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.appengine.v1; 18 19 import com.google.api.core.BetaApi; 20 import com.google.api.gax.core.BackgroundResource; 21 import com.google.api.gax.httpjson.longrunning.OperationsClient; 22 import com.google.api.gax.longrunning.OperationFuture; 23 import com.google.api.gax.rpc.OperationCallable; 24 import com.google.api.gax.rpc.UnaryCallable; 25 import com.google.appengine.v1.stub.ApplicationsStub; 26 import com.google.appengine.v1.stub.ApplicationsStubSettings; 27 import com.google.longrunning.Operation; 28 import java.io.IOException; 29 import java.util.concurrent.TimeUnit; 30 import javax.annotation.Generated; 31 32 // AUTO-GENERATED DOCUMENTATION AND CLASS. 33 /** 34 * Service Description: Manages App Engine applications. 35 * 36 * <p>This class provides the ability to make remote calls to the backing service through method 37 * calls that map to API methods. Sample code to get started: 38 * 39 * <pre>{@code 40 * // This snippet has been automatically generated and should be regarded as a code template only. 41 * // It will require modifications to work: 42 * // - It may require correct/in-range values for request initialization. 43 * // - It may require specifying regional endpoints when creating the service client as shown in 44 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 45 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 46 * String name = "name3373707"; 47 * Application response = applicationsClient.getApplication(name); 48 * } 49 * }</pre> 50 * 51 * <p>Note: close() needs to be called on the ApplicationsClient object to clean up resources such 52 * as threads. In the example above, try-with-resources is used, which automatically calls close(). 53 * 54 * <p>The surface of this class includes several types of Java methods for each of the API's 55 * methods: 56 * 57 * <ol> 58 * <li>A "flattened" method. With this type of method, the fields of the request type have been 59 * converted into function parameters. It may be the case that not all fields are available as 60 * parameters, and not every API method will have a flattened method entry point. 61 * <li>A "request object" method. This type of method only takes one parameter, a request object, 62 * which must be constructed before the call. Not every API method will have a request object 63 * method. 64 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 65 * callable object, which can be used to initiate calls to the service. 66 * </ol> 67 * 68 * <p>See the individual methods for example code. 69 * 70 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 71 * these names, this class includes a format method for each type of name, and additionally a parse 72 * method to extract the individual identifiers contained within names that are returned. 73 * 74 * <p>This class can be customized by passing in a custom instance of ApplicationsSettings to 75 * create(). For example: 76 * 77 * <p>To customize credentials: 78 * 79 * <pre>{@code 80 * // This snippet has been automatically generated and should be regarded as a code template only. 81 * // It will require modifications to work: 82 * // - It may require correct/in-range values for request initialization. 83 * // - It may require specifying regional endpoints when creating the service client as shown in 84 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 85 * ApplicationsSettings applicationsSettings = 86 * ApplicationsSettings.newBuilder() 87 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 88 * .build(); 89 * ApplicationsClient applicationsClient = ApplicationsClient.create(applicationsSettings); 90 * }</pre> 91 * 92 * <p>To customize the endpoint: 93 * 94 * <pre>{@code 95 * // This snippet has been automatically generated and should be regarded as a code template only. 96 * // It will require modifications to work: 97 * // - It may require correct/in-range values for request initialization. 98 * // - It may require specifying regional endpoints when creating the service client as shown in 99 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 100 * ApplicationsSettings applicationsSettings = 101 * ApplicationsSettings.newBuilder().setEndpoint(myEndpoint).build(); 102 * ApplicationsClient applicationsClient = ApplicationsClient.create(applicationsSettings); 103 * }</pre> 104 * 105 * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over 106 * the wire: 107 * 108 * <pre>{@code 109 * // This snippet has been automatically generated and should be regarded as a code template only. 110 * // It will require modifications to work: 111 * // - It may require correct/in-range values for request initialization. 112 * // - It may require specifying regional endpoints when creating the service client as shown in 113 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 114 * ApplicationsSettings applicationsSettings = ApplicationsSettings.newHttpJsonBuilder().build(); 115 * ApplicationsClient applicationsClient = ApplicationsClient.create(applicationsSettings); 116 * }</pre> 117 * 118 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 119 */ 120 @Generated("by gapic-generator-java") 121 public class ApplicationsClient implements BackgroundResource { 122 private final ApplicationsSettings settings; 123 private final ApplicationsStub stub; 124 private final OperationsClient httpJsonOperationsClient; 125 private final com.google.longrunning.OperationsClient operationsClient; 126 127 /** Constructs an instance of ApplicationsClient with default settings. */ create()128 public static final ApplicationsClient create() throws IOException { 129 return create(ApplicationsSettings.newBuilder().build()); 130 } 131 132 /** 133 * Constructs an instance of ApplicationsClient, using the given settings. The channels are 134 * created based on the settings passed in, or defaults for any settings that are not set. 135 */ create(ApplicationsSettings settings)136 public static final ApplicationsClient create(ApplicationsSettings settings) throws IOException { 137 return new ApplicationsClient(settings); 138 } 139 140 /** 141 * Constructs an instance of ApplicationsClient, using the given stub for making calls. This is 142 * for advanced usage - prefer using create(ApplicationsSettings). 143 */ create(ApplicationsStub stub)144 public static final ApplicationsClient create(ApplicationsStub stub) { 145 return new ApplicationsClient(stub); 146 } 147 148 /** 149 * Constructs an instance of ApplicationsClient, using the given settings. This is protected so 150 * that it is easy to make a subclass, but otherwise, the static factory methods should be 151 * preferred. 152 */ ApplicationsClient(ApplicationsSettings settings)153 protected ApplicationsClient(ApplicationsSettings settings) throws IOException { 154 this.settings = settings; 155 this.stub = ((ApplicationsStubSettings) settings.getStubSettings()).createStub(); 156 this.operationsClient = 157 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 158 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 159 } 160 ApplicationsClient(ApplicationsStub stub)161 protected ApplicationsClient(ApplicationsStub stub) { 162 this.settings = null; 163 this.stub = stub; 164 this.operationsClient = 165 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 166 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 167 } 168 getSettings()169 public final ApplicationsSettings getSettings() { 170 return settings; 171 } 172 getStub()173 public ApplicationsStub getStub() { 174 return stub; 175 } 176 177 /** 178 * Returns the OperationsClient that can be used to query the status of a long-running operation 179 * returned by another API method call. 180 */ getOperationsClient()181 public final com.google.longrunning.OperationsClient getOperationsClient() { 182 return operationsClient; 183 } 184 185 /** 186 * Returns the OperationsClient that can be used to query the status of a long-running operation 187 * returned by another API method call. 188 */ 189 @BetaApi getHttpJsonOperationsClient()190 public final OperationsClient getHttpJsonOperationsClient() { 191 return httpJsonOperationsClient; 192 } 193 194 // AUTO-GENERATED DOCUMENTATION AND METHOD. 195 /** 196 * Gets information about an application. 197 * 198 * <p>Sample code: 199 * 200 * <pre>{@code 201 * // This snippet has been automatically generated and should be regarded as a code template only. 202 * // It will require modifications to work: 203 * // - It may require correct/in-range values for request initialization. 204 * // - It may require specifying regional endpoints when creating the service client as shown in 205 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 206 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 207 * String name = "name3373707"; 208 * Application response = applicationsClient.getApplication(name); 209 * } 210 * }</pre> 211 * 212 * @param name Name of the Application resource to get. Example: `apps/myapp`. 213 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 214 */ getApplication(String name)215 public final Application getApplication(String name) { 216 GetApplicationRequest request = GetApplicationRequest.newBuilder().setName(name).build(); 217 return getApplication(request); 218 } 219 220 // AUTO-GENERATED DOCUMENTATION AND METHOD. 221 /** 222 * Gets information about an application. 223 * 224 * <p>Sample code: 225 * 226 * <pre>{@code 227 * // This snippet has been automatically generated and should be regarded as a code template only. 228 * // It will require modifications to work: 229 * // - It may require correct/in-range values for request initialization. 230 * // - It may require specifying regional endpoints when creating the service client as shown in 231 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 232 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 233 * GetApplicationRequest request = 234 * GetApplicationRequest.newBuilder().setName("name3373707").build(); 235 * Application response = applicationsClient.getApplication(request); 236 * } 237 * }</pre> 238 * 239 * @param request The request object containing all of the parameters for the API call. 240 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 241 */ getApplication(GetApplicationRequest request)242 public final Application getApplication(GetApplicationRequest request) { 243 return getApplicationCallable().call(request); 244 } 245 246 // AUTO-GENERATED DOCUMENTATION AND METHOD. 247 /** 248 * Gets information about an application. 249 * 250 * <p>Sample code: 251 * 252 * <pre>{@code 253 * // This snippet has been automatically generated and should be regarded as a code template only. 254 * // It will require modifications to work: 255 * // - It may require correct/in-range values for request initialization. 256 * // - It may require specifying regional endpoints when creating the service client as shown in 257 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 258 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 259 * GetApplicationRequest request = 260 * GetApplicationRequest.newBuilder().setName("name3373707").build(); 261 * ApiFuture<Application> future = 262 * applicationsClient.getApplicationCallable().futureCall(request); 263 * // Do something. 264 * Application response = future.get(); 265 * } 266 * }</pre> 267 */ getApplicationCallable()268 public final UnaryCallable<GetApplicationRequest, Application> getApplicationCallable() { 269 return stub.getApplicationCallable(); 270 } 271 272 // AUTO-GENERATED DOCUMENTATION AND METHOD. 273 /** 274 * Creates an App Engine application for a Google Cloud Platform project. Required fields: 275 * 276 * <ul> 277 * <li>`id` - The ID of the target Cloud Platform project. 278 * <li>*location* - The [region](https://cloud.google.com/appengine/docs/locations) 279 * where you want the App Engine application located. 280 * </ul> 281 * 282 * <p>For more information about App Engine applications, see [Managing Projects, Applications, 283 * and Billing](https://cloud.google.com/appengine/docs/standard/python/console/). 284 * 285 * <p>Sample code: 286 * 287 * <pre>{@code 288 * // This snippet has been automatically generated and should be regarded as a code template only. 289 * // It will require modifications to work: 290 * // - It may require correct/in-range values for request initialization. 291 * // - It may require specifying regional endpoints when creating the service client as shown in 292 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 293 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 294 * CreateApplicationRequest request = 295 * CreateApplicationRequest.newBuilder() 296 * .setApplication(Application.newBuilder().build()) 297 * .build(); 298 * Application response = applicationsClient.createApplicationAsync(request).get(); 299 * } 300 * }</pre> 301 * 302 * @param request The request object containing all of the parameters for the API call. 303 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 304 */ createApplicationAsync( CreateApplicationRequest request)305 public final OperationFuture<Application, OperationMetadataV1> createApplicationAsync( 306 CreateApplicationRequest request) { 307 return createApplicationOperationCallable().futureCall(request); 308 } 309 310 // AUTO-GENERATED DOCUMENTATION AND METHOD. 311 /** 312 * Creates an App Engine application for a Google Cloud Platform project. Required fields: 313 * 314 * <ul> 315 * <li>`id` - The ID of the target Cloud Platform project. 316 * <li>*location* - The [region](https://cloud.google.com/appengine/docs/locations) 317 * where you want the App Engine application located. 318 * </ul> 319 * 320 * <p>For more information about App Engine applications, see [Managing Projects, Applications, 321 * and Billing](https://cloud.google.com/appengine/docs/standard/python/console/). 322 * 323 * <p>Sample code: 324 * 325 * <pre>{@code 326 * // This snippet has been automatically generated and should be regarded as a code template only. 327 * // It will require modifications to work: 328 * // - It may require correct/in-range values for request initialization. 329 * // - It may require specifying regional endpoints when creating the service client as shown in 330 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 331 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 332 * CreateApplicationRequest request = 333 * CreateApplicationRequest.newBuilder() 334 * .setApplication(Application.newBuilder().build()) 335 * .build(); 336 * OperationFuture<Application, OperationMetadataV1> future = 337 * applicationsClient.createApplicationOperationCallable().futureCall(request); 338 * // Do something. 339 * Application response = future.get(); 340 * } 341 * }</pre> 342 */ 343 public final OperationCallable<CreateApplicationRequest, Application, OperationMetadataV1> createApplicationOperationCallable()344 createApplicationOperationCallable() { 345 return stub.createApplicationOperationCallable(); 346 } 347 348 // AUTO-GENERATED DOCUMENTATION AND METHOD. 349 /** 350 * Creates an App Engine application for a Google Cloud Platform project. Required fields: 351 * 352 * <ul> 353 * <li>`id` - The ID of the target Cloud Platform project. 354 * <li>*location* - The [region](https://cloud.google.com/appengine/docs/locations) 355 * where you want the App Engine application located. 356 * </ul> 357 * 358 * <p>For more information about App Engine applications, see [Managing Projects, Applications, 359 * and Billing](https://cloud.google.com/appengine/docs/standard/python/console/). 360 * 361 * <p>Sample code: 362 * 363 * <pre>{@code 364 * // This snippet has been automatically generated and should be regarded as a code template only. 365 * // It will require modifications to work: 366 * // - It may require correct/in-range values for request initialization. 367 * // - It may require specifying regional endpoints when creating the service client as shown in 368 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 369 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 370 * CreateApplicationRequest request = 371 * CreateApplicationRequest.newBuilder() 372 * .setApplication(Application.newBuilder().build()) 373 * .build(); 374 * ApiFuture<Operation> future = 375 * applicationsClient.createApplicationCallable().futureCall(request); 376 * // Do something. 377 * Operation response = future.get(); 378 * } 379 * }</pre> 380 */ createApplicationCallable()381 public final UnaryCallable<CreateApplicationRequest, Operation> createApplicationCallable() { 382 return stub.createApplicationCallable(); 383 } 384 385 // AUTO-GENERATED DOCUMENTATION AND METHOD. 386 /** 387 * Updates the specified Application resource. You can update the following fields: 388 * 389 * <ul> 390 * <li>`auth_domain` - Google authentication domain for controlling user access to the 391 * application. 392 * <li>`default_cookie_expiration` - Cookie expiration policy for the application. 393 * <li>`iap` - Identity-Aware Proxy properties for the application. 394 * </ul> 395 * 396 * <p>Sample code: 397 * 398 * <pre>{@code 399 * // This snippet has been automatically generated and should be regarded as a code template only. 400 * // It will require modifications to work: 401 * // - It may require correct/in-range values for request initialization. 402 * // - It may require specifying regional endpoints when creating the service client as shown in 403 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 404 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 405 * UpdateApplicationRequest request = 406 * UpdateApplicationRequest.newBuilder() 407 * .setName("name3373707") 408 * .setApplication(Application.newBuilder().build()) 409 * .setUpdateMask(FieldMask.newBuilder().build()) 410 * .build(); 411 * Application response = applicationsClient.updateApplicationAsync(request).get(); 412 * } 413 * }</pre> 414 * 415 * @param request The request object containing all of the parameters for the API call. 416 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 417 */ updateApplicationAsync( UpdateApplicationRequest request)418 public final OperationFuture<Application, OperationMetadataV1> updateApplicationAsync( 419 UpdateApplicationRequest request) { 420 return updateApplicationOperationCallable().futureCall(request); 421 } 422 423 // AUTO-GENERATED DOCUMENTATION AND METHOD. 424 /** 425 * Updates the specified Application resource. You can update the following fields: 426 * 427 * <ul> 428 * <li>`auth_domain` - Google authentication domain for controlling user access to the 429 * application. 430 * <li>`default_cookie_expiration` - Cookie expiration policy for the application. 431 * <li>`iap` - Identity-Aware Proxy properties for the application. 432 * </ul> 433 * 434 * <p>Sample code: 435 * 436 * <pre>{@code 437 * // This snippet has been automatically generated and should be regarded as a code template only. 438 * // It will require modifications to work: 439 * // - It may require correct/in-range values for request initialization. 440 * // - It may require specifying regional endpoints when creating the service client as shown in 441 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 442 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 443 * UpdateApplicationRequest request = 444 * UpdateApplicationRequest.newBuilder() 445 * .setName("name3373707") 446 * .setApplication(Application.newBuilder().build()) 447 * .setUpdateMask(FieldMask.newBuilder().build()) 448 * .build(); 449 * OperationFuture<Application, OperationMetadataV1> future = 450 * applicationsClient.updateApplicationOperationCallable().futureCall(request); 451 * // Do something. 452 * Application response = future.get(); 453 * } 454 * }</pre> 455 */ 456 public final OperationCallable<UpdateApplicationRequest, Application, OperationMetadataV1> updateApplicationOperationCallable()457 updateApplicationOperationCallable() { 458 return stub.updateApplicationOperationCallable(); 459 } 460 461 // AUTO-GENERATED DOCUMENTATION AND METHOD. 462 /** 463 * Updates the specified Application resource. You can update the following fields: 464 * 465 * <ul> 466 * <li>`auth_domain` - Google authentication domain for controlling user access to the 467 * application. 468 * <li>`default_cookie_expiration` - Cookie expiration policy for the application. 469 * <li>`iap` - Identity-Aware Proxy properties for the application. 470 * </ul> 471 * 472 * <p>Sample code: 473 * 474 * <pre>{@code 475 * // This snippet has been automatically generated and should be regarded as a code template only. 476 * // It will require modifications to work: 477 * // - It may require correct/in-range values for request initialization. 478 * // - It may require specifying regional endpoints when creating the service client as shown in 479 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 480 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 481 * UpdateApplicationRequest request = 482 * UpdateApplicationRequest.newBuilder() 483 * .setName("name3373707") 484 * .setApplication(Application.newBuilder().build()) 485 * .setUpdateMask(FieldMask.newBuilder().build()) 486 * .build(); 487 * ApiFuture<Operation> future = 488 * applicationsClient.updateApplicationCallable().futureCall(request); 489 * // Do something. 490 * Operation response = future.get(); 491 * } 492 * }</pre> 493 */ updateApplicationCallable()494 public final UnaryCallable<UpdateApplicationRequest, Operation> updateApplicationCallable() { 495 return stub.updateApplicationCallable(); 496 } 497 498 // AUTO-GENERATED DOCUMENTATION AND METHOD. 499 /** 500 * Recreates the required App Engine features for the specified App Engine application, for 501 * example a Cloud Storage bucket or App Engine service account. Use this method if you receive an 502 * error message about a missing feature, for example, *Error retrieving the App Engine 503 * service account*. If you have deleted your App Engine service account, this will not be 504 * able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at 505 * https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D 506 * . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log. 507 * 508 * <p>Sample code: 509 * 510 * <pre>{@code 511 * // This snippet has been automatically generated and should be regarded as a code template only. 512 * // It will require modifications to work: 513 * // - It may require correct/in-range values for request initialization. 514 * // - It may require specifying regional endpoints when creating the service client as shown in 515 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 516 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 517 * RepairApplicationRequest request = 518 * RepairApplicationRequest.newBuilder().setName("name3373707").build(); 519 * Application response = applicationsClient.repairApplicationAsync(request).get(); 520 * } 521 * }</pre> 522 * 523 * @param request The request object containing all of the parameters for the API call. 524 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 525 */ repairApplicationAsync( RepairApplicationRequest request)526 public final OperationFuture<Application, OperationMetadataV1> repairApplicationAsync( 527 RepairApplicationRequest request) { 528 return repairApplicationOperationCallable().futureCall(request); 529 } 530 531 // AUTO-GENERATED DOCUMENTATION AND METHOD. 532 /** 533 * Recreates the required App Engine features for the specified App Engine application, for 534 * example a Cloud Storage bucket or App Engine service account. Use this method if you receive an 535 * error message about a missing feature, for example, *Error retrieving the App Engine 536 * service account*. If you have deleted your App Engine service account, this will not be 537 * able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at 538 * https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D 539 * . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log. 540 * 541 * <p>Sample code: 542 * 543 * <pre>{@code 544 * // This snippet has been automatically generated and should be regarded as a code template only. 545 * // It will require modifications to work: 546 * // - It may require correct/in-range values for request initialization. 547 * // - It may require specifying regional endpoints when creating the service client as shown in 548 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 549 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 550 * RepairApplicationRequest request = 551 * RepairApplicationRequest.newBuilder().setName("name3373707").build(); 552 * OperationFuture<Application, OperationMetadataV1> future = 553 * applicationsClient.repairApplicationOperationCallable().futureCall(request); 554 * // Do something. 555 * Application response = future.get(); 556 * } 557 * }</pre> 558 */ 559 public final OperationCallable<RepairApplicationRequest, Application, OperationMetadataV1> repairApplicationOperationCallable()560 repairApplicationOperationCallable() { 561 return stub.repairApplicationOperationCallable(); 562 } 563 564 // AUTO-GENERATED DOCUMENTATION AND METHOD. 565 /** 566 * Recreates the required App Engine features for the specified App Engine application, for 567 * example a Cloud Storage bucket or App Engine service account. Use this method if you receive an 568 * error message about a missing feature, for example, *Error retrieving the App Engine 569 * service account*. If you have deleted your App Engine service account, this will not be 570 * able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at 571 * https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D 572 * . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log. 573 * 574 * <p>Sample code: 575 * 576 * <pre>{@code 577 * // This snippet has been automatically generated and should be regarded as a code template only. 578 * // It will require modifications to work: 579 * // - It may require correct/in-range values for request initialization. 580 * // - It may require specifying regional endpoints when creating the service client as shown in 581 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 582 * try (ApplicationsClient applicationsClient = ApplicationsClient.create()) { 583 * RepairApplicationRequest request = 584 * RepairApplicationRequest.newBuilder().setName("name3373707").build(); 585 * ApiFuture<Operation> future = 586 * applicationsClient.repairApplicationCallable().futureCall(request); 587 * // Do something. 588 * Operation response = future.get(); 589 * } 590 * }</pre> 591 */ repairApplicationCallable()592 public final UnaryCallable<RepairApplicationRequest, Operation> repairApplicationCallable() { 593 return stub.repairApplicationCallable(); 594 } 595 596 @Override close()597 public final void close() { 598 stub.close(); 599 } 600 601 @Override shutdown()602 public void shutdown() { 603 stub.shutdown(); 604 } 605 606 @Override isShutdown()607 public boolean isShutdown() { 608 return stub.isShutdown(); 609 } 610 611 @Override isTerminated()612 public boolean isTerminated() { 613 return stub.isTerminated(); 614 } 615 616 @Override shutdownNow()617 public void shutdownNow() { 618 stub.shutdownNow(); 619 } 620 621 @Override awaitTermination(long duration, TimeUnit unit)622 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 623 return stub.awaitTermination(duration, unit); 624 } 625 } 626