com.google.cloud.eventarc.v1.EventarcSettings Maven / Gradle / Ivy
Show all versions of google-cloud-eventarc Show documentation
/*
* 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 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.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
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.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;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link EventarcClient}.
*
* 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
* EventarcSettings.Builder eventarcSettingsBuilder = EventarcSettings.newBuilder();
* eventarcSettingsBuilder
* .getTriggerSettings()
* .setRetrySettings(
* eventarcSettingsBuilder
* .getTriggerSettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* EventarcSettings eventarcSettings = eventarcSettingsBuilder.build();
* }
*/
@Generated("by gapic-generator-java")
public class EventarcSettings extends ClientSettings {
/** Returns the object with the settings used for calls to getTrigger. */
public UnaryCallSettings getTriggerSettings() {
return ((EventarcStubSettings) getStubSettings()).getTriggerSettings();
}
/** Returns the object with the settings used for calls to listTriggers. */
public PagedCallSettings
listTriggersSettings() {
return ((EventarcStubSettings) getStubSettings()).listTriggersSettings();
}
/** Returns the object with the settings used for calls to createTrigger. */
public UnaryCallSettings createTriggerSettings() {
return ((EventarcStubSettings) getStubSettings()).createTriggerSettings();
}
/** Returns the object with the settings used for calls to createTrigger. */
public OperationCallSettings
createTriggerOperationSettings() {
return ((EventarcStubSettings) getStubSettings()).createTriggerOperationSettings();
}
/** Returns the object with the settings used for calls to updateTrigger. */
public UnaryCallSettings updateTriggerSettings() {
return ((EventarcStubSettings) getStubSettings()).updateTriggerSettings();
}
/** Returns the object with the settings used for calls to updateTrigger. */
public OperationCallSettings
updateTriggerOperationSettings() {
return ((EventarcStubSettings) getStubSettings()).updateTriggerOperationSettings();
}
/** Returns the object with the settings used for calls to deleteTrigger. */
public UnaryCallSettings deleteTriggerSettings() {
return ((EventarcStubSettings) getStubSettings()).deleteTriggerSettings();
}
/** Returns the object with the settings used for calls to deleteTrigger. */
public OperationCallSettings
deleteTriggerOperationSettings() {
return ((EventarcStubSettings) getStubSettings()).deleteTriggerOperationSettings();
}
/** Returns the object with the settings used for calls to getChannel. */
public UnaryCallSettings getChannelSettings() {
return ((EventarcStubSettings) getStubSettings()).getChannelSettings();
}
/** Returns the object with the settings used for calls to listChannels. */
public PagedCallSettings
listChannelsSettings() {
return ((EventarcStubSettings) getStubSettings()).listChannelsSettings();
}
/** Returns the object with the settings used for calls to createChannel. */
public UnaryCallSettings createChannelSettings() {
return ((EventarcStubSettings) getStubSettings()).createChannelSettings();
}
/** Returns the object with the settings used for calls to createChannel. */
public OperationCallSettings
createChannelOperationSettings() {
return ((EventarcStubSettings) getStubSettings()).createChannelOperationSettings();
}
/** Returns the object with the settings used for calls to updateChannel. */
public UnaryCallSettings updateChannelSettings() {
return ((EventarcStubSettings) getStubSettings()).updateChannelSettings();
}
/** Returns the object with the settings used for calls to updateChannel. */
public OperationCallSettings
updateChannelOperationSettings() {
return ((EventarcStubSettings) getStubSettings()).updateChannelOperationSettings();
}
/** Returns the object with the settings used for calls to deleteChannel. */
public UnaryCallSettings deleteChannelSettings() {
return ((EventarcStubSettings) getStubSettings()).deleteChannelSettings();
}
/** Returns the object with the settings used for calls to deleteChannel. */
public OperationCallSettings
deleteChannelOperationSettings() {
return ((EventarcStubSettings) getStubSettings()).deleteChannelOperationSettings();
}
/** Returns the object with the settings used for calls to getProvider. */
public UnaryCallSettings getProviderSettings() {
return ((EventarcStubSettings) getStubSettings()).getProviderSettings();
}
/** Returns the object with the settings used for calls to listProviders. */
public PagedCallSettings
listProvidersSettings() {
return ((EventarcStubSettings) getStubSettings()).listProvidersSettings();
}
/** Returns the object with the settings used for calls to getChannelConnection. */
public UnaryCallSettings
getChannelConnectionSettings() {
return ((EventarcStubSettings) getStubSettings()).getChannelConnectionSettings();
}
/** Returns the object with the settings used for calls to listChannelConnections. */
public PagedCallSettings<
ListChannelConnectionsRequest,
ListChannelConnectionsResponse,
ListChannelConnectionsPagedResponse>
listChannelConnectionsSettings() {
return ((EventarcStubSettings) getStubSettings()).listChannelConnectionsSettings();
}
/** Returns the object with the settings used for calls to createChannelConnection. */
public UnaryCallSettings
createChannelConnectionSettings() {
return ((EventarcStubSettings) getStubSettings()).createChannelConnectionSettings();
}
/** Returns the object with the settings used for calls to createChannelConnection. */
public OperationCallSettings
createChannelConnectionOperationSettings() {
return ((EventarcStubSettings) getStubSettings()).createChannelConnectionOperationSettings();
}
/** Returns the object with the settings used for calls to deleteChannelConnection. */
public UnaryCallSettings
deleteChannelConnectionSettings() {
return ((EventarcStubSettings) getStubSettings()).deleteChannelConnectionSettings();
}
/** Returns the object with the settings used for calls to deleteChannelConnection. */
public OperationCallSettings
deleteChannelConnectionOperationSettings() {
return ((EventarcStubSettings) getStubSettings()).deleteChannelConnectionOperationSettings();
}
/** Returns the object with the settings used for calls to getGoogleChannelConfig. */
public UnaryCallSettings
getGoogleChannelConfigSettings() {
return ((EventarcStubSettings) getStubSettings()).getGoogleChannelConfigSettings();
}
/** Returns the object with the settings used for calls to updateGoogleChannelConfig. */
public UnaryCallSettings
updateGoogleChannelConfigSettings() {
return ((EventarcStubSettings) getStubSettings()).updateGoogleChannelConfigSettings();
}
/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings
listLocationsSettings() {
return ((EventarcStubSettings) getStubSettings()).listLocationsSettings();
}
/** Returns the object with the settings used for calls to getLocation. */
public UnaryCallSettings getLocationSettings() {
return ((EventarcStubSettings) getStubSettings()).getLocationSettings();
}
/** Returns the object with the settings used for calls to setIamPolicy. */
public UnaryCallSettings setIamPolicySettings() {
return ((EventarcStubSettings) getStubSettings()).setIamPolicySettings();
}
/** Returns the object with the settings used for calls to getIamPolicy. */
public UnaryCallSettings getIamPolicySettings() {
return ((EventarcStubSettings) getStubSettings()).getIamPolicySettings();
}
/** Returns the object with the settings used for calls to testIamPermissions. */
public UnaryCallSettings
testIamPermissionsSettings() {
return ((EventarcStubSettings) getStubSettings()).testIamPermissionsSettings();
}
public static final EventarcSettings create(EventarcStubSettings stub) throws IOException {
return new EventarcSettings.Builder(stub.toBuilder()).build();
}
/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return EventarcStubSettings.defaultExecutorProviderBuilder();
}
/** Returns the default service endpoint. */
public static String getDefaultEndpoint() {
return EventarcStubSettings.getDefaultEndpoint();
}
/** Returns the default service scopes. */
public static List getDefaultServiceScopes() {
return EventarcStubSettings.getDefaultServiceScopes();
}
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
return EventarcStubSettings.defaultCredentialsProviderBuilder();
}
/** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return EventarcStubSettings.defaultGrpcTransportProviderBuilder();
}
/** Returns a builder for the default REST ChannelProvider for this service. */
@BetaApi
public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder() {
return EventarcStubSettings.defaultHttpJsonTransportProviderBuilder();
}
public static TransportChannelProvider defaultTransportChannelProvider() {
return EventarcStubSettings.defaultTransportChannelProvider();
}
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return EventarcStubSettings.defaultApiClientHeaderProviderBuilder();
}
/** 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 EventarcSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
}
/** Builder for EventarcSettings. */
public static class Builder extends ClientSettings.Builder {
protected Builder() throws IOException {
this(((ClientContext) null));
}
protected Builder(ClientContext clientContext) {
super(EventarcStubSettings.newBuilder(clientContext));
}
protected Builder(EventarcSettings settings) {
super(settings.getStubSettings().toBuilder());
}
protected Builder(EventarcStubSettings.Builder stubSettings) {
super(stubSettings);
}
private static Builder createDefault() {
return new Builder(EventarcStubSettings.newBuilder());
}
private static Builder createHttpJsonDefault() {
return new Builder(EventarcStubSettings.newHttpJsonBuilder());
}
public EventarcStubSettings.Builder getStubSettingsBuilder() {
return ((EventarcStubSettings.Builder) getStubSettings());
}
/**
* 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(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
}
/** Returns the builder for the settings used for calls to getTrigger. */
public UnaryCallSettings.Builder getTriggerSettings() {
return getStubSettingsBuilder().getTriggerSettings();
}
/** Returns the builder for the settings used for calls to listTriggers. */
public PagedCallSettings.Builder<
ListTriggersRequest, ListTriggersResponse, ListTriggersPagedResponse>
listTriggersSettings() {
return getStubSettingsBuilder().listTriggersSettings();
}
/** Returns the builder for the settings used for calls to createTrigger. */
public UnaryCallSettings.Builder createTriggerSettings() {
return getStubSettingsBuilder().createTriggerSettings();
}
/** Returns the builder for the settings used for calls to createTrigger. */
public OperationCallSettings.Builder
createTriggerOperationSettings() {
return getStubSettingsBuilder().createTriggerOperationSettings();
}
/** Returns the builder for the settings used for calls to updateTrigger. */
public UnaryCallSettings.Builder updateTriggerSettings() {
return getStubSettingsBuilder().updateTriggerSettings();
}
/** Returns the builder for the settings used for calls to updateTrigger. */
public OperationCallSettings.Builder
updateTriggerOperationSettings() {
return getStubSettingsBuilder().updateTriggerOperationSettings();
}
/** Returns the builder for the settings used for calls to deleteTrigger. */
public UnaryCallSettings.Builder deleteTriggerSettings() {
return getStubSettingsBuilder().deleteTriggerSettings();
}
/** Returns the builder for the settings used for calls to deleteTrigger. */
public OperationCallSettings.Builder
deleteTriggerOperationSettings() {
return getStubSettingsBuilder().deleteTriggerOperationSettings();
}
/** Returns the builder for the settings used for calls to getChannel. */
public UnaryCallSettings.Builder getChannelSettings() {
return getStubSettingsBuilder().getChannelSettings();
}
/** Returns the builder for the settings used for calls to listChannels. */
public PagedCallSettings.Builder<
ListChannelsRequest, ListChannelsResponse, ListChannelsPagedResponse>
listChannelsSettings() {
return getStubSettingsBuilder().listChannelsSettings();
}
/** Returns the builder for the settings used for calls to createChannel. */
public UnaryCallSettings.Builder createChannelSettings() {
return getStubSettingsBuilder().createChannelSettings();
}
/** Returns the builder for the settings used for calls to createChannel. */
public OperationCallSettings.Builder
createChannelOperationSettings() {
return getStubSettingsBuilder().createChannelOperationSettings();
}
/** Returns the builder for the settings used for calls to updateChannel. */
public UnaryCallSettings.Builder updateChannelSettings() {
return getStubSettingsBuilder().updateChannelSettings();
}
/** Returns the builder for the settings used for calls to updateChannel. */
public OperationCallSettings.Builder
updateChannelOperationSettings() {
return getStubSettingsBuilder().updateChannelOperationSettings();
}
/** Returns the builder for the settings used for calls to deleteChannel. */
public UnaryCallSettings.Builder deleteChannelSettings() {
return getStubSettingsBuilder().deleteChannelSettings();
}
/** Returns the builder for the settings used for calls to deleteChannel. */
public OperationCallSettings.Builder
deleteChannelOperationSettings() {
return getStubSettingsBuilder().deleteChannelOperationSettings();
}
/** Returns the builder for the settings used for calls to getProvider. */
public UnaryCallSettings.Builder getProviderSettings() {
return getStubSettingsBuilder().getProviderSettings();
}
/** Returns the builder for the settings used for calls to listProviders. */
public PagedCallSettings.Builder<
ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>
listProvidersSettings() {
return getStubSettingsBuilder().listProvidersSettings();
}
/** Returns the builder for the settings used for calls to getChannelConnection. */
public UnaryCallSettings.Builder
getChannelConnectionSettings() {
return getStubSettingsBuilder().getChannelConnectionSettings();
}
/** Returns the builder for the settings used for calls to listChannelConnections. */
public PagedCallSettings.Builder<
ListChannelConnectionsRequest,
ListChannelConnectionsResponse,
ListChannelConnectionsPagedResponse>
listChannelConnectionsSettings() {
return getStubSettingsBuilder().listChannelConnectionsSettings();
}
/** Returns the builder for the settings used for calls to createChannelConnection. */
public UnaryCallSettings.Builder
createChannelConnectionSettings() {
return getStubSettingsBuilder().createChannelConnectionSettings();
}
/** Returns the builder for the settings used for calls to createChannelConnection. */
public OperationCallSettings.Builder<
CreateChannelConnectionRequest, ChannelConnection, OperationMetadata>
createChannelConnectionOperationSettings() {
return getStubSettingsBuilder().createChannelConnectionOperationSettings();
}
/** Returns the builder for the settings used for calls to deleteChannelConnection. */
public UnaryCallSettings.Builder
deleteChannelConnectionSettings() {
return getStubSettingsBuilder().deleteChannelConnectionSettings();
}
/** Returns the builder for the settings used for calls to deleteChannelConnection. */
public OperationCallSettings.Builder<
DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata>
deleteChannelConnectionOperationSettings() {
return getStubSettingsBuilder().deleteChannelConnectionOperationSettings();
}
/** Returns the builder for the settings used for calls to getGoogleChannelConfig. */
public UnaryCallSettings.Builder
getGoogleChannelConfigSettings() {
return getStubSettingsBuilder().getGoogleChannelConfigSettings();
}
/** Returns the builder for the settings used for calls to updateGoogleChannelConfig. */
public UnaryCallSettings.Builder
updateGoogleChannelConfigSettings() {
return getStubSettingsBuilder().updateGoogleChannelConfigSettings();
}
/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
return getStubSettingsBuilder().listLocationsSettings();
}
/** Returns the builder for the settings used for calls to getLocation. */
public UnaryCallSettings.Builder getLocationSettings() {
return getStubSettingsBuilder().getLocationSettings();
}
/** Returns the builder for the settings used for calls to setIamPolicy. */
public UnaryCallSettings.Builder setIamPolicySettings() {
return getStubSettingsBuilder().setIamPolicySettings();
}
/** Returns the builder for the settings used for calls to getIamPolicy. */
public UnaryCallSettings.Builder getIamPolicySettings() {
return getStubSettingsBuilder().getIamPolicySettings();
}
/** Returns the builder for the settings used for calls to testIamPermissions. */
public UnaryCallSettings.Builder
testIamPermissionsSettings() {
return getStubSettingsBuilder().testIamPermissionsSettings();
}
@Override
public EventarcSettings build() throws IOException {
return new EventarcSettings(this);
}
}
}