|
| 1 | +/* |
| 2 | + * Copyright 2021 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.cloud.dialogflow.cx.v3; |
| 18 | + |
| 19 | +import static com.google.cloud.dialogflow.cx.v3.ChangelogsClient.ListChangelogsPagedResponse; |
| 20 | + |
| 21 | +import com.google.api.core.ApiFunction; |
| 22 | +import com.google.api.core.BetaApi; |
| 23 | +import com.google.api.gax.core.GoogleCredentialsProvider; |
| 24 | +import com.google.api.gax.core.InstantiatingExecutorProvider; |
| 25 | +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; |
| 26 | +import com.google.api.gax.rpc.ApiClientHeaderProvider; |
| 27 | +import com.google.api.gax.rpc.ClientContext; |
| 28 | +import com.google.api.gax.rpc.ClientSettings; |
| 29 | +import com.google.api.gax.rpc.PagedCallSettings; |
| 30 | +import com.google.api.gax.rpc.TransportChannelProvider; |
| 31 | +import com.google.api.gax.rpc.UnaryCallSettings; |
| 32 | +import com.google.cloud.dialogflow.cx.v3.stub.ChangelogsStubSettings; |
| 33 | +import java.io.IOException; |
| 34 | +import java.util.List; |
| 35 | +import javax.annotation.Generated; |
| 36 | + |
| 37 | +// AUTO-GENERATED DOCUMENTATION AND CLASS. |
| 38 | +/** |
| 39 | + * Settings class to configure an instance of {@link ChangelogsClient}. |
| 40 | + * |
| 41 | + * <p>The default instance has everything set to sensible defaults: |
| 42 | + * |
| 43 | + * <ul> |
| 44 | + * <li>The default service address (dialogflow.googleapis.com) and default port (443) are used. |
| 45 | + * <li>Credentials are acquired automatically through Application Default Credentials. |
| 46 | + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. |
| 47 | + * </ul> |
| 48 | + * |
| 49 | + * <p>The builder of this class is recursive, so contained classes are themselves builders. When |
| 50 | + * build() is called, the tree of builders is called to create the complete settings object. |
| 51 | + * |
| 52 | + * <p>For example, to set the total timeout of getChangelog to 30 seconds: |
| 53 | + * |
| 54 | + * <pre>{@code |
| 55 | + * ChangelogsSettings.Builder changelogsSettingsBuilder = ChangelogsSettings.newBuilder(); |
| 56 | + * changelogsSettingsBuilder |
| 57 | + * .getChangelogSettings() |
| 58 | + * .setRetrySettings( |
| 59 | + * changelogsSettingsBuilder |
| 60 | + * .getChangelogSettings() |
| 61 | + * .getRetrySettings() |
| 62 | + * .toBuilder() |
| 63 | + * .setTotalTimeout(Duration.ofSeconds(30)) |
| 64 | + * .build()); |
| 65 | + * ChangelogsSettings changelogsSettings = changelogsSettingsBuilder.build(); |
| 66 | + * }</pre> |
| 67 | + */ |
| 68 | +@Generated("by gapic-generator-java") |
| 69 | +public class ChangelogsSettings extends ClientSettings<ChangelogsSettings> { |
| 70 | + |
| 71 | + /** Returns the object with the settings used for calls to listChangelogs. */ |
| 72 | + public PagedCallSettings< |
| 73 | + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> |
| 74 | + listChangelogsSettings() { |
| 75 | + return ((ChangelogsStubSettings) getStubSettings()).listChangelogsSettings(); |
| 76 | + } |
| 77 | + |
| 78 | + /** Returns the object with the settings used for calls to getChangelog. */ |
| 79 | + public UnaryCallSettings<GetChangelogRequest, Changelog> getChangelogSettings() { |
| 80 | + return ((ChangelogsStubSettings) getStubSettings()).getChangelogSettings(); |
| 81 | + } |
| 82 | + |
| 83 | + public static final ChangelogsSettings create(ChangelogsStubSettings stub) throws IOException { |
| 84 | + return new ChangelogsSettings.Builder(stub.toBuilder()).build(); |
| 85 | + } |
| 86 | + |
| 87 | + /** Returns a builder for the default ExecutorProvider for this service. */ |
| 88 | + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { |
| 89 | + return ChangelogsStubSettings.defaultExecutorProviderBuilder(); |
| 90 | + } |
| 91 | + |
| 92 | + /** Returns the default service endpoint. */ |
| 93 | + public static String getDefaultEndpoint() { |
| 94 | + return ChangelogsStubSettings.getDefaultEndpoint(); |
| 95 | + } |
| 96 | + |
| 97 | + /** Returns the default service scopes. */ |
| 98 | + public static List<String> getDefaultServiceScopes() { |
| 99 | + return ChangelogsStubSettings.getDefaultServiceScopes(); |
| 100 | + } |
| 101 | + |
| 102 | + /** Returns a builder for the default credentials for this service. */ |
| 103 | + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { |
| 104 | + return ChangelogsStubSettings.defaultCredentialsProviderBuilder(); |
| 105 | + } |
| 106 | + |
| 107 | + /** Returns a builder for the default ChannelProvider for this service. */ |
| 108 | + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { |
| 109 | + return ChangelogsStubSettings.defaultGrpcTransportProviderBuilder(); |
| 110 | + } |
| 111 | + |
| 112 | + public static TransportChannelProvider defaultTransportChannelProvider() { |
| 113 | + return ChangelogsStubSettings.defaultTransportChannelProvider(); |
| 114 | + } |
| 115 | + |
| 116 | + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") |
| 117 | + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { |
| 118 | + return ChangelogsStubSettings.defaultApiClientHeaderProviderBuilder(); |
| 119 | + } |
| 120 | + |
| 121 | + /** Returns a new builder for this class. */ |
| 122 | + public static Builder newBuilder() { |
| 123 | + return Builder.createDefault(); |
| 124 | + } |
| 125 | + |
| 126 | + /** Returns a new builder for this class. */ |
| 127 | + public static Builder newBuilder(ClientContext clientContext) { |
| 128 | + return new Builder(clientContext); |
| 129 | + } |
| 130 | + |
| 131 | + /** Returns a builder containing all the values of this settings class. */ |
| 132 | + public Builder toBuilder() { |
| 133 | + return new Builder(this); |
| 134 | + } |
| 135 | + |
| 136 | + protected ChangelogsSettings(Builder settingsBuilder) throws IOException { |
| 137 | + super(settingsBuilder); |
| 138 | + } |
| 139 | + |
| 140 | + /** Builder for ChangelogsSettings. */ |
| 141 | + public static class Builder extends ClientSettings.Builder<ChangelogsSettings, Builder> { |
| 142 | + |
| 143 | + protected Builder() throws IOException { |
| 144 | + this(((ClientContext) null)); |
| 145 | + } |
| 146 | + |
| 147 | + protected Builder(ClientContext clientContext) { |
| 148 | + super(ChangelogsStubSettings.newBuilder(clientContext)); |
| 149 | + } |
| 150 | + |
| 151 | + protected Builder(ChangelogsSettings settings) { |
| 152 | + super(settings.getStubSettings().toBuilder()); |
| 153 | + } |
| 154 | + |
| 155 | + protected Builder(ChangelogsStubSettings.Builder stubSettings) { |
| 156 | + super(stubSettings); |
| 157 | + } |
| 158 | + |
| 159 | + private static Builder createDefault() { |
| 160 | + return new Builder(ChangelogsStubSettings.newBuilder()); |
| 161 | + } |
| 162 | + |
| 163 | + public ChangelogsStubSettings.Builder getStubSettingsBuilder() { |
| 164 | + return ((ChangelogsStubSettings.Builder) getStubSettings()); |
| 165 | + } |
| 166 | + |
| 167 | + /** |
| 168 | + * Applies the given settings updater function to all of the unary API methods in this service. |
| 169 | + * |
| 170 | + * <p>Note: This method does not support applying settings to streaming methods. |
| 171 | + */ |
| 172 | + public Builder applyToAllUnaryMethods( |
| 173 | + ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { |
| 174 | + super.applyToAllUnaryMethods( |
| 175 | + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); |
| 176 | + return this; |
| 177 | + } |
| 178 | + |
| 179 | + /** Returns the builder for the settings used for calls to listChangelogs. */ |
| 180 | + public PagedCallSettings.Builder< |
| 181 | + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> |
| 182 | + listChangelogsSettings() { |
| 183 | + return getStubSettingsBuilder().listChangelogsSettings(); |
| 184 | + } |
| 185 | + |
| 186 | + /** Returns the builder for the settings used for calls to getChangelog. */ |
| 187 | + public UnaryCallSettings.Builder<GetChangelogRequest, Changelog> getChangelogSettings() { |
| 188 | + return getStubSettingsBuilder().getChangelogSettings(); |
| 189 | + } |
| 190 | + |
| 191 | + @Override |
| 192 | + public ChangelogsSettings build() throws IOException { |
| 193 | + return new ChangelogsSettings(this); |
| 194 | + } |
| 195 | + } |
| 196 | +} |
0 commit comments