com.google.chat.v1.ChatServiceSettings Maven / Gradle / Ivy
Show all versions of google-cloud-chat 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.chat.v1;
import static com.google.chat.v1.ChatServiceClient.ListMembershipsPagedResponse;
import static com.google.chat.v1.ChatServiceClient.ListMessagesPagedResponse;
import static com.google.chat.v1.ChatServiceClient.ListReactionsPagedResponse;
import static com.google.chat.v1.ChatServiceClient.ListSpaceEventsPagedResponse;
import static com.google.chat.v1.ChatServiceClient.ListSpacesPagedResponse;
import static com.google.chat.v1.ChatServiceClient.SearchSpacesPagedResponse;
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.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.chat.v1.stub.ChatServiceStubSettings;
import com.google.protobuf.Empty;
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 ChatServiceClient}.
*
* The default instance has everything set to sensible defaults:
*
*
* - The default service address (chat.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
* [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
* of createMessage:
*
*
{@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
* ChatServiceSettings.Builder chatServiceSettingsBuilder = ChatServiceSettings.newBuilder();
* chatServiceSettingsBuilder
* .createMessageSettings()
* .setRetrySettings(
* chatServiceSettingsBuilder
* .createMessageSettings()
* .getRetrySettings()
* .toBuilder()
* .setInitialRetryDelayDuration(Duration.ofSeconds(1))
* .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
* .setMaxAttempts(5)
* .setMaxRetryDelayDuration(Duration.ofSeconds(30))
* .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
* .setRetryDelayMultiplier(1.3)
* .setRpcTimeoutMultiplier(1.5)
* .setTotalTimeoutDuration(Duration.ofSeconds(300))
* .build());
* ChatServiceSettings chatServiceSettings = chatServiceSettingsBuilder.build();
* }
*
* Please refer to the [Client Side Retry
* Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
* additional support in setting retries.
*/
@Generated("by gapic-generator-java")
public class ChatServiceSettings extends ClientSettings {
/** Returns the object with the settings used for calls to createMessage. */
public UnaryCallSettings createMessageSettings() {
return ((ChatServiceStubSettings) getStubSettings()).createMessageSettings();
}
/** Returns the object with the settings used for calls to listMessages. */
public PagedCallSettings
listMessagesSettings() {
return ((ChatServiceStubSettings) getStubSettings()).listMessagesSettings();
}
/** Returns the object with the settings used for calls to listMemberships. */
public PagedCallSettings<
ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse>
listMembershipsSettings() {
return ((ChatServiceStubSettings) getStubSettings()).listMembershipsSettings();
}
/** Returns the object with the settings used for calls to getMembership. */
public UnaryCallSettings getMembershipSettings() {
return ((ChatServiceStubSettings) getStubSettings()).getMembershipSettings();
}
/** Returns the object with the settings used for calls to getMessage. */
public UnaryCallSettings getMessageSettings() {
return ((ChatServiceStubSettings) getStubSettings()).getMessageSettings();
}
/** Returns the object with the settings used for calls to updateMessage. */
public UnaryCallSettings updateMessageSettings() {
return ((ChatServiceStubSettings) getStubSettings()).updateMessageSettings();
}
/** Returns the object with the settings used for calls to deleteMessage. */
public UnaryCallSettings deleteMessageSettings() {
return ((ChatServiceStubSettings) getStubSettings()).deleteMessageSettings();
}
/** Returns the object with the settings used for calls to getAttachment. */
public UnaryCallSettings getAttachmentSettings() {
return ((ChatServiceStubSettings) getStubSettings()).getAttachmentSettings();
}
/** Returns the object with the settings used for calls to uploadAttachment. */
public UnaryCallSettings
uploadAttachmentSettings() {
return ((ChatServiceStubSettings) getStubSettings()).uploadAttachmentSettings();
}
/** Returns the object with the settings used for calls to listSpaces. */
public PagedCallSettings
listSpacesSettings() {
return ((ChatServiceStubSettings) getStubSettings()).listSpacesSettings();
}
/** Returns the object with the settings used for calls to searchSpaces. */
public PagedCallSettings
searchSpacesSettings() {
return ((ChatServiceStubSettings) getStubSettings()).searchSpacesSettings();
}
/** Returns the object with the settings used for calls to getSpace. */
public UnaryCallSettings getSpaceSettings() {
return ((ChatServiceStubSettings) getStubSettings()).getSpaceSettings();
}
/** Returns the object with the settings used for calls to createSpace. */
public UnaryCallSettings createSpaceSettings() {
return ((ChatServiceStubSettings) getStubSettings()).createSpaceSettings();
}
/** Returns the object with the settings used for calls to setUpSpace. */
public UnaryCallSettings setUpSpaceSettings() {
return ((ChatServiceStubSettings) getStubSettings()).setUpSpaceSettings();
}
/** Returns the object with the settings used for calls to updateSpace. */
public UnaryCallSettings updateSpaceSettings() {
return ((ChatServiceStubSettings) getStubSettings()).updateSpaceSettings();
}
/** Returns the object with the settings used for calls to deleteSpace. */
public UnaryCallSettings deleteSpaceSettings() {
return ((ChatServiceStubSettings) getStubSettings()).deleteSpaceSettings();
}
/** Returns the object with the settings used for calls to completeImportSpace. */
public UnaryCallSettings
completeImportSpaceSettings() {
return ((ChatServiceStubSettings) getStubSettings()).completeImportSpaceSettings();
}
/** Returns the object with the settings used for calls to findDirectMessage. */
public UnaryCallSettings findDirectMessageSettings() {
return ((ChatServiceStubSettings) getStubSettings()).findDirectMessageSettings();
}
/** Returns the object with the settings used for calls to createMembership. */
public UnaryCallSettings createMembershipSettings() {
return ((ChatServiceStubSettings) getStubSettings()).createMembershipSettings();
}
/** Returns the object with the settings used for calls to updateMembership. */
public UnaryCallSettings updateMembershipSettings() {
return ((ChatServiceStubSettings) getStubSettings()).updateMembershipSettings();
}
/** Returns the object with the settings used for calls to deleteMembership. */
public UnaryCallSettings deleteMembershipSettings() {
return ((ChatServiceStubSettings) getStubSettings()).deleteMembershipSettings();
}
/** Returns the object with the settings used for calls to createReaction. */
public UnaryCallSettings createReactionSettings() {
return ((ChatServiceStubSettings) getStubSettings()).createReactionSettings();
}
/** Returns the object with the settings used for calls to listReactions. */
public PagedCallSettings
listReactionsSettings() {
return ((ChatServiceStubSettings) getStubSettings()).listReactionsSettings();
}
/** Returns the object with the settings used for calls to deleteReaction. */
public UnaryCallSettings deleteReactionSettings() {
return ((ChatServiceStubSettings) getStubSettings()).deleteReactionSettings();
}
/** Returns the object with the settings used for calls to getSpaceReadState. */
public UnaryCallSettings getSpaceReadStateSettings() {
return ((ChatServiceStubSettings) getStubSettings()).getSpaceReadStateSettings();
}
/** Returns the object with the settings used for calls to updateSpaceReadState. */
public UnaryCallSettings
updateSpaceReadStateSettings() {
return ((ChatServiceStubSettings) getStubSettings()).updateSpaceReadStateSettings();
}
/** Returns the object with the settings used for calls to getThreadReadState. */
public UnaryCallSettings
getThreadReadStateSettings() {
return ((ChatServiceStubSettings) getStubSettings()).getThreadReadStateSettings();
}
/** Returns the object with the settings used for calls to getSpaceEvent. */
public UnaryCallSettings getSpaceEventSettings() {
return ((ChatServiceStubSettings) getStubSettings()).getSpaceEventSettings();
}
/** Returns the object with the settings used for calls to listSpaceEvents. */
public PagedCallSettings<
ListSpaceEventsRequest, ListSpaceEventsResponse, ListSpaceEventsPagedResponse>
listSpaceEventsSettings() {
return ((ChatServiceStubSettings) getStubSettings()).listSpaceEventsSettings();
}
public static final ChatServiceSettings create(ChatServiceStubSettings stub) throws IOException {
return new ChatServiceSettings.Builder(stub.toBuilder()).build();
}
/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return ChatServiceStubSettings.defaultExecutorProviderBuilder();
}
/** Returns the default service endpoint. */
public static String getDefaultEndpoint() {
return ChatServiceStubSettings.getDefaultEndpoint();
}
/** Returns the default service scopes. */
public static List getDefaultServiceScopes() {
return ChatServiceStubSettings.getDefaultServiceScopes();
}
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
return ChatServiceStubSettings.defaultCredentialsProviderBuilder();
}
/** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return ChatServiceStubSettings.defaultGrpcTransportProviderBuilder();
}
/** Returns a builder for the default REST ChannelProvider for this service. */
@BetaApi
public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder() {
return ChatServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
}
public static TransportChannelProvider defaultTransportChannelProvider() {
return ChatServiceStubSettings.defaultTransportChannelProvider();
}
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return ChatServiceStubSettings.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 ChatServiceSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
}
/** Builder for ChatServiceSettings. */
public static class Builder extends ClientSettings.Builder {
protected Builder() throws IOException {
this(((ClientContext) null));
}
protected Builder(ClientContext clientContext) {
super(ChatServiceStubSettings.newBuilder(clientContext));
}
protected Builder(ChatServiceSettings settings) {
super(settings.getStubSettings().toBuilder());
}
protected Builder(ChatServiceStubSettings.Builder stubSettings) {
super(stubSettings);
}
private static Builder createDefault() {
return new Builder(ChatServiceStubSettings.newBuilder());
}
private static Builder createHttpJsonDefault() {
return new Builder(ChatServiceStubSettings.newHttpJsonBuilder());
}
public ChatServiceStubSettings.Builder getStubSettingsBuilder() {
return ((ChatServiceStubSettings.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 createMessage. */
public UnaryCallSettings.Builder createMessageSettings() {
return getStubSettingsBuilder().createMessageSettings();
}
/** Returns the builder for the settings used for calls to listMessages. */
public PagedCallSettings.Builder<
ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse>
listMessagesSettings() {
return getStubSettingsBuilder().listMessagesSettings();
}
/** Returns the builder for the settings used for calls to listMemberships. */
public PagedCallSettings.Builder<
ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse>
listMembershipsSettings() {
return getStubSettingsBuilder().listMembershipsSettings();
}
/** Returns the builder for the settings used for calls to getMembership. */
public UnaryCallSettings.Builder getMembershipSettings() {
return getStubSettingsBuilder().getMembershipSettings();
}
/** Returns the builder for the settings used for calls to getMessage. */
public UnaryCallSettings.Builder getMessageSettings() {
return getStubSettingsBuilder().getMessageSettings();
}
/** Returns the builder for the settings used for calls to updateMessage. */
public UnaryCallSettings.Builder updateMessageSettings() {
return getStubSettingsBuilder().updateMessageSettings();
}
/** Returns the builder for the settings used for calls to deleteMessage. */
public UnaryCallSettings.Builder deleteMessageSettings() {
return getStubSettingsBuilder().deleteMessageSettings();
}
/** Returns the builder for the settings used for calls to getAttachment. */
public UnaryCallSettings.Builder getAttachmentSettings() {
return getStubSettingsBuilder().getAttachmentSettings();
}
/** Returns the builder for the settings used for calls to uploadAttachment. */
public UnaryCallSettings.Builder
uploadAttachmentSettings() {
return getStubSettingsBuilder().uploadAttachmentSettings();
}
/** Returns the builder for the settings used for calls to listSpaces. */
public PagedCallSettings.Builder
listSpacesSettings() {
return getStubSettingsBuilder().listSpacesSettings();
}
/** Returns the builder for the settings used for calls to searchSpaces. */
public PagedCallSettings.Builder<
SearchSpacesRequest, SearchSpacesResponse, SearchSpacesPagedResponse>
searchSpacesSettings() {
return getStubSettingsBuilder().searchSpacesSettings();
}
/** Returns the builder for the settings used for calls to getSpace. */
public UnaryCallSettings.Builder getSpaceSettings() {
return getStubSettingsBuilder().getSpaceSettings();
}
/** Returns the builder for the settings used for calls to createSpace. */
public UnaryCallSettings.Builder createSpaceSettings() {
return getStubSettingsBuilder().createSpaceSettings();
}
/** Returns the builder for the settings used for calls to setUpSpace. */
public UnaryCallSettings.Builder setUpSpaceSettings() {
return getStubSettingsBuilder().setUpSpaceSettings();
}
/** Returns the builder for the settings used for calls to updateSpace. */
public UnaryCallSettings.Builder updateSpaceSettings() {
return getStubSettingsBuilder().updateSpaceSettings();
}
/** Returns the builder for the settings used for calls to deleteSpace. */
public UnaryCallSettings.Builder deleteSpaceSettings() {
return getStubSettingsBuilder().deleteSpaceSettings();
}
/** Returns the builder for the settings used for calls to completeImportSpace. */
public UnaryCallSettings.Builder
completeImportSpaceSettings() {
return getStubSettingsBuilder().completeImportSpaceSettings();
}
/** Returns the builder for the settings used for calls to findDirectMessage. */
public UnaryCallSettings.Builder findDirectMessageSettings() {
return getStubSettingsBuilder().findDirectMessageSettings();
}
/** Returns the builder for the settings used for calls to createMembership. */
public UnaryCallSettings.Builder
createMembershipSettings() {
return getStubSettingsBuilder().createMembershipSettings();
}
/** Returns the builder for the settings used for calls to updateMembership. */
public UnaryCallSettings.Builder
updateMembershipSettings() {
return getStubSettingsBuilder().updateMembershipSettings();
}
/** Returns the builder for the settings used for calls to deleteMembership. */
public UnaryCallSettings.Builder
deleteMembershipSettings() {
return getStubSettingsBuilder().deleteMembershipSettings();
}
/** Returns the builder for the settings used for calls to createReaction. */
public UnaryCallSettings.Builder createReactionSettings() {
return getStubSettingsBuilder().createReactionSettings();
}
/** Returns the builder for the settings used for calls to listReactions. */
public PagedCallSettings.Builder<
ListReactionsRequest, ListReactionsResponse, ListReactionsPagedResponse>
listReactionsSettings() {
return getStubSettingsBuilder().listReactionsSettings();
}
/** Returns the builder for the settings used for calls to deleteReaction. */
public UnaryCallSettings.Builder deleteReactionSettings() {
return getStubSettingsBuilder().deleteReactionSettings();
}
/** Returns the builder for the settings used for calls to getSpaceReadState. */
public UnaryCallSettings.Builder
getSpaceReadStateSettings() {
return getStubSettingsBuilder().getSpaceReadStateSettings();
}
/** Returns the builder for the settings used for calls to updateSpaceReadState. */
public UnaryCallSettings.Builder
updateSpaceReadStateSettings() {
return getStubSettingsBuilder().updateSpaceReadStateSettings();
}
/** Returns the builder for the settings used for calls to getThreadReadState. */
public UnaryCallSettings.Builder
getThreadReadStateSettings() {
return getStubSettingsBuilder().getThreadReadStateSettings();
}
/** Returns the builder for the settings used for calls to getSpaceEvent. */
public UnaryCallSettings.Builder getSpaceEventSettings() {
return getStubSettingsBuilder().getSpaceEventSettings();
}
/** Returns the builder for the settings used for calls to listSpaceEvents. */
public PagedCallSettings.Builder<
ListSpaceEventsRequest, ListSpaceEventsResponse, ListSpaceEventsPagedResponse>
listSpaceEventsSettings() {
return getStubSettingsBuilder().listSpaceEventsSettings();
}
@Override
public ChatServiceSettings build() throws IOException {
return new ChatServiceSettings(this);
}
}
}