All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.eventarc.v1.EventarcClient Maven / Gradle / Ivy

Go to download

Eventarc lets you asynchronously deliver events from Google services, SaaS, and your own apps using loosely coupled services that react to state changes.

There is a newer version: 1.54.0
Show newest version
/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.eventarc.v1;

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.eventarc.v1.stub.EventarcStub;
import com.google.cloud.eventarc.v1.stub.EventarcStubSettings;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * 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: * *

{@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);
 * }
 * }
* *

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(). * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Methods
MethodDescriptionMethod Variants

GetTrigger

Get a single trigger.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getTrigger(GetTriggerRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getTrigger(TriggerName name) *

  • getTrigger(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getTriggerCallable() *

*

ListTriggers

List triggers.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listTriggers(ListTriggersRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listTriggers(LocationName parent) *

  • listTriggers(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • listTriggersPagedCallable() *

  • listTriggersCallable() *

*

CreateTrigger

Create a new trigger in a particular project and location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • createTriggerAsync(CreateTriggerRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • createTriggerAsync(LocationName parent, Trigger trigger, String triggerId) *

  • createTriggerAsync(String parent, Trigger trigger, String triggerId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • createTriggerOperationCallable() *

  • createTriggerCallable() *

*

UpdateTrigger

Update a single trigger.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • updateTriggerAsync(UpdateTriggerRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • updateTriggerAsync(Trigger trigger, FieldMask updateMask, boolean allowMissing) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • updateTriggerOperationCallable() *

  • updateTriggerCallable() *

*

DeleteTrigger

Delete a single trigger.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • deleteTriggerAsync(DeleteTriggerRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • deleteTriggerAsync(TriggerName name, boolean allowMissing) *

  • deleteTriggerAsync(String name, boolean allowMissing) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • deleteTriggerOperationCallable() *

  • deleteTriggerCallable() *

*

GetChannel

Get a single Channel.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getChannel(GetChannelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getChannel(ChannelName name) *

  • getChannel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getChannelCallable() *

*

ListChannels

List channels.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listChannels(ListChannelsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listChannels(LocationName parent) *

  • listChannels(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • listChannelsPagedCallable() *

  • listChannelsCallable() *

*

CreateChannel

Create a new channel in a particular project and location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • createChannelAsync(CreateChannelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • createChannelAsync(LocationName parent, Channel channel, String channelId) *

  • createChannelAsync(String parent, Channel channel, String channelId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • createChannelOperationCallable() *

  • createChannelCallable() *

*

UpdateChannel

Update a single channel.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • updateChannelAsync(UpdateChannelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • updateChannelAsync(Channel channel, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • updateChannelOperationCallable() *

  • updateChannelCallable() *

*

DeleteChannel

Delete a single channel.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • deleteChannelAsync(DeleteChannelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • deleteChannelAsync(ChannelName name) *

  • deleteChannelAsync(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • deleteChannelOperationCallable() *

  • deleteChannelCallable() *

*

GetProvider

Get a single Provider.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getProvider(GetProviderRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getProvider(ProviderName name) *

  • getProvider(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getProviderCallable() *

*

ListProviders

List providers.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listProviders(ListProvidersRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listProviders(LocationName parent) *

  • listProviders(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • listProvidersPagedCallable() *

  • listProvidersCallable() *

*

GetChannelConnection

Get a single ChannelConnection.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getChannelConnection(GetChannelConnectionRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getChannelConnection(ChannelConnectionName name) *

  • getChannelConnection(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getChannelConnectionCallable() *

*

ListChannelConnections

List channel connections.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listChannelConnections(ListChannelConnectionsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listChannelConnections(LocationName parent) *

  • listChannelConnections(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • listChannelConnectionsPagedCallable() *

  • listChannelConnectionsCallable() *

*

CreateChannelConnection

Create a new ChannelConnection in a particular project and location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • createChannelConnectionAsync(CreateChannelConnectionRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • createChannelConnectionAsync(LocationName parent, ChannelConnection channelConnection, String channelConnectionId) *

  • createChannelConnectionAsync(String parent, ChannelConnection channelConnection, String channelConnectionId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • createChannelConnectionOperationCallable() *

  • createChannelConnectionCallable() *

*

DeleteChannelConnection

Delete a single ChannelConnection.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • deleteChannelConnectionAsync(DeleteChannelConnectionRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • deleteChannelConnectionAsync(ChannelConnectionName name) *

  • deleteChannelConnectionAsync(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • deleteChannelConnectionOperationCallable() *

  • deleteChannelConnectionCallable() *

*

GetGoogleChannelConfig

Get a GoogleChannelConfig

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getGoogleChannelConfig(GetGoogleChannelConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getGoogleChannelConfig(GoogleChannelConfigName name) *

  • getGoogleChannelConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getGoogleChannelConfigCallable() *

*

UpdateGoogleChannelConfig

Update a single GoogleChannelConfig

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • updateGoogleChannelConfig(UpdateGoogleChannelConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • updateGoogleChannelConfig(GoogleChannelConfig googleChannelConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • updateGoogleChannelConfigCallable() *

*

ListLocations

Lists information about the supported locations for this service.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listLocations(ListLocationsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • listLocationsPagedCallable() *

  • listLocationsCallable() *

*

GetLocation

Gets information about a location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getLocation(GetLocationRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getLocationCallable() *

*

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy. *

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

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • setIamPolicy(SetIamPolicyRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • setIamPolicyCallable() *

*

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getIamPolicy(GetIamPolicyRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getIamPolicyCallable() *

*

TestIamPermissions

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.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • testIamPermissions(TestIamPermissionsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • testIamPermissionsCallable() *

*
* *

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: * *

{@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
 * EventarcSettings eventarcSettings =
 *     EventarcSettings.newBuilder()
 *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
 *         .build();
 * EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
 * }
* *

To customize the endpoint: * *

{@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
 * 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: * *

{@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
 * EventarcSettings eventarcSettings = EventarcSettings.newHttpJsonBuilder().build();
 * EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
 * }
* *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class EventarcClient implements BackgroundResource { private final EventarcSettings settings; private final EventarcStub stub; private final OperationsClient httpJsonOperationsClient; private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of EventarcClient with default settings. */ public static final EventarcClient create() throws IOException { return create(EventarcSettings.newBuilder().build()); } /** * 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. */ public static final EventarcClient create(EventarcSettings settings) throws IOException { return new EventarcClient(settings); } /** * Constructs an instance of EventarcClient, using the given stub for making calls. This is for * advanced usage - prefer using create(EventarcSettings). */ public static final EventarcClient create(EventarcStub stub) { return new EventarcClient(stub); } /** * 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. */ protected EventarcClient(EventarcSettings settings) throws IOException { this.settings = settings; this.stub = ((EventarcStubSettings) settings.getStubSettings()).createStub(); this.operationsClient = com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } protected EventarcClient(EventarcStub stub) { this.settings = null; this.stub = stub; this.operationsClient = com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final EventarcSettings getSettings() { return settings; } public EventarcStub getStub() { return stub; } /** * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } /** * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ @BetaApi public final OperationsClient getHttpJsonOperationsClient() { return httpJsonOperationsClient; } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single trigger. * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the trigger to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Trigger getTrigger(TriggerName name) { GetTriggerRequest request = GetTriggerRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getTrigger(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single trigger. * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the trigger to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Trigger getTrigger(String name) { GetTriggerRequest request = GetTriggerRequest.newBuilder().setName(name).build(); return getTrigger(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single trigger. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final Trigger getTrigger(GetTriggerRequest request) { return getTriggerCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single trigger. * *

Sample code: * *

{@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 future = eventarcClient.getTriggerCallable().futureCall(request);
   *   // Do something.
   *   Trigger response = future.get();
   * }
   * }
*/ public final UnaryCallable getTriggerCallable() { return stub.getTriggerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List triggers. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param parent Required. The parent collection to list triggers on. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListTriggersPagedResponse listTriggers(LocationName parent) { ListTriggersRequest request = ListTriggersRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listTriggers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List triggers. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param parent Required. The parent collection to list triggers on. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListTriggersPagedResponse listTriggers(String parent) { ListTriggersRequest request = ListTriggersRequest.newBuilder().setParent(parent).build(); return listTriggers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List triggers. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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 */ public final ListTriggersPagedResponse listTriggers(ListTriggersRequest request) { return listTriggersPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List triggers. * *

Sample code: * *

{@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 future = eventarcClient.listTriggersPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Trigger element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listTriggersPagedCallable() { return stub.listTriggersPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List triggers. * *

Sample code: * *

{@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;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listTriggersCallable() { return stub.listTriggersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new trigger in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param parent Required. The parent collection in which to add this trigger. * @param trigger Required. The trigger to create. * @param triggerId Required. The user-provided ID to be assigned to the trigger. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createTriggerAsync( LocationName parent, Trigger trigger, String triggerId) { CreateTriggerRequest request = CreateTriggerRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setTrigger(trigger) .setTriggerId(triggerId) .build(); return createTriggerAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new trigger in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param parent Required. The parent collection in which to add this trigger. * @param trigger Required. The trigger to create. * @param triggerId Required. The user-provided ID to be assigned to the trigger. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createTriggerAsync( String parent, Trigger trigger, String triggerId) { CreateTriggerRequest request = CreateTriggerRequest.newBuilder() .setParent(parent) .setTrigger(trigger) .setTriggerId(triggerId) .build(); return createTriggerAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new trigger in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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 */ public final OperationFuture createTriggerAsync( CreateTriggerRequest request) { return createTriggerOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new trigger in a particular project and location. * *

Sample code: * *

{@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 future =
   *       eventarcClient.createTriggerOperationCallable().futureCall(request);
   *   // Do something.
   *   Trigger response = future.get();
   * }
   * }
*/ public final OperationCallable createTriggerOperationCallable() { return stub.createTriggerOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new trigger in a particular project and location. * *

Sample code: * *

{@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 future = eventarcClient.createTriggerCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable createTriggerCallable() { return stub.createTriggerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single trigger. * *

Sample code: * *

{@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();
   * }
   * }
* * @param trigger The trigger to be updated. * @param 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 "*". * @param 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 */ public final OperationFuture updateTriggerAsync( Trigger trigger, FieldMask updateMask, boolean allowMissing) { UpdateTriggerRequest request = UpdateTriggerRequest.newBuilder() .setTrigger(trigger) .setUpdateMask(updateMask) .setAllowMissing(allowMissing) .build(); return updateTriggerAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single trigger. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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 */ public final OperationFuture updateTriggerAsync( UpdateTriggerRequest request) { return updateTriggerOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single trigger. * *

Sample code: * *

{@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 future =
   *       eventarcClient.updateTriggerOperationCallable().futureCall(request);
   *   // Do something.
   *   Trigger response = future.get();
   * }
   * }
*/ public final OperationCallable updateTriggerOperationCallable() { return stub.updateTriggerOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single trigger. * *

Sample code: * *

{@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 future = eventarcClient.updateTriggerCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable updateTriggerCallable() { return stub.updateTriggerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single trigger. * *

Sample code: * *

{@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();
   * }
   * }
* * @param name Required. The name of the trigger to be deleted. * @param 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 */ public final OperationFuture deleteTriggerAsync( TriggerName name, boolean allowMissing) { DeleteTriggerRequest request = DeleteTriggerRequest.newBuilder() .setName(name == null ? null : name.toString()) .setAllowMissing(allowMissing) .build(); return deleteTriggerAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single trigger. * *

Sample code: * *

{@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();
   * }
   * }
* * @param name Required. The name of the trigger to be deleted. * @param 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 */ public final OperationFuture deleteTriggerAsync( String name, boolean allowMissing) { DeleteTriggerRequest request = DeleteTriggerRequest.newBuilder().setName(name).setAllowMissing(allowMissing).build(); return deleteTriggerAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single trigger. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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 */ public final OperationFuture deleteTriggerAsync( DeleteTriggerRequest request) { return deleteTriggerOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single trigger. * *

Sample code: * *

{@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 future =
   *       eventarcClient.deleteTriggerOperationCallable().futureCall(request);
   *   // Do something.
   *   Trigger response = future.get();
   * }
   * }
*/ public final OperationCallable deleteTriggerOperationCallable() { return stub.deleteTriggerOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single trigger. * *

Sample code: * *

{@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 future = eventarcClient.deleteTriggerCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable deleteTriggerCallable() { return stub.deleteTriggerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single Channel. * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the channel to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Channel getChannel(ChannelName name) { GetChannelRequest request = GetChannelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single Channel. * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the channel to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Channel getChannel(String name) { GetChannelRequest request = GetChannelRequest.newBuilder().setName(name).build(); return getChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single Channel. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final Channel getChannel(GetChannelRequest request) { return getChannelCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single Channel. * *

Sample code: * *

{@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 future = eventarcClient.getChannelCallable().futureCall(request);
   *   // Do something.
   *   Channel response = future.get();
   * }
   * }
*/ public final UnaryCallable getChannelCallable() { return stub.getChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channels. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param parent Required. The parent collection to list channels on. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListChannelsPagedResponse listChannels(LocationName parent) { ListChannelsRequest request = ListChannelsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listChannels(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channels. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param parent Required. The parent collection to list channels on. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListChannelsPagedResponse listChannels(String parent) { ListChannelsRequest request = ListChannelsRequest.newBuilder().setParent(parent).build(); return listChannels(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channels. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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 */ public final ListChannelsPagedResponse listChannels(ListChannelsRequest request) { return listChannelsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channels. * *

Sample code: * *

{@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 future = eventarcClient.listChannelsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Channel element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listChannelsPagedCallable() { return stub.listChannelsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channels. * *

Sample code: * *

{@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;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listChannelsCallable() { return stub.listChannelsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new channel in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param parent Required. The parent collection in which to add this channel. * @param channel Required. The channel to create. * @param channelId Required. The user-provided ID to be assigned to the channel. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createChannelAsync( LocationName parent, Channel channel, String channelId) { CreateChannelRequest request = CreateChannelRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setChannel(channel) .setChannelId(channelId) .build(); return createChannelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new channel in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param parent Required. The parent collection in which to add this channel. * @param channel Required. The channel to create. * @param channelId Required. The user-provided ID to be assigned to the channel. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createChannelAsync( String parent, Channel channel, String channelId) { CreateChannelRequest request = CreateChannelRequest.newBuilder() .setParent(parent) .setChannel(channel) .setChannelId(channelId) .build(); return createChannelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new channel in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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 */ public final OperationFuture createChannelAsync( CreateChannelRequest request) { return createChannelOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new channel in a particular project and location. * *

Sample code: * *

{@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 future =
   *       eventarcClient.createChannelOperationCallable().futureCall(request);
   *   // Do something.
   *   Channel response = future.get();
   * }
   * }
*/ public final OperationCallable createChannelOperationCallable() { return stub.createChannelOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new channel in a particular project and location. * *

Sample code: * *

{@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 future = eventarcClient.createChannelCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable createChannelCallable() { return stub.createChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single channel. * *

Sample code: * *

{@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();
   * }
   * }
* * @param channel The channel to be updated. * @param 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 */ public final OperationFuture updateChannelAsync( Channel channel, FieldMask updateMask) { UpdateChannelRequest request = UpdateChannelRequest.newBuilder().setChannel(channel).setUpdateMask(updateMask).build(); return updateChannelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single channel. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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 */ public final OperationFuture updateChannelAsync( UpdateChannelRequest request) { return updateChannelOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single channel. * *

Sample code: * *

{@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 future =
   *       eventarcClient.updateChannelOperationCallable().futureCall(request);
   *   // Do something.
   *   Channel response = future.get();
   * }
   * }
*/ public final OperationCallable updateChannelOperationCallable() { return stub.updateChannelOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single channel. * *

Sample code: * *

{@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 future = eventarcClient.updateChannelCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable updateChannelCallable() { return stub.updateChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single channel. * *

Sample code: * *

{@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();
   * }
   * }
* * @param name Required. The name of the channel to be deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteChannelAsync(ChannelName name) { DeleteChannelRequest request = DeleteChannelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return deleteChannelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single channel. * *

Sample code: * *

{@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();
   * }
   * }
* * @param name Required. The name of the channel to be deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteChannelAsync(String name) { DeleteChannelRequest request = DeleteChannelRequest.newBuilder().setName(name).build(); return deleteChannelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single channel. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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 */ public final OperationFuture deleteChannelAsync( DeleteChannelRequest request) { return deleteChannelOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single channel. * *

Sample code: * *

{@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 future =
   *       eventarcClient.deleteChannelOperationCallable().futureCall(request);
   *   // Do something.
   *   Channel response = future.get();
   * }
   * }
*/ public final OperationCallable deleteChannelOperationCallable() { return stub.deleteChannelOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single channel. * *

Sample code: * *

{@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 future = eventarcClient.deleteChannelCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable deleteChannelCallable() { return stub.deleteChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single Provider. * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the provider to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Provider getProvider(ProviderName name) { GetProviderRequest request = GetProviderRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getProvider(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single Provider. * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the provider to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Provider getProvider(String name) { GetProviderRequest request = GetProviderRequest.newBuilder().setName(name).build(); return getProvider(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single Provider. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final Provider getProvider(GetProviderRequest request) { return getProviderCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single Provider. * *

Sample code: * *

{@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 future = eventarcClient.getProviderCallable().futureCall(request);
   *   // Do something.
   *   Provider response = future.get();
   * }
   * }
*/ public final UnaryCallable getProviderCallable() { return stub.getProviderCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List providers. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param parent Required. The parent of the provider to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListProvidersPagedResponse listProviders(LocationName parent) { ListProvidersRequest request = ListProvidersRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listProviders(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List providers. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param parent Required. The parent of the provider to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListProvidersPagedResponse listProviders(String parent) { ListProvidersRequest request = ListProvidersRequest.newBuilder().setParent(parent).build(); return listProviders(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List providers. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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 */ public final ListProvidersPagedResponse listProviders(ListProvidersRequest request) { return listProvidersPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List providers. * *

Sample code: * *

{@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 future = eventarcClient.listProvidersPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Provider element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listProvidersPagedCallable() { return stub.listProvidersPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List providers. * *

Sample code: * *

{@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;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listProvidersCallable() { return stub.listProvidersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single ChannelConnection. * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the channel connection to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ChannelConnection getChannelConnection(ChannelConnectionName name) { GetChannelConnectionRequest request = GetChannelConnectionRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getChannelConnection(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single ChannelConnection. * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the channel connection to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ChannelConnection getChannelConnection(String name) { GetChannelConnectionRequest request = GetChannelConnectionRequest.newBuilder().setName(name).build(); return getChannelConnection(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single ChannelConnection. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final ChannelConnection getChannelConnection(GetChannelConnectionRequest request) { return getChannelConnectionCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single ChannelConnection. * *

Sample code: * *

{@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 future =
   *       eventarcClient.getChannelConnectionCallable().futureCall(request);
   *   // Do something.
   *   ChannelConnection response = future.get();
   * }
   * }
*/ public final UnaryCallable getChannelConnectionCallable() { return stub.getChannelConnectionCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channel connections. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param parent Required. The parent collection from which to list channel connections. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListChannelConnectionsPagedResponse listChannelConnections(LocationName parent) { ListChannelConnectionsRequest request = ListChannelConnectionsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listChannelConnections(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channel connections. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param parent Required. The parent collection from which to list channel connections. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListChannelConnectionsPagedResponse listChannelConnections(String parent) { ListChannelConnectionsRequest request = ListChannelConnectionsRequest.newBuilder().setParent(parent).build(); return listChannelConnections(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channel connections. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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 */ public final ListChannelConnectionsPagedResponse listChannelConnections( ListChannelConnectionsRequest request) { return listChannelConnectionsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channel connections. * *

Sample code: * *

{@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 future =
   *       eventarcClient.listChannelConnectionsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (ChannelConnection element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listChannelConnectionsPagedCallable() { return stub.listChannelConnectionsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List channel connections. * *

Sample code: * *

{@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;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listChannelConnectionsCallable() { return stub.listChannelConnectionsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new ChannelConnection in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param parent Required. The parent collection in which to add this channel connection. * @param channelConnection Required. Channel connection to create. * @param 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 */ public final OperationFuture createChannelConnectionAsync( LocationName parent, ChannelConnection channelConnection, String channelConnectionId) { CreateChannelConnectionRequest request = CreateChannelConnectionRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setChannelConnection(channelConnection) .setChannelConnectionId(channelConnectionId) .build(); return createChannelConnectionAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new ChannelConnection in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param parent Required. The parent collection in which to add this channel connection. * @param channelConnection Required. Channel connection to create. * @param 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 */ public final OperationFuture createChannelConnectionAsync( String parent, ChannelConnection channelConnection, String channelConnectionId) { CreateChannelConnectionRequest request = CreateChannelConnectionRequest.newBuilder() .setParent(parent) .setChannelConnection(channelConnection) .setChannelConnectionId(channelConnectionId) .build(); return createChannelConnectionAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new ChannelConnection in a particular project and location. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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 */ public final OperationFuture createChannelConnectionAsync( CreateChannelConnectionRequest request) { return createChannelConnectionOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new ChannelConnection in a particular project and location. * *

Sample code: * *

{@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 future =
   *       eventarcClient.createChannelConnectionOperationCallable().futureCall(request);
   *   // Do something.
   *   ChannelConnection response = future.get();
   * }
   * }
*/ public final OperationCallable< CreateChannelConnectionRequest, ChannelConnection, OperationMetadata> createChannelConnectionOperationCallable() { return stub.createChannelConnectionOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new ChannelConnection in a particular project and location. * *

Sample code: * *

{@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 future =
   *       eventarcClient.createChannelConnectionCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable createChannelConnectionCallable() { return stub.createChannelConnectionCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single ChannelConnection. * *

Sample code: * *

{@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();
   * }
   * }
* * @param name Required. The name of the channel connection to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteChannelConnectionAsync( ChannelConnectionName name) { DeleteChannelConnectionRequest request = DeleteChannelConnectionRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return deleteChannelConnectionAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single ChannelConnection. * *

Sample code: * *

{@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();
   * }
   * }
* * @param name Required. The name of the channel connection to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteChannelConnectionAsync( String name) { DeleteChannelConnectionRequest request = DeleteChannelConnectionRequest.newBuilder().setName(name).build(); return deleteChannelConnectionAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single ChannelConnection. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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 */ public final OperationFuture deleteChannelConnectionAsync( DeleteChannelConnectionRequest request) { return deleteChannelConnectionOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single ChannelConnection. * *

Sample code: * *

{@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 future =
   *       eventarcClient.deleteChannelConnectionOperationCallable().futureCall(request);
   *   // Do something.
   *   ChannelConnection response = future.get();
   * }
   * }
*/ public final OperationCallable< DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> deleteChannelConnectionOperationCallable() { return stub.deleteChannelConnectionOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a single ChannelConnection. * *

Sample code: * *

{@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 future =
   *       eventarcClient.deleteChannelConnectionCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable deleteChannelConnectionCallable() { return stub.deleteChannelConnectionCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a GoogleChannelConfig * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the config to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final GoogleChannelConfig getGoogleChannelConfig(GoogleChannelConfigName name) { GetGoogleChannelConfigRequest request = GetGoogleChannelConfigRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getGoogleChannelConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a GoogleChannelConfig * *

Sample code: * *

{@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);
   * }
   * }
* * @param name Required. The name of the config to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final GoogleChannelConfig getGoogleChannelConfig(String name) { GetGoogleChannelConfigRequest request = GetGoogleChannelConfigRequest.newBuilder().setName(name).build(); return getGoogleChannelConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a GoogleChannelConfig * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final GoogleChannelConfig getGoogleChannelConfig(GetGoogleChannelConfigRequest request) { return getGoogleChannelConfigCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a GoogleChannelConfig * *

Sample code: * *

{@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 future =
   *       eventarcClient.getGoogleChannelConfigCallable().futureCall(request);
   *   // Do something.
   *   GoogleChannelConfig response = future.get();
   * }
   * }
*/ public final UnaryCallable getGoogleChannelConfigCallable() { return stub.getGoogleChannelConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single GoogleChannelConfig * *

Sample code: * *

{@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);
   * }
   * }
* * @param googleChannelConfig Required. The config to be updated. * @param 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 */ public final GoogleChannelConfig updateGoogleChannelConfig( GoogleChannelConfig googleChannelConfig, FieldMask updateMask) { UpdateGoogleChannelConfigRequest request = UpdateGoogleChannelConfigRequest.newBuilder() .setGoogleChannelConfig(googleChannelConfig) .setUpdateMask(updateMask) .build(); return updateGoogleChannelConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single GoogleChannelConfig * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final GoogleChannelConfig updateGoogleChannelConfig( UpdateGoogleChannelConfigRequest request) { return updateGoogleChannelConfigCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a single GoogleChannelConfig * *

Sample code: * *

{@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 future =
   *       eventarcClient.updateGoogleChannelConfigCallable().futureCall(request);
   *   // Do something.
   *   GoogleChannelConfig response = future.get();
   * }
   * }
*/ public final UnaryCallable updateGoogleChannelConfigCallable() { return stub.updateGoogleChannelConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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 */ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { return listLocationsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@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 future = eventarcClient.listLocationsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Location element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listLocationsPagedCallable() { return stub.listLocationsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@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;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listLocationsCallable() { return stub.listLocationsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets information about a location. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final Location getLocation(GetLocationRequest request) { return getLocationCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets information about a location. * *

Sample code: * *

{@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 future = eventarcClient.getLocationCallable().futureCall(request);
   *   // Do something.
   *   Location response = future.get();
   * }
   * }
*/ public final UnaryCallable getLocationCallable() { return stub.getLocationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Sets the access control policy on the specified resource. Replacesany existing policy. * *

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

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final Policy setIamPolicy(SetIamPolicyRequest request) { return setIamPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Sets the access control policy on the specified resource. Replacesany existing policy. * *

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

Sample code: * *

{@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 future = eventarcClient.setIamPolicyCallable().futureCall(request);
   *   // Do something.
   *   Policy response = future.get();
   * }
   * }
*/ public final UnaryCallable setIamPolicyCallable() { return stub.setIamPolicyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets the access control policy for a resource. Returns an empty policyif the resource exists * and does not have a policy set. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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 */ public final Policy getIamPolicy(GetIamPolicyRequest request) { return getIamPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets the access control policy for a resource. Returns an empty policyif the resource exists * and does not have a policy set. * *

Sample code: * *

{@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 future = eventarcClient.getIamPolicyCallable().futureCall(request);
   *   // Do something.
   *   Policy response = future.get();
   * }
   * }
*/ public final UnaryCallable getIamPolicyCallable() { return stub.getIamPolicyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * 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: * *

{@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())
   *           .build();
   *   TestIamPermissionsResponse response = eventarcClient.testIamPermissions(request);
   * }
   * }
* * @param 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 */ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { return testIamPermissionsCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * 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: * *

{@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())
   *           .build();
   *   ApiFuture future =
   *       eventarcClient.testIamPermissionsCallable().futureCall(request);
   *   // Do something.
   *   TestIamPermissionsResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable testIamPermissionsCallable() { return stub.testIamPermissionsCallable(); } @Override public final void close() { stub.close(); } @Override public void shutdown() { stub.shutdown(); } @Override public boolean isShutdown() { return stub.isShutdown(); } @Override public boolean isTerminated() { return stub.isTerminated(); } @Override public void shutdownNow() { stub.shutdownNow(); } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); } public static class ListTriggersPagedResponse extends AbstractPagedListResponse< ListTriggersRequest, ListTriggersResponse, Trigger, ListTriggersPage, ListTriggersFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListTriggersPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListTriggersPagedResponse(input), MoreExecutors.directExecutor()); } private ListTriggersPagedResponse(ListTriggersPage page) { super(page, ListTriggersFixedSizeCollection.createEmptyCollection()); } } public static class ListTriggersPage extends AbstractPage { private ListTriggersPage( PageContext context, ListTriggersResponse response) { super(context, response); } private static ListTriggersPage createEmptyPage() { return new ListTriggersPage(null, null); } @Override protected ListTriggersPage createPage( PageContext context, ListTriggersResponse response) { return new ListTriggersPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListTriggersFixedSizeCollection extends AbstractFixedSizeCollection< ListTriggersRequest, ListTriggersResponse, Trigger, ListTriggersPage, ListTriggersFixedSizeCollection> { private ListTriggersFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListTriggersFixedSizeCollection createEmptyCollection() { return new ListTriggersFixedSizeCollection(null, 0); } @Override protected ListTriggersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTriggersFixedSizeCollection(pages, collectionSize); } } public static class ListChannelsPagedResponse extends AbstractPagedListResponse< ListChannelsRequest, ListChannelsResponse, Channel, ListChannelsPage, ListChannelsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListChannelsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListChannelsPagedResponse(input), MoreExecutors.directExecutor()); } private ListChannelsPagedResponse(ListChannelsPage page) { super(page, ListChannelsFixedSizeCollection.createEmptyCollection()); } } public static class ListChannelsPage extends AbstractPage { private ListChannelsPage( PageContext context, ListChannelsResponse response) { super(context, response); } private static ListChannelsPage createEmptyPage() { return new ListChannelsPage(null, null); } @Override protected ListChannelsPage createPage( PageContext context, ListChannelsResponse response) { return new ListChannelsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListChannelsFixedSizeCollection extends AbstractFixedSizeCollection< ListChannelsRequest, ListChannelsResponse, Channel, ListChannelsPage, ListChannelsFixedSizeCollection> { private ListChannelsFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListChannelsFixedSizeCollection createEmptyCollection() { return new ListChannelsFixedSizeCollection(null, 0); } @Override protected ListChannelsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListChannelsFixedSizeCollection(pages, collectionSize); } } public static class ListProvidersPagedResponse extends AbstractPagedListResponse< ListProvidersRequest, ListProvidersResponse, Provider, ListProvidersPage, ListProvidersFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListProvidersPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListProvidersPagedResponse(input), MoreExecutors.directExecutor()); } private ListProvidersPagedResponse(ListProvidersPage page) { super(page, ListProvidersFixedSizeCollection.createEmptyCollection()); } } public static class ListProvidersPage extends AbstractPage< ListProvidersRequest, ListProvidersResponse, Provider, ListProvidersPage> { private ListProvidersPage( PageContext context, ListProvidersResponse response) { super(context, response); } private static ListProvidersPage createEmptyPage() { return new ListProvidersPage(null, null); } @Override protected ListProvidersPage createPage( PageContext context, ListProvidersResponse response) { return new ListProvidersPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListProvidersFixedSizeCollection extends AbstractFixedSizeCollection< ListProvidersRequest, ListProvidersResponse, Provider, ListProvidersPage, ListProvidersFixedSizeCollection> { private ListProvidersFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListProvidersFixedSizeCollection createEmptyCollection() { return new ListProvidersFixedSizeCollection(null, 0); } @Override protected ListProvidersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListProvidersFixedSizeCollection(pages, collectionSize); } } public static class ListChannelConnectionsPagedResponse extends AbstractPagedListResponse< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection, ListChannelConnectionsPage, ListChannelConnectionsFixedSizeCollection> { public static ApiFuture createAsync( PageContext< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection> context, ApiFuture futureResponse) { ApiFuture futurePage = ListChannelConnectionsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListChannelConnectionsPagedResponse(input), MoreExecutors.directExecutor()); } private ListChannelConnectionsPagedResponse(ListChannelConnectionsPage page) { super(page, ListChannelConnectionsFixedSizeCollection.createEmptyCollection()); } } public static class ListChannelConnectionsPage extends AbstractPage< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection, ListChannelConnectionsPage> { private ListChannelConnectionsPage( PageContext< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection> context, ListChannelConnectionsResponse response) { super(context, response); } private static ListChannelConnectionsPage createEmptyPage() { return new ListChannelConnectionsPage(null, null); } @Override protected ListChannelConnectionsPage createPage( PageContext< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection> context, ListChannelConnectionsResponse response) { return new ListChannelConnectionsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection> context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListChannelConnectionsFixedSizeCollection extends AbstractFixedSizeCollection< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection, ListChannelConnectionsPage, ListChannelConnectionsFixedSizeCollection> { private ListChannelConnectionsFixedSizeCollection( List pages, int collectionSize) { super(pages, collectionSize); } private static ListChannelConnectionsFixedSizeCollection createEmptyCollection() { return new ListChannelConnectionsFixedSizeCollection(null, 0); } @Override protected ListChannelConnectionsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListChannelConnectionsFixedSizeCollection(pages, collectionSize); } } public static class ListLocationsPagedResponse extends AbstractPagedListResponse< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage, ListLocationsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListLocationsPagedResponse(input), MoreExecutors.directExecutor()); } private ListLocationsPagedResponse(ListLocationsPage page) { super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); } } public static class ListLocationsPage extends AbstractPage< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( PageContext context, ListLocationsResponse response) { super(context, response); } private static ListLocationsPage createEmptyPage() { return new ListLocationsPage(null, null); } @Override protected ListLocationsPage createPage( PageContext context, ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListLocationsFixedSizeCollection extends AbstractFixedSizeCollection< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage, ListLocationsFixedSizeCollection> { private ListLocationsFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListLocationsFixedSizeCollection createEmptyCollection() { return new ListLocationsFixedSizeCollection(null, 0); } @Override protected ListLocationsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy