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.vmmigration.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.location.GetLocationRequest; 32 import com.google.cloud.location.ListLocationsRequest; 33 import com.google.cloud.location.ListLocationsResponse; 34 import com.google.cloud.location.Location; 35 import com.google.cloud.vmmigration.v1.stub.VmMigrationStub; 36 import com.google.cloud.vmmigration.v1.stub.VmMigrationStubSettings; 37 import com.google.common.util.concurrent.MoreExecutors; 38 import com.google.longrunning.Operation; 39 import com.google.protobuf.Empty; 40 import com.google.protobuf.FieldMask; 41 import java.io.IOException; 42 import java.util.List; 43 import java.util.concurrent.TimeUnit; 44 import javax.annotation.Generated; 45 46 // AUTO-GENERATED DOCUMENTATION AND CLASS. 47 /** 48 * Service Description: VM Migration Service 49 * 50 * <p>This class provides the ability to make remote calls to the backing service through method 51 * calls that map to API methods. Sample code to get started: 52 * 53 * <pre>{@code 54 * // This snippet has been automatically generated and should be regarded as a code template only. 55 * // It will require modifications to work: 56 * // - It may require correct/in-range values for request initialization. 57 * // - It may require specifying regional endpoints when creating the service client as shown in 58 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 59 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 60 * SourceName name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 61 * Source response = vmMigrationClient.getSource(name); 62 * } 63 * }</pre> 64 * 65 * <p>Note: close() needs to be called on the VmMigrationClient object to clean up resources such as 66 * threads. In the example above, try-with-resources is used, which automatically calls close(). 67 * 68 * <p>The surface of this class includes several types of Java methods for each of the API's 69 * methods: 70 * 71 * <ol> 72 * <li>A "flattened" method. With this type of method, the fields of the request type have been 73 * converted into function parameters. It may be the case that not all fields are available as 74 * parameters, and not every API method will have a flattened method entry point. 75 * <li>A "request object" method. This type of method only takes one parameter, a request object, 76 * which must be constructed before the call. Not every API method will have a request object 77 * method. 78 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 79 * callable object, which can be used to initiate calls to the service. 80 * </ol> 81 * 82 * <p>See the individual methods for example code. 83 * 84 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 85 * these names, this class includes a format method for each type of name, and additionally a parse 86 * method to extract the individual identifiers contained within names that are returned. 87 * 88 * <p>This class can be customized by passing in a custom instance of VmMigrationSettings to 89 * create(). For example: 90 * 91 * <p>To customize credentials: 92 * 93 * <pre>{@code 94 * // This snippet has been automatically generated and should be regarded as a code template only. 95 * // It will require modifications to work: 96 * // - It may require correct/in-range values for request initialization. 97 * // - It may require specifying regional endpoints when creating the service client as shown in 98 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 99 * VmMigrationSettings vmMigrationSettings = 100 * VmMigrationSettings.newBuilder() 101 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 102 * .build(); 103 * VmMigrationClient vmMigrationClient = VmMigrationClient.create(vmMigrationSettings); 104 * }</pre> 105 * 106 * <p>To customize the endpoint: 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 * VmMigrationSettings vmMigrationSettings = 115 * VmMigrationSettings.newBuilder().setEndpoint(myEndpoint).build(); 116 * VmMigrationClient vmMigrationClient = VmMigrationClient.create(vmMigrationSettings); 117 * }</pre> 118 * 119 * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over 120 * the wire: 121 * 122 * <pre>{@code 123 * // This snippet has been automatically generated and should be regarded as a code template only. 124 * // It will require modifications to work: 125 * // - It may require correct/in-range values for request initialization. 126 * // - It may require specifying regional endpoints when creating the service client as shown in 127 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 128 * VmMigrationSettings vmMigrationSettings = VmMigrationSettings.newHttpJsonBuilder().build(); 129 * VmMigrationClient vmMigrationClient = VmMigrationClient.create(vmMigrationSettings); 130 * }</pre> 131 * 132 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 133 */ 134 @Generated("by gapic-generator-java") 135 public class VmMigrationClient implements BackgroundResource { 136 private final VmMigrationSettings settings; 137 private final VmMigrationStub stub; 138 private final OperationsClient httpJsonOperationsClient; 139 private final com.google.longrunning.OperationsClient operationsClient; 140 141 /** Constructs an instance of VmMigrationClient with default settings. */ create()142 public static final VmMigrationClient create() throws IOException { 143 return create(VmMigrationSettings.newBuilder().build()); 144 } 145 146 /** 147 * Constructs an instance of VmMigrationClient, using the given settings. The channels are created 148 * based on the settings passed in, or defaults for any settings that are not set. 149 */ create(VmMigrationSettings settings)150 public static final VmMigrationClient create(VmMigrationSettings settings) throws IOException { 151 return new VmMigrationClient(settings); 152 } 153 154 /** 155 * Constructs an instance of VmMigrationClient, using the given stub for making calls. This is for 156 * advanced usage - prefer using create(VmMigrationSettings). 157 */ create(VmMigrationStub stub)158 public static final VmMigrationClient create(VmMigrationStub stub) { 159 return new VmMigrationClient(stub); 160 } 161 162 /** 163 * Constructs an instance of VmMigrationClient, using the given settings. This is protected so 164 * that it is easy to make a subclass, but otherwise, the static factory methods should be 165 * preferred. 166 */ VmMigrationClient(VmMigrationSettings settings)167 protected VmMigrationClient(VmMigrationSettings settings) throws IOException { 168 this.settings = settings; 169 this.stub = ((VmMigrationStubSettings) settings.getStubSettings()).createStub(); 170 this.operationsClient = 171 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 172 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 173 } 174 VmMigrationClient(VmMigrationStub stub)175 protected VmMigrationClient(VmMigrationStub stub) { 176 this.settings = null; 177 this.stub = stub; 178 this.operationsClient = 179 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 180 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 181 } 182 getSettings()183 public final VmMigrationSettings getSettings() { 184 return settings; 185 } 186 getStub()187 public VmMigrationStub getStub() { 188 return stub; 189 } 190 191 /** 192 * Returns the OperationsClient that can be used to query the status of a long-running operation 193 * returned by another API method call. 194 */ getOperationsClient()195 public final com.google.longrunning.OperationsClient getOperationsClient() { 196 return operationsClient; 197 } 198 199 /** 200 * Returns the OperationsClient that can be used to query the status of a long-running operation 201 * returned by another API method call. 202 */ 203 @BetaApi getHttpJsonOperationsClient()204 public final OperationsClient getHttpJsonOperationsClient() { 205 return httpJsonOperationsClient; 206 } 207 208 // AUTO-GENERATED DOCUMENTATION AND METHOD. 209 /** 210 * Lists Sources in a given project and location. 211 * 212 * <p>Sample code: 213 * 214 * <pre>{@code 215 * // This snippet has been automatically generated and should be regarded as a code template only. 216 * // It will require modifications to work: 217 * // - It may require correct/in-range values for request initialization. 218 * // - It may require specifying regional endpoints when creating the service client as shown in 219 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 220 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 221 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 222 * for (Source element : vmMigrationClient.listSources(parent).iterateAll()) { 223 * // doThingsWith(element); 224 * } 225 * } 226 * }</pre> 227 * 228 * @param parent Required. The parent, which owns this collection of sources. 229 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 230 */ listSources(LocationName parent)231 public final ListSourcesPagedResponse listSources(LocationName parent) { 232 ListSourcesRequest request = 233 ListSourcesRequest.newBuilder() 234 .setParent(parent == null ? null : parent.toString()) 235 .build(); 236 return listSources(request); 237 } 238 239 // AUTO-GENERATED DOCUMENTATION AND METHOD. 240 /** 241 * Lists Sources in a given project and location. 242 * 243 * <p>Sample code: 244 * 245 * <pre>{@code 246 * // This snippet has been automatically generated and should be regarded as a code template only. 247 * // It will require modifications to work: 248 * // - It may require correct/in-range values for request initialization. 249 * // - It may require specifying regional endpoints when creating the service client as shown in 250 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 251 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 252 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 253 * for (Source element : vmMigrationClient.listSources(parent).iterateAll()) { 254 * // doThingsWith(element); 255 * } 256 * } 257 * }</pre> 258 * 259 * @param parent Required. The parent, which owns this collection of sources. 260 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 261 */ listSources(String parent)262 public final ListSourcesPagedResponse listSources(String parent) { 263 ListSourcesRequest request = ListSourcesRequest.newBuilder().setParent(parent).build(); 264 return listSources(request); 265 } 266 267 // AUTO-GENERATED DOCUMENTATION AND METHOD. 268 /** 269 * Lists Sources in a given project and location. 270 * 271 * <p>Sample code: 272 * 273 * <pre>{@code 274 * // This snippet has been automatically generated and should be regarded as a code template only. 275 * // It will require modifications to work: 276 * // - It may require correct/in-range values for request initialization. 277 * // - It may require specifying regional endpoints when creating the service client as shown in 278 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 279 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 280 * ListSourcesRequest request = 281 * ListSourcesRequest.newBuilder() 282 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 283 * .setPageSize(883849137) 284 * .setPageToken("pageToken873572522") 285 * .setFilter("filter-1274492040") 286 * .setOrderBy("orderBy-1207110587") 287 * .build(); 288 * for (Source element : vmMigrationClient.listSources(request).iterateAll()) { 289 * // doThingsWith(element); 290 * } 291 * } 292 * }</pre> 293 * 294 * @param request The request object containing all of the parameters for the API call. 295 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 296 */ listSources(ListSourcesRequest request)297 public final ListSourcesPagedResponse listSources(ListSourcesRequest request) { 298 return listSourcesPagedCallable().call(request); 299 } 300 301 // AUTO-GENERATED DOCUMENTATION AND METHOD. 302 /** 303 * Lists Sources in a given project and location. 304 * 305 * <p>Sample code: 306 * 307 * <pre>{@code 308 * // This snippet has been automatically generated and should be regarded as a code template only. 309 * // It will require modifications to work: 310 * // - It may require correct/in-range values for request initialization. 311 * // - It may require specifying regional endpoints when creating the service client as shown in 312 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 313 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 314 * ListSourcesRequest request = 315 * ListSourcesRequest.newBuilder() 316 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 317 * .setPageSize(883849137) 318 * .setPageToken("pageToken873572522") 319 * .setFilter("filter-1274492040") 320 * .setOrderBy("orderBy-1207110587") 321 * .build(); 322 * ApiFuture<Source> future = vmMigrationClient.listSourcesPagedCallable().futureCall(request); 323 * // Do something. 324 * for (Source element : future.get().iterateAll()) { 325 * // doThingsWith(element); 326 * } 327 * } 328 * }</pre> 329 */ 330 public final UnaryCallable<ListSourcesRequest, ListSourcesPagedResponse> listSourcesPagedCallable()331 listSourcesPagedCallable() { 332 return stub.listSourcesPagedCallable(); 333 } 334 335 // AUTO-GENERATED DOCUMENTATION AND METHOD. 336 /** 337 * Lists Sources in a given project and location. 338 * 339 * <p>Sample code: 340 * 341 * <pre>{@code 342 * // This snippet has been automatically generated and should be regarded as a code template only. 343 * // It will require modifications to work: 344 * // - It may require correct/in-range values for request initialization. 345 * // - It may require specifying regional endpoints when creating the service client as shown in 346 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 347 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 348 * ListSourcesRequest request = 349 * ListSourcesRequest.newBuilder() 350 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 351 * .setPageSize(883849137) 352 * .setPageToken("pageToken873572522") 353 * .setFilter("filter-1274492040") 354 * .setOrderBy("orderBy-1207110587") 355 * .build(); 356 * while (true) { 357 * ListSourcesResponse response = vmMigrationClient.listSourcesCallable().call(request); 358 * for (Source element : response.getSourcesList()) { 359 * // doThingsWith(element); 360 * } 361 * String nextPageToken = response.getNextPageToken(); 362 * if (!Strings.isNullOrEmpty(nextPageToken)) { 363 * request = request.toBuilder().setPageToken(nextPageToken).build(); 364 * } else { 365 * break; 366 * } 367 * } 368 * } 369 * }</pre> 370 */ listSourcesCallable()371 public final UnaryCallable<ListSourcesRequest, ListSourcesResponse> listSourcesCallable() { 372 return stub.listSourcesCallable(); 373 } 374 375 // AUTO-GENERATED DOCUMENTATION AND METHOD. 376 /** 377 * Gets details of a single Source. 378 * 379 * <p>Sample code: 380 * 381 * <pre>{@code 382 * // This snippet has been automatically generated and should be regarded as a code template only. 383 * // It will require modifications to work: 384 * // - It may require correct/in-range values for request initialization. 385 * // - It may require specifying regional endpoints when creating the service client as shown in 386 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 387 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 388 * SourceName name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 389 * Source response = vmMigrationClient.getSource(name); 390 * } 391 * }</pre> 392 * 393 * @param name Required. The Source name. 394 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 395 */ getSource(SourceName name)396 public final Source getSource(SourceName name) { 397 GetSourceRequest request = 398 GetSourceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 399 return getSource(request); 400 } 401 402 // AUTO-GENERATED DOCUMENTATION AND METHOD. 403 /** 404 * Gets details of a single Source. 405 * 406 * <p>Sample code: 407 * 408 * <pre>{@code 409 * // This snippet has been automatically generated and should be regarded as a code template only. 410 * // It will require modifications to work: 411 * // - It may require correct/in-range values for request initialization. 412 * // - It may require specifying regional endpoints when creating the service client as shown in 413 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 414 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 415 * String name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 416 * Source response = vmMigrationClient.getSource(name); 417 * } 418 * }</pre> 419 * 420 * @param name Required. The Source name. 421 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 422 */ getSource(String name)423 public final Source getSource(String name) { 424 GetSourceRequest request = GetSourceRequest.newBuilder().setName(name).build(); 425 return getSource(request); 426 } 427 428 // AUTO-GENERATED DOCUMENTATION AND METHOD. 429 /** 430 * Gets details of a single Source. 431 * 432 * <p>Sample code: 433 * 434 * <pre>{@code 435 * // This snippet has been automatically generated and should be regarded as a code template only. 436 * // It will require modifications to work: 437 * // - It may require correct/in-range values for request initialization. 438 * // - It may require specifying regional endpoints when creating the service client as shown in 439 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 440 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 441 * GetSourceRequest request = 442 * GetSourceRequest.newBuilder() 443 * .setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 444 * .build(); 445 * Source response = vmMigrationClient.getSource(request); 446 * } 447 * }</pre> 448 * 449 * @param request The request object containing all of the parameters for the API call. 450 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 451 */ getSource(GetSourceRequest request)452 public final Source getSource(GetSourceRequest request) { 453 return getSourceCallable().call(request); 454 } 455 456 // AUTO-GENERATED DOCUMENTATION AND METHOD. 457 /** 458 * Gets details of a single Source. 459 * 460 * <p>Sample code: 461 * 462 * <pre>{@code 463 * // This snippet has been automatically generated and should be regarded as a code template only. 464 * // It will require modifications to work: 465 * // - It may require correct/in-range values for request initialization. 466 * // - It may require specifying regional endpoints when creating the service client as shown in 467 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 468 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 469 * GetSourceRequest request = 470 * GetSourceRequest.newBuilder() 471 * .setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 472 * .build(); 473 * ApiFuture<Source> future = vmMigrationClient.getSourceCallable().futureCall(request); 474 * // Do something. 475 * Source response = future.get(); 476 * } 477 * }</pre> 478 */ getSourceCallable()479 public final UnaryCallable<GetSourceRequest, Source> getSourceCallable() { 480 return stub.getSourceCallable(); 481 } 482 483 // AUTO-GENERATED DOCUMENTATION AND METHOD. 484 /** 485 * Creates a new Source in a given project and location. 486 * 487 * <p>Sample code: 488 * 489 * <pre>{@code 490 * // This snippet has been automatically generated and should be regarded as a code template only. 491 * // It will require modifications to work: 492 * // - It may require correct/in-range values for request initialization. 493 * // - It may require specifying regional endpoints when creating the service client as shown in 494 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 495 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 496 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 497 * Source source = Source.newBuilder().build(); 498 * String sourceId = "sourceId1746327190"; 499 * Source response = vmMigrationClient.createSourceAsync(parent, source, sourceId).get(); 500 * } 501 * }</pre> 502 * 503 * @param parent Required. The Source's parent. 504 * @param source Required. The create request body. 505 * @param sourceId Required. The source identifier. 506 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 507 */ createSourceAsync( LocationName parent, Source source, String sourceId)508 public final OperationFuture<Source, OperationMetadata> createSourceAsync( 509 LocationName parent, Source source, String sourceId) { 510 CreateSourceRequest request = 511 CreateSourceRequest.newBuilder() 512 .setParent(parent == null ? null : parent.toString()) 513 .setSource(source) 514 .setSourceId(sourceId) 515 .build(); 516 return createSourceAsync(request); 517 } 518 519 // AUTO-GENERATED DOCUMENTATION AND METHOD. 520 /** 521 * Creates a new Source in a given project and location. 522 * 523 * <p>Sample code: 524 * 525 * <pre>{@code 526 * // This snippet has been automatically generated and should be regarded as a code template only. 527 * // It will require modifications to work: 528 * // - It may require correct/in-range values for request initialization. 529 * // - It may require specifying regional endpoints when creating the service client as shown in 530 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 531 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 532 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 533 * Source source = Source.newBuilder().build(); 534 * String sourceId = "sourceId1746327190"; 535 * Source response = vmMigrationClient.createSourceAsync(parent, source, sourceId).get(); 536 * } 537 * }</pre> 538 * 539 * @param parent Required. The Source's parent. 540 * @param source Required. The create request body. 541 * @param sourceId Required. The source identifier. 542 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 543 */ createSourceAsync( String parent, Source source, String sourceId)544 public final OperationFuture<Source, OperationMetadata> createSourceAsync( 545 String parent, Source source, String sourceId) { 546 CreateSourceRequest request = 547 CreateSourceRequest.newBuilder() 548 .setParent(parent) 549 .setSource(source) 550 .setSourceId(sourceId) 551 .build(); 552 return createSourceAsync(request); 553 } 554 555 // AUTO-GENERATED DOCUMENTATION AND METHOD. 556 /** 557 * Creates a new Source in a given project and location. 558 * 559 * <p>Sample code: 560 * 561 * <pre>{@code 562 * // This snippet has been automatically generated and should be regarded as a code template only. 563 * // It will require modifications to work: 564 * // - It may require correct/in-range values for request initialization. 565 * // - It may require specifying regional endpoints when creating the service client as shown in 566 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 567 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 568 * CreateSourceRequest request = 569 * CreateSourceRequest.newBuilder() 570 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 571 * .setSourceId("sourceId1746327190") 572 * .setSource(Source.newBuilder().build()) 573 * .setRequestId("requestId693933066") 574 * .build(); 575 * Source response = vmMigrationClient.createSourceAsync(request).get(); 576 * } 577 * }</pre> 578 * 579 * @param request The request object containing all of the parameters for the API call. 580 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 581 */ createSourceAsync( CreateSourceRequest request)582 public final OperationFuture<Source, OperationMetadata> createSourceAsync( 583 CreateSourceRequest request) { 584 return createSourceOperationCallable().futureCall(request); 585 } 586 587 // AUTO-GENERATED DOCUMENTATION AND METHOD. 588 /** 589 * Creates a new Source in a given project and location. 590 * 591 * <p>Sample code: 592 * 593 * <pre>{@code 594 * // This snippet has been automatically generated and should be regarded as a code template only. 595 * // It will require modifications to work: 596 * // - It may require correct/in-range values for request initialization. 597 * // - It may require specifying regional endpoints when creating the service client as shown in 598 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 599 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 600 * CreateSourceRequest request = 601 * CreateSourceRequest.newBuilder() 602 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 603 * .setSourceId("sourceId1746327190") 604 * .setSource(Source.newBuilder().build()) 605 * .setRequestId("requestId693933066") 606 * .build(); 607 * OperationFuture<Source, OperationMetadata> future = 608 * vmMigrationClient.createSourceOperationCallable().futureCall(request); 609 * // Do something. 610 * Source response = future.get(); 611 * } 612 * }</pre> 613 */ 614 public final OperationCallable<CreateSourceRequest, Source, OperationMetadata> createSourceOperationCallable()615 createSourceOperationCallable() { 616 return stub.createSourceOperationCallable(); 617 } 618 619 // AUTO-GENERATED DOCUMENTATION AND METHOD. 620 /** 621 * Creates a new Source in a given project and location. 622 * 623 * <p>Sample code: 624 * 625 * <pre>{@code 626 * // This snippet has been automatically generated and should be regarded as a code template only. 627 * // It will require modifications to work: 628 * // - It may require correct/in-range values for request initialization. 629 * // - It may require specifying regional endpoints when creating the service client as shown in 630 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 631 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 632 * CreateSourceRequest request = 633 * CreateSourceRequest.newBuilder() 634 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 635 * .setSourceId("sourceId1746327190") 636 * .setSource(Source.newBuilder().build()) 637 * .setRequestId("requestId693933066") 638 * .build(); 639 * ApiFuture<Operation> future = vmMigrationClient.createSourceCallable().futureCall(request); 640 * // Do something. 641 * Operation response = future.get(); 642 * } 643 * }</pre> 644 */ createSourceCallable()645 public final UnaryCallable<CreateSourceRequest, Operation> createSourceCallable() { 646 return stub.createSourceCallable(); 647 } 648 649 // AUTO-GENERATED DOCUMENTATION AND METHOD. 650 /** 651 * Updates the parameters of a single Source. 652 * 653 * <p>Sample code: 654 * 655 * <pre>{@code 656 * // This snippet has been automatically generated and should be regarded as a code template only. 657 * // It will require modifications to work: 658 * // - It may require correct/in-range values for request initialization. 659 * // - It may require specifying regional endpoints when creating the service client as shown in 660 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 661 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 662 * Source source = Source.newBuilder().build(); 663 * FieldMask updateMask = FieldMask.newBuilder().build(); 664 * Source response = vmMigrationClient.updateSourceAsync(source, updateMask).get(); 665 * } 666 * }</pre> 667 * 668 * @param source Required. The update request body. 669 * @param updateMask Field mask is used to specify the fields to be overwritten in the Source 670 * resource by the update. The fields specified in the update_mask are relative to the 671 * resource, not the full request. A field will be overwritten if it is in the mask. If the 672 * user does not provide a mask then all fields will be overwritten. 673 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 674 */ updateSourceAsync( Source source, FieldMask updateMask)675 public final OperationFuture<Source, OperationMetadata> updateSourceAsync( 676 Source source, FieldMask updateMask) { 677 UpdateSourceRequest request = 678 UpdateSourceRequest.newBuilder().setSource(source).setUpdateMask(updateMask).build(); 679 return updateSourceAsync(request); 680 } 681 682 // AUTO-GENERATED DOCUMENTATION AND METHOD. 683 /** 684 * Updates the parameters of a single Source. 685 * 686 * <p>Sample code: 687 * 688 * <pre>{@code 689 * // This snippet has been automatically generated and should be regarded as a code template only. 690 * // It will require modifications to work: 691 * // - It may require correct/in-range values for request initialization. 692 * // - It may require specifying regional endpoints when creating the service client as shown in 693 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 694 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 695 * UpdateSourceRequest request = 696 * UpdateSourceRequest.newBuilder() 697 * .setUpdateMask(FieldMask.newBuilder().build()) 698 * .setSource(Source.newBuilder().build()) 699 * .setRequestId("requestId693933066") 700 * .build(); 701 * Source response = vmMigrationClient.updateSourceAsync(request).get(); 702 * } 703 * }</pre> 704 * 705 * @param request The request object containing all of the parameters for the API call. 706 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 707 */ updateSourceAsync( UpdateSourceRequest request)708 public final OperationFuture<Source, OperationMetadata> updateSourceAsync( 709 UpdateSourceRequest request) { 710 return updateSourceOperationCallable().futureCall(request); 711 } 712 713 // AUTO-GENERATED DOCUMENTATION AND METHOD. 714 /** 715 * Updates the parameters of a single Source. 716 * 717 * <p>Sample code: 718 * 719 * <pre>{@code 720 * // This snippet has been automatically generated and should be regarded as a code template only. 721 * // It will require modifications to work: 722 * // - It may require correct/in-range values for request initialization. 723 * // - It may require specifying regional endpoints when creating the service client as shown in 724 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 725 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 726 * UpdateSourceRequest request = 727 * UpdateSourceRequest.newBuilder() 728 * .setUpdateMask(FieldMask.newBuilder().build()) 729 * .setSource(Source.newBuilder().build()) 730 * .setRequestId("requestId693933066") 731 * .build(); 732 * OperationFuture<Source, OperationMetadata> future = 733 * vmMigrationClient.updateSourceOperationCallable().futureCall(request); 734 * // Do something. 735 * Source response = future.get(); 736 * } 737 * }</pre> 738 */ 739 public final OperationCallable<UpdateSourceRequest, Source, OperationMetadata> updateSourceOperationCallable()740 updateSourceOperationCallable() { 741 return stub.updateSourceOperationCallable(); 742 } 743 744 // AUTO-GENERATED DOCUMENTATION AND METHOD. 745 /** 746 * Updates the parameters of a single Source. 747 * 748 * <p>Sample code: 749 * 750 * <pre>{@code 751 * // This snippet has been automatically generated and should be regarded as a code template only. 752 * // It will require modifications to work: 753 * // - It may require correct/in-range values for request initialization. 754 * // - It may require specifying regional endpoints when creating the service client as shown in 755 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 756 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 757 * UpdateSourceRequest request = 758 * UpdateSourceRequest.newBuilder() 759 * .setUpdateMask(FieldMask.newBuilder().build()) 760 * .setSource(Source.newBuilder().build()) 761 * .setRequestId("requestId693933066") 762 * .build(); 763 * ApiFuture<Operation> future = vmMigrationClient.updateSourceCallable().futureCall(request); 764 * // Do something. 765 * Operation response = future.get(); 766 * } 767 * }</pre> 768 */ updateSourceCallable()769 public final UnaryCallable<UpdateSourceRequest, Operation> updateSourceCallable() { 770 return stub.updateSourceCallable(); 771 } 772 773 // AUTO-GENERATED DOCUMENTATION AND METHOD. 774 /** 775 * Deletes a single Source. 776 * 777 * <p>Sample code: 778 * 779 * <pre>{@code 780 * // This snippet has been automatically generated and should be regarded as a code template only. 781 * // It will require modifications to work: 782 * // - It may require correct/in-range values for request initialization. 783 * // - It may require specifying regional endpoints when creating the service client as shown in 784 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 785 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 786 * SourceName name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 787 * vmMigrationClient.deleteSourceAsync(name).get(); 788 * } 789 * }</pre> 790 * 791 * @param name Required. The Source name. 792 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 793 */ deleteSourceAsync(SourceName name)794 public final OperationFuture<Empty, OperationMetadata> deleteSourceAsync(SourceName name) { 795 DeleteSourceRequest request = 796 DeleteSourceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 797 return deleteSourceAsync(request); 798 } 799 800 // AUTO-GENERATED DOCUMENTATION AND METHOD. 801 /** 802 * Deletes a single Source. 803 * 804 * <p>Sample code: 805 * 806 * <pre>{@code 807 * // This snippet has been automatically generated and should be regarded as a code template only. 808 * // It will require modifications to work: 809 * // - It may require correct/in-range values for request initialization. 810 * // - It may require specifying regional endpoints when creating the service client as shown in 811 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 812 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 813 * String name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 814 * vmMigrationClient.deleteSourceAsync(name).get(); 815 * } 816 * }</pre> 817 * 818 * @param name Required. The Source name. 819 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 820 */ deleteSourceAsync(String name)821 public final OperationFuture<Empty, OperationMetadata> deleteSourceAsync(String name) { 822 DeleteSourceRequest request = DeleteSourceRequest.newBuilder().setName(name).build(); 823 return deleteSourceAsync(request); 824 } 825 826 // AUTO-GENERATED DOCUMENTATION AND METHOD. 827 /** 828 * Deletes a single Source. 829 * 830 * <p>Sample code: 831 * 832 * <pre>{@code 833 * // This snippet has been automatically generated and should be regarded as a code template only. 834 * // It will require modifications to work: 835 * // - It may require correct/in-range values for request initialization. 836 * // - It may require specifying regional endpoints when creating the service client as shown in 837 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 838 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 839 * DeleteSourceRequest request = 840 * DeleteSourceRequest.newBuilder() 841 * .setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 842 * .setRequestId("requestId693933066") 843 * .build(); 844 * vmMigrationClient.deleteSourceAsync(request).get(); 845 * } 846 * }</pre> 847 * 848 * @param request The request object containing all of the parameters for the API call. 849 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 850 */ deleteSourceAsync( DeleteSourceRequest request)851 public final OperationFuture<Empty, OperationMetadata> deleteSourceAsync( 852 DeleteSourceRequest request) { 853 return deleteSourceOperationCallable().futureCall(request); 854 } 855 856 // AUTO-GENERATED DOCUMENTATION AND METHOD. 857 /** 858 * Deletes a single Source. 859 * 860 * <p>Sample code: 861 * 862 * <pre>{@code 863 * // This snippet has been automatically generated and should be regarded as a code template only. 864 * // It will require modifications to work: 865 * // - It may require correct/in-range values for request initialization. 866 * // - It may require specifying regional endpoints when creating the service client as shown in 867 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 868 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 869 * DeleteSourceRequest request = 870 * DeleteSourceRequest.newBuilder() 871 * .setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 872 * .setRequestId("requestId693933066") 873 * .build(); 874 * OperationFuture<Empty, OperationMetadata> future = 875 * vmMigrationClient.deleteSourceOperationCallable().futureCall(request); 876 * // Do something. 877 * future.get(); 878 * } 879 * }</pre> 880 */ 881 public final OperationCallable<DeleteSourceRequest, Empty, OperationMetadata> deleteSourceOperationCallable()882 deleteSourceOperationCallable() { 883 return stub.deleteSourceOperationCallable(); 884 } 885 886 // AUTO-GENERATED DOCUMENTATION AND METHOD. 887 /** 888 * Deletes a single Source. 889 * 890 * <p>Sample code: 891 * 892 * <pre>{@code 893 * // This snippet has been automatically generated and should be regarded as a code template only. 894 * // It will require modifications to work: 895 * // - It may require correct/in-range values for request initialization. 896 * // - It may require specifying regional endpoints when creating the service client as shown in 897 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 898 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 899 * DeleteSourceRequest request = 900 * DeleteSourceRequest.newBuilder() 901 * .setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 902 * .setRequestId("requestId693933066") 903 * .build(); 904 * ApiFuture<Operation> future = vmMigrationClient.deleteSourceCallable().futureCall(request); 905 * // Do something. 906 * future.get(); 907 * } 908 * }</pre> 909 */ deleteSourceCallable()910 public final UnaryCallable<DeleteSourceRequest, Operation> deleteSourceCallable() { 911 return stub.deleteSourceCallable(); 912 } 913 914 // AUTO-GENERATED DOCUMENTATION AND METHOD. 915 /** 916 * List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the 917 * sense it's not in Compute Engine). The inventory describes the list of existing VMs in that 918 * source. Note that this operation lists the VMs on the remote source, as opposed to listing the 919 * MigratingVms resources in the vmmigration service. 920 * 921 * <p>Sample code: 922 * 923 * <pre>{@code 924 * // This snippet has been automatically generated and should be regarded as a code template only. 925 * // It will require modifications to work: 926 * // - It may require correct/in-range values for request initialization. 927 * // - It may require specifying regional endpoints when creating the service client as shown in 928 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 929 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 930 * SourceName source = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 931 * FetchInventoryResponse response = vmMigrationClient.fetchInventory(source); 932 * } 933 * }</pre> 934 * 935 * @param source Required. The name of the Source. 936 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 937 */ fetchInventory(SourceName source)938 public final FetchInventoryResponse fetchInventory(SourceName source) { 939 FetchInventoryRequest request = 940 FetchInventoryRequest.newBuilder() 941 .setSource(source == null ? null : source.toString()) 942 .build(); 943 return fetchInventory(request); 944 } 945 946 // AUTO-GENERATED DOCUMENTATION AND METHOD. 947 /** 948 * List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the 949 * sense it's not in Compute Engine). The inventory describes the list of existing VMs in that 950 * source. Note that this operation lists the VMs on the remote source, as opposed to listing the 951 * MigratingVms resources in the vmmigration service. 952 * 953 * <p>Sample code: 954 * 955 * <pre>{@code 956 * // This snippet has been automatically generated and should be regarded as a code template only. 957 * // It will require modifications to work: 958 * // - It may require correct/in-range values for request initialization. 959 * // - It may require specifying regional endpoints when creating the service client as shown in 960 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 961 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 962 * String source = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 963 * FetchInventoryResponse response = vmMigrationClient.fetchInventory(source); 964 * } 965 * }</pre> 966 * 967 * @param source Required. The name of the Source. 968 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 969 */ fetchInventory(String source)970 public final FetchInventoryResponse fetchInventory(String source) { 971 FetchInventoryRequest request = FetchInventoryRequest.newBuilder().setSource(source).build(); 972 return fetchInventory(request); 973 } 974 975 // AUTO-GENERATED DOCUMENTATION AND METHOD. 976 /** 977 * List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the 978 * sense it's not in Compute Engine). The inventory describes the list of existing VMs in that 979 * source. Note that this operation lists the VMs on the remote source, as opposed to listing the 980 * MigratingVms resources in the vmmigration service. 981 * 982 * <p>Sample code: 983 * 984 * <pre>{@code 985 * // This snippet has been automatically generated and should be regarded as a code template only. 986 * // It will require modifications to work: 987 * // - It may require correct/in-range values for request initialization. 988 * // - It may require specifying regional endpoints when creating the service client as shown in 989 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 990 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 991 * FetchInventoryRequest request = 992 * FetchInventoryRequest.newBuilder() 993 * .setSource(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 994 * .setForceRefresh(true) 995 * .build(); 996 * FetchInventoryResponse response = vmMigrationClient.fetchInventory(request); 997 * } 998 * }</pre> 999 * 1000 * @param request The request object containing all of the parameters for the API call. 1001 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1002 */ fetchInventory(FetchInventoryRequest request)1003 public final FetchInventoryResponse fetchInventory(FetchInventoryRequest request) { 1004 return fetchInventoryCallable().call(request); 1005 } 1006 1007 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1008 /** 1009 * List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the 1010 * sense it's not in Compute Engine). The inventory describes the list of existing VMs in that 1011 * source. Note that this operation lists the VMs on the remote source, as opposed to listing the 1012 * MigratingVms resources in the vmmigration service. 1013 * 1014 * <p>Sample code: 1015 * 1016 * <pre>{@code 1017 * // This snippet has been automatically generated and should be regarded as a code template only. 1018 * // It will require modifications to work: 1019 * // - It may require correct/in-range values for request initialization. 1020 * // - It may require specifying regional endpoints when creating the service client as shown in 1021 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1022 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1023 * FetchInventoryRequest request = 1024 * FetchInventoryRequest.newBuilder() 1025 * .setSource(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1026 * .setForceRefresh(true) 1027 * .build(); 1028 * ApiFuture<FetchInventoryResponse> future = 1029 * vmMigrationClient.fetchInventoryCallable().futureCall(request); 1030 * // Do something. 1031 * FetchInventoryResponse response = future.get(); 1032 * } 1033 * }</pre> 1034 */ 1035 public final UnaryCallable<FetchInventoryRequest, FetchInventoryResponse> fetchInventoryCallable()1036 fetchInventoryCallable() { 1037 return stub.fetchInventoryCallable(); 1038 } 1039 1040 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1041 /** 1042 * Lists Utilization Reports of the given Source. 1043 * 1044 * <p>Sample code: 1045 * 1046 * <pre>{@code 1047 * // This snippet has been automatically generated and should be regarded as a code template only. 1048 * // It will require modifications to work: 1049 * // - It may require correct/in-range values for request initialization. 1050 * // - It may require specifying regional endpoints when creating the service client as shown in 1051 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1052 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1053 * SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 1054 * for (UtilizationReport element : 1055 * vmMigrationClient.listUtilizationReports(parent).iterateAll()) { 1056 * // doThingsWith(element); 1057 * } 1058 * } 1059 * }</pre> 1060 * 1061 * @param parent Required. The Utilization Reports parent. 1062 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1063 */ listUtilizationReports(SourceName parent)1064 public final ListUtilizationReportsPagedResponse listUtilizationReports(SourceName parent) { 1065 ListUtilizationReportsRequest request = 1066 ListUtilizationReportsRequest.newBuilder() 1067 .setParent(parent == null ? null : parent.toString()) 1068 .build(); 1069 return listUtilizationReports(request); 1070 } 1071 1072 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1073 /** 1074 * Lists Utilization Reports of the given Source. 1075 * 1076 * <p>Sample code: 1077 * 1078 * <pre>{@code 1079 * // This snippet has been automatically generated and should be regarded as a code template only. 1080 * // It will require modifications to work: 1081 * // - It may require correct/in-range values for request initialization. 1082 * // - It may require specifying regional endpoints when creating the service client as shown in 1083 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1084 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1085 * String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 1086 * for (UtilizationReport element : 1087 * vmMigrationClient.listUtilizationReports(parent).iterateAll()) { 1088 * // doThingsWith(element); 1089 * } 1090 * } 1091 * }</pre> 1092 * 1093 * @param parent Required. The Utilization Reports parent. 1094 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1095 */ listUtilizationReports(String parent)1096 public final ListUtilizationReportsPagedResponse listUtilizationReports(String parent) { 1097 ListUtilizationReportsRequest request = 1098 ListUtilizationReportsRequest.newBuilder().setParent(parent).build(); 1099 return listUtilizationReports(request); 1100 } 1101 1102 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1103 /** 1104 * Lists Utilization Reports of the given Source. 1105 * 1106 * <p>Sample code: 1107 * 1108 * <pre>{@code 1109 * // This snippet has been automatically generated and should be regarded as a code template only. 1110 * // It will require modifications to work: 1111 * // - It may require correct/in-range values for request initialization. 1112 * // - It may require specifying regional endpoints when creating the service client as shown in 1113 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1114 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1115 * ListUtilizationReportsRequest request = 1116 * ListUtilizationReportsRequest.newBuilder() 1117 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1118 * .setView(UtilizationReportView.forNumber(0)) 1119 * .setPageSize(883849137) 1120 * .setPageToken("pageToken873572522") 1121 * .setFilter("filter-1274492040") 1122 * .setOrderBy("orderBy-1207110587") 1123 * .build(); 1124 * for (UtilizationReport element : 1125 * vmMigrationClient.listUtilizationReports(request).iterateAll()) { 1126 * // doThingsWith(element); 1127 * } 1128 * } 1129 * }</pre> 1130 * 1131 * @param request The request object containing all of the parameters for the API call. 1132 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1133 */ listUtilizationReports( ListUtilizationReportsRequest request)1134 public final ListUtilizationReportsPagedResponse listUtilizationReports( 1135 ListUtilizationReportsRequest request) { 1136 return listUtilizationReportsPagedCallable().call(request); 1137 } 1138 1139 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1140 /** 1141 * Lists Utilization Reports of the given Source. 1142 * 1143 * <p>Sample code: 1144 * 1145 * <pre>{@code 1146 * // This snippet has been automatically generated and should be regarded as a code template only. 1147 * // It will require modifications to work: 1148 * // - It may require correct/in-range values for request initialization. 1149 * // - It may require specifying regional endpoints when creating the service client as shown in 1150 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1151 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1152 * ListUtilizationReportsRequest request = 1153 * ListUtilizationReportsRequest.newBuilder() 1154 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1155 * .setView(UtilizationReportView.forNumber(0)) 1156 * .setPageSize(883849137) 1157 * .setPageToken("pageToken873572522") 1158 * .setFilter("filter-1274492040") 1159 * .setOrderBy("orderBy-1207110587") 1160 * .build(); 1161 * ApiFuture<UtilizationReport> future = 1162 * vmMigrationClient.listUtilizationReportsPagedCallable().futureCall(request); 1163 * // Do something. 1164 * for (UtilizationReport element : future.get().iterateAll()) { 1165 * // doThingsWith(element); 1166 * } 1167 * } 1168 * }</pre> 1169 */ 1170 public final UnaryCallable<ListUtilizationReportsRequest, ListUtilizationReportsPagedResponse> listUtilizationReportsPagedCallable()1171 listUtilizationReportsPagedCallable() { 1172 return stub.listUtilizationReportsPagedCallable(); 1173 } 1174 1175 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1176 /** 1177 * Lists Utilization Reports of the given Source. 1178 * 1179 * <p>Sample code: 1180 * 1181 * <pre>{@code 1182 * // This snippet has been automatically generated and should be regarded as a code template only. 1183 * // It will require modifications to work: 1184 * // - It may require correct/in-range values for request initialization. 1185 * // - It may require specifying regional endpoints when creating the service client as shown in 1186 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1187 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1188 * ListUtilizationReportsRequest request = 1189 * ListUtilizationReportsRequest.newBuilder() 1190 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1191 * .setView(UtilizationReportView.forNumber(0)) 1192 * .setPageSize(883849137) 1193 * .setPageToken("pageToken873572522") 1194 * .setFilter("filter-1274492040") 1195 * .setOrderBy("orderBy-1207110587") 1196 * .build(); 1197 * while (true) { 1198 * ListUtilizationReportsResponse response = 1199 * vmMigrationClient.listUtilizationReportsCallable().call(request); 1200 * for (UtilizationReport element : response.getUtilizationReportsList()) { 1201 * // doThingsWith(element); 1202 * } 1203 * String nextPageToken = response.getNextPageToken(); 1204 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1205 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1206 * } else { 1207 * break; 1208 * } 1209 * } 1210 * } 1211 * }</pre> 1212 */ 1213 public final UnaryCallable<ListUtilizationReportsRequest, ListUtilizationReportsResponse> listUtilizationReportsCallable()1214 listUtilizationReportsCallable() { 1215 return stub.listUtilizationReportsCallable(); 1216 } 1217 1218 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1219 /** 1220 * Gets a single Utilization Report. 1221 * 1222 * <p>Sample code: 1223 * 1224 * <pre>{@code 1225 * // This snippet has been automatically generated and should be regarded as a code template only. 1226 * // It will require modifications to work: 1227 * // - It may require correct/in-range values for request initialization. 1228 * // - It may require specifying regional endpoints when creating the service client as shown in 1229 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1230 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1231 * UtilizationReportName name = 1232 * UtilizationReportName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]"); 1233 * UtilizationReport response = vmMigrationClient.getUtilizationReport(name); 1234 * } 1235 * }</pre> 1236 * 1237 * @param name Required. The Utilization Report name. 1238 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1239 */ getUtilizationReport(UtilizationReportName name)1240 public final UtilizationReport getUtilizationReport(UtilizationReportName name) { 1241 GetUtilizationReportRequest request = 1242 GetUtilizationReportRequest.newBuilder() 1243 .setName(name == null ? null : name.toString()) 1244 .build(); 1245 return getUtilizationReport(request); 1246 } 1247 1248 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1249 /** 1250 * Gets a single Utilization Report. 1251 * 1252 * <p>Sample code: 1253 * 1254 * <pre>{@code 1255 * // This snippet has been automatically generated and should be regarded as a code template only. 1256 * // It will require modifications to work: 1257 * // - It may require correct/in-range values for request initialization. 1258 * // - It may require specifying regional endpoints when creating the service client as shown in 1259 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1260 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1261 * String name = 1262 * UtilizationReportName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]") 1263 * .toString(); 1264 * UtilizationReport response = vmMigrationClient.getUtilizationReport(name); 1265 * } 1266 * }</pre> 1267 * 1268 * @param name Required. The Utilization Report name. 1269 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1270 */ getUtilizationReport(String name)1271 public final UtilizationReport getUtilizationReport(String name) { 1272 GetUtilizationReportRequest request = 1273 GetUtilizationReportRequest.newBuilder().setName(name).build(); 1274 return getUtilizationReport(request); 1275 } 1276 1277 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1278 /** 1279 * Gets a single Utilization Report. 1280 * 1281 * <p>Sample code: 1282 * 1283 * <pre>{@code 1284 * // This snippet has been automatically generated and should be regarded as a code template only. 1285 * // It will require modifications to work: 1286 * // - It may require correct/in-range values for request initialization. 1287 * // - It may require specifying regional endpoints when creating the service client as shown in 1288 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1289 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1290 * GetUtilizationReportRequest request = 1291 * GetUtilizationReportRequest.newBuilder() 1292 * .setName( 1293 * UtilizationReportName.of( 1294 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]") 1295 * .toString()) 1296 * .setView(UtilizationReportView.forNumber(0)) 1297 * .build(); 1298 * UtilizationReport response = vmMigrationClient.getUtilizationReport(request); 1299 * } 1300 * }</pre> 1301 * 1302 * @param request The request object containing all of the parameters for the API call. 1303 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1304 */ getUtilizationReport(GetUtilizationReportRequest request)1305 public final UtilizationReport getUtilizationReport(GetUtilizationReportRequest request) { 1306 return getUtilizationReportCallable().call(request); 1307 } 1308 1309 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1310 /** 1311 * Gets a single Utilization Report. 1312 * 1313 * <p>Sample code: 1314 * 1315 * <pre>{@code 1316 * // This snippet has been automatically generated and should be regarded as a code template only. 1317 * // It will require modifications to work: 1318 * // - It may require correct/in-range values for request initialization. 1319 * // - It may require specifying regional endpoints when creating the service client as shown in 1320 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1321 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1322 * GetUtilizationReportRequest request = 1323 * GetUtilizationReportRequest.newBuilder() 1324 * .setName( 1325 * UtilizationReportName.of( 1326 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]") 1327 * .toString()) 1328 * .setView(UtilizationReportView.forNumber(0)) 1329 * .build(); 1330 * ApiFuture<UtilizationReport> future = 1331 * vmMigrationClient.getUtilizationReportCallable().futureCall(request); 1332 * // Do something. 1333 * UtilizationReport response = future.get(); 1334 * } 1335 * }</pre> 1336 */ 1337 public final UnaryCallable<GetUtilizationReportRequest, UtilizationReport> getUtilizationReportCallable()1338 getUtilizationReportCallable() { 1339 return stub.getUtilizationReportCallable(); 1340 } 1341 1342 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1343 /** 1344 * Creates a new UtilizationReport. 1345 * 1346 * <p>Sample code: 1347 * 1348 * <pre>{@code 1349 * // This snippet has been automatically generated and should be regarded as a code template only. 1350 * // It will require modifications to work: 1351 * // - It may require correct/in-range values for request initialization. 1352 * // - It may require specifying regional endpoints when creating the service client as shown in 1353 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1354 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1355 * SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 1356 * UtilizationReport utilizationReport = UtilizationReport.newBuilder().build(); 1357 * String utilizationReportId = "utilizationReportId1215771057"; 1358 * UtilizationReport response = 1359 * vmMigrationClient 1360 * .createUtilizationReportAsync(parent, utilizationReport, utilizationReportId) 1361 * .get(); 1362 * } 1363 * }</pre> 1364 * 1365 * @param parent Required. The Utilization Report's parent. 1366 * @param utilizationReport Required. The report to create. 1367 * @param utilizationReportId Required. The ID to use for the report, which will become the final 1368 * component of the reports's resource name. 1369 * <p>This value maximum length is 63 characters, and valid characters are /[a-z][0-9]-/. It 1370 * must start with an english letter and must not end with a hyphen. 1371 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1372 */ createUtilizationReportAsync( SourceName parent, UtilizationReport utilizationReport, String utilizationReportId)1373 public final OperationFuture<UtilizationReport, OperationMetadata> createUtilizationReportAsync( 1374 SourceName parent, UtilizationReport utilizationReport, String utilizationReportId) { 1375 CreateUtilizationReportRequest request = 1376 CreateUtilizationReportRequest.newBuilder() 1377 .setParent(parent == null ? null : parent.toString()) 1378 .setUtilizationReport(utilizationReport) 1379 .setUtilizationReportId(utilizationReportId) 1380 .build(); 1381 return createUtilizationReportAsync(request); 1382 } 1383 1384 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1385 /** 1386 * Creates a new UtilizationReport. 1387 * 1388 * <p>Sample code: 1389 * 1390 * <pre>{@code 1391 * // This snippet has been automatically generated and should be regarded as a code template only. 1392 * // It will require modifications to work: 1393 * // - It may require correct/in-range values for request initialization. 1394 * // - It may require specifying regional endpoints when creating the service client as shown in 1395 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1396 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1397 * String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 1398 * UtilizationReport utilizationReport = UtilizationReport.newBuilder().build(); 1399 * String utilizationReportId = "utilizationReportId1215771057"; 1400 * UtilizationReport response = 1401 * vmMigrationClient 1402 * .createUtilizationReportAsync(parent, utilizationReport, utilizationReportId) 1403 * .get(); 1404 * } 1405 * }</pre> 1406 * 1407 * @param parent Required. The Utilization Report's parent. 1408 * @param utilizationReport Required. The report to create. 1409 * @param utilizationReportId Required. The ID to use for the report, which will become the final 1410 * component of the reports's resource name. 1411 * <p>This value maximum length is 63 characters, and valid characters are /[a-z][0-9]-/. It 1412 * must start with an english letter and must not end with a hyphen. 1413 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1414 */ createUtilizationReportAsync( String parent, UtilizationReport utilizationReport, String utilizationReportId)1415 public final OperationFuture<UtilizationReport, OperationMetadata> createUtilizationReportAsync( 1416 String parent, UtilizationReport utilizationReport, String utilizationReportId) { 1417 CreateUtilizationReportRequest request = 1418 CreateUtilizationReportRequest.newBuilder() 1419 .setParent(parent) 1420 .setUtilizationReport(utilizationReport) 1421 .setUtilizationReportId(utilizationReportId) 1422 .build(); 1423 return createUtilizationReportAsync(request); 1424 } 1425 1426 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1427 /** 1428 * Creates a new UtilizationReport. 1429 * 1430 * <p>Sample code: 1431 * 1432 * <pre>{@code 1433 * // This snippet has been automatically generated and should be regarded as a code template only. 1434 * // It will require modifications to work: 1435 * // - It may require correct/in-range values for request initialization. 1436 * // - It may require specifying regional endpoints when creating the service client as shown in 1437 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1438 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1439 * CreateUtilizationReportRequest request = 1440 * CreateUtilizationReportRequest.newBuilder() 1441 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1442 * .setUtilizationReport(UtilizationReport.newBuilder().build()) 1443 * .setUtilizationReportId("utilizationReportId1215771057") 1444 * .setRequestId("requestId693933066") 1445 * .build(); 1446 * UtilizationReport response = vmMigrationClient.createUtilizationReportAsync(request).get(); 1447 * } 1448 * }</pre> 1449 * 1450 * @param request The request object containing all of the parameters for the API call. 1451 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1452 */ createUtilizationReportAsync( CreateUtilizationReportRequest request)1453 public final OperationFuture<UtilizationReport, OperationMetadata> createUtilizationReportAsync( 1454 CreateUtilizationReportRequest request) { 1455 return createUtilizationReportOperationCallable().futureCall(request); 1456 } 1457 1458 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1459 /** 1460 * Creates a new UtilizationReport. 1461 * 1462 * <p>Sample code: 1463 * 1464 * <pre>{@code 1465 * // This snippet has been automatically generated and should be regarded as a code template only. 1466 * // It will require modifications to work: 1467 * // - It may require correct/in-range values for request initialization. 1468 * // - It may require specifying regional endpoints when creating the service client as shown in 1469 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1470 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1471 * CreateUtilizationReportRequest request = 1472 * CreateUtilizationReportRequest.newBuilder() 1473 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1474 * .setUtilizationReport(UtilizationReport.newBuilder().build()) 1475 * .setUtilizationReportId("utilizationReportId1215771057") 1476 * .setRequestId("requestId693933066") 1477 * .build(); 1478 * OperationFuture<UtilizationReport, OperationMetadata> future = 1479 * vmMigrationClient.createUtilizationReportOperationCallable().futureCall(request); 1480 * // Do something. 1481 * UtilizationReport response = future.get(); 1482 * } 1483 * }</pre> 1484 */ 1485 public final OperationCallable< 1486 CreateUtilizationReportRequest, UtilizationReport, OperationMetadata> createUtilizationReportOperationCallable()1487 createUtilizationReportOperationCallable() { 1488 return stub.createUtilizationReportOperationCallable(); 1489 } 1490 1491 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1492 /** 1493 * Creates a new UtilizationReport. 1494 * 1495 * <p>Sample code: 1496 * 1497 * <pre>{@code 1498 * // This snippet has been automatically generated and should be regarded as a code template only. 1499 * // It will require modifications to work: 1500 * // - It may require correct/in-range values for request initialization. 1501 * // - It may require specifying regional endpoints when creating the service client as shown in 1502 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1503 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1504 * CreateUtilizationReportRequest request = 1505 * CreateUtilizationReportRequest.newBuilder() 1506 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1507 * .setUtilizationReport(UtilizationReport.newBuilder().build()) 1508 * .setUtilizationReportId("utilizationReportId1215771057") 1509 * .setRequestId("requestId693933066") 1510 * .build(); 1511 * ApiFuture<Operation> future = 1512 * vmMigrationClient.createUtilizationReportCallable().futureCall(request); 1513 * // Do something. 1514 * Operation response = future.get(); 1515 * } 1516 * }</pre> 1517 */ 1518 public final UnaryCallable<CreateUtilizationReportRequest, Operation> createUtilizationReportCallable()1519 createUtilizationReportCallable() { 1520 return stub.createUtilizationReportCallable(); 1521 } 1522 1523 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1524 /** 1525 * Deletes a single Utilization Report. 1526 * 1527 * <p>Sample code: 1528 * 1529 * <pre>{@code 1530 * // This snippet has been automatically generated and should be regarded as a code template only. 1531 * // It will require modifications to work: 1532 * // - It may require correct/in-range values for request initialization. 1533 * // - It may require specifying regional endpoints when creating the service client as shown in 1534 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1535 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1536 * UtilizationReportName name = 1537 * UtilizationReportName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]"); 1538 * vmMigrationClient.deleteUtilizationReportAsync(name).get(); 1539 * } 1540 * }</pre> 1541 * 1542 * @param name Required. The Utilization Report name. 1543 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1544 */ deleteUtilizationReportAsync( UtilizationReportName name)1545 public final OperationFuture<Empty, OperationMetadata> deleteUtilizationReportAsync( 1546 UtilizationReportName name) { 1547 DeleteUtilizationReportRequest request = 1548 DeleteUtilizationReportRequest.newBuilder() 1549 .setName(name == null ? null : name.toString()) 1550 .build(); 1551 return deleteUtilizationReportAsync(request); 1552 } 1553 1554 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1555 /** 1556 * Deletes a single Utilization Report. 1557 * 1558 * <p>Sample code: 1559 * 1560 * <pre>{@code 1561 * // This snippet has been automatically generated and should be regarded as a code template only. 1562 * // It will require modifications to work: 1563 * // - It may require correct/in-range values for request initialization. 1564 * // - It may require specifying regional endpoints when creating the service client as shown in 1565 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1566 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1567 * String name = 1568 * UtilizationReportName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]") 1569 * .toString(); 1570 * vmMigrationClient.deleteUtilizationReportAsync(name).get(); 1571 * } 1572 * }</pre> 1573 * 1574 * @param name Required. The Utilization Report name. 1575 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1576 */ deleteUtilizationReportAsync(String name)1577 public final OperationFuture<Empty, OperationMetadata> deleteUtilizationReportAsync(String name) { 1578 DeleteUtilizationReportRequest request = 1579 DeleteUtilizationReportRequest.newBuilder().setName(name).build(); 1580 return deleteUtilizationReportAsync(request); 1581 } 1582 1583 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1584 /** 1585 * Deletes a single Utilization Report. 1586 * 1587 * <p>Sample code: 1588 * 1589 * <pre>{@code 1590 * // This snippet has been automatically generated and should be regarded as a code template only. 1591 * // It will require modifications to work: 1592 * // - It may require correct/in-range values for request initialization. 1593 * // - It may require specifying regional endpoints when creating the service client as shown in 1594 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1595 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1596 * DeleteUtilizationReportRequest request = 1597 * DeleteUtilizationReportRequest.newBuilder() 1598 * .setName( 1599 * UtilizationReportName.of( 1600 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]") 1601 * .toString()) 1602 * .setRequestId("requestId693933066") 1603 * .build(); 1604 * vmMigrationClient.deleteUtilizationReportAsync(request).get(); 1605 * } 1606 * }</pre> 1607 * 1608 * @param request The request object containing all of the parameters for the API call. 1609 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1610 */ deleteUtilizationReportAsync( DeleteUtilizationReportRequest request)1611 public final OperationFuture<Empty, OperationMetadata> deleteUtilizationReportAsync( 1612 DeleteUtilizationReportRequest request) { 1613 return deleteUtilizationReportOperationCallable().futureCall(request); 1614 } 1615 1616 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1617 /** 1618 * Deletes a single Utilization Report. 1619 * 1620 * <p>Sample code: 1621 * 1622 * <pre>{@code 1623 * // This snippet has been automatically generated and should be regarded as a code template only. 1624 * // It will require modifications to work: 1625 * // - It may require correct/in-range values for request initialization. 1626 * // - It may require specifying regional endpoints when creating the service client as shown in 1627 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1628 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1629 * DeleteUtilizationReportRequest request = 1630 * DeleteUtilizationReportRequest.newBuilder() 1631 * .setName( 1632 * UtilizationReportName.of( 1633 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]") 1634 * .toString()) 1635 * .setRequestId("requestId693933066") 1636 * .build(); 1637 * OperationFuture<Empty, OperationMetadata> future = 1638 * vmMigrationClient.deleteUtilizationReportOperationCallable().futureCall(request); 1639 * // Do something. 1640 * future.get(); 1641 * } 1642 * }</pre> 1643 */ 1644 public final OperationCallable<DeleteUtilizationReportRequest, Empty, OperationMetadata> deleteUtilizationReportOperationCallable()1645 deleteUtilizationReportOperationCallable() { 1646 return stub.deleteUtilizationReportOperationCallable(); 1647 } 1648 1649 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1650 /** 1651 * Deletes a single Utilization Report. 1652 * 1653 * <p>Sample code: 1654 * 1655 * <pre>{@code 1656 * // This snippet has been automatically generated and should be regarded as a code template only. 1657 * // It will require modifications to work: 1658 * // - It may require correct/in-range values for request initialization. 1659 * // - It may require specifying regional endpoints when creating the service client as shown in 1660 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1661 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1662 * DeleteUtilizationReportRequest request = 1663 * DeleteUtilizationReportRequest.newBuilder() 1664 * .setName( 1665 * UtilizationReportName.of( 1666 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]") 1667 * .toString()) 1668 * .setRequestId("requestId693933066") 1669 * .build(); 1670 * ApiFuture<Operation> future = 1671 * vmMigrationClient.deleteUtilizationReportCallable().futureCall(request); 1672 * // Do something. 1673 * future.get(); 1674 * } 1675 * }</pre> 1676 */ 1677 public final UnaryCallable<DeleteUtilizationReportRequest, Operation> deleteUtilizationReportCallable()1678 deleteUtilizationReportCallable() { 1679 return stub.deleteUtilizationReportCallable(); 1680 } 1681 1682 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1683 /** 1684 * Lists DatacenterConnectors in a given Source. 1685 * 1686 * <p>Sample code: 1687 * 1688 * <pre>{@code 1689 * // This snippet has been automatically generated and should be regarded as a code template only. 1690 * // It will require modifications to work: 1691 * // - It may require correct/in-range values for request initialization. 1692 * // - It may require specifying regional endpoints when creating the service client as shown in 1693 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1694 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1695 * SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 1696 * for (DatacenterConnector element : 1697 * vmMigrationClient.listDatacenterConnectors(parent).iterateAll()) { 1698 * // doThingsWith(element); 1699 * } 1700 * } 1701 * }</pre> 1702 * 1703 * @param parent Required. The parent, which owns this collection of connectors. 1704 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1705 */ listDatacenterConnectors(SourceName parent)1706 public final ListDatacenterConnectorsPagedResponse listDatacenterConnectors(SourceName parent) { 1707 ListDatacenterConnectorsRequest request = 1708 ListDatacenterConnectorsRequest.newBuilder() 1709 .setParent(parent == null ? null : parent.toString()) 1710 .build(); 1711 return listDatacenterConnectors(request); 1712 } 1713 1714 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1715 /** 1716 * Lists DatacenterConnectors in a given Source. 1717 * 1718 * <p>Sample code: 1719 * 1720 * <pre>{@code 1721 * // This snippet has been automatically generated and should be regarded as a code template only. 1722 * // It will require modifications to work: 1723 * // - It may require correct/in-range values for request initialization. 1724 * // - It may require specifying regional endpoints when creating the service client as shown in 1725 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1726 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1727 * String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 1728 * for (DatacenterConnector element : 1729 * vmMigrationClient.listDatacenterConnectors(parent).iterateAll()) { 1730 * // doThingsWith(element); 1731 * } 1732 * } 1733 * }</pre> 1734 * 1735 * @param parent Required. The parent, which owns this collection of connectors. 1736 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1737 */ listDatacenterConnectors(String parent)1738 public final ListDatacenterConnectorsPagedResponse listDatacenterConnectors(String parent) { 1739 ListDatacenterConnectorsRequest request = 1740 ListDatacenterConnectorsRequest.newBuilder().setParent(parent).build(); 1741 return listDatacenterConnectors(request); 1742 } 1743 1744 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1745 /** 1746 * Lists DatacenterConnectors in a given Source. 1747 * 1748 * <p>Sample code: 1749 * 1750 * <pre>{@code 1751 * // This snippet has been automatically generated and should be regarded as a code template only. 1752 * // It will require modifications to work: 1753 * // - It may require correct/in-range values for request initialization. 1754 * // - It may require specifying regional endpoints when creating the service client as shown in 1755 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1756 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1757 * ListDatacenterConnectorsRequest request = 1758 * ListDatacenterConnectorsRequest.newBuilder() 1759 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1760 * .setPageSize(883849137) 1761 * .setPageToken("pageToken873572522") 1762 * .setFilter("filter-1274492040") 1763 * .setOrderBy("orderBy-1207110587") 1764 * .build(); 1765 * for (DatacenterConnector element : 1766 * vmMigrationClient.listDatacenterConnectors(request).iterateAll()) { 1767 * // doThingsWith(element); 1768 * } 1769 * } 1770 * }</pre> 1771 * 1772 * @param request The request object containing all of the parameters for the API call. 1773 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1774 */ listDatacenterConnectors( ListDatacenterConnectorsRequest request)1775 public final ListDatacenterConnectorsPagedResponse listDatacenterConnectors( 1776 ListDatacenterConnectorsRequest request) { 1777 return listDatacenterConnectorsPagedCallable().call(request); 1778 } 1779 1780 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1781 /** 1782 * Lists DatacenterConnectors in a given Source. 1783 * 1784 * <p>Sample code: 1785 * 1786 * <pre>{@code 1787 * // This snippet has been automatically generated and should be regarded as a code template only. 1788 * // It will require modifications to work: 1789 * // - It may require correct/in-range values for request initialization. 1790 * // - It may require specifying regional endpoints when creating the service client as shown in 1791 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1792 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1793 * ListDatacenterConnectorsRequest request = 1794 * ListDatacenterConnectorsRequest.newBuilder() 1795 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1796 * .setPageSize(883849137) 1797 * .setPageToken("pageToken873572522") 1798 * .setFilter("filter-1274492040") 1799 * .setOrderBy("orderBy-1207110587") 1800 * .build(); 1801 * ApiFuture<DatacenterConnector> future = 1802 * vmMigrationClient.listDatacenterConnectorsPagedCallable().futureCall(request); 1803 * // Do something. 1804 * for (DatacenterConnector element : future.get().iterateAll()) { 1805 * // doThingsWith(element); 1806 * } 1807 * } 1808 * }</pre> 1809 */ 1810 public final UnaryCallable<ListDatacenterConnectorsRequest, ListDatacenterConnectorsPagedResponse> listDatacenterConnectorsPagedCallable()1811 listDatacenterConnectorsPagedCallable() { 1812 return stub.listDatacenterConnectorsPagedCallable(); 1813 } 1814 1815 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1816 /** 1817 * Lists DatacenterConnectors in a given Source. 1818 * 1819 * <p>Sample code: 1820 * 1821 * <pre>{@code 1822 * // This snippet has been automatically generated and should be regarded as a code template only. 1823 * // It will require modifications to work: 1824 * // - It may require correct/in-range values for request initialization. 1825 * // - It may require specifying regional endpoints when creating the service client as shown in 1826 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1827 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1828 * ListDatacenterConnectorsRequest request = 1829 * ListDatacenterConnectorsRequest.newBuilder() 1830 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 1831 * .setPageSize(883849137) 1832 * .setPageToken("pageToken873572522") 1833 * .setFilter("filter-1274492040") 1834 * .setOrderBy("orderBy-1207110587") 1835 * .build(); 1836 * while (true) { 1837 * ListDatacenterConnectorsResponse response = 1838 * vmMigrationClient.listDatacenterConnectorsCallable().call(request); 1839 * for (DatacenterConnector element : response.getDatacenterConnectorsList()) { 1840 * // doThingsWith(element); 1841 * } 1842 * String nextPageToken = response.getNextPageToken(); 1843 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1844 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1845 * } else { 1846 * break; 1847 * } 1848 * } 1849 * } 1850 * }</pre> 1851 */ 1852 public final UnaryCallable<ListDatacenterConnectorsRequest, ListDatacenterConnectorsResponse> listDatacenterConnectorsCallable()1853 listDatacenterConnectorsCallable() { 1854 return stub.listDatacenterConnectorsCallable(); 1855 } 1856 1857 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1858 /** 1859 * Gets details of a single DatacenterConnector. 1860 * 1861 * <p>Sample code: 1862 * 1863 * <pre>{@code 1864 * // This snippet has been automatically generated and should be regarded as a code template only. 1865 * // It will require modifications to work: 1866 * // - It may require correct/in-range values for request initialization. 1867 * // - It may require specifying regional endpoints when creating the service client as shown in 1868 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1869 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1870 * DatacenterConnectorName name = 1871 * DatacenterConnectorName.of( 1872 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]"); 1873 * DatacenterConnector response = vmMigrationClient.getDatacenterConnector(name); 1874 * } 1875 * }</pre> 1876 * 1877 * @param name Required. The name of the DatacenterConnector. 1878 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1879 */ getDatacenterConnector(DatacenterConnectorName name)1880 public final DatacenterConnector getDatacenterConnector(DatacenterConnectorName name) { 1881 GetDatacenterConnectorRequest request = 1882 GetDatacenterConnectorRequest.newBuilder() 1883 .setName(name == null ? null : name.toString()) 1884 .build(); 1885 return getDatacenterConnector(request); 1886 } 1887 1888 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1889 /** 1890 * Gets details of a single DatacenterConnector. 1891 * 1892 * <p>Sample code: 1893 * 1894 * <pre>{@code 1895 * // This snippet has been automatically generated and should be regarded as a code template only. 1896 * // It will require modifications to work: 1897 * // - It may require correct/in-range values for request initialization. 1898 * // - It may require specifying regional endpoints when creating the service client as shown in 1899 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1900 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1901 * String name = 1902 * DatacenterConnectorName.of( 1903 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 1904 * .toString(); 1905 * DatacenterConnector response = vmMigrationClient.getDatacenterConnector(name); 1906 * } 1907 * }</pre> 1908 * 1909 * @param name Required. The name of the DatacenterConnector. 1910 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1911 */ getDatacenterConnector(String name)1912 public final DatacenterConnector getDatacenterConnector(String name) { 1913 GetDatacenterConnectorRequest request = 1914 GetDatacenterConnectorRequest.newBuilder().setName(name).build(); 1915 return getDatacenterConnector(request); 1916 } 1917 1918 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1919 /** 1920 * Gets details of a single DatacenterConnector. 1921 * 1922 * <p>Sample code: 1923 * 1924 * <pre>{@code 1925 * // This snippet has been automatically generated and should be regarded as a code template only. 1926 * // It will require modifications to work: 1927 * // - It may require correct/in-range values for request initialization. 1928 * // - It may require specifying regional endpoints when creating the service client as shown in 1929 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1930 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1931 * GetDatacenterConnectorRequest request = 1932 * GetDatacenterConnectorRequest.newBuilder() 1933 * .setName( 1934 * DatacenterConnectorName.of( 1935 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 1936 * .toString()) 1937 * .build(); 1938 * DatacenterConnector response = vmMigrationClient.getDatacenterConnector(request); 1939 * } 1940 * }</pre> 1941 * 1942 * @param request The request object containing all of the parameters for the API call. 1943 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1944 */ getDatacenterConnector(GetDatacenterConnectorRequest request)1945 public final DatacenterConnector getDatacenterConnector(GetDatacenterConnectorRequest request) { 1946 return getDatacenterConnectorCallable().call(request); 1947 } 1948 1949 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1950 /** 1951 * Gets details of a single DatacenterConnector. 1952 * 1953 * <p>Sample code: 1954 * 1955 * <pre>{@code 1956 * // This snippet has been automatically generated and should be regarded as a code template only. 1957 * // It will require modifications to work: 1958 * // - It may require correct/in-range values for request initialization. 1959 * // - It may require specifying regional endpoints when creating the service client as shown in 1960 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1961 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1962 * GetDatacenterConnectorRequest request = 1963 * GetDatacenterConnectorRequest.newBuilder() 1964 * .setName( 1965 * DatacenterConnectorName.of( 1966 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 1967 * .toString()) 1968 * .build(); 1969 * ApiFuture<DatacenterConnector> future = 1970 * vmMigrationClient.getDatacenterConnectorCallable().futureCall(request); 1971 * // Do something. 1972 * DatacenterConnector response = future.get(); 1973 * } 1974 * }</pre> 1975 */ 1976 public final UnaryCallable<GetDatacenterConnectorRequest, DatacenterConnector> getDatacenterConnectorCallable()1977 getDatacenterConnectorCallable() { 1978 return stub.getDatacenterConnectorCallable(); 1979 } 1980 1981 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1982 /** 1983 * Creates a new DatacenterConnector in a given Source. 1984 * 1985 * <p>Sample code: 1986 * 1987 * <pre>{@code 1988 * // This snippet has been automatically generated and should be regarded as a code template only. 1989 * // It will require modifications to work: 1990 * // - It may require correct/in-range values for request initialization. 1991 * // - It may require specifying regional endpoints when creating the service client as shown in 1992 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1993 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 1994 * SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 1995 * DatacenterConnector datacenterConnector = DatacenterConnector.newBuilder().build(); 1996 * String datacenterConnectorId = "datacenterConnectorId-761889719"; 1997 * DatacenterConnector response = 1998 * vmMigrationClient 1999 * .createDatacenterConnectorAsync(parent, datacenterConnector, datacenterConnectorId) 2000 * .get(); 2001 * } 2002 * }</pre> 2003 * 2004 * @param parent Required. The DatacenterConnector's parent. Required. The Source in where the new 2005 * DatacenterConnector will be created. For example: 2006 * `projects/my-project/locations/us-central1/sources/my-source` 2007 * @param datacenterConnector Required. The create request body. 2008 * @param datacenterConnectorId Required. The datacenterConnector identifier. 2009 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2010 */ 2011 public final OperationFuture<DatacenterConnector, OperationMetadata> createDatacenterConnectorAsync( SourceName parent, DatacenterConnector datacenterConnector, String datacenterConnectorId)2012 createDatacenterConnectorAsync( 2013 SourceName parent, 2014 DatacenterConnector datacenterConnector, 2015 String datacenterConnectorId) { 2016 CreateDatacenterConnectorRequest request = 2017 CreateDatacenterConnectorRequest.newBuilder() 2018 .setParent(parent == null ? null : parent.toString()) 2019 .setDatacenterConnector(datacenterConnector) 2020 .setDatacenterConnectorId(datacenterConnectorId) 2021 .build(); 2022 return createDatacenterConnectorAsync(request); 2023 } 2024 2025 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2026 /** 2027 * Creates a new DatacenterConnector in a given Source. 2028 * 2029 * <p>Sample code: 2030 * 2031 * <pre>{@code 2032 * // This snippet has been automatically generated and should be regarded as a code template only. 2033 * // It will require modifications to work: 2034 * // - It may require correct/in-range values for request initialization. 2035 * // - It may require specifying regional endpoints when creating the service client as shown in 2036 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2037 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2038 * String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 2039 * DatacenterConnector datacenterConnector = DatacenterConnector.newBuilder().build(); 2040 * String datacenterConnectorId = "datacenterConnectorId-761889719"; 2041 * DatacenterConnector response = 2042 * vmMigrationClient 2043 * .createDatacenterConnectorAsync(parent, datacenterConnector, datacenterConnectorId) 2044 * .get(); 2045 * } 2046 * }</pre> 2047 * 2048 * @param parent Required. The DatacenterConnector's parent. Required. The Source in where the new 2049 * DatacenterConnector will be created. For example: 2050 * `projects/my-project/locations/us-central1/sources/my-source` 2051 * @param datacenterConnector Required. The create request body. 2052 * @param datacenterConnectorId Required. The datacenterConnector identifier. 2053 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2054 */ 2055 public final OperationFuture<DatacenterConnector, OperationMetadata> createDatacenterConnectorAsync( String parent, DatacenterConnector datacenterConnector, String datacenterConnectorId)2056 createDatacenterConnectorAsync( 2057 String parent, DatacenterConnector datacenterConnector, String datacenterConnectorId) { 2058 CreateDatacenterConnectorRequest request = 2059 CreateDatacenterConnectorRequest.newBuilder() 2060 .setParent(parent) 2061 .setDatacenterConnector(datacenterConnector) 2062 .setDatacenterConnectorId(datacenterConnectorId) 2063 .build(); 2064 return createDatacenterConnectorAsync(request); 2065 } 2066 2067 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2068 /** 2069 * Creates a new DatacenterConnector in a given Source. 2070 * 2071 * <p>Sample code: 2072 * 2073 * <pre>{@code 2074 * // This snippet has been automatically generated and should be regarded as a code template only. 2075 * // It will require modifications to work: 2076 * // - It may require correct/in-range values for request initialization. 2077 * // - It may require specifying regional endpoints when creating the service client as shown in 2078 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2079 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2080 * CreateDatacenterConnectorRequest request = 2081 * CreateDatacenterConnectorRequest.newBuilder() 2082 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2083 * .setDatacenterConnectorId("datacenterConnectorId-761889719") 2084 * .setDatacenterConnector(DatacenterConnector.newBuilder().build()) 2085 * .setRequestId("requestId693933066") 2086 * .build(); 2087 * DatacenterConnector response = 2088 * vmMigrationClient.createDatacenterConnectorAsync(request).get(); 2089 * } 2090 * }</pre> 2091 * 2092 * @param request The request object containing all of the parameters for the API call. 2093 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2094 */ 2095 public final OperationFuture<DatacenterConnector, OperationMetadata> createDatacenterConnectorAsync(CreateDatacenterConnectorRequest request)2096 createDatacenterConnectorAsync(CreateDatacenterConnectorRequest request) { 2097 return createDatacenterConnectorOperationCallable().futureCall(request); 2098 } 2099 2100 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2101 /** 2102 * Creates a new DatacenterConnector in a given Source. 2103 * 2104 * <p>Sample code: 2105 * 2106 * <pre>{@code 2107 * // This snippet has been automatically generated and should be regarded as a code template only. 2108 * // It will require modifications to work: 2109 * // - It may require correct/in-range values for request initialization. 2110 * // - It may require specifying regional endpoints when creating the service client as shown in 2111 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2112 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2113 * CreateDatacenterConnectorRequest request = 2114 * CreateDatacenterConnectorRequest.newBuilder() 2115 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2116 * .setDatacenterConnectorId("datacenterConnectorId-761889719") 2117 * .setDatacenterConnector(DatacenterConnector.newBuilder().build()) 2118 * .setRequestId("requestId693933066") 2119 * .build(); 2120 * OperationFuture<DatacenterConnector, OperationMetadata> future = 2121 * vmMigrationClient.createDatacenterConnectorOperationCallable().futureCall(request); 2122 * // Do something. 2123 * DatacenterConnector response = future.get(); 2124 * } 2125 * }</pre> 2126 */ 2127 public final OperationCallable< 2128 CreateDatacenterConnectorRequest, DatacenterConnector, OperationMetadata> createDatacenterConnectorOperationCallable()2129 createDatacenterConnectorOperationCallable() { 2130 return stub.createDatacenterConnectorOperationCallable(); 2131 } 2132 2133 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2134 /** 2135 * Creates a new DatacenterConnector in a given Source. 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 (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2146 * CreateDatacenterConnectorRequest request = 2147 * CreateDatacenterConnectorRequest.newBuilder() 2148 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2149 * .setDatacenterConnectorId("datacenterConnectorId-761889719") 2150 * .setDatacenterConnector(DatacenterConnector.newBuilder().build()) 2151 * .setRequestId("requestId693933066") 2152 * .build(); 2153 * ApiFuture<Operation> future = 2154 * vmMigrationClient.createDatacenterConnectorCallable().futureCall(request); 2155 * // Do something. 2156 * Operation response = future.get(); 2157 * } 2158 * }</pre> 2159 */ 2160 public final UnaryCallable<CreateDatacenterConnectorRequest, Operation> createDatacenterConnectorCallable()2161 createDatacenterConnectorCallable() { 2162 return stub.createDatacenterConnectorCallable(); 2163 } 2164 2165 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2166 /** 2167 * Deletes a single DatacenterConnector. 2168 * 2169 * <p>Sample code: 2170 * 2171 * <pre>{@code 2172 * // This snippet has been automatically generated and should be regarded as a code template only. 2173 * // It will require modifications to work: 2174 * // - It may require correct/in-range values for request initialization. 2175 * // - It may require specifying regional endpoints when creating the service client as shown in 2176 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2177 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2178 * DatacenterConnectorName name = 2179 * DatacenterConnectorName.of( 2180 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]"); 2181 * vmMigrationClient.deleteDatacenterConnectorAsync(name).get(); 2182 * } 2183 * }</pre> 2184 * 2185 * @param name Required. The DatacenterConnector name. 2186 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2187 */ deleteDatacenterConnectorAsync( DatacenterConnectorName name)2188 public final OperationFuture<Empty, OperationMetadata> deleteDatacenterConnectorAsync( 2189 DatacenterConnectorName name) { 2190 DeleteDatacenterConnectorRequest request = 2191 DeleteDatacenterConnectorRequest.newBuilder() 2192 .setName(name == null ? null : name.toString()) 2193 .build(); 2194 return deleteDatacenterConnectorAsync(request); 2195 } 2196 2197 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2198 /** 2199 * Deletes a single DatacenterConnector. 2200 * 2201 * <p>Sample code: 2202 * 2203 * <pre>{@code 2204 * // This snippet has been automatically generated and should be regarded as a code template only. 2205 * // It will require modifications to work: 2206 * // - It may require correct/in-range values for request initialization. 2207 * // - It may require specifying regional endpoints when creating the service client as shown in 2208 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2209 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2210 * String name = 2211 * DatacenterConnectorName.of( 2212 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 2213 * .toString(); 2214 * vmMigrationClient.deleteDatacenterConnectorAsync(name).get(); 2215 * } 2216 * }</pre> 2217 * 2218 * @param name Required. The DatacenterConnector name. 2219 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2220 */ deleteDatacenterConnectorAsync( String name)2221 public final OperationFuture<Empty, OperationMetadata> deleteDatacenterConnectorAsync( 2222 String name) { 2223 DeleteDatacenterConnectorRequest request = 2224 DeleteDatacenterConnectorRequest.newBuilder().setName(name).build(); 2225 return deleteDatacenterConnectorAsync(request); 2226 } 2227 2228 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2229 /** 2230 * Deletes a single DatacenterConnector. 2231 * 2232 * <p>Sample code: 2233 * 2234 * <pre>{@code 2235 * // This snippet has been automatically generated and should be regarded as a code template only. 2236 * // It will require modifications to work: 2237 * // - It may require correct/in-range values for request initialization. 2238 * // - It may require specifying regional endpoints when creating the service client as shown in 2239 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2240 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2241 * DeleteDatacenterConnectorRequest request = 2242 * DeleteDatacenterConnectorRequest.newBuilder() 2243 * .setName( 2244 * DatacenterConnectorName.of( 2245 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 2246 * .toString()) 2247 * .setRequestId("requestId693933066") 2248 * .build(); 2249 * vmMigrationClient.deleteDatacenterConnectorAsync(request).get(); 2250 * } 2251 * }</pre> 2252 * 2253 * @param request The request object containing all of the parameters for the API call. 2254 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2255 */ deleteDatacenterConnectorAsync( DeleteDatacenterConnectorRequest request)2256 public final OperationFuture<Empty, OperationMetadata> deleteDatacenterConnectorAsync( 2257 DeleteDatacenterConnectorRequest request) { 2258 return deleteDatacenterConnectorOperationCallable().futureCall(request); 2259 } 2260 2261 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2262 /** 2263 * Deletes a single DatacenterConnector. 2264 * 2265 * <p>Sample code: 2266 * 2267 * <pre>{@code 2268 * // This snippet has been automatically generated and should be regarded as a code template only. 2269 * // It will require modifications to work: 2270 * // - It may require correct/in-range values for request initialization. 2271 * // - It may require specifying regional endpoints when creating the service client as shown in 2272 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2273 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2274 * DeleteDatacenterConnectorRequest request = 2275 * DeleteDatacenterConnectorRequest.newBuilder() 2276 * .setName( 2277 * DatacenterConnectorName.of( 2278 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 2279 * .toString()) 2280 * .setRequestId("requestId693933066") 2281 * .build(); 2282 * OperationFuture<Empty, OperationMetadata> future = 2283 * vmMigrationClient.deleteDatacenterConnectorOperationCallable().futureCall(request); 2284 * // Do something. 2285 * future.get(); 2286 * } 2287 * }</pre> 2288 */ 2289 public final OperationCallable<DeleteDatacenterConnectorRequest, Empty, OperationMetadata> deleteDatacenterConnectorOperationCallable()2290 deleteDatacenterConnectorOperationCallable() { 2291 return stub.deleteDatacenterConnectorOperationCallable(); 2292 } 2293 2294 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2295 /** 2296 * Deletes a single DatacenterConnector. 2297 * 2298 * <p>Sample code: 2299 * 2300 * <pre>{@code 2301 * // This snippet has been automatically generated and should be regarded as a code template only. 2302 * // It will require modifications to work: 2303 * // - It may require correct/in-range values for request initialization. 2304 * // - It may require specifying regional endpoints when creating the service client as shown in 2305 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2306 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2307 * DeleteDatacenterConnectorRequest request = 2308 * DeleteDatacenterConnectorRequest.newBuilder() 2309 * .setName( 2310 * DatacenterConnectorName.of( 2311 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 2312 * .toString()) 2313 * .setRequestId("requestId693933066") 2314 * .build(); 2315 * ApiFuture<Operation> future = 2316 * vmMigrationClient.deleteDatacenterConnectorCallable().futureCall(request); 2317 * // Do something. 2318 * future.get(); 2319 * } 2320 * }</pre> 2321 */ 2322 public final UnaryCallable<DeleteDatacenterConnectorRequest, Operation> deleteDatacenterConnectorCallable()2323 deleteDatacenterConnectorCallable() { 2324 return stub.deleteDatacenterConnectorCallable(); 2325 } 2326 2327 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2328 /** 2329 * Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version. 2330 * 2331 * <p>Sample code: 2332 * 2333 * <pre>{@code 2334 * // This snippet has been automatically generated and should be regarded as a code template only. 2335 * // It will require modifications to work: 2336 * // - It may require correct/in-range values for request initialization. 2337 * // - It may require specifying regional endpoints when creating the service client as shown in 2338 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2339 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2340 * UpgradeApplianceRequest request = 2341 * UpgradeApplianceRequest.newBuilder() 2342 * .setDatacenterConnector( 2343 * DatacenterConnectorName.of( 2344 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 2345 * .toString()) 2346 * .setRequestId("requestId693933066") 2347 * .build(); 2348 * UpgradeApplianceResponse response = vmMigrationClient.upgradeApplianceAsync(request).get(); 2349 * } 2350 * }</pre> 2351 * 2352 * @param request The request object containing all of the parameters for the API call. 2353 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2354 */ upgradeApplianceAsync( UpgradeApplianceRequest request)2355 public final OperationFuture<UpgradeApplianceResponse, OperationMetadata> upgradeApplianceAsync( 2356 UpgradeApplianceRequest request) { 2357 return upgradeApplianceOperationCallable().futureCall(request); 2358 } 2359 2360 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2361 /** 2362 * Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version. 2363 * 2364 * <p>Sample code: 2365 * 2366 * <pre>{@code 2367 * // This snippet has been automatically generated and should be regarded as a code template only. 2368 * // It will require modifications to work: 2369 * // - It may require correct/in-range values for request initialization. 2370 * // - It may require specifying regional endpoints when creating the service client as shown in 2371 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2372 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2373 * UpgradeApplianceRequest request = 2374 * UpgradeApplianceRequest.newBuilder() 2375 * .setDatacenterConnector( 2376 * DatacenterConnectorName.of( 2377 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 2378 * .toString()) 2379 * .setRequestId("requestId693933066") 2380 * .build(); 2381 * OperationFuture<UpgradeApplianceResponse, OperationMetadata> future = 2382 * vmMigrationClient.upgradeApplianceOperationCallable().futureCall(request); 2383 * // Do something. 2384 * UpgradeApplianceResponse response = future.get(); 2385 * } 2386 * }</pre> 2387 */ 2388 public final OperationCallable< 2389 UpgradeApplianceRequest, UpgradeApplianceResponse, OperationMetadata> upgradeApplianceOperationCallable()2390 upgradeApplianceOperationCallable() { 2391 return stub.upgradeApplianceOperationCallable(); 2392 } 2393 2394 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2395 /** 2396 * Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version. 2397 * 2398 * <p>Sample code: 2399 * 2400 * <pre>{@code 2401 * // This snippet has been automatically generated and should be regarded as a code template only. 2402 * // It will require modifications to work: 2403 * // - It may require correct/in-range values for request initialization. 2404 * // - It may require specifying regional endpoints when creating the service client as shown in 2405 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2406 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2407 * UpgradeApplianceRequest request = 2408 * UpgradeApplianceRequest.newBuilder() 2409 * .setDatacenterConnector( 2410 * DatacenterConnectorName.of( 2411 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]") 2412 * .toString()) 2413 * .setRequestId("requestId693933066") 2414 * .build(); 2415 * ApiFuture<Operation> future = 2416 * vmMigrationClient.upgradeApplianceCallable().futureCall(request); 2417 * // Do something. 2418 * Operation response = future.get(); 2419 * } 2420 * }</pre> 2421 */ upgradeApplianceCallable()2422 public final UnaryCallable<UpgradeApplianceRequest, Operation> upgradeApplianceCallable() { 2423 return stub.upgradeApplianceCallable(); 2424 } 2425 2426 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2427 /** 2428 * Creates a new MigratingVm in a given Source. 2429 * 2430 * <p>Sample code: 2431 * 2432 * <pre>{@code 2433 * // This snippet has been automatically generated and should be regarded as a code template only. 2434 * // It will require modifications to work: 2435 * // - It may require correct/in-range values for request initialization. 2436 * // - It may require specifying regional endpoints when creating the service client as shown in 2437 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2438 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2439 * SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 2440 * MigratingVm migratingVm = MigratingVm.newBuilder().build(); 2441 * String migratingVmId = "migratingVmId441244154"; 2442 * MigratingVm response = 2443 * vmMigrationClient.createMigratingVmAsync(parent, migratingVm, migratingVmId).get(); 2444 * } 2445 * }</pre> 2446 * 2447 * @param parent Required. The MigratingVm's parent. 2448 * @param migratingVm Required. The create request body. 2449 * @param migratingVmId Required. The migratingVm identifier. 2450 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2451 */ createMigratingVmAsync( SourceName parent, MigratingVm migratingVm, String migratingVmId)2452 public final OperationFuture<MigratingVm, OperationMetadata> createMigratingVmAsync( 2453 SourceName parent, MigratingVm migratingVm, String migratingVmId) { 2454 CreateMigratingVmRequest request = 2455 CreateMigratingVmRequest.newBuilder() 2456 .setParent(parent == null ? null : parent.toString()) 2457 .setMigratingVm(migratingVm) 2458 .setMigratingVmId(migratingVmId) 2459 .build(); 2460 return createMigratingVmAsync(request); 2461 } 2462 2463 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2464 /** 2465 * Creates a new MigratingVm in a given Source. 2466 * 2467 * <p>Sample code: 2468 * 2469 * <pre>{@code 2470 * // This snippet has been automatically generated and should be regarded as a code template only. 2471 * // It will require modifications to work: 2472 * // - It may require correct/in-range values for request initialization. 2473 * // - It may require specifying regional endpoints when creating the service client as shown in 2474 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2475 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2476 * String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 2477 * MigratingVm migratingVm = MigratingVm.newBuilder().build(); 2478 * String migratingVmId = "migratingVmId441244154"; 2479 * MigratingVm response = 2480 * vmMigrationClient.createMigratingVmAsync(parent, migratingVm, migratingVmId).get(); 2481 * } 2482 * }</pre> 2483 * 2484 * @param parent Required. The MigratingVm's parent. 2485 * @param migratingVm Required. The create request body. 2486 * @param migratingVmId Required. The migratingVm identifier. 2487 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2488 */ createMigratingVmAsync( String parent, MigratingVm migratingVm, String migratingVmId)2489 public final OperationFuture<MigratingVm, OperationMetadata> createMigratingVmAsync( 2490 String parent, MigratingVm migratingVm, String migratingVmId) { 2491 CreateMigratingVmRequest request = 2492 CreateMigratingVmRequest.newBuilder() 2493 .setParent(parent) 2494 .setMigratingVm(migratingVm) 2495 .setMigratingVmId(migratingVmId) 2496 .build(); 2497 return createMigratingVmAsync(request); 2498 } 2499 2500 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2501 /** 2502 * Creates a new MigratingVm in a given Source. 2503 * 2504 * <p>Sample code: 2505 * 2506 * <pre>{@code 2507 * // This snippet has been automatically generated and should be regarded as a code template only. 2508 * // It will require modifications to work: 2509 * // - It may require correct/in-range values for request initialization. 2510 * // - It may require specifying regional endpoints when creating the service client as shown in 2511 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2512 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2513 * CreateMigratingVmRequest request = 2514 * CreateMigratingVmRequest.newBuilder() 2515 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2516 * .setMigratingVmId("migratingVmId441244154") 2517 * .setMigratingVm(MigratingVm.newBuilder().build()) 2518 * .setRequestId("requestId693933066") 2519 * .build(); 2520 * MigratingVm response = vmMigrationClient.createMigratingVmAsync(request).get(); 2521 * } 2522 * }</pre> 2523 * 2524 * @param request The request object containing all of the parameters for the API call. 2525 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2526 */ createMigratingVmAsync( CreateMigratingVmRequest request)2527 public final OperationFuture<MigratingVm, OperationMetadata> createMigratingVmAsync( 2528 CreateMigratingVmRequest request) { 2529 return createMigratingVmOperationCallable().futureCall(request); 2530 } 2531 2532 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2533 /** 2534 * Creates a new MigratingVm in a given Source. 2535 * 2536 * <p>Sample code: 2537 * 2538 * <pre>{@code 2539 * // This snippet has been automatically generated and should be regarded as a code template only. 2540 * // It will require modifications to work: 2541 * // - It may require correct/in-range values for request initialization. 2542 * // - It may require specifying regional endpoints when creating the service client as shown in 2543 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2544 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2545 * CreateMigratingVmRequest request = 2546 * CreateMigratingVmRequest.newBuilder() 2547 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2548 * .setMigratingVmId("migratingVmId441244154") 2549 * .setMigratingVm(MigratingVm.newBuilder().build()) 2550 * .setRequestId("requestId693933066") 2551 * .build(); 2552 * OperationFuture<MigratingVm, OperationMetadata> future = 2553 * vmMigrationClient.createMigratingVmOperationCallable().futureCall(request); 2554 * // Do something. 2555 * MigratingVm response = future.get(); 2556 * } 2557 * }</pre> 2558 */ 2559 public final OperationCallable<CreateMigratingVmRequest, MigratingVm, OperationMetadata> createMigratingVmOperationCallable()2560 createMigratingVmOperationCallable() { 2561 return stub.createMigratingVmOperationCallable(); 2562 } 2563 2564 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2565 /** 2566 * Creates a new MigratingVm in a given Source. 2567 * 2568 * <p>Sample code: 2569 * 2570 * <pre>{@code 2571 * // This snippet has been automatically generated and should be regarded as a code template only. 2572 * // It will require modifications to work: 2573 * // - It may require correct/in-range values for request initialization. 2574 * // - It may require specifying regional endpoints when creating the service client as shown in 2575 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2576 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2577 * CreateMigratingVmRequest request = 2578 * CreateMigratingVmRequest.newBuilder() 2579 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2580 * .setMigratingVmId("migratingVmId441244154") 2581 * .setMigratingVm(MigratingVm.newBuilder().build()) 2582 * .setRequestId("requestId693933066") 2583 * .build(); 2584 * ApiFuture<Operation> future = 2585 * vmMigrationClient.createMigratingVmCallable().futureCall(request); 2586 * // Do something. 2587 * Operation response = future.get(); 2588 * } 2589 * }</pre> 2590 */ createMigratingVmCallable()2591 public final UnaryCallable<CreateMigratingVmRequest, Operation> createMigratingVmCallable() { 2592 return stub.createMigratingVmCallable(); 2593 } 2594 2595 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2596 /** 2597 * Lists MigratingVms in a given Source. 2598 * 2599 * <p>Sample code: 2600 * 2601 * <pre>{@code 2602 * // This snippet has been automatically generated and should be regarded as a code template only. 2603 * // It will require modifications to work: 2604 * // - It may require correct/in-range values for request initialization. 2605 * // - It may require specifying regional endpoints when creating the service client as shown in 2606 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2607 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2608 * SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); 2609 * for (MigratingVm element : vmMigrationClient.listMigratingVms(parent).iterateAll()) { 2610 * // doThingsWith(element); 2611 * } 2612 * } 2613 * }</pre> 2614 * 2615 * @param parent Required. The parent, which owns this collection of MigratingVms. 2616 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2617 */ listMigratingVms(SourceName parent)2618 public final ListMigratingVmsPagedResponse listMigratingVms(SourceName parent) { 2619 ListMigratingVmsRequest request = 2620 ListMigratingVmsRequest.newBuilder() 2621 .setParent(parent == null ? null : parent.toString()) 2622 .build(); 2623 return listMigratingVms(request); 2624 } 2625 2626 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2627 /** 2628 * Lists MigratingVms in a given Source. 2629 * 2630 * <p>Sample code: 2631 * 2632 * <pre>{@code 2633 * // This snippet has been automatically generated and should be regarded as a code template only. 2634 * // It will require modifications to work: 2635 * // - It may require correct/in-range values for request initialization. 2636 * // - It may require specifying regional endpoints when creating the service client as shown in 2637 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2638 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2639 * String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); 2640 * for (MigratingVm element : vmMigrationClient.listMigratingVms(parent).iterateAll()) { 2641 * // doThingsWith(element); 2642 * } 2643 * } 2644 * }</pre> 2645 * 2646 * @param parent Required. The parent, which owns this collection of MigratingVms. 2647 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2648 */ listMigratingVms(String parent)2649 public final ListMigratingVmsPagedResponse listMigratingVms(String parent) { 2650 ListMigratingVmsRequest request = 2651 ListMigratingVmsRequest.newBuilder().setParent(parent).build(); 2652 return listMigratingVms(request); 2653 } 2654 2655 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2656 /** 2657 * Lists MigratingVms in a given Source. 2658 * 2659 * <p>Sample code: 2660 * 2661 * <pre>{@code 2662 * // This snippet has been automatically generated and should be regarded as a code template only. 2663 * // It will require modifications to work: 2664 * // - It may require correct/in-range values for request initialization. 2665 * // - It may require specifying regional endpoints when creating the service client as shown in 2666 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2667 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2668 * ListMigratingVmsRequest request = 2669 * ListMigratingVmsRequest.newBuilder() 2670 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2671 * .setPageSize(883849137) 2672 * .setPageToken("pageToken873572522") 2673 * .setFilter("filter-1274492040") 2674 * .setOrderBy("orderBy-1207110587") 2675 * .setView(MigratingVmView.forNumber(0)) 2676 * .build(); 2677 * for (MigratingVm element : vmMigrationClient.listMigratingVms(request).iterateAll()) { 2678 * // doThingsWith(element); 2679 * } 2680 * } 2681 * }</pre> 2682 * 2683 * @param request The request object containing all of the parameters for the API call. 2684 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2685 */ listMigratingVms(ListMigratingVmsRequest request)2686 public final ListMigratingVmsPagedResponse listMigratingVms(ListMigratingVmsRequest request) { 2687 return listMigratingVmsPagedCallable().call(request); 2688 } 2689 2690 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2691 /** 2692 * Lists MigratingVms in a given Source. 2693 * 2694 * <p>Sample code: 2695 * 2696 * <pre>{@code 2697 * // This snippet has been automatically generated and should be regarded as a code template only. 2698 * // It will require modifications to work: 2699 * // - It may require correct/in-range values for request initialization. 2700 * // - It may require specifying regional endpoints when creating the service client as shown in 2701 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2702 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2703 * ListMigratingVmsRequest request = 2704 * ListMigratingVmsRequest.newBuilder() 2705 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2706 * .setPageSize(883849137) 2707 * .setPageToken("pageToken873572522") 2708 * .setFilter("filter-1274492040") 2709 * .setOrderBy("orderBy-1207110587") 2710 * .setView(MigratingVmView.forNumber(0)) 2711 * .build(); 2712 * ApiFuture<MigratingVm> future = 2713 * vmMigrationClient.listMigratingVmsPagedCallable().futureCall(request); 2714 * // Do something. 2715 * for (MigratingVm element : future.get().iterateAll()) { 2716 * // doThingsWith(element); 2717 * } 2718 * } 2719 * }</pre> 2720 */ 2721 public final UnaryCallable<ListMigratingVmsRequest, ListMigratingVmsPagedResponse> listMigratingVmsPagedCallable()2722 listMigratingVmsPagedCallable() { 2723 return stub.listMigratingVmsPagedCallable(); 2724 } 2725 2726 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2727 /** 2728 * Lists MigratingVms in a given Source. 2729 * 2730 * <p>Sample code: 2731 * 2732 * <pre>{@code 2733 * // This snippet has been automatically generated and should be regarded as a code template only. 2734 * // It will require modifications to work: 2735 * // - It may require correct/in-range values for request initialization. 2736 * // - It may require specifying regional endpoints when creating the service client as shown in 2737 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2738 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2739 * ListMigratingVmsRequest request = 2740 * ListMigratingVmsRequest.newBuilder() 2741 * .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) 2742 * .setPageSize(883849137) 2743 * .setPageToken("pageToken873572522") 2744 * .setFilter("filter-1274492040") 2745 * .setOrderBy("orderBy-1207110587") 2746 * .setView(MigratingVmView.forNumber(0)) 2747 * .build(); 2748 * while (true) { 2749 * ListMigratingVmsResponse response = 2750 * vmMigrationClient.listMigratingVmsCallable().call(request); 2751 * for (MigratingVm element : response.getMigratingVmsList()) { 2752 * // doThingsWith(element); 2753 * } 2754 * String nextPageToken = response.getNextPageToken(); 2755 * if (!Strings.isNullOrEmpty(nextPageToken)) { 2756 * request = request.toBuilder().setPageToken(nextPageToken).build(); 2757 * } else { 2758 * break; 2759 * } 2760 * } 2761 * } 2762 * }</pre> 2763 */ 2764 public final UnaryCallable<ListMigratingVmsRequest, ListMigratingVmsResponse> listMigratingVmsCallable()2765 listMigratingVmsCallable() { 2766 return stub.listMigratingVmsCallable(); 2767 } 2768 2769 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2770 /** 2771 * Gets details of a single MigratingVm. 2772 * 2773 * <p>Sample code: 2774 * 2775 * <pre>{@code 2776 * // This snippet has been automatically generated and should be regarded as a code template only. 2777 * // It will require modifications to work: 2778 * // - It may require correct/in-range values for request initialization. 2779 * // - It may require specifying regional endpoints when creating the service client as shown in 2780 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2781 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2782 * MigratingVmName name = 2783 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 2784 * MigratingVm response = vmMigrationClient.getMigratingVm(name); 2785 * } 2786 * }</pre> 2787 * 2788 * @param name Required. The name of the MigratingVm. 2789 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2790 */ getMigratingVm(MigratingVmName name)2791 public final MigratingVm getMigratingVm(MigratingVmName name) { 2792 GetMigratingVmRequest request = 2793 GetMigratingVmRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2794 return getMigratingVm(request); 2795 } 2796 2797 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2798 /** 2799 * Gets details of a single MigratingVm. 2800 * 2801 * <p>Sample code: 2802 * 2803 * <pre>{@code 2804 * // This snippet has been automatically generated and should be regarded as a code template only. 2805 * // It will require modifications to work: 2806 * // - It may require correct/in-range values for request initialization. 2807 * // - It may require specifying regional endpoints when creating the service client as shown in 2808 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2809 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2810 * String name = 2811 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 2812 * MigratingVm response = vmMigrationClient.getMigratingVm(name); 2813 * } 2814 * }</pre> 2815 * 2816 * @param name Required. The name of the MigratingVm. 2817 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2818 */ getMigratingVm(String name)2819 public final MigratingVm getMigratingVm(String name) { 2820 GetMigratingVmRequest request = GetMigratingVmRequest.newBuilder().setName(name).build(); 2821 return getMigratingVm(request); 2822 } 2823 2824 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2825 /** 2826 * Gets details of a single MigratingVm. 2827 * 2828 * <p>Sample code: 2829 * 2830 * <pre>{@code 2831 * // This snippet has been automatically generated and should be regarded as a code template only. 2832 * // It will require modifications to work: 2833 * // - It may require correct/in-range values for request initialization. 2834 * // - It may require specifying regional endpoints when creating the service client as shown in 2835 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2836 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2837 * GetMigratingVmRequest request = 2838 * GetMigratingVmRequest.newBuilder() 2839 * .setName( 2840 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 2841 * .toString()) 2842 * .setView(MigratingVmView.forNumber(0)) 2843 * .build(); 2844 * MigratingVm response = vmMigrationClient.getMigratingVm(request); 2845 * } 2846 * }</pre> 2847 * 2848 * @param request The request object containing all of the parameters for the API call. 2849 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2850 */ getMigratingVm(GetMigratingVmRequest request)2851 public final MigratingVm getMigratingVm(GetMigratingVmRequest request) { 2852 return getMigratingVmCallable().call(request); 2853 } 2854 2855 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2856 /** 2857 * Gets details of a single MigratingVm. 2858 * 2859 * <p>Sample code: 2860 * 2861 * <pre>{@code 2862 * // This snippet has been automatically generated and should be regarded as a code template only. 2863 * // It will require modifications to work: 2864 * // - It may require correct/in-range values for request initialization. 2865 * // - It may require specifying regional endpoints when creating the service client as shown in 2866 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2867 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2868 * GetMigratingVmRequest request = 2869 * GetMigratingVmRequest.newBuilder() 2870 * .setName( 2871 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 2872 * .toString()) 2873 * .setView(MigratingVmView.forNumber(0)) 2874 * .build(); 2875 * ApiFuture<MigratingVm> future = 2876 * vmMigrationClient.getMigratingVmCallable().futureCall(request); 2877 * // Do something. 2878 * MigratingVm response = future.get(); 2879 * } 2880 * }</pre> 2881 */ getMigratingVmCallable()2882 public final UnaryCallable<GetMigratingVmRequest, MigratingVm> getMigratingVmCallable() { 2883 return stub.getMigratingVmCallable(); 2884 } 2885 2886 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2887 /** 2888 * Updates the parameters of a single MigratingVm. 2889 * 2890 * <p>Sample code: 2891 * 2892 * <pre>{@code 2893 * // This snippet has been automatically generated and should be regarded as a code template only. 2894 * // It will require modifications to work: 2895 * // - It may require correct/in-range values for request initialization. 2896 * // - It may require specifying regional endpoints when creating the service client as shown in 2897 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2898 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2899 * MigratingVm migratingVm = MigratingVm.newBuilder().build(); 2900 * FieldMask updateMask = FieldMask.newBuilder().build(); 2901 * MigratingVm response = 2902 * vmMigrationClient.updateMigratingVmAsync(migratingVm, updateMask).get(); 2903 * } 2904 * }</pre> 2905 * 2906 * @param migratingVm Required. The update request body. 2907 * @param updateMask Field mask is used to specify the fields to be overwritten in the MigratingVm 2908 * resource by the update. The fields specified in the update_mask are relative to the 2909 * resource, not the full request. A field will be overwritten if it is in the mask. If the 2910 * user does not provide a mask then all fields will be overwritten. 2911 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2912 */ updateMigratingVmAsync( MigratingVm migratingVm, FieldMask updateMask)2913 public final OperationFuture<MigratingVm, OperationMetadata> updateMigratingVmAsync( 2914 MigratingVm migratingVm, FieldMask updateMask) { 2915 UpdateMigratingVmRequest request = 2916 UpdateMigratingVmRequest.newBuilder() 2917 .setMigratingVm(migratingVm) 2918 .setUpdateMask(updateMask) 2919 .build(); 2920 return updateMigratingVmAsync(request); 2921 } 2922 2923 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2924 /** 2925 * Updates the parameters of a single MigratingVm. 2926 * 2927 * <p>Sample code: 2928 * 2929 * <pre>{@code 2930 * // This snippet has been automatically generated and should be regarded as a code template only. 2931 * // It will require modifications to work: 2932 * // - It may require correct/in-range values for request initialization. 2933 * // - It may require specifying regional endpoints when creating the service client as shown in 2934 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2935 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2936 * UpdateMigratingVmRequest request = 2937 * UpdateMigratingVmRequest.newBuilder() 2938 * .setUpdateMask(FieldMask.newBuilder().build()) 2939 * .setMigratingVm(MigratingVm.newBuilder().build()) 2940 * .setRequestId("requestId693933066") 2941 * .build(); 2942 * MigratingVm response = vmMigrationClient.updateMigratingVmAsync(request).get(); 2943 * } 2944 * }</pre> 2945 * 2946 * @param request The request object containing all of the parameters for the API call. 2947 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2948 */ updateMigratingVmAsync( UpdateMigratingVmRequest request)2949 public final OperationFuture<MigratingVm, OperationMetadata> updateMigratingVmAsync( 2950 UpdateMigratingVmRequest request) { 2951 return updateMigratingVmOperationCallable().futureCall(request); 2952 } 2953 2954 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2955 /** 2956 * Updates the parameters of a single MigratingVm. 2957 * 2958 * <p>Sample code: 2959 * 2960 * <pre>{@code 2961 * // This snippet has been automatically generated and should be regarded as a code template only. 2962 * // It will require modifications to work: 2963 * // - It may require correct/in-range values for request initialization. 2964 * // - It may require specifying regional endpoints when creating the service client as shown in 2965 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2966 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2967 * UpdateMigratingVmRequest request = 2968 * UpdateMigratingVmRequest.newBuilder() 2969 * .setUpdateMask(FieldMask.newBuilder().build()) 2970 * .setMigratingVm(MigratingVm.newBuilder().build()) 2971 * .setRequestId("requestId693933066") 2972 * .build(); 2973 * OperationFuture<MigratingVm, OperationMetadata> future = 2974 * vmMigrationClient.updateMigratingVmOperationCallable().futureCall(request); 2975 * // Do something. 2976 * MigratingVm response = future.get(); 2977 * } 2978 * }</pre> 2979 */ 2980 public final OperationCallable<UpdateMigratingVmRequest, MigratingVm, OperationMetadata> updateMigratingVmOperationCallable()2981 updateMigratingVmOperationCallable() { 2982 return stub.updateMigratingVmOperationCallable(); 2983 } 2984 2985 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2986 /** 2987 * Updates the parameters of a single MigratingVm. 2988 * 2989 * <p>Sample code: 2990 * 2991 * <pre>{@code 2992 * // This snippet has been automatically generated and should be regarded as a code template only. 2993 * // It will require modifications to work: 2994 * // - It may require correct/in-range values for request initialization. 2995 * // - It may require specifying regional endpoints when creating the service client as shown in 2996 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2997 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 2998 * UpdateMigratingVmRequest request = 2999 * UpdateMigratingVmRequest.newBuilder() 3000 * .setUpdateMask(FieldMask.newBuilder().build()) 3001 * .setMigratingVm(MigratingVm.newBuilder().build()) 3002 * .setRequestId("requestId693933066") 3003 * .build(); 3004 * ApiFuture<Operation> future = 3005 * vmMigrationClient.updateMigratingVmCallable().futureCall(request); 3006 * // Do something. 3007 * Operation response = future.get(); 3008 * } 3009 * }</pre> 3010 */ updateMigratingVmCallable()3011 public final UnaryCallable<UpdateMigratingVmRequest, Operation> updateMigratingVmCallable() { 3012 return stub.updateMigratingVmCallable(); 3013 } 3014 3015 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3016 /** 3017 * Deletes a single MigratingVm. 3018 * 3019 * <p>Sample code: 3020 * 3021 * <pre>{@code 3022 * // This snippet has been automatically generated and should be regarded as a code template only. 3023 * // It will require modifications to work: 3024 * // - It may require correct/in-range values for request initialization. 3025 * // - It may require specifying regional endpoints when creating the service client as shown in 3026 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3027 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3028 * MigratingVmName name = 3029 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 3030 * vmMigrationClient.deleteMigratingVmAsync(name).get(); 3031 * } 3032 * }</pre> 3033 * 3034 * @param name Required. The name of the MigratingVm. 3035 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3036 */ deleteMigratingVmAsync( MigratingVmName name)3037 public final OperationFuture<Empty, OperationMetadata> deleteMigratingVmAsync( 3038 MigratingVmName name) { 3039 DeleteMigratingVmRequest request = 3040 DeleteMigratingVmRequest.newBuilder() 3041 .setName(name == null ? null : name.toString()) 3042 .build(); 3043 return deleteMigratingVmAsync(request); 3044 } 3045 3046 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3047 /** 3048 * Deletes a single MigratingVm. 3049 * 3050 * <p>Sample code: 3051 * 3052 * <pre>{@code 3053 * // This snippet has been automatically generated and should be regarded as a code template only. 3054 * // It will require modifications to work: 3055 * // - It may require correct/in-range values for request initialization. 3056 * // - It may require specifying regional endpoints when creating the service client as shown in 3057 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3058 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3059 * String name = 3060 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 3061 * vmMigrationClient.deleteMigratingVmAsync(name).get(); 3062 * } 3063 * }</pre> 3064 * 3065 * @param name Required. The name of the MigratingVm. 3066 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3067 */ deleteMigratingVmAsync(String name)3068 public final OperationFuture<Empty, OperationMetadata> deleteMigratingVmAsync(String name) { 3069 DeleteMigratingVmRequest request = DeleteMigratingVmRequest.newBuilder().setName(name).build(); 3070 return deleteMigratingVmAsync(request); 3071 } 3072 3073 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3074 /** 3075 * Deletes a single MigratingVm. 3076 * 3077 * <p>Sample code: 3078 * 3079 * <pre>{@code 3080 * // This snippet has been automatically generated and should be regarded as a code template only. 3081 * // It will require modifications to work: 3082 * // - It may require correct/in-range values for request initialization. 3083 * // - It may require specifying regional endpoints when creating the service client as shown in 3084 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3085 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3086 * DeleteMigratingVmRequest request = 3087 * DeleteMigratingVmRequest.newBuilder() 3088 * .setName( 3089 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3090 * .toString()) 3091 * .build(); 3092 * vmMigrationClient.deleteMigratingVmAsync(request).get(); 3093 * } 3094 * }</pre> 3095 * 3096 * @param request The request object containing all of the parameters for the API call. 3097 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3098 */ deleteMigratingVmAsync( DeleteMigratingVmRequest request)3099 public final OperationFuture<Empty, OperationMetadata> deleteMigratingVmAsync( 3100 DeleteMigratingVmRequest request) { 3101 return deleteMigratingVmOperationCallable().futureCall(request); 3102 } 3103 3104 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3105 /** 3106 * Deletes a single MigratingVm. 3107 * 3108 * <p>Sample code: 3109 * 3110 * <pre>{@code 3111 * // This snippet has been automatically generated and should be regarded as a code template only. 3112 * // It will require modifications to work: 3113 * // - It may require correct/in-range values for request initialization. 3114 * // - It may require specifying regional endpoints when creating the service client as shown in 3115 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3116 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3117 * DeleteMigratingVmRequest request = 3118 * DeleteMigratingVmRequest.newBuilder() 3119 * .setName( 3120 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3121 * .toString()) 3122 * .build(); 3123 * OperationFuture<Empty, OperationMetadata> future = 3124 * vmMigrationClient.deleteMigratingVmOperationCallable().futureCall(request); 3125 * // Do something. 3126 * future.get(); 3127 * } 3128 * }</pre> 3129 */ 3130 public final OperationCallable<DeleteMigratingVmRequest, Empty, OperationMetadata> deleteMigratingVmOperationCallable()3131 deleteMigratingVmOperationCallable() { 3132 return stub.deleteMigratingVmOperationCallable(); 3133 } 3134 3135 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3136 /** 3137 * Deletes a single MigratingVm. 3138 * 3139 * <p>Sample code: 3140 * 3141 * <pre>{@code 3142 * // This snippet has been automatically generated and should be regarded as a code template only. 3143 * // It will require modifications to work: 3144 * // - It may require correct/in-range values for request initialization. 3145 * // - It may require specifying regional endpoints when creating the service client as shown in 3146 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3147 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3148 * DeleteMigratingVmRequest request = 3149 * DeleteMigratingVmRequest.newBuilder() 3150 * .setName( 3151 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3152 * .toString()) 3153 * .build(); 3154 * ApiFuture<Operation> future = 3155 * vmMigrationClient.deleteMigratingVmCallable().futureCall(request); 3156 * // Do something. 3157 * future.get(); 3158 * } 3159 * }</pre> 3160 */ deleteMigratingVmCallable()3161 public final UnaryCallable<DeleteMigratingVmRequest, Operation> deleteMigratingVmCallable() { 3162 return stub.deleteMigratingVmCallable(); 3163 } 3164 3165 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3166 /** 3167 * Starts migration for a VM. Starts the process of uploading data and creating snapshots, in 3168 * replication cycles scheduled by the policy. 3169 * 3170 * <p>Sample code: 3171 * 3172 * <pre>{@code 3173 * // This snippet has been automatically generated and should be regarded as a code template only. 3174 * // It will require modifications to work: 3175 * // - It may require correct/in-range values for request initialization. 3176 * // - It may require specifying regional endpoints when creating the service client as shown in 3177 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3178 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3179 * MigratingVmName migratingVm = 3180 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 3181 * StartMigrationResponse response = vmMigrationClient.startMigrationAsync(migratingVm).get(); 3182 * } 3183 * }</pre> 3184 * 3185 * @param migratingVm Required. The name of the MigratingVm. 3186 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3187 */ startMigrationAsync( MigratingVmName migratingVm)3188 public final OperationFuture<StartMigrationResponse, OperationMetadata> startMigrationAsync( 3189 MigratingVmName migratingVm) { 3190 StartMigrationRequest request = 3191 StartMigrationRequest.newBuilder() 3192 .setMigratingVm(migratingVm == null ? null : migratingVm.toString()) 3193 .build(); 3194 return startMigrationAsync(request); 3195 } 3196 3197 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3198 /** 3199 * Starts migration for a VM. Starts the process of uploading data and creating snapshots, in 3200 * replication cycles scheduled by the policy. 3201 * 3202 * <p>Sample code: 3203 * 3204 * <pre>{@code 3205 * // This snippet has been automatically generated and should be regarded as a code template only. 3206 * // It will require modifications to work: 3207 * // - It may require correct/in-range values for request initialization. 3208 * // - It may require specifying regional endpoints when creating the service client as shown in 3209 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3210 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3211 * String migratingVm = 3212 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 3213 * StartMigrationResponse response = vmMigrationClient.startMigrationAsync(migratingVm).get(); 3214 * } 3215 * }</pre> 3216 * 3217 * @param migratingVm Required. The name of the MigratingVm. 3218 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3219 */ startMigrationAsync( String migratingVm)3220 public final OperationFuture<StartMigrationResponse, OperationMetadata> startMigrationAsync( 3221 String migratingVm) { 3222 StartMigrationRequest request = 3223 StartMigrationRequest.newBuilder().setMigratingVm(migratingVm).build(); 3224 return startMigrationAsync(request); 3225 } 3226 3227 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3228 /** 3229 * Starts migration for a VM. Starts the process of uploading data and creating snapshots, in 3230 * replication cycles scheduled by the policy. 3231 * 3232 * <p>Sample code: 3233 * 3234 * <pre>{@code 3235 * // This snippet has been automatically generated and should be regarded as a code template only. 3236 * // It will require modifications to work: 3237 * // - It may require correct/in-range values for request initialization. 3238 * // - It may require specifying regional endpoints when creating the service client as shown in 3239 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3240 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3241 * StartMigrationRequest request = 3242 * StartMigrationRequest.newBuilder() 3243 * .setMigratingVm( 3244 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3245 * .toString()) 3246 * .build(); 3247 * StartMigrationResponse response = vmMigrationClient.startMigrationAsync(request).get(); 3248 * } 3249 * }</pre> 3250 * 3251 * @param request The request object containing all of the parameters for the API call. 3252 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3253 */ startMigrationAsync( StartMigrationRequest request)3254 public final OperationFuture<StartMigrationResponse, OperationMetadata> startMigrationAsync( 3255 StartMigrationRequest request) { 3256 return startMigrationOperationCallable().futureCall(request); 3257 } 3258 3259 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3260 /** 3261 * Starts migration for a VM. Starts the process of uploading data and creating snapshots, in 3262 * replication cycles scheduled by the policy. 3263 * 3264 * <p>Sample code: 3265 * 3266 * <pre>{@code 3267 * // This snippet has been automatically generated and should be regarded as a code template only. 3268 * // It will require modifications to work: 3269 * // - It may require correct/in-range values for request initialization. 3270 * // - It may require specifying regional endpoints when creating the service client as shown in 3271 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3272 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3273 * StartMigrationRequest request = 3274 * StartMigrationRequest.newBuilder() 3275 * .setMigratingVm( 3276 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3277 * .toString()) 3278 * .build(); 3279 * OperationFuture<StartMigrationResponse, OperationMetadata> future = 3280 * vmMigrationClient.startMigrationOperationCallable().futureCall(request); 3281 * // Do something. 3282 * StartMigrationResponse response = future.get(); 3283 * } 3284 * }</pre> 3285 */ 3286 public final OperationCallable<StartMigrationRequest, StartMigrationResponse, OperationMetadata> startMigrationOperationCallable()3287 startMigrationOperationCallable() { 3288 return stub.startMigrationOperationCallable(); 3289 } 3290 3291 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3292 /** 3293 * Starts migration for a VM. Starts the process of uploading data and creating snapshots, in 3294 * replication cycles scheduled by the policy. 3295 * 3296 * <p>Sample code: 3297 * 3298 * <pre>{@code 3299 * // This snippet has been automatically generated and should be regarded as a code template only. 3300 * // It will require modifications to work: 3301 * // - It may require correct/in-range values for request initialization. 3302 * // - It may require specifying regional endpoints when creating the service client as shown in 3303 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3304 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3305 * StartMigrationRequest request = 3306 * StartMigrationRequest.newBuilder() 3307 * .setMigratingVm( 3308 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3309 * .toString()) 3310 * .build(); 3311 * ApiFuture<Operation> future = vmMigrationClient.startMigrationCallable().futureCall(request); 3312 * // Do something. 3313 * Operation response = future.get(); 3314 * } 3315 * }</pre> 3316 */ startMigrationCallable()3317 public final UnaryCallable<StartMigrationRequest, Operation> startMigrationCallable() { 3318 return stub.startMigrationCallable(); 3319 } 3320 3321 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3322 /** 3323 * Resumes a migration for a VM. When called on a paused migration, will start the process of 3324 * uploading data and creating snapshots; when called on a completed cut-over migration, will 3325 * update the migration to active state and start the process of uploading data and creating 3326 * snapshots. 3327 * 3328 * <p>Sample code: 3329 * 3330 * <pre>{@code 3331 * // This snippet has been automatically generated and should be regarded as a code template only. 3332 * // It will require modifications to work: 3333 * // - It may require correct/in-range values for request initialization. 3334 * // - It may require specifying regional endpoints when creating the service client as shown in 3335 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3336 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3337 * ResumeMigrationRequest request = 3338 * ResumeMigrationRequest.newBuilder() 3339 * .setMigratingVm( 3340 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3341 * .toString()) 3342 * .build(); 3343 * ResumeMigrationResponse response = vmMigrationClient.resumeMigrationAsync(request).get(); 3344 * } 3345 * }</pre> 3346 * 3347 * @param request The request object containing all of the parameters for the API call. 3348 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3349 */ resumeMigrationAsync( ResumeMigrationRequest request)3350 public final OperationFuture<ResumeMigrationResponse, OperationMetadata> resumeMigrationAsync( 3351 ResumeMigrationRequest request) { 3352 return resumeMigrationOperationCallable().futureCall(request); 3353 } 3354 3355 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3356 /** 3357 * Resumes a migration for a VM. When called on a paused migration, will start the process of 3358 * uploading data and creating snapshots; when called on a completed cut-over migration, will 3359 * update the migration to active state and start the process of uploading data and creating 3360 * snapshots. 3361 * 3362 * <p>Sample code: 3363 * 3364 * <pre>{@code 3365 * // This snippet has been automatically generated and should be regarded as a code template only. 3366 * // It will require modifications to work: 3367 * // - It may require correct/in-range values for request initialization. 3368 * // - It may require specifying regional endpoints when creating the service client as shown in 3369 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3370 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3371 * ResumeMigrationRequest request = 3372 * ResumeMigrationRequest.newBuilder() 3373 * .setMigratingVm( 3374 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3375 * .toString()) 3376 * .build(); 3377 * OperationFuture<ResumeMigrationResponse, OperationMetadata> future = 3378 * vmMigrationClient.resumeMigrationOperationCallable().futureCall(request); 3379 * // Do something. 3380 * ResumeMigrationResponse response = future.get(); 3381 * } 3382 * }</pre> 3383 */ 3384 public final OperationCallable<ResumeMigrationRequest, ResumeMigrationResponse, OperationMetadata> resumeMigrationOperationCallable()3385 resumeMigrationOperationCallable() { 3386 return stub.resumeMigrationOperationCallable(); 3387 } 3388 3389 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3390 /** 3391 * Resumes a migration for a VM. When called on a paused migration, will start the process of 3392 * uploading data and creating snapshots; when called on a completed cut-over migration, will 3393 * update the migration to active state and start the process of uploading data and creating 3394 * snapshots. 3395 * 3396 * <p>Sample code: 3397 * 3398 * <pre>{@code 3399 * // This snippet has been automatically generated and should be regarded as a code template only. 3400 * // It will require modifications to work: 3401 * // - It may require correct/in-range values for request initialization. 3402 * // - It may require specifying regional endpoints when creating the service client as shown in 3403 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3404 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3405 * ResumeMigrationRequest request = 3406 * ResumeMigrationRequest.newBuilder() 3407 * .setMigratingVm( 3408 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3409 * .toString()) 3410 * .build(); 3411 * ApiFuture<Operation> future = vmMigrationClient.resumeMigrationCallable().futureCall(request); 3412 * // Do something. 3413 * Operation response = future.get(); 3414 * } 3415 * }</pre> 3416 */ resumeMigrationCallable()3417 public final UnaryCallable<ResumeMigrationRequest, Operation> resumeMigrationCallable() { 3418 return stub.resumeMigrationCallable(); 3419 } 3420 3421 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3422 /** 3423 * Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving 3424 * source task data. Further replication cycles will not be triggered while the VM is paused. 3425 * 3426 * <p>Sample code: 3427 * 3428 * <pre>{@code 3429 * // This snippet has been automatically generated and should be regarded as a code template only. 3430 * // It will require modifications to work: 3431 * // - It may require correct/in-range values for request initialization. 3432 * // - It may require specifying regional endpoints when creating the service client as shown in 3433 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3434 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3435 * PauseMigrationRequest request = 3436 * PauseMigrationRequest.newBuilder() 3437 * .setMigratingVm( 3438 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3439 * .toString()) 3440 * .build(); 3441 * PauseMigrationResponse response = vmMigrationClient.pauseMigrationAsync(request).get(); 3442 * } 3443 * }</pre> 3444 * 3445 * @param request The request object containing all of the parameters for the API call. 3446 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3447 */ pauseMigrationAsync( PauseMigrationRequest request)3448 public final OperationFuture<PauseMigrationResponse, OperationMetadata> pauseMigrationAsync( 3449 PauseMigrationRequest request) { 3450 return pauseMigrationOperationCallable().futureCall(request); 3451 } 3452 3453 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3454 /** 3455 * Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving 3456 * source task data. Further replication cycles will not be triggered while the VM is paused. 3457 * 3458 * <p>Sample code: 3459 * 3460 * <pre>{@code 3461 * // This snippet has been automatically generated and should be regarded as a code template only. 3462 * // It will require modifications to work: 3463 * // - It may require correct/in-range values for request initialization. 3464 * // - It may require specifying regional endpoints when creating the service client as shown in 3465 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3466 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3467 * PauseMigrationRequest request = 3468 * PauseMigrationRequest.newBuilder() 3469 * .setMigratingVm( 3470 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3471 * .toString()) 3472 * .build(); 3473 * OperationFuture<PauseMigrationResponse, OperationMetadata> future = 3474 * vmMigrationClient.pauseMigrationOperationCallable().futureCall(request); 3475 * // Do something. 3476 * PauseMigrationResponse response = future.get(); 3477 * } 3478 * }</pre> 3479 */ 3480 public final OperationCallable<PauseMigrationRequest, PauseMigrationResponse, OperationMetadata> pauseMigrationOperationCallable()3481 pauseMigrationOperationCallable() { 3482 return stub.pauseMigrationOperationCallable(); 3483 } 3484 3485 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3486 /** 3487 * Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving 3488 * source task data. Further replication cycles will not be triggered while the VM is paused. 3489 * 3490 * <p>Sample code: 3491 * 3492 * <pre>{@code 3493 * // This snippet has been automatically generated and should be regarded as a code template only. 3494 * // It will require modifications to work: 3495 * // - It may require correct/in-range values for request initialization. 3496 * // - It may require specifying regional endpoints when creating the service client as shown in 3497 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3498 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3499 * PauseMigrationRequest request = 3500 * PauseMigrationRequest.newBuilder() 3501 * .setMigratingVm( 3502 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3503 * .toString()) 3504 * .build(); 3505 * ApiFuture<Operation> future = vmMigrationClient.pauseMigrationCallable().futureCall(request); 3506 * // Do something. 3507 * Operation response = future.get(); 3508 * } 3509 * }</pre> 3510 */ pauseMigrationCallable()3511 public final UnaryCallable<PauseMigrationRequest, Operation> pauseMigrationCallable() { 3512 return stub.pauseMigrationCallable(); 3513 } 3514 3515 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3516 /** 3517 * Marks a migration as completed, deleting migration resources that are no longer being used. 3518 * Only applicable after cutover is done. 3519 * 3520 * <p>Sample code: 3521 * 3522 * <pre>{@code 3523 * // This snippet has been automatically generated and should be regarded as a code template only. 3524 * // It will require modifications to work: 3525 * // - It may require correct/in-range values for request initialization. 3526 * // - It may require specifying regional endpoints when creating the service client as shown in 3527 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3528 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3529 * MigratingVmName migratingVm = 3530 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 3531 * FinalizeMigrationResponse response = 3532 * vmMigrationClient.finalizeMigrationAsync(migratingVm).get(); 3533 * } 3534 * }</pre> 3535 * 3536 * @param migratingVm Required. The name of the MigratingVm. 3537 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3538 */ finalizeMigrationAsync( MigratingVmName migratingVm)3539 public final OperationFuture<FinalizeMigrationResponse, OperationMetadata> finalizeMigrationAsync( 3540 MigratingVmName migratingVm) { 3541 FinalizeMigrationRequest request = 3542 FinalizeMigrationRequest.newBuilder() 3543 .setMigratingVm(migratingVm == null ? null : migratingVm.toString()) 3544 .build(); 3545 return finalizeMigrationAsync(request); 3546 } 3547 3548 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3549 /** 3550 * Marks a migration as completed, deleting migration resources that are no longer being used. 3551 * Only applicable after cutover is done. 3552 * 3553 * <p>Sample code: 3554 * 3555 * <pre>{@code 3556 * // This snippet has been automatically generated and should be regarded as a code template only. 3557 * // It will require modifications to work: 3558 * // - It may require correct/in-range values for request initialization. 3559 * // - It may require specifying regional endpoints when creating the service client as shown in 3560 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3561 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3562 * String migratingVm = 3563 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 3564 * FinalizeMigrationResponse response = 3565 * vmMigrationClient.finalizeMigrationAsync(migratingVm).get(); 3566 * } 3567 * }</pre> 3568 * 3569 * @param migratingVm Required. The name of the MigratingVm. 3570 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3571 */ finalizeMigrationAsync( String migratingVm)3572 public final OperationFuture<FinalizeMigrationResponse, OperationMetadata> finalizeMigrationAsync( 3573 String migratingVm) { 3574 FinalizeMigrationRequest request = 3575 FinalizeMigrationRequest.newBuilder().setMigratingVm(migratingVm).build(); 3576 return finalizeMigrationAsync(request); 3577 } 3578 3579 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3580 /** 3581 * Marks a migration as completed, deleting migration resources that are no longer being used. 3582 * Only applicable after cutover is done. 3583 * 3584 * <p>Sample code: 3585 * 3586 * <pre>{@code 3587 * // This snippet has been automatically generated and should be regarded as a code template only. 3588 * // It will require modifications to work: 3589 * // - It may require correct/in-range values for request initialization. 3590 * // - It may require specifying regional endpoints when creating the service client as shown in 3591 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3592 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3593 * FinalizeMigrationRequest request = 3594 * FinalizeMigrationRequest.newBuilder() 3595 * .setMigratingVm( 3596 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3597 * .toString()) 3598 * .build(); 3599 * FinalizeMigrationResponse response = vmMigrationClient.finalizeMigrationAsync(request).get(); 3600 * } 3601 * }</pre> 3602 * 3603 * @param request The request object containing all of the parameters for the API call. 3604 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3605 */ finalizeMigrationAsync( FinalizeMigrationRequest request)3606 public final OperationFuture<FinalizeMigrationResponse, OperationMetadata> finalizeMigrationAsync( 3607 FinalizeMigrationRequest request) { 3608 return finalizeMigrationOperationCallable().futureCall(request); 3609 } 3610 3611 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3612 /** 3613 * Marks a migration as completed, deleting migration resources that are no longer being used. 3614 * Only applicable after cutover is done. 3615 * 3616 * <p>Sample code: 3617 * 3618 * <pre>{@code 3619 * // This snippet has been automatically generated and should be regarded as a code template only. 3620 * // It will require modifications to work: 3621 * // - It may require correct/in-range values for request initialization. 3622 * // - It may require specifying regional endpoints when creating the service client as shown in 3623 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3624 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3625 * FinalizeMigrationRequest request = 3626 * FinalizeMigrationRequest.newBuilder() 3627 * .setMigratingVm( 3628 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3629 * .toString()) 3630 * .build(); 3631 * OperationFuture<FinalizeMigrationResponse, OperationMetadata> future = 3632 * vmMigrationClient.finalizeMigrationOperationCallable().futureCall(request); 3633 * // Do something. 3634 * FinalizeMigrationResponse response = future.get(); 3635 * } 3636 * }</pre> 3637 */ 3638 public final OperationCallable< 3639 FinalizeMigrationRequest, FinalizeMigrationResponse, OperationMetadata> finalizeMigrationOperationCallable()3640 finalizeMigrationOperationCallable() { 3641 return stub.finalizeMigrationOperationCallable(); 3642 } 3643 3644 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3645 /** 3646 * Marks a migration as completed, deleting migration resources that are no longer being used. 3647 * Only applicable after cutover is done. 3648 * 3649 * <p>Sample code: 3650 * 3651 * <pre>{@code 3652 * // This snippet has been automatically generated and should be regarded as a code template only. 3653 * // It will require modifications to work: 3654 * // - It may require correct/in-range values for request initialization. 3655 * // - It may require specifying regional endpoints when creating the service client as shown in 3656 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3657 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3658 * FinalizeMigrationRequest request = 3659 * FinalizeMigrationRequest.newBuilder() 3660 * .setMigratingVm( 3661 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3662 * .toString()) 3663 * .build(); 3664 * ApiFuture<Operation> future = 3665 * vmMigrationClient.finalizeMigrationCallable().futureCall(request); 3666 * // Do something. 3667 * Operation response = future.get(); 3668 * } 3669 * }</pre> 3670 */ finalizeMigrationCallable()3671 public final UnaryCallable<FinalizeMigrationRequest, Operation> finalizeMigrationCallable() { 3672 return stub.finalizeMigrationCallable(); 3673 } 3674 3675 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3676 /** 3677 * Initiates a Clone of a specific migrating VM. 3678 * 3679 * <p>Sample code: 3680 * 3681 * <pre>{@code 3682 * // This snippet has been automatically generated and should be regarded as a code template only. 3683 * // It will require modifications to work: 3684 * // - It may require correct/in-range values for request initialization. 3685 * // - It may require specifying regional endpoints when creating the service client as shown in 3686 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3687 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3688 * MigratingVmName parent = 3689 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 3690 * CloneJob cloneJob = CloneJob.newBuilder().build(); 3691 * String cloneJobId = "cloneJobId2071309915"; 3692 * CloneJob response = vmMigrationClient.createCloneJobAsync(parent, cloneJob, cloneJobId).get(); 3693 * } 3694 * }</pre> 3695 * 3696 * @param parent Required. The Clone's parent. 3697 * @param cloneJob Required. The clone request body. 3698 * @param cloneJobId Required. The clone job identifier. 3699 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3700 */ createCloneJobAsync( MigratingVmName parent, CloneJob cloneJob, String cloneJobId)3701 public final OperationFuture<CloneJob, OperationMetadata> createCloneJobAsync( 3702 MigratingVmName parent, CloneJob cloneJob, String cloneJobId) { 3703 CreateCloneJobRequest request = 3704 CreateCloneJobRequest.newBuilder() 3705 .setParent(parent == null ? null : parent.toString()) 3706 .setCloneJob(cloneJob) 3707 .setCloneJobId(cloneJobId) 3708 .build(); 3709 return createCloneJobAsync(request); 3710 } 3711 3712 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3713 /** 3714 * Initiates a Clone of a specific migrating VM. 3715 * 3716 * <p>Sample code: 3717 * 3718 * <pre>{@code 3719 * // This snippet has been automatically generated and should be regarded as a code template only. 3720 * // It will require modifications to work: 3721 * // - It may require correct/in-range values for request initialization. 3722 * // - It may require specifying regional endpoints when creating the service client as shown in 3723 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3724 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3725 * String parent = 3726 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 3727 * CloneJob cloneJob = CloneJob.newBuilder().build(); 3728 * String cloneJobId = "cloneJobId2071309915"; 3729 * CloneJob response = vmMigrationClient.createCloneJobAsync(parent, cloneJob, cloneJobId).get(); 3730 * } 3731 * }</pre> 3732 * 3733 * @param parent Required. The Clone's parent. 3734 * @param cloneJob Required. The clone request body. 3735 * @param cloneJobId Required. The clone job identifier. 3736 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3737 */ createCloneJobAsync( String parent, CloneJob cloneJob, String cloneJobId)3738 public final OperationFuture<CloneJob, OperationMetadata> createCloneJobAsync( 3739 String parent, CloneJob cloneJob, String cloneJobId) { 3740 CreateCloneJobRequest request = 3741 CreateCloneJobRequest.newBuilder() 3742 .setParent(parent) 3743 .setCloneJob(cloneJob) 3744 .setCloneJobId(cloneJobId) 3745 .build(); 3746 return createCloneJobAsync(request); 3747 } 3748 3749 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3750 /** 3751 * Initiates a Clone of a specific migrating VM. 3752 * 3753 * <p>Sample code: 3754 * 3755 * <pre>{@code 3756 * // This snippet has been automatically generated and should be regarded as a code template only. 3757 * // It will require modifications to work: 3758 * // - It may require correct/in-range values for request initialization. 3759 * // - It may require specifying regional endpoints when creating the service client as shown in 3760 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3761 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3762 * CreateCloneJobRequest request = 3763 * CreateCloneJobRequest.newBuilder() 3764 * .setParent( 3765 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3766 * .toString()) 3767 * .setCloneJobId("cloneJobId2071309915") 3768 * .setCloneJob(CloneJob.newBuilder().build()) 3769 * .setRequestId("requestId693933066") 3770 * .build(); 3771 * CloneJob response = vmMigrationClient.createCloneJobAsync(request).get(); 3772 * } 3773 * }</pre> 3774 * 3775 * @param request The request object containing all of the parameters for the API call. 3776 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3777 */ createCloneJobAsync( CreateCloneJobRequest request)3778 public final OperationFuture<CloneJob, OperationMetadata> createCloneJobAsync( 3779 CreateCloneJobRequest request) { 3780 return createCloneJobOperationCallable().futureCall(request); 3781 } 3782 3783 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3784 /** 3785 * Initiates a Clone of a specific migrating VM. 3786 * 3787 * <p>Sample code: 3788 * 3789 * <pre>{@code 3790 * // This snippet has been automatically generated and should be regarded as a code template only. 3791 * // It will require modifications to work: 3792 * // - It may require correct/in-range values for request initialization. 3793 * // - It may require specifying regional endpoints when creating the service client as shown in 3794 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3795 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3796 * CreateCloneJobRequest request = 3797 * CreateCloneJobRequest.newBuilder() 3798 * .setParent( 3799 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3800 * .toString()) 3801 * .setCloneJobId("cloneJobId2071309915") 3802 * .setCloneJob(CloneJob.newBuilder().build()) 3803 * .setRequestId("requestId693933066") 3804 * .build(); 3805 * OperationFuture<CloneJob, OperationMetadata> future = 3806 * vmMigrationClient.createCloneJobOperationCallable().futureCall(request); 3807 * // Do something. 3808 * CloneJob response = future.get(); 3809 * } 3810 * }</pre> 3811 */ 3812 public final OperationCallable<CreateCloneJobRequest, CloneJob, OperationMetadata> createCloneJobOperationCallable()3813 createCloneJobOperationCallable() { 3814 return stub.createCloneJobOperationCallable(); 3815 } 3816 3817 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3818 /** 3819 * Initiates a Clone of a specific migrating VM. 3820 * 3821 * <p>Sample code: 3822 * 3823 * <pre>{@code 3824 * // This snippet has been automatically generated and should be regarded as a code template only. 3825 * // It will require modifications to work: 3826 * // - It may require correct/in-range values for request initialization. 3827 * // - It may require specifying regional endpoints when creating the service client as shown in 3828 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3829 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3830 * CreateCloneJobRequest request = 3831 * CreateCloneJobRequest.newBuilder() 3832 * .setParent( 3833 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 3834 * .toString()) 3835 * .setCloneJobId("cloneJobId2071309915") 3836 * .setCloneJob(CloneJob.newBuilder().build()) 3837 * .setRequestId("requestId693933066") 3838 * .build(); 3839 * ApiFuture<Operation> future = vmMigrationClient.createCloneJobCallable().futureCall(request); 3840 * // Do something. 3841 * Operation response = future.get(); 3842 * } 3843 * }</pre> 3844 */ createCloneJobCallable()3845 public final UnaryCallable<CreateCloneJobRequest, Operation> createCloneJobCallable() { 3846 return stub.createCloneJobCallable(); 3847 } 3848 3849 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3850 /** 3851 * Initiates the cancellation of a running clone job. 3852 * 3853 * <p>Sample code: 3854 * 3855 * <pre>{@code 3856 * // This snippet has been automatically generated and should be regarded as a code template only. 3857 * // It will require modifications to work: 3858 * // - It may require correct/in-range values for request initialization. 3859 * // - It may require specifying regional endpoints when creating the service client as shown in 3860 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3861 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3862 * CloneJobName name = 3863 * CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]"); 3864 * CancelCloneJobResponse response = vmMigrationClient.cancelCloneJobAsync(name).get(); 3865 * } 3866 * }</pre> 3867 * 3868 * @param name Required. The clone job id 3869 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3870 */ cancelCloneJobAsync( CloneJobName name)3871 public final OperationFuture<CancelCloneJobResponse, OperationMetadata> cancelCloneJobAsync( 3872 CloneJobName name) { 3873 CancelCloneJobRequest request = 3874 CancelCloneJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 3875 return cancelCloneJobAsync(request); 3876 } 3877 3878 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3879 /** 3880 * Initiates the cancellation of a running clone job. 3881 * 3882 * <p>Sample code: 3883 * 3884 * <pre>{@code 3885 * // This snippet has been automatically generated and should be regarded as a code template only. 3886 * // It will require modifications to work: 3887 * // - It may require correct/in-range values for request initialization. 3888 * // - It may require specifying regional endpoints when creating the service client as shown in 3889 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3890 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3891 * String name = 3892 * CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]") 3893 * .toString(); 3894 * CancelCloneJobResponse response = vmMigrationClient.cancelCloneJobAsync(name).get(); 3895 * } 3896 * }</pre> 3897 * 3898 * @param name Required. The clone job id 3899 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3900 */ cancelCloneJobAsync( String name)3901 public final OperationFuture<CancelCloneJobResponse, OperationMetadata> cancelCloneJobAsync( 3902 String name) { 3903 CancelCloneJobRequest request = CancelCloneJobRequest.newBuilder().setName(name).build(); 3904 return cancelCloneJobAsync(request); 3905 } 3906 3907 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3908 /** 3909 * Initiates the cancellation of a running clone job. 3910 * 3911 * <p>Sample code: 3912 * 3913 * <pre>{@code 3914 * // This snippet has been automatically generated and should be regarded as a code template only. 3915 * // It will require modifications to work: 3916 * // - It may require correct/in-range values for request initialization. 3917 * // - It may require specifying regional endpoints when creating the service client as shown in 3918 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3919 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3920 * CancelCloneJobRequest request = 3921 * CancelCloneJobRequest.newBuilder() 3922 * .setName( 3923 * CloneJobName.of( 3924 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]") 3925 * .toString()) 3926 * .build(); 3927 * CancelCloneJobResponse response = vmMigrationClient.cancelCloneJobAsync(request).get(); 3928 * } 3929 * }</pre> 3930 * 3931 * @param request The request object containing all of the parameters for the API call. 3932 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3933 */ cancelCloneJobAsync( CancelCloneJobRequest request)3934 public final OperationFuture<CancelCloneJobResponse, OperationMetadata> cancelCloneJobAsync( 3935 CancelCloneJobRequest request) { 3936 return cancelCloneJobOperationCallable().futureCall(request); 3937 } 3938 3939 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3940 /** 3941 * Initiates the cancellation of a running clone job. 3942 * 3943 * <p>Sample code: 3944 * 3945 * <pre>{@code 3946 * // This snippet has been automatically generated and should be regarded as a code template only. 3947 * // It will require modifications to work: 3948 * // - It may require correct/in-range values for request initialization. 3949 * // - It may require specifying regional endpoints when creating the service client as shown in 3950 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3951 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3952 * CancelCloneJobRequest request = 3953 * CancelCloneJobRequest.newBuilder() 3954 * .setName( 3955 * CloneJobName.of( 3956 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]") 3957 * .toString()) 3958 * .build(); 3959 * OperationFuture<CancelCloneJobResponse, OperationMetadata> future = 3960 * vmMigrationClient.cancelCloneJobOperationCallable().futureCall(request); 3961 * // Do something. 3962 * CancelCloneJobResponse response = future.get(); 3963 * } 3964 * }</pre> 3965 */ 3966 public final OperationCallable<CancelCloneJobRequest, CancelCloneJobResponse, OperationMetadata> cancelCloneJobOperationCallable()3967 cancelCloneJobOperationCallable() { 3968 return stub.cancelCloneJobOperationCallable(); 3969 } 3970 3971 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3972 /** 3973 * Initiates the cancellation of a running clone job. 3974 * 3975 * <p>Sample code: 3976 * 3977 * <pre>{@code 3978 * // This snippet has been automatically generated and should be regarded as a code template only. 3979 * // It will require modifications to work: 3980 * // - It may require correct/in-range values for request initialization. 3981 * // - It may require specifying regional endpoints when creating the service client as shown in 3982 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3983 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 3984 * CancelCloneJobRequest request = 3985 * CancelCloneJobRequest.newBuilder() 3986 * .setName( 3987 * CloneJobName.of( 3988 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]") 3989 * .toString()) 3990 * .build(); 3991 * ApiFuture<Operation> future = vmMigrationClient.cancelCloneJobCallable().futureCall(request); 3992 * // Do something. 3993 * Operation response = future.get(); 3994 * } 3995 * }</pre> 3996 */ cancelCloneJobCallable()3997 public final UnaryCallable<CancelCloneJobRequest, Operation> cancelCloneJobCallable() { 3998 return stub.cancelCloneJobCallable(); 3999 } 4000 4001 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4002 /** 4003 * Lists CloneJobs of a given migrating VM. 4004 * 4005 * <p>Sample code: 4006 * 4007 * <pre>{@code 4008 * // This snippet has been automatically generated and should be regarded as a code template only. 4009 * // It will require modifications to work: 4010 * // - It may require correct/in-range values for request initialization. 4011 * // - It may require specifying regional endpoints when creating the service client as shown in 4012 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4013 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4014 * MigratingVmName parent = 4015 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 4016 * for (CloneJob element : vmMigrationClient.listCloneJobs(parent).iterateAll()) { 4017 * // doThingsWith(element); 4018 * } 4019 * } 4020 * }</pre> 4021 * 4022 * @param parent Required. The parent, which owns this collection of source VMs. 4023 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4024 */ listCloneJobs(MigratingVmName parent)4025 public final ListCloneJobsPagedResponse listCloneJobs(MigratingVmName parent) { 4026 ListCloneJobsRequest request = 4027 ListCloneJobsRequest.newBuilder() 4028 .setParent(parent == null ? null : parent.toString()) 4029 .build(); 4030 return listCloneJobs(request); 4031 } 4032 4033 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4034 /** 4035 * Lists CloneJobs of a given migrating VM. 4036 * 4037 * <p>Sample code: 4038 * 4039 * <pre>{@code 4040 * // This snippet has been automatically generated and should be regarded as a code template only. 4041 * // It will require modifications to work: 4042 * // - It may require correct/in-range values for request initialization. 4043 * // - It may require specifying regional endpoints when creating the service client as shown in 4044 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4045 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4046 * String parent = 4047 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 4048 * for (CloneJob element : vmMigrationClient.listCloneJobs(parent).iterateAll()) { 4049 * // doThingsWith(element); 4050 * } 4051 * } 4052 * }</pre> 4053 * 4054 * @param parent Required. The parent, which owns this collection of source VMs. 4055 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4056 */ listCloneJobs(String parent)4057 public final ListCloneJobsPagedResponse listCloneJobs(String parent) { 4058 ListCloneJobsRequest request = ListCloneJobsRequest.newBuilder().setParent(parent).build(); 4059 return listCloneJobs(request); 4060 } 4061 4062 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4063 /** 4064 * Lists CloneJobs of a given migrating VM. 4065 * 4066 * <p>Sample code: 4067 * 4068 * <pre>{@code 4069 * // This snippet has been automatically generated and should be regarded as a code template only. 4070 * // It will require modifications to work: 4071 * // - It may require correct/in-range values for request initialization. 4072 * // - It may require specifying regional endpoints when creating the service client as shown in 4073 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4074 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4075 * ListCloneJobsRequest request = 4076 * ListCloneJobsRequest.newBuilder() 4077 * .setParent( 4078 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4079 * .toString()) 4080 * .setPageSize(883849137) 4081 * .setPageToken("pageToken873572522") 4082 * .setFilter("filter-1274492040") 4083 * .setOrderBy("orderBy-1207110587") 4084 * .build(); 4085 * for (CloneJob element : vmMigrationClient.listCloneJobs(request).iterateAll()) { 4086 * // doThingsWith(element); 4087 * } 4088 * } 4089 * }</pre> 4090 * 4091 * @param request The request object containing all of the parameters for the API call. 4092 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4093 */ listCloneJobs(ListCloneJobsRequest request)4094 public final ListCloneJobsPagedResponse listCloneJobs(ListCloneJobsRequest request) { 4095 return listCloneJobsPagedCallable().call(request); 4096 } 4097 4098 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4099 /** 4100 * Lists CloneJobs of a given migrating VM. 4101 * 4102 * <p>Sample code: 4103 * 4104 * <pre>{@code 4105 * // This snippet has been automatically generated and should be regarded as a code template only. 4106 * // It will require modifications to work: 4107 * // - It may require correct/in-range values for request initialization. 4108 * // - It may require specifying regional endpoints when creating the service client as shown in 4109 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4110 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4111 * ListCloneJobsRequest request = 4112 * ListCloneJobsRequest.newBuilder() 4113 * .setParent( 4114 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4115 * .toString()) 4116 * .setPageSize(883849137) 4117 * .setPageToken("pageToken873572522") 4118 * .setFilter("filter-1274492040") 4119 * .setOrderBy("orderBy-1207110587") 4120 * .build(); 4121 * ApiFuture<CloneJob> future = 4122 * vmMigrationClient.listCloneJobsPagedCallable().futureCall(request); 4123 * // Do something. 4124 * for (CloneJob element : future.get().iterateAll()) { 4125 * // doThingsWith(element); 4126 * } 4127 * } 4128 * }</pre> 4129 */ 4130 public final UnaryCallable<ListCloneJobsRequest, ListCloneJobsPagedResponse> listCloneJobsPagedCallable()4131 listCloneJobsPagedCallable() { 4132 return stub.listCloneJobsPagedCallable(); 4133 } 4134 4135 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4136 /** 4137 * Lists CloneJobs of a given migrating VM. 4138 * 4139 * <p>Sample code: 4140 * 4141 * <pre>{@code 4142 * // This snippet has been automatically generated and should be regarded as a code template only. 4143 * // It will require modifications to work: 4144 * // - It may require correct/in-range values for request initialization. 4145 * // - It may require specifying regional endpoints when creating the service client as shown in 4146 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4147 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4148 * ListCloneJobsRequest request = 4149 * ListCloneJobsRequest.newBuilder() 4150 * .setParent( 4151 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4152 * .toString()) 4153 * .setPageSize(883849137) 4154 * .setPageToken("pageToken873572522") 4155 * .setFilter("filter-1274492040") 4156 * .setOrderBy("orderBy-1207110587") 4157 * .build(); 4158 * while (true) { 4159 * ListCloneJobsResponse response = vmMigrationClient.listCloneJobsCallable().call(request); 4160 * for (CloneJob element : response.getCloneJobsList()) { 4161 * // doThingsWith(element); 4162 * } 4163 * String nextPageToken = response.getNextPageToken(); 4164 * if (!Strings.isNullOrEmpty(nextPageToken)) { 4165 * request = request.toBuilder().setPageToken(nextPageToken).build(); 4166 * } else { 4167 * break; 4168 * } 4169 * } 4170 * } 4171 * }</pre> 4172 */ listCloneJobsCallable()4173 public final UnaryCallable<ListCloneJobsRequest, ListCloneJobsResponse> listCloneJobsCallable() { 4174 return stub.listCloneJobsCallable(); 4175 } 4176 4177 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4178 /** 4179 * Gets details of a single CloneJob. 4180 * 4181 * <p>Sample code: 4182 * 4183 * <pre>{@code 4184 * // This snippet has been automatically generated and should be regarded as a code template only. 4185 * // It will require modifications to work: 4186 * // - It may require correct/in-range values for request initialization. 4187 * // - It may require specifying regional endpoints when creating the service client as shown in 4188 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4189 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4190 * CloneJobName name = 4191 * CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]"); 4192 * CloneJob response = vmMigrationClient.getCloneJob(name); 4193 * } 4194 * }</pre> 4195 * 4196 * @param name Required. The name of the CloneJob. 4197 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4198 */ getCloneJob(CloneJobName name)4199 public final CloneJob getCloneJob(CloneJobName name) { 4200 GetCloneJobRequest request = 4201 GetCloneJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 4202 return getCloneJob(request); 4203 } 4204 4205 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4206 /** 4207 * Gets details of a single CloneJob. 4208 * 4209 * <p>Sample code: 4210 * 4211 * <pre>{@code 4212 * // This snippet has been automatically generated and should be regarded as a code template only. 4213 * // It will require modifications to work: 4214 * // - It may require correct/in-range values for request initialization. 4215 * // - It may require specifying regional endpoints when creating the service client as shown in 4216 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4217 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4218 * String name = 4219 * CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]") 4220 * .toString(); 4221 * CloneJob response = vmMigrationClient.getCloneJob(name); 4222 * } 4223 * }</pre> 4224 * 4225 * @param name Required. The name of the CloneJob. 4226 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4227 */ getCloneJob(String name)4228 public final CloneJob getCloneJob(String name) { 4229 GetCloneJobRequest request = GetCloneJobRequest.newBuilder().setName(name).build(); 4230 return getCloneJob(request); 4231 } 4232 4233 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4234 /** 4235 * Gets details of a single CloneJob. 4236 * 4237 * <p>Sample code: 4238 * 4239 * <pre>{@code 4240 * // This snippet has been automatically generated and should be regarded as a code template only. 4241 * // It will require modifications to work: 4242 * // - It may require correct/in-range values for request initialization. 4243 * // - It may require specifying regional endpoints when creating the service client as shown in 4244 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4245 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4246 * GetCloneJobRequest request = 4247 * GetCloneJobRequest.newBuilder() 4248 * .setName( 4249 * CloneJobName.of( 4250 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]") 4251 * .toString()) 4252 * .build(); 4253 * CloneJob response = vmMigrationClient.getCloneJob(request); 4254 * } 4255 * }</pre> 4256 * 4257 * @param request The request object containing all of the parameters for the API call. 4258 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4259 */ getCloneJob(GetCloneJobRequest request)4260 public final CloneJob getCloneJob(GetCloneJobRequest request) { 4261 return getCloneJobCallable().call(request); 4262 } 4263 4264 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4265 /** 4266 * Gets details of a single CloneJob. 4267 * 4268 * <p>Sample code: 4269 * 4270 * <pre>{@code 4271 * // This snippet has been automatically generated and should be regarded as a code template only. 4272 * // It will require modifications to work: 4273 * // - It may require correct/in-range values for request initialization. 4274 * // - It may require specifying regional endpoints when creating the service client as shown in 4275 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4276 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4277 * GetCloneJobRequest request = 4278 * GetCloneJobRequest.newBuilder() 4279 * .setName( 4280 * CloneJobName.of( 4281 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]") 4282 * .toString()) 4283 * .build(); 4284 * ApiFuture<CloneJob> future = vmMigrationClient.getCloneJobCallable().futureCall(request); 4285 * // Do something. 4286 * CloneJob response = future.get(); 4287 * } 4288 * }</pre> 4289 */ getCloneJobCallable()4290 public final UnaryCallable<GetCloneJobRequest, CloneJob> getCloneJobCallable() { 4291 return stub.getCloneJobCallable(); 4292 } 4293 4294 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4295 /** 4296 * Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover 4297 * job resource is created and the job is initiated. 4298 * 4299 * <p>Sample code: 4300 * 4301 * <pre>{@code 4302 * // This snippet has been automatically generated and should be regarded as a code template only. 4303 * // It will require modifications to work: 4304 * // - It may require correct/in-range values for request initialization. 4305 * // - It may require specifying regional endpoints when creating the service client as shown in 4306 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4307 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4308 * MigratingVmName parent = 4309 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 4310 * CutoverJob cutoverJob = CutoverJob.newBuilder().build(); 4311 * String cutoverJobId = "cutoverJobId-2003089086"; 4312 * CutoverJob response = 4313 * vmMigrationClient.createCutoverJobAsync(parent, cutoverJob, cutoverJobId).get(); 4314 * } 4315 * }</pre> 4316 * 4317 * @param parent Required. The Cutover's parent. 4318 * @param cutoverJob Required. The cutover request body. 4319 * @param cutoverJobId Required. The cutover job identifier. 4320 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4321 */ createCutoverJobAsync( MigratingVmName parent, CutoverJob cutoverJob, String cutoverJobId)4322 public final OperationFuture<CutoverJob, OperationMetadata> createCutoverJobAsync( 4323 MigratingVmName parent, CutoverJob cutoverJob, String cutoverJobId) { 4324 CreateCutoverJobRequest request = 4325 CreateCutoverJobRequest.newBuilder() 4326 .setParent(parent == null ? null : parent.toString()) 4327 .setCutoverJob(cutoverJob) 4328 .setCutoverJobId(cutoverJobId) 4329 .build(); 4330 return createCutoverJobAsync(request); 4331 } 4332 4333 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4334 /** 4335 * Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover 4336 * job resource is created and the job is initiated. 4337 * 4338 * <p>Sample code: 4339 * 4340 * <pre>{@code 4341 * // This snippet has been automatically generated and should be regarded as a code template only. 4342 * // It will require modifications to work: 4343 * // - It may require correct/in-range values for request initialization. 4344 * // - It may require specifying regional endpoints when creating the service client as shown in 4345 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4346 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4347 * String parent = 4348 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 4349 * CutoverJob cutoverJob = CutoverJob.newBuilder().build(); 4350 * String cutoverJobId = "cutoverJobId-2003089086"; 4351 * CutoverJob response = 4352 * vmMigrationClient.createCutoverJobAsync(parent, cutoverJob, cutoverJobId).get(); 4353 * } 4354 * }</pre> 4355 * 4356 * @param parent Required. The Cutover's parent. 4357 * @param cutoverJob Required. The cutover request body. 4358 * @param cutoverJobId Required. The cutover job identifier. 4359 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4360 */ createCutoverJobAsync( String parent, CutoverJob cutoverJob, String cutoverJobId)4361 public final OperationFuture<CutoverJob, OperationMetadata> createCutoverJobAsync( 4362 String parent, CutoverJob cutoverJob, String cutoverJobId) { 4363 CreateCutoverJobRequest request = 4364 CreateCutoverJobRequest.newBuilder() 4365 .setParent(parent) 4366 .setCutoverJob(cutoverJob) 4367 .setCutoverJobId(cutoverJobId) 4368 .build(); 4369 return createCutoverJobAsync(request); 4370 } 4371 4372 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4373 /** 4374 * Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover 4375 * job resource is created and the job is initiated. 4376 * 4377 * <p>Sample code: 4378 * 4379 * <pre>{@code 4380 * // This snippet has been automatically generated and should be regarded as a code template only. 4381 * // It will require modifications to work: 4382 * // - It may require correct/in-range values for request initialization. 4383 * // - It may require specifying regional endpoints when creating the service client as shown in 4384 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4385 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4386 * CreateCutoverJobRequest request = 4387 * CreateCutoverJobRequest.newBuilder() 4388 * .setParent( 4389 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4390 * .toString()) 4391 * .setCutoverJobId("cutoverJobId-2003089086") 4392 * .setCutoverJob(CutoverJob.newBuilder().build()) 4393 * .setRequestId("requestId693933066") 4394 * .build(); 4395 * CutoverJob response = vmMigrationClient.createCutoverJobAsync(request).get(); 4396 * } 4397 * }</pre> 4398 * 4399 * @param request The request object containing all of the parameters for the API call. 4400 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4401 */ createCutoverJobAsync( CreateCutoverJobRequest request)4402 public final OperationFuture<CutoverJob, OperationMetadata> createCutoverJobAsync( 4403 CreateCutoverJobRequest request) { 4404 return createCutoverJobOperationCallable().futureCall(request); 4405 } 4406 4407 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4408 /** 4409 * Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover 4410 * job resource is created and the job is initiated. 4411 * 4412 * <p>Sample code: 4413 * 4414 * <pre>{@code 4415 * // This snippet has been automatically generated and should be regarded as a code template only. 4416 * // It will require modifications to work: 4417 * // - It may require correct/in-range values for request initialization. 4418 * // - It may require specifying regional endpoints when creating the service client as shown in 4419 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4420 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4421 * CreateCutoverJobRequest request = 4422 * CreateCutoverJobRequest.newBuilder() 4423 * .setParent( 4424 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4425 * .toString()) 4426 * .setCutoverJobId("cutoverJobId-2003089086") 4427 * .setCutoverJob(CutoverJob.newBuilder().build()) 4428 * .setRequestId("requestId693933066") 4429 * .build(); 4430 * OperationFuture<CutoverJob, OperationMetadata> future = 4431 * vmMigrationClient.createCutoverJobOperationCallable().futureCall(request); 4432 * // Do something. 4433 * CutoverJob response = future.get(); 4434 * } 4435 * }</pre> 4436 */ 4437 public final OperationCallable<CreateCutoverJobRequest, CutoverJob, OperationMetadata> createCutoverJobOperationCallable()4438 createCutoverJobOperationCallable() { 4439 return stub.createCutoverJobOperationCallable(); 4440 } 4441 4442 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4443 /** 4444 * Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover 4445 * job resource is created and the job is initiated. 4446 * 4447 * <p>Sample code: 4448 * 4449 * <pre>{@code 4450 * // This snippet has been automatically generated and should be regarded as a code template only. 4451 * // It will require modifications to work: 4452 * // - It may require correct/in-range values for request initialization. 4453 * // - It may require specifying regional endpoints when creating the service client as shown in 4454 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4455 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4456 * CreateCutoverJobRequest request = 4457 * CreateCutoverJobRequest.newBuilder() 4458 * .setParent( 4459 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4460 * .toString()) 4461 * .setCutoverJobId("cutoverJobId-2003089086") 4462 * .setCutoverJob(CutoverJob.newBuilder().build()) 4463 * .setRequestId("requestId693933066") 4464 * .build(); 4465 * ApiFuture<Operation> future = 4466 * vmMigrationClient.createCutoverJobCallable().futureCall(request); 4467 * // Do something. 4468 * Operation response = future.get(); 4469 * } 4470 * }</pre> 4471 */ createCutoverJobCallable()4472 public final UnaryCallable<CreateCutoverJobRequest, Operation> createCutoverJobCallable() { 4473 return stub.createCutoverJobCallable(); 4474 } 4475 4476 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4477 /** 4478 * Initiates the cancellation of a running cutover job. 4479 * 4480 * <p>Sample code: 4481 * 4482 * <pre>{@code 4483 * // This snippet has been automatically generated and should be regarded as a code template only. 4484 * // It will require modifications to work: 4485 * // - It may require correct/in-range values for request initialization. 4486 * // - It may require specifying regional endpoints when creating the service client as shown in 4487 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4488 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4489 * CutoverJobName name = 4490 * CutoverJobName.of( 4491 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]"); 4492 * CancelCutoverJobResponse response = vmMigrationClient.cancelCutoverJobAsync(name).get(); 4493 * } 4494 * }</pre> 4495 * 4496 * @param name Required. The cutover job id 4497 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4498 */ cancelCutoverJobAsync( CutoverJobName name)4499 public final OperationFuture<CancelCutoverJobResponse, OperationMetadata> cancelCutoverJobAsync( 4500 CutoverJobName name) { 4501 CancelCutoverJobRequest request = 4502 CancelCutoverJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 4503 return cancelCutoverJobAsync(request); 4504 } 4505 4506 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4507 /** 4508 * Initiates the cancellation of a running cutover job. 4509 * 4510 * <p>Sample code: 4511 * 4512 * <pre>{@code 4513 * // This snippet has been automatically generated and should be regarded as a code template only. 4514 * // It will require modifications to work: 4515 * // - It may require correct/in-range values for request initialization. 4516 * // - It may require specifying regional endpoints when creating the service client as shown in 4517 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4518 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4519 * String name = 4520 * CutoverJobName.of( 4521 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]") 4522 * .toString(); 4523 * CancelCutoverJobResponse response = vmMigrationClient.cancelCutoverJobAsync(name).get(); 4524 * } 4525 * }</pre> 4526 * 4527 * @param name Required. The cutover job id 4528 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4529 */ cancelCutoverJobAsync( String name)4530 public final OperationFuture<CancelCutoverJobResponse, OperationMetadata> cancelCutoverJobAsync( 4531 String name) { 4532 CancelCutoverJobRequest request = CancelCutoverJobRequest.newBuilder().setName(name).build(); 4533 return cancelCutoverJobAsync(request); 4534 } 4535 4536 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4537 /** 4538 * Initiates the cancellation of a running cutover job. 4539 * 4540 * <p>Sample code: 4541 * 4542 * <pre>{@code 4543 * // This snippet has been automatically generated and should be regarded as a code template only. 4544 * // It will require modifications to work: 4545 * // - It may require correct/in-range values for request initialization. 4546 * // - It may require specifying regional endpoints when creating the service client as shown in 4547 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4548 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4549 * CancelCutoverJobRequest request = 4550 * CancelCutoverJobRequest.newBuilder() 4551 * .setName( 4552 * CutoverJobName.of( 4553 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]") 4554 * .toString()) 4555 * .build(); 4556 * CancelCutoverJobResponse response = vmMigrationClient.cancelCutoverJobAsync(request).get(); 4557 * } 4558 * }</pre> 4559 * 4560 * @param request The request object containing all of the parameters for the API call. 4561 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4562 */ cancelCutoverJobAsync( CancelCutoverJobRequest request)4563 public final OperationFuture<CancelCutoverJobResponse, OperationMetadata> cancelCutoverJobAsync( 4564 CancelCutoverJobRequest request) { 4565 return cancelCutoverJobOperationCallable().futureCall(request); 4566 } 4567 4568 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4569 /** 4570 * Initiates the cancellation of a running cutover job. 4571 * 4572 * <p>Sample code: 4573 * 4574 * <pre>{@code 4575 * // This snippet has been automatically generated and should be regarded as a code template only. 4576 * // It will require modifications to work: 4577 * // - It may require correct/in-range values for request initialization. 4578 * // - It may require specifying regional endpoints when creating the service client as shown in 4579 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4580 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4581 * CancelCutoverJobRequest request = 4582 * CancelCutoverJobRequest.newBuilder() 4583 * .setName( 4584 * CutoverJobName.of( 4585 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]") 4586 * .toString()) 4587 * .build(); 4588 * OperationFuture<CancelCutoverJobResponse, OperationMetadata> future = 4589 * vmMigrationClient.cancelCutoverJobOperationCallable().futureCall(request); 4590 * // Do something. 4591 * CancelCutoverJobResponse response = future.get(); 4592 * } 4593 * }</pre> 4594 */ 4595 public final OperationCallable< 4596 CancelCutoverJobRequest, CancelCutoverJobResponse, OperationMetadata> cancelCutoverJobOperationCallable()4597 cancelCutoverJobOperationCallable() { 4598 return stub.cancelCutoverJobOperationCallable(); 4599 } 4600 4601 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4602 /** 4603 * Initiates the cancellation of a running cutover job. 4604 * 4605 * <p>Sample code: 4606 * 4607 * <pre>{@code 4608 * // This snippet has been automatically generated and should be regarded as a code template only. 4609 * // It will require modifications to work: 4610 * // - It may require correct/in-range values for request initialization. 4611 * // - It may require specifying regional endpoints when creating the service client as shown in 4612 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4613 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4614 * CancelCutoverJobRequest request = 4615 * CancelCutoverJobRequest.newBuilder() 4616 * .setName( 4617 * CutoverJobName.of( 4618 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]") 4619 * .toString()) 4620 * .build(); 4621 * ApiFuture<Operation> future = 4622 * vmMigrationClient.cancelCutoverJobCallable().futureCall(request); 4623 * // Do something. 4624 * Operation response = future.get(); 4625 * } 4626 * }</pre> 4627 */ cancelCutoverJobCallable()4628 public final UnaryCallable<CancelCutoverJobRequest, Operation> cancelCutoverJobCallable() { 4629 return stub.cancelCutoverJobCallable(); 4630 } 4631 4632 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4633 /** 4634 * Lists CutoverJobs of a given migrating VM. 4635 * 4636 * <p>Sample code: 4637 * 4638 * <pre>{@code 4639 * // This snippet has been automatically generated and should be regarded as a code template only. 4640 * // It will require modifications to work: 4641 * // - It may require correct/in-range values for request initialization. 4642 * // - It may require specifying regional endpoints when creating the service client as shown in 4643 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4644 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4645 * MigratingVmName parent = 4646 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 4647 * for (CutoverJob element : vmMigrationClient.listCutoverJobs(parent).iterateAll()) { 4648 * // doThingsWith(element); 4649 * } 4650 * } 4651 * }</pre> 4652 * 4653 * @param parent Required. The parent, which owns this collection of migrating VMs. 4654 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4655 */ listCutoverJobs(MigratingVmName parent)4656 public final ListCutoverJobsPagedResponse listCutoverJobs(MigratingVmName parent) { 4657 ListCutoverJobsRequest request = 4658 ListCutoverJobsRequest.newBuilder() 4659 .setParent(parent == null ? null : parent.toString()) 4660 .build(); 4661 return listCutoverJobs(request); 4662 } 4663 4664 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4665 /** 4666 * Lists CutoverJobs of a given migrating VM. 4667 * 4668 * <p>Sample code: 4669 * 4670 * <pre>{@code 4671 * // This snippet has been automatically generated and should be regarded as a code template only. 4672 * // It will require modifications to work: 4673 * // - It may require correct/in-range values for request initialization. 4674 * // - It may require specifying regional endpoints when creating the service client as shown in 4675 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4676 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4677 * String parent = 4678 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 4679 * for (CutoverJob element : vmMigrationClient.listCutoverJobs(parent).iterateAll()) { 4680 * // doThingsWith(element); 4681 * } 4682 * } 4683 * }</pre> 4684 * 4685 * @param parent Required. The parent, which owns this collection of migrating VMs. 4686 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4687 */ listCutoverJobs(String parent)4688 public final ListCutoverJobsPagedResponse listCutoverJobs(String parent) { 4689 ListCutoverJobsRequest request = ListCutoverJobsRequest.newBuilder().setParent(parent).build(); 4690 return listCutoverJobs(request); 4691 } 4692 4693 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4694 /** 4695 * Lists CutoverJobs of a given migrating VM. 4696 * 4697 * <p>Sample code: 4698 * 4699 * <pre>{@code 4700 * // This snippet has been automatically generated and should be regarded as a code template only. 4701 * // It will require modifications to work: 4702 * // - It may require correct/in-range values for request initialization. 4703 * // - It may require specifying regional endpoints when creating the service client as shown in 4704 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4705 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4706 * ListCutoverJobsRequest request = 4707 * ListCutoverJobsRequest.newBuilder() 4708 * .setParent( 4709 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4710 * .toString()) 4711 * .setPageSize(883849137) 4712 * .setPageToken("pageToken873572522") 4713 * .setFilter("filter-1274492040") 4714 * .setOrderBy("orderBy-1207110587") 4715 * .build(); 4716 * for (CutoverJob element : vmMigrationClient.listCutoverJobs(request).iterateAll()) { 4717 * // doThingsWith(element); 4718 * } 4719 * } 4720 * }</pre> 4721 * 4722 * @param request The request object containing all of the parameters for the API call. 4723 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4724 */ listCutoverJobs(ListCutoverJobsRequest request)4725 public final ListCutoverJobsPagedResponse listCutoverJobs(ListCutoverJobsRequest request) { 4726 return listCutoverJobsPagedCallable().call(request); 4727 } 4728 4729 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4730 /** 4731 * Lists CutoverJobs of a given migrating VM. 4732 * 4733 * <p>Sample code: 4734 * 4735 * <pre>{@code 4736 * // This snippet has been automatically generated and should be regarded as a code template only. 4737 * // It will require modifications to work: 4738 * // - It may require correct/in-range values for request initialization. 4739 * // - It may require specifying regional endpoints when creating the service client as shown in 4740 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4741 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4742 * ListCutoverJobsRequest request = 4743 * ListCutoverJobsRequest.newBuilder() 4744 * .setParent( 4745 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4746 * .toString()) 4747 * .setPageSize(883849137) 4748 * .setPageToken("pageToken873572522") 4749 * .setFilter("filter-1274492040") 4750 * .setOrderBy("orderBy-1207110587") 4751 * .build(); 4752 * ApiFuture<CutoverJob> future = 4753 * vmMigrationClient.listCutoverJobsPagedCallable().futureCall(request); 4754 * // Do something. 4755 * for (CutoverJob element : future.get().iterateAll()) { 4756 * // doThingsWith(element); 4757 * } 4758 * } 4759 * }</pre> 4760 */ 4761 public final UnaryCallable<ListCutoverJobsRequest, ListCutoverJobsPagedResponse> listCutoverJobsPagedCallable()4762 listCutoverJobsPagedCallable() { 4763 return stub.listCutoverJobsPagedCallable(); 4764 } 4765 4766 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4767 /** 4768 * Lists CutoverJobs of a given migrating VM. 4769 * 4770 * <p>Sample code: 4771 * 4772 * <pre>{@code 4773 * // This snippet has been automatically generated and should be regarded as a code template only. 4774 * // It will require modifications to work: 4775 * // - It may require correct/in-range values for request initialization. 4776 * // - It may require specifying regional endpoints when creating the service client as shown in 4777 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4778 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4779 * ListCutoverJobsRequest request = 4780 * ListCutoverJobsRequest.newBuilder() 4781 * .setParent( 4782 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 4783 * .toString()) 4784 * .setPageSize(883849137) 4785 * .setPageToken("pageToken873572522") 4786 * .setFilter("filter-1274492040") 4787 * .setOrderBy("orderBy-1207110587") 4788 * .build(); 4789 * while (true) { 4790 * ListCutoverJobsResponse response = 4791 * vmMigrationClient.listCutoverJobsCallable().call(request); 4792 * for (CutoverJob element : response.getCutoverJobsList()) { 4793 * // doThingsWith(element); 4794 * } 4795 * String nextPageToken = response.getNextPageToken(); 4796 * if (!Strings.isNullOrEmpty(nextPageToken)) { 4797 * request = request.toBuilder().setPageToken(nextPageToken).build(); 4798 * } else { 4799 * break; 4800 * } 4801 * } 4802 * } 4803 * }</pre> 4804 */ 4805 public final UnaryCallable<ListCutoverJobsRequest, ListCutoverJobsResponse> listCutoverJobsCallable()4806 listCutoverJobsCallable() { 4807 return stub.listCutoverJobsCallable(); 4808 } 4809 4810 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4811 /** 4812 * Gets details of a single CutoverJob. 4813 * 4814 * <p>Sample code: 4815 * 4816 * <pre>{@code 4817 * // This snippet has been automatically generated and should be regarded as a code template only. 4818 * // It will require modifications to work: 4819 * // - It may require correct/in-range values for request initialization. 4820 * // - It may require specifying regional endpoints when creating the service client as shown in 4821 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4822 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4823 * CutoverJobName name = 4824 * CutoverJobName.of( 4825 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]"); 4826 * CutoverJob response = vmMigrationClient.getCutoverJob(name); 4827 * } 4828 * }</pre> 4829 * 4830 * @param name Required. The name of the CutoverJob. 4831 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4832 */ getCutoverJob(CutoverJobName name)4833 public final CutoverJob getCutoverJob(CutoverJobName name) { 4834 GetCutoverJobRequest request = 4835 GetCutoverJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 4836 return getCutoverJob(request); 4837 } 4838 4839 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4840 /** 4841 * Gets details of a single CutoverJob. 4842 * 4843 * <p>Sample code: 4844 * 4845 * <pre>{@code 4846 * // This snippet has been automatically generated and should be regarded as a code template only. 4847 * // It will require modifications to work: 4848 * // - It may require correct/in-range values for request initialization. 4849 * // - It may require specifying regional endpoints when creating the service client as shown in 4850 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4851 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4852 * String name = 4853 * CutoverJobName.of( 4854 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]") 4855 * .toString(); 4856 * CutoverJob response = vmMigrationClient.getCutoverJob(name); 4857 * } 4858 * }</pre> 4859 * 4860 * @param name Required. The name of the CutoverJob. 4861 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4862 */ getCutoverJob(String name)4863 public final CutoverJob getCutoverJob(String name) { 4864 GetCutoverJobRequest request = GetCutoverJobRequest.newBuilder().setName(name).build(); 4865 return getCutoverJob(request); 4866 } 4867 4868 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4869 /** 4870 * Gets details of a single CutoverJob. 4871 * 4872 * <p>Sample code: 4873 * 4874 * <pre>{@code 4875 * // This snippet has been automatically generated and should be regarded as a code template only. 4876 * // It will require modifications to work: 4877 * // - It may require correct/in-range values for request initialization. 4878 * // - It may require specifying regional endpoints when creating the service client as shown in 4879 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4880 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4881 * GetCutoverJobRequest request = 4882 * GetCutoverJobRequest.newBuilder() 4883 * .setName( 4884 * CutoverJobName.of( 4885 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]") 4886 * .toString()) 4887 * .build(); 4888 * CutoverJob response = vmMigrationClient.getCutoverJob(request); 4889 * } 4890 * }</pre> 4891 * 4892 * @param request The request object containing all of the parameters for the API call. 4893 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4894 */ getCutoverJob(GetCutoverJobRequest request)4895 public final CutoverJob getCutoverJob(GetCutoverJobRequest request) { 4896 return getCutoverJobCallable().call(request); 4897 } 4898 4899 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4900 /** 4901 * Gets details of a single CutoverJob. 4902 * 4903 * <p>Sample code: 4904 * 4905 * <pre>{@code 4906 * // This snippet has been automatically generated and should be regarded as a code template only. 4907 * // It will require modifications to work: 4908 * // - It may require correct/in-range values for request initialization. 4909 * // - It may require specifying regional endpoints when creating the service client as shown in 4910 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4911 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4912 * GetCutoverJobRequest request = 4913 * GetCutoverJobRequest.newBuilder() 4914 * .setName( 4915 * CutoverJobName.of( 4916 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]") 4917 * .toString()) 4918 * .build(); 4919 * ApiFuture<CutoverJob> future = vmMigrationClient.getCutoverJobCallable().futureCall(request); 4920 * // Do something. 4921 * CutoverJob response = future.get(); 4922 * } 4923 * }</pre> 4924 */ getCutoverJobCallable()4925 public final UnaryCallable<GetCutoverJobRequest, CutoverJob> getCutoverJobCallable() { 4926 return stub.getCutoverJobCallable(); 4927 } 4928 4929 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4930 /** 4931 * Lists Groups in a given project and location. 4932 * 4933 * <p>Sample code: 4934 * 4935 * <pre>{@code 4936 * // This snippet has been automatically generated and should be regarded as a code template only. 4937 * // It will require modifications to work: 4938 * // - It may require correct/in-range values for request initialization. 4939 * // - It may require specifying regional endpoints when creating the service client as shown in 4940 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4941 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4942 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 4943 * for (Group element : vmMigrationClient.listGroups(parent).iterateAll()) { 4944 * // doThingsWith(element); 4945 * } 4946 * } 4947 * }</pre> 4948 * 4949 * @param parent Required. The parent, which owns this collection of groups. 4950 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4951 */ listGroups(LocationName parent)4952 public final ListGroupsPagedResponse listGroups(LocationName parent) { 4953 ListGroupsRequest request = 4954 ListGroupsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); 4955 return listGroups(request); 4956 } 4957 4958 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4959 /** 4960 * Lists Groups in a given project and location. 4961 * 4962 * <p>Sample code: 4963 * 4964 * <pre>{@code 4965 * // This snippet has been automatically generated and should be regarded as a code template only. 4966 * // It will require modifications to work: 4967 * // - It may require correct/in-range values for request initialization. 4968 * // - It may require specifying regional endpoints when creating the service client as shown in 4969 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4970 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4971 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 4972 * for (Group element : vmMigrationClient.listGroups(parent).iterateAll()) { 4973 * // doThingsWith(element); 4974 * } 4975 * } 4976 * }</pre> 4977 * 4978 * @param parent Required. The parent, which owns this collection of groups. 4979 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4980 */ listGroups(String parent)4981 public final ListGroupsPagedResponse listGroups(String parent) { 4982 ListGroupsRequest request = ListGroupsRequest.newBuilder().setParent(parent).build(); 4983 return listGroups(request); 4984 } 4985 4986 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4987 /** 4988 * Lists Groups in a given project and location. 4989 * 4990 * <p>Sample code: 4991 * 4992 * <pre>{@code 4993 * // This snippet has been automatically generated and should be regarded as a code template only. 4994 * // It will require modifications to work: 4995 * // - It may require correct/in-range values for request initialization. 4996 * // - It may require specifying regional endpoints when creating the service client as shown in 4997 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4998 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 4999 * ListGroupsRequest request = 5000 * ListGroupsRequest.newBuilder() 5001 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 5002 * .setPageSize(883849137) 5003 * .setPageToken("pageToken873572522") 5004 * .setFilter("filter-1274492040") 5005 * .setOrderBy("orderBy-1207110587") 5006 * .build(); 5007 * for (Group element : vmMigrationClient.listGroups(request).iterateAll()) { 5008 * // doThingsWith(element); 5009 * } 5010 * } 5011 * }</pre> 5012 * 5013 * @param request The request object containing all of the parameters for the API call. 5014 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5015 */ listGroups(ListGroupsRequest request)5016 public final ListGroupsPagedResponse listGroups(ListGroupsRequest request) { 5017 return listGroupsPagedCallable().call(request); 5018 } 5019 5020 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5021 /** 5022 * Lists Groups in a given project and location. 5023 * 5024 * <p>Sample code: 5025 * 5026 * <pre>{@code 5027 * // This snippet has been automatically generated and should be regarded as a code template only. 5028 * // It will require modifications to work: 5029 * // - It may require correct/in-range values for request initialization. 5030 * // - It may require specifying regional endpoints when creating the service client as shown in 5031 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5032 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5033 * ListGroupsRequest request = 5034 * ListGroupsRequest.newBuilder() 5035 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 5036 * .setPageSize(883849137) 5037 * .setPageToken("pageToken873572522") 5038 * .setFilter("filter-1274492040") 5039 * .setOrderBy("orderBy-1207110587") 5040 * .build(); 5041 * ApiFuture<Group> future = vmMigrationClient.listGroupsPagedCallable().futureCall(request); 5042 * // Do something. 5043 * for (Group element : future.get().iterateAll()) { 5044 * // doThingsWith(element); 5045 * } 5046 * } 5047 * }</pre> 5048 */ listGroupsPagedCallable()5049 public final UnaryCallable<ListGroupsRequest, ListGroupsPagedResponse> listGroupsPagedCallable() { 5050 return stub.listGroupsPagedCallable(); 5051 } 5052 5053 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5054 /** 5055 * Lists Groups in a given project and location. 5056 * 5057 * <p>Sample code: 5058 * 5059 * <pre>{@code 5060 * // This snippet has been automatically generated and should be regarded as a code template only. 5061 * // It will require modifications to work: 5062 * // - It may require correct/in-range values for request initialization. 5063 * // - It may require specifying regional endpoints when creating the service client as shown in 5064 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5065 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5066 * ListGroupsRequest request = 5067 * ListGroupsRequest.newBuilder() 5068 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 5069 * .setPageSize(883849137) 5070 * .setPageToken("pageToken873572522") 5071 * .setFilter("filter-1274492040") 5072 * .setOrderBy("orderBy-1207110587") 5073 * .build(); 5074 * while (true) { 5075 * ListGroupsResponse response = vmMigrationClient.listGroupsCallable().call(request); 5076 * for (Group element : response.getGroupsList()) { 5077 * // doThingsWith(element); 5078 * } 5079 * String nextPageToken = response.getNextPageToken(); 5080 * if (!Strings.isNullOrEmpty(nextPageToken)) { 5081 * request = request.toBuilder().setPageToken(nextPageToken).build(); 5082 * } else { 5083 * break; 5084 * } 5085 * } 5086 * } 5087 * }</pre> 5088 */ listGroupsCallable()5089 public final UnaryCallable<ListGroupsRequest, ListGroupsResponse> listGroupsCallable() { 5090 return stub.listGroupsCallable(); 5091 } 5092 5093 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5094 /** 5095 * Gets details of a single Group. 5096 * 5097 * <p>Sample code: 5098 * 5099 * <pre>{@code 5100 * // This snippet has been automatically generated and should be regarded as a code template only. 5101 * // It will require modifications to work: 5102 * // - It may require correct/in-range values for request initialization. 5103 * // - It may require specifying regional endpoints when creating the service client as shown in 5104 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5105 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5106 * GroupName name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]"); 5107 * Group response = vmMigrationClient.getGroup(name); 5108 * } 5109 * }</pre> 5110 * 5111 * @param name Required. The group name. 5112 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5113 */ getGroup(GroupName name)5114 public final Group getGroup(GroupName name) { 5115 GetGroupRequest request = 5116 GetGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 5117 return getGroup(request); 5118 } 5119 5120 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5121 /** 5122 * Gets details of a single Group. 5123 * 5124 * <p>Sample code: 5125 * 5126 * <pre>{@code 5127 * // This snippet has been automatically generated and should be regarded as a code template only. 5128 * // It will require modifications to work: 5129 * // - It may require correct/in-range values for request initialization. 5130 * // - It may require specifying regional endpoints when creating the service client as shown in 5131 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5132 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5133 * String name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString(); 5134 * Group response = vmMigrationClient.getGroup(name); 5135 * } 5136 * }</pre> 5137 * 5138 * @param name Required. The group name. 5139 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5140 */ getGroup(String name)5141 public final Group getGroup(String name) { 5142 GetGroupRequest request = GetGroupRequest.newBuilder().setName(name).build(); 5143 return getGroup(request); 5144 } 5145 5146 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5147 /** 5148 * Gets details of a single Group. 5149 * 5150 * <p>Sample code: 5151 * 5152 * <pre>{@code 5153 * // This snippet has been automatically generated and should be regarded as a code template only. 5154 * // It will require modifications to work: 5155 * // - It may require correct/in-range values for request initialization. 5156 * // - It may require specifying regional endpoints when creating the service client as shown in 5157 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5158 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5159 * GetGroupRequest request = 5160 * GetGroupRequest.newBuilder() 5161 * .setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5162 * .build(); 5163 * Group response = vmMigrationClient.getGroup(request); 5164 * } 5165 * }</pre> 5166 * 5167 * @param request The request object containing all of the parameters for the API call. 5168 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5169 */ getGroup(GetGroupRequest request)5170 public final Group getGroup(GetGroupRequest request) { 5171 return getGroupCallable().call(request); 5172 } 5173 5174 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5175 /** 5176 * Gets details of a single Group. 5177 * 5178 * <p>Sample code: 5179 * 5180 * <pre>{@code 5181 * // This snippet has been automatically generated and should be regarded as a code template only. 5182 * // It will require modifications to work: 5183 * // - It may require correct/in-range values for request initialization. 5184 * // - It may require specifying regional endpoints when creating the service client as shown in 5185 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5186 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5187 * GetGroupRequest request = 5188 * GetGroupRequest.newBuilder() 5189 * .setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5190 * .build(); 5191 * ApiFuture<Group> future = vmMigrationClient.getGroupCallable().futureCall(request); 5192 * // Do something. 5193 * Group response = future.get(); 5194 * } 5195 * }</pre> 5196 */ getGroupCallable()5197 public final UnaryCallable<GetGroupRequest, Group> getGroupCallable() { 5198 return stub.getGroupCallable(); 5199 } 5200 5201 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5202 /** 5203 * Creates a new Group in a given project and location. 5204 * 5205 * <p>Sample code: 5206 * 5207 * <pre>{@code 5208 * // This snippet has been automatically generated and should be regarded as a code template only. 5209 * // It will require modifications to work: 5210 * // - It may require correct/in-range values for request initialization. 5211 * // - It may require specifying regional endpoints when creating the service client as shown in 5212 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5213 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5214 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 5215 * Group group = Group.newBuilder().build(); 5216 * String groupId = "groupId293428218"; 5217 * Group response = vmMigrationClient.createGroupAsync(parent, group, groupId).get(); 5218 * } 5219 * }</pre> 5220 * 5221 * @param parent Required. The Group's parent. 5222 * @param group Required. The create request body. 5223 * @param groupId Required. The group identifier. 5224 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5225 */ createGroupAsync( LocationName parent, Group group, String groupId)5226 public final OperationFuture<Group, OperationMetadata> createGroupAsync( 5227 LocationName parent, Group group, String groupId) { 5228 CreateGroupRequest request = 5229 CreateGroupRequest.newBuilder() 5230 .setParent(parent == null ? null : parent.toString()) 5231 .setGroup(group) 5232 .setGroupId(groupId) 5233 .build(); 5234 return createGroupAsync(request); 5235 } 5236 5237 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5238 /** 5239 * Creates a new Group in a given project and location. 5240 * 5241 * <p>Sample code: 5242 * 5243 * <pre>{@code 5244 * // This snippet has been automatically generated and should be regarded as a code template only. 5245 * // It will require modifications to work: 5246 * // - It may require correct/in-range values for request initialization. 5247 * // - It may require specifying regional endpoints when creating the service client as shown in 5248 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5249 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5250 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 5251 * Group group = Group.newBuilder().build(); 5252 * String groupId = "groupId293428218"; 5253 * Group response = vmMigrationClient.createGroupAsync(parent, group, groupId).get(); 5254 * } 5255 * }</pre> 5256 * 5257 * @param parent Required. The Group's parent. 5258 * @param group Required. The create request body. 5259 * @param groupId Required. The group identifier. 5260 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5261 */ createGroupAsync( String parent, Group group, String groupId)5262 public final OperationFuture<Group, OperationMetadata> createGroupAsync( 5263 String parent, Group group, String groupId) { 5264 CreateGroupRequest request = 5265 CreateGroupRequest.newBuilder() 5266 .setParent(parent) 5267 .setGroup(group) 5268 .setGroupId(groupId) 5269 .build(); 5270 return createGroupAsync(request); 5271 } 5272 5273 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5274 /** 5275 * Creates a new Group in a given project and location. 5276 * 5277 * <p>Sample code: 5278 * 5279 * <pre>{@code 5280 * // This snippet has been automatically generated and should be regarded as a code template only. 5281 * // It will require modifications to work: 5282 * // - It may require correct/in-range values for request initialization. 5283 * // - It may require specifying regional endpoints when creating the service client as shown in 5284 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5285 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5286 * CreateGroupRequest request = 5287 * CreateGroupRequest.newBuilder() 5288 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 5289 * .setGroupId("groupId293428218") 5290 * .setGroup(Group.newBuilder().build()) 5291 * .setRequestId("requestId693933066") 5292 * .build(); 5293 * Group response = vmMigrationClient.createGroupAsync(request).get(); 5294 * } 5295 * }</pre> 5296 * 5297 * @param request The request object containing all of the parameters for the API call. 5298 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5299 */ createGroupAsync( CreateGroupRequest request)5300 public final OperationFuture<Group, OperationMetadata> createGroupAsync( 5301 CreateGroupRequest request) { 5302 return createGroupOperationCallable().futureCall(request); 5303 } 5304 5305 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5306 /** 5307 * Creates a new Group in a given project and location. 5308 * 5309 * <p>Sample code: 5310 * 5311 * <pre>{@code 5312 * // This snippet has been automatically generated and should be regarded as a code template only. 5313 * // It will require modifications to work: 5314 * // - It may require correct/in-range values for request initialization. 5315 * // - It may require specifying regional endpoints when creating the service client as shown in 5316 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5317 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5318 * CreateGroupRequest request = 5319 * CreateGroupRequest.newBuilder() 5320 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 5321 * .setGroupId("groupId293428218") 5322 * .setGroup(Group.newBuilder().build()) 5323 * .setRequestId("requestId693933066") 5324 * .build(); 5325 * OperationFuture<Group, OperationMetadata> future = 5326 * vmMigrationClient.createGroupOperationCallable().futureCall(request); 5327 * // Do something. 5328 * Group response = future.get(); 5329 * } 5330 * }</pre> 5331 */ 5332 public final OperationCallable<CreateGroupRequest, Group, OperationMetadata> createGroupOperationCallable()5333 createGroupOperationCallable() { 5334 return stub.createGroupOperationCallable(); 5335 } 5336 5337 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5338 /** 5339 * Creates a new Group in a given project and location. 5340 * 5341 * <p>Sample code: 5342 * 5343 * <pre>{@code 5344 * // This snippet has been automatically generated and should be regarded as a code template only. 5345 * // It will require modifications to work: 5346 * // - It may require correct/in-range values for request initialization. 5347 * // - It may require specifying regional endpoints when creating the service client as shown in 5348 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5349 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5350 * CreateGroupRequest request = 5351 * CreateGroupRequest.newBuilder() 5352 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 5353 * .setGroupId("groupId293428218") 5354 * .setGroup(Group.newBuilder().build()) 5355 * .setRequestId("requestId693933066") 5356 * .build(); 5357 * ApiFuture<Operation> future = vmMigrationClient.createGroupCallable().futureCall(request); 5358 * // Do something. 5359 * Operation response = future.get(); 5360 * } 5361 * }</pre> 5362 */ createGroupCallable()5363 public final UnaryCallable<CreateGroupRequest, Operation> createGroupCallable() { 5364 return stub.createGroupCallable(); 5365 } 5366 5367 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5368 /** 5369 * Updates the parameters of a single Group. 5370 * 5371 * <p>Sample code: 5372 * 5373 * <pre>{@code 5374 * // This snippet has been automatically generated and should be regarded as a code template only. 5375 * // It will require modifications to work: 5376 * // - It may require correct/in-range values for request initialization. 5377 * // - It may require specifying regional endpoints when creating the service client as shown in 5378 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5379 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5380 * Group group = Group.newBuilder().build(); 5381 * FieldMask updateMask = FieldMask.newBuilder().build(); 5382 * Group response = vmMigrationClient.updateGroupAsync(group, updateMask).get(); 5383 * } 5384 * }</pre> 5385 * 5386 * @param group Required. The update request body. 5387 * @param updateMask Field mask is used to specify the fields to be overwritten in the Group 5388 * resource by the update. The fields specified in the update_mask are relative to the 5389 * resource, not the full request. A field will be overwritten if it is in the mask. If the 5390 * user does not provide a mask then all fields will be overwritten. 5391 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5392 */ updateGroupAsync( Group group, FieldMask updateMask)5393 public final OperationFuture<Group, OperationMetadata> updateGroupAsync( 5394 Group group, FieldMask updateMask) { 5395 UpdateGroupRequest request = 5396 UpdateGroupRequest.newBuilder().setGroup(group).setUpdateMask(updateMask).build(); 5397 return updateGroupAsync(request); 5398 } 5399 5400 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5401 /** 5402 * Updates the parameters of a single Group. 5403 * 5404 * <p>Sample code: 5405 * 5406 * <pre>{@code 5407 * // This snippet has been automatically generated and should be regarded as a code template only. 5408 * // It will require modifications to work: 5409 * // - It may require correct/in-range values for request initialization. 5410 * // - It may require specifying regional endpoints when creating the service client as shown in 5411 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5412 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5413 * UpdateGroupRequest request = 5414 * UpdateGroupRequest.newBuilder() 5415 * .setUpdateMask(FieldMask.newBuilder().build()) 5416 * .setGroup(Group.newBuilder().build()) 5417 * .setRequestId("requestId693933066") 5418 * .build(); 5419 * Group response = vmMigrationClient.updateGroupAsync(request).get(); 5420 * } 5421 * }</pre> 5422 * 5423 * @param request The request object containing all of the parameters for the API call. 5424 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5425 */ updateGroupAsync( UpdateGroupRequest request)5426 public final OperationFuture<Group, OperationMetadata> updateGroupAsync( 5427 UpdateGroupRequest request) { 5428 return updateGroupOperationCallable().futureCall(request); 5429 } 5430 5431 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5432 /** 5433 * Updates the parameters of a single Group. 5434 * 5435 * <p>Sample code: 5436 * 5437 * <pre>{@code 5438 * // This snippet has been automatically generated and should be regarded as a code template only. 5439 * // It will require modifications to work: 5440 * // - It may require correct/in-range values for request initialization. 5441 * // - It may require specifying regional endpoints when creating the service client as shown in 5442 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5443 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5444 * UpdateGroupRequest request = 5445 * UpdateGroupRequest.newBuilder() 5446 * .setUpdateMask(FieldMask.newBuilder().build()) 5447 * .setGroup(Group.newBuilder().build()) 5448 * .setRequestId("requestId693933066") 5449 * .build(); 5450 * OperationFuture<Group, OperationMetadata> future = 5451 * vmMigrationClient.updateGroupOperationCallable().futureCall(request); 5452 * // Do something. 5453 * Group response = future.get(); 5454 * } 5455 * }</pre> 5456 */ 5457 public final OperationCallable<UpdateGroupRequest, Group, OperationMetadata> updateGroupOperationCallable()5458 updateGroupOperationCallable() { 5459 return stub.updateGroupOperationCallable(); 5460 } 5461 5462 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5463 /** 5464 * Updates the parameters of a single Group. 5465 * 5466 * <p>Sample code: 5467 * 5468 * <pre>{@code 5469 * // This snippet has been automatically generated and should be regarded as a code template only. 5470 * // It will require modifications to work: 5471 * // - It may require correct/in-range values for request initialization. 5472 * // - It may require specifying regional endpoints when creating the service client as shown in 5473 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5474 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5475 * UpdateGroupRequest request = 5476 * UpdateGroupRequest.newBuilder() 5477 * .setUpdateMask(FieldMask.newBuilder().build()) 5478 * .setGroup(Group.newBuilder().build()) 5479 * .setRequestId("requestId693933066") 5480 * .build(); 5481 * ApiFuture<Operation> future = vmMigrationClient.updateGroupCallable().futureCall(request); 5482 * // Do something. 5483 * Operation response = future.get(); 5484 * } 5485 * }</pre> 5486 */ updateGroupCallable()5487 public final UnaryCallable<UpdateGroupRequest, Operation> updateGroupCallable() { 5488 return stub.updateGroupCallable(); 5489 } 5490 5491 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5492 /** 5493 * Deletes a single Group. 5494 * 5495 * <p>Sample code: 5496 * 5497 * <pre>{@code 5498 * // This snippet has been automatically generated and should be regarded as a code template only. 5499 * // It will require modifications to work: 5500 * // - It may require correct/in-range values for request initialization. 5501 * // - It may require specifying regional endpoints when creating the service client as shown in 5502 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5503 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5504 * GroupName name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]"); 5505 * vmMigrationClient.deleteGroupAsync(name).get(); 5506 * } 5507 * }</pre> 5508 * 5509 * @param name Required. The Group name. 5510 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5511 */ deleteGroupAsync(GroupName name)5512 public final OperationFuture<Empty, OperationMetadata> deleteGroupAsync(GroupName name) { 5513 DeleteGroupRequest request = 5514 DeleteGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 5515 return deleteGroupAsync(request); 5516 } 5517 5518 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5519 /** 5520 * Deletes a single Group. 5521 * 5522 * <p>Sample code: 5523 * 5524 * <pre>{@code 5525 * // This snippet has been automatically generated and should be regarded as a code template only. 5526 * // It will require modifications to work: 5527 * // - It may require correct/in-range values for request initialization. 5528 * // - It may require specifying regional endpoints when creating the service client as shown in 5529 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5530 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5531 * String name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString(); 5532 * vmMigrationClient.deleteGroupAsync(name).get(); 5533 * } 5534 * }</pre> 5535 * 5536 * @param name Required. The Group name. 5537 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5538 */ deleteGroupAsync(String name)5539 public final OperationFuture<Empty, OperationMetadata> deleteGroupAsync(String name) { 5540 DeleteGroupRequest request = DeleteGroupRequest.newBuilder().setName(name).build(); 5541 return deleteGroupAsync(request); 5542 } 5543 5544 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5545 /** 5546 * Deletes a single Group. 5547 * 5548 * <p>Sample code: 5549 * 5550 * <pre>{@code 5551 * // This snippet has been automatically generated and should be regarded as a code template only. 5552 * // It will require modifications to work: 5553 * // - It may require correct/in-range values for request initialization. 5554 * // - It may require specifying regional endpoints when creating the service client as shown in 5555 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5556 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5557 * DeleteGroupRequest request = 5558 * DeleteGroupRequest.newBuilder() 5559 * .setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5560 * .setRequestId("requestId693933066") 5561 * .build(); 5562 * vmMigrationClient.deleteGroupAsync(request).get(); 5563 * } 5564 * }</pre> 5565 * 5566 * @param request The request object containing all of the parameters for the API call. 5567 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5568 */ deleteGroupAsync( DeleteGroupRequest request)5569 public final OperationFuture<Empty, OperationMetadata> deleteGroupAsync( 5570 DeleteGroupRequest request) { 5571 return deleteGroupOperationCallable().futureCall(request); 5572 } 5573 5574 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5575 /** 5576 * Deletes a single Group. 5577 * 5578 * <p>Sample code: 5579 * 5580 * <pre>{@code 5581 * // This snippet has been automatically generated and should be regarded as a code template only. 5582 * // It will require modifications to work: 5583 * // - It may require correct/in-range values for request initialization. 5584 * // - It may require specifying regional endpoints when creating the service client as shown in 5585 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5586 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5587 * DeleteGroupRequest request = 5588 * DeleteGroupRequest.newBuilder() 5589 * .setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5590 * .setRequestId("requestId693933066") 5591 * .build(); 5592 * OperationFuture<Empty, OperationMetadata> future = 5593 * vmMigrationClient.deleteGroupOperationCallable().futureCall(request); 5594 * // Do something. 5595 * future.get(); 5596 * } 5597 * }</pre> 5598 */ 5599 public final OperationCallable<DeleteGroupRequest, Empty, OperationMetadata> deleteGroupOperationCallable()5600 deleteGroupOperationCallable() { 5601 return stub.deleteGroupOperationCallable(); 5602 } 5603 5604 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5605 /** 5606 * Deletes a single Group. 5607 * 5608 * <p>Sample code: 5609 * 5610 * <pre>{@code 5611 * // This snippet has been automatically generated and should be regarded as a code template only. 5612 * // It will require modifications to work: 5613 * // - It may require correct/in-range values for request initialization. 5614 * // - It may require specifying regional endpoints when creating the service client as shown in 5615 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5616 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5617 * DeleteGroupRequest request = 5618 * DeleteGroupRequest.newBuilder() 5619 * .setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5620 * .setRequestId("requestId693933066") 5621 * .build(); 5622 * ApiFuture<Operation> future = vmMigrationClient.deleteGroupCallable().futureCall(request); 5623 * // Do something. 5624 * future.get(); 5625 * } 5626 * }</pre> 5627 */ deleteGroupCallable()5628 public final UnaryCallable<DeleteGroupRequest, Operation> deleteGroupCallable() { 5629 return stub.deleteGroupCallable(); 5630 } 5631 5632 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5633 /** 5634 * Adds a MigratingVm to a Group. 5635 * 5636 * <p>Sample code: 5637 * 5638 * <pre>{@code 5639 * // This snippet has been automatically generated and should be regarded as a code template only. 5640 * // It will require modifications to work: 5641 * // - It may require correct/in-range values for request initialization. 5642 * // - It may require specifying regional endpoints when creating the service client as shown in 5643 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5644 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5645 * GroupName group = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]"); 5646 * AddGroupMigrationResponse response = vmMigrationClient.addGroupMigrationAsync(group).get(); 5647 * } 5648 * }</pre> 5649 * 5650 * @param group Required. The full path name of the Group to add to. 5651 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5652 */ addGroupMigrationAsync( GroupName group)5653 public final OperationFuture<AddGroupMigrationResponse, OperationMetadata> addGroupMigrationAsync( 5654 GroupName group) { 5655 AddGroupMigrationRequest request = 5656 AddGroupMigrationRequest.newBuilder() 5657 .setGroup(group == null ? null : group.toString()) 5658 .build(); 5659 return addGroupMigrationAsync(request); 5660 } 5661 5662 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5663 /** 5664 * Adds a MigratingVm to a Group. 5665 * 5666 * <p>Sample code: 5667 * 5668 * <pre>{@code 5669 * // This snippet has been automatically generated and should be regarded as a code template only. 5670 * // It will require modifications to work: 5671 * // - It may require correct/in-range values for request initialization. 5672 * // - It may require specifying regional endpoints when creating the service client as shown in 5673 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5674 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5675 * String group = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString(); 5676 * AddGroupMigrationResponse response = vmMigrationClient.addGroupMigrationAsync(group).get(); 5677 * } 5678 * }</pre> 5679 * 5680 * @param group Required. The full path name of the Group to add to. 5681 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5682 */ addGroupMigrationAsync( String group)5683 public final OperationFuture<AddGroupMigrationResponse, OperationMetadata> addGroupMigrationAsync( 5684 String group) { 5685 AddGroupMigrationRequest request = 5686 AddGroupMigrationRequest.newBuilder().setGroup(group).build(); 5687 return addGroupMigrationAsync(request); 5688 } 5689 5690 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5691 /** 5692 * Adds a MigratingVm to a Group. 5693 * 5694 * <p>Sample code: 5695 * 5696 * <pre>{@code 5697 * // This snippet has been automatically generated and should be regarded as a code template only. 5698 * // It will require modifications to work: 5699 * // - It may require correct/in-range values for request initialization. 5700 * // - It may require specifying regional endpoints when creating the service client as shown in 5701 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5702 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5703 * AddGroupMigrationRequest request = 5704 * AddGroupMigrationRequest.newBuilder() 5705 * .setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5706 * .setMigratingVm( 5707 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 5708 * .toString()) 5709 * .build(); 5710 * AddGroupMigrationResponse response = vmMigrationClient.addGroupMigrationAsync(request).get(); 5711 * } 5712 * }</pre> 5713 * 5714 * @param request The request object containing all of the parameters for the API call. 5715 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5716 */ addGroupMigrationAsync( AddGroupMigrationRequest request)5717 public final OperationFuture<AddGroupMigrationResponse, OperationMetadata> addGroupMigrationAsync( 5718 AddGroupMigrationRequest request) { 5719 return addGroupMigrationOperationCallable().futureCall(request); 5720 } 5721 5722 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5723 /** 5724 * Adds a MigratingVm to a Group. 5725 * 5726 * <p>Sample code: 5727 * 5728 * <pre>{@code 5729 * // This snippet has been automatically generated and should be regarded as a code template only. 5730 * // It will require modifications to work: 5731 * // - It may require correct/in-range values for request initialization. 5732 * // - It may require specifying regional endpoints when creating the service client as shown in 5733 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5734 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5735 * AddGroupMigrationRequest request = 5736 * AddGroupMigrationRequest.newBuilder() 5737 * .setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5738 * .setMigratingVm( 5739 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 5740 * .toString()) 5741 * .build(); 5742 * OperationFuture<AddGroupMigrationResponse, OperationMetadata> future = 5743 * vmMigrationClient.addGroupMigrationOperationCallable().futureCall(request); 5744 * // Do something. 5745 * AddGroupMigrationResponse response = future.get(); 5746 * } 5747 * }</pre> 5748 */ 5749 public final OperationCallable< 5750 AddGroupMigrationRequest, AddGroupMigrationResponse, OperationMetadata> addGroupMigrationOperationCallable()5751 addGroupMigrationOperationCallable() { 5752 return stub.addGroupMigrationOperationCallable(); 5753 } 5754 5755 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5756 /** 5757 * Adds a MigratingVm to a Group. 5758 * 5759 * <p>Sample code: 5760 * 5761 * <pre>{@code 5762 * // This snippet has been automatically generated and should be regarded as a code template only. 5763 * // It will require modifications to work: 5764 * // - It may require correct/in-range values for request initialization. 5765 * // - It may require specifying regional endpoints when creating the service client as shown in 5766 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5767 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5768 * AddGroupMigrationRequest request = 5769 * AddGroupMigrationRequest.newBuilder() 5770 * .setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5771 * .setMigratingVm( 5772 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 5773 * .toString()) 5774 * .build(); 5775 * ApiFuture<Operation> future = 5776 * vmMigrationClient.addGroupMigrationCallable().futureCall(request); 5777 * // Do something. 5778 * Operation response = future.get(); 5779 * } 5780 * }</pre> 5781 */ addGroupMigrationCallable()5782 public final UnaryCallable<AddGroupMigrationRequest, Operation> addGroupMigrationCallable() { 5783 return stub.addGroupMigrationCallable(); 5784 } 5785 5786 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5787 /** 5788 * Removes a MigratingVm from a Group. 5789 * 5790 * <p>Sample code: 5791 * 5792 * <pre>{@code 5793 * // This snippet has been automatically generated and should be regarded as a code template only. 5794 * // It will require modifications to work: 5795 * // - It may require correct/in-range values for request initialization. 5796 * // - It may require specifying regional endpoints when creating the service client as shown in 5797 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5798 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5799 * GroupName group = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]"); 5800 * RemoveGroupMigrationResponse response = 5801 * vmMigrationClient.removeGroupMigrationAsync(group).get(); 5802 * } 5803 * }</pre> 5804 * 5805 * @param group Required. The name of the Group. 5806 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5807 */ 5808 public final OperationFuture<RemoveGroupMigrationResponse, OperationMetadata> removeGroupMigrationAsync(GroupName group)5809 removeGroupMigrationAsync(GroupName group) { 5810 RemoveGroupMigrationRequest request = 5811 RemoveGroupMigrationRequest.newBuilder() 5812 .setGroup(group == null ? null : group.toString()) 5813 .build(); 5814 return removeGroupMigrationAsync(request); 5815 } 5816 5817 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5818 /** 5819 * Removes a MigratingVm from a Group. 5820 * 5821 * <p>Sample code: 5822 * 5823 * <pre>{@code 5824 * // This snippet has been automatically generated and should be regarded as a code template only. 5825 * // It will require modifications to work: 5826 * // - It may require correct/in-range values for request initialization. 5827 * // - It may require specifying regional endpoints when creating the service client as shown in 5828 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5829 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5830 * String group = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString(); 5831 * RemoveGroupMigrationResponse response = 5832 * vmMigrationClient.removeGroupMigrationAsync(group).get(); 5833 * } 5834 * }</pre> 5835 * 5836 * @param group Required. The name of the Group. 5837 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5838 */ 5839 public final OperationFuture<RemoveGroupMigrationResponse, OperationMetadata> removeGroupMigrationAsync(String group)5840 removeGroupMigrationAsync(String group) { 5841 RemoveGroupMigrationRequest request = 5842 RemoveGroupMigrationRequest.newBuilder().setGroup(group).build(); 5843 return removeGroupMigrationAsync(request); 5844 } 5845 5846 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5847 /** 5848 * Removes a MigratingVm from a Group. 5849 * 5850 * <p>Sample code: 5851 * 5852 * <pre>{@code 5853 * // This snippet has been automatically generated and should be regarded as a code template only. 5854 * // It will require modifications to work: 5855 * // - It may require correct/in-range values for request initialization. 5856 * // - It may require specifying regional endpoints when creating the service client as shown in 5857 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5858 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5859 * RemoveGroupMigrationRequest request = 5860 * RemoveGroupMigrationRequest.newBuilder() 5861 * .setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5862 * .setMigratingVm( 5863 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 5864 * .toString()) 5865 * .build(); 5866 * RemoveGroupMigrationResponse response = 5867 * vmMigrationClient.removeGroupMigrationAsync(request).get(); 5868 * } 5869 * }</pre> 5870 * 5871 * @param request The request object containing all of the parameters for the API call. 5872 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5873 */ 5874 public final OperationFuture<RemoveGroupMigrationResponse, OperationMetadata> removeGroupMigrationAsync(RemoveGroupMigrationRequest request)5875 removeGroupMigrationAsync(RemoveGroupMigrationRequest request) { 5876 return removeGroupMigrationOperationCallable().futureCall(request); 5877 } 5878 5879 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5880 /** 5881 * Removes a MigratingVm from a Group. 5882 * 5883 * <p>Sample code: 5884 * 5885 * <pre>{@code 5886 * // This snippet has been automatically generated and should be regarded as a code template only. 5887 * // It will require modifications to work: 5888 * // - It may require correct/in-range values for request initialization. 5889 * // - It may require specifying regional endpoints when creating the service client as shown in 5890 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5891 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5892 * RemoveGroupMigrationRequest request = 5893 * RemoveGroupMigrationRequest.newBuilder() 5894 * .setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5895 * .setMigratingVm( 5896 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 5897 * .toString()) 5898 * .build(); 5899 * OperationFuture<RemoveGroupMigrationResponse, OperationMetadata> future = 5900 * vmMigrationClient.removeGroupMigrationOperationCallable().futureCall(request); 5901 * // Do something. 5902 * RemoveGroupMigrationResponse response = future.get(); 5903 * } 5904 * }</pre> 5905 */ 5906 public final OperationCallable< 5907 RemoveGroupMigrationRequest, RemoveGroupMigrationResponse, OperationMetadata> removeGroupMigrationOperationCallable()5908 removeGroupMigrationOperationCallable() { 5909 return stub.removeGroupMigrationOperationCallable(); 5910 } 5911 5912 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5913 /** 5914 * Removes a MigratingVm from a Group. 5915 * 5916 * <p>Sample code: 5917 * 5918 * <pre>{@code 5919 * // This snippet has been automatically generated and should be regarded as a code template only. 5920 * // It will require modifications to work: 5921 * // - It may require correct/in-range values for request initialization. 5922 * // - It may require specifying regional endpoints when creating the service client as shown in 5923 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5924 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5925 * RemoveGroupMigrationRequest request = 5926 * RemoveGroupMigrationRequest.newBuilder() 5927 * .setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) 5928 * .setMigratingVm( 5929 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 5930 * .toString()) 5931 * .build(); 5932 * ApiFuture<Operation> future = 5933 * vmMigrationClient.removeGroupMigrationCallable().futureCall(request); 5934 * // Do something. 5935 * Operation response = future.get(); 5936 * } 5937 * }</pre> 5938 */ 5939 public final UnaryCallable<RemoveGroupMigrationRequest, Operation> removeGroupMigrationCallable()5940 removeGroupMigrationCallable() { 5941 return stub.removeGroupMigrationCallable(); 5942 } 5943 5944 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5945 /** 5946 * Lists TargetProjects in a given project. 5947 * 5948 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 5949 * `global`. 5950 * 5951 * <p>Sample code: 5952 * 5953 * <pre>{@code 5954 * // This snippet has been automatically generated and should be regarded as a code template only. 5955 * // It will require modifications to work: 5956 * // - It may require correct/in-range values for request initialization. 5957 * // - It may require specifying regional endpoints when creating the service client as shown in 5958 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5959 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5960 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 5961 * for (TargetProject element : vmMigrationClient.listTargetProjects(parent).iterateAll()) { 5962 * // doThingsWith(element); 5963 * } 5964 * } 5965 * }</pre> 5966 * 5967 * @param parent Required. The parent, which owns this collection of targets. 5968 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5969 */ listTargetProjects(LocationName parent)5970 public final ListTargetProjectsPagedResponse listTargetProjects(LocationName parent) { 5971 ListTargetProjectsRequest request = 5972 ListTargetProjectsRequest.newBuilder() 5973 .setParent(parent == null ? null : parent.toString()) 5974 .build(); 5975 return listTargetProjects(request); 5976 } 5977 5978 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5979 /** 5980 * Lists TargetProjects in a given project. 5981 * 5982 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 5983 * `global`. 5984 * 5985 * <p>Sample code: 5986 * 5987 * <pre>{@code 5988 * // This snippet has been automatically generated and should be regarded as a code template only. 5989 * // It will require modifications to work: 5990 * // - It may require correct/in-range values for request initialization. 5991 * // - It may require specifying regional endpoints when creating the service client as shown in 5992 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5993 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 5994 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 5995 * for (TargetProject element : vmMigrationClient.listTargetProjects(parent).iterateAll()) { 5996 * // doThingsWith(element); 5997 * } 5998 * } 5999 * }</pre> 6000 * 6001 * @param parent Required. The parent, which owns this collection of targets. 6002 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6003 */ listTargetProjects(String parent)6004 public final ListTargetProjectsPagedResponse listTargetProjects(String parent) { 6005 ListTargetProjectsRequest request = 6006 ListTargetProjectsRequest.newBuilder().setParent(parent).build(); 6007 return listTargetProjects(request); 6008 } 6009 6010 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6011 /** 6012 * Lists TargetProjects in a given project. 6013 * 6014 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6015 * `global`. 6016 * 6017 * <p>Sample code: 6018 * 6019 * <pre>{@code 6020 * // This snippet has been automatically generated and should be regarded as a code template only. 6021 * // It will require modifications to work: 6022 * // - It may require correct/in-range values for request initialization. 6023 * // - It may require specifying regional endpoints when creating the service client as shown in 6024 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6025 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6026 * ListTargetProjectsRequest request = 6027 * ListTargetProjectsRequest.newBuilder() 6028 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 6029 * .setPageSize(883849137) 6030 * .setPageToken("pageToken873572522") 6031 * .setFilter("filter-1274492040") 6032 * .setOrderBy("orderBy-1207110587") 6033 * .build(); 6034 * for (TargetProject element : vmMigrationClient.listTargetProjects(request).iterateAll()) { 6035 * // doThingsWith(element); 6036 * } 6037 * } 6038 * }</pre> 6039 * 6040 * @param request The request object containing all of the parameters for the API call. 6041 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6042 */ listTargetProjects( ListTargetProjectsRequest request)6043 public final ListTargetProjectsPagedResponse listTargetProjects( 6044 ListTargetProjectsRequest request) { 6045 return listTargetProjectsPagedCallable().call(request); 6046 } 6047 6048 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6049 /** 6050 * Lists TargetProjects in a given project. 6051 * 6052 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6053 * `global`. 6054 * 6055 * <p>Sample code: 6056 * 6057 * <pre>{@code 6058 * // This snippet has been automatically generated and should be regarded as a code template only. 6059 * // It will require modifications to work: 6060 * // - It may require correct/in-range values for request initialization. 6061 * // - It may require specifying regional endpoints when creating the service client as shown in 6062 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6063 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6064 * ListTargetProjectsRequest request = 6065 * ListTargetProjectsRequest.newBuilder() 6066 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 6067 * .setPageSize(883849137) 6068 * .setPageToken("pageToken873572522") 6069 * .setFilter("filter-1274492040") 6070 * .setOrderBy("orderBy-1207110587") 6071 * .build(); 6072 * ApiFuture<TargetProject> future = 6073 * vmMigrationClient.listTargetProjectsPagedCallable().futureCall(request); 6074 * // Do something. 6075 * for (TargetProject element : future.get().iterateAll()) { 6076 * // doThingsWith(element); 6077 * } 6078 * } 6079 * }</pre> 6080 */ 6081 public final UnaryCallable<ListTargetProjectsRequest, ListTargetProjectsPagedResponse> listTargetProjectsPagedCallable()6082 listTargetProjectsPagedCallable() { 6083 return stub.listTargetProjectsPagedCallable(); 6084 } 6085 6086 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6087 /** 6088 * Lists TargetProjects in a given project. 6089 * 6090 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6091 * `global`. 6092 * 6093 * <p>Sample code: 6094 * 6095 * <pre>{@code 6096 * // This snippet has been automatically generated and should be regarded as a code template only. 6097 * // It will require modifications to work: 6098 * // - It may require correct/in-range values for request initialization. 6099 * // - It may require specifying regional endpoints when creating the service client as shown in 6100 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6101 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6102 * ListTargetProjectsRequest request = 6103 * ListTargetProjectsRequest.newBuilder() 6104 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 6105 * .setPageSize(883849137) 6106 * .setPageToken("pageToken873572522") 6107 * .setFilter("filter-1274492040") 6108 * .setOrderBy("orderBy-1207110587") 6109 * .build(); 6110 * while (true) { 6111 * ListTargetProjectsResponse response = 6112 * vmMigrationClient.listTargetProjectsCallable().call(request); 6113 * for (TargetProject element : response.getTargetProjectsList()) { 6114 * // doThingsWith(element); 6115 * } 6116 * String nextPageToken = response.getNextPageToken(); 6117 * if (!Strings.isNullOrEmpty(nextPageToken)) { 6118 * request = request.toBuilder().setPageToken(nextPageToken).build(); 6119 * } else { 6120 * break; 6121 * } 6122 * } 6123 * } 6124 * }</pre> 6125 */ 6126 public final UnaryCallable<ListTargetProjectsRequest, ListTargetProjectsResponse> listTargetProjectsCallable()6127 listTargetProjectsCallable() { 6128 return stub.listTargetProjectsCallable(); 6129 } 6130 6131 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6132 /** 6133 * Gets details of a single TargetProject. 6134 * 6135 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6136 * `global`. 6137 * 6138 * <p>Sample code: 6139 * 6140 * <pre>{@code 6141 * // This snippet has been automatically generated and should be regarded as a code template only. 6142 * // It will require modifications to work: 6143 * // - It may require correct/in-range values for request initialization. 6144 * // - It may require specifying regional endpoints when creating the service client as shown in 6145 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6146 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6147 * TargetProjectName name = TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]"); 6148 * TargetProject response = vmMigrationClient.getTargetProject(name); 6149 * } 6150 * }</pre> 6151 * 6152 * @param name Required. The TargetProject name. 6153 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6154 */ getTargetProject(TargetProjectName name)6155 public final TargetProject getTargetProject(TargetProjectName name) { 6156 GetTargetProjectRequest request = 6157 GetTargetProjectRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 6158 return getTargetProject(request); 6159 } 6160 6161 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6162 /** 6163 * Gets details of a single TargetProject. 6164 * 6165 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6166 * `global`. 6167 * 6168 * <p>Sample code: 6169 * 6170 * <pre>{@code 6171 * // This snippet has been automatically generated and should be regarded as a code template only. 6172 * // It will require modifications to work: 6173 * // - It may require correct/in-range values for request initialization. 6174 * // - It may require specifying regional endpoints when creating the service client as shown in 6175 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6176 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6177 * String name = TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString(); 6178 * TargetProject response = vmMigrationClient.getTargetProject(name); 6179 * } 6180 * }</pre> 6181 * 6182 * @param name Required. The TargetProject name. 6183 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6184 */ getTargetProject(String name)6185 public final TargetProject getTargetProject(String name) { 6186 GetTargetProjectRequest request = GetTargetProjectRequest.newBuilder().setName(name).build(); 6187 return getTargetProject(request); 6188 } 6189 6190 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6191 /** 6192 * Gets details of a single TargetProject. 6193 * 6194 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6195 * `global`. 6196 * 6197 * <p>Sample code: 6198 * 6199 * <pre>{@code 6200 * // This snippet has been automatically generated and should be regarded as a code template only. 6201 * // It will require modifications to work: 6202 * // - It may require correct/in-range values for request initialization. 6203 * // - It may require specifying regional endpoints when creating the service client as shown in 6204 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6205 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6206 * GetTargetProjectRequest request = 6207 * GetTargetProjectRequest.newBuilder() 6208 * .setName( 6209 * TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString()) 6210 * .build(); 6211 * TargetProject response = vmMigrationClient.getTargetProject(request); 6212 * } 6213 * }</pre> 6214 * 6215 * @param request The request object containing all of the parameters for the API call. 6216 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6217 */ getTargetProject(GetTargetProjectRequest request)6218 public final TargetProject getTargetProject(GetTargetProjectRequest request) { 6219 return getTargetProjectCallable().call(request); 6220 } 6221 6222 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6223 /** 6224 * Gets details of a single TargetProject. 6225 * 6226 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6227 * `global`. 6228 * 6229 * <p>Sample code: 6230 * 6231 * <pre>{@code 6232 * // This snippet has been automatically generated and should be regarded as a code template only. 6233 * // It will require modifications to work: 6234 * // - It may require correct/in-range values for request initialization. 6235 * // - It may require specifying regional endpoints when creating the service client as shown in 6236 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6237 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6238 * GetTargetProjectRequest request = 6239 * GetTargetProjectRequest.newBuilder() 6240 * .setName( 6241 * TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString()) 6242 * .build(); 6243 * ApiFuture<TargetProject> future = 6244 * vmMigrationClient.getTargetProjectCallable().futureCall(request); 6245 * // Do something. 6246 * TargetProject response = future.get(); 6247 * } 6248 * }</pre> 6249 */ getTargetProjectCallable()6250 public final UnaryCallable<GetTargetProjectRequest, TargetProject> getTargetProjectCallable() { 6251 return stub.getTargetProjectCallable(); 6252 } 6253 6254 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6255 /** 6256 * Creates a new TargetProject in a given project. 6257 * 6258 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6259 * `global`. 6260 * 6261 * <p>Sample code: 6262 * 6263 * <pre>{@code 6264 * // This snippet has been automatically generated and should be regarded as a code template only. 6265 * // It will require modifications to work: 6266 * // - It may require correct/in-range values for request initialization. 6267 * // - It may require specifying regional endpoints when creating the service client as shown in 6268 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6269 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6270 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 6271 * TargetProject targetProject = TargetProject.newBuilder().build(); 6272 * String targetProjectId = "targetProjectId1290130307"; 6273 * TargetProject response = 6274 * vmMigrationClient.createTargetProjectAsync(parent, targetProject, targetProjectId).get(); 6275 * } 6276 * }</pre> 6277 * 6278 * @param parent Required. The TargetProject's parent. 6279 * @param targetProject Required. The create request body. 6280 * @param targetProjectId Required. The target_project identifier. 6281 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6282 */ createTargetProjectAsync( LocationName parent, TargetProject targetProject, String targetProjectId)6283 public final OperationFuture<TargetProject, OperationMetadata> createTargetProjectAsync( 6284 LocationName parent, TargetProject targetProject, String targetProjectId) { 6285 CreateTargetProjectRequest request = 6286 CreateTargetProjectRequest.newBuilder() 6287 .setParent(parent == null ? null : parent.toString()) 6288 .setTargetProject(targetProject) 6289 .setTargetProjectId(targetProjectId) 6290 .build(); 6291 return createTargetProjectAsync(request); 6292 } 6293 6294 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6295 /** 6296 * Creates a new TargetProject in a given project. 6297 * 6298 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6299 * `global`. 6300 * 6301 * <p>Sample code: 6302 * 6303 * <pre>{@code 6304 * // This snippet has been automatically generated and should be regarded as a code template only. 6305 * // It will require modifications to work: 6306 * // - It may require correct/in-range values for request initialization. 6307 * // - It may require specifying regional endpoints when creating the service client as shown in 6308 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6309 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6310 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 6311 * TargetProject targetProject = TargetProject.newBuilder().build(); 6312 * String targetProjectId = "targetProjectId1290130307"; 6313 * TargetProject response = 6314 * vmMigrationClient.createTargetProjectAsync(parent, targetProject, targetProjectId).get(); 6315 * } 6316 * }</pre> 6317 * 6318 * @param parent Required. The TargetProject's parent. 6319 * @param targetProject Required. The create request body. 6320 * @param targetProjectId Required. The target_project identifier. 6321 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6322 */ createTargetProjectAsync( String parent, TargetProject targetProject, String targetProjectId)6323 public final OperationFuture<TargetProject, OperationMetadata> createTargetProjectAsync( 6324 String parent, TargetProject targetProject, String targetProjectId) { 6325 CreateTargetProjectRequest request = 6326 CreateTargetProjectRequest.newBuilder() 6327 .setParent(parent) 6328 .setTargetProject(targetProject) 6329 .setTargetProjectId(targetProjectId) 6330 .build(); 6331 return createTargetProjectAsync(request); 6332 } 6333 6334 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6335 /** 6336 * Creates a new TargetProject in a given project. 6337 * 6338 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6339 * `global`. 6340 * 6341 * <p>Sample code: 6342 * 6343 * <pre>{@code 6344 * // This snippet has been automatically generated and should be regarded as a code template only. 6345 * // It will require modifications to work: 6346 * // - It may require correct/in-range values for request initialization. 6347 * // - It may require specifying regional endpoints when creating the service client as shown in 6348 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6349 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6350 * CreateTargetProjectRequest request = 6351 * CreateTargetProjectRequest.newBuilder() 6352 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 6353 * .setTargetProjectId("targetProjectId1290130307") 6354 * .setTargetProject(TargetProject.newBuilder().build()) 6355 * .setRequestId("requestId693933066") 6356 * .build(); 6357 * TargetProject response = vmMigrationClient.createTargetProjectAsync(request).get(); 6358 * } 6359 * }</pre> 6360 * 6361 * @param request The request object containing all of the parameters for the API call. 6362 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6363 */ createTargetProjectAsync( CreateTargetProjectRequest request)6364 public final OperationFuture<TargetProject, OperationMetadata> createTargetProjectAsync( 6365 CreateTargetProjectRequest request) { 6366 return createTargetProjectOperationCallable().futureCall(request); 6367 } 6368 6369 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6370 /** 6371 * Creates a new TargetProject in a given project. 6372 * 6373 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6374 * `global`. 6375 * 6376 * <p>Sample code: 6377 * 6378 * <pre>{@code 6379 * // This snippet has been automatically generated and should be regarded as a code template only. 6380 * // It will require modifications to work: 6381 * // - It may require correct/in-range values for request initialization. 6382 * // - It may require specifying regional endpoints when creating the service client as shown in 6383 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6384 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6385 * CreateTargetProjectRequest request = 6386 * CreateTargetProjectRequest.newBuilder() 6387 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 6388 * .setTargetProjectId("targetProjectId1290130307") 6389 * .setTargetProject(TargetProject.newBuilder().build()) 6390 * .setRequestId("requestId693933066") 6391 * .build(); 6392 * OperationFuture<TargetProject, OperationMetadata> future = 6393 * vmMigrationClient.createTargetProjectOperationCallable().futureCall(request); 6394 * // Do something. 6395 * TargetProject response = future.get(); 6396 * } 6397 * }</pre> 6398 */ 6399 public final OperationCallable<CreateTargetProjectRequest, TargetProject, OperationMetadata> createTargetProjectOperationCallable()6400 createTargetProjectOperationCallable() { 6401 return stub.createTargetProjectOperationCallable(); 6402 } 6403 6404 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6405 /** 6406 * Creates a new TargetProject in a given project. 6407 * 6408 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6409 * `global`. 6410 * 6411 * <p>Sample code: 6412 * 6413 * <pre>{@code 6414 * // This snippet has been automatically generated and should be regarded as a code template only. 6415 * // It will require modifications to work: 6416 * // - It may require correct/in-range values for request initialization. 6417 * // - It may require specifying regional endpoints when creating the service client as shown in 6418 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6419 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6420 * CreateTargetProjectRequest request = 6421 * CreateTargetProjectRequest.newBuilder() 6422 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 6423 * .setTargetProjectId("targetProjectId1290130307") 6424 * .setTargetProject(TargetProject.newBuilder().build()) 6425 * .setRequestId("requestId693933066") 6426 * .build(); 6427 * ApiFuture<Operation> future = 6428 * vmMigrationClient.createTargetProjectCallable().futureCall(request); 6429 * // Do something. 6430 * Operation response = future.get(); 6431 * } 6432 * }</pre> 6433 */ createTargetProjectCallable()6434 public final UnaryCallable<CreateTargetProjectRequest, Operation> createTargetProjectCallable() { 6435 return stub.createTargetProjectCallable(); 6436 } 6437 6438 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6439 /** 6440 * Updates the parameters of a single TargetProject. 6441 * 6442 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6443 * `global`. 6444 * 6445 * <p>Sample code: 6446 * 6447 * <pre>{@code 6448 * // This snippet has been automatically generated and should be regarded as a code template only. 6449 * // It will require modifications to work: 6450 * // - It may require correct/in-range values for request initialization. 6451 * // - It may require specifying regional endpoints when creating the service client as shown in 6452 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6453 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6454 * TargetProject targetProject = TargetProject.newBuilder().build(); 6455 * FieldMask updateMask = FieldMask.newBuilder().build(); 6456 * TargetProject response = 6457 * vmMigrationClient.updateTargetProjectAsync(targetProject, updateMask).get(); 6458 * } 6459 * }</pre> 6460 * 6461 * @param targetProject Required. The update request body. 6462 * @param updateMask Field mask is used to specify the fields to be overwritten in the 6463 * TargetProject resource by the update. The fields specified in the update_mask are relative 6464 * to the resource, not the full request. A field will be overwritten if it is in the mask. If 6465 * the user does not provide a mask then all fields will be overwritten. 6466 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6467 */ updateTargetProjectAsync( TargetProject targetProject, FieldMask updateMask)6468 public final OperationFuture<TargetProject, OperationMetadata> updateTargetProjectAsync( 6469 TargetProject targetProject, FieldMask updateMask) { 6470 UpdateTargetProjectRequest request = 6471 UpdateTargetProjectRequest.newBuilder() 6472 .setTargetProject(targetProject) 6473 .setUpdateMask(updateMask) 6474 .build(); 6475 return updateTargetProjectAsync(request); 6476 } 6477 6478 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6479 /** 6480 * Updates the parameters of a single TargetProject. 6481 * 6482 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6483 * `global`. 6484 * 6485 * <p>Sample code: 6486 * 6487 * <pre>{@code 6488 * // This snippet has been automatically generated and should be regarded as a code template only. 6489 * // It will require modifications to work: 6490 * // - It may require correct/in-range values for request initialization. 6491 * // - It may require specifying regional endpoints when creating the service client as shown in 6492 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6493 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6494 * UpdateTargetProjectRequest request = 6495 * UpdateTargetProjectRequest.newBuilder() 6496 * .setUpdateMask(FieldMask.newBuilder().build()) 6497 * .setTargetProject(TargetProject.newBuilder().build()) 6498 * .setRequestId("requestId693933066") 6499 * .build(); 6500 * TargetProject response = vmMigrationClient.updateTargetProjectAsync(request).get(); 6501 * } 6502 * }</pre> 6503 * 6504 * @param request The request object containing all of the parameters for the API call. 6505 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6506 */ updateTargetProjectAsync( UpdateTargetProjectRequest request)6507 public final OperationFuture<TargetProject, OperationMetadata> updateTargetProjectAsync( 6508 UpdateTargetProjectRequest request) { 6509 return updateTargetProjectOperationCallable().futureCall(request); 6510 } 6511 6512 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6513 /** 6514 * Updates the parameters of a single TargetProject. 6515 * 6516 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6517 * `global`. 6518 * 6519 * <p>Sample code: 6520 * 6521 * <pre>{@code 6522 * // This snippet has been automatically generated and should be regarded as a code template only. 6523 * // It will require modifications to work: 6524 * // - It may require correct/in-range values for request initialization. 6525 * // - It may require specifying regional endpoints when creating the service client as shown in 6526 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6527 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6528 * UpdateTargetProjectRequest request = 6529 * UpdateTargetProjectRequest.newBuilder() 6530 * .setUpdateMask(FieldMask.newBuilder().build()) 6531 * .setTargetProject(TargetProject.newBuilder().build()) 6532 * .setRequestId("requestId693933066") 6533 * .build(); 6534 * OperationFuture<TargetProject, OperationMetadata> future = 6535 * vmMigrationClient.updateTargetProjectOperationCallable().futureCall(request); 6536 * // Do something. 6537 * TargetProject response = future.get(); 6538 * } 6539 * }</pre> 6540 */ 6541 public final OperationCallable<UpdateTargetProjectRequest, TargetProject, OperationMetadata> updateTargetProjectOperationCallable()6542 updateTargetProjectOperationCallable() { 6543 return stub.updateTargetProjectOperationCallable(); 6544 } 6545 6546 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6547 /** 6548 * Updates the parameters of a single TargetProject. 6549 * 6550 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6551 * `global`. 6552 * 6553 * <p>Sample code: 6554 * 6555 * <pre>{@code 6556 * // This snippet has been automatically generated and should be regarded as a code template only. 6557 * // It will require modifications to work: 6558 * // - It may require correct/in-range values for request initialization. 6559 * // - It may require specifying regional endpoints when creating the service client as shown in 6560 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6561 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6562 * UpdateTargetProjectRequest request = 6563 * UpdateTargetProjectRequest.newBuilder() 6564 * .setUpdateMask(FieldMask.newBuilder().build()) 6565 * .setTargetProject(TargetProject.newBuilder().build()) 6566 * .setRequestId("requestId693933066") 6567 * .build(); 6568 * ApiFuture<Operation> future = 6569 * vmMigrationClient.updateTargetProjectCallable().futureCall(request); 6570 * // Do something. 6571 * Operation response = future.get(); 6572 * } 6573 * }</pre> 6574 */ updateTargetProjectCallable()6575 public final UnaryCallable<UpdateTargetProjectRequest, Operation> updateTargetProjectCallable() { 6576 return stub.updateTargetProjectCallable(); 6577 } 6578 6579 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6580 /** 6581 * Deletes a single TargetProject. 6582 * 6583 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6584 * `global`. 6585 * 6586 * <p>Sample code: 6587 * 6588 * <pre>{@code 6589 * // This snippet has been automatically generated and should be regarded as a code template only. 6590 * // It will require modifications to work: 6591 * // - It may require correct/in-range values for request initialization. 6592 * // - It may require specifying regional endpoints when creating the service client as shown in 6593 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6594 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6595 * TargetProjectName name = TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]"); 6596 * vmMigrationClient.deleteTargetProjectAsync(name).get(); 6597 * } 6598 * }</pre> 6599 * 6600 * @param name Required. The TargetProject name. 6601 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6602 */ deleteTargetProjectAsync( TargetProjectName name)6603 public final OperationFuture<Empty, OperationMetadata> deleteTargetProjectAsync( 6604 TargetProjectName name) { 6605 DeleteTargetProjectRequest request = 6606 DeleteTargetProjectRequest.newBuilder() 6607 .setName(name == null ? null : name.toString()) 6608 .build(); 6609 return deleteTargetProjectAsync(request); 6610 } 6611 6612 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6613 /** 6614 * Deletes a single TargetProject. 6615 * 6616 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6617 * `global`. 6618 * 6619 * <p>Sample code: 6620 * 6621 * <pre>{@code 6622 * // This snippet has been automatically generated and should be regarded as a code template only. 6623 * // It will require modifications to work: 6624 * // - It may require correct/in-range values for request initialization. 6625 * // - It may require specifying regional endpoints when creating the service client as shown in 6626 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6627 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6628 * String name = TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString(); 6629 * vmMigrationClient.deleteTargetProjectAsync(name).get(); 6630 * } 6631 * }</pre> 6632 * 6633 * @param name Required. The TargetProject name. 6634 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6635 */ deleteTargetProjectAsync(String name)6636 public final OperationFuture<Empty, OperationMetadata> deleteTargetProjectAsync(String name) { 6637 DeleteTargetProjectRequest request = 6638 DeleteTargetProjectRequest.newBuilder().setName(name).build(); 6639 return deleteTargetProjectAsync(request); 6640 } 6641 6642 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6643 /** 6644 * Deletes a single TargetProject. 6645 * 6646 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6647 * `global`. 6648 * 6649 * <p>Sample code: 6650 * 6651 * <pre>{@code 6652 * // This snippet has been automatically generated and should be regarded as a code template only. 6653 * // It will require modifications to work: 6654 * // - It may require correct/in-range values for request initialization. 6655 * // - It may require specifying regional endpoints when creating the service client as shown in 6656 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6657 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6658 * DeleteTargetProjectRequest request = 6659 * DeleteTargetProjectRequest.newBuilder() 6660 * .setName( 6661 * TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString()) 6662 * .setRequestId("requestId693933066") 6663 * .build(); 6664 * vmMigrationClient.deleteTargetProjectAsync(request).get(); 6665 * } 6666 * }</pre> 6667 * 6668 * @param request The request object containing all of the parameters for the API call. 6669 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6670 */ deleteTargetProjectAsync( DeleteTargetProjectRequest request)6671 public final OperationFuture<Empty, OperationMetadata> deleteTargetProjectAsync( 6672 DeleteTargetProjectRequest request) { 6673 return deleteTargetProjectOperationCallable().futureCall(request); 6674 } 6675 6676 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6677 /** 6678 * Deletes a single TargetProject. 6679 * 6680 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6681 * `global`. 6682 * 6683 * <p>Sample code: 6684 * 6685 * <pre>{@code 6686 * // This snippet has been automatically generated and should be regarded as a code template only. 6687 * // It will require modifications to work: 6688 * // - It may require correct/in-range values for request initialization. 6689 * // - It may require specifying regional endpoints when creating the service client as shown in 6690 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6691 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6692 * DeleteTargetProjectRequest request = 6693 * DeleteTargetProjectRequest.newBuilder() 6694 * .setName( 6695 * TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString()) 6696 * .setRequestId("requestId693933066") 6697 * .build(); 6698 * OperationFuture<Empty, OperationMetadata> future = 6699 * vmMigrationClient.deleteTargetProjectOperationCallable().futureCall(request); 6700 * // Do something. 6701 * future.get(); 6702 * } 6703 * }</pre> 6704 */ 6705 public final OperationCallable<DeleteTargetProjectRequest, Empty, OperationMetadata> deleteTargetProjectOperationCallable()6706 deleteTargetProjectOperationCallable() { 6707 return stub.deleteTargetProjectOperationCallable(); 6708 } 6709 6710 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6711 /** 6712 * Deletes a single TargetProject. 6713 * 6714 * <p>NOTE: TargetProject is a global resource; hence the only supported value for location is 6715 * `global`. 6716 * 6717 * <p>Sample code: 6718 * 6719 * <pre>{@code 6720 * // This snippet has been automatically generated and should be regarded as a code template only. 6721 * // It will require modifications to work: 6722 * // - It may require correct/in-range values for request initialization. 6723 * // - It may require specifying regional endpoints when creating the service client as shown in 6724 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6725 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6726 * DeleteTargetProjectRequest request = 6727 * DeleteTargetProjectRequest.newBuilder() 6728 * .setName( 6729 * TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString()) 6730 * .setRequestId("requestId693933066") 6731 * .build(); 6732 * ApiFuture<Operation> future = 6733 * vmMigrationClient.deleteTargetProjectCallable().futureCall(request); 6734 * // Do something. 6735 * future.get(); 6736 * } 6737 * }</pre> 6738 */ deleteTargetProjectCallable()6739 public final UnaryCallable<DeleteTargetProjectRequest, Operation> deleteTargetProjectCallable() { 6740 return stub.deleteTargetProjectCallable(); 6741 } 6742 6743 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6744 /** 6745 * Lists ReplicationCycles in a given MigratingVM. 6746 * 6747 * <p>Sample code: 6748 * 6749 * <pre>{@code 6750 * // This snippet has been automatically generated and should be regarded as a code template only. 6751 * // It will require modifications to work: 6752 * // - It may require correct/in-range values for request initialization. 6753 * // - It may require specifying regional endpoints when creating the service client as shown in 6754 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6755 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6756 * MigratingVmName parent = 6757 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); 6758 * for (ReplicationCycle element : 6759 * vmMigrationClient.listReplicationCycles(parent).iterateAll()) { 6760 * // doThingsWith(element); 6761 * } 6762 * } 6763 * }</pre> 6764 * 6765 * @param parent Required. The parent, which owns this collection of ReplicationCycles. 6766 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6767 */ listReplicationCycles(MigratingVmName parent)6768 public final ListReplicationCyclesPagedResponse listReplicationCycles(MigratingVmName parent) { 6769 ListReplicationCyclesRequest request = 6770 ListReplicationCyclesRequest.newBuilder() 6771 .setParent(parent == null ? null : parent.toString()) 6772 .build(); 6773 return listReplicationCycles(request); 6774 } 6775 6776 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6777 /** 6778 * Lists ReplicationCycles in a given MigratingVM. 6779 * 6780 * <p>Sample code: 6781 * 6782 * <pre>{@code 6783 * // This snippet has been automatically generated and should be regarded as a code template only. 6784 * // It will require modifications to work: 6785 * // - It may require correct/in-range values for request initialization. 6786 * // - It may require specifying regional endpoints when creating the service client as shown in 6787 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6788 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6789 * String parent = 6790 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); 6791 * for (ReplicationCycle element : 6792 * vmMigrationClient.listReplicationCycles(parent).iterateAll()) { 6793 * // doThingsWith(element); 6794 * } 6795 * } 6796 * }</pre> 6797 * 6798 * @param parent Required. The parent, which owns this collection of ReplicationCycles. 6799 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6800 */ listReplicationCycles(String parent)6801 public final ListReplicationCyclesPagedResponse listReplicationCycles(String parent) { 6802 ListReplicationCyclesRequest request = 6803 ListReplicationCyclesRequest.newBuilder().setParent(parent).build(); 6804 return listReplicationCycles(request); 6805 } 6806 6807 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6808 /** 6809 * Lists ReplicationCycles in a given MigratingVM. 6810 * 6811 * <p>Sample code: 6812 * 6813 * <pre>{@code 6814 * // This snippet has been automatically generated and should be regarded as a code template only. 6815 * // It will require modifications to work: 6816 * // - It may require correct/in-range values for request initialization. 6817 * // - It may require specifying regional endpoints when creating the service client as shown in 6818 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6819 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6820 * ListReplicationCyclesRequest request = 6821 * ListReplicationCyclesRequest.newBuilder() 6822 * .setParent( 6823 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 6824 * .toString()) 6825 * .setPageSize(883849137) 6826 * .setPageToken("pageToken873572522") 6827 * .setFilter("filter-1274492040") 6828 * .setOrderBy("orderBy-1207110587") 6829 * .build(); 6830 * for (ReplicationCycle element : 6831 * vmMigrationClient.listReplicationCycles(request).iterateAll()) { 6832 * // doThingsWith(element); 6833 * } 6834 * } 6835 * }</pre> 6836 * 6837 * @param request The request object containing all of the parameters for the API call. 6838 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6839 */ listReplicationCycles( ListReplicationCyclesRequest request)6840 public final ListReplicationCyclesPagedResponse listReplicationCycles( 6841 ListReplicationCyclesRequest request) { 6842 return listReplicationCyclesPagedCallable().call(request); 6843 } 6844 6845 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6846 /** 6847 * Lists ReplicationCycles in a given MigratingVM. 6848 * 6849 * <p>Sample code: 6850 * 6851 * <pre>{@code 6852 * // This snippet has been automatically generated and should be regarded as a code template only. 6853 * // It will require modifications to work: 6854 * // - It may require correct/in-range values for request initialization. 6855 * // - It may require specifying regional endpoints when creating the service client as shown in 6856 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6857 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6858 * ListReplicationCyclesRequest request = 6859 * ListReplicationCyclesRequest.newBuilder() 6860 * .setParent( 6861 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 6862 * .toString()) 6863 * .setPageSize(883849137) 6864 * .setPageToken("pageToken873572522") 6865 * .setFilter("filter-1274492040") 6866 * .setOrderBy("orderBy-1207110587") 6867 * .build(); 6868 * ApiFuture<ReplicationCycle> future = 6869 * vmMigrationClient.listReplicationCyclesPagedCallable().futureCall(request); 6870 * // Do something. 6871 * for (ReplicationCycle element : future.get().iterateAll()) { 6872 * // doThingsWith(element); 6873 * } 6874 * } 6875 * }</pre> 6876 */ 6877 public final UnaryCallable<ListReplicationCyclesRequest, ListReplicationCyclesPagedResponse> listReplicationCyclesPagedCallable()6878 listReplicationCyclesPagedCallable() { 6879 return stub.listReplicationCyclesPagedCallable(); 6880 } 6881 6882 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6883 /** 6884 * Lists ReplicationCycles in a given MigratingVM. 6885 * 6886 * <p>Sample code: 6887 * 6888 * <pre>{@code 6889 * // This snippet has been automatically generated and should be regarded as a code template only. 6890 * // It will require modifications to work: 6891 * // - It may require correct/in-range values for request initialization. 6892 * // - It may require specifying regional endpoints when creating the service client as shown in 6893 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6894 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6895 * ListReplicationCyclesRequest request = 6896 * ListReplicationCyclesRequest.newBuilder() 6897 * .setParent( 6898 * MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") 6899 * .toString()) 6900 * .setPageSize(883849137) 6901 * .setPageToken("pageToken873572522") 6902 * .setFilter("filter-1274492040") 6903 * .setOrderBy("orderBy-1207110587") 6904 * .build(); 6905 * while (true) { 6906 * ListReplicationCyclesResponse response = 6907 * vmMigrationClient.listReplicationCyclesCallable().call(request); 6908 * for (ReplicationCycle element : response.getReplicationCyclesList()) { 6909 * // doThingsWith(element); 6910 * } 6911 * String nextPageToken = response.getNextPageToken(); 6912 * if (!Strings.isNullOrEmpty(nextPageToken)) { 6913 * request = request.toBuilder().setPageToken(nextPageToken).build(); 6914 * } else { 6915 * break; 6916 * } 6917 * } 6918 * } 6919 * }</pre> 6920 */ 6921 public final UnaryCallable<ListReplicationCyclesRequest, ListReplicationCyclesResponse> listReplicationCyclesCallable()6922 listReplicationCyclesCallable() { 6923 return stub.listReplicationCyclesCallable(); 6924 } 6925 6926 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6927 /** 6928 * Gets details of a single ReplicationCycle. 6929 * 6930 * <p>Sample code: 6931 * 6932 * <pre>{@code 6933 * // This snippet has been automatically generated and should be regarded as a code template only. 6934 * // It will require modifications to work: 6935 * // - It may require correct/in-range values for request initialization. 6936 * // - It may require specifying regional endpoints when creating the service client as shown in 6937 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6938 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6939 * ReplicationCycleName name = 6940 * ReplicationCycleName.of( 6941 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[REPLICATION_CYCLE]"); 6942 * ReplicationCycle response = vmMigrationClient.getReplicationCycle(name); 6943 * } 6944 * }</pre> 6945 * 6946 * @param name Required. The name of the ReplicationCycle. 6947 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6948 */ getReplicationCycle(ReplicationCycleName name)6949 public final ReplicationCycle getReplicationCycle(ReplicationCycleName name) { 6950 GetReplicationCycleRequest request = 6951 GetReplicationCycleRequest.newBuilder() 6952 .setName(name == null ? null : name.toString()) 6953 .build(); 6954 return getReplicationCycle(request); 6955 } 6956 6957 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6958 /** 6959 * Gets details of a single ReplicationCycle. 6960 * 6961 * <p>Sample code: 6962 * 6963 * <pre>{@code 6964 * // This snippet has been automatically generated and should be regarded as a code template only. 6965 * // It will require modifications to work: 6966 * // - It may require correct/in-range values for request initialization. 6967 * // - It may require specifying regional endpoints when creating the service client as shown in 6968 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6969 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 6970 * String name = 6971 * ReplicationCycleName.of( 6972 * "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[REPLICATION_CYCLE]") 6973 * .toString(); 6974 * ReplicationCycle response = vmMigrationClient.getReplicationCycle(name); 6975 * } 6976 * }</pre> 6977 * 6978 * @param name Required. The name of the ReplicationCycle. 6979 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 6980 */ getReplicationCycle(String name)6981 public final ReplicationCycle getReplicationCycle(String name) { 6982 GetReplicationCycleRequest request = 6983 GetReplicationCycleRequest.newBuilder().setName(name).build(); 6984 return getReplicationCycle(request); 6985 } 6986 6987 // AUTO-GENERATED DOCUMENTATION AND METHOD. 6988 /** 6989 * Gets details of a single ReplicationCycle. 6990 * 6991 * <p>Sample code: 6992 * 6993 * <pre>{@code 6994 * // This snippet has been automatically generated and should be regarded as a code template only. 6995 * // It will require modifications to work: 6996 * // - It may require correct/in-range values for request initialization. 6997 * // - It may require specifying regional endpoints when creating the service client as shown in 6998 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 6999 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 7000 * GetReplicationCycleRequest request = 7001 * GetReplicationCycleRequest.newBuilder() 7002 * .setName( 7003 * ReplicationCycleName.of( 7004 * "[PROJECT]", 7005 * "[LOCATION]", 7006 * "[SOURCE]", 7007 * "[MIGRATING_VM]", 7008 * "[REPLICATION_CYCLE]") 7009 * .toString()) 7010 * .build(); 7011 * ReplicationCycle response = vmMigrationClient.getReplicationCycle(request); 7012 * } 7013 * }</pre> 7014 * 7015 * @param request The request object containing all of the parameters for the API call. 7016 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 7017 */ getReplicationCycle(GetReplicationCycleRequest request)7018 public final ReplicationCycle getReplicationCycle(GetReplicationCycleRequest request) { 7019 return getReplicationCycleCallable().call(request); 7020 } 7021 7022 // AUTO-GENERATED DOCUMENTATION AND METHOD. 7023 /** 7024 * Gets details of a single ReplicationCycle. 7025 * 7026 * <p>Sample code: 7027 * 7028 * <pre>{@code 7029 * // This snippet has been automatically generated and should be regarded as a code template only. 7030 * // It will require modifications to work: 7031 * // - It may require correct/in-range values for request initialization. 7032 * // - It may require specifying regional endpoints when creating the service client as shown in 7033 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 7034 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 7035 * GetReplicationCycleRequest request = 7036 * GetReplicationCycleRequest.newBuilder() 7037 * .setName( 7038 * ReplicationCycleName.of( 7039 * "[PROJECT]", 7040 * "[LOCATION]", 7041 * "[SOURCE]", 7042 * "[MIGRATING_VM]", 7043 * "[REPLICATION_CYCLE]") 7044 * .toString()) 7045 * .build(); 7046 * ApiFuture<ReplicationCycle> future = 7047 * vmMigrationClient.getReplicationCycleCallable().futureCall(request); 7048 * // Do something. 7049 * ReplicationCycle response = future.get(); 7050 * } 7051 * }</pre> 7052 */ 7053 public final UnaryCallable<GetReplicationCycleRequest, ReplicationCycle> getReplicationCycleCallable()7054 getReplicationCycleCallable() { 7055 return stub.getReplicationCycleCallable(); 7056 } 7057 7058 // AUTO-GENERATED DOCUMENTATION AND METHOD. 7059 /** 7060 * Lists information about the supported locations for this service. 7061 * 7062 * <p>Sample code: 7063 * 7064 * <pre>{@code 7065 * // This snippet has been automatically generated and should be regarded as a code template only. 7066 * // It will require modifications to work: 7067 * // - It may require correct/in-range values for request initialization. 7068 * // - It may require specifying regional endpoints when creating the service client as shown in 7069 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 7070 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 7071 * ListLocationsRequest request = 7072 * ListLocationsRequest.newBuilder() 7073 * .setName("name3373707") 7074 * .setFilter("filter-1274492040") 7075 * .setPageSize(883849137) 7076 * .setPageToken("pageToken873572522") 7077 * .build(); 7078 * for (Location element : vmMigrationClient.listLocations(request).iterateAll()) { 7079 * // doThingsWith(element); 7080 * } 7081 * } 7082 * }</pre> 7083 * 7084 * @param request The request object containing all of the parameters for the API call. 7085 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 7086 */ listLocations(ListLocationsRequest request)7087 public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { 7088 return listLocationsPagedCallable().call(request); 7089 } 7090 7091 // AUTO-GENERATED DOCUMENTATION AND METHOD. 7092 /** 7093 * Lists information about the supported locations for this service. 7094 * 7095 * <p>Sample code: 7096 * 7097 * <pre>{@code 7098 * // This snippet has been automatically generated and should be regarded as a code template only. 7099 * // It will require modifications to work: 7100 * // - It may require correct/in-range values for request initialization. 7101 * // - It may require specifying regional endpoints when creating the service client as shown in 7102 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 7103 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 7104 * ListLocationsRequest request = 7105 * ListLocationsRequest.newBuilder() 7106 * .setName("name3373707") 7107 * .setFilter("filter-1274492040") 7108 * .setPageSize(883849137) 7109 * .setPageToken("pageToken873572522") 7110 * .build(); 7111 * ApiFuture<Location> future = 7112 * vmMigrationClient.listLocationsPagedCallable().futureCall(request); 7113 * // Do something. 7114 * for (Location element : future.get().iterateAll()) { 7115 * // doThingsWith(element); 7116 * } 7117 * } 7118 * }</pre> 7119 */ 7120 public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse> listLocationsPagedCallable()7121 listLocationsPagedCallable() { 7122 return stub.listLocationsPagedCallable(); 7123 } 7124 7125 // AUTO-GENERATED DOCUMENTATION AND METHOD. 7126 /** 7127 * Lists information about the supported locations for this service. 7128 * 7129 * <p>Sample code: 7130 * 7131 * <pre>{@code 7132 * // This snippet has been automatically generated and should be regarded as a code template only. 7133 * // It will require modifications to work: 7134 * // - It may require correct/in-range values for request initialization. 7135 * // - It may require specifying regional endpoints when creating the service client as shown in 7136 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 7137 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 7138 * ListLocationsRequest request = 7139 * ListLocationsRequest.newBuilder() 7140 * .setName("name3373707") 7141 * .setFilter("filter-1274492040") 7142 * .setPageSize(883849137) 7143 * .setPageToken("pageToken873572522") 7144 * .build(); 7145 * while (true) { 7146 * ListLocationsResponse response = vmMigrationClient.listLocationsCallable().call(request); 7147 * for (Location element : response.getLocationsList()) { 7148 * // doThingsWith(element); 7149 * } 7150 * String nextPageToken = response.getNextPageToken(); 7151 * if (!Strings.isNullOrEmpty(nextPageToken)) { 7152 * request = request.toBuilder().setPageToken(nextPageToken).build(); 7153 * } else { 7154 * break; 7155 * } 7156 * } 7157 * } 7158 * }</pre> 7159 */ listLocationsCallable()7160 public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() { 7161 return stub.listLocationsCallable(); 7162 } 7163 7164 // AUTO-GENERATED DOCUMENTATION AND METHOD. 7165 /** 7166 * Gets information about a location. 7167 * 7168 * <p>Sample code: 7169 * 7170 * <pre>{@code 7171 * // This snippet has been automatically generated and should be regarded as a code template only. 7172 * // It will require modifications to work: 7173 * // - It may require correct/in-range values for request initialization. 7174 * // - It may require specifying regional endpoints when creating the service client as shown in 7175 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 7176 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 7177 * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); 7178 * Location response = vmMigrationClient.getLocation(request); 7179 * } 7180 * }</pre> 7181 * 7182 * @param request The request object containing all of the parameters for the API call. 7183 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 7184 */ getLocation(GetLocationRequest request)7185 public final Location getLocation(GetLocationRequest request) { 7186 return getLocationCallable().call(request); 7187 } 7188 7189 // AUTO-GENERATED DOCUMENTATION AND METHOD. 7190 /** 7191 * Gets information about a location. 7192 * 7193 * <p>Sample code: 7194 * 7195 * <pre>{@code 7196 * // This snippet has been automatically generated and should be regarded as a code template only. 7197 * // It will require modifications to work: 7198 * // - It may require correct/in-range values for request initialization. 7199 * // - It may require specifying regional endpoints when creating the service client as shown in 7200 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 7201 * try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { 7202 * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); 7203 * ApiFuture<Location> future = vmMigrationClient.getLocationCallable().futureCall(request); 7204 * // Do something. 7205 * Location response = future.get(); 7206 * } 7207 * }</pre> 7208 */ getLocationCallable()7209 public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() { 7210 return stub.getLocationCallable(); 7211 } 7212 7213 @Override close()7214 public final void close() { 7215 stub.close(); 7216 } 7217 7218 @Override shutdown()7219 public void shutdown() { 7220 stub.shutdown(); 7221 } 7222 7223 @Override isShutdown()7224 public boolean isShutdown() { 7225 return stub.isShutdown(); 7226 } 7227 7228 @Override isTerminated()7229 public boolean isTerminated() { 7230 return stub.isTerminated(); 7231 } 7232 7233 @Override shutdownNow()7234 public void shutdownNow() { 7235 stub.shutdownNow(); 7236 } 7237 7238 @Override awaitTermination(long duration, TimeUnit unit)7239 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 7240 return stub.awaitTermination(duration, unit); 7241 } 7242 7243 public static class ListSourcesPagedResponse 7244 extends AbstractPagedListResponse< 7245 ListSourcesRequest, 7246 ListSourcesResponse, 7247 Source, 7248 ListSourcesPage, 7249 ListSourcesFixedSizeCollection> { 7250 createAsync( PageContext<ListSourcesRequest, ListSourcesResponse, Source> context, ApiFuture<ListSourcesResponse> futureResponse)7251 public static ApiFuture<ListSourcesPagedResponse> createAsync( 7252 PageContext<ListSourcesRequest, ListSourcesResponse, Source> context, 7253 ApiFuture<ListSourcesResponse> futureResponse) { 7254 ApiFuture<ListSourcesPage> futurePage = 7255 ListSourcesPage.createEmptyPage().createPageAsync(context, futureResponse); 7256 return ApiFutures.transform( 7257 futurePage, input -> new ListSourcesPagedResponse(input), MoreExecutors.directExecutor()); 7258 } 7259 ListSourcesPagedResponse(ListSourcesPage page)7260 private ListSourcesPagedResponse(ListSourcesPage page) { 7261 super(page, ListSourcesFixedSizeCollection.createEmptyCollection()); 7262 } 7263 } 7264 7265 public static class ListSourcesPage 7266 extends AbstractPage<ListSourcesRequest, ListSourcesResponse, Source, ListSourcesPage> { 7267 ListSourcesPage( PageContext<ListSourcesRequest, ListSourcesResponse, Source> context, ListSourcesResponse response)7268 private ListSourcesPage( 7269 PageContext<ListSourcesRequest, ListSourcesResponse, Source> context, 7270 ListSourcesResponse response) { 7271 super(context, response); 7272 } 7273 createEmptyPage()7274 private static ListSourcesPage createEmptyPage() { 7275 return new ListSourcesPage(null, null); 7276 } 7277 7278 @Override createPage( PageContext<ListSourcesRequest, ListSourcesResponse, Source> context, ListSourcesResponse response)7279 protected ListSourcesPage createPage( 7280 PageContext<ListSourcesRequest, ListSourcesResponse, Source> context, 7281 ListSourcesResponse response) { 7282 return new ListSourcesPage(context, response); 7283 } 7284 7285 @Override createPageAsync( PageContext<ListSourcesRequest, ListSourcesResponse, Source> context, ApiFuture<ListSourcesResponse> futureResponse)7286 public ApiFuture<ListSourcesPage> createPageAsync( 7287 PageContext<ListSourcesRequest, ListSourcesResponse, Source> context, 7288 ApiFuture<ListSourcesResponse> futureResponse) { 7289 return super.createPageAsync(context, futureResponse); 7290 } 7291 } 7292 7293 public static class ListSourcesFixedSizeCollection 7294 extends AbstractFixedSizeCollection< 7295 ListSourcesRequest, 7296 ListSourcesResponse, 7297 Source, 7298 ListSourcesPage, 7299 ListSourcesFixedSizeCollection> { 7300 ListSourcesFixedSizeCollection(List<ListSourcesPage> pages, int collectionSize)7301 private ListSourcesFixedSizeCollection(List<ListSourcesPage> pages, int collectionSize) { 7302 super(pages, collectionSize); 7303 } 7304 createEmptyCollection()7305 private static ListSourcesFixedSizeCollection createEmptyCollection() { 7306 return new ListSourcesFixedSizeCollection(null, 0); 7307 } 7308 7309 @Override createCollection( List<ListSourcesPage> pages, int collectionSize)7310 protected ListSourcesFixedSizeCollection createCollection( 7311 List<ListSourcesPage> pages, int collectionSize) { 7312 return new ListSourcesFixedSizeCollection(pages, collectionSize); 7313 } 7314 } 7315 7316 public static class ListUtilizationReportsPagedResponse 7317 extends AbstractPagedListResponse< 7318 ListUtilizationReportsRequest, 7319 ListUtilizationReportsResponse, 7320 UtilizationReport, 7321 ListUtilizationReportsPage, 7322 ListUtilizationReportsFixedSizeCollection> { 7323 createAsync( PageContext< ListUtilizationReportsRequest, ListUtilizationReportsResponse, UtilizationReport> context, ApiFuture<ListUtilizationReportsResponse> futureResponse)7324 public static ApiFuture<ListUtilizationReportsPagedResponse> createAsync( 7325 PageContext< 7326 ListUtilizationReportsRequest, ListUtilizationReportsResponse, UtilizationReport> 7327 context, 7328 ApiFuture<ListUtilizationReportsResponse> futureResponse) { 7329 ApiFuture<ListUtilizationReportsPage> futurePage = 7330 ListUtilizationReportsPage.createEmptyPage().createPageAsync(context, futureResponse); 7331 return ApiFutures.transform( 7332 futurePage, 7333 input -> new ListUtilizationReportsPagedResponse(input), 7334 MoreExecutors.directExecutor()); 7335 } 7336 ListUtilizationReportsPagedResponse(ListUtilizationReportsPage page)7337 private ListUtilizationReportsPagedResponse(ListUtilizationReportsPage page) { 7338 super(page, ListUtilizationReportsFixedSizeCollection.createEmptyCollection()); 7339 } 7340 } 7341 7342 public static class ListUtilizationReportsPage 7343 extends AbstractPage< 7344 ListUtilizationReportsRequest, 7345 ListUtilizationReportsResponse, 7346 UtilizationReport, 7347 ListUtilizationReportsPage> { 7348 ListUtilizationReportsPage( PageContext< ListUtilizationReportsRequest, ListUtilizationReportsResponse, UtilizationReport> context, ListUtilizationReportsResponse response)7349 private ListUtilizationReportsPage( 7350 PageContext< 7351 ListUtilizationReportsRequest, ListUtilizationReportsResponse, UtilizationReport> 7352 context, 7353 ListUtilizationReportsResponse response) { 7354 super(context, response); 7355 } 7356 createEmptyPage()7357 private static ListUtilizationReportsPage createEmptyPage() { 7358 return new ListUtilizationReportsPage(null, null); 7359 } 7360 7361 @Override createPage( PageContext< ListUtilizationReportsRequest, ListUtilizationReportsResponse, UtilizationReport> context, ListUtilizationReportsResponse response)7362 protected ListUtilizationReportsPage createPage( 7363 PageContext< 7364 ListUtilizationReportsRequest, ListUtilizationReportsResponse, UtilizationReport> 7365 context, 7366 ListUtilizationReportsResponse response) { 7367 return new ListUtilizationReportsPage(context, response); 7368 } 7369 7370 @Override createPageAsync( PageContext< ListUtilizationReportsRequest, ListUtilizationReportsResponse, UtilizationReport> context, ApiFuture<ListUtilizationReportsResponse> futureResponse)7371 public ApiFuture<ListUtilizationReportsPage> createPageAsync( 7372 PageContext< 7373 ListUtilizationReportsRequest, ListUtilizationReportsResponse, UtilizationReport> 7374 context, 7375 ApiFuture<ListUtilizationReportsResponse> futureResponse) { 7376 return super.createPageAsync(context, futureResponse); 7377 } 7378 } 7379 7380 public static class ListUtilizationReportsFixedSizeCollection 7381 extends AbstractFixedSizeCollection< 7382 ListUtilizationReportsRequest, 7383 ListUtilizationReportsResponse, 7384 UtilizationReport, 7385 ListUtilizationReportsPage, 7386 ListUtilizationReportsFixedSizeCollection> { 7387 ListUtilizationReportsFixedSizeCollection( List<ListUtilizationReportsPage> pages, int collectionSize)7388 private ListUtilizationReportsFixedSizeCollection( 7389 List<ListUtilizationReportsPage> pages, int collectionSize) { 7390 super(pages, collectionSize); 7391 } 7392 createEmptyCollection()7393 private static ListUtilizationReportsFixedSizeCollection createEmptyCollection() { 7394 return new ListUtilizationReportsFixedSizeCollection(null, 0); 7395 } 7396 7397 @Override createCollection( List<ListUtilizationReportsPage> pages, int collectionSize)7398 protected ListUtilizationReportsFixedSizeCollection createCollection( 7399 List<ListUtilizationReportsPage> pages, int collectionSize) { 7400 return new ListUtilizationReportsFixedSizeCollection(pages, collectionSize); 7401 } 7402 } 7403 7404 public static class ListDatacenterConnectorsPagedResponse 7405 extends AbstractPagedListResponse< 7406 ListDatacenterConnectorsRequest, 7407 ListDatacenterConnectorsResponse, 7408 DatacenterConnector, 7409 ListDatacenterConnectorsPage, 7410 ListDatacenterConnectorsFixedSizeCollection> { 7411 createAsync( PageContext< ListDatacenterConnectorsRequest, ListDatacenterConnectorsResponse, DatacenterConnector> context, ApiFuture<ListDatacenterConnectorsResponse> futureResponse)7412 public static ApiFuture<ListDatacenterConnectorsPagedResponse> createAsync( 7413 PageContext< 7414 ListDatacenterConnectorsRequest, 7415 ListDatacenterConnectorsResponse, 7416 DatacenterConnector> 7417 context, 7418 ApiFuture<ListDatacenterConnectorsResponse> futureResponse) { 7419 ApiFuture<ListDatacenterConnectorsPage> futurePage = 7420 ListDatacenterConnectorsPage.createEmptyPage().createPageAsync(context, futureResponse); 7421 return ApiFutures.transform( 7422 futurePage, 7423 input -> new ListDatacenterConnectorsPagedResponse(input), 7424 MoreExecutors.directExecutor()); 7425 } 7426 ListDatacenterConnectorsPagedResponse(ListDatacenterConnectorsPage page)7427 private ListDatacenterConnectorsPagedResponse(ListDatacenterConnectorsPage page) { 7428 super(page, ListDatacenterConnectorsFixedSizeCollection.createEmptyCollection()); 7429 } 7430 } 7431 7432 public static class ListDatacenterConnectorsPage 7433 extends AbstractPage< 7434 ListDatacenterConnectorsRequest, 7435 ListDatacenterConnectorsResponse, 7436 DatacenterConnector, 7437 ListDatacenterConnectorsPage> { 7438 ListDatacenterConnectorsPage( PageContext< ListDatacenterConnectorsRequest, ListDatacenterConnectorsResponse, DatacenterConnector> context, ListDatacenterConnectorsResponse response)7439 private ListDatacenterConnectorsPage( 7440 PageContext< 7441 ListDatacenterConnectorsRequest, 7442 ListDatacenterConnectorsResponse, 7443 DatacenterConnector> 7444 context, 7445 ListDatacenterConnectorsResponse response) { 7446 super(context, response); 7447 } 7448 createEmptyPage()7449 private static ListDatacenterConnectorsPage createEmptyPage() { 7450 return new ListDatacenterConnectorsPage(null, null); 7451 } 7452 7453 @Override createPage( PageContext< ListDatacenterConnectorsRequest, ListDatacenterConnectorsResponse, DatacenterConnector> context, ListDatacenterConnectorsResponse response)7454 protected ListDatacenterConnectorsPage createPage( 7455 PageContext< 7456 ListDatacenterConnectorsRequest, 7457 ListDatacenterConnectorsResponse, 7458 DatacenterConnector> 7459 context, 7460 ListDatacenterConnectorsResponse response) { 7461 return new ListDatacenterConnectorsPage(context, response); 7462 } 7463 7464 @Override createPageAsync( PageContext< ListDatacenterConnectorsRequest, ListDatacenterConnectorsResponse, DatacenterConnector> context, ApiFuture<ListDatacenterConnectorsResponse> futureResponse)7465 public ApiFuture<ListDatacenterConnectorsPage> createPageAsync( 7466 PageContext< 7467 ListDatacenterConnectorsRequest, 7468 ListDatacenterConnectorsResponse, 7469 DatacenterConnector> 7470 context, 7471 ApiFuture<ListDatacenterConnectorsResponse> futureResponse) { 7472 return super.createPageAsync(context, futureResponse); 7473 } 7474 } 7475 7476 public static class ListDatacenterConnectorsFixedSizeCollection 7477 extends AbstractFixedSizeCollection< 7478 ListDatacenterConnectorsRequest, 7479 ListDatacenterConnectorsResponse, 7480 DatacenterConnector, 7481 ListDatacenterConnectorsPage, 7482 ListDatacenterConnectorsFixedSizeCollection> { 7483 ListDatacenterConnectorsFixedSizeCollection( List<ListDatacenterConnectorsPage> pages, int collectionSize)7484 private ListDatacenterConnectorsFixedSizeCollection( 7485 List<ListDatacenterConnectorsPage> pages, int collectionSize) { 7486 super(pages, collectionSize); 7487 } 7488 createEmptyCollection()7489 private static ListDatacenterConnectorsFixedSizeCollection createEmptyCollection() { 7490 return new ListDatacenterConnectorsFixedSizeCollection(null, 0); 7491 } 7492 7493 @Override createCollection( List<ListDatacenterConnectorsPage> pages, int collectionSize)7494 protected ListDatacenterConnectorsFixedSizeCollection createCollection( 7495 List<ListDatacenterConnectorsPage> pages, int collectionSize) { 7496 return new ListDatacenterConnectorsFixedSizeCollection(pages, collectionSize); 7497 } 7498 } 7499 7500 public static class ListMigratingVmsPagedResponse 7501 extends AbstractPagedListResponse< 7502 ListMigratingVmsRequest, 7503 ListMigratingVmsResponse, 7504 MigratingVm, 7505 ListMigratingVmsPage, 7506 ListMigratingVmsFixedSizeCollection> { 7507 createAsync( PageContext<ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm> context, ApiFuture<ListMigratingVmsResponse> futureResponse)7508 public static ApiFuture<ListMigratingVmsPagedResponse> createAsync( 7509 PageContext<ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm> context, 7510 ApiFuture<ListMigratingVmsResponse> futureResponse) { 7511 ApiFuture<ListMigratingVmsPage> futurePage = 7512 ListMigratingVmsPage.createEmptyPage().createPageAsync(context, futureResponse); 7513 return ApiFutures.transform( 7514 futurePage, 7515 input -> new ListMigratingVmsPagedResponse(input), 7516 MoreExecutors.directExecutor()); 7517 } 7518 ListMigratingVmsPagedResponse(ListMigratingVmsPage page)7519 private ListMigratingVmsPagedResponse(ListMigratingVmsPage page) { 7520 super(page, ListMigratingVmsFixedSizeCollection.createEmptyCollection()); 7521 } 7522 } 7523 7524 public static class ListMigratingVmsPage 7525 extends AbstractPage< 7526 ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm, ListMigratingVmsPage> { 7527 ListMigratingVmsPage( PageContext<ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm> context, ListMigratingVmsResponse response)7528 private ListMigratingVmsPage( 7529 PageContext<ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm> context, 7530 ListMigratingVmsResponse response) { 7531 super(context, response); 7532 } 7533 createEmptyPage()7534 private static ListMigratingVmsPage createEmptyPage() { 7535 return new ListMigratingVmsPage(null, null); 7536 } 7537 7538 @Override createPage( PageContext<ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm> context, ListMigratingVmsResponse response)7539 protected ListMigratingVmsPage createPage( 7540 PageContext<ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm> context, 7541 ListMigratingVmsResponse response) { 7542 return new ListMigratingVmsPage(context, response); 7543 } 7544 7545 @Override createPageAsync( PageContext<ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm> context, ApiFuture<ListMigratingVmsResponse> futureResponse)7546 public ApiFuture<ListMigratingVmsPage> createPageAsync( 7547 PageContext<ListMigratingVmsRequest, ListMigratingVmsResponse, MigratingVm> context, 7548 ApiFuture<ListMigratingVmsResponse> futureResponse) { 7549 return super.createPageAsync(context, futureResponse); 7550 } 7551 } 7552 7553 public static class ListMigratingVmsFixedSizeCollection 7554 extends AbstractFixedSizeCollection< 7555 ListMigratingVmsRequest, 7556 ListMigratingVmsResponse, 7557 MigratingVm, 7558 ListMigratingVmsPage, 7559 ListMigratingVmsFixedSizeCollection> { 7560 ListMigratingVmsFixedSizeCollection( List<ListMigratingVmsPage> pages, int collectionSize)7561 private ListMigratingVmsFixedSizeCollection( 7562 List<ListMigratingVmsPage> pages, int collectionSize) { 7563 super(pages, collectionSize); 7564 } 7565 createEmptyCollection()7566 private static ListMigratingVmsFixedSizeCollection createEmptyCollection() { 7567 return new ListMigratingVmsFixedSizeCollection(null, 0); 7568 } 7569 7570 @Override createCollection( List<ListMigratingVmsPage> pages, int collectionSize)7571 protected ListMigratingVmsFixedSizeCollection createCollection( 7572 List<ListMigratingVmsPage> pages, int collectionSize) { 7573 return new ListMigratingVmsFixedSizeCollection(pages, collectionSize); 7574 } 7575 } 7576 7577 public static class ListCloneJobsPagedResponse 7578 extends AbstractPagedListResponse< 7579 ListCloneJobsRequest, 7580 ListCloneJobsResponse, 7581 CloneJob, 7582 ListCloneJobsPage, 7583 ListCloneJobsFixedSizeCollection> { 7584 createAsync( PageContext<ListCloneJobsRequest, ListCloneJobsResponse, CloneJob> context, ApiFuture<ListCloneJobsResponse> futureResponse)7585 public static ApiFuture<ListCloneJobsPagedResponse> createAsync( 7586 PageContext<ListCloneJobsRequest, ListCloneJobsResponse, CloneJob> context, 7587 ApiFuture<ListCloneJobsResponse> futureResponse) { 7588 ApiFuture<ListCloneJobsPage> futurePage = 7589 ListCloneJobsPage.createEmptyPage().createPageAsync(context, futureResponse); 7590 return ApiFutures.transform( 7591 futurePage, 7592 input -> new ListCloneJobsPagedResponse(input), 7593 MoreExecutors.directExecutor()); 7594 } 7595 ListCloneJobsPagedResponse(ListCloneJobsPage page)7596 private ListCloneJobsPagedResponse(ListCloneJobsPage page) { 7597 super(page, ListCloneJobsFixedSizeCollection.createEmptyCollection()); 7598 } 7599 } 7600 7601 public static class ListCloneJobsPage 7602 extends AbstractPage< 7603 ListCloneJobsRequest, ListCloneJobsResponse, CloneJob, ListCloneJobsPage> { 7604 ListCloneJobsPage( PageContext<ListCloneJobsRequest, ListCloneJobsResponse, CloneJob> context, ListCloneJobsResponse response)7605 private ListCloneJobsPage( 7606 PageContext<ListCloneJobsRequest, ListCloneJobsResponse, CloneJob> context, 7607 ListCloneJobsResponse response) { 7608 super(context, response); 7609 } 7610 createEmptyPage()7611 private static ListCloneJobsPage createEmptyPage() { 7612 return new ListCloneJobsPage(null, null); 7613 } 7614 7615 @Override createPage( PageContext<ListCloneJobsRequest, ListCloneJobsResponse, CloneJob> context, ListCloneJobsResponse response)7616 protected ListCloneJobsPage createPage( 7617 PageContext<ListCloneJobsRequest, ListCloneJobsResponse, CloneJob> context, 7618 ListCloneJobsResponse response) { 7619 return new ListCloneJobsPage(context, response); 7620 } 7621 7622 @Override createPageAsync( PageContext<ListCloneJobsRequest, ListCloneJobsResponse, CloneJob> context, ApiFuture<ListCloneJobsResponse> futureResponse)7623 public ApiFuture<ListCloneJobsPage> createPageAsync( 7624 PageContext<ListCloneJobsRequest, ListCloneJobsResponse, CloneJob> context, 7625 ApiFuture<ListCloneJobsResponse> futureResponse) { 7626 return super.createPageAsync(context, futureResponse); 7627 } 7628 } 7629 7630 public static class ListCloneJobsFixedSizeCollection 7631 extends AbstractFixedSizeCollection< 7632 ListCloneJobsRequest, 7633 ListCloneJobsResponse, 7634 CloneJob, 7635 ListCloneJobsPage, 7636 ListCloneJobsFixedSizeCollection> { 7637 ListCloneJobsFixedSizeCollection(List<ListCloneJobsPage> pages, int collectionSize)7638 private ListCloneJobsFixedSizeCollection(List<ListCloneJobsPage> pages, int collectionSize) { 7639 super(pages, collectionSize); 7640 } 7641 createEmptyCollection()7642 private static ListCloneJobsFixedSizeCollection createEmptyCollection() { 7643 return new ListCloneJobsFixedSizeCollection(null, 0); 7644 } 7645 7646 @Override createCollection( List<ListCloneJobsPage> pages, int collectionSize)7647 protected ListCloneJobsFixedSizeCollection createCollection( 7648 List<ListCloneJobsPage> pages, int collectionSize) { 7649 return new ListCloneJobsFixedSizeCollection(pages, collectionSize); 7650 } 7651 } 7652 7653 public static class ListCutoverJobsPagedResponse 7654 extends AbstractPagedListResponse< 7655 ListCutoverJobsRequest, 7656 ListCutoverJobsResponse, 7657 CutoverJob, 7658 ListCutoverJobsPage, 7659 ListCutoverJobsFixedSizeCollection> { 7660 createAsync( PageContext<ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob> context, ApiFuture<ListCutoverJobsResponse> futureResponse)7661 public static ApiFuture<ListCutoverJobsPagedResponse> createAsync( 7662 PageContext<ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob> context, 7663 ApiFuture<ListCutoverJobsResponse> futureResponse) { 7664 ApiFuture<ListCutoverJobsPage> futurePage = 7665 ListCutoverJobsPage.createEmptyPage().createPageAsync(context, futureResponse); 7666 return ApiFutures.transform( 7667 futurePage, 7668 input -> new ListCutoverJobsPagedResponse(input), 7669 MoreExecutors.directExecutor()); 7670 } 7671 ListCutoverJobsPagedResponse(ListCutoverJobsPage page)7672 private ListCutoverJobsPagedResponse(ListCutoverJobsPage page) { 7673 super(page, ListCutoverJobsFixedSizeCollection.createEmptyCollection()); 7674 } 7675 } 7676 7677 public static class ListCutoverJobsPage 7678 extends AbstractPage< 7679 ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob, ListCutoverJobsPage> { 7680 ListCutoverJobsPage( PageContext<ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob> context, ListCutoverJobsResponse response)7681 private ListCutoverJobsPage( 7682 PageContext<ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob> context, 7683 ListCutoverJobsResponse response) { 7684 super(context, response); 7685 } 7686 createEmptyPage()7687 private static ListCutoverJobsPage createEmptyPage() { 7688 return new ListCutoverJobsPage(null, null); 7689 } 7690 7691 @Override createPage( PageContext<ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob> context, ListCutoverJobsResponse response)7692 protected ListCutoverJobsPage createPage( 7693 PageContext<ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob> context, 7694 ListCutoverJobsResponse response) { 7695 return new ListCutoverJobsPage(context, response); 7696 } 7697 7698 @Override createPageAsync( PageContext<ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob> context, ApiFuture<ListCutoverJobsResponse> futureResponse)7699 public ApiFuture<ListCutoverJobsPage> createPageAsync( 7700 PageContext<ListCutoverJobsRequest, ListCutoverJobsResponse, CutoverJob> context, 7701 ApiFuture<ListCutoverJobsResponse> futureResponse) { 7702 return super.createPageAsync(context, futureResponse); 7703 } 7704 } 7705 7706 public static class ListCutoverJobsFixedSizeCollection 7707 extends AbstractFixedSizeCollection< 7708 ListCutoverJobsRequest, 7709 ListCutoverJobsResponse, 7710 CutoverJob, 7711 ListCutoverJobsPage, 7712 ListCutoverJobsFixedSizeCollection> { 7713 ListCutoverJobsFixedSizeCollection( List<ListCutoverJobsPage> pages, int collectionSize)7714 private ListCutoverJobsFixedSizeCollection( 7715 List<ListCutoverJobsPage> pages, int collectionSize) { 7716 super(pages, collectionSize); 7717 } 7718 createEmptyCollection()7719 private static ListCutoverJobsFixedSizeCollection createEmptyCollection() { 7720 return new ListCutoverJobsFixedSizeCollection(null, 0); 7721 } 7722 7723 @Override createCollection( List<ListCutoverJobsPage> pages, int collectionSize)7724 protected ListCutoverJobsFixedSizeCollection createCollection( 7725 List<ListCutoverJobsPage> pages, int collectionSize) { 7726 return new ListCutoverJobsFixedSizeCollection(pages, collectionSize); 7727 } 7728 } 7729 7730 public static class ListGroupsPagedResponse 7731 extends AbstractPagedListResponse< 7732 ListGroupsRequest, 7733 ListGroupsResponse, 7734 Group, 7735 ListGroupsPage, 7736 ListGroupsFixedSizeCollection> { 7737 createAsync( PageContext<ListGroupsRequest, ListGroupsResponse, Group> context, ApiFuture<ListGroupsResponse> futureResponse)7738 public static ApiFuture<ListGroupsPagedResponse> createAsync( 7739 PageContext<ListGroupsRequest, ListGroupsResponse, Group> context, 7740 ApiFuture<ListGroupsResponse> futureResponse) { 7741 ApiFuture<ListGroupsPage> futurePage = 7742 ListGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); 7743 return ApiFutures.transform( 7744 futurePage, input -> new ListGroupsPagedResponse(input), MoreExecutors.directExecutor()); 7745 } 7746 ListGroupsPagedResponse(ListGroupsPage page)7747 private ListGroupsPagedResponse(ListGroupsPage page) { 7748 super(page, ListGroupsFixedSizeCollection.createEmptyCollection()); 7749 } 7750 } 7751 7752 public static class ListGroupsPage 7753 extends AbstractPage<ListGroupsRequest, ListGroupsResponse, Group, ListGroupsPage> { 7754 ListGroupsPage( PageContext<ListGroupsRequest, ListGroupsResponse, Group> context, ListGroupsResponse response)7755 private ListGroupsPage( 7756 PageContext<ListGroupsRequest, ListGroupsResponse, Group> context, 7757 ListGroupsResponse response) { 7758 super(context, response); 7759 } 7760 createEmptyPage()7761 private static ListGroupsPage createEmptyPage() { 7762 return new ListGroupsPage(null, null); 7763 } 7764 7765 @Override createPage( PageContext<ListGroupsRequest, ListGroupsResponse, Group> context, ListGroupsResponse response)7766 protected ListGroupsPage createPage( 7767 PageContext<ListGroupsRequest, ListGroupsResponse, Group> context, 7768 ListGroupsResponse response) { 7769 return new ListGroupsPage(context, response); 7770 } 7771 7772 @Override createPageAsync( PageContext<ListGroupsRequest, ListGroupsResponse, Group> context, ApiFuture<ListGroupsResponse> futureResponse)7773 public ApiFuture<ListGroupsPage> createPageAsync( 7774 PageContext<ListGroupsRequest, ListGroupsResponse, Group> context, 7775 ApiFuture<ListGroupsResponse> futureResponse) { 7776 return super.createPageAsync(context, futureResponse); 7777 } 7778 } 7779 7780 public static class ListGroupsFixedSizeCollection 7781 extends AbstractFixedSizeCollection< 7782 ListGroupsRequest, 7783 ListGroupsResponse, 7784 Group, 7785 ListGroupsPage, 7786 ListGroupsFixedSizeCollection> { 7787 ListGroupsFixedSizeCollection(List<ListGroupsPage> pages, int collectionSize)7788 private ListGroupsFixedSizeCollection(List<ListGroupsPage> pages, int collectionSize) { 7789 super(pages, collectionSize); 7790 } 7791 createEmptyCollection()7792 private static ListGroupsFixedSizeCollection createEmptyCollection() { 7793 return new ListGroupsFixedSizeCollection(null, 0); 7794 } 7795 7796 @Override createCollection( List<ListGroupsPage> pages, int collectionSize)7797 protected ListGroupsFixedSizeCollection createCollection( 7798 List<ListGroupsPage> pages, int collectionSize) { 7799 return new ListGroupsFixedSizeCollection(pages, collectionSize); 7800 } 7801 } 7802 7803 public static class ListTargetProjectsPagedResponse 7804 extends AbstractPagedListResponse< 7805 ListTargetProjectsRequest, 7806 ListTargetProjectsResponse, 7807 TargetProject, 7808 ListTargetProjectsPage, 7809 ListTargetProjectsFixedSizeCollection> { 7810 createAsync( PageContext<ListTargetProjectsRequest, ListTargetProjectsResponse, TargetProject> context, ApiFuture<ListTargetProjectsResponse> futureResponse)7811 public static ApiFuture<ListTargetProjectsPagedResponse> createAsync( 7812 PageContext<ListTargetProjectsRequest, ListTargetProjectsResponse, TargetProject> context, 7813 ApiFuture<ListTargetProjectsResponse> futureResponse) { 7814 ApiFuture<ListTargetProjectsPage> futurePage = 7815 ListTargetProjectsPage.createEmptyPage().createPageAsync(context, futureResponse); 7816 return ApiFutures.transform( 7817 futurePage, 7818 input -> new ListTargetProjectsPagedResponse(input), 7819 MoreExecutors.directExecutor()); 7820 } 7821 ListTargetProjectsPagedResponse(ListTargetProjectsPage page)7822 private ListTargetProjectsPagedResponse(ListTargetProjectsPage page) { 7823 super(page, ListTargetProjectsFixedSizeCollection.createEmptyCollection()); 7824 } 7825 } 7826 7827 public static class ListTargetProjectsPage 7828 extends AbstractPage< 7829 ListTargetProjectsRequest, 7830 ListTargetProjectsResponse, 7831 TargetProject, 7832 ListTargetProjectsPage> { 7833 ListTargetProjectsPage( PageContext<ListTargetProjectsRequest, ListTargetProjectsResponse, TargetProject> context, ListTargetProjectsResponse response)7834 private ListTargetProjectsPage( 7835 PageContext<ListTargetProjectsRequest, ListTargetProjectsResponse, TargetProject> context, 7836 ListTargetProjectsResponse response) { 7837 super(context, response); 7838 } 7839 createEmptyPage()7840 private static ListTargetProjectsPage createEmptyPage() { 7841 return new ListTargetProjectsPage(null, null); 7842 } 7843 7844 @Override createPage( PageContext<ListTargetProjectsRequest, ListTargetProjectsResponse, TargetProject> context, ListTargetProjectsResponse response)7845 protected ListTargetProjectsPage createPage( 7846 PageContext<ListTargetProjectsRequest, ListTargetProjectsResponse, TargetProject> context, 7847 ListTargetProjectsResponse response) { 7848 return new ListTargetProjectsPage(context, response); 7849 } 7850 7851 @Override createPageAsync( PageContext<ListTargetProjectsRequest, ListTargetProjectsResponse, TargetProject> context, ApiFuture<ListTargetProjectsResponse> futureResponse)7852 public ApiFuture<ListTargetProjectsPage> createPageAsync( 7853 PageContext<ListTargetProjectsRequest, ListTargetProjectsResponse, TargetProject> context, 7854 ApiFuture<ListTargetProjectsResponse> futureResponse) { 7855 return super.createPageAsync(context, futureResponse); 7856 } 7857 } 7858 7859 public static class ListTargetProjectsFixedSizeCollection 7860 extends AbstractFixedSizeCollection< 7861 ListTargetProjectsRequest, 7862 ListTargetProjectsResponse, 7863 TargetProject, 7864 ListTargetProjectsPage, 7865 ListTargetProjectsFixedSizeCollection> { 7866 ListTargetProjectsFixedSizeCollection( List<ListTargetProjectsPage> pages, int collectionSize)7867 private ListTargetProjectsFixedSizeCollection( 7868 List<ListTargetProjectsPage> pages, int collectionSize) { 7869 super(pages, collectionSize); 7870 } 7871 createEmptyCollection()7872 private static ListTargetProjectsFixedSizeCollection createEmptyCollection() { 7873 return new ListTargetProjectsFixedSizeCollection(null, 0); 7874 } 7875 7876 @Override createCollection( List<ListTargetProjectsPage> pages, int collectionSize)7877 protected ListTargetProjectsFixedSizeCollection createCollection( 7878 List<ListTargetProjectsPage> pages, int collectionSize) { 7879 return new ListTargetProjectsFixedSizeCollection(pages, collectionSize); 7880 } 7881 } 7882 7883 public static class ListReplicationCyclesPagedResponse 7884 extends AbstractPagedListResponse< 7885 ListReplicationCyclesRequest, 7886 ListReplicationCyclesResponse, 7887 ReplicationCycle, 7888 ListReplicationCyclesPage, 7889 ListReplicationCyclesFixedSizeCollection> { 7890 createAsync( PageContext<ListReplicationCyclesRequest, ListReplicationCyclesResponse, ReplicationCycle> context, ApiFuture<ListReplicationCyclesResponse> futureResponse)7891 public static ApiFuture<ListReplicationCyclesPagedResponse> createAsync( 7892 PageContext<ListReplicationCyclesRequest, ListReplicationCyclesResponse, ReplicationCycle> 7893 context, 7894 ApiFuture<ListReplicationCyclesResponse> futureResponse) { 7895 ApiFuture<ListReplicationCyclesPage> futurePage = 7896 ListReplicationCyclesPage.createEmptyPage().createPageAsync(context, futureResponse); 7897 return ApiFutures.transform( 7898 futurePage, 7899 input -> new ListReplicationCyclesPagedResponse(input), 7900 MoreExecutors.directExecutor()); 7901 } 7902 ListReplicationCyclesPagedResponse(ListReplicationCyclesPage page)7903 private ListReplicationCyclesPagedResponse(ListReplicationCyclesPage page) { 7904 super(page, ListReplicationCyclesFixedSizeCollection.createEmptyCollection()); 7905 } 7906 } 7907 7908 public static class ListReplicationCyclesPage 7909 extends AbstractPage< 7910 ListReplicationCyclesRequest, 7911 ListReplicationCyclesResponse, 7912 ReplicationCycle, 7913 ListReplicationCyclesPage> { 7914 ListReplicationCyclesPage( PageContext<ListReplicationCyclesRequest, ListReplicationCyclesResponse, ReplicationCycle> context, ListReplicationCyclesResponse response)7915 private ListReplicationCyclesPage( 7916 PageContext<ListReplicationCyclesRequest, ListReplicationCyclesResponse, ReplicationCycle> 7917 context, 7918 ListReplicationCyclesResponse response) { 7919 super(context, response); 7920 } 7921 createEmptyPage()7922 private static ListReplicationCyclesPage createEmptyPage() { 7923 return new ListReplicationCyclesPage(null, null); 7924 } 7925 7926 @Override createPage( PageContext<ListReplicationCyclesRequest, ListReplicationCyclesResponse, ReplicationCycle> context, ListReplicationCyclesResponse response)7927 protected ListReplicationCyclesPage createPage( 7928 PageContext<ListReplicationCyclesRequest, ListReplicationCyclesResponse, ReplicationCycle> 7929 context, 7930 ListReplicationCyclesResponse response) { 7931 return new ListReplicationCyclesPage(context, response); 7932 } 7933 7934 @Override createPageAsync( PageContext<ListReplicationCyclesRequest, ListReplicationCyclesResponse, ReplicationCycle> context, ApiFuture<ListReplicationCyclesResponse> futureResponse)7935 public ApiFuture<ListReplicationCyclesPage> createPageAsync( 7936 PageContext<ListReplicationCyclesRequest, ListReplicationCyclesResponse, ReplicationCycle> 7937 context, 7938 ApiFuture<ListReplicationCyclesResponse> futureResponse) { 7939 return super.createPageAsync(context, futureResponse); 7940 } 7941 } 7942 7943 public static class ListReplicationCyclesFixedSizeCollection 7944 extends AbstractFixedSizeCollection< 7945 ListReplicationCyclesRequest, 7946 ListReplicationCyclesResponse, 7947 ReplicationCycle, 7948 ListReplicationCyclesPage, 7949 ListReplicationCyclesFixedSizeCollection> { 7950 ListReplicationCyclesFixedSizeCollection( List<ListReplicationCyclesPage> pages, int collectionSize)7951 private ListReplicationCyclesFixedSizeCollection( 7952 List<ListReplicationCyclesPage> pages, int collectionSize) { 7953 super(pages, collectionSize); 7954 } 7955 createEmptyCollection()7956 private static ListReplicationCyclesFixedSizeCollection createEmptyCollection() { 7957 return new ListReplicationCyclesFixedSizeCollection(null, 0); 7958 } 7959 7960 @Override createCollection( List<ListReplicationCyclesPage> pages, int collectionSize)7961 protected ListReplicationCyclesFixedSizeCollection createCollection( 7962 List<ListReplicationCyclesPage> pages, int collectionSize) { 7963 return new ListReplicationCyclesFixedSizeCollection(pages, collectionSize); 7964 } 7965 } 7966 7967 public static class ListLocationsPagedResponse 7968 extends AbstractPagedListResponse< 7969 ListLocationsRequest, 7970 ListLocationsResponse, 7971 Location, 7972 ListLocationsPage, 7973 ListLocationsFixedSizeCollection> { 7974 createAsync( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ApiFuture<ListLocationsResponse> futureResponse)7975 public static ApiFuture<ListLocationsPagedResponse> createAsync( 7976 PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, 7977 ApiFuture<ListLocationsResponse> futureResponse) { 7978 ApiFuture<ListLocationsPage> futurePage = 7979 ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); 7980 return ApiFutures.transform( 7981 futurePage, 7982 input -> new ListLocationsPagedResponse(input), 7983 MoreExecutors.directExecutor()); 7984 } 7985 ListLocationsPagedResponse(ListLocationsPage page)7986 private ListLocationsPagedResponse(ListLocationsPage page) { 7987 super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); 7988 } 7989 } 7990 7991 public static class ListLocationsPage 7992 extends AbstractPage< 7993 ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { 7994 ListLocationsPage( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ListLocationsResponse response)7995 private ListLocationsPage( 7996 PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, 7997 ListLocationsResponse response) { 7998 super(context, response); 7999 } 8000 createEmptyPage()8001 private static ListLocationsPage createEmptyPage() { 8002 return new ListLocationsPage(null, null); 8003 } 8004 8005 @Override createPage( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ListLocationsResponse response)8006 protected ListLocationsPage createPage( 8007 PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, 8008 ListLocationsResponse response) { 8009 return new ListLocationsPage(context, response); 8010 } 8011 8012 @Override createPageAsync( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ApiFuture<ListLocationsResponse> futureResponse)8013 public ApiFuture<ListLocationsPage> createPageAsync( 8014 PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, 8015 ApiFuture<ListLocationsResponse> futureResponse) { 8016 return super.createPageAsync(context, futureResponse); 8017 } 8018 } 8019 8020 public static class ListLocationsFixedSizeCollection 8021 extends AbstractFixedSizeCollection< 8022 ListLocationsRequest, 8023 ListLocationsResponse, 8024 Location, 8025 ListLocationsPage, 8026 ListLocationsFixedSizeCollection> { 8027 ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize)8028 private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) { 8029 super(pages, collectionSize); 8030 } 8031 createEmptyCollection()8032 private static ListLocationsFixedSizeCollection createEmptyCollection() { 8033 return new ListLocationsFixedSizeCollection(null, 0); 8034 } 8035 8036 @Override createCollection( List<ListLocationsPage> pages, int collectionSize)8037 protected ListLocationsFixedSizeCollection createCollection( 8038 List<ListLocationsPage> pages, int collectionSize) { 8039 return new ListLocationsFixedSizeCollection(pages, collectionSize); 8040 } 8041 } 8042 } 8043