def sample_create_trigger():
    # Create a client
    client = eventarc_v1.EventarcClient()

    # Initialize request argument(s)
    trigger = eventarc_v1.Trigger()
    trigger.name = "name_value"
    trigger.event_filters.attribute = "attribute_value"
    trigger.event_filters.value = "value_value"
    trigger.destination.cloud_run.service = "service_value"
    trigger.destination.cloud_run.region = "region_value"

    request = eventarc_v1.CreateTriggerRequest(
        parent="parent_value",
        trigger=trigger,
        trigger_id="trigger_id_value",
        validate_only=True,
    )

    # Make the request
    operation = client.create_trigger(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Example #2
0
def sample_get_trigger():
    # Create a client
    client = eventarc_v1.EventarcClient()

    # Initialize request argument(s)
    request = eventarc_v1.GetTriggerRequest(name="name_value", )

    # Make the request
    response = client.get_trigger(request=request)

    # Handle the response
    print(response)
Example #3
0
def sample_list_triggers():
    # Create a client
    client = eventarc_v1.EventarcClient()

    # Initialize request argument(s)
    request = eventarc_v1.ListTriggersRequest(parent="parent_value", )

    # Make the request
    page_result = client.list_triggers(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Example #4
0
def sample_update_trigger():
    # Create a client
    client = eventarc_v1.EventarcClient()

    # Initialize request argument(s)
    request = eventarc_v1.UpdateTriggerRequest(validate_only=True, )

    # Make the request
    operation = client.update_trigger(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)