• 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 com.google.api.core.ApiFuture;
20 import com.google.api.core.ApiFutures;
21 import com.google.api.core.BetaApi;
22 import com.google.api.gax.core.BackgroundResource;
23 import com.google.api.gax.longrunning.OperationFuture;
24 import com.google.api.gax.paging.AbstractFixedSizeCollection;
25 import com.google.api.gax.paging.AbstractPage;
26 import com.google.api.gax.paging.AbstractPagedListResponse;
27 import com.google.api.gax.rpc.OperationCallable;
28 import com.google.api.gax.rpc.PageContext;
29 import com.google.api.gax.rpc.UnaryCallable;
30 import com.google.cloud.compute.v1.stub.TargetHttpProxiesStub;
31 import com.google.cloud.compute.v1.stub.TargetHttpProxiesStubSettings;
32 import com.google.common.util.concurrent.MoreExecutors;
33 import java.io.IOException;
34 import java.util.List;
35 import java.util.Map;
36 import java.util.concurrent.TimeUnit;
37 import javax.annotation.Generated;
38 
39 // AUTO-GENERATED DOCUMENTATION AND CLASS.
40 /**
41  * Service Description: The TargetHttpProxies API.
42  *
43  * <p>This class provides the ability to make remote calls to the backing service through method
44  * calls that map to API methods. Sample code to get started:
45  *
46  * <pre>{@code
47  * // This snippet has been automatically generated and should be regarded as a code template only.
48  * // It will require modifications to work:
49  * // - It may require correct/in-range values for request initialization.
50  * // - It may require specifying regional endpoints when creating the service client as shown in
51  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
52  * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
53  *   String project = "project-309310695";
54  *   String targetHttpProxy = "targetHttpProxy-1944074187";
55  *   TargetHttpProxy response = targetHttpProxiesClient.get(project, targetHttpProxy);
56  * }
57  * }</pre>
58  *
59  * <p>Note: close() needs to be called on the TargetHttpProxiesClient object to clean up resources
60  * such as threads. In the example above, try-with-resources is used, which automatically calls
61  * close().
62  *
63  * <p>The surface of this class includes several types of Java methods for each of the API's
64  * methods:
65  *
66  * <ol>
67  *   <li>A "flattened" method. With this type of method, the fields of the request type have been
68  *       converted into function parameters. It may be the case that not all fields are available as
69  *       parameters, and not every API method will have a flattened method entry point.
70  *   <li>A "request object" method. This type of method only takes one parameter, a request object,
71  *       which must be constructed before the call. Not every API method will have a request object
72  *       method.
73  *   <li>A "callable" method. This type of method takes no parameters and returns an immutable API
74  *       callable object, which can be used to initiate calls to the service.
75  * </ol>
76  *
77  * <p>See the individual methods for example code.
78  *
79  * <p>Many parameters require resource names to be formatted in a particular way. To assist with
80  * these names, this class includes a format method for each type of name, and additionally a parse
81  * method to extract the individual identifiers contained within names that are returned.
82  *
83  * <p>This class can be customized by passing in a custom instance of TargetHttpProxiesSettings to
84  * create(). For example:
85  *
86  * <p>To customize credentials:
87  *
88  * <pre>{@code
89  * // This snippet has been automatically generated and should be regarded as a code template only.
90  * // It will require modifications to work:
91  * // - It may require correct/in-range values for request initialization.
92  * // - It may require specifying regional endpoints when creating the service client as shown in
93  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
94  * TargetHttpProxiesSettings targetHttpProxiesSettings =
95  *     TargetHttpProxiesSettings.newBuilder()
96  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
97  *         .build();
98  * TargetHttpProxiesClient targetHttpProxiesClient =
99  *     TargetHttpProxiesClient.create(targetHttpProxiesSettings);
100  * }</pre>
101  *
102  * <p>To customize the endpoint:
103  *
104  * <pre>{@code
105  * // This snippet has been automatically generated and should be regarded as a code template only.
106  * // It will require modifications to work:
107  * // - It may require correct/in-range values for request initialization.
108  * // - It may require specifying regional endpoints when creating the service client as shown in
109  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
110  * TargetHttpProxiesSettings targetHttpProxiesSettings =
111  *     TargetHttpProxiesSettings.newBuilder().setEndpoint(myEndpoint).build();
112  * TargetHttpProxiesClient targetHttpProxiesClient =
113  *     TargetHttpProxiesClient.create(targetHttpProxiesSettings);
114  * }</pre>
115  *
116  * <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
117  */
118 @Generated("by gapic-generator-java")
119 public class TargetHttpProxiesClient implements BackgroundResource {
120   private final TargetHttpProxiesSettings settings;
121   private final TargetHttpProxiesStub stub;
122 
123   /** Constructs an instance of TargetHttpProxiesClient with default settings. */
create()124   public static final TargetHttpProxiesClient create() throws IOException {
125     return create(TargetHttpProxiesSettings.newBuilder().build());
126   }
127 
128   /**
129    * Constructs an instance of TargetHttpProxiesClient, using the given settings. The channels are
130    * created based on the settings passed in, or defaults for any settings that are not set.
131    */
create(TargetHttpProxiesSettings settings)132   public static final TargetHttpProxiesClient create(TargetHttpProxiesSettings settings)
133       throws IOException {
134     return new TargetHttpProxiesClient(settings);
135   }
136 
137   /**
138    * Constructs an instance of TargetHttpProxiesClient, using the given stub for making calls. This
139    * is for advanced usage - prefer using create(TargetHttpProxiesSettings).
140    */
create(TargetHttpProxiesStub stub)141   public static final TargetHttpProxiesClient create(TargetHttpProxiesStub stub) {
142     return new TargetHttpProxiesClient(stub);
143   }
144 
145   /**
146    * Constructs an instance of TargetHttpProxiesClient, using the given settings. This is protected
147    * so that it is easy to make a subclass, but otherwise, the static factory methods should be
148    * preferred.
149    */
TargetHttpProxiesClient(TargetHttpProxiesSettings settings)150   protected TargetHttpProxiesClient(TargetHttpProxiesSettings settings) throws IOException {
151     this.settings = settings;
152     this.stub = ((TargetHttpProxiesStubSettings) settings.getStubSettings()).createStub();
153   }
154 
TargetHttpProxiesClient(TargetHttpProxiesStub stub)155   protected TargetHttpProxiesClient(TargetHttpProxiesStub stub) {
156     this.settings = null;
157     this.stub = stub;
158   }
159 
getSettings()160   public final TargetHttpProxiesSettings getSettings() {
161     return settings;
162   }
163 
getStub()164   public TargetHttpProxiesStub getStub() {
165     return stub;
166   }
167 
168   // AUTO-GENERATED DOCUMENTATION AND METHOD.
169   /**
170    * Retrieves the list of all TargetHttpProxy resources, regional and global, available to the
171    * specified project.
172    *
173    * <p>Sample code:
174    *
175    * <pre>{@code
176    * // This snippet has been automatically generated and should be regarded as a code template only.
177    * // It will require modifications to work:
178    * // - It may require correct/in-range values for request initialization.
179    * // - It may require specifying regional endpoints when creating the service client as shown in
180    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
181    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
182    *   String project = "project-309310695";
183    *   for (Map.Entry<String, TargetHttpProxiesScopedList> element :
184    *       targetHttpProxiesClient.aggregatedList(project).iterateAll()) {
185    *     // doThingsWith(element);
186    *   }
187    * }
188    * }</pre>
189    *
190    * @param project Name of the project scoping this request.
191    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
192    */
aggregatedList(String project)193   public final AggregatedListPagedResponse aggregatedList(String project) {
194     AggregatedListTargetHttpProxiesRequest request =
195         AggregatedListTargetHttpProxiesRequest.newBuilder().setProject(project).build();
196     return aggregatedList(request);
197   }
198 
199   // AUTO-GENERATED DOCUMENTATION AND METHOD.
200   /**
201    * Retrieves the list of all TargetHttpProxy resources, regional and global, available to the
202    * specified project.
203    *
204    * <p>Sample code:
205    *
206    * <pre>{@code
207    * // This snippet has been automatically generated and should be regarded as a code template only.
208    * // It will require modifications to work:
209    * // - It may require correct/in-range values for request initialization.
210    * // - It may require specifying regional endpoints when creating the service client as shown in
211    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
212    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
213    *   AggregatedListTargetHttpProxiesRequest request =
214    *       AggregatedListTargetHttpProxiesRequest.newBuilder()
215    *           .setFilter("filter-1274492040")
216    *           .setIncludeAllScopes(true)
217    *           .setMaxResults(1128457243)
218    *           .setOrderBy("orderBy-1207110587")
219    *           .setPageToken("pageToken873572522")
220    *           .setProject("project-309310695")
221    *           .setReturnPartialSuccess(true)
222    *           .build();
223    *   for (Map.Entry<String, TargetHttpProxiesScopedList> element :
224    *       targetHttpProxiesClient.aggregatedList(request).iterateAll()) {
225    *     // doThingsWith(element);
226    *   }
227    * }
228    * }</pre>
229    *
230    * @param request The request object containing all of the parameters for the API call.
231    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
232    */
aggregatedList( AggregatedListTargetHttpProxiesRequest request)233   public final AggregatedListPagedResponse aggregatedList(
234       AggregatedListTargetHttpProxiesRequest request) {
235     return aggregatedListPagedCallable().call(request);
236   }
237 
238   // AUTO-GENERATED DOCUMENTATION AND METHOD.
239   /**
240    * Retrieves the list of all TargetHttpProxy resources, regional and global, available to the
241    * specified project.
242    *
243    * <p>Sample code:
244    *
245    * <pre>{@code
246    * // This snippet has been automatically generated and should be regarded as a code template only.
247    * // It will require modifications to work:
248    * // - It may require correct/in-range values for request initialization.
249    * // - It may require specifying regional endpoints when creating the service client as shown in
250    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
251    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
252    *   AggregatedListTargetHttpProxiesRequest request =
253    *       AggregatedListTargetHttpProxiesRequest.newBuilder()
254    *           .setFilter("filter-1274492040")
255    *           .setIncludeAllScopes(true)
256    *           .setMaxResults(1128457243)
257    *           .setOrderBy("orderBy-1207110587")
258    *           .setPageToken("pageToken873572522")
259    *           .setProject("project-309310695")
260    *           .setReturnPartialSuccess(true)
261    *           .build();
262    *   ApiFuture<Map.Entry<String, TargetHttpProxiesScopedList>> future =
263    *       targetHttpProxiesClient.aggregatedListPagedCallable().futureCall(request);
264    *   // Do something.
265    *   for (Map.Entry<String, TargetHttpProxiesScopedList> element : future.get().iterateAll()) {
266    *     // doThingsWith(element);
267    *   }
268    * }
269    * }</pre>
270    */
271   public final UnaryCallable<AggregatedListTargetHttpProxiesRequest, AggregatedListPagedResponse>
aggregatedListPagedCallable()272       aggregatedListPagedCallable() {
273     return stub.aggregatedListPagedCallable();
274   }
275 
276   // AUTO-GENERATED DOCUMENTATION AND METHOD.
277   /**
278    * Retrieves the list of all TargetHttpProxy resources, regional and global, available to the
279    * specified project.
280    *
281    * <p>Sample code:
282    *
283    * <pre>{@code
284    * // This snippet has been automatically generated and should be regarded as a code template only.
285    * // It will require modifications to work:
286    * // - It may require correct/in-range values for request initialization.
287    * // - It may require specifying regional endpoints when creating the service client as shown in
288    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
289    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
290    *   AggregatedListTargetHttpProxiesRequest request =
291    *       AggregatedListTargetHttpProxiesRequest.newBuilder()
292    *           .setFilter("filter-1274492040")
293    *           .setIncludeAllScopes(true)
294    *           .setMaxResults(1128457243)
295    *           .setOrderBy("orderBy-1207110587")
296    *           .setPageToken("pageToken873572522")
297    *           .setProject("project-309310695")
298    *           .setReturnPartialSuccess(true)
299    *           .build();
300    *   while (true) {
301    *     TargetHttpProxyAggregatedList response =
302    *         targetHttpProxiesClient.aggregatedListCallable().call(request);
303    *     for (Map.Entry<String, TargetHttpProxiesScopedList> element : response.getItemsList()) {
304    *       // doThingsWith(element);
305    *     }
306    *     String nextPageToken = response.getNextPageToken();
307    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
308    *       request = request.toBuilder().setPageToken(nextPageToken).build();
309    *     } else {
310    *       break;
311    *     }
312    *   }
313    * }
314    * }</pre>
315    */
316   public final UnaryCallable<AggregatedListTargetHttpProxiesRequest, TargetHttpProxyAggregatedList>
aggregatedListCallable()317       aggregatedListCallable() {
318     return stub.aggregatedListCallable();
319   }
320 
321   // AUTO-GENERATED DOCUMENTATION AND METHOD.
322   /**
323    * Deletes the specified TargetHttpProxy resource.
324    *
325    * <p>Sample code:
326    *
327    * <pre>{@code
328    * // This snippet has been automatically generated and should be regarded as a code template only.
329    * // It will require modifications to work:
330    * // - It may require correct/in-range values for request initialization.
331    * // - It may require specifying regional endpoints when creating the service client as shown in
332    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
333    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
334    *   String project = "project-309310695";
335    *   String targetHttpProxy = "targetHttpProxy-1944074187";
336    *   Operation response = targetHttpProxiesClient.deleteAsync(project, targetHttpProxy).get();
337    * }
338    * }</pre>
339    *
340    * @param project Project ID for this request.
341    * @param targetHttpProxy Name of the TargetHttpProxy resource to delete.
342    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
343    */
deleteAsync( String project, String targetHttpProxy)344   public final OperationFuture<Operation, Operation> deleteAsync(
345       String project, String targetHttpProxy) {
346     DeleteTargetHttpProxyRequest request =
347         DeleteTargetHttpProxyRequest.newBuilder()
348             .setProject(project)
349             .setTargetHttpProxy(targetHttpProxy)
350             .build();
351     return deleteAsync(request);
352   }
353 
354   // AUTO-GENERATED DOCUMENTATION AND METHOD.
355   /**
356    * Deletes the specified TargetHttpProxy resource.
357    *
358    * <p>Sample code:
359    *
360    * <pre>{@code
361    * // This snippet has been automatically generated and should be regarded as a code template only.
362    * // It will require modifications to work:
363    * // - It may require correct/in-range values for request initialization.
364    * // - It may require specifying regional endpoints when creating the service client as shown in
365    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
366    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
367    *   DeleteTargetHttpProxyRequest request =
368    *       DeleteTargetHttpProxyRequest.newBuilder()
369    *           .setProject("project-309310695")
370    *           .setRequestId("requestId693933066")
371    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
372    *           .build();
373    *   Operation response = targetHttpProxiesClient.deleteAsync(request).get();
374    * }
375    * }</pre>
376    *
377    * @param request The request object containing all of the parameters for the API call.
378    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
379    */
380   @BetaApi(
381       "The surface for long-running operations is not stable yet and may change in the future.")
deleteAsync( DeleteTargetHttpProxyRequest request)382   public final OperationFuture<Operation, Operation> deleteAsync(
383       DeleteTargetHttpProxyRequest request) {
384     return deleteOperationCallable().futureCall(request);
385   }
386 
387   // AUTO-GENERATED DOCUMENTATION AND METHOD.
388   /**
389    * Deletes the specified TargetHttpProxy resource.
390    *
391    * <p>Sample code:
392    *
393    * <pre>{@code
394    * // This snippet has been automatically generated and should be regarded as a code template only.
395    * // It will require modifications to work:
396    * // - It may require correct/in-range values for request initialization.
397    * // - It may require specifying regional endpoints when creating the service client as shown in
398    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
399    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
400    *   DeleteTargetHttpProxyRequest request =
401    *       DeleteTargetHttpProxyRequest.newBuilder()
402    *           .setProject("project-309310695")
403    *           .setRequestId("requestId693933066")
404    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
405    *           .build();
406    *   OperationFuture<Operation, Operation> future =
407    *       targetHttpProxiesClient.deleteOperationCallable().futureCall(request);
408    *   // Do something.
409    *   Operation response = future.get();
410    * }
411    * }</pre>
412    */
413   public final OperationCallable<DeleteTargetHttpProxyRequest, Operation, Operation>
deleteOperationCallable()414       deleteOperationCallable() {
415     return stub.deleteOperationCallable();
416   }
417 
418   // AUTO-GENERATED DOCUMENTATION AND METHOD.
419   /**
420    * Deletes the specified TargetHttpProxy resource.
421    *
422    * <p>Sample code:
423    *
424    * <pre>{@code
425    * // This snippet has been automatically generated and should be regarded as a code template only.
426    * // It will require modifications to work:
427    * // - It may require correct/in-range values for request initialization.
428    * // - It may require specifying regional endpoints when creating the service client as shown in
429    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
430    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
431    *   DeleteTargetHttpProxyRequest request =
432    *       DeleteTargetHttpProxyRequest.newBuilder()
433    *           .setProject("project-309310695")
434    *           .setRequestId("requestId693933066")
435    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
436    *           .build();
437    *   ApiFuture<Operation> future = targetHttpProxiesClient.deleteCallable().futureCall(request);
438    *   // Do something.
439    *   Operation response = future.get();
440    * }
441    * }</pre>
442    */
deleteCallable()443   public final UnaryCallable<DeleteTargetHttpProxyRequest, Operation> deleteCallable() {
444     return stub.deleteCallable();
445   }
446 
447   // AUTO-GENERATED DOCUMENTATION AND METHOD.
448   /**
449    * Returns the specified TargetHttpProxy resource.
450    *
451    * <p>Sample code:
452    *
453    * <pre>{@code
454    * // This snippet has been automatically generated and should be regarded as a code template only.
455    * // It will require modifications to work:
456    * // - It may require correct/in-range values for request initialization.
457    * // - It may require specifying regional endpoints when creating the service client as shown in
458    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
459    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
460    *   String project = "project-309310695";
461    *   String targetHttpProxy = "targetHttpProxy-1944074187";
462    *   TargetHttpProxy response = targetHttpProxiesClient.get(project, targetHttpProxy);
463    * }
464    * }</pre>
465    *
466    * @param project Project ID for this request.
467    * @param targetHttpProxy Name of the TargetHttpProxy resource to return.
468    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
469    */
get(String project, String targetHttpProxy)470   public final TargetHttpProxy get(String project, String targetHttpProxy) {
471     GetTargetHttpProxyRequest request =
472         GetTargetHttpProxyRequest.newBuilder()
473             .setProject(project)
474             .setTargetHttpProxy(targetHttpProxy)
475             .build();
476     return get(request);
477   }
478 
479   // AUTO-GENERATED DOCUMENTATION AND METHOD.
480   /**
481    * Returns the specified TargetHttpProxy resource.
482    *
483    * <p>Sample code:
484    *
485    * <pre>{@code
486    * // This snippet has been automatically generated and should be regarded as a code template only.
487    * // It will require modifications to work:
488    * // - It may require correct/in-range values for request initialization.
489    * // - It may require specifying regional endpoints when creating the service client as shown in
490    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
491    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
492    *   GetTargetHttpProxyRequest request =
493    *       GetTargetHttpProxyRequest.newBuilder()
494    *           .setProject("project-309310695")
495    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
496    *           .build();
497    *   TargetHttpProxy response = targetHttpProxiesClient.get(request);
498    * }
499    * }</pre>
500    *
501    * @param request The request object containing all of the parameters for the API call.
502    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
503    */
get(GetTargetHttpProxyRequest request)504   public final TargetHttpProxy get(GetTargetHttpProxyRequest request) {
505     return getCallable().call(request);
506   }
507 
508   // AUTO-GENERATED DOCUMENTATION AND METHOD.
509   /**
510    * Returns the specified TargetHttpProxy resource.
511    *
512    * <p>Sample code:
513    *
514    * <pre>{@code
515    * // This snippet has been automatically generated and should be regarded as a code template only.
516    * // It will require modifications to work:
517    * // - It may require correct/in-range values for request initialization.
518    * // - It may require specifying regional endpoints when creating the service client as shown in
519    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
520    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
521    *   GetTargetHttpProxyRequest request =
522    *       GetTargetHttpProxyRequest.newBuilder()
523    *           .setProject("project-309310695")
524    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
525    *           .build();
526    *   ApiFuture<TargetHttpProxy> future = targetHttpProxiesClient.getCallable().futureCall(request);
527    *   // Do something.
528    *   TargetHttpProxy response = future.get();
529    * }
530    * }</pre>
531    */
getCallable()532   public final UnaryCallable<GetTargetHttpProxyRequest, TargetHttpProxy> getCallable() {
533     return stub.getCallable();
534   }
535 
536   // AUTO-GENERATED DOCUMENTATION AND METHOD.
537   /**
538    * Creates a TargetHttpProxy resource in the specified project using the data included in the
539    * request.
540    *
541    * <p>Sample code:
542    *
543    * <pre>{@code
544    * // This snippet has been automatically generated and should be regarded as a code template only.
545    * // It will require modifications to work:
546    * // - It may require correct/in-range values for request initialization.
547    * // - It may require specifying regional endpoints when creating the service client as shown in
548    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
549    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
550    *   String project = "project-309310695";
551    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
552    *   Operation response =
553    *       targetHttpProxiesClient.insertAsync(project, targetHttpProxyResource).get();
554    * }
555    * }</pre>
556    *
557    * @param project Project ID for this request.
558    * @param targetHttpProxyResource The body resource for this request
559    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
560    */
insertAsync( String project, TargetHttpProxy targetHttpProxyResource)561   public final OperationFuture<Operation, Operation> insertAsync(
562       String project, TargetHttpProxy targetHttpProxyResource) {
563     InsertTargetHttpProxyRequest request =
564         InsertTargetHttpProxyRequest.newBuilder()
565             .setProject(project)
566             .setTargetHttpProxyResource(targetHttpProxyResource)
567             .build();
568     return insertAsync(request);
569   }
570 
571   // AUTO-GENERATED DOCUMENTATION AND METHOD.
572   /**
573    * Creates a TargetHttpProxy resource in the specified project using the data included in the
574    * request.
575    *
576    * <p>Sample code:
577    *
578    * <pre>{@code
579    * // This snippet has been automatically generated and should be regarded as a code template only.
580    * // It will require modifications to work:
581    * // - It may require correct/in-range values for request initialization.
582    * // - It may require specifying regional endpoints when creating the service client as shown in
583    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
584    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
585    *   InsertTargetHttpProxyRequest request =
586    *       InsertTargetHttpProxyRequest.newBuilder()
587    *           .setProject("project-309310695")
588    *           .setRequestId("requestId693933066")
589    *           .setTargetHttpProxyResource(TargetHttpProxy.newBuilder().build())
590    *           .build();
591    *   Operation response = targetHttpProxiesClient.insertAsync(request).get();
592    * }
593    * }</pre>
594    *
595    * @param request The request object containing all of the parameters for the API call.
596    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
597    */
598   @BetaApi(
599       "The surface for long-running operations is not stable yet and may change in the future.")
insertAsync( InsertTargetHttpProxyRequest request)600   public final OperationFuture<Operation, Operation> insertAsync(
601       InsertTargetHttpProxyRequest request) {
602     return insertOperationCallable().futureCall(request);
603   }
604 
605   // AUTO-GENERATED DOCUMENTATION AND METHOD.
606   /**
607    * Creates a TargetHttpProxy resource in the specified project using the data included in the
608    * request.
609    *
610    * <p>Sample code:
611    *
612    * <pre>{@code
613    * // This snippet has been automatically generated and should be regarded as a code template only.
614    * // It will require modifications to work:
615    * // - It may require correct/in-range values for request initialization.
616    * // - It may require specifying regional endpoints when creating the service client as shown in
617    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
618    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
619    *   InsertTargetHttpProxyRequest request =
620    *       InsertTargetHttpProxyRequest.newBuilder()
621    *           .setProject("project-309310695")
622    *           .setRequestId("requestId693933066")
623    *           .setTargetHttpProxyResource(TargetHttpProxy.newBuilder().build())
624    *           .build();
625    *   OperationFuture<Operation, Operation> future =
626    *       targetHttpProxiesClient.insertOperationCallable().futureCall(request);
627    *   // Do something.
628    *   Operation response = future.get();
629    * }
630    * }</pre>
631    */
632   public final OperationCallable<InsertTargetHttpProxyRequest, Operation, Operation>
insertOperationCallable()633       insertOperationCallable() {
634     return stub.insertOperationCallable();
635   }
636 
637   // AUTO-GENERATED DOCUMENTATION AND METHOD.
638   /**
639    * Creates a TargetHttpProxy resource in the specified project using the data included in the
640    * request.
641    *
642    * <p>Sample code:
643    *
644    * <pre>{@code
645    * // This snippet has been automatically generated and should be regarded as a code template only.
646    * // It will require modifications to work:
647    * // - It may require correct/in-range values for request initialization.
648    * // - It may require specifying regional endpoints when creating the service client as shown in
649    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
650    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
651    *   InsertTargetHttpProxyRequest request =
652    *       InsertTargetHttpProxyRequest.newBuilder()
653    *           .setProject("project-309310695")
654    *           .setRequestId("requestId693933066")
655    *           .setTargetHttpProxyResource(TargetHttpProxy.newBuilder().build())
656    *           .build();
657    *   ApiFuture<Operation> future = targetHttpProxiesClient.insertCallable().futureCall(request);
658    *   // Do something.
659    *   Operation response = future.get();
660    * }
661    * }</pre>
662    */
insertCallable()663   public final UnaryCallable<InsertTargetHttpProxyRequest, Operation> insertCallable() {
664     return stub.insertCallable();
665   }
666 
667   // AUTO-GENERATED DOCUMENTATION AND METHOD.
668   /**
669    * Retrieves the list of TargetHttpProxy resources available to the specified project.
670    *
671    * <p>Sample code:
672    *
673    * <pre>{@code
674    * // This snippet has been automatically generated and should be regarded as a code template only.
675    * // It will require modifications to work:
676    * // - It may require correct/in-range values for request initialization.
677    * // - It may require specifying regional endpoints when creating the service client as shown in
678    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
679    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
680    *   String project = "project-309310695";
681    *   for (TargetHttpProxy element : targetHttpProxiesClient.list(project).iterateAll()) {
682    *     // doThingsWith(element);
683    *   }
684    * }
685    * }</pre>
686    *
687    * @param project Project ID for this request.
688    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
689    */
list(String project)690   public final ListPagedResponse list(String project) {
691     ListTargetHttpProxiesRequest request =
692         ListTargetHttpProxiesRequest.newBuilder().setProject(project).build();
693     return list(request);
694   }
695 
696   // AUTO-GENERATED DOCUMENTATION AND METHOD.
697   /**
698    * Retrieves the list of TargetHttpProxy resources available to the specified project.
699    *
700    * <p>Sample code:
701    *
702    * <pre>{@code
703    * // This snippet has been automatically generated and should be regarded as a code template only.
704    * // It will require modifications to work:
705    * // - It may require correct/in-range values for request initialization.
706    * // - It may require specifying regional endpoints when creating the service client as shown in
707    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
708    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
709    *   ListTargetHttpProxiesRequest request =
710    *       ListTargetHttpProxiesRequest.newBuilder()
711    *           .setFilter("filter-1274492040")
712    *           .setMaxResults(1128457243)
713    *           .setOrderBy("orderBy-1207110587")
714    *           .setPageToken("pageToken873572522")
715    *           .setProject("project-309310695")
716    *           .setReturnPartialSuccess(true)
717    *           .build();
718    *   for (TargetHttpProxy element : targetHttpProxiesClient.list(request).iterateAll()) {
719    *     // doThingsWith(element);
720    *   }
721    * }
722    * }</pre>
723    *
724    * @param request The request object containing all of the parameters for the API call.
725    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
726    */
list(ListTargetHttpProxiesRequest request)727   public final ListPagedResponse list(ListTargetHttpProxiesRequest request) {
728     return listPagedCallable().call(request);
729   }
730 
731   // AUTO-GENERATED DOCUMENTATION AND METHOD.
732   /**
733    * Retrieves the list of TargetHttpProxy resources available to the specified project.
734    *
735    * <p>Sample code:
736    *
737    * <pre>{@code
738    * // This snippet has been automatically generated and should be regarded as a code template only.
739    * // It will require modifications to work:
740    * // - It may require correct/in-range values for request initialization.
741    * // - It may require specifying regional endpoints when creating the service client as shown in
742    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
743    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
744    *   ListTargetHttpProxiesRequest request =
745    *       ListTargetHttpProxiesRequest.newBuilder()
746    *           .setFilter("filter-1274492040")
747    *           .setMaxResults(1128457243)
748    *           .setOrderBy("orderBy-1207110587")
749    *           .setPageToken("pageToken873572522")
750    *           .setProject("project-309310695")
751    *           .setReturnPartialSuccess(true)
752    *           .build();
753    *   ApiFuture<TargetHttpProxy> future =
754    *       targetHttpProxiesClient.listPagedCallable().futureCall(request);
755    *   // Do something.
756    *   for (TargetHttpProxy element : future.get().iterateAll()) {
757    *     // doThingsWith(element);
758    *   }
759    * }
760    * }</pre>
761    */
listPagedCallable()762   public final UnaryCallable<ListTargetHttpProxiesRequest, ListPagedResponse> listPagedCallable() {
763     return stub.listPagedCallable();
764   }
765 
766   // AUTO-GENERATED DOCUMENTATION AND METHOD.
767   /**
768    * Retrieves the list of TargetHttpProxy resources available to the specified project.
769    *
770    * <p>Sample code:
771    *
772    * <pre>{@code
773    * // This snippet has been automatically generated and should be regarded as a code template only.
774    * // It will require modifications to work:
775    * // - It may require correct/in-range values for request initialization.
776    * // - It may require specifying regional endpoints when creating the service client as shown in
777    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
778    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
779    *   ListTargetHttpProxiesRequest request =
780    *       ListTargetHttpProxiesRequest.newBuilder()
781    *           .setFilter("filter-1274492040")
782    *           .setMaxResults(1128457243)
783    *           .setOrderBy("orderBy-1207110587")
784    *           .setPageToken("pageToken873572522")
785    *           .setProject("project-309310695")
786    *           .setReturnPartialSuccess(true)
787    *           .build();
788    *   while (true) {
789    *     TargetHttpProxyList response = targetHttpProxiesClient.listCallable().call(request);
790    *     for (TargetHttpProxy element : response.getItemsList()) {
791    *       // doThingsWith(element);
792    *     }
793    *     String nextPageToken = response.getNextPageToken();
794    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
795    *       request = request.toBuilder().setPageToken(nextPageToken).build();
796    *     } else {
797    *       break;
798    *     }
799    *   }
800    * }
801    * }</pre>
802    */
listCallable()803   public final UnaryCallable<ListTargetHttpProxiesRequest, TargetHttpProxyList> listCallable() {
804     return stub.listCallable();
805   }
806 
807   // AUTO-GENERATED DOCUMENTATION AND METHOD.
808   /**
809    * Patches the specified TargetHttpProxy resource with the data included in the request. This
810    * method supports PATCH semantics and uses JSON merge patch format and processing rules.
811    *
812    * <p>Sample code:
813    *
814    * <pre>{@code
815    * // This snippet has been automatically generated and should be regarded as a code template only.
816    * // It will require modifications to work:
817    * // - It may require correct/in-range values for request initialization.
818    * // - It may require specifying regional endpoints when creating the service client as shown in
819    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
820    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
821    *   String project = "project-309310695";
822    *   String targetHttpProxy = "targetHttpProxy-1944074187";
823    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
824    *   Operation response =
825    *       targetHttpProxiesClient
826    *           .patchAsync(project, targetHttpProxy, targetHttpProxyResource)
827    *           .get();
828    * }
829    * }</pre>
830    *
831    * @param project Project ID for this request.
832    * @param targetHttpProxy Name of the TargetHttpProxy resource to patch.
833    * @param targetHttpProxyResource The body resource for this request
834    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
835    */
patchAsync( String project, String targetHttpProxy, TargetHttpProxy targetHttpProxyResource)836   public final OperationFuture<Operation, Operation> patchAsync(
837       String project, String targetHttpProxy, TargetHttpProxy targetHttpProxyResource) {
838     PatchTargetHttpProxyRequest request =
839         PatchTargetHttpProxyRequest.newBuilder()
840             .setProject(project)
841             .setTargetHttpProxy(targetHttpProxy)
842             .setTargetHttpProxyResource(targetHttpProxyResource)
843             .build();
844     return patchAsync(request);
845   }
846 
847   // AUTO-GENERATED DOCUMENTATION AND METHOD.
848   /**
849    * Patches the specified TargetHttpProxy resource with the data included in the request. This
850    * method supports PATCH semantics and uses JSON merge patch format and processing rules.
851    *
852    * <p>Sample code:
853    *
854    * <pre>{@code
855    * // This snippet has been automatically generated and should be regarded as a code template only.
856    * // It will require modifications to work:
857    * // - It may require correct/in-range values for request initialization.
858    * // - It may require specifying regional endpoints when creating the service client as shown in
859    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
860    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
861    *   PatchTargetHttpProxyRequest request =
862    *       PatchTargetHttpProxyRequest.newBuilder()
863    *           .setProject("project-309310695")
864    *           .setRequestId("requestId693933066")
865    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
866    *           .setTargetHttpProxyResource(TargetHttpProxy.newBuilder().build())
867    *           .build();
868    *   Operation response = targetHttpProxiesClient.patchAsync(request).get();
869    * }
870    * }</pre>
871    *
872    * @param request The request object containing all of the parameters for the API call.
873    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
874    */
875   @BetaApi(
876       "The surface for long-running operations is not stable yet and may change in the future.")
patchAsync( PatchTargetHttpProxyRequest request)877   public final OperationFuture<Operation, Operation> patchAsync(
878       PatchTargetHttpProxyRequest request) {
879     return patchOperationCallable().futureCall(request);
880   }
881 
882   // AUTO-GENERATED DOCUMENTATION AND METHOD.
883   /**
884    * Patches the specified TargetHttpProxy resource with the data included in the request. This
885    * method supports PATCH semantics and uses JSON merge patch format and processing rules.
886    *
887    * <p>Sample code:
888    *
889    * <pre>{@code
890    * // This snippet has been automatically generated and should be regarded as a code template only.
891    * // It will require modifications to work:
892    * // - It may require correct/in-range values for request initialization.
893    * // - It may require specifying regional endpoints when creating the service client as shown in
894    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
895    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
896    *   PatchTargetHttpProxyRequest request =
897    *       PatchTargetHttpProxyRequest.newBuilder()
898    *           .setProject("project-309310695")
899    *           .setRequestId("requestId693933066")
900    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
901    *           .setTargetHttpProxyResource(TargetHttpProxy.newBuilder().build())
902    *           .build();
903    *   OperationFuture<Operation, Operation> future =
904    *       targetHttpProxiesClient.patchOperationCallable().futureCall(request);
905    *   // Do something.
906    *   Operation response = future.get();
907    * }
908    * }</pre>
909    */
910   public final OperationCallable<PatchTargetHttpProxyRequest, Operation, Operation>
patchOperationCallable()911       patchOperationCallable() {
912     return stub.patchOperationCallable();
913   }
914 
915   // AUTO-GENERATED DOCUMENTATION AND METHOD.
916   /**
917    * Patches the specified TargetHttpProxy resource with the data included in the request. This
918    * method supports PATCH semantics and uses JSON merge patch format and processing rules.
919    *
920    * <p>Sample code:
921    *
922    * <pre>{@code
923    * // This snippet has been automatically generated and should be regarded as a code template only.
924    * // It will require modifications to work:
925    * // - It may require correct/in-range values for request initialization.
926    * // - It may require specifying regional endpoints when creating the service client as shown in
927    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
928    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
929    *   PatchTargetHttpProxyRequest request =
930    *       PatchTargetHttpProxyRequest.newBuilder()
931    *           .setProject("project-309310695")
932    *           .setRequestId("requestId693933066")
933    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
934    *           .setTargetHttpProxyResource(TargetHttpProxy.newBuilder().build())
935    *           .build();
936    *   ApiFuture<Operation> future = targetHttpProxiesClient.patchCallable().futureCall(request);
937    *   // Do something.
938    *   Operation response = future.get();
939    * }
940    * }</pre>
941    */
patchCallable()942   public final UnaryCallable<PatchTargetHttpProxyRequest, Operation> patchCallable() {
943     return stub.patchCallable();
944   }
945 
946   // AUTO-GENERATED DOCUMENTATION AND METHOD.
947   /**
948    * Changes the URL map for TargetHttpProxy.
949    *
950    * <p>Sample code:
951    *
952    * <pre>{@code
953    * // This snippet has been automatically generated and should be regarded as a code template only.
954    * // It will require modifications to work:
955    * // - It may require correct/in-range values for request initialization.
956    * // - It may require specifying regional endpoints when creating the service client as shown in
957    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
958    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
959    *   String project = "project-309310695";
960    *   String targetHttpProxy = "targetHttpProxy-1944074187";
961    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
962    *   Operation response =
963    *       targetHttpProxiesClient
964    *           .setUrlMapAsync(project, targetHttpProxy, urlMapReferenceResource)
965    *           .get();
966    * }
967    * }</pre>
968    *
969    * @param project Project ID for this request.
970    * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for.
971    * @param urlMapReferenceResource The body resource for this request
972    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
973    */
setUrlMapAsync( String project, String targetHttpProxy, UrlMapReference urlMapReferenceResource)974   public final OperationFuture<Operation, Operation> setUrlMapAsync(
975       String project, String targetHttpProxy, UrlMapReference urlMapReferenceResource) {
976     SetUrlMapTargetHttpProxyRequest request =
977         SetUrlMapTargetHttpProxyRequest.newBuilder()
978             .setProject(project)
979             .setTargetHttpProxy(targetHttpProxy)
980             .setUrlMapReferenceResource(urlMapReferenceResource)
981             .build();
982     return setUrlMapAsync(request);
983   }
984 
985   // AUTO-GENERATED DOCUMENTATION AND METHOD.
986   /**
987    * Changes the URL map for TargetHttpProxy.
988    *
989    * <p>Sample code:
990    *
991    * <pre>{@code
992    * // This snippet has been automatically generated and should be regarded as a code template only.
993    * // It will require modifications to work:
994    * // - It may require correct/in-range values for request initialization.
995    * // - It may require specifying regional endpoints when creating the service client as shown in
996    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
997    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
998    *   SetUrlMapTargetHttpProxyRequest request =
999    *       SetUrlMapTargetHttpProxyRequest.newBuilder()
1000    *           .setProject("project-309310695")
1001    *           .setRequestId("requestId693933066")
1002    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
1003    *           .setUrlMapReferenceResource(UrlMapReference.newBuilder().build())
1004    *           .build();
1005    *   Operation response = targetHttpProxiesClient.setUrlMapAsync(request).get();
1006    * }
1007    * }</pre>
1008    *
1009    * @param request The request object containing all of the parameters for the API call.
1010    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1011    */
1012   @BetaApi(
1013       "The surface for long-running operations is not stable yet and may change in the future.")
setUrlMapAsync( SetUrlMapTargetHttpProxyRequest request)1014   public final OperationFuture<Operation, Operation> setUrlMapAsync(
1015       SetUrlMapTargetHttpProxyRequest request) {
1016     return setUrlMapOperationCallable().futureCall(request);
1017   }
1018 
1019   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1020   /**
1021    * Changes the URL map for TargetHttpProxy.
1022    *
1023    * <p>Sample code:
1024    *
1025    * <pre>{@code
1026    * // This snippet has been automatically generated and should be regarded as a code template only.
1027    * // It will require modifications to work:
1028    * // - It may require correct/in-range values for request initialization.
1029    * // - It may require specifying regional endpoints when creating the service client as shown in
1030    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1031    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
1032    *   SetUrlMapTargetHttpProxyRequest request =
1033    *       SetUrlMapTargetHttpProxyRequest.newBuilder()
1034    *           .setProject("project-309310695")
1035    *           .setRequestId("requestId693933066")
1036    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
1037    *           .setUrlMapReferenceResource(UrlMapReference.newBuilder().build())
1038    *           .build();
1039    *   OperationFuture<Operation, Operation> future =
1040    *       targetHttpProxiesClient.setUrlMapOperationCallable().futureCall(request);
1041    *   // Do something.
1042    *   Operation response = future.get();
1043    * }
1044    * }</pre>
1045    */
1046   public final OperationCallable<SetUrlMapTargetHttpProxyRequest, Operation, Operation>
setUrlMapOperationCallable()1047       setUrlMapOperationCallable() {
1048     return stub.setUrlMapOperationCallable();
1049   }
1050 
1051   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1052   /**
1053    * Changes the URL map for TargetHttpProxy.
1054    *
1055    * <p>Sample code:
1056    *
1057    * <pre>{@code
1058    * // This snippet has been automatically generated and should be regarded as a code template only.
1059    * // It will require modifications to work:
1060    * // - It may require correct/in-range values for request initialization.
1061    * // - It may require specifying regional endpoints when creating the service client as shown in
1062    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1063    * try (TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.create()) {
1064    *   SetUrlMapTargetHttpProxyRequest request =
1065    *       SetUrlMapTargetHttpProxyRequest.newBuilder()
1066    *           .setProject("project-309310695")
1067    *           .setRequestId("requestId693933066")
1068    *           .setTargetHttpProxy("targetHttpProxy-1944074187")
1069    *           .setUrlMapReferenceResource(UrlMapReference.newBuilder().build())
1070    *           .build();
1071    *   ApiFuture<Operation> future = targetHttpProxiesClient.setUrlMapCallable().futureCall(request);
1072    *   // Do something.
1073    *   Operation response = future.get();
1074    * }
1075    * }</pre>
1076    */
setUrlMapCallable()1077   public final UnaryCallable<SetUrlMapTargetHttpProxyRequest, Operation> setUrlMapCallable() {
1078     return stub.setUrlMapCallable();
1079   }
1080 
1081   @Override
close()1082   public final void close() {
1083     stub.close();
1084   }
1085 
1086   @Override
shutdown()1087   public void shutdown() {
1088     stub.shutdown();
1089   }
1090 
1091   @Override
isShutdown()1092   public boolean isShutdown() {
1093     return stub.isShutdown();
1094   }
1095 
1096   @Override
isTerminated()1097   public boolean isTerminated() {
1098     return stub.isTerminated();
1099   }
1100 
1101   @Override
shutdownNow()1102   public void shutdownNow() {
1103     stub.shutdownNow();
1104   }
1105 
1106   @Override
awaitTermination(long duration, TimeUnit unit)1107   public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
1108     return stub.awaitTermination(duration, unit);
1109   }
1110 
1111   public static class AggregatedListPagedResponse
1112       extends AbstractPagedListResponse<
1113           AggregatedListTargetHttpProxiesRequest,
1114           TargetHttpProxyAggregatedList,
1115           Map.Entry<String, TargetHttpProxiesScopedList>,
1116           AggregatedListPage,
1117           AggregatedListFixedSizeCollection> {
1118 
createAsync( PageContext< AggregatedListTargetHttpProxiesRequest, TargetHttpProxyAggregatedList, Map.Entry<String, TargetHttpProxiesScopedList>> context, ApiFuture<TargetHttpProxyAggregatedList> futureResponse)1119     public static ApiFuture<AggregatedListPagedResponse> createAsync(
1120         PageContext<
1121                 AggregatedListTargetHttpProxiesRequest,
1122                 TargetHttpProxyAggregatedList,
1123                 Map.Entry<String, TargetHttpProxiesScopedList>>
1124             context,
1125         ApiFuture<TargetHttpProxyAggregatedList> futureResponse) {
1126       ApiFuture<AggregatedListPage> futurePage =
1127           AggregatedListPage.createEmptyPage().createPageAsync(context, futureResponse);
1128       return ApiFutures.transform(
1129           futurePage,
1130           input -> new AggregatedListPagedResponse(input),
1131           MoreExecutors.directExecutor());
1132     }
1133 
AggregatedListPagedResponse(AggregatedListPage page)1134     private AggregatedListPagedResponse(AggregatedListPage page) {
1135       super(page, AggregatedListFixedSizeCollection.createEmptyCollection());
1136     }
1137   }
1138 
1139   public static class AggregatedListPage
1140       extends AbstractPage<
1141           AggregatedListTargetHttpProxiesRequest,
1142           TargetHttpProxyAggregatedList,
1143           Map.Entry<String, TargetHttpProxiesScopedList>,
1144           AggregatedListPage> {
1145 
AggregatedListPage( PageContext< AggregatedListTargetHttpProxiesRequest, TargetHttpProxyAggregatedList, Map.Entry<String, TargetHttpProxiesScopedList>> context, TargetHttpProxyAggregatedList response)1146     private AggregatedListPage(
1147         PageContext<
1148                 AggregatedListTargetHttpProxiesRequest,
1149                 TargetHttpProxyAggregatedList,
1150                 Map.Entry<String, TargetHttpProxiesScopedList>>
1151             context,
1152         TargetHttpProxyAggregatedList response) {
1153       super(context, response);
1154     }
1155 
createEmptyPage()1156     private static AggregatedListPage createEmptyPage() {
1157       return new AggregatedListPage(null, null);
1158     }
1159 
1160     @Override
createPage( PageContext< AggregatedListTargetHttpProxiesRequest, TargetHttpProxyAggregatedList, Map.Entry<String, TargetHttpProxiesScopedList>> context, TargetHttpProxyAggregatedList response)1161     protected AggregatedListPage createPage(
1162         PageContext<
1163                 AggregatedListTargetHttpProxiesRequest,
1164                 TargetHttpProxyAggregatedList,
1165                 Map.Entry<String, TargetHttpProxiesScopedList>>
1166             context,
1167         TargetHttpProxyAggregatedList response) {
1168       return new AggregatedListPage(context, response);
1169     }
1170 
1171     @Override
createPageAsync( PageContext< AggregatedListTargetHttpProxiesRequest, TargetHttpProxyAggregatedList, Map.Entry<String, TargetHttpProxiesScopedList>> context, ApiFuture<TargetHttpProxyAggregatedList> futureResponse)1172     public ApiFuture<AggregatedListPage> createPageAsync(
1173         PageContext<
1174                 AggregatedListTargetHttpProxiesRequest,
1175                 TargetHttpProxyAggregatedList,
1176                 Map.Entry<String, TargetHttpProxiesScopedList>>
1177             context,
1178         ApiFuture<TargetHttpProxyAggregatedList> futureResponse) {
1179       return super.createPageAsync(context, futureResponse);
1180     }
1181   }
1182 
1183   public static class AggregatedListFixedSizeCollection
1184       extends AbstractFixedSizeCollection<
1185           AggregatedListTargetHttpProxiesRequest,
1186           TargetHttpProxyAggregatedList,
1187           Map.Entry<String, TargetHttpProxiesScopedList>,
1188           AggregatedListPage,
1189           AggregatedListFixedSizeCollection> {
1190 
AggregatedListFixedSizeCollection(List<AggregatedListPage> pages, int collectionSize)1191     private AggregatedListFixedSizeCollection(List<AggregatedListPage> pages, int collectionSize) {
1192       super(pages, collectionSize);
1193     }
1194 
createEmptyCollection()1195     private static AggregatedListFixedSizeCollection createEmptyCollection() {
1196       return new AggregatedListFixedSizeCollection(null, 0);
1197     }
1198 
1199     @Override
createCollection( List<AggregatedListPage> pages, int collectionSize)1200     protected AggregatedListFixedSizeCollection createCollection(
1201         List<AggregatedListPage> pages, int collectionSize) {
1202       return new AggregatedListFixedSizeCollection(pages, collectionSize);
1203     }
1204   }
1205 
1206   public static class ListPagedResponse
1207       extends AbstractPagedListResponse<
1208           ListTargetHttpProxiesRequest,
1209           TargetHttpProxyList,
1210           TargetHttpProxy,
1211           ListPage,
1212           ListFixedSizeCollection> {
1213 
createAsync( PageContext<ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy> context, ApiFuture<TargetHttpProxyList> futureResponse)1214     public static ApiFuture<ListPagedResponse> createAsync(
1215         PageContext<ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy> context,
1216         ApiFuture<TargetHttpProxyList> futureResponse) {
1217       ApiFuture<ListPage> futurePage =
1218           ListPage.createEmptyPage().createPageAsync(context, futureResponse);
1219       return ApiFutures.transform(
1220           futurePage, input -> new ListPagedResponse(input), MoreExecutors.directExecutor());
1221     }
1222 
ListPagedResponse(ListPage page)1223     private ListPagedResponse(ListPage page) {
1224       super(page, ListFixedSizeCollection.createEmptyCollection());
1225     }
1226   }
1227 
1228   public static class ListPage
1229       extends AbstractPage<
1230           ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy, ListPage> {
1231 
ListPage( PageContext<ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy> context, TargetHttpProxyList response)1232     private ListPage(
1233         PageContext<ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy> context,
1234         TargetHttpProxyList response) {
1235       super(context, response);
1236     }
1237 
createEmptyPage()1238     private static ListPage createEmptyPage() {
1239       return new ListPage(null, null);
1240     }
1241 
1242     @Override
createPage( PageContext<ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy> context, TargetHttpProxyList response)1243     protected ListPage createPage(
1244         PageContext<ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy> context,
1245         TargetHttpProxyList response) {
1246       return new ListPage(context, response);
1247     }
1248 
1249     @Override
createPageAsync( PageContext<ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy> context, ApiFuture<TargetHttpProxyList> futureResponse)1250     public ApiFuture<ListPage> createPageAsync(
1251         PageContext<ListTargetHttpProxiesRequest, TargetHttpProxyList, TargetHttpProxy> context,
1252         ApiFuture<TargetHttpProxyList> futureResponse) {
1253       return super.createPageAsync(context, futureResponse);
1254     }
1255   }
1256 
1257   public static class ListFixedSizeCollection
1258       extends AbstractFixedSizeCollection<
1259           ListTargetHttpProxiesRequest,
1260           TargetHttpProxyList,
1261           TargetHttpProxy,
1262           ListPage,
1263           ListFixedSizeCollection> {
1264 
ListFixedSizeCollection(List<ListPage> pages, int collectionSize)1265     private ListFixedSizeCollection(List<ListPage> pages, int collectionSize) {
1266       super(pages, collectionSize);
1267     }
1268 
createEmptyCollection()1269     private static ListFixedSizeCollection createEmptyCollection() {
1270       return new ListFixedSizeCollection(null, 0);
1271     }
1272 
1273     @Override
createCollection(List<ListPage> pages, int collectionSize)1274     protected ListFixedSizeCollection createCollection(List<ListPage> pages, int collectionSize) {
1275       return new ListFixedSizeCollection(pages, collectionSize);
1276     }
1277   }
1278 }
1279