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.apigateway.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.httpjson.longrunning.OperationsClient; 24 import com.google.api.gax.longrunning.OperationFuture; 25 import com.google.api.gax.paging.AbstractFixedSizeCollection; 26 import com.google.api.gax.paging.AbstractPage; 27 import com.google.api.gax.paging.AbstractPagedListResponse; 28 import com.google.api.gax.rpc.OperationCallable; 29 import com.google.api.gax.rpc.PageContext; 30 import com.google.api.gax.rpc.UnaryCallable; 31 import com.google.cloud.apigateway.v1.stub.ApiGatewayServiceStub; 32 import com.google.cloud.apigateway.v1.stub.ApiGatewayServiceStubSettings; 33 import com.google.common.util.concurrent.MoreExecutors; 34 import com.google.longrunning.Operation; 35 import com.google.protobuf.Empty; 36 import com.google.protobuf.FieldMask; 37 import java.io.IOException; 38 import java.util.List; 39 import java.util.concurrent.TimeUnit; 40 import javax.annotation.Generated; 41 42 // AUTO-GENERATED DOCUMENTATION AND CLASS. 43 /** 44 * Service Description: The API Gateway Service is the interface for managing API Gateways. 45 * 46 * <p>This class provides the ability to make remote calls to the backing service through method 47 * calls that map to API methods. Sample code to get started: 48 * 49 * <pre>{@code 50 * // This snippet has been automatically generated and should be regarded as a code template only. 51 * // It will require modifications to work: 52 * // - It may require correct/in-range values for request initialization. 53 * // - It may require specifying regional endpoints when creating the service client as shown in 54 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 55 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 56 * GatewayName name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]"); 57 * Gateway response = apiGatewayServiceClient.getGateway(name); 58 * } 59 * }</pre> 60 * 61 * <p>Note: close() needs to be called on the ApiGatewayServiceClient object to clean up resources 62 * such as threads. In the example above, try-with-resources is used, which automatically calls 63 * 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 ApiGatewayServiceSettings to 86 * 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 * ApiGatewayServiceSettings apiGatewayServiceSettings = 97 * ApiGatewayServiceSettings.newBuilder() 98 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 99 * .build(); 100 * ApiGatewayServiceClient apiGatewayServiceClient = 101 * ApiGatewayServiceClient.create(apiGatewayServiceSettings); 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 * ApiGatewayServiceSettings apiGatewayServiceSettings = 113 * ApiGatewayServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); 114 * ApiGatewayServiceClient apiGatewayServiceClient = 115 * ApiGatewayServiceClient.create(apiGatewayServiceSettings); 116 * }</pre> 117 * 118 * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over 119 * the wire: 120 * 121 * <pre>{@code 122 * // This snippet has been automatically generated and should be regarded as a code template only. 123 * // It will require modifications to work: 124 * // - It may require correct/in-range values for request initialization. 125 * // - It may require specifying regional endpoints when creating the service client as shown in 126 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 127 * ApiGatewayServiceSettings apiGatewayServiceSettings = 128 * ApiGatewayServiceSettings.newHttpJsonBuilder().build(); 129 * ApiGatewayServiceClient apiGatewayServiceClient = 130 * ApiGatewayServiceClient.create(apiGatewayServiceSettings); 131 * }</pre> 132 * 133 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 134 */ 135 @Generated("by gapic-generator-java") 136 public class ApiGatewayServiceClient implements BackgroundResource { 137 private final ApiGatewayServiceSettings settings; 138 private final ApiGatewayServiceStub stub; 139 private final OperationsClient httpJsonOperationsClient; 140 private final com.google.longrunning.OperationsClient operationsClient; 141 142 /** Constructs an instance of ApiGatewayServiceClient with default settings. */ create()143 public static final ApiGatewayServiceClient create() throws IOException { 144 return create(ApiGatewayServiceSettings.newBuilder().build()); 145 } 146 147 /** 148 * Constructs an instance of ApiGatewayServiceClient, using the given settings. The channels are 149 * created based on the settings passed in, or defaults for any settings that are not set. 150 */ create(ApiGatewayServiceSettings settings)151 public static final ApiGatewayServiceClient create(ApiGatewayServiceSettings settings) 152 throws IOException { 153 return new ApiGatewayServiceClient(settings); 154 } 155 156 /** 157 * Constructs an instance of ApiGatewayServiceClient, using the given stub for making calls. This 158 * is for advanced usage - prefer using create(ApiGatewayServiceSettings). 159 */ create(ApiGatewayServiceStub stub)160 public static final ApiGatewayServiceClient create(ApiGatewayServiceStub stub) { 161 return new ApiGatewayServiceClient(stub); 162 } 163 164 /** 165 * Constructs an instance of ApiGatewayServiceClient, using the given settings. This is protected 166 * so that it is easy to make a subclass, but otherwise, the static factory methods should be 167 * preferred. 168 */ ApiGatewayServiceClient(ApiGatewayServiceSettings settings)169 protected ApiGatewayServiceClient(ApiGatewayServiceSettings settings) throws IOException { 170 this.settings = settings; 171 this.stub = ((ApiGatewayServiceStubSettings) settings.getStubSettings()).createStub(); 172 this.operationsClient = 173 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 174 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 175 } 176 ApiGatewayServiceClient(ApiGatewayServiceStub stub)177 protected ApiGatewayServiceClient(ApiGatewayServiceStub stub) { 178 this.settings = null; 179 this.stub = stub; 180 this.operationsClient = 181 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 182 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 183 } 184 getSettings()185 public final ApiGatewayServiceSettings getSettings() { 186 return settings; 187 } 188 getStub()189 public ApiGatewayServiceStub getStub() { 190 return stub; 191 } 192 193 /** 194 * Returns the OperationsClient that can be used to query the status of a long-running operation 195 * returned by another API method call. 196 */ getOperationsClient()197 public final com.google.longrunning.OperationsClient getOperationsClient() { 198 return operationsClient; 199 } 200 201 /** 202 * Returns the OperationsClient that can be used to query the status of a long-running operation 203 * returned by another API method call. 204 */ 205 @BetaApi getHttpJsonOperationsClient()206 public final OperationsClient getHttpJsonOperationsClient() { 207 return httpJsonOperationsClient; 208 } 209 210 // AUTO-GENERATED DOCUMENTATION AND METHOD. 211 /** 212 * Lists Gateways in a given project and location. 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 (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 223 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 224 * for (Gateway element : apiGatewayServiceClient.listGateways(parent).iterateAll()) { 225 * // doThingsWith(element); 226 * } 227 * } 228 * }</pre> 229 * 230 * @param parent Required. Parent resource of the Gateway, of the form: 231 * `projects/*/locations/*` 232 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 233 */ listGateways(LocationName parent)234 public final ListGatewaysPagedResponse listGateways(LocationName parent) { 235 ListGatewaysRequest request = 236 ListGatewaysRequest.newBuilder() 237 .setParent(parent == null ? null : parent.toString()) 238 .build(); 239 return listGateways(request); 240 } 241 242 // AUTO-GENERATED DOCUMENTATION AND METHOD. 243 /** 244 * Lists Gateways in a given project and location. 245 * 246 * <p>Sample code: 247 * 248 * <pre>{@code 249 * // This snippet has been automatically generated and should be regarded as a code template only. 250 * // It will require modifications to work: 251 * // - It may require correct/in-range values for request initialization. 252 * // - It may require specifying regional endpoints when creating the service client as shown in 253 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 254 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 255 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 256 * for (Gateway element : apiGatewayServiceClient.listGateways(parent).iterateAll()) { 257 * // doThingsWith(element); 258 * } 259 * } 260 * }</pre> 261 * 262 * @param parent Required. Parent resource of the Gateway, of the form: 263 * `projects/*/locations/*` 264 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 265 */ listGateways(String parent)266 public final ListGatewaysPagedResponse listGateways(String parent) { 267 ListGatewaysRequest request = ListGatewaysRequest.newBuilder().setParent(parent).build(); 268 return listGateways(request); 269 } 270 271 // AUTO-GENERATED DOCUMENTATION AND METHOD. 272 /** 273 * Lists Gateways in a given project and location. 274 * 275 * <p>Sample code: 276 * 277 * <pre>{@code 278 * // This snippet has been automatically generated and should be regarded as a code template only. 279 * // It will require modifications to work: 280 * // - It may require correct/in-range values for request initialization. 281 * // - It may require specifying regional endpoints when creating the service client as shown in 282 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 283 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 284 * ListGatewaysRequest request = 285 * ListGatewaysRequest.newBuilder() 286 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 287 * .setPageSize(883849137) 288 * .setPageToken("pageToken873572522") 289 * .setFilter("filter-1274492040") 290 * .setOrderBy("orderBy-1207110587") 291 * .build(); 292 * for (Gateway element : apiGatewayServiceClient.listGateways(request).iterateAll()) { 293 * // doThingsWith(element); 294 * } 295 * } 296 * }</pre> 297 * 298 * @param request The request object containing all of the parameters for the API call. 299 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 300 */ listGateways(ListGatewaysRequest request)301 public final ListGatewaysPagedResponse listGateways(ListGatewaysRequest request) { 302 return listGatewaysPagedCallable().call(request); 303 } 304 305 // AUTO-GENERATED DOCUMENTATION AND METHOD. 306 /** 307 * Lists Gateways in a given project and location. 308 * 309 * <p>Sample code: 310 * 311 * <pre>{@code 312 * // This snippet has been automatically generated and should be regarded as a code template only. 313 * // It will require modifications to work: 314 * // - It may require correct/in-range values for request initialization. 315 * // - It may require specifying regional endpoints when creating the service client as shown in 316 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 317 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 318 * ListGatewaysRequest request = 319 * ListGatewaysRequest.newBuilder() 320 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 321 * .setPageSize(883849137) 322 * .setPageToken("pageToken873572522") 323 * .setFilter("filter-1274492040") 324 * .setOrderBy("orderBy-1207110587") 325 * .build(); 326 * ApiFuture<Gateway> future = 327 * apiGatewayServiceClient.listGatewaysPagedCallable().futureCall(request); 328 * // Do something. 329 * for (Gateway element : future.get().iterateAll()) { 330 * // doThingsWith(element); 331 * } 332 * } 333 * }</pre> 334 */ 335 public final UnaryCallable<ListGatewaysRequest, ListGatewaysPagedResponse> listGatewaysPagedCallable()336 listGatewaysPagedCallable() { 337 return stub.listGatewaysPagedCallable(); 338 } 339 340 // AUTO-GENERATED DOCUMENTATION AND METHOD. 341 /** 342 * Lists Gateways in a given project and location. 343 * 344 * <p>Sample code: 345 * 346 * <pre>{@code 347 * // This snippet has been automatically generated and should be regarded as a code template only. 348 * // It will require modifications to work: 349 * // - It may require correct/in-range values for request initialization. 350 * // - It may require specifying regional endpoints when creating the service client as shown in 351 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 352 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 353 * ListGatewaysRequest request = 354 * ListGatewaysRequest.newBuilder() 355 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 356 * .setPageSize(883849137) 357 * .setPageToken("pageToken873572522") 358 * .setFilter("filter-1274492040") 359 * .setOrderBy("orderBy-1207110587") 360 * .build(); 361 * while (true) { 362 * ListGatewaysResponse response = 363 * apiGatewayServiceClient.listGatewaysCallable().call(request); 364 * for (Gateway element : response.getGatewaysList()) { 365 * // doThingsWith(element); 366 * } 367 * String nextPageToken = response.getNextPageToken(); 368 * if (!Strings.isNullOrEmpty(nextPageToken)) { 369 * request = request.toBuilder().setPageToken(nextPageToken).build(); 370 * } else { 371 * break; 372 * } 373 * } 374 * } 375 * }</pre> 376 */ listGatewaysCallable()377 public final UnaryCallable<ListGatewaysRequest, ListGatewaysResponse> listGatewaysCallable() { 378 return stub.listGatewaysCallable(); 379 } 380 381 // AUTO-GENERATED DOCUMENTATION AND METHOD. 382 /** 383 * Gets details of a single Gateway. 384 * 385 * <p>Sample code: 386 * 387 * <pre>{@code 388 * // This snippet has been automatically generated and should be regarded as a code template only. 389 * // It will require modifications to work: 390 * // - It may require correct/in-range values for request initialization. 391 * // - It may require specifying regional endpoints when creating the service client as shown in 392 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 393 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 394 * GatewayName name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]"); 395 * Gateway response = apiGatewayServiceClient.getGateway(name); 396 * } 397 * }</pre> 398 * 399 * @param name Required. Resource name of the form: 400 * `projects/*/locations/*/gateways/*` 401 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 402 */ getGateway(GatewayName name)403 public final Gateway getGateway(GatewayName name) { 404 GetGatewayRequest request = 405 GetGatewayRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 406 return getGateway(request); 407 } 408 409 // AUTO-GENERATED DOCUMENTATION AND METHOD. 410 /** 411 * Gets details of a single Gateway. 412 * 413 * <p>Sample code: 414 * 415 * <pre>{@code 416 * // This snippet has been automatically generated and should be regarded as a code template only. 417 * // It will require modifications to work: 418 * // - It may require correct/in-range values for request initialization. 419 * // - It may require specifying regional endpoints when creating the service client as shown in 420 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 421 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 422 * String name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString(); 423 * Gateway response = apiGatewayServiceClient.getGateway(name); 424 * } 425 * }</pre> 426 * 427 * @param name Required. Resource name of the form: 428 * `projects/*/locations/*/gateways/*` 429 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 430 */ getGateway(String name)431 public final Gateway getGateway(String name) { 432 GetGatewayRequest request = GetGatewayRequest.newBuilder().setName(name).build(); 433 return getGateway(request); 434 } 435 436 // AUTO-GENERATED DOCUMENTATION AND METHOD. 437 /** 438 * Gets details of a single Gateway. 439 * 440 * <p>Sample code: 441 * 442 * <pre>{@code 443 * // This snippet has been automatically generated and should be regarded as a code template only. 444 * // It will require modifications to work: 445 * // - It may require correct/in-range values for request initialization. 446 * // - It may require specifying regional endpoints when creating the service client as shown in 447 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 448 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 449 * GetGatewayRequest request = 450 * GetGatewayRequest.newBuilder() 451 * .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) 452 * .build(); 453 * Gateway response = apiGatewayServiceClient.getGateway(request); 454 * } 455 * }</pre> 456 * 457 * @param request The request object containing all of the parameters for the API call. 458 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 459 */ getGateway(GetGatewayRequest request)460 public final Gateway getGateway(GetGatewayRequest request) { 461 return getGatewayCallable().call(request); 462 } 463 464 // AUTO-GENERATED DOCUMENTATION AND METHOD. 465 /** 466 * Gets details of a single Gateway. 467 * 468 * <p>Sample code: 469 * 470 * <pre>{@code 471 * // This snippet has been automatically generated and should be regarded as a code template only. 472 * // It will require modifications to work: 473 * // - It may require correct/in-range values for request initialization. 474 * // - It may require specifying regional endpoints when creating the service client as shown in 475 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 476 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 477 * GetGatewayRequest request = 478 * GetGatewayRequest.newBuilder() 479 * .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) 480 * .build(); 481 * ApiFuture<Gateway> future = apiGatewayServiceClient.getGatewayCallable().futureCall(request); 482 * // Do something. 483 * Gateway response = future.get(); 484 * } 485 * }</pre> 486 */ getGatewayCallable()487 public final UnaryCallable<GetGatewayRequest, Gateway> getGatewayCallable() { 488 return stub.getGatewayCallable(); 489 } 490 491 // AUTO-GENERATED DOCUMENTATION AND METHOD. 492 /** 493 * Creates a new Gateway in a given project and location. 494 * 495 * <p>Sample code: 496 * 497 * <pre>{@code 498 * // This snippet has been automatically generated and should be regarded as a code template only. 499 * // It will require modifications to work: 500 * // - It may require correct/in-range values for request initialization. 501 * // - It may require specifying regional endpoints when creating the service client as shown in 502 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 503 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 504 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 505 * Gateway gateway = Gateway.newBuilder().build(); 506 * String gatewayId = "gatewayId-1354641793"; 507 * Gateway response = 508 * apiGatewayServiceClient.createGatewayAsync(parent, gateway, gatewayId).get(); 509 * } 510 * }</pre> 511 * 512 * @param parent Required. Parent resource of the Gateway, of the form: 513 * `projects/*/locations/*` 514 * @param gateway Required. Gateway resource. 515 * @param gatewayId Required. Identifier to assign to the Gateway. Must be unique within scope of 516 * the parent resource. 517 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 518 */ createGatewayAsync( LocationName parent, Gateway gateway, String gatewayId)519 public final OperationFuture<Gateway, OperationMetadata> createGatewayAsync( 520 LocationName parent, Gateway gateway, String gatewayId) { 521 CreateGatewayRequest request = 522 CreateGatewayRequest.newBuilder() 523 .setParent(parent == null ? null : parent.toString()) 524 .setGateway(gateway) 525 .setGatewayId(gatewayId) 526 .build(); 527 return createGatewayAsync(request); 528 } 529 530 // AUTO-GENERATED DOCUMENTATION AND METHOD. 531 /** 532 * Creates a new Gateway in a given project and location. 533 * 534 * <p>Sample code: 535 * 536 * <pre>{@code 537 * // This snippet has been automatically generated and should be regarded as a code template only. 538 * // It will require modifications to work: 539 * // - It may require correct/in-range values for request initialization. 540 * // - It may require specifying regional endpoints when creating the service client as shown in 541 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 542 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 543 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 544 * Gateway gateway = Gateway.newBuilder().build(); 545 * String gatewayId = "gatewayId-1354641793"; 546 * Gateway response = 547 * apiGatewayServiceClient.createGatewayAsync(parent, gateway, gatewayId).get(); 548 * } 549 * }</pre> 550 * 551 * @param parent Required. Parent resource of the Gateway, of the form: 552 * `projects/*/locations/*` 553 * @param gateway Required. Gateway resource. 554 * @param gatewayId Required. Identifier to assign to the Gateway. Must be unique within scope of 555 * the parent resource. 556 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 557 */ createGatewayAsync( String parent, Gateway gateway, String gatewayId)558 public final OperationFuture<Gateway, OperationMetadata> createGatewayAsync( 559 String parent, Gateway gateway, String gatewayId) { 560 CreateGatewayRequest request = 561 CreateGatewayRequest.newBuilder() 562 .setParent(parent) 563 .setGateway(gateway) 564 .setGatewayId(gatewayId) 565 .build(); 566 return createGatewayAsync(request); 567 } 568 569 // AUTO-GENERATED DOCUMENTATION AND METHOD. 570 /** 571 * Creates a new Gateway in a given project and location. 572 * 573 * <p>Sample code: 574 * 575 * <pre>{@code 576 * // This snippet has been automatically generated and should be regarded as a code template only. 577 * // It will require modifications to work: 578 * // - It may require correct/in-range values for request initialization. 579 * // - It may require specifying regional endpoints when creating the service client as shown in 580 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 581 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 582 * CreateGatewayRequest request = 583 * CreateGatewayRequest.newBuilder() 584 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 585 * .setGatewayId("gatewayId-1354641793") 586 * .setGateway(Gateway.newBuilder().build()) 587 * .build(); 588 * Gateway response = apiGatewayServiceClient.createGatewayAsync(request).get(); 589 * } 590 * }</pre> 591 * 592 * @param request The request object containing all of the parameters for the API call. 593 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 594 */ createGatewayAsync( CreateGatewayRequest request)595 public final OperationFuture<Gateway, OperationMetadata> createGatewayAsync( 596 CreateGatewayRequest request) { 597 return createGatewayOperationCallable().futureCall(request); 598 } 599 600 // AUTO-GENERATED DOCUMENTATION AND METHOD. 601 /** 602 * Creates a new Gateway in a given project and location. 603 * 604 * <p>Sample code: 605 * 606 * <pre>{@code 607 * // This snippet has been automatically generated and should be regarded as a code template only. 608 * // It will require modifications to work: 609 * // - It may require correct/in-range values for request initialization. 610 * // - It may require specifying regional endpoints when creating the service client as shown in 611 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 612 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 613 * CreateGatewayRequest request = 614 * CreateGatewayRequest.newBuilder() 615 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 616 * .setGatewayId("gatewayId-1354641793") 617 * .setGateway(Gateway.newBuilder().build()) 618 * .build(); 619 * OperationFuture<Gateway, OperationMetadata> future = 620 * apiGatewayServiceClient.createGatewayOperationCallable().futureCall(request); 621 * // Do something. 622 * Gateway response = future.get(); 623 * } 624 * }</pre> 625 */ 626 public final OperationCallable<CreateGatewayRequest, Gateway, OperationMetadata> createGatewayOperationCallable()627 createGatewayOperationCallable() { 628 return stub.createGatewayOperationCallable(); 629 } 630 631 // AUTO-GENERATED DOCUMENTATION AND METHOD. 632 /** 633 * Creates a new Gateway in a given project and location. 634 * 635 * <p>Sample code: 636 * 637 * <pre>{@code 638 * // This snippet has been automatically generated and should be regarded as a code template only. 639 * // It will require modifications to work: 640 * // - It may require correct/in-range values for request initialization. 641 * // - It may require specifying regional endpoints when creating the service client as shown in 642 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 643 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 644 * CreateGatewayRequest request = 645 * CreateGatewayRequest.newBuilder() 646 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 647 * .setGatewayId("gatewayId-1354641793") 648 * .setGateway(Gateway.newBuilder().build()) 649 * .build(); 650 * ApiFuture<Operation> future = 651 * apiGatewayServiceClient.createGatewayCallable().futureCall(request); 652 * // Do something. 653 * Operation response = future.get(); 654 * } 655 * }</pre> 656 */ createGatewayCallable()657 public final UnaryCallable<CreateGatewayRequest, Operation> createGatewayCallable() { 658 return stub.createGatewayCallable(); 659 } 660 661 // AUTO-GENERATED DOCUMENTATION AND METHOD. 662 /** 663 * Updates the parameters of a single Gateway. 664 * 665 * <p>Sample code: 666 * 667 * <pre>{@code 668 * // This snippet has been automatically generated and should be regarded as a code template only. 669 * // It will require modifications to work: 670 * // - It may require correct/in-range values for request initialization. 671 * // - It may require specifying regional endpoints when creating the service client as shown in 672 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 673 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 674 * Gateway gateway = Gateway.newBuilder().build(); 675 * FieldMask updateMask = FieldMask.newBuilder().build(); 676 * Gateway response = apiGatewayServiceClient.updateGatewayAsync(gateway, updateMask).get(); 677 * } 678 * }</pre> 679 * 680 * @param gateway Required. Gateway resource. 681 * @param updateMask Field mask is used to specify the fields to be overwritten in the Gateway 682 * resource by the update. The fields specified in the update_mask are relative to the 683 * resource, not the full request. A field will be overwritten if it is in the mask. If the 684 * user does not provide a mask then all fields will be overwritten. 685 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 686 */ updateGatewayAsync( Gateway gateway, FieldMask updateMask)687 public final OperationFuture<Gateway, OperationMetadata> updateGatewayAsync( 688 Gateway gateway, FieldMask updateMask) { 689 UpdateGatewayRequest request = 690 UpdateGatewayRequest.newBuilder().setGateway(gateway).setUpdateMask(updateMask).build(); 691 return updateGatewayAsync(request); 692 } 693 694 // AUTO-GENERATED DOCUMENTATION AND METHOD. 695 /** 696 * Updates the parameters of a single Gateway. 697 * 698 * <p>Sample code: 699 * 700 * <pre>{@code 701 * // This snippet has been automatically generated and should be regarded as a code template only. 702 * // It will require modifications to work: 703 * // - It may require correct/in-range values for request initialization. 704 * // - It may require specifying regional endpoints when creating the service client as shown in 705 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 706 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 707 * UpdateGatewayRequest request = 708 * UpdateGatewayRequest.newBuilder() 709 * .setUpdateMask(FieldMask.newBuilder().build()) 710 * .setGateway(Gateway.newBuilder().build()) 711 * .build(); 712 * Gateway response = apiGatewayServiceClient.updateGatewayAsync(request).get(); 713 * } 714 * }</pre> 715 * 716 * @param request The request object containing all of the parameters for the API call. 717 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 718 */ updateGatewayAsync( UpdateGatewayRequest request)719 public final OperationFuture<Gateway, OperationMetadata> updateGatewayAsync( 720 UpdateGatewayRequest request) { 721 return updateGatewayOperationCallable().futureCall(request); 722 } 723 724 // AUTO-GENERATED DOCUMENTATION AND METHOD. 725 /** 726 * Updates the parameters of a single Gateway. 727 * 728 * <p>Sample code: 729 * 730 * <pre>{@code 731 * // This snippet has been automatically generated and should be regarded as a code template only. 732 * // It will require modifications to work: 733 * // - It may require correct/in-range values for request initialization. 734 * // - It may require specifying regional endpoints when creating the service client as shown in 735 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 736 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 737 * UpdateGatewayRequest request = 738 * UpdateGatewayRequest.newBuilder() 739 * .setUpdateMask(FieldMask.newBuilder().build()) 740 * .setGateway(Gateway.newBuilder().build()) 741 * .build(); 742 * OperationFuture<Gateway, OperationMetadata> future = 743 * apiGatewayServiceClient.updateGatewayOperationCallable().futureCall(request); 744 * // Do something. 745 * Gateway response = future.get(); 746 * } 747 * }</pre> 748 */ 749 public final OperationCallable<UpdateGatewayRequest, Gateway, OperationMetadata> updateGatewayOperationCallable()750 updateGatewayOperationCallable() { 751 return stub.updateGatewayOperationCallable(); 752 } 753 754 // AUTO-GENERATED DOCUMENTATION AND METHOD. 755 /** 756 * Updates the parameters of a single Gateway. 757 * 758 * <p>Sample code: 759 * 760 * <pre>{@code 761 * // This snippet has been automatically generated and should be regarded as a code template only. 762 * // It will require modifications to work: 763 * // - It may require correct/in-range values for request initialization. 764 * // - It may require specifying regional endpoints when creating the service client as shown in 765 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 766 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 767 * UpdateGatewayRequest request = 768 * UpdateGatewayRequest.newBuilder() 769 * .setUpdateMask(FieldMask.newBuilder().build()) 770 * .setGateway(Gateway.newBuilder().build()) 771 * .build(); 772 * ApiFuture<Operation> future = 773 * apiGatewayServiceClient.updateGatewayCallable().futureCall(request); 774 * // Do something. 775 * Operation response = future.get(); 776 * } 777 * }</pre> 778 */ updateGatewayCallable()779 public final UnaryCallable<UpdateGatewayRequest, Operation> updateGatewayCallable() { 780 return stub.updateGatewayCallable(); 781 } 782 783 // AUTO-GENERATED DOCUMENTATION AND METHOD. 784 /** 785 * Deletes a single Gateway. 786 * 787 * <p>Sample code: 788 * 789 * <pre>{@code 790 * // This snippet has been automatically generated and should be regarded as a code template only. 791 * // It will require modifications to work: 792 * // - It may require correct/in-range values for request initialization. 793 * // - It may require specifying regional endpoints when creating the service client as shown in 794 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 795 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 796 * GatewayName name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]"); 797 * apiGatewayServiceClient.deleteGatewayAsync(name).get(); 798 * } 799 * }</pre> 800 * 801 * @param name Required. Resource name of the form: 802 * `projects/*/locations/*/gateways/*` 803 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 804 */ deleteGatewayAsync(GatewayName name)805 public final OperationFuture<Empty, OperationMetadata> deleteGatewayAsync(GatewayName name) { 806 DeleteGatewayRequest request = 807 DeleteGatewayRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 808 return deleteGatewayAsync(request); 809 } 810 811 // AUTO-GENERATED DOCUMENTATION AND METHOD. 812 /** 813 * Deletes a single Gateway. 814 * 815 * <p>Sample code: 816 * 817 * <pre>{@code 818 * // This snippet has been automatically generated and should be regarded as a code template only. 819 * // It will require modifications to work: 820 * // - It may require correct/in-range values for request initialization. 821 * // - It may require specifying regional endpoints when creating the service client as shown in 822 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 823 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 824 * String name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString(); 825 * apiGatewayServiceClient.deleteGatewayAsync(name).get(); 826 * } 827 * }</pre> 828 * 829 * @param name Required. Resource name of the form: 830 * `projects/*/locations/*/gateways/*` 831 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 832 */ deleteGatewayAsync(String name)833 public final OperationFuture<Empty, OperationMetadata> deleteGatewayAsync(String name) { 834 DeleteGatewayRequest request = DeleteGatewayRequest.newBuilder().setName(name).build(); 835 return deleteGatewayAsync(request); 836 } 837 838 // AUTO-GENERATED DOCUMENTATION AND METHOD. 839 /** 840 * Deletes a single Gateway. 841 * 842 * <p>Sample code: 843 * 844 * <pre>{@code 845 * // This snippet has been automatically generated and should be regarded as a code template only. 846 * // It will require modifications to work: 847 * // - It may require correct/in-range values for request initialization. 848 * // - It may require specifying regional endpoints when creating the service client as shown in 849 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 850 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 851 * DeleteGatewayRequest request = 852 * DeleteGatewayRequest.newBuilder() 853 * .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) 854 * .build(); 855 * apiGatewayServiceClient.deleteGatewayAsync(request).get(); 856 * } 857 * }</pre> 858 * 859 * @param request The request object containing all of the parameters for the API call. 860 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 861 */ deleteGatewayAsync( DeleteGatewayRequest request)862 public final OperationFuture<Empty, OperationMetadata> deleteGatewayAsync( 863 DeleteGatewayRequest request) { 864 return deleteGatewayOperationCallable().futureCall(request); 865 } 866 867 // AUTO-GENERATED DOCUMENTATION AND METHOD. 868 /** 869 * Deletes a single Gateway. 870 * 871 * <p>Sample code: 872 * 873 * <pre>{@code 874 * // This snippet has been automatically generated and should be regarded as a code template only. 875 * // It will require modifications to work: 876 * // - It may require correct/in-range values for request initialization. 877 * // - It may require specifying regional endpoints when creating the service client as shown in 878 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 879 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 880 * DeleteGatewayRequest request = 881 * DeleteGatewayRequest.newBuilder() 882 * .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) 883 * .build(); 884 * OperationFuture<Empty, OperationMetadata> future = 885 * apiGatewayServiceClient.deleteGatewayOperationCallable().futureCall(request); 886 * // Do something. 887 * future.get(); 888 * } 889 * }</pre> 890 */ 891 public final OperationCallable<DeleteGatewayRequest, Empty, OperationMetadata> deleteGatewayOperationCallable()892 deleteGatewayOperationCallable() { 893 return stub.deleteGatewayOperationCallable(); 894 } 895 896 // AUTO-GENERATED DOCUMENTATION AND METHOD. 897 /** 898 * Deletes a single Gateway. 899 * 900 * <p>Sample code: 901 * 902 * <pre>{@code 903 * // This snippet has been automatically generated and should be regarded as a code template only. 904 * // It will require modifications to work: 905 * // - It may require correct/in-range values for request initialization. 906 * // - It may require specifying regional endpoints when creating the service client as shown in 907 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 908 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 909 * DeleteGatewayRequest request = 910 * DeleteGatewayRequest.newBuilder() 911 * .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) 912 * .build(); 913 * ApiFuture<Operation> future = 914 * apiGatewayServiceClient.deleteGatewayCallable().futureCall(request); 915 * // Do something. 916 * future.get(); 917 * } 918 * }</pre> 919 */ deleteGatewayCallable()920 public final UnaryCallable<DeleteGatewayRequest, Operation> deleteGatewayCallable() { 921 return stub.deleteGatewayCallable(); 922 } 923 924 // AUTO-GENERATED DOCUMENTATION AND METHOD. 925 /** 926 * Lists Apis in a given project and location. 927 * 928 * <p>Sample code: 929 * 930 * <pre>{@code 931 * // This snippet has been automatically generated and should be regarded as a code template only. 932 * // It will require modifications to work: 933 * // - It may require correct/in-range values for request initialization. 934 * // - It may require specifying regional endpoints when creating the service client as shown in 935 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 936 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 937 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 938 * for (Api element : apiGatewayServiceClient.listApis(parent).iterateAll()) { 939 * // doThingsWith(element); 940 * } 941 * } 942 * }</pre> 943 * 944 * @param parent Required. Parent resource of the API, of the form: 945 * `projects/*/locations/global` 946 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 947 */ listApis(LocationName parent)948 public final ListApisPagedResponse listApis(LocationName parent) { 949 ListApisRequest request = 950 ListApisRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); 951 return listApis(request); 952 } 953 954 // AUTO-GENERATED DOCUMENTATION AND METHOD. 955 /** 956 * Lists Apis in a given project and location. 957 * 958 * <p>Sample code: 959 * 960 * <pre>{@code 961 * // This snippet has been automatically generated and should be regarded as a code template only. 962 * // It will require modifications to work: 963 * // - It may require correct/in-range values for request initialization. 964 * // - It may require specifying regional endpoints when creating the service client as shown in 965 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 966 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 967 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 968 * for (Api element : apiGatewayServiceClient.listApis(parent).iterateAll()) { 969 * // doThingsWith(element); 970 * } 971 * } 972 * }</pre> 973 * 974 * @param parent Required. Parent resource of the API, of the form: 975 * `projects/*/locations/global` 976 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 977 */ listApis(String parent)978 public final ListApisPagedResponse listApis(String parent) { 979 ListApisRequest request = ListApisRequest.newBuilder().setParent(parent).build(); 980 return listApis(request); 981 } 982 983 // AUTO-GENERATED DOCUMENTATION AND METHOD. 984 /** 985 * Lists Apis in a given project and location. 986 * 987 * <p>Sample code: 988 * 989 * <pre>{@code 990 * // This snippet has been automatically generated and should be regarded as a code template only. 991 * // It will require modifications to work: 992 * // - It may require correct/in-range values for request initialization. 993 * // - It may require specifying regional endpoints when creating the service client as shown in 994 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 995 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 996 * ListApisRequest request = 997 * ListApisRequest.newBuilder() 998 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 999 * .setPageSize(883849137) 1000 * .setPageToken("pageToken873572522") 1001 * .setFilter("filter-1274492040") 1002 * .setOrderBy("orderBy-1207110587") 1003 * .build(); 1004 * for (Api element : apiGatewayServiceClient.listApis(request).iterateAll()) { 1005 * // doThingsWith(element); 1006 * } 1007 * } 1008 * }</pre> 1009 * 1010 * @param request The request object containing all of the parameters for the API call. 1011 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1012 */ listApis(ListApisRequest request)1013 public final ListApisPagedResponse listApis(ListApisRequest request) { 1014 return listApisPagedCallable().call(request); 1015 } 1016 1017 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1018 /** 1019 * Lists Apis in a given project and location. 1020 * 1021 * <p>Sample code: 1022 * 1023 * <pre>{@code 1024 * // This snippet has been automatically generated and should be regarded as a code template only. 1025 * // It will require modifications to work: 1026 * // - It may require correct/in-range values for request initialization. 1027 * // - It may require specifying regional endpoints when creating the service client as shown in 1028 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1029 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1030 * ListApisRequest request = 1031 * ListApisRequest.newBuilder() 1032 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1033 * .setPageSize(883849137) 1034 * .setPageToken("pageToken873572522") 1035 * .setFilter("filter-1274492040") 1036 * .setOrderBy("orderBy-1207110587") 1037 * .build(); 1038 * ApiFuture<Api> future = apiGatewayServiceClient.listApisPagedCallable().futureCall(request); 1039 * // Do something. 1040 * for (Api element : future.get().iterateAll()) { 1041 * // doThingsWith(element); 1042 * } 1043 * } 1044 * }</pre> 1045 */ listApisPagedCallable()1046 public final UnaryCallable<ListApisRequest, ListApisPagedResponse> listApisPagedCallable() { 1047 return stub.listApisPagedCallable(); 1048 } 1049 1050 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1051 /** 1052 * Lists Apis in a given project and location. 1053 * 1054 * <p>Sample code: 1055 * 1056 * <pre>{@code 1057 * // This snippet has been automatically generated and should be regarded as a code template only. 1058 * // It will require modifications to work: 1059 * // - It may require correct/in-range values for request initialization. 1060 * // - It may require specifying regional endpoints when creating the service client as shown in 1061 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1062 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1063 * ListApisRequest request = 1064 * ListApisRequest.newBuilder() 1065 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1066 * .setPageSize(883849137) 1067 * .setPageToken("pageToken873572522") 1068 * .setFilter("filter-1274492040") 1069 * .setOrderBy("orderBy-1207110587") 1070 * .build(); 1071 * while (true) { 1072 * ListApisResponse response = apiGatewayServiceClient.listApisCallable().call(request); 1073 * for (Api element : response.getApisList()) { 1074 * // doThingsWith(element); 1075 * } 1076 * String nextPageToken = response.getNextPageToken(); 1077 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1078 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1079 * } else { 1080 * break; 1081 * } 1082 * } 1083 * } 1084 * }</pre> 1085 */ listApisCallable()1086 public final UnaryCallable<ListApisRequest, ListApisResponse> listApisCallable() { 1087 return stub.listApisCallable(); 1088 } 1089 1090 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1091 /** 1092 * Gets details of a single Api. 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 (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1103 * ApiName name = ApiName.of("[PROJECT]", "[API]"); 1104 * Api response = apiGatewayServiceClient.getApi(name); 1105 * } 1106 * }</pre> 1107 * 1108 * @param name Required. Resource name of the form: `projects/*/locations/global/apis/*` 1109 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1110 */ getApi(ApiName name)1111 public final Api getApi(ApiName name) { 1112 GetApiRequest request = 1113 GetApiRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 1114 return getApi(request); 1115 } 1116 1117 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1118 /** 1119 * Gets details of a single Api. 1120 * 1121 * <p>Sample code: 1122 * 1123 * <pre>{@code 1124 * // This snippet has been automatically generated and should be regarded as a code template only. 1125 * // It will require modifications to work: 1126 * // - It may require correct/in-range values for request initialization. 1127 * // - It may require specifying regional endpoints when creating the service client as shown in 1128 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1129 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1130 * String name = ApiName.of("[PROJECT]", "[API]").toString(); 1131 * Api response = apiGatewayServiceClient.getApi(name); 1132 * } 1133 * }</pre> 1134 * 1135 * @param name Required. Resource name of the form: `projects/*/locations/global/apis/*` 1136 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1137 */ getApi(String name)1138 public final Api getApi(String name) { 1139 GetApiRequest request = GetApiRequest.newBuilder().setName(name).build(); 1140 return getApi(request); 1141 } 1142 1143 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1144 /** 1145 * Gets details of a single Api. 1146 * 1147 * <p>Sample code: 1148 * 1149 * <pre>{@code 1150 * // This snippet has been automatically generated and should be regarded as a code template only. 1151 * // It will require modifications to work: 1152 * // - It may require correct/in-range values for request initialization. 1153 * // - It may require specifying regional endpoints when creating the service client as shown in 1154 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1155 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1156 * GetApiRequest request = 1157 * GetApiRequest.newBuilder().setName(ApiName.of("[PROJECT]", "[API]").toString()).build(); 1158 * Api response = apiGatewayServiceClient.getApi(request); 1159 * } 1160 * }</pre> 1161 * 1162 * @param request The request object containing all of the parameters for the API call. 1163 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1164 */ getApi(GetApiRequest request)1165 public final Api getApi(GetApiRequest request) { 1166 return getApiCallable().call(request); 1167 } 1168 1169 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1170 /** 1171 * Gets details of a single Api. 1172 * 1173 * <p>Sample code: 1174 * 1175 * <pre>{@code 1176 * // This snippet has been automatically generated and should be regarded as a code template only. 1177 * // It will require modifications to work: 1178 * // - It may require correct/in-range values for request initialization. 1179 * // - It may require specifying regional endpoints when creating the service client as shown in 1180 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1181 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1182 * GetApiRequest request = 1183 * GetApiRequest.newBuilder().setName(ApiName.of("[PROJECT]", "[API]").toString()).build(); 1184 * ApiFuture<Api> future = apiGatewayServiceClient.getApiCallable().futureCall(request); 1185 * // Do something. 1186 * Api response = future.get(); 1187 * } 1188 * }</pre> 1189 */ getApiCallable()1190 public final UnaryCallable<GetApiRequest, Api> getApiCallable() { 1191 return stub.getApiCallable(); 1192 } 1193 1194 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1195 /** 1196 * Creates a new Api in a given project and location. 1197 * 1198 * <p>Sample code: 1199 * 1200 * <pre>{@code 1201 * // This snippet has been automatically generated and should be regarded as a code template only. 1202 * // It will require modifications to work: 1203 * // - It may require correct/in-range values for request initialization. 1204 * // - It may require specifying regional endpoints when creating the service client as shown in 1205 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1206 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1207 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 1208 * Api api = Api.newBuilder().build(); 1209 * String apiId = "apiId93021397"; 1210 * Api response = apiGatewayServiceClient.createApiAsync(parent, api, apiId).get(); 1211 * } 1212 * }</pre> 1213 * 1214 * @param parent Required. Parent resource of the API, of the form: 1215 * `projects/*/locations/global` 1216 * @param api Required. API resource. 1217 * @param apiId Required. Identifier to assign to the API. Must be unique within scope of the 1218 * parent resource. 1219 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1220 */ createApiAsync( LocationName parent, Api api, String apiId)1221 public final OperationFuture<Api, OperationMetadata> createApiAsync( 1222 LocationName parent, Api api, String apiId) { 1223 CreateApiRequest request = 1224 CreateApiRequest.newBuilder() 1225 .setParent(parent == null ? null : parent.toString()) 1226 .setApi(api) 1227 .setApiId(apiId) 1228 .build(); 1229 return createApiAsync(request); 1230 } 1231 1232 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1233 /** 1234 * Creates a new Api in a given project and location. 1235 * 1236 * <p>Sample code: 1237 * 1238 * <pre>{@code 1239 * // This snippet has been automatically generated and should be regarded as a code template only. 1240 * // It will require modifications to work: 1241 * // - It may require correct/in-range values for request initialization. 1242 * // - It may require specifying regional endpoints when creating the service client as shown in 1243 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1244 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1245 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 1246 * Api api = Api.newBuilder().build(); 1247 * String apiId = "apiId93021397"; 1248 * Api response = apiGatewayServiceClient.createApiAsync(parent, api, apiId).get(); 1249 * } 1250 * }</pre> 1251 * 1252 * @param parent Required. Parent resource of the API, of the form: 1253 * `projects/*/locations/global` 1254 * @param api Required. API resource. 1255 * @param apiId Required. Identifier to assign to the API. Must be unique within scope of the 1256 * parent resource. 1257 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1258 */ createApiAsync( String parent, Api api, String apiId)1259 public final OperationFuture<Api, OperationMetadata> createApiAsync( 1260 String parent, Api api, String apiId) { 1261 CreateApiRequest request = 1262 CreateApiRequest.newBuilder().setParent(parent).setApi(api).setApiId(apiId).build(); 1263 return createApiAsync(request); 1264 } 1265 1266 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1267 /** 1268 * Creates a new Api in a given project and location. 1269 * 1270 * <p>Sample code: 1271 * 1272 * <pre>{@code 1273 * // This snippet has been automatically generated and should be regarded as a code template only. 1274 * // It will require modifications to work: 1275 * // - It may require correct/in-range values for request initialization. 1276 * // - It may require specifying regional endpoints when creating the service client as shown in 1277 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1278 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1279 * CreateApiRequest request = 1280 * CreateApiRequest.newBuilder() 1281 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1282 * .setApiId("apiId93021397") 1283 * .setApi(Api.newBuilder().build()) 1284 * .build(); 1285 * Api response = apiGatewayServiceClient.createApiAsync(request).get(); 1286 * } 1287 * }</pre> 1288 * 1289 * @param request The request object containing all of the parameters for the API call. 1290 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1291 */ createApiAsync(CreateApiRequest request)1292 public final OperationFuture<Api, OperationMetadata> createApiAsync(CreateApiRequest request) { 1293 return createApiOperationCallable().futureCall(request); 1294 } 1295 1296 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1297 /** 1298 * Creates a new Api in a given project and location. 1299 * 1300 * <p>Sample code: 1301 * 1302 * <pre>{@code 1303 * // This snippet has been automatically generated and should be regarded as a code template only. 1304 * // It will require modifications to work: 1305 * // - It may require correct/in-range values for request initialization. 1306 * // - It may require specifying regional endpoints when creating the service client as shown in 1307 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1308 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1309 * CreateApiRequest request = 1310 * CreateApiRequest.newBuilder() 1311 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1312 * .setApiId("apiId93021397") 1313 * .setApi(Api.newBuilder().build()) 1314 * .build(); 1315 * OperationFuture<Api, OperationMetadata> future = 1316 * apiGatewayServiceClient.createApiOperationCallable().futureCall(request); 1317 * // Do something. 1318 * Api response = future.get(); 1319 * } 1320 * }</pre> 1321 */ 1322 public final OperationCallable<CreateApiRequest, Api, OperationMetadata> createApiOperationCallable()1323 createApiOperationCallable() { 1324 return stub.createApiOperationCallable(); 1325 } 1326 1327 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1328 /** 1329 * Creates a new Api in a given project and location. 1330 * 1331 * <p>Sample code: 1332 * 1333 * <pre>{@code 1334 * // This snippet has been automatically generated and should be regarded as a code template only. 1335 * // It will require modifications to work: 1336 * // - It may require correct/in-range values for request initialization. 1337 * // - It may require specifying regional endpoints when creating the service client as shown in 1338 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1339 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1340 * CreateApiRequest request = 1341 * CreateApiRequest.newBuilder() 1342 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1343 * .setApiId("apiId93021397") 1344 * .setApi(Api.newBuilder().build()) 1345 * .build(); 1346 * ApiFuture<Operation> future = apiGatewayServiceClient.createApiCallable().futureCall(request); 1347 * // Do something. 1348 * Operation response = future.get(); 1349 * } 1350 * }</pre> 1351 */ createApiCallable()1352 public final UnaryCallable<CreateApiRequest, Operation> createApiCallable() { 1353 return stub.createApiCallable(); 1354 } 1355 1356 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1357 /** 1358 * Updates the parameters of a single Api. 1359 * 1360 * <p>Sample code: 1361 * 1362 * <pre>{@code 1363 * // This snippet has been automatically generated and should be regarded as a code template only. 1364 * // It will require modifications to work: 1365 * // - It may require correct/in-range values for request initialization. 1366 * // - It may require specifying regional endpoints when creating the service client as shown in 1367 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1368 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1369 * Api api = Api.newBuilder().build(); 1370 * FieldMask updateMask = FieldMask.newBuilder().build(); 1371 * Api response = apiGatewayServiceClient.updateApiAsync(api, updateMask).get(); 1372 * } 1373 * }</pre> 1374 * 1375 * @param api Required. API resource. 1376 * @param updateMask Field mask is used to specify the fields to be overwritten in the Api 1377 * resource by the update. The fields specified in the update_mask are relative to the 1378 * resource, not the full request. A field will be overwritten if it is in the mask. If the 1379 * user does not provide a mask then all fields will be overwritten. 1380 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1381 */ updateApiAsync( Api api, FieldMask updateMask)1382 public final OperationFuture<Api, OperationMetadata> updateApiAsync( 1383 Api api, FieldMask updateMask) { 1384 UpdateApiRequest request = 1385 UpdateApiRequest.newBuilder().setApi(api).setUpdateMask(updateMask).build(); 1386 return updateApiAsync(request); 1387 } 1388 1389 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1390 /** 1391 * Updates the parameters of a single Api. 1392 * 1393 * <p>Sample code: 1394 * 1395 * <pre>{@code 1396 * // This snippet has been automatically generated and should be regarded as a code template only. 1397 * // It will require modifications to work: 1398 * // - It may require correct/in-range values for request initialization. 1399 * // - It may require specifying regional endpoints when creating the service client as shown in 1400 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1401 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1402 * UpdateApiRequest request = 1403 * UpdateApiRequest.newBuilder() 1404 * .setUpdateMask(FieldMask.newBuilder().build()) 1405 * .setApi(Api.newBuilder().build()) 1406 * .build(); 1407 * Api response = apiGatewayServiceClient.updateApiAsync(request).get(); 1408 * } 1409 * }</pre> 1410 * 1411 * @param request The request object containing all of the parameters for the API call. 1412 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1413 */ updateApiAsync(UpdateApiRequest request)1414 public final OperationFuture<Api, OperationMetadata> updateApiAsync(UpdateApiRequest request) { 1415 return updateApiOperationCallable().futureCall(request); 1416 } 1417 1418 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1419 /** 1420 * Updates the parameters of a single Api. 1421 * 1422 * <p>Sample code: 1423 * 1424 * <pre>{@code 1425 * // This snippet has been automatically generated and should be regarded as a code template only. 1426 * // It will require modifications to work: 1427 * // - It may require correct/in-range values for request initialization. 1428 * // - It may require specifying regional endpoints when creating the service client as shown in 1429 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1430 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1431 * UpdateApiRequest request = 1432 * UpdateApiRequest.newBuilder() 1433 * .setUpdateMask(FieldMask.newBuilder().build()) 1434 * .setApi(Api.newBuilder().build()) 1435 * .build(); 1436 * OperationFuture<Api, OperationMetadata> future = 1437 * apiGatewayServiceClient.updateApiOperationCallable().futureCall(request); 1438 * // Do something. 1439 * Api response = future.get(); 1440 * } 1441 * }</pre> 1442 */ 1443 public final OperationCallable<UpdateApiRequest, Api, OperationMetadata> updateApiOperationCallable()1444 updateApiOperationCallable() { 1445 return stub.updateApiOperationCallable(); 1446 } 1447 1448 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1449 /** 1450 * Updates the parameters of a single Api. 1451 * 1452 * <p>Sample code: 1453 * 1454 * <pre>{@code 1455 * // This snippet has been automatically generated and should be regarded as a code template only. 1456 * // It will require modifications to work: 1457 * // - It may require correct/in-range values for request initialization. 1458 * // - It may require specifying regional endpoints when creating the service client as shown in 1459 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1460 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1461 * UpdateApiRequest request = 1462 * UpdateApiRequest.newBuilder() 1463 * .setUpdateMask(FieldMask.newBuilder().build()) 1464 * .setApi(Api.newBuilder().build()) 1465 * .build(); 1466 * ApiFuture<Operation> future = apiGatewayServiceClient.updateApiCallable().futureCall(request); 1467 * // Do something. 1468 * Operation response = future.get(); 1469 * } 1470 * }</pre> 1471 */ updateApiCallable()1472 public final UnaryCallable<UpdateApiRequest, Operation> updateApiCallable() { 1473 return stub.updateApiCallable(); 1474 } 1475 1476 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1477 /** 1478 * Deletes a single Api. 1479 * 1480 * <p>Sample code: 1481 * 1482 * <pre>{@code 1483 * // This snippet has been automatically generated and should be regarded as a code template only. 1484 * // It will require modifications to work: 1485 * // - It may require correct/in-range values for request initialization. 1486 * // - It may require specifying regional endpoints when creating the service client as shown in 1487 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1488 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1489 * ApiName name = ApiName.of("[PROJECT]", "[API]"); 1490 * apiGatewayServiceClient.deleteApiAsync(name).get(); 1491 * } 1492 * }</pre> 1493 * 1494 * @param name Required. Resource name of the form: `projects/*/locations/global/apis/*` 1495 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1496 */ deleteApiAsync(ApiName name)1497 public final OperationFuture<Empty, OperationMetadata> deleteApiAsync(ApiName name) { 1498 DeleteApiRequest request = 1499 DeleteApiRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 1500 return deleteApiAsync(request); 1501 } 1502 1503 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1504 /** 1505 * Deletes a single Api. 1506 * 1507 * <p>Sample code: 1508 * 1509 * <pre>{@code 1510 * // This snippet has been automatically generated and should be regarded as a code template only. 1511 * // It will require modifications to work: 1512 * // - It may require correct/in-range values for request initialization. 1513 * // - It may require specifying regional endpoints when creating the service client as shown in 1514 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1515 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1516 * String name = ApiName.of("[PROJECT]", "[API]").toString(); 1517 * apiGatewayServiceClient.deleteApiAsync(name).get(); 1518 * } 1519 * }</pre> 1520 * 1521 * @param name Required. Resource name of the form: `projects/*/locations/global/apis/*` 1522 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1523 */ deleteApiAsync(String name)1524 public final OperationFuture<Empty, OperationMetadata> deleteApiAsync(String name) { 1525 DeleteApiRequest request = DeleteApiRequest.newBuilder().setName(name).build(); 1526 return deleteApiAsync(request); 1527 } 1528 1529 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1530 /** 1531 * Deletes a single Api. 1532 * 1533 * <p>Sample code: 1534 * 1535 * <pre>{@code 1536 * // This snippet has been automatically generated and should be regarded as a code template only. 1537 * // It will require modifications to work: 1538 * // - It may require correct/in-range values for request initialization. 1539 * // - It may require specifying regional endpoints when creating the service client as shown in 1540 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1541 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1542 * DeleteApiRequest request = 1543 * DeleteApiRequest.newBuilder() 1544 * .setName(ApiName.of("[PROJECT]", "[API]").toString()) 1545 * .build(); 1546 * apiGatewayServiceClient.deleteApiAsync(request).get(); 1547 * } 1548 * }</pre> 1549 * 1550 * @param request The request object containing all of the parameters for the API call. 1551 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1552 */ deleteApiAsync(DeleteApiRequest request)1553 public final OperationFuture<Empty, OperationMetadata> deleteApiAsync(DeleteApiRequest request) { 1554 return deleteApiOperationCallable().futureCall(request); 1555 } 1556 1557 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1558 /** 1559 * Deletes a single Api. 1560 * 1561 * <p>Sample code: 1562 * 1563 * <pre>{@code 1564 * // This snippet has been automatically generated and should be regarded as a code template only. 1565 * // It will require modifications to work: 1566 * // - It may require correct/in-range values for request initialization. 1567 * // - It may require specifying regional endpoints when creating the service client as shown in 1568 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1569 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1570 * DeleteApiRequest request = 1571 * DeleteApiRequest.newBuilder() 1572 * .setName(ApiName.of("[PROJECT]", "[API]").toString()) 1573 * .build(); 1574 * OperationFuture<Empty, OperationMetadata> future = 1575 * apiGatewayServiceClient.deleteApiOperationCallable().futureCall(request); 1576 * // Do something. 1577 * future.get(); 1578 * } 1579 * }</pre> 1580 */ 1581 public final OperationCallable<DeleteApiRequest, Empty, OperationMetadata> deleteApiOperationCallable()1582 deleteApiOperationCallable() { 1583 return stub.deleteApiOperationCallable(); 1584 } 1585 1586 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1587 /** 1588 * Deletes a single Api. 1589 * 1590 * <p>Sample code: 1591 * 1592 * <pre>{@code 1593 * // This snippet has been automatically generated and should be regarded as a code template only. 1594 * // It will require modifications to work: 1595 * // - It may require correct/in-range values for request initialization. 1596 * // - It may require specifying regional endpoints when creating the service client as shown in 1597 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1598 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1599 * DeleteApiRequest request = 1600 * DeleteApiRequest.newBuilder() 1601 * .setName(ApiName.of("[PROJECT]", "[API]").toString()) 1602 * .build(); 1603 * ApiFuture<Operation> future = apiGatewayServiceClient.deleteApiCallable().futureCall(request); 1604 * // Do something. 1605 * future.get(); 1606 * } 1607 * }</pre> 1608 */ deleteApiCallable()1609 public final UnaryCallable<DeleteApiRequest, Operation> deleteApiCallable() { 1610 return stub.deleteApiCallable(); 1611 } 1612 1613 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1614 /** 1615 * Lists ApiConfigs in a given project and location. 1616 * 1617 * <p>Sample code: 1618 * 1619 * <pre>{@code 1620 * // This snippet has been automatically generated and should be regarded as a code template only. 1621 * // It will require modifications to work: 1622 * // - It may require correct/in-range values for request initialization. 1623 * // - It may require specifying regional endpoints when creating the service client as shown in 1624 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1625 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1626 * ApiName parent = ApiName.of("[PROJECT]", "[API]"); 1627 * for (ApiConfig element : apiGatewayServiceClient.listApiConfigs(parent).iterateAll()) { 1628 * // doThingsWith(element); 1629 * } 1630 * } 1631 * }</pre> 1632 * 1633 * @param parent Required. Parent resource of the API Config, of the form: 1634 * `projects/*/locations/global/apis/*` 1635 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1636 */ listApiConfigs(ApiName parent)1637 public final ListApiConfigsPagedResponse listApiConfigs(ApiName parent) { 1638 ListApiConfigsRequest request = 1639 ListApiConfigsRequest.newBuilder() 1640 .setParent(parent == null ? null : parent.toString()) 1641 .build(); 1642 return listApiConfigs(request); 1643 } 1644 1645 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1646 /** 1647 * Lists ApiConfigs in a given project and location. 1648 * 1649 * <p>Sample code: 1650 * 1651 * <pre>{@code 1652 * // This snippet has been automatically generated and should be regarded as a code template only. 1653 * // It will require modifications to work: 1654 * // - It may require correct/in-range values for request initialization. 1655 * // - It may require specifying regional endpoints when creating the service client as shown in 1656 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1657 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1658 * String parent = ApiName.of("[PROJECT]", "[API]").toString(); 1659 * for (ApiConfig element : apiGatewayServiceClient.listApiConfigs(parent).iterateAll()) { 1660 * // doThingsWith(element); 1661 * } 1662 * } 1663 * }</pre> 1664 * 1665 * @param parent Required. Parent resource of the API Config, of the form: 1666 * `projects/*/locations/global/apis/*` 1667 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1668 */ listApiConfigs(String parent)1669 public final ListApiConfigsPagedResponse listApiConfigs(String parent) { 1670 ListApiConfigsRequest request = ListApiConfigsRequest.newBuilder().setParent(parent).build(); 1671 return listApiConfigs(request); 1672 } 1673 1674 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1675 /** 1676 * Lists ApiConfigs in a given project and location. 1677 * 1678 * <p>Sample code: 1679 * 1680 * <pre>{@code 1681 * // This snippet has been automatically generated and should be regarded as a code template only. 1682 * // It will require modifications to work: 1683 * // - It may require correct/in-range values for request initialization. 1684 * // - It may require specifying regional endpoints when creating the service client as shown in 1685 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1686 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1687 * ListApiConfigsRequest request = 1688 * ListApiConfigsRequest.newBuilder() 1689 * .setParent(ApiName.of("[PROJECT]", "[API]").toString()) 1690 * .setPageSize(883849137) 1691 * .setPageToken("pageToken873572522") 1692 * .setFilter("filter-1274492040") 1693 * .setOrderBy("orderBy-1207110587") 1694 * .build(); 1695 * for (ApiConfig element : apiGatewayServiceClient.listApiConfigs(request).iterateAll()) { 1696 * // doThingsWith(element); 1697 * } 1698 * } 1699 * }</pre> 1700 * 1701 * @param request The request object containing all of the parameters for the API call. 1702 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1703 */ listApiConfigs(ListApiConfigsRequest request)1704 public final ListApiConfigsPagedResponse listApiConfigs(ListApiConfigsRequest request) { 1705 return listApiConfigsPagedCallable().call(request); 1706 } 1707 1708 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1709 /** 1710 * Lists ApiConfigs in a given project and location. 1711 * 1712 * <p>Sample code: 1713 * 1714 * <pre>{@code 1715 * // This snippet has been automatically generated and should be regarded as a code template only. 1716 * // It will require modifications to work: 1717 * // - It may require correct/in-range values for request initialization. 1718 * // - It may require specifying regional endpoints when creating the service client as shown in 1719 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1720 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1721 * ListApiConfigsRequest request = 1722 * ListApiConfigsRequest.newBuilder() 1723 * .setParent(ApiName.of("[PROJECT]", "[API]").toString()) 1724 * .setPageSize(883849137) 1725 * .setPageToken("pageToken873572522") 1726 * .setFilter("filter-1274492040") 1727 * .setOrderBy("orderBy-1207110587") 1728 * .build(); 1729 * ApiFuture<ApiConfig> future = 1730 * apiGatewayServiceClient.listApiConfigsPagedCallable().futureCall(request); 1731 * // Do something. 1732 * for (ApiConfig element : future.get().iterateAll()) { 1733 * // doThingsWith(element); 1734 * } 1735 * } 1736 * }</pre> 1737 */ 1738 public final UnaryCallable<ListApiConfigsRequest, ListApiConfigsPagedResponse> listApiConfigsPagedCallable()1739 listApiConfigsPagedCallable() { 1740 return stub.listApiConfigsPagedCallable(); 1741 } 1742 1743 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1744 /** 1745 * Lists ApiConfigs in a given project and location. 1746 * 1747 * <p>Sample code: 1748 * 1749 * <pre>{@code 1750 * // This snippet has been automatically generated and should be regarded as a code template only. 1751 * // It will require modifications to work: 1752 * // - It may require correct/in-range values for request initialization. 1753 * // - It may require specifying regional endpoints when creating the service client as shown in 1754 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1755 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1756 * ListApiConfigsRequest request = 1757 * ListApiConfigsRequest.newBuilder() 1758 * .setParent(ApiName.of("[PROJECT]", "[API]").toString()) 1759 * .setPageSize(883849137) 1760 * .setPageToken("pageToken873572522") 1761 * .setFilter("filter-1274492040") 1762 * .setOrderBy("orderBy-1207110587") 1763 * .build(); 1764 * while (true) { 1765 * ListApiConfigsResponse response = 1766 * apiGatewayServiceClient.listApiConfigsCallable().call(request); 1767 * for (ApiConfig element : response.getApiConfigsList()) { 1768 * // doThingsWith(element); 1769 * } 1770 * String nextPageToken = response.getNextPageToken(); 1771 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1772 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1773 * } else { 1774 * break; 1775 * } 1776 * } 1777 * } 1778 * }</pre> 1779 */ 1780 public final UnaryCallable<ListApiConfigsRequest, ListApiConfigsResponse> listApiConfigsCallable()1781 listApiConfigsCallable() { 1782 return stub.listApiConfigsCallable(); 1783 } 1784 1785 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1786 /** 1787 * Gets details of a single ApiConfig. 1788 * 1789 * <p>Sample code: 1790 * 1791 * <pre>{@code 1792 * // This snippet has been automatically generated and should be regarded as a code template only. 1793 * // It will require modifications to work: 1794 * // - It may require correct/in-range values for request initialization. 1795 * // - It may require specifying regional endpoints when creating the service client as shown in 1796 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1797 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1798 * ApiConfigName name = ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]"); 1799 * ApiConfig response = apiGatewayServiceClient.getApiConfig(name); 1800 * } 1801 * }</pre> 1802 * 1803 * @param name Required. Resource name of the form: 1804 * `projects/*/locations/global/apis/*/configs/*` 1805 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1806 */ getApiConfig(ApiConfigName name)1807 public final ApiConfig getApiConfig(ApiConfigName name) { 1808 GetApiConfigRequest request = 1809 GetApiConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 1810 return getApiConfig(request); 1811 } 1812 1813 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1814 /** 1815 * Gets details of a single ApiConfig. 1816 * 1817 * <p>Sample code: 1818 * 1819 * <pre>{@code 1820 * // This snippet has been automatically generated and should be regarded as a code template only. 1821 * // It will require modifications to work: 1822 * // - It may require correct/in-range values for request initialization. 1823 * // - It may require specifying regional endpoints when creating the service client as shown in 1824 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1825 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1826 * String name = ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString(); 1827 * ApiConfig response = apiGatewayServiceClient.getApiConfig(name); 1828 * } 1829 * }</pre> 1830 * 1831 * @param name Required. Resource name of the form: 1832 * `projects/*/locations/global/apis/*/configs/*` 1833 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1834 */ getApiConfig(String name)1835 public final ApiConfig getApiConfig(String name) { 1836 GetApiConfigRequest request = GetApiConfigRequest.newBuilder().setName(name).build(); 1837 return getApiConfig(request); 1838 } 1839 1840 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1841 /** 1842 * Gets details of a single ApiConfig. 1843 * 1844 * <p>Sample code: 1845 * 1846 * <pre>{@code 1847 * // This snippet has been automatically generated and should be regarded as a code template only. 1848 * // It will require modifications to work: 1849 * // - It may require correct/in-range values for request initialization. 1850 * // - It may require specifying regional endpoints when creating the service client as shown in 1851 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1852 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1853 * GetApiConfigRequest request = 1854 * GetApiConfigRequest.newBuilder() 1855 * .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) 1856 * .build(); 1857 * ApiConfig response = apiGatewayServiceClient.getApiConfig(request); 1858 * } 1859 * }</pre> 1860 * 1861 * @param request The request object containing all of the parameters for the API call. 1862 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1863 */ getApiConfig(GetApiConfigRequest request)1864 public final ApiConfig getApiConfig(GetApiConfigRequest request) { 1865 return getApiConfigCallable().call(request); 1866 } 1867 1868 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1869 /** 1870 * Gets details of a single ApiConfig. 1871 * 1872 * <p>Sample code: 1873 * 1874 * <pre>{@code 1875 * // This snippet has been automatically generated and should be regarded as a code template only. 1876 * // It will require modifications to work: 1877 * // - It may require correct/in-range values for request initialization. 1878 * // - It may require specifying regional endpoints when creating the service client as shown in 1879 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1880 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1881 * GetApiConfigRequest request = 1882 * GetApiConfigRequest.newBuilder() 1883 * .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) 1884 * .build(); 1885 * ApiFuture<ApiConfig> future = 1886 * apiGatewayServiceClient.getApiConfigCallable().futureCall(request); 1887 * // Do something. 1888 * ApiConfig response = future.get(); 1889 * } 1890 * }</pre> 1891 */ getApiConfigCallable()1892 public final UnaryCallable<GetApiConfigRequest, ApiConfig> getApiConfigCallable() { 1893 return stub.getApiConfigCallable(); 1894 } 1895 1896 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1897 /** 1898 * Creates a new ApiConfig in a given project and location. 1899 * 1900 * <p>Sample code: 1901 * 1902 * <pre>{@code 1903 * // This snippet has been automatically generated and should be regarded as a code template only. 1904 * // It will require modifications to work: 1905 * // - It may require correct/in-range values for request initialization. 1906 * // - It may require specifying regional endpoints when creating the service client as shown in 1907 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1908 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1909 * ApiName parent = ApiName.of("[PROJECT]", "[API]"); 1910 * ApiConfig apiConfig = ApiConfig.newBuilder().build(); 1911 * String apiConfigId = "apiConfigId-64952265"; 1912 * ApiConfig response = 1913 * apiGatewayServiceClient.createApiConfigAsync(parent, apiConfig, apiConfigId).get(); 1914 * } 1915 * }</pre> 1916 * 1917 * @param parent Required. Parent resource of the API Config, of the form: 1918 * `projects/*/locations/global/apis/*` 1919 * @param apiConfig Required. API resource. 1920 * @param apiConfigId Required. Identifier to assign to the API Config. Must be unique within 1921 * scope of the parent resource. 1922 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1923 */ createApiConfigAsync( ApiName parent, ApiConfig apiConfig, String apiConfigId)1924 public final OperationFuture<ApiConfig, OperationMetadata> createApiConfigAsync( 1925 ApiName parent, ApiConfig apiConfig, String apiConfigId) { 1926 CreateApiConfigRequest request = 1927 CreateApiConfigRequest.newBuilder() 1928 .setParent(parent == null ? null : parent.toString()) 1929 .setApiConfig(apiConfig) 1930 .setApiConfigId(apiConfigId) 1931 .build(); 1932 return createApiConfigAsync(request); 1933 } 1934 1935 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1936 /** 1937 * Creates a new ApiConfig in a given project and location. 1938 * 1939 * <p>Sample code: 1940 * 1941 * <pre>{@code 1942 * // This snippet has been automatically generated and should be regarded as a code template only. 1943 * // It will require modifications to work: 1944 * // - It may require correct/in-range values for request initialization. 1945 * // - It may require specifying regional endpoints when creating the service client as shown in 1946 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1947 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1948 * String parent = ApiName.of("[PROJECT]", "[API]").toString(); 1949 * ApiConfig apiConfig = ApiConfig.newBuilder().build(); 1950 * String apiConfigId = "apiConfigId-64952265"; 1951 * ApiConfig response = 1952 * apiGatewayServiceClient.createApiConfigAsync(parent, apiConfig, apiConfigId).get(); 1953 * } 1954 * }</pre> 1955 * 1956 * @param parent Required. Parent resource of the API Config, of the form: 1957 * `projects/*/locations/global/apis/*` 1958 * @param apiConfig Required. API resource. 1959 * @param apiConfigId Required. Identifier to assign to the API Config. Must be unique within 1960 * scope of the parent resource. 1961 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1962 */ createApiConfigAsync( String parent, ApiConfig apiConfig, String apiConfigId)1963 public final OperationFuture<ApiConfig, OperationMetadata> createApiConfigAsync( 1964 String parent, ApiConfig apiConfig, String apiConfigId) { 1965 CreateApiConfigRequest request = 1966 CreateApiConfigRequest.newBuilder() 1967 .setParent(parent) 1968 .setApiConfig(apiConfig) 1969 .setApiConfigId(apiConfigId) 1970 .build(); 1971 return createApiConfigAsync(request); 1972 } 1973 1974 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1975 /** 1976 * Creates a new ApiConfig in a given project and location. 1977 * 1978 * <p>Sample code: 1979 * 1980 * <pre>{@code 1981 * // This snippet has been automatically generated and should be regarded as a code template only. 1982 * // It will require modifications to work: 1983 * // - It may require correct/in-range values for request initialization. 1984 * // - It may require specifying regional endpoints when creating the service client as shown in 1985 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1986 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 1987 * CreateApiConfigRequest request = 1988 * CreateApiConfigRequest.newBuilder() 1989 * .setParent(ApiName.of("[PROJECT]", "[API]").toString()) 1990 * .setApiConfigId("apiConfigId-64952265") 1991 * .setApiConfig(ApiConfig.newBuilder().build()) 1992 * .build(); 1993 * ApiConfig response = apiGatewayServiceClient.createApiConfigAsync(request).get(); 1994 * } 1995 * }</pre> 1996 * 1997 * @param request The request object containing all of the parameters for the API call. 1998 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1999 */ createApiConfigAsync( CreateApiConfigRequest request)2000 public final OperationFuture<ApiConfig, OperationMetadata> createApiConfigAsync( 2001 CreateApiConfigRequest request) { 2002 return createApiConfigOperationCallable().futureCall(request); 2003 } 2004 2005 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2006 /** 2007 * Creates a new ApiConfig in a given project and location. 2008 * 2009 * <p>Sample code: 2010 * 2011 * <pre>{@code 2012 * // This snippet has been automatically generated and should be regarded as a code template only. 2013 * // It will require modifications to work: 2014 * // - It may require correct/in-range values for request initialization. 2015 * // - It may require specifying regional endpoints when creating the service client as shown in 2016 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2017 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2018 * CreateApiConfigRequest request = 2019 * CreateApiConfigRequest.newBuilder() 2020 * .setParent(ApiName.of("[PROJECT]", "[API]").toString()) 2021 * .setApiConfigId("apiConfigId-64952265") 2022 * .setApiConfig(ApiConfig.newBuilder().build()) 2023 * .build(); 2024 * OperationFuture<ApiConfig, OperationMetadata> future = 2025 * apiGatewayServiceClient.createApiConfigOperationCallable().futureCall(request); 2026 * // Do something. 2027 * ApiConfig response = future.get(); 2028 * } 2029 * }</pre> 2030 */ 2031 public final OperationCallable<CreateApiConfigRequest, ApiConfig, OperationMetadata> createApiConfigOperationCallable()2032 createApiConfigOperationCallable() { 2033 return stub.createApiConfigOperationCallable(); 2034 } 2035 2036 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2037 /** 2038 * Creates a new ApiConfig in a given project and location. 2039 * 2040 * <p>Sample code: 2041 * 2042 * <pre>{@code 2043 * // This snippet has been automatically generated and should be regarded as a code template only. 2044 * // It will require modifications to work: 2045 * // - It may require correct/in-range values for request initialization. 2046 * // - It may require specifying regional endpoints when creating the service client as shown in 2047 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2048 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2049 * CreateApiConfigRequest request = 2050 * CreateApiConfigRequest.newBuilder() 2051 * .setParent(ApiName.of("[PROJECT]", "[API]").toString()) 2052 * .setApiConfigId("apiConfigId-64952265") 2053 * .setApiConfig(ApiConfig.newBuilder().build()) 2054 * .build(); 2055 * ApiFuture<Operation> future = 2056 * apiGatewayServiceClient.createApiConfigCallable().futureCall(request); 2057 * // Do something. 2058 * Operation response = future.get(); 2059 * } 2060 * }</pre> 2061 */ createApiConfigCallable()2062 public final UnaryCallable<CreateApiConfigRequest, Operation> createApiConfigCallable() { 2063 return stub.createApiConfigCallable(); 2064 } 2065 2066 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2067 /** 2068 * Updates the parameters of a single ApiConfig. 2069 * 2070 * <p>Sample code: 2071 * 2072 * <pre>{@code 2073 * // This snippet has been automatically generated and should be regarded as a code template only. 2074 * // It will require modifications to work: 2075 * // - It may require correct/in-range values for request initialization. 2076 * // - It may require specifying regional endpoints when creating the service client as shown in 2077 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2078 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2079 * ApiConfig apiConfig = ApiConfig.newBuilder().build(); 2080 * FieldMask updateMask = FieldMask.newBuilder().build(); 2081 * ApiConfig response = 2082 * apiGatewayServiceClient.updateApiConfigAsync(apiConfig, updateMask).get(); 2083 * } 2084 * }</pre> 2085 * 2086 * @param apiConfig Required. API Config resource. 2087 * @param updateMask Field mask is used to specify the fields to be overwritten in the ApiConfig 2088 * resource by the update. The fields specified in the update_mask are relative to the 2089 * resource, not the full request. A field will be overwritten if it is in the mask. If the 2090 * user does not provide a mask then all fields will be overwritten. 2091 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2092 */ updateApiConfigAsync( ApiConfig apiConfig, FieldMask updateMask)2093 public final OperationFuture<ApiConfig, OperationMetadata> updateApiConfigAsync( 2094 ApiConfig apiConfig, FieldMask updateMask) { 2095 UpdateApiConfigRequest request = 2096 UpdateApiConfigRequest.newBuilder() 2097 .setApiConfig(apiConfig) 2098 .setUpdateMask(updateMask) 2099 .build(); 2100 return updateApiConfigAsync(request); 2101 } 2102 2103 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2104 /** 2105 * Updates the parameters of a single ApiConfig. 2106 * 2107 * <p>Sample code: 2108 * 2109 * <pre>{@code 2110 * // This snippet has been automatically generated and should be regarded as a code template only. 2111 * // It will require modifications to work: 2112 * // - It may require correct/in-range values for request initialization. 2113 * // - It may require specifying regional endpoints when creating the service client as shown in 2114 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2115 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2116 * UpdateApiConfigRequest request = 2117 * UpdateApiConfigRequest.newBuilder() 2118 * .setUpdateMask(FieldMask.newBuilder().build()) 2119 * .setApiConfig(ApiConfig.newBuilder().build()) 2120 * .build(); 2121 * ApiConfig response = apiGatewayServiceClient.updateApiConfigAsync(request).get(); 2122 * } 2123 * }</pre> 2124 * 2125 * @param request The request object containing all of the parameters for the API call. 2126 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2127 */ updateApiConfigAsync( UpdateApiConfigRequest request)2128 public final OperationFuture<ApiConfig, OperationMetadata> updateApiConfigAsync( 2129 UpdateApiConfigRequest request) { 2130 return updateApiConfigOperationCallable().futureCall(request); 2131 } 2132 2133 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2134 /** 2135 * Updates the parameters of a single ApiConfig. 2136 * 2137 * <p>Sample code: 2138 * 2139 * <pre>{@code 2140 * // This snippet has been automatically generated and should be regarded as a code template only. 2141 * // It will require modifications to work: 2142 * // - It may require correct/in-range values for request initialization. 2143 * // - It may require specifying regional endpoints when creating the service client as shown in 2144 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2145 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2146 * UpdateApiConfigRequest request = 2147 * UpdateApiConfigRequest.newBuilder() 2148 * .setUpdateMask(FieldMask.newBuilder().build()) 2149 * .setApiConfig(ApiConfig.newBuilder().build()) 2150 * .build(); 2151 * OperationFuture<ApiConfig, OperationMetadata> future = 2152 * apiGatewayServiceClient.updateApiConfigOperationCallable().futureCall(request); 2153 * // Do something. 2154 * ApiConfig response = future.get(); 2155 * } 2156 * }</pre> 2157 */ 2158 public final OperationCallable<UpdateApiConfigRequest, ApiConfig, OperationMetadata> updateApiConfigOperationCallable()2159 updateApiConfigOperationCallable() { 2160 return stub.updateApiConfigOperationCallable(); 2161 } 2162 2163 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2164 /** 2165 * Updates the parameters of a single ApiConfig. 2166 * 2167 * <p>Sample code: 2168 * 2169 * <pre>{@code 2170 * // This snippet has been automatically generated and should be regarded as a code template only. 2171 * // It will require modifications to work: 2172 * // - It may require correct/in-range values for request initialization. 2173 * // - It may require specifying regional endpoints when creating the service client as shown in 2174 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2175 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2176 * UpdateApiConfigRequest request = 2177 * UpdateApiConfigRequest.newBuilder() 2178 * .setUpdateMask(FieldMask.newBuilder().build()) 2179 * .setApiConfig(ApiConfig.newBuilder().build()) 2180 * .build(); 2181 * ApiFuture<Operation> future = 2182 * apiGatewayServiceClient.updateApiConfigCallable().futureCall(request); 2183 * // Do something. 2184 * Operation response = future.get(); 2185 * } 2186 * }</pre> 2187 */ updateApiConfigCallable()2188 public final UnaryCallable<UpdateApiConfigRequest, Operation> updateApiConfigCallable() { 2189 return stub.updateApiConfigCallable(); 2190 } 2191 2192 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2193 /** 2194 * Deletes a single ApiConfig. 2195 * 2196 * <p>Sample code: 2197 * 2198 * <pre>{@code 2199 * // This snippet has been automatically generated and should be regarded as a code template only. 2200 * // It will require modifications to work: 2201 * // - It may require correct/in-range values for request initialization. 2202 * // - It may require specifying regional endpoints when creating the service client as shown in 2203 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2204 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2205 * ApiConfigName name = ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]"); 2206 * apiGatewayServiceClient.deleteApiConfigAsync(name).get(); 2207 * } 2208 * }</pre> 2209 * 2210 * @param name Required. Resource name of the form: 2211 * `projects/*/locations/global/apis/*/configs/*` 2212 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2213 */ deleteApiConfigAsync(ApiConfigName name)2214 public final OperationFuture<Empty, OperationMetadata> deleteApiConfigAsync(ApiConfigName name) { 2215 DeleteApiConfigRequest request = 2216 DeleteApiConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2217 return deleteApiConfigAsync(request); 2218 } 2219 2220 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2221 /** 2222 * Deletes a single ApiConfig. 2223 * 2224 * <p>Sample code: 2225 * 2226 * <pre>{@code 2227 * // This snippet has been automatically generated and should be regarded as a code template only. 2228 * // It will require modifications to work: 2229 * // - It may require correct/in-range values for request initialization. 2230 * // - It may require specifying regional endpoints when creating the service client as shown in 2231 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2232 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2233 * String name = ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString(); 2234 * apiGatewayServiceClient.deleteApiConfigAsync(name).get(); 2235 * } 2236 * }</pre> 2237 * 2238 * @param name Required. Resource name of the form: 2239 * `projects/*/locations/global/apis/*/configs/*` 2240 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2241 */ deleteApiConfigAsync(String name)2242 public final OperationFuture<Empty, OperationMetadata> deleteApiConfigAsync(String name) { 2243 DeleteApiConfigRequest request = DeleteApiConfigRequest.newBuilder().setName(name).build(); 2244 return deleteApiConfigAsync(request); 2245 } 2246 2247 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2248 /** 2249 * Deletes a single ApiConfig. 2250 * 2251 * <p>Sample code: 2252 * 2253 * <pre>{@code 2254 * // This snippet has been automatically generated and should be regarded as a code template only. 2255 * // It will require modifications to work: 2256 * // - It may require correct/in-range values for request initialization. 2257 * // - It may require specifying regional endpoints when creating the service client as shown in 2258 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2259 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2260 * DeleteApiConfigRequest request = 2261 * DeleteApiConfigRequest.newBuilder() 2262 * .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) 2263 * .build(); 2264 * apiGatewayServiceClient.deleteApiConfigAsync(request).get(); 2265 * } 2266 * }</pre> 2267 * 2268 * @param request The request object containing all of the parameters for the API call. 2269 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2270 */ deleteApiConfigAsync( DeleteApiConfigRequest request)2271 public final OperationFuture<Empty, OperationMetadata> deleteApiConfigAsync( 2272 DeleteApiConfigRequest request) { 2273 return deleteApiConfigOperationCallable().futureCall(request); 2274 } 2275 2276 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2277 /** 2278 * Deletes a single ApiConfig. 2279 * 2280 * <p>Sample code: 2281 * 2282 * <pre>{@code 2283 * // This snippet has been automatically generated and should be regarded as a code template only. 2284 * // It will require modifications to work: 2285 * // - It may require correct/in-range values for request initialization. 2286 * // - It may require specifying regional endpoints when creating the service client as shown in 2287 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2288 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2289 * DeleteApiConfigRequest request = 2290 * DeleteApiConfigRequest.newBuilder() 2291 * .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) 2292 * .build(); 2293 * OperationFuture<Empty, OperationMetadata> future = 2294 * apiGatewayServiceClient.deleteApiConfigOperationCallable().futureCall(request); 2295 * // Do something. 2296 * future.get(); 2297 * } 2298 * }</pre> 2299 */ 2300 public final OperationCallable<DeleteApiConfigRequest, Empty, OperationMetadata> deleteApiConfigOperationCallable()2301 deleteApiConfigOperationCallable() { 2302 return stub.deleteApiConfigOperationCallable(); 2303 } 2304 2305 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2306 /** 2307 * Deletes a single ApiConfig. 2308 * 2309 * <p>Sample code: 2310 * 2311 * <pre>{@code 2312 * // This snippet has been automatically generated and should be regarded as a code template only. 2313 * // It will require modifications to work: 2314 * // - It may require correct/in-range values for request initialization. 2315 * // - It may require specifying regional endpoints when creating the service client as shown in 2316 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2317 * try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { 2318 * DeleteApiConfigRequest request = 2319 * DeleteApiConfigRequest.newBuilder() 2320 * .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) 2321 * .build(); 2322 * ApiFuture<Operation> future = 2323 * apiGatewayServiceClient.deleteApiConfigCallable().futureCall(request); 2324 * // Do something. 2325 * future.get(); 2326 * } 2327 * }</pre> 2328 */ deleteApiConfigCallable()2329 public final UnaryCallable<DeleteApiConfigRequest, Operation> deleteApiConfigCallable() { 2330 return stub.deleteApiConfigCallable(); 2331 } 2332 2333 @Override close()2334 public final void close() { 2335 stub.close(); 2336 } 2337 2338 @Override shutdown()2339 public void shutdown() { 2340 stub.shutdown(); 2341 } 2342 2343 @Override isShutdown()2344 public boolean isShutdown() { 2345 return stub.isShutdown(); 2346 } 2347 2348 @Override isTerminated()2349 public boolean isTerminated() { 2350 return stub.isTerminated(); 2351 } 2352 2353 @Override shutdownNow()2354 public void shutdownNow() { 2355 stub.shutdownNow(); 2356 } 2357 2358 @Override awaitTermination(long duration, TimeUnit unit)2359 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 2360 return stub.awaitTermination(duration, unit); 2361 } 2362 2363 public static class ListGatewaysPagedResponse 2364 extends AbstractPagedListResponse< 2365 ListGatewaysRequest, 2366 ListGatewaysResponse, 2367 Gateway, 2368 ListGatewaysPage, 2369 ListGatewaysFixedSizeCollection> { 2370 createAsync( PageContext<ListGatewaysRequest, ListGatewaysResponse, Gateway> context, ApiFuture<ListGatewaysResponse> futureResponse)2371 public static ApiFuture<ListGatewaysPagedResponse> createAsync( 2372 PageContext<ListGatewaysRequest, ListGatewaysResponse, Gateway> context, 2373 ApiFuture<ListGatewaysResponse> futureResponse) { 2374 ApiFuture<ListGatewaysPage> futurePage = 2375 ListGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); 2376 return ApiFutures.transform( 2377 futurePage, 2378 input -> new ListGatewaysPagedResponse(input), 2379 MoreExecutors.directExecutor()); 2380 } 2381 ListGatewaysPagedResponse(ListGatewaysPage page)2382 private ListGatewaysPagedResponse(ListGatewaysPage page) { 2383 super(page, ListGatewaysFixedSizeCollection.createEmptyCollection()); 2384 } 2385 } 2386 2387 public static class ListGatewaysPage 2388 extends AbstractPage<ListGatewaysRequest, ListGatewaysResponse, Gateway, ListGatewaysPage> { 2389 ListGatewaysPage( PageContext<ListGatewaysRequest, ListGatewaysResponse, Gateway> context, ListGatewaysResponse response)2390 private ListGatewaysPage( 2391 PageContext<ListGatewaysRequest, ListGatewaysResponse, Gateway> context, 2392 ListGatewaysResponse response) { 2393 super(context, response); 2394 } 2395 createEmptyPage()2396 private static ListGatewaysPage createEmptyPage() { 2397 return new ListGatewaysPage(null, null); 2398 } 2399 2400 @Override createPage( PageContext<ListGatewaysRequest, ListGatewaysResponse, Gateway> context, ListGatewaysResponse response)2401 protected ListGatewaysPage createPage( 2402 PageContext<ListGatewaysRequest, ListGatewaysResponse, Gateway> context, 2403 ListGatewaysResponse response) { 2404 return new ListGatewaysPage(context, response); 2405 } 2406 2407 @Override createPageAsync( PageContext<ListGatewaysRequest, ListGatewaysResponse, Gateway> context, ApiFuture<ListGatewaysResponse> futureResponse)2408 public ApiFuture<ListGatewaysPage> createPageAsync( 2409 PageContext<ListGatewaysRequest, ListGatewaysResponse, Gateway> context, 2410 ApiFuture<ListGatewaysResponse> futureResponse) { 2411 return super.createPageAsync(context, futureResponse); 2412 } 2413 } 2414 2415 public static class ListGatewaysFixedSizeCollection 2416 extends AbstractFixedSizeCollection< 2417 ListGatewaysRequest, 2418 ListGatewaysResponse, 2419 Gateway, 2420 ListGatewaysPage, 2421 ListGatewaysFixedSizeCollection> { 2422 ListGatewaysFixedSizeCollection(List<ListGatewaysPage> pages, int collectionSize)2423 private ListGatewaysFixedSizeCollection(List<ListGatewaysPage> pages, int collectionSize) { 2424 super(pages, collectionSize); 2425 } 2426 createEmptyCollection()2427 private static ListGatewaysFixedSizeCollection createEmptyCollection() { 2428 return new ListGatewaysFixedSizeCollection(null, 0); 2429 } 2430 2431 @Override createCollection( List<ListGatewaysPage> pages, int collectionSize)2432 protected ListGatewaysFixedSizeCollection createCollection( 2433 List<ListGatewaysPage> pages, int collectionSize) { 2434 return new ListGatewaysFixedSizeCollection(pages, collectionSize); 2435 } 2436 } 2437 2438 public static class ListApisPagedResponse 2439 extends AbstractPagedListResponse< 2440 ListApisRequest, ListApisResponse, Api, ListApisPage, ListApisFixedSizeCollection> { 2441 createAsync( PageContext<ListApisRequest, ListApisResponse, Api> context, ApiFuture<ListApisResponse> futureResponse)2442 public static ApiFuture<ListApisPagedResponse> createAsync( 2443 PageContext<ListApisRequest, ListApisResponse, Api> context, 2444 ApiFuture<ListApisResponse> futureResponse) { 2445 ApiFuture<ListApisPage> futurePage = 2446 ListApisPage.createEmptyPage().createPageAsync(context, futureResponse); 2447 return ApiFutures.transform( 2448 futurePage, input -> new ListApisPagedResponse(input), MoreExecutors.directExecutor()); 2449 } 2450 ListApisPagedResponse(ListApisPage page)2451 private ListApisPagedResponse(ListApisPage page) { 2452 super(page, ListApisFixedSizeCollection.createEmptyCollection()); 2453 } 2454 } 2455 2456 public static class ListApisPage 2457 extends AbstractPage<ListApisRequest, ListApisResponse, Api, ListApisPage> { 2458 ListApisPage( PageContext<ListApisRequest, ListApisResponse, Api> context, ListApisResponse response)2459 private ListApisPage( 2460 PageContext<ListApisRequest, ListApisResponse, Api> context, ListApisResponse response) { 2461 super(context, response); 2462 } 2463 createEmptyPage()2464 private static ListApisPage createEmptyPage() { 2465 return new ListApisPage(null, null); 2466 } 2467 2468 @Override createPage( PageContext<ListApisRequest, ListApisResponse, Api> context, ListApisResponse response)2469 protected ListApisPage createPage( 2470 PageContext<ListApisRequest, ListApisResponse, Api> context, ListApisResponse response) { 2471 return new ListApisPage(context, response); 2472 } 2473 2474 @Override createPageAsync( PageContext<ListApisRequest, ListApisResponse, Api> context, ApiFuture<ListApisResponse> futureResponse)2475 public ApiFuture<ListApisPage> createPageAsync( 2476 PageContext<ListApisRequest, ListApisResponse, Api> context, 2477 ApiFuture<ListApisResponse> futureResponse) { 2478 return super.createPageAsync(context, futureResponse); 2479 } 2480 } 2481 2482 public static class ListApisFixedSizeCollection 2483 extends AbstractFixedSizeCollection< 2484 ListApisRequest, ListApisResponse, Api, ListApisPage, ListApisFixedSizeCollection> { 2485 ListApisFixedSizeCollection(List<ListApisPage> pages, int collectionSize)2486 private ListApisFixedSizeCollection(List<ListApisPage> pages, int collectionSize) { 2487 super(pages, collectionSize); 2488 } 2489 createEmptyCollection()2490 private static ListApisFixedSizeCollection createEmptyCollection() { 2491 return new ListApisFixedSizeCollection(null, 0); 2492 } 2493 2494 @Override createCollection( List<ListApisPage> pages, int collectionSize)2495 protected ListApisFixedSizeCollection createCollection( 2496 List<ListApisPage> pages, int collectionSize) { 2497 return new ListApisFixedSizeCollection(pages, collectionSize); 2498 } 2499 } 2500 2501 public static class ListApiConfigsPagedResponse 2502 extends AbstractPagedListResponse< 2503 ListApiConfigsRequest, 2504 ListApiConfigsResponse, 2505 ApiConfig, 2506 ListApiConfigsPage, 2507 ListApiConfigsFixedSizeCollection> { 2508 createAsync( PageContext<ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig> context, ApiFuture<ListApiConfigsResponse> futureResponse)2509 public static ApiFuture<ListApiConfigsPagedResponse> createAsync( 2510 PageContext<ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig> context, 2511 ApiFuture<ListApiConfigsResponse> futureResponse) { 2512 ApiFuture<ListApiConfigsPage> futurePage = 2513 ListApiConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); 2514 return ApiFutures.transform( 2515 futurePage, 2516 input -> new ListApiConfigsPagedResponse(input), 2517 MoreExecutors.directExecutor()); 2518 } 2519 ListApiConfigsPagedResponse(ListApiConfigsPage page)2520 private ListApiConfigsPagedResponse(ListApiConfigsPage page) { 2521 super(page, ListApiConfigsFixedSizeCollection.createEmptyCollection()); 2522 } 2523 } 2524 2525 public static class ListApiConfigsPage 2526 extends AbstractPage< 2527 ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig, ListApiConfigsPage> { 2528 ListApiConfigsPage( PageContext<ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig> context, ListApiConfigsResponse response)2529 private ListApiConfigsPage( 2530 PageContext<ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig> context, 2531 ListApiConfigsResponse response) { 2532 super(context, response); 2533 } 2534 createEmptyPage()2535 private static ListApiConfigsPage createEmptyPage() { 2536 return new ListApiConfigsPage(null, null); 2537 } 2538 2539 @Override createPage( PageContext<ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig> context, ListApiConfigsResponse response)2540 protected ListApiConfigsPage createPage( 2541 PageContext<ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig> context, 2542 ListApiConfigsResponse response) { 2543 return new ListApiConfigsPage(context, response); 2544 } 2545 2546 @Override createPageAsync( PageContext<ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig> context, ApiFuture<ListApiConfigsResponse> futureResponse)2547 public ApiFuture<ListApiConfigsPage> createPageAsync( 2548 PageContext<ListApiConfigsRequest, ListApiConfigsResponse, ApiConfig> context, 2549 ApiFuture<ListApiConfigsResponse> futureResponse) { 2550 return super.createPageAsync(context, futureResponse); 2551 } 2552 } 2553 2554 public static class ListApiConfigsFixedSizeCollection 2555 extends AbstractFixedSizeCollection< 2556 ListApiConfigsRequest, 2557 ListApiConfigsResponse, 2558 ApiConfig, 2559 ListApiConfigsPage, 2560 ListApiConfigsFixedSizeCollection> { 2561 ListApiConfigsFixedSizeCollection(List<ListApiConfigsPage> pages, int collectionSize)2562 private ListApiConfigsFixedSizeCollection(List<ListApiConfigsPage> pages, int collectionSize) { 2563 super(pages, collectionSize); 2564 } 2565 createEmptyCollection()2566 private static ListApiConfigsFixedSizeCollection createEmptyCollection() { 2567 return new ListApiConfigsFixedSizeCollection(null, 0); 2568 } 2569 2570 @Override createCollection( List<ListApiConfigsPage> pages, int collectionSize)2571 protected ListApiConfigsFixedSizeCollection createCollection( 2572 List<ListApiConfigsPage> pages, int collectionSize) { 2573 return new ListApiConfigsFixedSizeCollection(pages, collectionSize); 2574 } 2575 } 2576 } 2577