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

com.google.cloud.eventarc.v1.stub.EventarcStubSettings 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.stub;

import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
import com.google.api.gax.httpjson.GaxHttpJsonProperties;
import com.google.api.gax.httpjson.HttpJsonTransportChannel;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.PagedListDescriptor;
import com.google.api.gax.rpc.PagedListResponseFactory;
import com.google.api.gax.rpc.StatusCode;
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.eventarc.v1.Channel;
import com.google.cloud.eventarc.v1.ChannelConnection;
import com.google.cloud.eventarc.v1.CreateChannelConnectionRequest;
import com.google.cloud.eventarc.v1.CreateChannelRequest;
import com.google.cloud.eventarc.v1.CreateTriggerRequest;
import com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest;
import com.google.cloud.eventarc.v1.DeleteChannelRequest;
import com.google.cloud.eventarc.v1.DeleteTriggerRequest;
import com.google.cloud.eventarc.v1.GetChannelConnectionRequest;
import com.google.cloud.eventarc.v1.GetChannelRequest;
import com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest;
import com.google.cloud.eventarc.v1.GetProviderRequest;
import com.google.cloud.eventarc.v1.GetTriggerRequest;
import com.google.cloud.eventarc.v1.GoogleChannelConfig;
import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest;
import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse;
import com.google.cloud.eventarc.v1.ListChannelsRequest;
import com.google.cloud.eventarc.v1.ListChannelsResponse;
import com.google.cloud.eventarc.v1.ListProvidersRequest;
import com.google.cloud.eventarc.v1.ListProvidersResponse;
import com.google.cloud.eventarc.v1.ListTriggersRequest;
import com.google.cloud.eventarc.v1.ListTriggersResponse;
import com.google.cloud.eventarc.v1.OperationMetadata;
import com.google.cloud.eventarc.v1.Provider;
import com.google.cloud.eventarc.v1.Trigger;
import com.google.cloud.eventarc.v1.UpdateChannelRequest;
import com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest;
import com.google.cloud.eventarc.v1.UpdateTriggerRequest;
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.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
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 java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.threeten.bp.Duration;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Settings class to configure an instance of {@link EventarcStub}.
 *
 * 

The default instance has everything set to sensible defaults: * *

    *
  • The default service address (eventarc.googleapis.com) and default port (443) are used. *
  • Credentials are acquired automatically through Application Default Credentials. *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * *

For example, to set the total timeout of getTrigger to 30 seconds: * *

{@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
 * EventarcStubSettings.Builder eventarcSettingsBuilder = EventarcStubSettings.newBuilder();
 * eventarcSettingsBuilder
 *     .getTriggerSettings()
 *     .setRetrySettings(
 *         eventarcSettingsBuilder
 *             .getTriggerSettings()
 *             .getRetrySettings()
 *             .toBuilder()
 *             .setTotalTimeout(Duration.ofSeconds(30))
 *             .build());
 * EventarcStubSettings eventarcSettings = eventarcSettingsBuilder.build();
 * }
