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.TargetSslProxiesStub; 31 import com.google.cloud.compute.v1.stub.TargetSslProxiesStubSettings; 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 TargetSslProxies 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 (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 52 * String project = "project-309310695"; 53 * String targetSslProxy = "targetSslProxy-879314829"; 54 * TargetSslProxy response = targetSslProxiesClient.get(project, targetSslProxy); 55 * } 56 * }</pre> 57 * 58 * <p>Note: close() needs to be called on the TargetSslProxiesClient object to clean up resources 59 * such as threads. In the example above, try-with-resources is used, which automatically calls 60 * close(). 61 * 62 * <p>The surface of this class includes several types of Java methods for each of the API's 63 * methods: 64 * 65 * <ol> 66 * <li>A "flattened" method. With this type of method, the fields of the request type have been 67 * converted into function parameters. It may be the case that not all fields are available as 68 * parameters, and not every API method will have a flattened method entry point. 69 * <li>A "request object" method. This type of method only takes one parameter, a request object, 70 * which must be constructed before the call. Not every API method will have a request object 71 * method. 72 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 73 * callable object, which can be used to initiate calls to the service. 74 * </ol> 75 * 76 * <p>See the individual methods for example code. 77 * 78 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 79 * these names, this class includes a format method for each type of name, and additionally a parse 80 * method to extract the individual identifiers contained within names that are returned. 81 * 82 * <p>This class can be customized by passing in a custom instance of TargetSslProxiesSettings to 83 * create(). For example: 84 * 85 * <p>To customize credentials: 86 * 87 * <pre>{@code 88 * // This snippet has been automatically generated and should be regarded as a code template only. 89 * // It will require modifications to work: 90 * // - It may require correct/in-range values for request initialization. 91 * // - It may require specifying regional endpoints when creating the service client as shown in 92 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 93 * TargetSslProxiesSettings targetSslProxiesSettings = 94 * TargetSslProxiesSettings.newBuilder() 95 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 96 * .build(); 97 * TargetSslProxiesClient targetSslProxiesClient = 98 * TargetSslProxiesClient.create(targetSslProxiesSettings); 99 * }</pre> 100 * 101 * <p>To customize the endpoint: 102 * 103 * <pre>{@code 104 * // This snippet has been automatically generated and should be regarded as a code template only. 105 * // It will require modifications to work: 106 * // - It may require correct/in-range values for request initialization. 107 * // - It may require specifying regional endpoints when creating the service client as shown in 108 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 109 * TargetSslProxiesSettings targetSslProxiesSettings = 110 * TargetSslProxiesSettings.newBuilder().setEndpoint(myEndpoint).build(); 111 * TargetSslProxiesClient targetSslProxiesClient = 112 * TargetSslProxiesClient.create(targetSslProxiesSettings); 113 * }</pre> 114 * 115 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 116 */ 117 @Generated("by gapic-generator-java") 118 public class TargetSslProxiesClient implements BackgroundResource { 119 private final TargetSslProxiesSettings settings; 120 private final TargetSslProxiesStub stub; 121 122 /** Constructs an instance of TargetSslProxiesClient with default settings. */ create()123 public static final TargetSslProxiesClient create() throws IOException { 124 return create(TargetSslProxiesSettings.newBuilder().build()); 125 } 126 127 /** 128 * Constructs an instance of TargetSslProxiesClient, using the given settings. The channels are 129 * created based on the settings passed in, or defaults for any settings that are not set. 130 */ create(TargetSslProxiesSettings settings)131 public static final TargetSslProxiesClient create(TargetSslProxiesSettings settings) 132 throws IOException { 133 return new TargetSslProxiesClient(settings); 134 } 135 136 /** 137 * Constructs an instance of TargetSslProxiesClient, using the given stub for making calls. This 138 * is for advanced usage - prefer using create(TargetSslProxiesSettings). 139 */ create(TargetSslProxiesStub stub)140 public static final TargetSslProxiesClient create(TargetSslProxiesStub stub) { 141 return new TargetSslProxiesClient(stub); 142 } 143 144 /** 145 * Constructs an instance of TargetSslProxiesClient, using the given settings. This is protected 146 * so that it is easy to make a subclass, but otherwise, the static factory methods should be 147 * preferred. 148 */ TargetSslProxiesClient(TargetSslProxiesSettings settings)149 protected TargetSslProxiesClient(TargetSslProxiesSettings settings) throws IOException { 150 this.settings = settings; 151 this.stub = ((TargetSslProxiesStubSettings) settings.getStubSettings()).createStub(); 152 } 153 TargetSslProxiesClient(TargetSslProxiesStub stub)154 protected TargetSslProxiesClient(TargetSslProxiesStub stub) { 155 this.settings = null; 156 this.stub = stub; 157 } 158 getSettings()159 public final TargetSslProxiesSettings getSettings() { 160 return settings; 161 } 162 getStub()163 public TargetSslProxiesStub getStub() { 164 return stub; 165 } 166 167 // AUTO-GENERATED DOCUMENTATION AND METHOD. 168 /** 169 * Deletes the specified TargetSslProxy resource. 170 * 171 * <p>Sample code: 172 * 173 * <pre>{@code 174 * // This snippet has been automatically generated and should be regarded as a code template only. 175 * // It will require modifications to work: 176 * // - It may require correct/in-range values for request initialization. 177 * // - It may require specifying regional endpoints when creating the service client as shown in 178 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 179 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 180 * String project = "project-309310695"; 181 * String targetSslProxy = "targetSslProxy-879314829"; 182 * Operation response = targetSslProxiesClient.deleteAsync(project, targetSslProxy).get(); 183 * } 184 * }</pre> 185 * 186 * @param project Project ID for this request. 187 * @param targetSslProxy Name of the TargetSslProxy resource to delete. 188 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 189 */ deleteAsync( String project, String targetSslProxy)190 public final OperationFuture<Operation, Operation> deleteAsync( 191 String project, String targetSslProxy) { 192 DeleteTargetSslProxyRequest request = 193 DeleteTargetSslProxyRequest.newBuilder() 194 .setProject(project) 195 .setTargetSslProxy(targetSslProxy) 196 .build(); 197 return deleteAsync(request); 198 } 199 200 // AUTO-GENERATED DOCUMENTATION AND METHOD. 201 /** 202 * Deletes the specified TargetSslProxy resource. 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 (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 213 * DeleteTargetSslProxyRequest request = 214 * DeleteTargetSslProxyRequest.newBuilder() 215 * .setProject("project-309310695") 216 * .setRequestId("requestId693933066") 217 * .setTargetSslProxy("targetSslProxy-879314829") 218 * .build(); 219 * Operation response = targetSslProxiesClient.deleteAsync(request).get(); 220 * } 221 * }</pre> 222 * 223 * @param request The request object containing all of the parameters for the API call. 224 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 225 */ 226 @BetaApi( 227 "The surface for long-running operations is not stable yet and may change in the future.") deleteAsync( DeleteTargetSslProxyRequest request)228 public final OperationFuture<Operation, Operation> deleteAsync( 229 DeleteTargetSslProxyRequest request) { 230 return deleteOperationCallable().futureCall(request); 231 } 232 233 // AUTO-GENERATED DOCUMENTATION AND METHOD. 234 /** 235 * Deletes the specified TargetSslProxy resource. 236 * 237 * <p>Sample code: 238 * 239 * <pre>{@code 240 * // This snippet has been automatically generated and should be regarded as a code template only. 241 * // It will require modifications to work: 242 * // - It may require correct/in-range values for request initialization. 243 * // - It may require specifying regional endpoints when creating the service client as shown in 244 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 245 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 246 * DeleteTargetSslProxyRequest request = 247 * DeleteTargetSslProxyRequest.newBuilder() 248 * .setProject("project-309310695") 249 * .setRequestId("requestId693933066") 250 * .setTargetSslProxy("targetSslProxy-879314829") 251 * .build(); 252 * OperationFuture<Operation, Operation> future = 253 * targetSslProxiesClient.deleteOperationCallable().futureCall(request); 254 * // Do something. 255 * Operation response = future.get(); 256 * } 257 * }</pre> 258 */ 259 public final OperationCallable<DeleteTargetSslProxyRequest, Operation, Operation> deleteOperationCallable()260 deleteOperationCallable() { 261 return stub.deleteOperationCallable(); 262 } 263 264 // AUTO-GENERATED DOCUMENTATION AND METHOD. 265 /** 266 * Deletes the specified TargetSslProxy resource. 267 * 268 * <p>Sample code: 269 * 270 * <pre>{@code 271 * // This snippet has been automatically generated and should be regarded as a code template only. 272 * // It will require modifications to work: 273 * // - It may require correct/in-range values for request initialization. 274 * // - It may require specifying regional endpoints when creating the service client as shown in 275 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 276 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 277 * DeleteTargetSslProxyRequest request = 278 * DeleteTargetSslProxyRequest.newBuilder() 279 * .setProject("project-309310695") 280 * .setRequestId("requestId693933066") 281 * .setTargetSslProxy("targetSslProxy-879314829") 282 * .build(); 283 * ApiFuture<Operation> future = targetSslProxiesClient.deleteCallable().futureCall(request); 284 * // Do something. 285 * Operation response = future.get(); 286 * } 287 * }</pre> 288 */ deleteCallable()289 public final UnaryCallable<DeleteTargetSslProxyRequest, Operation> deleteCallable() { 290 return stub.deleteCallable(); 291 } 292 293 // AUTO-GENERATED DOCUMENTATION AND METHOD. 294 /** 295 * Returns the specified TargetSslProxy resource. 296 * 297 * <p>Sample code: 298 * 299 * <pre>{@code 300 * // This snippet has been automatically generated and should be regarded as a code template only. 301 * // It will require modifications to work: 302 * // - It may require correct/in-range values for request initialization. 303 * // - It may require specifying regional endpoints when creating the service client as shown in 304 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 305 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 306 * String project = "project-309310695"; 307 * String targetSslProxy = "targetSslProxy-879314829"; 308 * TargetSslProxy response = targetSslProxiesClient.get(project, targetSslProxy); 309 * } 310 * }</pre> 311 * 312 * @param project Project ID for this request. 313 * @param targetSslProxy Name of the TargetSslProxy resource to return. 314 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 315 */ get(String project, String targetSslProxy)316 public final TargetSslProxy get(String project, String targetSslProxy) { 317 GetTargetSslProxyRequest request = 318 GetTargetSslProxyRequest.newBuilder() 319 .setProject(project) 320 .setTargetSslProxy(targetSslProxy) 321 .build(); 322 return get(request); 323 } 324 325 // AUTO-GENERATED DOCUMENTATION AND METHOD. 326 /** 327 * Returns the specified TargetSslProxy resource. 328 * 329 * <p>Sample code: 330 * 331 * <pre>{@code 332 * // This snippet has been automatically generated and should be regarded as a code template only. 333 * // It will require modifications to work: 334 * // - It may require correct/in-range values for request initialization. 335 * // - It may require specifying regional endpoints when creating the service client as shown in 336 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 337 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 338 * GetTargetSslProxyRequest request = 339 * GetTargetSslProxyRequest.newBuilder() 340 * .setProject("project-309310695") 341 * .setTargetSslProxy("targetSslProxy-879314829") 342 * .build(); 343 * TargetSslProxy response = targetSslProxiesClient.get(request); 344 * } 345 * }</pre> 346 * 347 * @param request The request object containing all of the parameters for the API call. 348 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 349 */ get(GetTargetSslProxyRequest request)350 public final TargetSslProxy get(GetTargetSslProxyRequest request) { 351 return getCallable().call(request); 352 } 353 354 // AUTO-GENERATED DOCUMENTATION AND METHOD. 355 /** 356 * Returns the specified TargetSslProxy 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 (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 367 * GetTargetSslProxyRequest request = 368 * GetTargetSslProxyRequest.newBuilder() 369 * .setProject("project-309310695") 370 * .setTargetSslProxy("targetSslProxy-879314829") 371 * .build(); 372 * ApiFuture<TargetSslProxy> future = targetSslProxiesClient.getCallable().futureCall(request); 373 * // Do something. 374 * TargetSslProxy response = future.get(); 375 * } 376 * }</pre> 377 */ getCallable()378 public final UnaryCallable<GetTargetSslProxyRequest, TargetSslProxy> getCallable() { 379 return stub.getCallable(); 380 } 381 382 // AUTO-GENERATED DOCUMENTATION AND METHOD. 383 /** 384 * Creates a TargetSslProxy resource in the specified project using the data included in the 385 * request. 386 * 387 * <p>Sample code: 388 * 389 * <pre>{@code 390 * // This snippet has been automatically generated and should be regarded as a code template only. 391 * // It will require modifications to work: 392 * // - It may require correct/in-range values for request initialization. 393 * // - It may require specifying regional endpoints when creating the service client as shown in 394 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 395 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 396 * String project = "project-309310695"; 397 * TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build(); 398 * Operation response = 399 * targetSslProxiesClient.insertAsync(project, targetSslProxyResource).get(); 400 * } 401 * }</pre> 402 * 403 * @param project Project ID for this request. 404 * @param targetSslProxyResource The body resource for this request 405 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 406 */ insertAsync( String project, TargetSslProxy targetSslProxyResource)407 public final OperationFuture<Operation, Operation> insertAsync( 408 String project, TargetSslProxy targetSslProxyResource) { 409 InsertTargetSslProxyRequest request = 410 InsertTargetSslProxyRequest.newBuilder() 411 .setProject(project) 412 .setTargetSslProxyResource(targetSslProxyResource) 413 .build(); 414 return insertAsync(request); 415 } 416 417 // AUTO-GENERATED DOCUMENTATION AND METHOD. 418 /** 419 * Creates a TargetSslProxy resource in the specified project using the data included in the 420 * request. 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 (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 431 * InsertTargetSslProxyRequest request = 432 * InsertTargetSslProxyRequest.newBuilder() 433 * .setProject("project-309310695") 434 * .setRequestId("requestId693933066") 435 * .setTargetSslProxyResource(TargetSslProxy.newBuilder().build()) 436 * .build(); 437 * Operation response = targetSslProxiesClient.insertAsync(request).get(); 438 * } 439 * }</pre> 440 * 441 * @param request The request object containing all of the parameters for the API call. 442 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 443 */ 444 @BetaApi( 445 "The surface for long-running operations is not stable yet and may change in the future.") insertAsync( InsertTargetSslProxyRequest request)446 public final OperationFuture<Operation, Operation> insertAsync( 447 InsertTargetSslProxyRequest request) { 448 return insertOperationCallable().futureCall(request); 449 } 450 451 // AUTO-GENERATED DOCUMENTATION AND METHOD. 452 /** 453 * Creates a TargetSslProxy resource in the specified project using the data included in the 454 * request. 455 * 456 * <p>Sample code: 457 * 458 * <pre>{@code 459 * // This snippet has been automatically generated and should be regarded as a code template only. 460 * // It will require modifications to work: 461 * // - It may require correct/in-range values for request initialization. 462 * // - It may require specifying regional endpoints when creating the service client as shown in 463 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 464 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 465 * InsertTargetSslProxyRequest request = 466 * InsertTargetSslProxyRequest.newBuilder() 467 * .setProject("project-309310695") 468 * .setRequestId("requestId693933066") 469 * .setTargetSslProxyResource(TargetSslProxy.newBuilder().build()) 470 * .build(); 471 * OperationFuture<Operation, Operation> future = 472 * targetSslProxiesClient.insertOperationCallable().futureCall(request); 473 * // Do something. 474 * Operation response = future.get(); 475 * } 476 * }</pre> 477 */ 478 public final OperationCallable<InsertTargetSslProxyRequest, Operation, Operation> insertOperationCallable()479 insertOperationCallable() { 480 return stub.insertOperationCallable(); 481 } 482 483 // AUTO-GENERATED DOCUMENTATION AND METHOD. 484 /** 485 * Creates a TargetSslProxy resource in the specified project using the data included in the 486 * request. 487 * 488 * <p>Sample code: 489 * 490 * <pre>{@code 491 * // This snippet has been automatically generated and should be regarded as a code template only. 492 * // It will require modifications to work: 493 * // - It may require correct/in-range values for request initialization. 494 * // - It may require specifying regional endpoints when creating the service client as shown in 495 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 496 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 497 * InsertTargetSslProxyRequest request = 498 * InsertTargetSslProxyRequest.newBuilder() 499 * .setProject("project-309310695") 500 * .setRequestId("requestId693933066") 501 * .setTargetSslProxyResource(TargetSslProxy.newBuilder().build()) 502 * .build(); 503 * ApiFuture<Operation> future = targetSslProxiesClient.insertCallable().futureCall(request); 504 * // Do something. 505 * Operation response = future.get(); 506 * } 507 * }</pre> 508 */ insertCallable()509 public final UnaryCallable<InsertTargetSslProxyRequest, Operation> insertCallable() { 510 return stub.insertCallable(); 511 } 512 513 // AUTO-GENERATED DOCUMENTATION AND METHOD. 514 /** 515 * Retrieves the list of TargetSslProxy resources available to the specified project. 516 * 517 * <p>Sample code: 518 * 519 * <pre>{@code 520 * // This snippet has been automatically generated and should be regarded as a code template only. 521 * // It will require modifications to work: 522 * // - It may require correct/in-range values for request initialization. 523 * // - It may require specifying regional endpoints when creating the service client as shown in 524 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 525 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 526 * String project = "project-309310695"; 527 * for (TargetSslProxy element : targetSslProxiesClient.list(project).iterateAll()) { 528 * // doThingsWith(element); 529 * } 530 * } 531 * }</pre> 532 * 533 * @param project Project ID for this request. 534 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 535 */ list(String project)536 public final ListPagedResponse list(String project) { 537 ListTargetSslProxiesRequest request = 538 ListTargetSslProxiesRequest.newBuilder().setProject(project).build(); 539 return list(request); 540 } 541 542 // AUTO-GENERATED DOCUMENTATION AND METHOD. 543 /** 544 * Retrieves the list of TargetSslProxy resources available to the specified project. 545 * 546 * <p>Sample code: 547 * 548 * <pre>{@code 549 * // This snippet has been automatically generated and should be regarded as a code template only. 550 * // It will require modifications to work: 551 * // - It may require correct/in-range values for request initialization. 552 * // - It may require specifying regional endpoints when creating the service client as shown in 553 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 554 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 555 * ListTargetSslProxiesRequest request = 556 * ListTargetSslProxiesRequest.newBuilder() 557 * .setFilter("filter-1274492040") 558 * .setMaxResults(1128457243) 559 * .setOrderBy("orderBy-1207110587") 560 * .setPageToken("pageToken873572522") 561 * .setProject("project-309310695") 562 * .setReturnPartialSuccess(true) 563 * .build(); 564 * for (TargetSslProxy element : targetSslProxiesClient.list(request).iterateAll()) { 565 * // doThingsWith(element); 566 * } 567 * } 568 * }</pre> 569 * 570 * @param request The request object containing all of the parameters for the API call. 571 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 572 */ list(ListTargetSslProxiesRequest request)573 public final ListPagedResponse list(ListTargetSslProxiesRequest request) { 574 return listPagedCallable().call(request); 575 } 576 577 // AUTO-GENERATED DOCUMENTATION AND METHOD. 578 /** 579 * Retrieves the list of TargetSslProxy resources available to the specified project. 580 * 581 * <p>Sample code: 582 * 583 * <pre>{@code 584 * // This snippet has been automatically generated and should be regarded as a code template only. 585 * // It will require modifications to work: 586 * // - It may require correct/in-range values for request initialization. 587 * // - It may require specifying regional endpoints when creating the service client as shown in 588 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 589 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 590 * ListTargetSslProxiesRequest request = 591 * ListTargetSslProxiesRequest.newBuilder() 592 * .setFilter("filter-1274492040") 593 * .setMaxResults(1128457243) 594 * .setOrderBy("orderBy-1207110587") 595 * .setPageToken("pageToken873572522") 596 * .setProject("project-309310695") 597 * .setReturnPartialSuccess(true) 598 * .build(); 599 * ApiFuture<TargetSslProxy> future = 600 * targetSslProxiesClient.listPagedCallable().futureCall(request); 601 * // Do something. 602 * for (TargetSslProxy element : future.get().iterateAll()) { 603 * // doThingsWith(element); 604 * } 605 * } 606 * }</pre> 607 */ listPagedCallable()608 public final UnaryCallable<ListTargetSslProxiesRequest, ListPagedResponse> listPagedCallable() { 609 return stub.listPagedCallable(); 610 } 611 612 // AUTO-GENERATED DOCUMENTATION AND METHOD. 613 /** 614 * Retrieves the list of TargetSslProxy resources available to the specified project. 615 * 616 * <p>Sample code: 617 * 618 * <pre>{@code 619 * // This snippet has been automatically generated and should be regarded as a code template only. 620 * // It will require modifications to work: 621 * // - It may require correct/in-range values for request initialization. 622 * // - It may require specifying regional endpoints when creating the service client as shown in 623 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 624 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 625 * ListTargetSslProxiesRequest request = 626 * ListTargetSslProxiesRequest.newBuilder() 627 * .setFilter("filter-1274492040") 628 * .setMaxResults(1128457243) 629 * .setOrderBy("orderBy-1207110587") 630 * .setPageToken("pageToken873572522") 631 * .setProject("project-309310695") 632 * .setReturnPartialSuccess(true) 633 * .build(); 634 * while (true) { 635 * TargetSslProxyList response = targetSslProxiesClient.listCallable().call(request); 636 * for (TargetSslProxy element : response.getItemsList()) { 637 * // doThingsWith(element); 638 * } 639 * String nextPageToken = response.getNextPageToken(); 640 * if (!Strings.isNullOrEmpty(nextPageToken)) { 641 * request = request.toBuilder().setPageToken(nextPageToken).build(); 642 * } else { 643 * break; 644 * } 645 * } 646 * } 647 * }</pre> 648 */ listCallable()649 public final UnaryCallable<ListTargetSslProxiesRequest, TargetSslProxyList> listCallable() { 650 return stub.listCallable(); 651 } 652 653 // AUTO-GENERATED DOCUMENTATION AND METHOD. 654 /** 655 * Changes the BackendService for TargetSslProxy. 656 * 657 * <p>Sample code: 658 * 659 * <pre>{@code 660 * // This snippet has been automatically generated and should be regarded as a code template only. 661 * // It will require modifications to work: 662 * // - It may require correct/in-range values for request initialization. 663 * // - It may require specifying regional endpoints when creating the service client as shown in 664 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 665 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 666 * String project = "project-309310695"; 667 * String targetSslProxy = "targetSslProxy-879314829"; 668 * TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = 669 * TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); 670 * Operation response = 671 * targetSslProxiesClient 672 * .setBackendServiceAsync( 673 * project, targetSslProxy, targetSslProxiesSetBackendServiceRequestResource) 674 * .get(); 675 * } 676 * }</pre> 677 * 678 * @param project Project ID for this request. 679 * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to 680 * be set. 681 * @param targetSslProxiesSetBackendServiceRequestResource The body resource for this request 682 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 683 */ setBackendServiceAsync( String project, String targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource)684 public final OperationFuture<Operation, Operation> setBackendServiceAsync( 685 String project, 686 String targetSslProxy, 687 TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { 688 SetBackendServiceTargetSslProxyRequest request = 689 SetBackendServiceTargetSslProxyRequest.newBuilder() 690 .setProject(project) 691 .setTargetSslProxy(targetSslProxy) 692 .setTargetSslProxiesSetBackendServiceRequestResource( 693 targetSslProxiesSetBackendServiceRequestResource) 694 .build(); 695 return setBackendServiceAsync(request); 696 } 697 698 // AUTO-GENERATED DOCUMENTATION AND METHOD. 699 /** 700 * Changes the BackendService for TargetSslProxy. 701 * 702 * <p>Sample code: 703 * 704 * <pre>{@code 705 * // This snippet has been automatically generated and should be regarded as a code template only. 706 * // It will require modifications to work: 707 * // - It may require correct/in-range values for request initialization. 708 * // - It may require specifying regional endpoints when creating the service client as shown in 709 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 710 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 711 * SetBackendServiceTargetSslProxyRequest request = 712 * SetBackendServiceTargetSslProxyRequest.newBuilder() 713 * .setProject("project-309310695") 714 * .setRequestId("requestId693933066") 715 * .setTargetSslProxiesSetBackendServiceRequestResource( 716 * TargetSslProxiesSetBackendServiceRequest.newBuilder().build()) 717 * .setTargetSslProxy("targetSslProxy-879314829") 718 * .build(); 719 * Operation response = targetSslProxiesClient.setBackendServiceAsync(request).get(); 720 * } 721 * }</pre> 722 * 723 * @param request The request object containing all of the parameters for the API call. 724 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 725 */ 726 @BetaApi( 727 "The surface for long-running operations is not stable yet and may change in the future.") setBackendServiceAsync( SetBackendServiceTargetSslProxyRequest request)728 public final OperationFuture<Operation, Operation> setBackendServiceAsync( 729 SetBackendServiceTargetSslProxyRequest request) { 730 return setBackendServiceOperationCallable().futureCall(request); 731 } 732 733 // AUTO-GENERATED DOCUMENTATION AND METHOD. 734 /** 735 * Changes the BackendService for TargetSslProxy. 736 * 737 * <p>Sample code: 738 * 739 * <pre>{@code 740 * // This snippet has been automatically generated and should be regarded as a code template only. 741 * // It will require modifications to work: 742 * // - It may require correct/in-range values for request initialization. 743 * // - It may require specifying regional endpoints when creating the service client as shown in 744 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 745 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 746 * SetBackendServiceTargetSslProxyRequest request = 747 * SetBackendServiceTargetSslProxyRequest.newBuilder() 748 * .setProject("project-309310695") 749 * .setRequestId("requestId693933066") 750 * .setTargetSslProxiesSetBackendServiceRequestResource( 751 * TargetSslProxiesSetBackendServiceRequest.newBuilder().build()) 752 * .setTargetSslProxy("targetSslProxy-879314829") 753 * .build(); 754 * OperationFuture<Operation, Operation> future = 755 * targetSslProxiesClient.setBackendServiceOperationCallable().futureCall(request); 756 * // Do something. 757 * Operation response = future.get(); 758 * } 759 * }</pre> 760 */ 761 public final OperationCallable<SetBackendServiceTargetSslProxyRequest, Operation, Operation> setBackendServiceOperationCallable()762 setBackendServiceOperationCallable() { 763 return stub.setBackendServiceOperationCallable(); 764 } 765 766 // AUTO-GENERATED DOCUMENTATION AND METHOD. 767 /** 768 * Changes the BackendService for TargetSslProxy. 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 (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 779 * SetBackendServiceTargetSslProxyRequest request = 780 * SetBackendServiceTargetSslProxyRequest.newBuilder() 781 * .setProject("project-309310695") 782 * .setRequestId("requestId693933066") 783 * .setTargetSslProxiesSetBackendServiceRequestResource( 784 * TargetSslProxiesSetBackendServiceRequest.newBuilder().build()) 785 * .setTargetSslProxy("targetSslProxy-879314829") 786 * .build(); 787 * ApiFuture<Operation> future = 788 * targetSslProxiesClient.setBackendServiceCallable().futureCall(request); 789 * // Do something. 790 * Operation response = future.get(); 791 * } 792 * }</pre> 793 */ 794 public final UnaryCallable<SetBackendServiceTargetSslProxyRequest, Operation> setBackendServiceCallable()795 setBackendServiceCallable() { 796 return stub.setBackendServiceCallable(); 797 } 798 799 // AUTO-GENERATED DOCUMENTATION AND METHOD. 800 /** 801 * Changes the Certificate Map for TargetSslProxy. 802 * 803 * <p>Sample code: 804 * 805 * <pre>{@code 806 * // This snippet has been automatically generated and should be regarded as a code template only. 807 * // It will require modifications to work: 808 * // - It may require correct/in-range values for request initialization. 809 * // - It may require specifying regional endpoints when creating the service client as shown in 810 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 811 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 812 * String project = "project-309310695"; 813 * String targetSslProxy = "targetSslProxy-879314829"; 814 * TargetSslProxiesSetCertificateMapRequest targetSslProxiesSetCertificateMapRequestResource = 815 * TargetSslProxiesSetCertificateMapRequest.newBuilder().build(); 816 * Operation response = 817 * targetSslProxiesClient 818 * .setCertificateMapAsync( 819 * project, targetSslProxy, targetSslProxiesSetCertificateMapRequestResource) 820 * .get(); 821 * } 822 * }</pre> 823 * 824 * @param project Project ID for this request. 825 * @param targetSslProxy Name of the TargetSslProxy resource whose CertificateMap is to be set. 826 * The name must be 1-63 characters long, and comply with RFC1035. 827 * @param targetSslProxiesSetCertificateMapRequestResource The body resource for this request 828 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 829 */ setCertificateMapAsync( String project, String targetSslProxy, TargetSslProxiesSetCertificateMapRequest targetSslProxiesSetCertificateMapRequestResource)830 public final OperationFuture<Operation, Operation> setCertificateMapAsync( 831 String project, 832 String targetSslProxy, 833 TargetSslProxiesSetCertificateMapRequest targetSslProxiesSetCertificateMapRequestResource) { 834 SetCertificateMapTargetSslProxyRequest request = 835 SetCertificateMapTargetSslProxyRequest.newBuilder() 836 .setProject(project) 837 .setTargetSslProxy(targetSslProxy) 838 .setTargetSslProxiesSetCertificateMapRequestResource( 839 targetSslProxiesSetCertificateMapRequestResource) 840 .build(); 841 return setCertificateMapAsync(request); 842 } 843 844 // AUTO-GENERATED DOCUMENTATION AND METHOD. 845 /** 846 * Changes the Certificate Map for TargetSslProxy. 847 * 848 * <p>Sample code: 849 * 850 * <pre>{@code 851 * // This snippet has been automatically generated and should be regarded as a code template only. 852 * // It will require modifications to work: 853 * // - It may require correct/in-range values for request initialization. 854 * // - It may require specifying regional endpoints when creating the service client as shown in 855 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 856 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 857 * SetCertificateMapTargetSslProxyRequest request = 858 * SetCertificateMapTargetSslProxyRequest.newBuilder() 859 * .setProject("project-309310695") 860 * .setRequestId("requestId693933066") 861 * .setTargetSslProxiesSetCertificateMapRequestResource( 862 * TargetSslProxiesSetCertificateMapRequest.newBuilder().build()) 863 * .setTargetSslProxy("targetSslProxy-879314829") 864 * .build(); 865 * Operation response = targetSslProxiesClient.setCertificateMapAsync(request).get(); 866 * } 867 * }</pre> 868 * 869 * @param request The request object containing all of the parameters for the API call. 870 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 871 */ 872 @BetaApi( 873 "The surface for long-running operations is not stable yet and may change in the future.") setCertificateMapAsync( SetCertificateMapTargetSslProxyRequest request)874 public final OperationFuture<Operation, Operation> setCertificateMapAsync( 875 SetCertificateMapTargetSslProxyRequest request) { 876 return setCertificateMapOperationCallable().futureCall(request); 877 } 878 879 // AUTO-GENERATED DOCUMENTATION AND METHOD. 880 /** 881 * Changes the Certificate Map for TargetSslProxy. 882 * 883 * <p>Sample code: 884 * 885 * <pre>{@code 886 * // This snippet has been automatically generated and should be regarded as a code template only. 887 * // It will require modifications to work: 888 * // - It may require correct/in-range values for request initialization. 889 * // - It may require specifying regional endpoints when creating the service client as shown in 890 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 891 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 892 * SetCertificateMapTargetSslProxyRequest request = 893 * SetCertificateMapTargetSslProxyRequest.newBuilder() 894 * .setProject("project-309310695") 895 * .setRequestId("requestId693933066") 896 * .setTargetSslProxiesSetCertificateMapRequestResource( 897 * TargetSslProxiesSetCertificateMapRequest.newBuilder().build()) 898 * .setTargetSslProxy("targetSslProxy-879314829") 899 * .build(); 900 * OperationFuture<Operation, Operation> future = 901 * targetSslProxiesClient.setCertificateMapOperationCallable().futureCall(request); 902 * // Do something. 903 * Operation response = future.get(); 904 * } 905 * }</pre> 906 */ 907 public final OperationCallable<SetCertificateMapTargetSslProxyRequest, Operation, Operation> setCertificateMapOperationCallable()908 setCertificateMapOperationCallable() { 909 return stub.setCertificateMapOperationCallable(); 910 } 911 912 // AUTO-GENERATED DOCUMENTATION AND METHOD. 913 /** 914 * Changes the Certificate Map for TargetSslProxy. 915 * 916 * <p>Sample code: 917 * 918 * <pre>{@code 919 * // This snippet has been automatically generated and should be regarded as a code template only. 920 * // It will require modifications to work: 921 * // - It may require correct/in-range values for request initialization. 922 * // - It may require specifying regional endpoints when creating the service client as shown in 923 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 924 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 925 * SetCertificateMapTargetSslProxyRequest request = 926 * SetCertificateMapTargetSslProxyRequest.newBuilder() 927 * .setProject("project-309310695") 928 * .setRequestId("requestId693933066") 929 * .setTargetSslProxiesSetCertificateMapRequestResource( 930 * TargetSslProxiesSetCertificateMapRequest.newBuilder().build()) 931 * .setTargetSslProxy("targetSslProxy-879314829") 932 * .build(); 933 * ApiFuture<Operation> future = 934 * targetSslProxiesClient.setCertificateMapCallable().futureCall(request); 935 * // Do something. 936 * Operation response = future.get(); 937 * } 938 * }</pre> 939 */ 940 public final UnaryCallable<SetCertificateMapTargetSslProxyRequest, Operation> setCertificateMapCallable()941 setCertificateMapCallable() { 942 return stub.setCertificateMapCallable(); 943 } 944 945 // AUTO-GENERATED DOCUMENTATION AND METHOD. 946 /** 947 * Changes the ProxyHeaderType for TargetSslProxy. 948 * 949 * <p>Sample code: 950 * 951 * <pre>{@code 952 * // This snippet has been automatically generated and should be regarded as a code template only. 953 * // It will require modifications to work: 954 * // - It may require correct/in-range values for request initialization. 955 * // - It may require specifying regional endpoints when creating the service client as shown in 956 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 957 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 958 * String project = "project-309310695"; 959 * String targetSslProxy = "targetSslProxy-879314829"; 960 * TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = 961 * TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); 962 * Operation response = 963 * targetSslProxiesClient 964 * .setProxyHeaderAsync( 965 * project, targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource) 966 * .get(); 967 * } 968 * }</pre> 969 * 970 * @param project Project ID for this request. 971 * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. 972 * @param targetSslProxiesSetProxyHeaderRequestResource The body resource for this request 973 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 974 */ setProxyHeaderAsync( String project, String targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource)975 public final OperationFuture<Operation, Operation> setProxyHeaderAsync( 976 String project, 977 String targetSslProxy, 978 TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { 979 SetProxyHeaderTargetSslProxyRequest request = 980 SetProxyHeaderTargetSslProxyRequest.newBuilder() 981 .setProject(project) 982 .setTargetSslProxy(targetSslProxy) 983 .setTargetSslProxiesSetProxyHeaderRequestResource( 984 targetSslProxiesSetProxyHeaderRequestResource) 985 .build(); 986 return setProxyHeaderAsync(request); 987 } 988 989 // AUTO-GENERATED DOCUMENTATION AND METHOD. 990 /** 991 * Changes the ProxyHeaderType for TargetSslProxy. 992 * 993 * <p>Sample code: 994 * 995 * <pre>{@code 996 * // This snippet has been automatically generated and should be regarded as a code template only. 997 * // It will require modifications to work: 998 * // - It may require correct/in-range values for request initialization. 999 * // - It may require specifying regional endpoints when creating the service client as shown in 1000 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1001 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1002 * SetProxyHeaderTargetSslProxyRequest request = 1003 * SetProxyHeaderTargetSslProxyRequest.newBuilder() 1004 * .setProject("project-309310695") 1005 * .setRequestId("requestId693933066") 1006 * .setTargetSslProxiesSetProxyHeaderRequestResource( 1007 * TargetSslProxiesSetProxyHeaderRequest.newBuilder().build()) 1008 * .setTargetSslProxy("targetSslProxy-879314829") 1009 * .build(); 1010 * Operation response = targetSslProxiesClient.setProxyHeaderAsync(request).get(); 1011 * } 1012 * }</pre> 1013 * 1014 * @param request The request object containing all of the parameters for the API call. 1015 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1016 */ 1017 @BetaApi( 1018 "The surface for long-running operations is not stable yet and may change in the future.") setProxyHeaderAsync( SetProxyHeaderTargetSslProxyRequest request)1019 public final OperationFuture<Operation, Operation> setProxyHeaderAsync( 1020 SetProxyHeaderTargetSslProxyRequest request) { 1021 return setProxyHeaderOperationCallable().futureCall(request); 1022 } 1023 1024 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1025 /** 1026 * Changes the ProxyHeaderType for TargetSslProxy. 1027 * 1028 * <p>Sample code: 1029 * 1030 * <pre>{@code 1031 * // This snippet has been automatically generated and should be regarded as a code template only. 1032 * // It will require modifications to work: 1033 * // - It may require correct/in-range values for request initialization. 1034 * // - It may require specifying regional endpoints when creating the service client as shown in 1035 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1036 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1037 * SetProxyHeaderTargetSslProxyRequest request = 1038 * SetProxyHeaderTargetSslProxyRequest.newBuilder() 1039 * .setProject("project-309310695") 1040 * .setRequestId("requestId693933066") 1041 * .setTargetSslProxiesSetProxyHeaderRequestResource( 1042 * TargetSslProxiesSetProxyHeaderRequest.newBuilder().build()) 1043 * .setTargetSslProxy("targetSslProxy-879314829") 1044 * .build(); 1045 * OperationFuture<Operation, Operation> future = 1046 * targetSslProxiesClient.setProxyHeaderOperationCallable().futureCall(request); 1047 * // Do something. 1048 * Operation response = future.get(); 1049 * } 1050 * }</pre> 1051 */ 1052 public final OperationCallable<SetProxyHeaderTargetSslProxyRequest, Operation, Operation> setProxyHeaderOperationCallable()1053 setProxyHeaderOperationCallable() { 1054 return stub.setProxyHeaderOperationCallable(); 1055 } 1056 1057 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1058 /** 1059 * Changes the ProxyHeaderType for TargetSslProxy. 1060 * 1061 * <p>Sample code: 1062 * 1063 * <pre>{@code 1064 * // This snippet has been automatically generated and should be regarded as a code template only. 1065 * // It will require modifications to work: 1066 * // - It may require correct/in-range values for request initialization. 1067 * // - It may require specifying regional endpoints when creating the service client as shown in 1068 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1069 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1070 * SetProxyHeaderTargetSslProxyRequest request = 1071 * SetProxyHeaderTargetSslProxyRequest.newBuilder() 1072 * .setProject("project-309310695") 1073 * .setRequestId("requestId693933066") 1074 * .setTargetSslProxiesSetProxyHeaderRequestResource( 1075 * TargetSslProxiesSetProxyHeaderRequest.newBuilder().build()) 1076 * .setTargetSslProxy("targetSslProxy-879314829") 1077 * .build(); 1078 * ApiFuture<Operation> future = 1079 * targetSslProxiesClient.setProxyHeaderCallable().futureCall(request); 1080 * // Do something. 1081 * Operation response = future.get(); 1082 * } 1083 * }</pre> 1084 */ 1085 public final UnaryCallable<SetProxyHeaderTargetSslProxyRequest, Operation> setProxyHeaderCallable()1086 setProxyHeaderCallable() { 1087 return stub.setProxyHeaderCallable(); 1088 } 1089 1090 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1091 /** 1092 * Changes SslCertificates for TargetSslProxy. 1093 * 1094 * <p>Sample code: 1095 * 1096 * <pre>{@code 1097 * // This snippet has been automatically generated and should be regarded as a code template only. 1098 * // It will require modifications to work: 1099 * // - It may require correct/in-range values for request initialization. 1100 * // - It may require specifying regional endpoints when creating the service client as shown in 1101 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1102 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1103 * String project = "project-309310695"; 1104 * String targetSslProxy = "targetSslProxy-879314829"; 1105 * TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = 1106 * TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); 1107 * Operation response = 1108 * targetSslProxiesClient 1109 * .setSslCertificatesAsync( 1110 * project, targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource) 1111 * .get(); 1112 * } 1113 * }</pre> 1114 * 1115 * @param project Project ID for this request. 1116 * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to 1117 * be set. 1118 * @param targetSslProxiesSetSslCertificatesRequestResource The body resource for this request 1119 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1120 */ setSslCertificatesAsync( String project, String targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource)1121 public final OperationFuture<Operation, Operation> setSslCertificatesAsync( 1122 String project, 1123 String targetSslProxy, 1124 TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { 1125 SetSslCertificatesTargetSslProxyRequest request = 1126 SetSslCertificatesTargetSslProxyRequest.newBuilder() 1127 .setProject(project) 1128 .setTargetSslProxy(targetSslProxy) 1129 .setTargetSslProxiesSetSslCertificatesRequestResource( 1130 targetSslProxiesSetSslCertificatesRequestResource) 1131 .build(); 1132 return setSslCertificatesAsync(request); 1133 } 1134 1135 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1136 /** 1137 * Changes SslCertificates for TargetSslProxy. 1138 * 1139 * <p>Sample code: 1140 * 1141 * <pre>{@code 1142 * // This snippet has been automatically generated and should be regarded as a code template only. 1143 * // It will require modifications to work: 1144 * // - It may require correct/in-range values for request initialization. 1145 * // - It may require specifying regional endpoints when creating the service client as shown in 1146 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1147 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1148 * SetSslCertificatesTargetSslProxyRequest request = 1149 * SetSslCertificatesTargetSslProxyRequest.newBuilder() 1150 * .setProject("project-309310695") 1151 * .setRequestId("requestId693933066") 1152 * .setTargetSslProxiesSetSslCertificatesRequestResource( 1153 * TargetSslProxiesSetSslCertificatesRequest.newBuilder().build()) 1154 * .setTargetSslProxy("targetSslProxy-879314829") 1155 * .build(); 1156 * Operation response = targetSslProxiesClient.setSslCertificatesAsync(request).get(); 1157 * } 1158 * }</pre> 1159 * 1160 * @param request The request object containing all of the parameters for the API call. 1161 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1162 */ 1163 @BetaApi( 1164 "The surface for long-running operations is not stable yet and may change in the future.") setSslCertificatesAsync( SetSslCertificatesTargetSslProxyRequest request)1165 public final OperationFuture<Operation, Operation> setSslCertificatesAsync( 1166 SetSslCertificatesTargetSslProxyRequest request) { 1167 return setSslCertificatesOperationCallable().futureCall(request); 1168 } 1169 1170 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1171 /** 1172 * Changes SslCertificates for TargetSslProxy. 1173 * 1174 * <p>Sample code: 1175 * 1176 * <pre>{@code 1177 * // This snippet has been automatically generated and should be regarded as a code template only. 1178 * // It will require modifications to work: 1179 * // - It may require correct/in-range values for request initialization. 1180 * // - It may require specifying regional endpoints when creating the service client as shown in 1181 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1182 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1183 * SetSslCertificatesTargetSslProxyRequest request = 1184 * SetSslCertificatesTargetSslProxyRequest.newBuilder() 1185 * .setProject("project-309310695") 1186 * .setRequestId("requestId693933066") 1187 * .setTargetSslProxiesSetSslCertificatesRequestResource( 1188 * TargetSslProxiesSetSslCertificatesRequest.newBuilder().build()) 1189 * .setTargetSslProxy("targetSslProxy-879314829") 1190 * .build(); 1191 * OperationFuture<Operation, Operation> future = 1192 * targetSslProxiesClient.setSslCertificatesOperationCallable().futureCall(request); 1193 * // Do something. 1194 * Operation response = future.get(); 1195 * } 1196 * }</pre> 1197 */ 1198 public final OperationCallable<SetSslCertificatesTargetSslProxyRequest, Operation, Operation> setSslCertificatesOperationCallable()1199 setSslCertificatesOperationCallable() { 1200 return stub.setSslCertificatesOperationCallable(); 1201 } 1202 1203 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1204 /** 1205 * Changes SslCertificates for TargetSslProxy. 1206 * 1207 * <p>Sample code: 1208 * 1209 * <pre>{@code 1210 * // This snippet has been automatically generated and should be regarded as a code template only. 1211 * // It will require modifications to work: 1212 * // - It may require correct/in-range values for request initialization. 1213 * // - It may require specifying regional endpoints when creating the service client as shown in 1214 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1215 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1216 * SetSslCertificatesTargetSslProxyRequest request = 1217 * SetSslCertificatesTargetSslProxyRequest.newBuilder() 1218 * .setProject("project-309310695") 1219 * .setRequestId("requestId693933066") 1220 * .setTargetSslProxiesSetSslCertificatesRequestResource( 1221 * TargetSslProxiesSetSslCertificatesRequest.newBuilder().build()) 1222 * .setTargetSslProxy("targetSslProxy-879314829") 1223 * .build(); 1224 * ApiFuture<Operation> future = 1225 * targetSslProxiesClient.setSslCertificatesCallable().futureCall(request); 1226 * // Do something. 1227 * Operation response = future.get(); 1228 * } 1229 * }</pre> 1230 */ 1231 public final UnaryCallable<SetSslCertificatesTargetSslProxyRequest, Operation> setSslCertificatesCallable()1232 setSslCertificatesCallable() { 1233 return stub.setSslCertificatesCallable(); 1234 } 1235 1236 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1237 /** 1238 * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for 1239 * SSL features. This affects connections between clients and the SSL proxy load balancer. They do 1240 * not affect the connection between the load balancer and the backends. 1241 * 1242 * <p>Sample code: 1243 * 1244 * <pre>{@code 1245 * // This snippet has been automatically generated and should be regarded as a code template only. 1246 * // It will require modifications to work: 1247 * // - It may require correct/in-range values for request initialization. 1248 * // - It may require specifying regional endpoints when creating the service client as shown in 1249 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1250 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1251 * String project = "project-309310695"; 1252 * String targetSslProxy = "targetSslProxy-879314829"; 1253 * SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); 1254 * Operation response = 1255 * targetSslProxiesClient 1256 * .setSslPolicyAsync(project, targetSslProxy, sslPolicyReferenceResource) 1257 * .get(); 1258 * } 1259 * }</pre> 1260 * 1261 * @param project Project ID for this request. 1262 * @param targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The 1263 * name must be 1-63 characters long, and comply with RFC1035. 1264 * @param sslPolicyReferenceResource The body resource for this request 1265 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1266 */ setSslPolicyAsync( String project, String targetSslProxy, SslPolicyReference sslPolicyReferenceResource)1267 public final OperationFuture<Operation, Operation> setSslPolicyAsync( 1268 String project, String targetSslProxy, SslPolicyReference sslPolicyReferenceResource) { 1269 SetSslPolicyTargetSslProxyRequest request = 1270 SetSslPolicyTargetSslProxyRequest.newBuilder() 1271 .setProject(project) 1272 .setTargetSslProxy(targetSslProxy) 1273 .setSslPolicyReferenceResource(sslPolicyReferenceResource) 1274 .build(); 1275 return setSslPolicyAsync(request); 1276 } 1277 1278 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1279 /** 1280 * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for 1281 * SSL features. This affects connections between clients and the SSL proxy load balancer. They do 1282 * not affect the connection between the load balancer and the backends. 1283 * 1284 * <p>Sample code: 1285 * 1286 * <pre>{@code 1287 * // This snippet has been automatically generated and should be regarded as a code template only. 1288 * // It will require modifications to work: 1289 * // - It may require correct/in-range values for request initialization. 1290 * // - It may require specifying regional endpoints when creating the service client as shown in 1291 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1292 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1293 * SetSslPolicyTargetSslProxyRequest request = 1294 * SetSslPolicyTargetSslProxyRequest.newBuilder() 1295 * .setProject("project-309310695") 1296 * .setRequestId("requestId693933066") 1297 * .setSslPolicyReferenceResource(SslPolicyReference.newBuilder().build()) 1298 * .setTargetSslProxy("targetSslProxy-879314829") 1299 * .build(); 1300 * Operation response = targetSslProxiesClient.setSslPolicyAsync(request).get(); 1301 * } 1302 * }</pre> 1303 * 1304 * @param request The request object containing all of the parameters for the API call. 1305 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1306 */ 1307 @BetaApi( 1308 "The surface for long-running operations is not stable yet and may change in the future.") setSslPolicyAsync( SetSslPolicyTargetSslProxyRequest request)1309 public final OperationFuture<Operation, Operation> setSslPolicyAsync( 1310 SetSslPolicyTargetSslProxyRequest request) { 1311 return setSslPolicyOperationCallable().futureCall(request); 1312 } 1313 1314 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1315 /** 1316 * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for 1317 * SSL features. This affects connections between clients and the SSL proxy load balancer. They do 1318 * not affect the connection between the load balancer and the backends. 1319 * 1320 * <p>Sample code: 1321 * 1322 * <pre>{@code 1323 * // This snippet has been automatically generated and should be regarded as a code template only. 1324 * // It will require modifications to work: 1325 * // - It may require correct/in-range values for request initialization. 1326 * // - It may require specifying regional endpoints when creating the service client as shown in 1327 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1328 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1329 * SetSslPolicyTargetSslProxyRequest request = 1330 * SetSslPolicyTargetSslProxyRequest.newBuilder() 1331 * .setProject("project-309310695") 1332 * .setRequestId("requestId693933066") 1333 * .setSslPolicyReferenceResource(SslPolicyReference.newBuilder().build()) 1334 * .setTargetSslProxy("targetSslProxy-879314829") 1335 * .build(); 1336 * OperationFuture<Operation, Operation> future = 1337 * targetSslProxiesClient.setSslPolicyOperationCallable().futureCall(request); 1338 * // Do something. 1339 * Operation response = future.get(); 1340 * } 1341 * }</pre> 1342 */ 1343 public final OperationCallable<SetSslPolicyTargetSslProxyRequest, Operation, Operation> setSslPolicyOperationCallable()1344 setSslPolicyOperationCallable() { 1345 return stub.setSslPolicyOperationCallable(); 1346 } 1347 1348 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1349 /** 1350 * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for 1351 * SSL features. This affects connections between clients and the SSL proxy load balancer. They do 1352 * not affect the connection between the load balancer and the backends. 1353 * 1354 * <p>Sample code: 1355 * 1356 * <pre>{@code 1357 * // This snippet has been automatically generated and should be regarded as a code template only. 1358 * // It will require modifications to work: 1359 * // - It may require correct/in-range values for request initialization. 1360 * // - It may require specifying regional endpoints when creating the service client as shown in 1361 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1362 * try (TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.create()) { 1363 * SetSslPolicyTargetSslProxyRequest request = 1364 * SetSslPolicyTargetSslProxyRequest.newBuilder() 1365 * .setProject("project-309310695") 1366 * .setRequestId("requestId693933066") 1367 * .setSslPolicyReferenceResource(SslPolicyReference.newBuilder().build()) 1368 * .setTargetSslProxy("targetSslProxy-879314829") 1369 * .build(); 1370 * ApiFuture<Operation> future = 1371 * targetSslProxiesClient.setSslPolicyCallable().futureCall(request); 1372 * // Do something. 1373 * Operation response = future.get(); 1374 * } 1375 * }</pre> 1376 */ setSslPolicyCallable()1377 public final UnaryCallable<SetSslPolicyTargetSslProxyRequest, Operation> setSslPolicyCallable() { 1378 return stub.setSslPolicyCallable(); 1379 } 1380 1381 @Override close()1382 public final void close() { 1383 stub.close(); 1384 } 1385 1386 @Override shutdown()1387 public void shutdown() { 1388 stub.shutdown(); 1389 } 1390 1391 @Override isShutdown()1392 public boolean isShutdown() { 1393 return stub.isShutdown(); 1394 } 1395 1396 @Override isTerminated()1397 public boolean isTerminated() { 1398 return stub.isTerminated(); 1399 } 1400 1401 @Override shutdownNow()1402 public void shutdownNow() { 1403 stub.shutdownNow(); 1404 } 1405 1406 @Override awaitTermination(long duration, TimeUnit unit)1407 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 1408 return stub.awaitTermination(duration, unit); 1409 } 1410 1411 public static class ListPagedResponse 1412 extends AbstractPagedListResponse< 1413 ListTargetSslProxiesRequest, 1414 TargetSslProxyList, 1415 TargetSslProxy, 1416 ListPage, 1417 ListFixedSizeCollection> { 1418 createAsync( PageContext<ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy> context, ApiFuture<TargetSslProxyList> futureResponse)1419 public static ApiFuture<ListPagedResponse> createAsync( 1420 PageContext<ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy> context, 1421 ApiFuture<TargetSslProxyList> futureResponse) { 1422 ApiFuture<ListPage> futurePage = 1423 ListPage.createEmptyPage().createPageAsync(context, futureResponse); 1424 return ApiFutures.transform( 1425 futurePage, input -> new ListPagedResponse(input), MoreExecutors.directExecutor()); 1426 } 1427 ListPagedResponse(ListPage page)1428 private ListPagedResponse(ListPage page) { 1429 super(page, ListFixedSizeCollection.createEmptyCollection()); 1430 } 1431 } 1432 1433 public static class ListPage 1434 extends AbstractPage< 1435 ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy, ListPage> { 1436 ListPage( PageContext<ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy> context, TargetSslProxyList response)1437 private ListPage( 1438 PageContext<ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy> context, 1439 TargetSslProxyList response) { 1440 super(context, response); 1441 } 1442 createEmptyPage()1443 private static ListPage createEmptyPage() { 1444 return new ListPage(null, null); 1445 } 1446 1447 @Override createPage( PageContext<ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy> context, TargetSslProxyList response)1448 protected ListPage createPage( 1449 PageContext<ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy> context, 1450 TargetSslProxyList response) { 1451 return new ListPage(context, response); 1452 } 1453 1454 @Override createPageAsync( PageContext<ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy> context, ApiFuture<TargetSslProxyList> futureResponse)1455 public ApiFuture<ListPage> createPageAsync( 1456 PageContext<ListTargetSslProxiesRequest, TargetSslProxyList, TargetSslProxy> context, 1457 ApiFuture<TargetSslProxyList> futureResponse) { 1458 return super.createPageAsync(context, futureResponse); 1459 } 1460 } 1461 1462 public static class ListFixedSizeCollection 1463 extends AbstractFixedSizeCollection< 1464 ListTargetSslProxiesRequest, 1465 TargetSslProxyList, 1466 TargetSslProxy, 1467 ListPage, 1468 ListFixedSizeCollection> { 1469 ListFixedSizeCollection(List<ListPage> pages, int collectionSize)1470 private ListFixedSizeCollection(List<ListPage> pages, int collectionSize) { 1471 super(pages, collectionSize); 1472 } 1473 createEmptyCollection()1474 private static ListFixedSizeCollection createEmptyCollection() { 1475 return new ListFixedSizeCollection(null, 0); 1476 } 1477 1478 @Override createCollection(List<ListPage> pages, int collectionSize)1479 protected ListFixedSizeCollection createCollection(List<ListPage> pages, int collectionSize) { 1480 return new ListFixedSizeCollection(pages, collectionSize); 1481 } 1482 } 1483 } 1484