• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.compute.v1;
18 
19 import static com.google.cloud.compute.v1.BackendServicesClient.AggregatedListPagedResponse;
20 import static com.google.cloud.compute.v1.BackendServicesClient.ListPagedResponse;
21 
22 import com.google.api.core.ApiFunction;
23 import com.google.api.core.BetaApi;
24 import com.google.api.gax.core.GoogleCredentialsProvider;
25 import com.google.api.gax.core.InstantiatingExecutorProvider;
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.OperationCallSettings;
31 import com.google.api.gax.rpc.PagedCallSettings;
32 import com.google.api.gax.rpc.TransportChannelProvider;
33 import com.google.api.gax.rpc.UnaryCallSettings;
34 import com.google.cloud.compute.v1.stub.BackendServicesStubSettings;
35 import java.io.IOException;
36 import java.util.List;
37 import javax.annotation.Generated;
38 
39 // AUTO-GENERATED DOCUMENTATION AND CLASS.
40 /**
41  * Settings class to configure an instance of {@link BackendServicesClient}.
42  *
43  * <p>The default instance has everything set to sensible defaults:
44  *
45  * <ul>
46  *   <li>The default service address (compute.googleapis.com) and default port (443) are used.
47  *   <li>Credentials are acquired automatically through Application Default Credentials.
48  *   <li>Retries are configured for idempotent methods but not for non-idempotent methods.
49  * </ul>
50  *
51  * <p>The builder of this class is recursive, so contained classes are themselves builders. When
52  * build() is called, the tree of builders is called to create the complete settings object.
53  *
54  * <p>For example, to set the total timeout of get to 30 seconds:
55  *
56  * <pre>{@code
57  * // This snippet has been automatically generated and should be regarded as a code template only.
58  * // It will require modifications to work:
59  * // - It may require correct/in-range values for request initialization.
60  * // - It may require specifying regional endpoints when creating the service client as shown in
61  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
62  * BackendServicesSettings.Builder backendServicesSettingsBuilder =
63  *     BackendServicesSettings.newBuilder();
64  * backendServicesSettingsBuilder
65  *     .getSettings()
66  *     .setRetrySettings(
67  *         backendServicesSettingsBuilder
68  *             .getSettings()
69  *             .getRetrySettings()
70  *             .toBuilder()
71  *             .setTotalTimeout(Duration.ofSeconds(30))
72  *             .build());
73  * BackendServicesSettings backendServicesSettings = backendServicesSettingsBuilder.build();
74  * }</pre>
75  */
76 @Generated("by gapic-generator-java")
77 public class BackendServicesSettings extends ClientSettings<BackendServicesSettings> {
78 
79   /** Returns the object with the settings used for calls to addSignedUrlKey. */
80   public UnaryCallSettings<AddSignedUrlKeyBackendServiceRequest, Operation>
addSignedUrlKeySettings()81       addSignedUrlKeySettings() {
82     return ((BackendServicesStubSettings) getStubSettings()).addSignedUrlKeySettings();
83   }
84 
85   /** Returns the object with the settings used for calls to addSignedUrlKey. */
86   public OperationCallSettings<AddSignedUrlKeyBackendServiceRequest, Operation, Operation>
addSignedUrlKeyOperationSettings()87       addSignedUrlKeyOperationSettings() {
88     return ((BackendServicesStubSettings) getStubSettings()).addSignedUrlKeyOperationSettings();
89   }
90 
91   /** Returns the object with the settings used for calls to aggregatedList. */
92   public PagedCallSettings<
93           AggregatedListBackendServicesRequest,
94           BackendServiceAggregatedList,
95           AggregatedListPagedResponse>
aggregatedListSettings()96       aggregatedListSettings() {
97     return ((BackendServicesStubSettings) getStubSettings()).aggregatedListSettings();
98   }
99 
100   /** Returns the object with the settings used for calls to delete. */
deleteSettings()101   public UnaryCallSettings<DeleteBackendServiceRequest, Operation> deleteSettings() {
102     return ((BackendServicesStubSettings) getStubSettings()).deleteSettings();
103   }
104 
105   /** Returns the object with the settings used for calls to delete. */
106   public OperationCallSettings<DeleteBackendServiceRequest, Operation, Operation>
deleteOperationSettings()107       deleteOperationSettings() {
108     return ((BackendServicesStubSettings) getStubSettings()).deleteOperationSettings();
109   }
110 
111   /** Returns the object with the settings used for calls to deleteSignedUrlKey. */
112   public UnaryCallSettings<DeleteSignedUrlKeyBackendServiceRequest, Operation>
deleteSignedUrlKeySettings()113       deleteSignedUrlKeySettings() {
114     return ((BackendServicesStubSettings) getStubSettings()).deleteSignedUrlKeySettings();
115   }
116 
117   /** Returns the object with the settings used for calls to deleteSignedUrlKey. */
118   public OperationCallSettings<DeleteSignedUrlKeyBackendServiceRequest, Operation, Operation>
deleteSignedUrlKeyOperationSettings()119       deleteSignedUrlKeyOperationSettings() {
120     return ((BackendServicesStubSettings) getStubSettings()).deleteSignedUrlKeyOperationSettings();
121   }
122 
123   /** Returns the object with the settings used for calls to get. */
getSettings()124   public UnaryCallSettings<GetBackendServiceRequest, BackendService> getSettings() {
125     return ((BackendServicesStubSettings) getStubSettings()).getSettings();
126   }
127 
128   /** Returns the object with the settings used for calls to getHealth. */
129   public UnaryCallSettings<GetHealthBackendServiceRequest, BackendServiceGroupHealth>
getHealthSettings()130       getHealthSettings() {
131     return ((BackendServicesStubSettings) getStubSettings()).getHealthSettings();
132   }
133 
134   /** Returns the object with the settings used for calls to getIamPolicy. */
getIamPolicySettings()135   public UnaryCallSettings<GetIamPolicyBackendServiceRequest, Policy> getIamPolicySettings() {
136     return ((BackendServicesStubSettings) getStubSettings()).getIamPolicySettings();
137   }
138 
139   /** Returns the object with the settings used for calls to insert. */
insertSettings()140   public UnaryCallSettings<InsertBackendServiceRequest, Operation> insertSettings() {
141     return ((BackendServicesStubSettings) getStubSettings()).insertSettings();
142   }
143 
144   /** Returns the object with the settings used for calls to insert. */
145   public OperationCallSettings<InsertBackendServiceRequest, Operation, Operation>
insertOperationSettings()146       insertOperationSettings() {
147     return ((BackendServicesStubSettings) getStubSettings()).insertOperationSettings();
148   }
149 
150   /** Returns the object with the settings used for calls to list. */
151   public PagedCallSettings<ListBackendServicesRequest, BackendServiceList, ListPagedResponse>
listSettings()152       listSettings() {
153     return ((BackendServicesStubSettings) getStubSettings()).listSettings();
154   }
155 
156   /** Returns the object with the settings used for calls to patch. */
patchSettings()157   public UnaryCallSettings<PatchBackendServiceRequest, Operation> patchSettings() {
158     return ((BackendServicesStubSettings) getStubSettings()).patchSettings();
159   }
160 
161   /** Returns the object with the settings used for calls to patch. */
162   public OperationCallSettings<PatchBackendServiceRequest, Operation, Operation>
patchOperationSettings()163       patchOperationSettings() {
164     return ((BackendServicesStubSettings) getStubSettings()).patchOperationSettings();
165   }
166 
167   /** Returns the object with the settings used for calls to setEdgeSecurityPolicy. */
168   public UnaryCallSettings<SetEdgeSecurityPolicyBackendServiceRequest, Operation>
setEdgeSecurityPolicySettings()169       setEdgeSecurityPolicySettings() {
170     return ((BackendServicesStubSettings) getStubSettings()).setEdgeSecurityPolicySettings();
171   }
172 
173   /** Returns the object with the settings used for calls to setEdgeSecurityPolicy. */
174   public OperationCallSettings<SetEdgeSecurityPolicyBackendServiceRequest, Operation, Operation>
setEdgeSecurityPolicyOperationSettings()175       setEdgeSecurityPolicyOperationSettings() {
176     return ((BackendServicesStubSettings) getStubSettings())
177         .setEdgeSecurityPolicyOperationSettings();
178   }
179 
180   /** Returns the object with the settings used for calls to setIamPolicy. */
setIamPolicySettings()181   public UnaryCallSettings<SetIamPolicyBackendServiceRequest, Policy> setIamPolicySettings() {
182     return ((BackendServicesStubSettings) getStubSettings()).setIamPolicySettings();
183   }
184 
185   /** Returns the object with the settings used for calls to setSecurityPolicy. */
186   public UnaryCallSettings<SetSecurityPolicyBackendServiceRequest, Operation>
setSecurityPolicySettings()187       setSecurityPolicySettings() {
188     return ((BackendServicesStubSettings) getStubSettings()).setSecurityPolicySettings();
189   }
190 
191   /** Returns the object with the settings used for calls to setSecurityPolicy. */
192   public OperationCallSettings<SetSecurityPolicyBackendServiceRequest, Operation, Operation>
setSecurityPolicyOperationSettings()193       setSecurityPolicyOperationSettings() {
194     return ((BackendServicesStubSettings) getStubSettings()).setSecurityPolicyOperationSettings();
195   }
196 
197   /** Returns the object with the settings used for calls to update. */
updateSettings()198   public UnaryCallSettings<UpdateBackendServiceRequest, Operation> updateSettings() {
199     return ((BackendServicesStubSettings) getStubSettings()).updateSettings();
200   }
201 
202   /** Returns the object with the settings used for calls to update. */
203   public OperationCallSettings<UpdateBackendServiceRequest, Operation, Operation>
updateOperationSettings()204       updateOperationSettings() {
205     return ((BackendServicesStubSettings) getStubSettings()).updateOperationSettings();
206   }
207 
create(BackendServicesStubSettings stub)208   public static final BackendServicesSettings create(BackendServicesStubSettings stub)
209       throws IOException {
210     return new BackendServicesSettings.Builder(stub.toBuilder()).build();
211   }
212 
213   /** Returns a builder for the default ExecutorProvider for this service. */
defaultExecutorProviderBuilder()214   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
215     return BackendServicesStubSettings.defaultExecutorProviderBuilder();
216   }
217 
218   /** Returns the default service endpoint. */
getDefaultEndpoint()219   public static String getDefaultEndpoint() {
220     return BackendServicesStubSettings.getDefaultEndpoint();
221   }
222 
223   /** Returns the default service scopes. */
getDefaultServiceScopes()224   public static List<String> getDefaultServiceScopes() {
225     return BackendServicesStubSettings.getDefaultServiceScopes();
226   }
227 
228   /** Returns a builder for the default credentials for this service. */
defaultCredentialsProviderBuilder()229   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
230     return BackendServicesStubSettings.defaultCredentialsProviderBuilder();
231   }
232 
233   /** Returns a builder for the default ChannelProvider for this service. */
234   public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder()235       defaultHttpJsonTransportProviderBuilder() {
236     return BackendServicesStubSettings.defaultHttpJsonTransportProviderBuilder();
237   }
238 
defaultTransportChannelProvider()239   public static TransportChannelProvider defaultTransportChannelProvider() {
240     return BackendServicesStubSettings.defaultTransportChannelProvider();
241   }
242 
243   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
defaultApiClientHeaderProviderBuilder()244   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
245     return BackendServicesStubSettings.defaultApiClientHeaderProviderBuilder();
246   }
247 
248   /** Returns a new builder for this class. */
newBuilder()249   public static Builder newBuilder() {
250     return Builder.createDefault();
251   }
252 
253   /** Returns a new builder for this class. */
newBuilder(ClientContext clientContext)254   public static Builder newBuilder(ClientContext clientContext) {
255     return new Builder(clientContext);
256   }
257 
258   /** Returns a builder containing all the values of this settings class. */
toBuilder()259   public Builder toBuilder() {
260     return new Builder(this);
261   }
262 
BackendServicesSettings(Builder settingsBuilder)263   protected BackendServicesSettings(Builder settingsBuilder) throws IOException {
264     super(settingsBuilder);
265   }
266 
267   /** Builder for BackendServicesSettings. */
268   public static class Builder extends ClientSettings.Builder<BackendServicesSettings, Builder> {
269 
Builder()270     protected Builder() throws IOException {
271       this(((ClientContext) null));
272     }
273 
Builder(ClientContext clientContext)274     protected Builder(ClientContext clientContext) {
275       super(BackendServicesStubSettings.newBuilder(clientContext));
276     }
277 
Builder(BackendServicesSettings settings)278     protected Builder(BackendServicesSettings settings) {
279       super(settings.getStubSettings().toBuilder());
280     }
281 
Builder(BackendServicesStubSettings.Builder stubSettings)282     protected Builder(BackendServicesStubSettings.Builder stubSettings) {
283       super(stubSettings);
284     }
285 
createDefault()286     private static Builder createDefault() {
287       return new Builder(BackendServicesStubSettings.newBuilder());
288     }
289 
getStubSettingsBuilder()290     public BackendServicesStubSettings.Builder getStubSettingsBuilder() {
291       return ((BackendServicesStubSettings.Builder) getStubSettings());
292     }
293 
294     /**
295      * Applies the given settings updater function to all of the unary API methods in this service.
296      *
297      * <p>Note: This method does not support applying settings to streaming methods.
298      */
applyToAllUnaryMethods( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater)299     public Builder applyToAllUnaryMethods(
300         ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
301       super.applyToAllUnaryMethods(
302           getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
303       return this;
304     }
305 
306     /** Returns the builder for the settings used for calls to addSignedUrlKey. */
307     public UnaryCallSettings.Builder<AddSignedUrlKeyBackendServiceRequest, Operation>
addSignedUrlKeySettings()308         addSignedUrlKeySettings() {
309       return getStubSettingsBuilder().addSignedUrlKeySettings();
310     }
311 
312     /** Returns the builder for the settings used for calls to addSignedUrlKey. */
313     public OperationCallSettings.Builder<AddSignedUrlKeyBackendServiceRequest, Operation, Operation>
addSignedUrlKeyOperationSettings()314         addSignedUrlKeyOperationSettings() {
315       return getStubSettingsBuilder().addSignedUrlKeyOperationSettings();
316     }
317 
318     /** Returns the builder for the settings used for calls to aggregatedList. */
319     public PagedCallSettings.Builder<
320             AggregatedListBackendServicesRequest,
321             BackendServiceAggregatedList,
322             AggregatedListPagedResponse>
aggregatedListSettings()323         aggregatedListSettings() {
324       return getStubSettingsBuilder().aggregatedListSettings();
325     }
326 
327     /** Returns the builder for the settings used for calls to delete. */
deleteSettings()328     public UnaryCallSettings.Builder<DeleteBackendServiceRequest, Operation> deleteSettings() {
329       return getStubSettingsBuilder().deleteSettings();
330     }
331 
332     /** Returns the builder for the settings used for calls to delete. */
333     public OperationCallSettings.Builder<DeleteBackendServiceRequest, Operation, Operation>
deleteOperationSettings()334         deleteOperationSettings() {
335       return getStubSettingsBuilder().deleteOperationSettings();
336     }
337 
338     /** Returns the builder for the settings used for calls to deleteSignedUrlKey. */
339     public UnaryCallSettings.Builder<DeleteSignedUrlKeyBackendServiceRequest, Operation>
deleteSignedUrlKeySettings()340         deleteSignedUrlKeySettings() {
341       return getStubSettingsBuilder().deleteSignedUrlKeySettings();
342     }
343 
344     /** Returns the builder for the settings used for calls to deleteSignedUrlKey. */
345     public OperationCallSettings.Builder<
346             DeleteSignedUrlKeyBackendServiceRequest, Operation, Operation>
deleteSignedUrlKeyOperationSettings()347         deleteSignedUrlKeyOperationSettings() {
348       return getStubSettingsBuilder().deleteSignedUrlKeyOperationSettings();
349     }
350 
351     /** Returns the builder for the settings used for calls to get. */
getSettings()352     public UnaryCallSettings.Builder<GetBackendServiceRequest, BackendService> getSettings() {
353       return getStubSettingsBuilder().getSettings();
354     }
355 
356     /** Returns the builder for the settings used for calls to getHealth. */
357     public UnaryCallSettings.Builder<GetHealthBackendServiceRequest, BackendServiceGroupHealth>
getHealthSettings()358         getHealthSettings() {
359       return getStubSettingsBuilder().getHealthSettings();
360     }
361 
362     /** Returns the builder for the settings used for calls to getIamPolicy. */
363     public UnaryCallSettings.Builder<GetIamPolicyBackendServiceRequest, Policy>
getIamPolicySettings()364         getIamPolicySettings() {
365       return getStubSettingsBuilder().getIamPolicySettings();
366     }
367 
368     /** Returns the builder for the settings used for calls to insert. */
insertSettings()369     public UnaryCallSettings.Builder<InsertBackendServiceRequest, Operation> insertSettings() {
370       return getStubSettingsBuilder().insertSettings();
371     }
372 
373     /** Returns the builder for the settings used for calls to insert. */
374     public OperationCallSettings.Builder<InsertBackendServiceRequest, Operation, Operation>
insertOperationSettings()375         insertOperationSettings() {
376       return getStubSettingsBuilder().insertOperationSettings();
377     }
378 
379     /** Returns the builder for the settings used for calls to list. */
380     public PagedCallSettings.Builder<
381             ListBackendServicesRequest, BackendServiceList, ListPagedResponse>
listSettings()382         listSettings() {
383       return getStubSettingsBuilder().listSettings();
384     }
385 
386     /** Returns the builder for the settings used for calls to patch. */
patchSettings()387     public UnaryCallSettings.Builder<PatchBackendServiceRequest, Operation> patchSettings() {
388       return getStubSettingsBuilder().patchSettings();
389     }
390 
391     /** Returns the builder for the settings used for calls to patch. */
392     public OperationCallSettings.Builder<PatchBackendServiceRequest, Operation, Operation>
patchOperationSettings()393         patchOperationSettings() {
394       return getStubSettingsBuilder().patchOperationSettings();
395     }
396 
397     /** Returns the builder for the settings used for calls to setEdgeSecurityPolicy. */
398     public UnaryCallSettings.Builder<SetEdgeSecurityPolicyBackendServiceRequest, Operation>
setEdgeSecurityPolicySettings()399         setEdgeSecurityPolicySettings() {
400       return getStubSettingsBuilder().setEdgeSecurityPolicySettings();
401     }
402 
403     /** Returns the builder for the settings used for calls to setEdgeSecurityPolicy. */
404     public OperationCallSettings.Builder<
405             SetEdgeSecurityPolicyBackendServiceRequest, Operation, Operation>
setEdgeSecurityPolicyOperationSettings()406         setEdgeSecurityPolicyOperationSettings() {
407       return getStubSettingsBuilder().setEdgeSecurityPolicyOperationSettings();
408     }
409 
410     /** Returns the builder for the settings used for calls to setIamPolicy. */
411     public UnaryCallSettings.Builder<SetIamPolicyBackendServiceRequest, Policy>
setIamPolicySettings()412         setIamPolicySettings() {
413       return getStubSettingsBuilder().setIamPolicySettings();
414     }
415 
416     /** Returns the builder for the settings used for calls to setSecurityPolicy. */
417     public UnaryCallSettings.Builder<SetSecurityPolicyBackendServiceRequest, Operation>
setSecurityPolicySettings()418         setSecurityPolicySettings() {
419       return getStubSettingsBuilder().setSecurityPolicySettings();
420     }
421 
422     /** Returns the builder for the settings used for calls to setSecurityPolicy. */
423     public OperationCallSettings.Builder<
424             SetSecurityPolicyBackendServiceRequest, Operation, Operation>
setSecurityPolicyOperationSettings()425         setSecurityPolicyOperationSettings() {
426       return getStubSettingsBuilder().setSecurityPolicyOperationSettings();
427     }
428 
429     /** Returns the builder for the settings used for calls to update. */
updateSettings()430     public UnaryCallSettings.Builder<UpdateBackendServiceRequest, Operation> updateSettings() {
431       return getStubSettingsBuilder().updateSettings();
432     }
433 
434     /** Returns the builder for the settings used for calls to update. */
435     public OperationCallSettings.Builder<UpdateBackendServiceRequest, Operation, Operation>
updateOperationSettings()436         updateOperationSettings() {
437       return getStubSettingsBuilder().updateOperationSettings();
438     }
439 
440     @Override
build()441     public BackendServicesSettings build() throws IOException {
442       return new BackendServicesSettings(this);
443     }
444   }
445 }
446