*/ @Generated("by gapic-generator-java") public class EventarcStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); private final UnaryCallSettings getTriggerSettings; private final PagedCallSettings< ListTriggersRequest, ListTriggersResponse, ListTriggersPagedResponse> listTriggersSettings; private final UnaryCallSettings createTriggerSettings; private final OperationCallSettings createTriggerOperationSettings; private final UnaryCallSettings updateTriggerSettings; private final OperationCallSettings updateTriggerOperationSettings; private final UnaryCallSettings deleteTriggerSettings; private final OperationCallSettings deleteTriggerOperationSettings; private final UnaryCallSettings getChannelSettings; private final PagedCallSettings< ListChannelsRequest, ListChannelsResponse, ListChannelsPagedResponse> listChannelsSettings; private final UnaryCallSettings createChannelSettings; private final OperationCallSettings createChannelOperationSettings; private final UnaryCallSettings updateChannelSettings; private final OperationCallSettings updateChannelOperationSettings; private final UnaryCallSettings deleteChannelSettings; private final OperationCallSettings deleteChannelOperationSettings; private final UnaryCallSettings getProviderSettings; private final PagedCallSettings< ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> listProvidersSettings; private final UnaryCallSettings getChannelConnectionSettings; private final PagedCallSettings< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ListChannelConnectionsPagedResponse> listChannelConnectionsSettings; private final UnaryCallSettings createChannelConnectionSettings; private final OperationCallSettings< CreateChannelConnectionRequest, ChannelConnection, OperationMetadata> createChannelConnectionOperationSettings; private final UnaryCallSettings deleteChannelConnectionSettings; private final OperationCallSettings< DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> deleteChannelConnectionOperationSettings; private final UnaryCallSettings getGoogleChannelConfigSettings; private final UnaryCallSettings updateGoogleChannelConfigSettings; private final PagedCallSettings< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; private final UnaryCallSettings getLocationSettings; private final UnaryCallSettings setIamPolicySettings; private final UnaryCallSettings getIamPolicySettings; private final UnaryCallSettings testIamPermissionsSettings; private static final PagedListDescriptor LIST_TRIGGERS_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListTriggersRequest injectToken(ListTriggersRequest payload, String token) { return ListTriggersRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListTriggersRequest injectPageSize(ListTriggersRequest payload, int pageSize) { return ListTriggersRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListTriggersRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListTriggersResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListTriggersResponse payload) { return payload.getTriggersList() == null ? ImmutableList.of() : payload.getTriggersList(); } }; private static final PagedListDescriptor LIST_CHANNELS_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListChannelsRequest injectToken(ListChannelsRequest payload, String token) { return ListChannelsRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListChannelsRequest injectPageSize(ListChannelsRequest payload, int pageSize) { return ListChannelsRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListChannelsRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListChannelsResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListChannelsResponse payload) { return payload.getChannelsList() == null ? ImmutableList.of() : payload.getChannelsList(); } }; private static final PagedListDescriptor LIST_PROVIDERS_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListProvidersRequest injectToken(ListProvidersRequest payload, String token) { return ListProvidersRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListProvidersRequest injectPageSize(ListProvidersRequest payload, int pageSize) { return ListProvidersRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListProvidersRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListProvidersResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListProvidersResponse payload) { return payload.getProvidersList() == null ? ImmutableList.of() : payload.getProvidersList(); } }; private static final PagedListDescriptor< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection> LIST_CHANNEL_CONNECTIONS_PAGE_STR_DESC = new PagedListDescriptor< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection>() { @Override public String emptyToken() { return ""; } @Override public ListChannelConnectionsRequest injectToken( ListChannelConnectionsRequest payload, String token) { return ListChannelConnectionsRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListChannelConnectionsRequest injectPageSize( ListChannelConnectionsRequest payload, int pageSize) { return ListChannelConnectionsRequest.newBuilder(payload) .setPageSize(pageSize) .build(); } @Override public Integer extractPageSize(ListChannelConnectionsRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListChannelConnectionsResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources( ListChannelConnectionsResponse payload) { return payload.getChannelConnectionsList() == null ? ImmutableList.of() : payload.getChannelConnectionsList(); } }; private static final PagedListDescriptor LIST_LOCATIONS_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListLocationsRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListLocationsResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListLocationsResponse payload) { return payload.getLocationsList() == null ? ImmutableList.of() : payload.getLocationsList(); } }; private static final PagedListResponseFactory< ListTriggersRequest, ListTriggersResponse, ListTriggersPagedResponse> LIST_TRIGGERS_PAGE_STR_FACT = new PagedListResponseFactory< ListTriggersRequest, ListTriggersResponse, ListTriggersPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListTriggersRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_TRIGGERS_PAGE_STR_DESC, request, context); return ListTriggersPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListChannelsRequest, ListChannelsResponse, ListChannelsPagedResponse> LIST_CHANNELS_PAGE_STR_FACT = new PagedListResponseFactory< ListChannelsRequest, ListChannelsResponse, ListChannelsPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListChannelsRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_CHANNELS_PAGE_STR_DESC, request, context); return ListChannelsPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> LIST_PROVIDERS_PAGE_STR_FACT = new PagedListResponseFactory< ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListProvidersRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_PROVIDERS_PAGE_STR_DESC, request, context); return ListProvidersPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ListChannelConnectionsPagedResponse> LIST_CHANNEL_CONNECTIONS_PAGE_STR_FACT = new PagedListResponseFactory< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ListChannelConnectionsPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListChannelConnectionsRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection> pageContext = PageContext.create( callable, LIST_CHANNEL_CONNECTIONS_PAGE_STR_DESC, request, context); return ListChannelConnectionsPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> LIST_LOCATIONS_PAGE_STR_FACT = new PagedListResponseFactory< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListLocationsRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); } }; /** Returns the object with the settings used for calls to getTrigger. */ public UnaryCallSettings getTriggerSettings() { return getTriggerSettings; } /** Returns the object with the settings used for calls to listTriggers. */ public PagedCallSettings listTriggersSettings() { return listTriggersSettings; } /** Returns the object with the settings used for calls to createTrigger. */ public UnaryCallSettings createTriggerSettings() { return createTriggerSettings; } /** Returns the object with the settings used for calls to createTrigger. */ public OperationCallSettings createTriggerOperationSettings() { return createTriggerOperationSettings; } /** Returns the object with the settings used for calls to updateTrigger. */ public UnaryCallSettings updateTriggerSettings() { return updateTriggerSettings; } /** Returns the object with the settings used for calls to updateTrigger. */ public OperationCallSettings updateTriggerOperationSettings() { return updateTriggerOperationSettings; } /** Returns the object with the settings used for calls to deleteTrigger. */ public UnaryCallSettings deleteTriggerSettings() { return deleteTriggerSettings; } /** Returns the object with the settings used for calls to deleteTrigger. */ public OperationCallSettings deleteTriggerOperationSettings() { return deleteTriggerOperationSettings; } /** Returns the object with the settings used for calls to getChannel. */ public UnaryCallSettings getChannelSettings() { return getChannelSettings; } /** Returns the object with the settings used for calls to listChannels. */ public PagedCallSettings listChannelsSettings() { return listChannelsSettings; } /** Returns the object with the settings used for calls to createChannel. */ public UnaryCallSettings createChannelSettings() { return createChannelSettings; } /** Returns the object with the settings used for calls to createChannel. */ public OperationCallSettings createChannelOperationSettings() { return createChannelOperationSettings; } /** Returns the object with the settings used for calls to updateChannel. */ public UnaryCallSettings updateChannelSettings() { return updateChannelSettings; } /** Returns the object with the settings used for calls to updateChannel. */ public OperationCallSettings updateChannelOperationSettings() { return updateChannelOperationSettings; } /** Returns the object with the settings used for calls to deleteChannel. */ public UnaryCallSettings deleteChannelSettings() { return deleteChannelSettings; } /** Returns the object with the settings used for calls to deleteChannel. */ public OperationCallSettings deleteChannelOperationSettings() { return deleteChannelOperationSettings; } /** Returns the object with the settings used for calls to getProvider. */ public UnaryCallSettings getProviderSettings() { return getProviderSettings; } /** Returns the object with the settings used for calls to listProviders. */ public PagedCallSettings listProvidersSettings() { return listProvidersSettings; } /** Returns the object with the settings used for calls to getChannelConnection. */ public UnaryCallSettings getChannelConnectionSettings() { return getChannelConnectionSettings; } /** Returns the object with the settings used for calls to listChannelConnections. */ public PagedCallSettings< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ListChannelConnectionsPagedResponse> listChannelConnectionsSettings() { return listChannelConnectionsSettings; } /** Returns the object with the settings used for calls to createChannelConnection. */ public UnaryCallSettings createChannelConnectionSettings() { return createChannelConnectionSettings; } /** Returns the object with the settings used for calls to createChannelConnection. */ public OperationCallSettings createChannelConnectionOperationSettings() { return createChannelConnectionOperationSettings; } /** Returns the object with the settings used for calls to deleteChannelConnection. */ public UnaryCallSettings deleteChannelConnectionSettings() { return deleteChannelConnectionSettings; } /** Returns the object with the settings used for calls to deleteChannelConnection. */ public OperationCallSettings deleteChannelConnectionOperationSettings() { return deleteChannelConnectionOperationSettings; } /** Returns the object with the settings used for calls to getGoogleChannelConfig. */ public UnaryCallSettings getGoogleChannelConfigSettings() { return getGoogleChannelConfigSettings; } /** Returns the object with the settings used for calls to updateGoogleChannelConfig. */ public UnaryCallSettings updateGoogleChannelConfigSettings() { return updateGoogleChannelConfigSettings; } /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { return listLocationsSettings; } /** Returns the object with the settings used for calls to getLocation. */ public UnaryCallSettings getLocationSettings() { return getLocationSettings; } /** Returns the object with the settings used for calls to setIamPolicy. */ public UnaryCallSettings setIamPolicySettings() { return setIamPolicySettings; } /** Returns the object with the settings used for calls to getIamPolicy. */ public UnaryCallSettings getIamPolicySettings() { return getIamPolicySettings; } /** Returns the object with the settings used for calls to testIamPermissions. */ public UnaryCallSettings testIamPermissionsSettings() { return testIamPermissionsSettings; } public EventarcStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcEventarcStub.create(this); } if (getTransportChannelProvider() .getTransportName() .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { return HttpJsonEventarcStub.create(this); } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns the default service name. */ @Override public String getServiceName() { return "eventarc"; } /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); } /** Returns the default service endpoint. */ public static String getDefaultEndpoint() { return "eventarc.googleapis.com:443"; } /** Returns the default mTLS service endpoint. */ public static String getDefaultMtlsEndpoint() { return "eventarc.mtls.googleapis.com:443"; } /** Returns the default service scopes. */ public static List getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { return GoogleCredentialsProvider.newBuilder() .setScopesToApply(DEFAULT_SERVICE_SCOPES) .setUseJwtAccessWithScope(true); } /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } /** Returns a builder for the default REST ChannelProvider for this service. */ @BetaApi public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { return InstantiatingHttpJsonChannelProvider.newBuilder(); } public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EventarcStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EventarcStubSettings.class)) .setTransportToken( GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); } public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return EventarcStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); } /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } /** Returns a new REST builder for this class. */ public static Builder newHttpJsonBuilder() { return Builder.createHttpJsonDefault(); } /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); } /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } protected EventarcStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); getTriggerSettings = settingsBuilder.getTriggerSettings().build(); listTriggersSettings = settingsBuilder.listTriggersSettings().build(); createTriggerSettings = settingsBuilder.createTriggerSettings().build(); createTriggerOperationSettings = settingsBuilder.createTriggerOperationSettings().build(); updateTriggerSettings = settingsBuilder.updateTriggerSettings().build(); updateTriggerOperationSettings = settingsBuilder.updateTriggerOperationSettings().build(); deleteTriggerSettings = settingsBuilder.deleteTriggerSettings().build(); deleteTriggerOperationSettings = settingsBuilder.deleteTriggerOperationSettings().build(); getChannelSettings = settingsBuilder.getChannelSettings().build(); listChannelsSettings = settingsBuilder.listChannelsSettings().build(); createChannelSettings = settingsBuilder.createChannelSettings().build(); createChannelOperationSettings = settingsBuilder.createChannelOperationSettings().build(); updateChannelSettings = settingsBuilder.updateChannelSettings().build(); updateChannelOperationSettings = settingsBuilder.updateChannelOperationSettings().build(); deleteChannelSettings = settingsBuilder.deleteChannelSettings().build(); deleteChannelOperationSettings = settingsBuilder.deleteChannelOperationSettings().build(); getProviderSettings = settingsBuilder.getProviderSettings().build(); listProvidersSettings = settingsBuilder.listProvidersSettings().build(); getChannelConnectionSettings = settingsBuilder.getChannelConnectionSettings().build(); listChannelConnectionsSettings = settingsBuilder.listChannelConnectionsSettings().build(); createChannelConnectionSettings = settingsBuilder.createChannelConnectionSettings().build(); createChannelConnectionOperationSettings = settingsBuilder.createChannelConnectionOperationSettings().build(); deleteChannelConnectionSettings = settingsBuilder.deleteChannelConnectionSettings().build(); deleteChannelConnectionOperationSettings = settingsBuilder.deleteChannelConnectionOperationSettings().build(); getGoogleChannelConfigSettings = settingsBuilder.getGoogleChannelConfigSettings().build(); updateGoogleChannelConfigSettings = settingsBuilder.updateGoogleChannelConfigSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for EventarcStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; private final UnaryCallSettings.Builder getTriggerSettings; private final PagedCallSettings.Builder< ListTriggersRequest, ListTriggersResponse, ListTriggersPagedResponse> listTriggersSettings; private final UnaryCallSettings.Builder createTriggerSettings; private final OperationCallSettings.Builder createTriggerOperationSettings; private final UnaryCallSettings.Builder updateTriggerSettings; private final OperationCallSettings.Builder updateTriggerOperationSettings; private final UnaryCallSettings.Builder deleteTriggerSettings; private final OperationCallSettings.Builder deleteTriggerOperationSettings; private final UnaryCallSettings.Builder getChannelSettings; private final PagedCallSettings.Builder< ListChannelsRequest, ListChannelsResponse, ListChannelsPagedResponse> listChannelsSettings; private final UnaryCallSettings.Builder createChannelSettings; private final OperationCallSettings.Builder createChannelOperationSettings; private final UnaryCallSettings.Builder updateChannelSettings; private final OperationCallSettings.Builder updateChannelOperationSettings; private final UnaryCallSettings.Builder deleteChannelSettings; private final OperationCallSettings.Builder deleteChannelOperationSettings; private final UnaryCallSettings.Builder getProviderSettings; private final PagedCallSettings.Builder< ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> listProvidersSettings; private final UnaryCallSettings.Builder getChannelConnectionSettings; private final PagedCallSettings.Builder< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ListChannelConnectionsPagedResponse> listChannelConnectionsSettings; private final UnaryCallSettings.Builder createChannelConnectionSettings; private final OperationCallSettings.Builder< CreateChannelConnectionRequest, ChannelConnection, OperationMetadata> createChannelConnectionOperationSettings; private final UnaryCallSettings.Builder deleteChannelConnectionSettings; private final OperationCallSettings.Builder< DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> deleteChannelConnectionOperationSettings; private final UnaryCallSettings.Builder getGoogleChannelConfigSettings; private final UnaryCallSettings.Builder updateGoogleChannelConfigSettings; private final PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; private final UnaryCallSettings.Builder getLocationSettings; private final UnaryCallSettings.Builder setIamPolicySettings; private final UnaryCallSettings.Builder getIamPolicySettings; private final UnaryCallSettings.Builder testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; static { ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } private static final ImmutableMap RETRY_PARAM_DEFINITIONS; static { ImmutableMap.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(clientContext); getTriggerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listTriggersSettings = PagedCallSettings.newBuilder(LIST_TRIGGERS_PAGE_STR_FACT); createTriggerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createTriggerOperationSettings = OperationCallSettings.newBuilder(); updateTriggerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateTriggerOperationSettings = OperationCallSettings.newBuilder(); deleteTriggerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteTriggerOperationSettings = OperationCallSettings.newBuilder(); getChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listChannelsSettings = PagedCallSettings.newBuilder(LIST_CHANNELS_PAGE_STR_FACT); createChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createChannelOperationSettings = OperationCallSettings.newBuilder(); updateChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateChannelOperationSettings = OperationCallSettings.newBuilder(); deleteChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteChannelOperationSettings = OperationCallSettings.newBuilder(); getProviderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listProvidersSettings = PagedCallSettings.newBuilder(LIST_PROVIDERS_PAGE_STR_FACT); getChannelConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listChannelConnectionsSettings = PagedCallSettings.newBuilder(LIST_CHANNEL_CONNECTIONS_PAGE_STR_FACT); createChannelConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createChannelConnectionOperationSettings = OperationCallSettings.newBuilder(); deleteChannelConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteChannelConnectionOperationSettings = OperationCallSettings.newBuilder(); getGoogleChannelConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateGoogleChannelConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( getTriggerSettings, listTriggersSettings, createTriggerSettings, updateTriggerSettings, deleteTriggerSettings, getChannelSettings, listChannelsSettings, createChannelSettings, updateChannelSettings, deleteChannelSettings, getProviderSettings, listProvidersSettings, getChannelConnectionSettings, listChannelConnectionsSettings, createChannelConnectionSettings, deleteChannelConnectionSettings, getGoogleChannelConfigSettings, updateGoogleChannelConfigSettings, listLocationsSettings, getLocationSettings, setIamPolicySettings, getIamPolicySettings, testIamPermissionsSettings); initDefaults(this); } protected Builder(EventarcStubSettings settings) { super(settings); getTriggerSettings = settings.getTriggerSettings.toBuilder(); listTriggersSettings = settings.listTriggersSettings.toBuilder(); createTriggerSettings = settings.createTriggerSettings.toBuilder(); createTriggerOperationSettings = settings.createTriggerOperationSettings.toBuilder(); updateTriggerSettings = settings.updateTriggerSettings.toBuilder(); updateTriggerOperationSettings = settings.updateTriggerOperationSettings.toBuilder(); deleteTriggerSettings = settings.deleteTriggerSettings.toBuilder(); deleteTriggerOperationSettings = settings.deleteTriggerOperationSettings.toBuilder(); getChannelSettings = settings.getChannelSettings.toBuilder(); listChannelsSettings = settings.listChannelsSettings.toBuilder(); createChannelSettings = settings.createChannelSettings.toBuilder(); createChannelOperationSettings = settings.createChannelOperationSettings.toBuilder(); updateChannelSettings = settings.updateChannelSettings.toBuilder(); updateChannelOperationSettings = settings.updateChannelOperationSettings.toBuilder(); deleteChannelSettings = settings.deleteChannelSettings.toBuilder(); deleteChannelOperationSettings = settings.deleteChannelOperationSettings.toBuilder(); getProviderSettings = settings.getProviderSettings.toBuilder(); listProvidersSettings = settings.listProvidersSettings.toBuilder(); getChannelConnectionSettings = settings.getChannelConnectionSettings.toBuilder(); listChannelConnectionsSettings = settings.listChannelConnectionsSettings.toBuilder(); createChannelConnectionSettings = settings.createChannelConnectionSettings.toBuilder(); createChannelConnectionOperationSettings = settings.createChannelConnectionOperationSettings.toBuilder(); deleteChannelConnectionSettings = settings.deleteChannelConnectionSettings.toBuilder(); deleteChannelConnectionOperationSettings = settings.deleteChannelConnectionOperationSettings.toBuilder(); getGoogleChannelConfigSettings = settings.getGoogleChannelConfigSettings.toBuilder(); updateGoogleChannelConfigSettings = settings.updateGoogleChannelConfigSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( getTriggerSettings, listTriggersSettings, createTriggerSettings, updateTriggerSettings, deleteTriggerSettings, getChannelSettings, listChannelsSettings, createChannelSettings, updateChannelSettings, deleteChannelSettings, getProviderSettings, listProvidersSettings, getChannelConnectionSettings, listChannelConnectionsSettings, createChannelConnectionSettings, deleteChannelConnectionSettings, getGoogleChannelConfigSettings, updateGoogleChannelConfigSettings, listLocationsSettings, getLocationSettings, setIamPolicySettings, getIamPolicySettings, testIamPermissionsSettings); } private static Builder createDefault() { Builder builder = new Builder(((ClientContext) null)); builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } private static Builder createHttpJsonDefault() { Builder builder = new Builder(((ClientContext) null)); builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } private static Builder initDefaults(Builder builder) { builder .getTriggerSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .listTriggersSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .createTriggerSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .updateTriggerSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .deleteTriggerSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .getChannelSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .listChannelsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .createChannelSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .updateChannelSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .deleteChannelSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .getProviderSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .listProvidersSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .getChannelConnectionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .listChannelConnectionsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .createChannelConnectionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .deleteChannelConnectionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .getGoogleChannelConfigSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .updateGoogleChannelConfigSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .getLocationSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .setIamPolicySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .getIamPolicySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .testIamPermissionsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .createTriggerOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Trigger.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .updateTriggerOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Trigger.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .deleteTriggerOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Trigger.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .createChannelOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Channel.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .updateChannelOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Channel.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .deleteChannelOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Channel.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .createChannelConnectionOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(ChannelConnection.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .deleteChannelConnectionOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(ChannelConnection.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } public ImmutableList> unaryMethodSettingsBuilders() { return unaryMethodSettingsBuilders; } /** Returns the builder for the settings used for calls to getTrigger. */ public UnaryCallSettings.Builder getTriggerSettings() { return getTriggerSettings; } /** Returns the builder for the settings used for calls to listTriggers. */ public PagedCallSettings.Builder< ListTriggersRequest, ListTriggersResponse, ListTriggersPagedResponse> listTriggersSettings() { return listTriggersSettings; } /** Returns the builder for the settings used for calls to createTrigger. */ public UnaryCallSettings.Builder createTriggerSettings() { return createTriggerSettings; } /** Returns the builder for the settings used for calls to createTrigger. */ public OperationCallSettings.Builder createTriggerOperationSettings() { return createTriggerOperationSettings; } /** Returns the builder for the settings used for calls to updateTrigger. */ public UnaryCallSettings.Builder updateTriggerSettings() { return updateTriggerSettings; } /** Returns the builder for the settings used for calls to updateTrigger. */ public OperationCallSettings.Builder updateTriggerOperationSettings() { return updateTriggerOperationSettings; } /** Returns the builder for the settings used for calls to deleteTrigger. */ public UnaryCallSettings.Builder deleteTriggerSettings() { return deleteTriggerSettings; } /** Returns the builder for the settings used for calls to deleteTrigger. */ public OperationCallSettings.Builder deleteTriggerOperationSettings() { return deleteTriggerOperationSettings; } /** Returns the builder for the settings used for calls to getChannel. */ public UnaryCallSettings.Builder getChannelSettings() { return getChannelSettings; } /** Returns the builder for the settings used for calls to listChannels. */ public PagedCallSettings.Builder< ListChannelsRequest, ListChannelsResponse, ListChannelsPagedResponse> listChannelsSettings() { return listChannelsSettings; } /** Returns the builder for the settings used for calls to createChannel. */ public UnaryCallSettings.Builder createChannelSettings() { return createChannelSettings; } /** Returns the builder for the settings used for calls to createChannel. */ public OperationCallSettings.Builder createChannelOperationSettings() { return createChannelOperationSettings; } /** Returns the builder for the settings used for calls to updateChannel. */ public UnaryCallSettings.Builder updateChannelSettings() { return updateChannelSettings; } /** Returns the builder for the settings used for calls to updateChannel. */ public OperationCallSettings.Builder updateChannelOperationSettings() { return updateChannelOperationSettings; } /** Returns the builder for the settings used for calls to deleteChannel. */ public UnaryCallSettings.Builder deleteChannelSettings() { return deleteChannelSettings; } /** Returns the builder for the settings used for calls to deleteChannel. */ public OperationCallSettings.Builder deleteChannelOperationSettings() { return deleteChannelOperationSettings; } /** Returns the builder for the settings used for calls to getProvider. */ public UnaryCallSettings.Builder getProviderSettings() { return getProviderSettings; } /** Returns the builder for the settings used for calls to listProviders. */ public PagedCallSettings.Builder< ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> listProvidersSettings() { return listProvidersSettings; } /** Returns the builder for the settings used for calls to getChannelConnection. */ public UnaryCallSettings.Builder getChannelConnectionSettings() { return getChannelConnectionSettings; } /** Returns the builder for the settings used for calls to listChannelConnections. */ public PagedCallSettings.Builder< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ListChannelConnectionsPagedResponse> listChannelConnectionsSettings() { return listChannelConnectionsSettings; } /** Returns the builder for the settings used for calls to createChannelConnection. */ public UnaryCallSettings.Builder createChannelConnectionSettings() { return createChannelConnectionSettings; } /** Returns the builder for the settings used for calls to createChannelConnection. */ public OperationCallSettings.Builder< CreateChannelConnectionRequest, ChannelConnection, OperationMetadata> createChannelConnectionOperationSettings() { return createChannelConnectionOperationSettings; } /** Returns the builder for the settings used for calls to deleteChannelConnection. */ public UnaryCallSettings.Builder deleteChannelConnectionSettings() { return deleteChannelConnectionSettings; } /** Returns the builder for the settings used for calls to deleteChannelConnection. */ public OperationCallSettings.Builder< DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> deleteChannelConnectionOperationSettings() { return deleteChannelConnectionOperationSettings; } /** Returns the builder for the settings used for calls to getGoogleChannelConfig. */ public UnaryCallSettings.Builder getGoogleChannelConfigSettings() { return getGoogleChannelConfigSettings; } /** Returns the builder for the settings used for calls to updateGoogleChannelConfig. */ public UnaryCallSettings.Builder updateGoogleChannelConfigSettings() { return updateGoogleChannelConfigSettings; } /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings() { return listLocationsSettings; } /** Returns the builder for the settings used for calls to getLocation. */ public UnaryCallSettings.Builder getLocationSettings() { return getLocationSettings; } /** Returns the builder for the settings used for calls to setIamPolicy. */ public UnaryCallSettings.Builder setIamPolicySettings() { return setIamPolicySettings; } /** Returns the builder for the settings used for calls to getIamPolicy. */ public UnaryCallSettings.Builder getIamPolicySettings() { return getIamPolicySettings; } /** Returns the builder for the settings used for calls to testIamPermissions. */ public UnaryCallSettings.Builder testIamPermissionsSettings() { return testIamPermissionsSettings; } @Override public EventarcStubSettings build() throws IOException { return new EventarcStubSettings(this); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy