| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 415aefb commit 5573023
471 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,274 @@ | |||
| 1 | + /* | ||
| 2 | + * Copyright 2022 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.dataproc.v1; | ||
| 18 | + | ||
| 19 | + import static com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient.ListAutoscalingPoliciesPagedResponse; | ||
| 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.httpjson.InstantiatingHttpJsonChannelProvider; | ||
| 27 | + import com.google.api.gax.rpc.ApiClientHeaderProvider; | ||
| 28 | + import com.google.api.gax.rpc.ClientContext; | ||
| 29 | + import com.google.api.gax.rpc.ClientSettings; | ||
| 30 | + import com.google.api.gax.rpc.PagedCallSettings; | ||
| 31 | + import com.google.api.gax.rpc.StubSettings; | ||
| 32 | + import com.google.api.gax.rpc.TransportChannelProvider; | ||
| 33 | + import com.google.api.gax.rpc.UnaryCallSettings; | ||
| 34 | + import com.google.cloud.dataproc.v1.stub.AutoscalingPolicyServiceStubSettings; | ||
| 35 | + import com.google.protobuf.Empty; | ||
| 36 | + import java.io.IOException; | ||
| 37 | + import java.util.List; | ||
| 38 | + import javax.annotation.Generated; | ||
| 39 | + | ||
| 40 | + // AUTO-GENERATED DOCUMENTATION AND CLASS. | ||
| 41 | + /** | ||
| 42 | + * Settings class to configure an instance of {@link AutoscalingPolicyServiceClient}. | ||
| 43 | + * | ||
| 44 | + * <p>The default instance has everything set to sensible defaults: | ||
| 45 | + * | ||
| 46 | + * <ul> | ||
| 47 | + * <li>The default service address (dataproc.googleapis.com) and default port (443) are used. | ||
| 48 | + * <li>Credentials are acquired automatically through Application Default Credentials. | ||
| 49 | + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. | ||
| 50 | + * </ul> | ||
| 51 | + * | ||
| 52 | + * <p>The builder of this class is recursive, so contained classes are themselves builders. When | ||
| 53 | + * build() is called, the tree of builders is called to create the complete settings object. | ||
| 54 | + * | ||
| 55 | + * <p>For example, to set the total timeout of createAutoscalingPolicy to 30 seconds: | ||
| 56 | + * | ||
| 57 | + * <pre>{@code | ||
| 58 | + * // This snippet has been automatically generated and should be regarded as a code template only. | ||
| 59 | + * // It will require modifications to work: | ||
| 60 | + * // - It may require correct/in-range values for request initialization. | ||
| 61 | + * // - It may require specifying regional endpoints when creating the service client as shown in | ||
| 62 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library | ||
| 63 | + * AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder = | ||
| 64 | + * AutoscalingPolicyServiceSettings.newBuilder(); | ||
| 65 | + * autoscalingPolicyServiceSettingsBuilder | ||
| 66 | + * .createAutoscalingPolicySettings() | ||
| 67 | + * .setRetrySettings( | ||
| 68 | + * autoscalingPolicyServiceSettingsBuilder | ||
| 69 | + * .createAutoscalingPolicySettings() | ||
| 70 | + * .getRetrySettings() | ||
| 71 | + * .toBuilder() | ||
| 72 | + * .setTotalTimeout(Duration.ofSeconds(30)) | ||
| 73 | + * .build()); | ||
| 74 | + * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = | ||
| 75 | + * autoscalingPolicyServiceSettingsBuilder.build(); | ||
| 76 | + * }</pre> | ||
| 77 | + */ | ||
| 78 | + @Generated("by gapic-generator-java") | ||
| 79 | + public class AutoscalingPolicyServiceSettings | ||
| 80 | + extends ClientSettings<AutoscalingPolicyServiceSettings> { | ||
| 81 | + | ||
| 82 | + /** Returns the object with the settings used for calls to createAutoscalingPolicy. */ | ||
| 83 | + public UnaryCallSettings<CreateAutoscalingPolicyRequest, AutoscalingPolicy> | ||
| 84 | + createAutoscalingPolicySettings() { | ||
| 85 | + return ((AutoscalingPolicyServiceStubSettings) getStubSettings()) | ||
| 86 | + .createAutoscalingPolicySettings(); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + /** Returns the object with the settings used for calls to updateAutoscalingPolicy. */ | ||
| 90 | + public UnaryCallSettings<UpdateAutoscalingPolicyRequest, AutoscalingPolicy> | ||
| 91 | + updateAutoscalingPolicySettings() { | ||
| 92 | + return ((AutoscalingPolicyServiceStubSettings) getStubSettings()) | ||
| 93 | + .updateAutoscalingPolicySettings(); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + /** Returns the object with the settings used for calls to getAutoscalingPolicy. */ | ||
| 97 | + public UnaryCallSettings<GetAutoscalingPolicyRequest, AutoscalingPolicy> | ||
| 98 | + getAutoscalingPolicySettings() { | ||
| 99 | + return ((AutoscalingPolicyServiceStubSettings) getStubSettings()) | ||
| 100 | + .getAutoscalingPolicySettings(); | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + /** Returns the object with the settings used for calls to listAutoscalingPolicies. */ | ||
| 104 | + public PagedCallSettings< | ||
| 105 | + ListAutoscalingPoliciesRequest, | ||
| 106 | + ListAutoscalingPoliciesResponse, | ||
| 107 | + ListAutoscalingPoliciesPagedResponse> | ||
| 108 | + listAutoscalingPoliciesSettings() { | ||
| 109 | + return ((AutoscalingPolicyServiceStubSettings) getStubSettings()) | ||
| 110 | + .listAutoscalingPoliciesSettings(); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + /** Returns the object with the settings used for calls to deleteAutoscalingPolicy. */ | ||
| 114 | + public UnaryCallSettings<DeleteAutoscalingPolicyRequest, Empty> | ||
| 115 | + deleteAutoscalingPolicySettings() { | ||
| 116 | + return ((AutoscalingPolicyServiceStubSettings) getStubSettings()) | ||
| 117 | + .deleteAutoscalingPolicySettings(); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + public static final AutoscalingPolicyServiceSettings create( | ||
| 121 | + AutoscalingPolicyServiceStubSettings stub) throws IOException { | ||
| 122 | + return new AutoscalingPolicyServiceSettings.Builder(stub.toBuilder()).build(); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + /** Returns a builder for the default ExecutorProvider for this service. */ | ||
| 126 | + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { | ||
| 127 | + return AutoscalingPolicyServiceStubSettings.defaultExecutorProviderBuilder(); | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + /** Returns the default service endpoint. */ | ||
| 131 | + public static String getDefaultEndpoint() { | ||
| 132 | + return AutoscalingPolicyServiceStubSettings.getDefaultEndpoint(); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + /** Returns the default service scopes. */ | ||
| 136 | + public static List<String> getDefaultServiceScopes() { | ||
| 137 | + return AutoscalingPolicyServiceStubSettings.getDefaultServiceScopes(); | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + /** Returns a builder for the default credentials for this service. */ | ||
| 141 | + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { | ||
| 142 | + return AutoscalingPolicyServiceStubSettings.defaultCredentialsProviderBuilder(); | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + /** Returns a builder for the default gRPC ChannelProvider for this service. */ | ||
| 146 | + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { | ||
| 147 | + return AutoscalingPolicyServiceStubSettings.defaultGrpcTransportProviderBuilder(); | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + /** Returns a builder for the default REST ChannelProvider for this service. */ | ||
| 151 | + @BetaApi | ||
| 152 | + public static InstantiatingHttpJsonChannelProvider.Builder | ||
| 153 | + defaultHttpJsonTransportProviderBuilder() { | ||
| 154 | + return AutoscalingPolicyServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + public static TransportChannelProvider defaultTransportChannelProvider() { | ||
| 158 | + return AutoscalingPolicyServiceStubSettings.defaultTransportChannelProvider(); | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") | ||
| 162 | + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { | ||
| 163 | + return AutoscalingPolicyServiceStubSettings.defaultApiClientHeaderProviderBuilder(); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + /** Returns a new gRPC builder for this class. */ | ||
| 167 | + public static Builder newBuilder() { | ||
| 168 | + return Builder.createDefault(); | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + /** Returns a new REST builder for this class. */ | ||
| 172 | + @BetaApi | ||
| 173 | + public static Builder newHttpJsonBuilder() { | ||
| 174 | + return Builder.createHttpJsonDefault(); | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + /** Returns a new builder for this class. */ | ||
| 178 | + public static Builder newBuilder(ClientContext clientContext) { | ||
| 179 | + return new Builder(clientContext); | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + /** Returns a builder containing all the values of this settings class. */ | ||
| 183 | + public Builder toBuilder() { | ||
| 184 | + return new Builder(this); | ||
| 185 | + } | ||
| 186 | + | ||
| 187 | + protected AutoscalingPolicyServiceSettings(Builder settingsBuilder) throws IOException { | ||
| 188 | + super(settingsBuilder); | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + /** Builder for AutoscalingPolicyServiceSettings. */ | ||
| 192 | + public static class Builder | ||
| 193 | + extends ClientSettings.Builder<AutoscalingPolicyServiceSettings, Builder> { | ||
| 194 | + | ||
| 195 | + protected Builder() throws IOException { | ||
| 196 | + this(((ClientContext) null)); | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + protected Builder(ClientContext clientContext) { | ||
| 200 | + super(AutoscalingPolicyServiceStubSettings.newBuilder(clientContext)); | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + protected Builder(AutoscalingPolicyServiceSettings settings) { | ||
| 204 | + super(settings.getStubSettings().toBuilder()); | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + protected Builder(AutoscalingPolicyServiceStubSettings.Builder stubSettings) { | ||
| 208 | + super(stubSettings); | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + private static Builder createDefault() { | ||
| 212 | + return new Builder(AutoscalingPolicyServiceStubSettings.newBuilder()); | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | + @BetaApi | ||
| 216 | + private static Builder createHttpJsonDefault() { | ||
| 217 | + return new Builder(AutoscalingPolicyServiceStubSettings.newHttpJsonBuilder()); | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + public AutoscalingPolicyServiceStubSettings.Builder getStubSettingsBuilder() { | ||
| 221 | + return ((AutoscalingPolicyServiceStubSettings.Builder) getStubSettings()); | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + /** | ||
| 225 | + * Applies the given settings updater function to all of the unary API methods in this service. | ||
| 226 | + * | ||
| 227 | + * <p>Note: This method does not support applying settings to streaming methods. | ||
| 228 | + */ | ||
| 229 | + public Builder applyToAllUnaryMethods( | ||
| 230 | + ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { | ||
| 231 | + super.applyToAllUnaryMethods( | ||
| 232 | + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); | ||
| 233 | + return this; | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + /** Returns the builder for the settings used for calls to createAutoscalingPolicy. */ | ||
| 237 | + public UnaryCallSettings.Builder<CreateAutoscalingPolicyRequest, AutoscalingPolicy> | ||
| 238 | + createAutoscalingPolicySettings() { | ||
| 239 | + return getStubSettingsBuilder().createAutoscalingPolicySettings(); | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + /** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */ | ||
| 243 | + public UnaryCallSettings.Builder<UpdateAutoscalingPolicyRequest, AutoscalingPolicy> | ||
| 244 | + updateAutoscalingPolicySettings() { | ||
| 245 | + return getStubSettingsBuilder().updateAutoscalingPolicySettings(); | ||
| 246 | + } | ||
| 247 | + | ||
| 248 | + /** Returns the builder for the settings used for calls to getAutoscalingPolicy. */ | ||
| 249 | + public UnaryCallSettings.Builder<GetAutoscalingPolicyRequest, AutoscalingPolicy> | ||
| 250 | + getAutoscalingPolicySettings() { | ||
| 251 | + return getStubSettingsBuilder().getAutoscalingPolicySettings(); | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + /** Returns the builder for the settings used for calls to listAutoscalingPolicies. */ | ||
| 255 | + public PagedCallSettings.Builder< | ||
| 256 | + ListAutoscalingPoliciesRequest, | ||
| 257 | + ListAutoscalingPoliciesResponse, | ||
| 258 | + ListAutoscalingPoliciesPagedResponse> | ||
| 259 | + listAutoscalingPoliciesSettings() { | ||
| 260 | + return getStubSettingsBuilder().listAutoscalingPoliciesSettings(); | ||
| 261 | + } | ||
| 262 | + | ||
| 263 | + /** Returns the builder for the settings used for calls to deleteAutoscalingPolicy. */ | ||
| 264 | + public UnaryCallSettings.Builder<DeleteAutoscalingPolicyRequest, Empty> | ||
| 265 | + deleteAutoscalingPolicySettings() { | ||
| 266 | + return getStubSettingsBuilder().deleteAutoscalingPolicySettings(); | ||
| 267 | + } | ||
| 268 | + | ||
| 269 | + @Override | ||
| 270 | + public AutoscalingPolicyServiceSettings build() throws IOException { | ||
| 271 | + return new AutoscalingPolicyServiceSettings(this); | ||
| 272 | + } | ||
| 273 | + } | ||
| 274 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments