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