Class EventarcClient

  • All Implemented Interfaces:
    com.google.api.gax.core.BackgroundResource, AutoCloseable

    @Generated("by gapic-generator-java")
    public class EventarcClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: Eventarc allows users to subscribe to various events that are provided by Google Cloud services and forward them to supported destinations.

    This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (EventarcClient eventarcClient = EventarcClient.create()) {
       TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]");
       Trigger response = eventarcClient.getTrigger(name);
     }
     

    Note: close() needs to be called on the EventarcClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

    The surface of this class includes several types of Java methods for each of the API's methods:

    1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
    2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
    3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

    See the individual methods for example code.

    Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

    This class can be customized by passing in a custom instance of EventarcSettings to create(). For example:

    To customize credentials:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     EventarcSettings eventarcSettings =
         EventarcSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
     

    To customize the endpoint:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     EventarcSettings eventarcSettings =
         EventarcSettings.newBuilder().setEndpoint(myEndpoint).build();
     EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
     

    To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     EventarcSettings eventarcSettings = EventarcSettings.newHttpJsonBuilder().build();
     EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
     

    Please refer to the GitHub repository's samples for more quickstart code snippets.

    • Constructor Detail

      • EventarcClient

        protected EventarcClient​(EventarcSettings settings)
                          throws IOException
        Constructs an instance of EventarcClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
        Throws:
        IOException
      • EventarcClient

        protected EventarcClient​(EventarcStub stub)
    • Method Detail

      • create

        public static final EventarcClient create​(EventarcSettings settings)
                                           throws IOException
        Constructs an instance of EventarcClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
        Throws:
        IOException
      • create

        public static final EventarcClient create​(EventarcStub stub)
        Constructs an instance of EventarcClient, using the given stub for making calls. This is for advanced usage - prefer using create(EventarcSettings).
      • getOperationsClient

        public final com.google.longrunning.OperationsClient getOperationsClient()
        Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
      • getHttpJsonOperationsClient

        @BetaApi
        public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
        Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
      • getTrigger

        public final Trigger getTrigger​(TriggerName name)
        Get a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]");
           Trigger response = eventarcClient.getTrigger(name);
         }
         
        Parameters:
        name - Required. The name of the trigger to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTrigger

        public final Trigger getTrigger​(String name)
        Get a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString();
           Trigger response = eventarcClient.getTrigger(name);
         }
         
        Parameters:
        name - Required. The name of the trigger to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTrigger

        public final Trigger getTrigger​(GetTriggerRequest request)
        Get a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetTriggerRequest request =
               GetTriggerRequest.newBuilder()
                   .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
                   .build();
           Trigger response = eventarcClient.getTrigger(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTriggerCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetTriggerRequest,​Trigger> getTriggerCallable()
        Get a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetTriggerRequest request =
               GetTriggerRequest.newBuilder()
                   .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
                   .build();
           ApiFuture<Trigger> future = eventarcClient.getTriggerCallable().futureCall(request);
           // Do something.
           Trigger response = future.get();
         }
         
      • listTriggers

        public final EventarcClient.ListTriggersPagedResponse listTriggers​(LocationName parent)
        List triggers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           for (Trigger element : eventarcClient.listTriggers(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent collection to list triggers on.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTriggers

        public final EventarcClient.ListTriggersPagedResponse listTriggers​(String parent)
        List triggers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
           for (Trigger element : eventarcClient.listTriggers(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent collection to list triggers on.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTriggers

        public final EventarcClient.ListTriggersPagedResponse listTriggers​(ListTriggersRequest request)
        List triggers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListTriggersRequest request =
               ListTriggersRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .setFilter("filter-1274492040")
                   .build();
           for (Trigger element : eventarcClient.listTriggers(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTriggersPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTriggersRequest,​EventarcClient.ListTriggersPagedResponse> listTriggersPagedCallable()
        List triggers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListTriggersRequest request =
               ListTriggersRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .setFilter("filter-1274492040")
                   .build();
           ApiFuture<Trigger> future = eventarcClient.listTriggersPagedCallable().futureCall(request);
           // Do something.
           for (Trigger element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listTriggersCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTriggersRequest,​ListTriggersResponse> listTriggersCallable()
        List triggers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListTriggersRequest request =
               ListTriggersRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .setFilter("filter-1274492040")
                   .build();
           while (true) {
             ListTriggersResponse response = eventarcClient.listTriggersCallable().call(request);
             for (Trigger element : response.getTriggersList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • createTriggerAsync

        public final com.google.api.gax.longrunning.OperationFuture<Trigger,​OperationMetadata> createTriggerAsync​(LocationName parent,
                                                                                                                        Trigger trigger,
                                                                                                                        String triggerId)
        Create a new trigger in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           Trigger trigger = Trigger.newBuilder().build();
           String triggerId = "triggerId-648752909";
           Trigger response = eventarcClient.createTriggerAsync(parent, trigger, triggerId).get();
         }
         
        Parameters:
        parent - Required. The parent collection in which to add this trigger.
        trigger - Required. The trigger to create.
        triggerId - Required. The user-provided ID to be assigned to the trigger.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTriggerAsync

        public final com.google.api.gax.longrunning.OperationFuture<Trigger,​OperationMetadata> createTriggerAsync​(String parent,
                                                                                                                        Trigger trigger,
                                                                                                                        String triggerId)
        Create a new trigger in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
           Trigger trigger = Trigger.newBuilder().build();
           String triggerId = "triggerId-648752909";
           Trigger response = eventarcClient.createTriggerAsync(parent, trigger, triggerId).get();
         }
         
        Parameters:
        parent - Required. The parent collection in which to add this trigger.
        trigger - Required. The trigger to create.
        triggerId - Required. The user-provided ID to be assigned to the trigger.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTriggerAsync

        public final com.google.api.gax.longrunning.OperationFuture<Trigger,​OperationMetadata> createTriggerAsync​(CreateTriggerRequest request)
        Create a new trigger in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateTriggerRequest request =
               CreateTriggerRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setTrigger(Trigger.newBuilder().build())
                   .setTriggerId("triggerId-648752909")
                   .setValidateOnly(true)
                   .build();
           Trigger response = eventarcClient.createTriggerAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTriggerOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<CreateTriggerRequest,​Trigger,​OperationMetadata> createTriggerOperationCallable()
        Create a new trigger in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateTriggerRequest request =
               CreateTriggerRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setTrigger(Trigger.newBuilder().build())
                   .setTriggerId("triggerId-648752909")
                   .setValidateOnly(true)
                   .build();
           OperationFuture<Trigger, OperationMetadata> future =
               eventarcClient.createTriggerOperationCallable().futureCall(request);
           // Do something.
           Trigger response = future.get();
         }
         
      • createTriggerCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateTriggerRequest,​com.google.longrunning.Operation> createTriggerCallable()
        Create a new trigger in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateTriggerRequest request =
               CreateTriggerRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setTrigger(Trigger.newBuilder().build())
                   .setTriggerId("triggerId-648752909")
                   .setValidateOnly(true)
                   .build();
           ApiFuture<Operation> future = eventarcClient.createTriggerCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • updateTriggerAsync

        public final com.google.api.gax.longrunning.OperationFuture<Trigger,​OperationMetadata> updateTriggerAsync​(Trigger trigger,
                                                                                                                        com.google.protobuf.FieldMask updateMask,
                                                                                                                        boolean allowMissing)
        Update a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           Trigger trigger = Trigger.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           boolean allowMissing = true;
           Trigger response = eventarcClient.updateTriggerAsync(trigger, updateMask, allowMissing).get();
         }
         
        Parameters:
        trigger - The trigger to be updated.
        updateMask - The fields to be updated; only fields explicitly provided are updated. If no field mask is provided, all provided fields in the request are updated. To update all fields, provide a field mask of "*".
        allowMissing - If set to true, and the trigger is not found, a new trigger will be created. In this situation, `update_mask` is ignored.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateTriggerAsync

        public final com.google.api.gax.longrunning.OperationFuture<Trigger,​OperationMetadata> updateTriggerAsync​(UpdateTriggerRequest request)
        Update a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           UpdateTriggerRequest request =
               UpdateTriggerRequest.newBuilder()
                   .setTrigger(Trigger.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setAllowMissing(true)
                   .setValidateOnly(true)
                   .build();
           Trigger response = eventarcClient.updateTriggerAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateTriggerOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<UpdateTriggerRequest,​Trigger,​OperationMetadata> updateTriggerOperationCallable()
        Update a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           UpdateTriggerRequest request =
               UpdateTriggerRequest.newBuilder()
                   .setTrigger(Trigger.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setAllowMissing(true)
                   .setValidateOnly(true)
                   .build();
           OperationFuture<Trigger, OperationMetadata> future =
               eventarcClient.updateTriggerOperationCallable().futureCall(request);
           // Do something.
           Trigger response = future.get();
         }
         
      • updateTriggerCallable

        public final com.google.api.gax.rpc.UnaryCallable<UpdateTriggerRequest,​com.google.longrunning.Operation> updateTriggerCallable()
        Update a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           UpdateTriggerRequest request =
               UpdateTriggerRequest.newBuilder()
                   .setTrigger(Trigger.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setAllowMissing(true)
                   .setValidateOnly(true)
                   .build();
           ApiFuture<Operation> future = eventarcClient.updateTriggerCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • deleteTriggerAsync

        public final com.google.api.gax.longrunning.OperationFuture<Trigger,​OperationMetadata> deleteTriggerAsync​(TriggerName name,
                                                                                                                        boolean allowMissing)
        Delete a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]");
           boolean allowMissing = true;
           Trigger response = eventarcClient.deleteTriggerAsync(name, allowMissing).get();
         }
         
        Parameters:
        name - Required. The name of the trigger to be deleted.
        allowMissing - If set to true, and the trigger is not found, the request will succeed but no action will be taken on the server.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTriggerAsync

        public final com.google.api.gax.longrunning.OperationFuture<Trigger,​OperationMetadata> deleteTriggerAsync​(String name,
                                                                                                                        boolean allowMissing)
        Delete a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString();
           boolean allowMissing = true;
           Trigger response = eventarcClient.deleteTriggerAsync(name, allowMissing).get();
         }
         
        Parameters:
        name - Required. The name of the trigger to be deleted.
        allowMissing - If set to true, and the trigger is not found, the request will succeed but no action will be taken on the server.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTriggerAsync

        public final com.google.api.gax.longrunning.OperationFuture<Trigger,​OperationMetadata> deleteTriggerAsync​(DeleteTriggerRequest request)
        Delete a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteTriggerRequest request =
               DeleteTriggerRequest.newBuilder()
                   .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
                   .setEtag("etag3123477")
                   .setAllowMissing(true)
                   .setValidateOnly(true)
                   .build();
           Trigger response = eventarcClient.deleteTriggerAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTriggerOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<DeleteTriggerRequest,​Trigger,​OperationMetadata> deleteTriggerOperationCallable()
        Delete a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteTriggerRequest request =
               DeleteTriggerRequest.newBuilder()
                   .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
                   .setEtag("etag3123477")
                   .setAllowMissing(true)
                   .setValidateOnly(true)
                   .build();
           OperationFuture<Trigger, OperationMetadata> future =
               eventarcClient.deleteTriggerOperationCallable().futureCall(request);
           // Do something.
           Trigger response = future.get();
         }
         
      • deleteTriggerCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteTriggerRequest,​com.google.longrunning.Operation> deleteTriggerCallable()
        Delete a single trigger.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteTriggerRequest request =
               DeleteTriggerRequest.newBuilder()
                   .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
                   .setEtag("etag3123477")
                   .setAllowMissing(true)
                   .setValidateOnly(true)
                   .build();
           ApiFuture<Operation> future = eventarcClient.deleteTriggerCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • getChannel

        public final Channel getChannel​(ChannelName name)
        Get a single Channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]");
           Channel response = eventarcClient.getChannel(name);
         }
         
        Parameters:
        name - Required. The name of the channel to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getChannel

        public final Channel getChannel​(String name)
        Get a single Channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString();
           Channel response = eventarcClient.getChannel(name);
         }
         
        Parameters:
        name - Required. The name of the channel to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getChannel

        public final Channel getChannel​(GetChannelRequest request)
        Get a single Channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetChannelRequest request =
               GetChannelRequest.newBuilder()
                   .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .build();
           Channel response = eventarcClient.getChannel(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getChannelCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetChannelRequest,​Channel> getChannelCallable()
        Get a single Channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetChannelRequest request =
               GetChannelRequest.newBuilder()
                   .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .build();
           ApiFuture<Channel> future = eventarcClient.getChannelCallable().futureCall(request);
           // Do something.
           Channel response = future.get();
         }
         
      • listChannels

        public final EventarcClient.ListChannelsPagedResponse listChannels​(LocationName parent)
        List channels.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           for (Channel element : eventarcClient.listChannels(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent collection to list channels on.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listChannels

        public final EventarcClient.ListChannelsPagedResponse listChannels​(String parent)
        List channels.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
           for (Channel element : eventarcClient.listChannels(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent collection to list channels on.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listChannels

        public final EventarcClient.ListChannelsPagedResponse listChannels​(ListChannelsRequest request)
        List channels.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListChannelsRequest request =
               ListChannelsRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .build();
           for (Channel element : eventarcClient.listChannels(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listChannelsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListChannelsRequest,​EventarcClient.ListChannelsPagedResponse> listChannelsPagedCallable()
        List channels.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListChannelsRequest request =
               ListChannelsRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .build();
           ApiFuture<Channel> future = eventarcClient.listChannelsPagedCallable().futureCall(request);
           // Do something.
           for (Channel element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listChannelsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListChannelsRequest,​ListChannelsResponse> listChannelsCallable()
        List channels.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListChannelsRequest request =
               ListChannelsRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .build();
           while (true) {
             ListChannelsResponse response = eventarcClient.listChannelsCallable().call(request);
             for (Channel element : response.getChannelsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • createChannelAsync

        public final com.google.api.gax.longrunning.OperationFuture<Channel,​OperationMetadata> createChannelAsync​(LocationName parent,
                                                                                                                        Channel channel,
                                                                                                                        String channelId)
        Create a new channel in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           Channel channel = Channel.newBuilder().build();
           String channelId = "channelId1461735806";
           Channel response = eventarcClient.createChannelAsync(parent, channel, channelId).get();
         }
         
        Parameters:
        parent - Required. The parent collection in which to add this channel.
        channel - Required. The channel to create.
        channelId - Required. The user-provided ID to be assigned to the channel.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createChannelAsync

        public final com.google.api.gax.longrunning.OperationFuture<Channel,​OperationMetadata> createChannelAsync​(String parent,
                                                                                                                        Channel channel,
                                                                                                                        String channelId)
        Create a new channel in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
           Channel channel = Channel.newBuilder().build();
           String channelId = "channelId1461735806";
           Channel response = eventarcClient.createChannelAsync(parent, channel, channelId).get();
         }
         
        Parameters:
        parent - Required. The parent collection in which to add this channel.
        channel - Required. The channel to create.
        channelId - Required. The user-provided ID to be assigned to the channel.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createChannelAsync

        public final com.google.api.gax.longrunning.OperationFuture<Channel,​OperationMetadata> createChannelAsync​(CreateChannelRequest request)
        Create a new channel in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateChannelRequest request =
               CreateChannelRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setChannel(Channel.newBuilder().build())
                   .setChannelId("channelId1461735806")
                   .setValidateOnly(true)
                   .build();
           Channel response = eventarcClient.createChannelAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createChannelOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<CreateChannelRequest,​Channel,​OperationMetadata> createChannelOperationCallable()
        Create a new channel in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateChannelRequest request =
               CreateChannelRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setChannel(Channel.newBuilder().build())
                   .setChannelId("channelId1461735806")
                   .setValidateOnly(true)
                   .build();
           OperationFuture<Channel, OperationMetadata> future =
               eventarcClient.createChannelOperationCallable().futureCall(request);
           // Do something.
           Channel response = future.get();
         }
         
      • createChannelCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateChannelRequest,​com.google.longrunning.Operation> createChannelCallable()
        Create a new channel in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateChannelRequest request =
               CreateChannelRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setChannel(Channel.newBuilder().build())
                   .setChannelId("channelId1461735806")
                   .setValidateOnly(true)
                   .build();
           ApiFuture<Operation> future = eventarcClient.createChannelCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • updateChannelAsync

        public final com.google.api.gax.longrunning.OperationFuture<Channel,​OperationMetadata> updateChannelAsync​(Channel channel,
                                                                                                                        com.google.protobuf.FieldMask updateMask)
        Update a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           Channel channel = Channel.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           Channel response = eventarcClient.updateChannelAsync(channel, updateMask).get();
         }
         
        Parameters:
        channel - The channel to be updated.
        updateMask - The fields to be updated; only fields explicitly provided are updated. If no field mask is provided, all provided fields in the request are updated. To update all fields, provide a field mask of "*".
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateChannelAsync

        public final com.google.api.gax.longrunning.OperationFuture<Channel,​OperationMetadata> updateChannelAsync​(UpdateChannelRequest request)
        Update a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           UpdateChannelRequest request =
               UpdateChannelRequest.newBuilder()
                   .setChannel(Channel.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           Channel response = eventarcClient.updateChannelAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateChannelOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<UpdateChannelRequest,​Channel,​OperationMetadata> updateChannelOperationCallable()
        Update a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           UpdateChannelRequest request =
               UpdateChannelRequest.newBuilder()
                   .setChannel(Channel.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           OperationFuture<Channel, OperationMetadata> future =
               eventarcClient.updateChannelOperationCallable().futureCall(request);
           // Do something.
           Channel response = future.get();
         }
         
      • updateChannelCallable

        public final com.google.api.gax.rpc.UnaryCallable<UpdateChannelRequest,​com.google.longrunning.Operation> updateChannelCallable()
        Update a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           UpdateChannelRequest request =
               UpdateChannelRequest.newBuilder()
                   .setChannel(Channel.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           ApiFuture<Operation> future = eventarcClient.updateChannelCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • deleteChannelAsync

        public final com.google.api.gax.longrunning.OperationFuture<Channel,​OperationMetadata> deleteChannelAsync​(ChannelName name)
        Delete a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]");
           Channel response = eventarcClient.deleteChannelAsync(name).get();
         }
         
        Parameters:
        name - Required. The name of the channel to be deleted.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteChannelAsync

        public final com.google.api.gax.longrunning.OperationFuture<Channel,​OperationMetadata> deleteChannelAsync​(String name)
        Delete a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString();
           Channel response = eventarcClient.deleteChannelAsync(name).get();
         }
         
        Parameters:
        name - Required. The name of the channel to be deleted.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteChannelAsync

        public final com.google.api.gax.longrunning.OperationFuture<Channel,​OperationMetadata> deleteChannelAsync​(DeleteChannelRequest request)
        Delete a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteChannelRequest request =
               DeleteChannelRequest.newBuilder()
                   .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .setValidateOnly(true)
                   .build();
           Channel response = eventarcClient.deleteChannelAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteChannelOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<DeleteChannelRequest,​Channel,​OperationMetadata> deleteChannelOperationCallable()
        Delete a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteChannelRequest request =
               DeleteChannelRequest.newBuilder()
                   .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .setValidateOnly(true)
                   .build();
           OperationFuture<Channel, OperationMetadata> future =
               eventarcClient.deleteChannelOperationCallable().futureCall(request);
           // Do something.
           Channel response = future.get();
         }
         
      • deleteChannelCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteChannelRequest,​com.google.longrunning.Operation> deleteChannelCallable()
        Delete a single channel.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteChannelRequest request =
               DeleteChannelRequest.newBuilder()
                   .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .setValidateOnly(true)
                   .build();
           ApiFuture<Operation> future = eventarcClient.deleteChannelCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • getProvider

        public final Provider getProvider​(ProviderName name)
        Get a single Provider.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]");
           Provider response = eventarcClient.getProvider(name);
         }
         
        Parameters:
        name - Required. The name of the provider to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getProvider

        public final Provider getProvider​(String name)
        Get a single Provider.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString();
           Provider response = eventarcClient.getProvider(name);
         }
         
        Parameters:
        name - Required. The name of the provider to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getProvider

        public final Provider getProvider​(GetProviderRequest request)
        Get a single Provider.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetProviderRequest request =
               GetProviderRequest.newBuilder()
                   .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString())
                   .build();
           Provider response = eventarcClient.getProvider(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getProviderCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetProviderRequest,​Provider> getProviderCallable()
        Get a single Provider.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetProviderRequest request =
               GetProviderRequest.newBuilder()
                   .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString())
                   .build();
           ApiFuture<Provider> future = eventarcClient.getProviderCallable().futureCall(request);
           // Do something.
           Provider response = future.get();
         }
         
      • listProviders

        public final EventarcClient.ListProvidersPagedResponse listProviders​(LocationName parent)
        List providers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           for (Provider element : eventarcClient.listProviders(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent of the provider to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listProviders

        public final EventarcClient.ListProvidersPagedResponse listProviders​(String parent)
        List providers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
           for (Provider element : eventarcClient.listProviders(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent of the provider to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listProviders

        public final EventarcClient.ListProvidersPagedResponse listProviders​(ListProvidersRequest request)
        List providers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListProvidersRequest request =
               ListProvidersRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .setFilter("filter-1274492040")
                   .build();
           for (Provider element : eventarcClient.listProviders(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listProvidersPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListProvidersRequest,​EventarcClient.ListProvidersPagedResponse> listProvidersPagedCallable()
        List providers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListProvidersRequest request =
               ListProvidersRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .setFilter("filter-1274492040")
                   .build();
           ApiFuture<Provider> future = eventarcClient.listProvidersPagedCallable().futureCall(request);
           // Do something.
           for (Provider element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listProvidersCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListProvidersRequest,​ListProvidersResponse> listProvidersCallable()
        List providers.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListProvidersRequest request =
               ListProvidersRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setOrderBy("orderBy-1207110587")
                   .setFilter("filter-1274492040")
                   .build();
           while (true) {
             ListProvidersResponse response = eventarcClient.listProvidersCallable().call(request);
             for (Provider element : response.getProvidersList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • getChannelConnection

        public final ChannelConnection getChannelConnection​(ChannelConnectionName name)
        Get a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ChannelConnectionName name =
               ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]");
           ChannelConnection response = eventarcClient.getChannelConnection(name);
         }
         
        Parameters:
        name - Required. The name of the channel connection to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getChannelConnection

        public final ChannelConnection getChannelConnection​(String name)
        Get a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String name =
               ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]").toString();
           ChannelConnection response = eventarcClient.getChannelConnection(name);
         }
         
        Parameters:
        name - Required. The name of the channel connection to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getChannelConnection

        public final ChannelConnection getChannelConnection​(GetChannelConnectionRequest request)
        Get a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetChannelConnectionRequest request =
               GetChannelConnectionRequest.newBuilder()
                   .setName(
                       ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
                           .toString())
                   .build();
           ChannelConnection response = eventarcClient.getChannelConnection(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getChannelConnectionCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetChannelConnectionRequest,​ChannelConnection> getChannelConnectionCallable()
        Get a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetChannelConnectionRequest request =
               GetChannelConnectionRequest.newBuilder()
                   .setName(
                       ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
                           .toString())
                   .build();
           ApiFuture<ChannelConnection> future =
               eventarcClient.getChannelConnectionCallable().futureCall(request);
           // Do something.
           ChannelConnection response = future.get();
         }
         
      • listChannelConnections

        public final EventarcClient.ListChannelConnectionsPagedResponse listChannelConnections​(LocationName parent)
        List channel connections.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           for (ChannelConnection element : eventarcClient.listChannelConnections(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent collection from which to list channel connections.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listChannelConnections

        public final EventarcClient.ListChannelConnectionsPagedResponse listChannelConnections​(String parent)
        List channel connections.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
           for (ChannelConnection element : eventarcClient.listChannelConnections(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent collection from which to list channel connections.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listChannelConnections

        public final EventarcClient.ListChannelConnectionsPagedResponse listChannelConnections​(ListChannelConnectionsRequest request)
        List channel connections.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListChannelConnectionsRequest request =
               ListChannelConnectionsRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (ChannelConnection element :
               eventarcClient.listChannelConnections(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listChannelConnectionsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListChannelConnectionsRequest,​EventarcClient.ListChannelConnectionsPagedResponse> listChannelConnectionsPagedCallable()
        List channel connections.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListChannelConnectionsRequest request =
               ListChannelConnectionsRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<ChannelConnection> future =
               eventarcClient.listChannelConnectionsPagedCallable().futureCall(request);
           // Do something.
           for (ChannelConnection element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listChannelConnectionsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListChannelConnectionsRequest,​ListChannelConnectionsResponse> listChannelConnectionsCallable()
        List channel connections.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListChannelConnectionsRequest request =
               ListChannelConnectionsRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListChannelConnectionsResponse response =
                 eventarcClient.listChannelConnectionsCallable().call(request);
             for (ChannelConnection element : response.getChannelConnectionsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • createChannelConnectionAsync

        public final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,​OperationMetadata> createChannelConnectionAsync​(LocationName parent,
                                                                                                                                            ChannelConnection channelConnection,
                                                                                                                                            String channelConnectionId)
        Create a new ChannelConnection in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           ChannelConnection channelConnection = ChannelConnection.newBuilder().build();
           String channelConnectionId = "channelConnectionId-1246974660";
           ChannelConnection response =
               eventarcClient
                   .createChannelConnectionAsync(parent, channelConnection, channelConnectionId)
                   .get();
         }
         
        Parameters:
        parent - Required. The parent collection in which to add this channel connection.
        channelConnection - Required. Channel connection to create.
        channelConnectionId - Required. The user-provided ID to be assigned to the channel connection.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createChannelConnectionAsync

        public final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,​OperationMetadata> createChannelConnectionAsync​(String parent,
                                                                                                                                            ChannelConnection channelConnection,
                                                                                                                                            String channelConnectionId)
        Create a new ChannelConnection in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
           ChannelConnection channelConnection = ChannelConnection.newBuilder().build();
           String channelConnectionId = "channelConnectionId-1246974660";
           ChannelConnection response =
               eventarcClient
                   .createChannelConnectionAsync(parent, channelConnection, channelConnectionId)
                   .get();
         }
         
        Parameters:
        parent - Required. The parent collection in which to add this channel connection.
        channelConnection - Required. Channel connection to create.
        channelConnectionId - Required. The user-provided ID to be assigned to the channel connection.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createChannelConnectionAsync

        public final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,​OperationMetadata> createChannelConnectionAsync​(CreateChannelConnectionRequest request)
        Create a new ChannelConnection in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateChannelConnectionRequest request =
               CreateChannelConnectionRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setChannelConnection(ChannelConnection.newBuilder().build())
                   .setChannelConnectionId("channelConnectionId-1246974660")
                   .build();
           ChannelConnection response = eventarcClient.createChannelConnectionAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createChannelConnectionOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<CreateChannelConnectionRequest,​ChannelConnection,​OperationMetadata> createChannelConnectionOperationCallable()
        Create a new ChannelConnection in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateChannelConnectionRequest request =
               CreateChannelConnectionRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setChannelConnection(ChannelConnection.newBuilder().build())
                   .setChannelConnectionId("channelConnectionId-1246974660")
                   .build();
           OperationFuture<ChannelConnection, OperationMetadata> future =
               eventarcClient.createChannelConnectionOperationCallable().futureCall(request);
           // Do something.
           ChannelConnection response = future.get();
         }
         
      • createChannelConnectionCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateChannelConnectionRequest,​com.google.longrunning.Operation> createChannelConnectionCallable()
        Create a new ChannelConnection in a particular project and location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           CreateChannelConnectionRequest request =
               CreateChannelConnectionRequest.newBuilder()
                   .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                   .setChannelConnection(ChannelConnection.newBuilder().build())
                   .setChannelConnectionId("channelConnectionId-1246974660")
                   .build();
           ApiFuture<Operation> future =
               eventarcClient.createChannelConnectionCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • deleteChannelConnectionAsync

        public final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,​OperationMetadata> deleteChannelConnectionAsync​(ChannelConnectionName name)
        Delete a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ChannelConnectionName name =
               ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]");
           ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(name).get();
         }
         
        Parameters:
        name - Required. The name of the channel connection to delete.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteChannelConnectionAsync

        public final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,​OperationMetadata> deleteChannelConnectionAsync​(String name)
        Delete a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String name =
               ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]").toString();
           ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(name).get();
         }
         
        Parameters:
        name - Required. The name of the channel connection to delete.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteChannelConnectionAsync

        public final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,​OperationMetadata> deleteChannelConnectionAsync​(DeleteChannelConnectionRequest request)
        Delete a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteChannelConnectionRequest request =
               DeleteChannelConnectionRequest.newBuilder()
                   .setName(
                       ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
                           .toString())
                   .build();
           ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteChannelConnectionOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<DeleteChannelConnectionRequest,​ChannelConnection,​OperationMetadata> deleteChannelConnectionOperationCallable()
        Delete a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteChannelConnectionRequest request =
               DeleteChannelConnectionRequest.newBuilder()
                   .setName(
                       ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
                           .toString())
                   .build();
           OperationFuture<ChannelConnection, OperationMetadata> future =
               eventarcClient.deleteChannelConnectionOperationCallable().futureCall(request);
           // Do something.
           ChannelConnection response = future.get();
         }
         
      • deleteChannelConnectionCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteChannelConnectionRequest,​com.google.longrunning.Operation> deleteChannelConnectionCallable()
        Delete a single ChannelConnection.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           DeleteChannelConnectionRequest request =
               DeleteChannelConnectionRequest.newBuilder()
                   .setName(
                       ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
                           .toString())
                   .build();
           ApiFuture<Operation> future =
               eventarcClient.deleteChannelConnectionCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • getGoogleChannelConfig

        public final GoogleChannelConfig getGoogleChannelConfig​(GoogleChannelConfigName name)
        Get a GoogleChannelConfig

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GoogleChannelConfigName name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]");
           GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(name);
         }
         
        Parameters:
        name - Required. The name of the config to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getGoogleChannelConfig

        public final GoogleChannelConfig getGoogleChannelConfig​(String name)
        Get a GoogleChannelConfig

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           String name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString();
           GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(name);
         }
         
        Parameters:
        name - Required. The name of the config to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getGoogleChannelConfig

        public final GoogleChannelConfig getGoogleChannelConfig​(GetGoogleChannelConfigRequest request)
        Get a GoogleChannelConfig

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetGoogleChannelConfigRequest request =
               GetGoogleChannelConfigRequest.newBuilder()
                   .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString())
                   .build();
           GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getGoogleChannelConfigCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetGoogleChannelConfigRequest,​GoogleChannelConfig> getGoogleChannelConfigCallable()
        Get a GoogleChannelConfig

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetGoogleChannelConfigRequest request =
               GetGoogleChannelConfigRequest.newBuilder()
                   .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString())
                   .build();
           ApiFuture<GoogleChannelConfig> future =
               eventarcClient.getGoogleChannelConfigCallable().futureCall(request);
           // Do something.
           GoogleChannelConfig response = future.get();
         }
         
      • updateGoogleChannelConfig

        public final GoogleChannelConfig updateGoogleChannelConfig​(GoogleChannelConfig googleChannelConfig,
                                                                   com.google.protobuf.FieldMask updateMask)
        Update a single GoogleChannelConfig

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GoogleChannelConfig googleChannelConfig = GoogleChannelConfig.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           GoogleChannelConfig response =
               eventarcClient.updateGoogleChannelConfig(googleChannelConfig, updateMask);
         }
         
        Parameters:
        googleChannelConfig - Required. The config to be updated.
        updateMask - The fields to be updated; only fields explicitly provided are updated. If no field mask is provided, all provided fields in the request are updated. To update all fields, provide a field mask of "*".
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateGoogleChannelConfig

        public final GoogleChannelConfig updateGoogleChannelConfig​(UpdateGoogleChannelConfigRequest request)
        Update a single GoogleChannelConfig

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           UpdateGoogleChannelConfigRequest request =
               UpdateGoogleChannelConfigRequest.newBuilder()
                   .setGoogleChannelConfig(GoogleChannelConfig.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           GoogleChannelConfig response = eventarcClient.updateGoogleChannelConfig(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateGoogleChannelConfigCallable

        public final com.google.api.gax.rpc.UnaryCallable<UpdateGoogleChannelConfigRequest,​GoogleChannelConfig> updateGoogleChannelConfigCallable()
        Update a single GoogleChannelConfig

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           UpdateGoogleChannelConfigRequest request =
               UpdateGoogleChannelConfigRequest.newBuilder()
                   .setGoogleChannelConfig(GoogleChannelConfig.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           ApiFuture<GoogleChannelConfig> future =
               eventarcClient.updateGoogleChannelConfigCallable().futureCall(request);
           // Do something.
           GoogleChannelConfig response = future.get();
         }
         
      • listLocations

        public final EventarcClient.ListLocationsPagedResponse listLocations​(com.google.cloud.location.ListLocationsRequest request)
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (Location element : eventarcClient.listLocations(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listLocationsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,​EventarcClient.ListLocationsPagedResponse> listLocationsPagedCallable()
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<Location> future = eventarcClient.listLocationsPagedCallable().futureCall(request);
           // Do something.
           for (Location element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listLocationsCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,​com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListLocationsResponse response = eventarcClient.listLocationsCallable().call(request);
             for (Location element : response.getLocationsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • getLocation

        public final com.google.cloud.location.Location getLocation​(com.google.cloud.location.GetLocationRequest request)
        Gets information about a location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
           Location response = eventarcClient.getLocation(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getLocationCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,​com.google.cloud.location.Location> getLocationCallable()
        Gets information about a location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
           ApiFuture<Location> future = eventarcClient.getLocationCallable().futureCall(request);
           // Do something.
           Location response = future.get();
         }
         
      • setIamPolicy

        public final com.google.iam.v1.Policy setIamPolicy​(com.google.iam.v1.SetIamPolicyRequest request)
        Sets the access control policy on the specified resource. Replacesany existing policy.

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           SetIamPolicyRequest request =
               SetIamPolicyRequest.newBuilder()
                   .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .setPolicy(Policy.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           Policy response = eventarcClient.setIamPolicy(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setIamPolicyCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,​com.google.iam.v1.Policy> setIamPolicyCallable()
        Sets the access control policy on the specified resource. Replacesany existing policy.

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           SetIamPolicyRequest request =
               SetIamPolicyRequest.newBuilder()
                   .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .setPolicy(Policy.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           ApiFuture<Policy> future = eventarcClient.setIamPolicyCallable().futureCall(request);
           // Do something.
           Policy response = future.get();
         }
         
      • getIamPolicy

        public final com.google.iam.v1.Policy getIamPolicy​(com.google.iam.v1.GetIamPolicyRequest request)
        Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetIamPolicyRequest request =
               GetIamPolicyRequest.newBuilder()
                   .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .setOptions(GetPolicyOptions.newBuilder().build())
                   .build();
           Policy response = eventarcClient.getIamPolicy(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIamPolicyCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,​com.google.iam.v1.Policy> getIamPolicyCallable()
        Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           GetIamPolicyRequest request =
               GetIamPolicyRequest.newBuilder()
                   .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .setOptions(GetPolicyOptions.newBuilder().build())
                   .build();
           ApiFuture<Policy> future = eventarcClient.getIamPolicyCallable().futureCall(request);
           // Do something.
           Policy response = future.get();
         }
         
      • testIamPermissions

        public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions​(com.google.iam.v1.TestIamPermissionsRequest request)
        Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

        Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           TestIamPermissionsRequest request =
               TestIamPermissionsRequest.newBuilder()
                   .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .addAllPermissions(new ArrayList<String>())
                   .build();
           TestIamPermissionsResponse response = eventarcClient.testIamPermissions(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • testIamPermissionsCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,​com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
        Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

        Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (EventarcClient eventarcClient = EventarcClient.create()) {
           TestIamPermissionsRequest request =
               TestIamPermissionsRequest.newBuilder()
                   .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
                   .addAllPermissions(new ArrayList<String>())
                   .build();
           ApiFuture<TestIamPermissionsResponse> future =
               eventarcClient.testIamPermissionsCallable().futureCall(request);
           // Do something.
           TestIamPermissionsResponse response = future.get();
         }
         
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.google.api.gax.core.BackgroundResource
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface com.google.api.gax.core.BackgroundResource
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface com.google.api.gax.core.BackgroundResource
      • shutdownNow

        public void shutdownNow()
        Specified by:
        shutdownNow in interface com.google.api.gax.core.BackgroundResource