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.osconfig.v1; 18 19 import com.google.api.core.ApiFuture; 20 import com.google.api.core.ApiFutures; 21 import com.google.api.gax.core.BackgroundResource; 22 import com.google.api.gax.paging.AbstractFixedSizeCollection; 23 import com.google.api.gax.paging.AbstractPage; 24 import com.google.api.gax.paging.AbstractPagedListResponse; 25 import com.google.api.gax.rpc.PageContext; 26 import com.google.api.gax.rpc.UnaryCallable; 27 import com.google.cloud.osconfig.v1.stub.OsConfigServiceStub; 28 import com.google.cloud.osconfig.v1.stub.OsConfigServiceStubSettings; 29 import com.google.common.util.concurrent.MoreExecutors; 30 import com.google.protobuf.Empty; 31 import com.google.protobuf.FieldMask; 32 import java.io.IOException; 33 import java.util.List; 34 import java.util.concurrent.TimeUnit; 35 import javax.annotation.Generated; 36 37 // AUTO-GENERATED DOCUMENTATION AND CLASS. 38 /** 39 * Service Description: OS Config API 40 * 41 * <p>The OS Config service is a server-side component that you can use to manage package 42 * installations and patch jobs for virtual machine instances. 43 * 44 * <p>This class provides the ability to make remote calls to the backing service through method 45 * calls that map to API methods. Sample code to get started: 46 * 47 * <pre>{@code 48 * // This snippet has been automatically generated and should be regarded as a code template only. 49 * // It will require modifications to work: 50 * // - It may require correct/in-range values for request initialization. 51 * // - It may require specifying regional endpoints when creating the service client as shown in 52 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 53 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 54 * PatchJobs.ExecutePatchJobRequest request = 55 * PatchJobs.ExecutePatchJobRequest.newBuilder() 56 * .setParent(ProjectName.of("[PROJECT]").toString()) 57 * .setDescription("description-1724546052") 58 * .setInstanceFilter(PatchJobs.PatchInstanceFilter.newBuilder().build()) 59 * .setPatchConfig(PatchJobs.PatchConfig.newBuilder().build()) 60 * .setDuration(Duration.newBuilder().build()) 61 * .setDryRun(true) 62 * .setDisplayName("displayName1714148973") 63 * .setRollout(PatchJobs.PatchRollout.newBuilder().build()) 64 * .build(); 65 * PatchJobs.PatchJob response = osConfigServiceClient.executePatchJob(request); 66 * } 67 * }</pre> 68 * 69 * <p>Note: close() needs to be called on the OsConfigServiceClient object to clean up resources 70 * such as threads. In the example above, try-with-resources is used, which automatically calls 71 * close(). 72 * 73 * <p>The surface of this class includes several types of Java methods for each of the API's 74 * methods: 75 * 76 * <ol> 77 * <li>A "flattened" method. With this type of method, the fields of the request type have been 78 * converted into function parameters. It may be the case that not all fields are available as 79 * parameters, and not every API method will have a flattened method entry point. 80 * <li>A "request object" method. This type of method only takes one parameter, a request object, 81 * which must be constructed before the call. Not every API method will have a request object 82 * method. 83 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 84 * callable object, which can be used to initiate calls to the service. 85 * </ol> 86 * 87 * <p>See the individual methods for example code. 88 * 89 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 90 * these names, this class includes a format method for each type of name, and additionally a parse 91 * method to extract the individual identifiers contained within names that are returned. 92 * 93 * <p>This class can be customized by passing in a custom instance of OsConfigServiceSettings to 94 * create(). For example: 95 * 96 * <p>To customize credentials: 97 * 98 * <pre>{@code 99 * // This snippet has been automatically generated and should be regarded as a code template only. 100 * // It will require modifications to work: 101 * // - It may require correct/in-range values for request initialization. 102 * // - It may require specifying regional endpoints when creating the service client as shown in 103 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 104 * OsConfigServiceSettings osConfigServiceSettings = 105 * OsConfigServiceSettings.newBuilder() 106 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 107 * .build(); 108 * OsConfigServiceClient osConfigServiceClient = 109 * OsConfigServiceClient.create(osConfigServiceSettings); 110 * }</pre> 111 * 112 * <p>To customize the endpoint: 113 * 114 * <pre>{@code 115 * // This snippet has been automatically generated and should be regarded as a code template only. 116 * // It will require modifications to work: 117 * // - It may require correct/in-range values for request initialization. 118 * // - It may require specifying regional endpoints when creating the service client as shown in 119 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 120 * OsConfigServiceSettings osConfigServiceSettings = 121 * OsConfigServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); 122 * OsConfigServiceClient osConfigServiceClient = 123 * OsConfigServiceClient.create(osConfigServiceSettings); 124 * }</pre> 125 * 126 * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over 127 * the wire: 128 * 129 * <pre>{@code 130 * // This snippet has been automatically generated and should be regarded as a code template only. 131 * // It will require modifications to work: 132 * // - It may require correct/in-range values for request initialization. 133 * // - It may require specifying regional endpoints when creating the service client as shown in 134 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 135 * OsConfigServiceSettings osConfigServiceSettings = 136 * OsConfigServiceSettings.newHttpJsonBuilder().build(); 137 * OsConfigServiceClient osConfigServiceClient = 138 * OsConfigServiceClient.create(osConfigServiceSettings); 139 * }</pre> 140 * 141 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 142 */ 143 @Generated("by gapic-generator-java") 144 public class OsConfigServiceClient implements BackgroundResource { 145 private final OsConfigServiceSettings settings; 146 private final OsConfigServiceStub stub; 147 148 /** Constructs an instance of OsConfigServiceClient with default settings. */ create()149 public static final OsConfigServiceClient create() throws IOException { 150 return create(OsConfigServiceSettings.newBuilder().build()); 151 } 152 153 /** 154 * Constructs an instance of OsConfigServiceClient, using the given settings. The channels are 155 * created based on the settings passed in, or defaults for any settings that are not set. 156 */ create(OsConfigServiceSettings settings)157 public static final OsConfigServiceClient create(OsConfigServiceSettings settings) 158 throws IOException { 159 return new OsConfigServiceClient(settings); 160 } 161 162 /** 163 * Constructs an instance of OsConfigServiceClient, using the given stub for making calls. This is 164 * for advanced usage - prefer using create(OsConfigServiceSettings). 165 */ create(OsConfigServiceStub stub)166 public static final OsConfigServiceClient create(OsConfigServiceStub stub) { 167 return new OsConfigServiceClient(stub); 168 } 169 170 /** 171 * Constructs an instance of OsConfigServiceClient, using the given settings. This is protected so 172 * that it is easy to make a subclass, but otherwise, the static factory methods should be 173 * preferred. 174 */ OsConfigServiceClient(OsConfigServiceSettings settings)175 protected OsConfigServiceClient(OsConfigServiceSettings settings) throws IOException { 176 this.settings = settings; 177 this.stub = ((OsConfigServiceStubSettings) settings.getStubSettings()).createStub(); 178 } 179 OsConfigServiceClient(OsConfigServiceStub stub)180 protected OsConfigServiceClient(OsConfigServiceStub stub) { 181 this.settings = null; 182 this.stub = stub; 183 } 184 getSettings()185 public final OsConfigServiceSettings getSettings() { 186 return settings; 187 } 188 getStub()189 public OsConfigServiceStub getStub() { 190 return stub; 191 } 192 193 // AUTO-GENERATED DOCUMENTATION AND METHOD. 194 /** 195 * Patch VM instances by creating and running a patch job. 196 * 197 * <p>Sample code: 198 * 199 * <pre>{@code 200 * // This snippet has been automatically generated and should be regarded as a code template only. 201 * // It will require modifications to work: 202 * // - It may require correct/in-range values for request initialization. 203 * // - It may require specifying regional endpoints when creating the service client as shown in 204 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 205 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 206 * PatchJobs.ExecutePatchJobRequest request = 207 * PatchJobs.ExecutePatchJobRequest.newBuilder() 208 * .setParent(ProjectName.of("[PROJECT]").toString()) 209 * .setDescription("description-1724546052") 210 * .setInstanceFilter(PatchJobs.PatchInstanceFilter.newBuilder().build()) 211 * .setPatchConfig(PatchJobs.PatchConfig.newBuilder().build()) 212 * .setDuration(Duration.newBuilder().build()) 213 * .setDryRun(true) 214 * .setDisplayName("displayName1714148973") 215 * .setRollout(PatchJobs.PatchRollout.newBuilder().build()) 216 * .build(); 217 * PatchJobs.PatchJob response = osConfigServiceClient.executePatchJob(request); 218 * } 219 * }</pre> 220 * 221 * @param request The request object containing all of the parameters for the API call. 222 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 223 */ executePatchJob(PatchJobs.ExecutePatchJobRequest request)224 public final PatchJobs.PatchJob executePatchJob(PatchJobs.ExecutePatchJobRequest request) { 225 return executePatchJobCallable().call(request); 226 } 227 228 // AUTO-GENERATED DOCUMENTATION AND METHOD. 229 /** 230 * Patch VM instances by creating and running a patch job. 231 * 232 * <p>Sample code: 233 * 234 * <pre>{@code 235 * // This snippet has been automatically generated and should be regarded as a code template only. 236 * // It will require modifications to work: 237 * // - It may require correct/in-range values for request initialization. 238 * // - It may require specifying regional endpoints when creating the service client as shown in 239 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 240 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 241 * PatchJobs.ExecutePatchJobRequest request = 242 * PatchJobs.ExecutePatchJobRequest.newBuilder() 243 * .setParent(ProjectName.of("[PROJECT]").toString()) 244 * .setDescription("description-1724546052") 245 * .setInstanceFilter(PatchJobs.PatchInstanceFilter.newBuilder().build()) 246 * .setPatchConfig(PatchJobs.PatchConfig.newBuilder().build()) 247 * .setDuration(Duration.newBuilder().build()) 248 * .setDryRun(true) 249 * .setDisplayName("displayName1714148973") 250 * .setRollout(PatchJobs.PatchRollout.newBuilder().build()) 251 * .build(); 252 * ApiFuture<PatchJobs.PatchJob> future = 253 * osConfigServiceClient.executePatchJobCallable().futureCall(request); 254 * // Do something. 255 * PatchJobs.PatchJob response = future.get(); 256 * } 257 * }</pre> 258 */ 259 public final UnaryCallable<PatchJobs.ExecutePatchJobRequest, PatchJobs.PatchJob> executePatchJobCallable()260 executePatchJobCallable() { 261 return stub.executePatchJobCallable(); 262 } 263 264 // AUTO-GENERATED DOCUMENTATION AND METHOD. 265 /** 266 * Get the patch job. This can be used to track the progress of an ongoing patch job or review the 267 * details of completed jobs. 268 * 269 * <p>Sample code: 270 * 271 * <pre>{@code 272 * // This snippet has been automatically generated and should be regarded as a code template only. 273 * // It will require modifications to work: 274 * // - It may require correct/in-range values for request initialization. 275 * // - It may require specifying regional endpoints when creating the service client as shown in 276 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 277 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 278 * PatchJobName name = PatchJobName.of("[PROJECT]", "[PATCH_JOB]"); 279 * PatchJobs.PatchJob response = osConfigServiceClient.getPatchJob(name); 280 * } 281 * }</pre> 282 * 283 * @param name Required. Name of the patch in the form `projects/*/patchJobs/*` 284 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 285 */ getPatchJob(PatchJobName name)286 public final PatchJobs.PatchJob getPatchJob(PatchJobName name) { 287 PatchJobs.GetPatchJobRequest request = 288 PatchJobs.GetPatchJobRequest.newBuilder() 289 .setName(name == null ? null : name.toString()) 290 .build(); 291 return getPatchJob(request); 292 } 293 294 // AUTO-GENERATED DOCUMENTATION AND METHOD. 295 /** 296 * Get the patch job. This can be used to track the progress of an ongoing patch job or review the 297 * details of completed jobs. 298 * 299 * <p>Sample code: 300 * 301 * <pre>{@code 302 * // This snippet has been automatically generated and should be regarded as a code template only. 303 * // It will require modifications to work: 304 * // - It may require correct/in-range values for request initialization. 305 * // - It may require specifying regional endpoints when creating the service client as shown in 306 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 307 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 308 * String name = PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString(); 309 * PatchJobs.PatchJob response = osConfigServiceClient.getPatchJob(name); 310 * } 311 * }</pre> 312 * 313 * @param name Required. Name of the patch in the form `projects/*/patchJobs/*` 314 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 315 */ getPatchJob(String name)316 public final PatchJobs.PatchJob getPatchJob(String name) { 317 PatchJobs.GetPatchJobRequest request = 318 PatchJobs.GetPatchJobRequest.newBuilder().setName(name).build(); 319 return getPatchJob(request); 320 } 321 322 // AUTO-GENERATED DOCUMENTATION AND METHOD. 323 /** 324 * Get the patch job. This can be used to track the progress of an ongoing patch job or review the 325 * details of completed jobs. 326 * 327 * <p>Sample code: 328 * 329 * <pre>{@code 330 * // This snippet has been automatically generated and should be regarded as a code template only. 331 * // It will require modifications to work: 332 * // - It may require correct/in-range values for request initialization. 333 * // - It may require specifying regional endpoints when creating the service client as shown in 334 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 335 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 336 * PatchJobs.GetPatchJobRequest request = 337 * PatchJobs.GetPatchJobRequest.newBuilder() 338 * .setName(PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString()) 339 * .build(); 340 * PatchJobs.PatchJob response = osConfigServiceClient.getPatchJob(request); 341 * } 342 * }</pre> 343 * 344 * @param request The request object containing all of the parameters for the API call. 345 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 346 */ getPatchJob(PatchJobs.GetPatchJobRequest request)347 public final PatchJobs.PatchJob getPatchJob(PatchJobs.GetPatchJobRequest request) { 348 return getPatchJobCallable().call(request); 349 } 350 351 // AUTO-GENERATED DOCUMENTATION AND METHOD. 352 /** 353 * Get the patch job. This can be used to track the progress of an ongoing patch job or review the 354 * details of completed jobs. 355 * 356 * <p>Sample code: 357 * 358 * <pre>{@code 359 * // This snippet has been automatically generated and should be regarded as a code template only. 360 * // It will require modifications to work: 361 * // - It may require correct/in-range values for request initialization. 362 * // - It may require specifying regional endpoints when creating the service client as shown in 363 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 364 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 365 * PatchJobs.GetPatchJobRequest request = 366 * PatchJobs.GetPatchJobRequest.newBuilder() 367 * .setName(PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString()) 368 * .build(); 369 * ApiFuture<PatchJobs.PatchJob> future = 370 * osConfigServiceClient.getPatchJobCallable().futureCall(request); 371 * // Do something. 372 * PatchJobs.PatchJob response = future.get(); 373 * } 374 * }</pre> 375 */ 376 public final UnaryCallable<PatchJobs.GetPatchJobRequest, PatchJobs.PatchJob> getPatchJobCallable()377 getPatchJobCallable() { 378 return stub.getPatchJobCallable(); 379 } 380 381 // AUTO-GENERATED DOCUMENTATION AND METHOD. 382 /** 383 * Cancel a patch job. The patch job must be active. Canceled patch jobs cannot be restarted. 384 * 385 * <p>Sample code: 386 * 387 * <pre>{@code 388 * // This snippet has been automatically generated and should be regarded as a code template only. 389 * // It will require modifications to work: 390 * // - It may require correct/in-range values for request initialization. 391 * // - It may require specifying regional endpoints when creating the service client as shown in 392 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 393 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 394 * PatchJobs.CancelPatchJobRequest request = 395 * PatchJobs.CancelPatchJobRequest.newBuilder() 396 * .setName(PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString()) 397 * .build(); 398 * PatchJobs.PatchJob response = osConfigServiceClient.cancelPatchJob(request); 399 * } 400 * }</pre> 401 * 402 * @param request The request object containing all of the parameters for the API call. 403 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 404 */ cancelPatchJob(PatchJobs.CancelPatchJobRequest request)405 public final PatchJobs.PatchJob cancelPatchJob(PatchJobs.CancelPatchJobRequest request) { 406 return cancelPatchJobCallable().call(request); 407 } 408 409 // AUTO-GENERATED DOCUMENTATION AND METHOD. 410 /** 411 * Cancel a patch job. The patch job must be active. Canceled patch jobs cannot be restarted. 412 * 413 * <p>Sample code: 414 * 415 * <pre>{@code 416 * // This snippet has been automatically generated and should be regarded as a code template only. 417 * // It will require modifications to work: 418 * // - It may require correct/in-range values for request initialization. 419 * // - It may require specifying regional endpoints when creating the service client as shown in 420 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 421 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 422 * PatchJobs.CancelPatchJobRequest request = 423 * PatchJobs.CancelPatchJobRequest.newBuilder() 424 * .setName(PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString()) 425 * .build(); 426 * ApiFuture<PatchJobs.PatchJob> future = 427 * osConfigServiceClient.cancelPatchJobCallable().futureCall(request); 428 * // Do something. 429 * PatchJobs.PatchJob response = future.get(); 430 * } 431 * }</pre> 432 */ 433 public final UnaryCallable<PatchJobs.CancelPatchJobRequest, PatchJobs.PatchJob> cancelPatchJobCallable()434 cancelPatchJobCallable() { 435 return stub.cancelPatchJobCallable(); 436 } 437 438 // AUTO-GENERATED DOCUMENTATION AND METHOD. 439 /** 440 * Get a list of patch jobs. 441 * 442 * <p>Sample code: 443 * 444 * <pre>{@code 445 * // This snippet has been automatically generated and should be regarded as a code template only. 446 * // It will require modifications to work: 447 * // - It may require correct/in-range values for request initialization. 448 * // - It may require specifying regional endpoints when creating the service client as shown in 449 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 450 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 451 * ProjectName parent = ProjectName.of("[PROJECT]"); 452 * for (PatchJobs.PatchJob element : osConfigServiceClient.listPatchJobs(parent).iterateAll()) { 453 * // doThingsWith(element); 454 * } 455 * } 456 * }</pre> 457 * 458 * @param parent Required. In the form of `projects/*` 459 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 460 */ listPatchJobs(ProjectName parent)461 public final ListPatchJobsPagedResponse listPatchJobs(ProjectName parent) { 462 PatchJobs.ListPatchJobsRequest request = 463 PatchJobs.ListPatchJobsRequest.newBuilder() 464 .setParent(parent == null ? null : parent.toString()) 465 .build(); 466 return listPatchJobs(request); 467 } 468 469 // AUTO-GENERATED DOCUMENTATION AND METHOD. 470 /** 471 * Get a list of patch jobs. 472 * 473 * <p>Sample code: 474 * 475 * <pre>{@code 476 * // This snippet has been automatically generated and should be regarded as a code template only. 477 * // It will require modifications to work: 478 * // - It may require correct/in-range values for request initialization. 479 * // - It may require specifying regional endpoints when creating the service client as shown in 480 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 481 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 482 * String parent = ProjectName.of("[PROJECT]").toString(); 483 * for (PatchJobs.PatchJob element : osConfigServiceClient.listPatchJobs(parent).iterateAll()) { 484 * // doThingsWith(element); 485 * } 486 * } 487 * }</pre> 488 * 489 * @param parent Required. In the form of `projects/*` 490 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 491 */ listPatchJobs(String parent)492 public final ListPatchJobsPagedResponse listPatchJobs(String parent) { 493 PatchJobs.ListPatchJobsRequest request = 494 PatchJobs.ListPatchJobsRequest.newBuilder().setParent(parent).build(); 495 return listPatchJobs(request); 496 } 497 498 // AUTO-GENERATED DOCUMENTATION AND METHOD. 499 /** 500 * Get a list of patch jobs. 501 * 502 * <p>Sample code: 503 * 504 * <pre>{@code 505 * // This snippet has been automatically generated and should be regarded as a code template only. 506 * // It will require modifications to work: 507 * // - It may require correct/in-range values for request initialization. 508 * // - It may require specifying regional endpoints when creating the service client as shown in 509 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 510 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 511 * PatchJobs.ListPatchJobsRequest request = 512 * PatchJobs.ListPatchJobsRequest.newBuilder() 513 * .setParent(ProjectName.of("[PROJECT]").toString()) 514 * .setPageSize(883849137) 515 * .setPageToken("pageToken873572522") 516 * .setFilter("filter-1274492040") 517 * .build(); 518 * for (PatchJobs.PatchJob element : osConfigServiceClient.listPatchJobs(request).iterateAll()) { 519 * // doThingsWith(element); 520 * } 521 * } 522 * }</pre> 523 * 524 * @param request The request object containing all of the parameters for the API call. 525 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 526 */ listPatchJobs(PatchJobs.ListPatchJobsRequest request)527 public final ListPatchJobsPagedResponse listPatchJobs(PatchJobs.ListPatchJobsRequest request) { 528 return listPatchJobsPagedCallable().call(request); 529 } 530 531 // AUTO-GENERATED DOCUMENTATION AND METHOD. 532 /** 533 * Get a list of patch jobs. 534 * 535 * <p>Sample code: 536 * 537 * <pre>{@code 538 * // This snippet has been automatically generated and should be regarded as a code template only. 539 * // It will require modifications to work: 540 * // - It may require correct/in-range values for request initialization. 541 * // - It may require specifying regional endpoints when creating the service client as shown in 542 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 543 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 544 * PatchJobs.ListPatchJobsRequest request = 545 * PatchJobs.ListPatchJobsRequest.newBuilder() 546 * .setParent(ProjectName.of("[PROJECT]").toString()) 547 * .setPageSize(883849137) 548 * .setPageToken("pageToken873572522") 549 * .setFilter("filter-1274492040") 550 * .build(); 551 * ApiFuture<PatchJobs.PatchJob> future = 552 * osConfigServiceClient.listPatchJobsPagedCallable().futureCall(request); 553 * // Do something. 554 * for (PatchJobs.PatchJob element : future.get().iterateAll()) { 555 * // doThingsWith(element); 556 * } 557 * } 558 * }</pre> 559 */ 560 public final UnaryCallable<PatchJobs.ListPatchJobsRequest, ListPatchJobsPagedResponse> listPatchJobsPagedCallable()561 listPatchJobsPagedCallable() { 562 return stub.listPatchJobsPagedCallable(); 563 } 564 565 // AUTO-GENERATED DOCUMENTATION AND METHOD. 566 /** 567 * Get a list of patch jobs. 568 * 569 * <p>Sample code: 570 * 571 * <pre>{@code 572 * // This snippet has been automatically generated and should be regarded as a code template only. 573 * // It will require modifications to work: 574 * // - It may require correct/in-range values for request initialization. 575 * // - It may require specifying regional endpoints when creating the service client as shown in 576 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 577 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 578 * PatchJobs.ListPatchJobsRequest request = 579 * PatchJobs.ListPatchJobsRequest.newBuilder() 580 * .setParent(ProjectName.of("[PROJECT]").toString()) 581 * .setPageSize(883849137) 582 * .setPageToken("pageToken873572522") 583 * .setFilter("filter-1274492040") 584 * .build(); 585 * while (true) { 586 * PatchJobs.ListPatchJobsResponse response = 587 * osConfigServiceClient.listPatchJobsCallable().call(request); 588 * for (PatchJobs.PatchJob element : response.getPatchJobsList()) { 589 * // doThingsWith(element); 590 * } 591 * String nextPageToken = response.getNextPageToken(); 592 * if (!Strings.isNullOrEmpty(nextPageToken)) { 593 * request = request.toBuilder().setPageToken(nextPageToken).build(); 594 * } else { 595 * break; 596 * } 597 * } 598 * } 599 * }</pre> 600 */ 601 public final UnaryCallable<PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse> listPatchJobsCallable()602 listPatchJobsCallable() { 603 return stub.listPatchJobsCallable(); 604 } 605 606 // AUTO-GENERATED DOCUMENTATION AND METHOD. 607 /** 608 * Get a list of instance details for a given patch job. 609 * 610 * <p>Sample code: 611 * 612 * <pre>{@code 613 * // This snippet has been automatically generated and should be regarded as a code template only. 614 * // It will require modifications to work: 615 * // - It may require correct/in-range values for request initialization. 616 * // - It may require specifying regional endpoints when creating the service client as shown in 617 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 618 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 619 * PatchJobName parent = PatchJobName.of("[PROJECT]", "[PATCH_JOB]"); 620 * for (PatchJobs.PatchJobInstanceDetails element : 621 * osConfigServiceClient.listPatchJobInstanceDetails(parent).iterateAll()) { 622 * // doThingsWith(element); 623 * } 624 * } 625 * }</pre> 626 * 627 * @param parent Required. The parent for the instances are in the form of 628 * `projects/*/patchJobs/*`. 629 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 630 */ listPatchJobInstanceDetails( PatchJobName parent)631 public final ListPatchJobInstanceDetailsPagedResponse listPatchJobInstanceDetails( 632 PatchJobName parent) { 633 PatchJobs.ListPatchJobInstanceDetailsRequest request = 634 PatchJobs.ListPatchJobInstanceDetailsRequest.newBuilder() 635 .setParent(parent == null ? null : parent.toString()) 636 .build(); 637 return listPatchJobInstanceDetails(request); 638 } 639 640 // AUTO-GENERATED DOCUMENTATION AND METHOD. 641 /** 642 * Get a list of instance details for a given patch job. 643 * 644 * <p>Sample code: 645 * 646 * <pre>{@code 647 * // This snippet has been automatically generated and should be regarded as a code template only. 648 * // It will require modifications to work: 649 * // - It may require correct/in-range values for request initialization. 650 * // - It may require specifying regional endpoints when creating the service client as shown in 651 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 652 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 653 * String parent = PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString(); 654 * for (PatchJobs.PatchJobInstanceDetails element : 655 * osConfigServiceClient.listPatchJobInstanceDetails(parent).iterateAll()) { 656 * // doThingsWith(element); 657 * } 658 * } 659 * }</pre> 660 * 661 * @param parent Required. The parent for the instances are in the form of 662 * `projects/*/patchJobs/*`. 663 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 664 */ listPatchJobInstanceDetails(String parent)665 public final ListPatchJobInstanceDetailsPagedResponse listPatchJobInstanceDetails(String parent) { 666 PatchJobs.ListPatchJobInstanceDetailsRequest request = 667 PatchJobs.ListPatchJobInstanceDetailsRequest.newBuilder().setParent(parent).build(); 668 return listPatchJobInstanceDetails(request); 669 } 670 671 // AUTO-GENERATED DOCUMENTATION AND METHOD. 672 /** 673 * Get a list of instance details for a given patch job. 674 * 675 * <p>Sample code: 676 * 677 * <pre>{@code 678 * // This snippet has been automatically generated and should be regarded as a code template only. 679 * // It will require modifications to work: 680 * // - It may require correct/in-range values for request initialization. 681 * // - It may require specifying regional endpoints when creating the service client as shown in 682 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 683 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 684 * PatchJobs.ListPatchJobInstanceDetailsRequest request = 685 * PatchJobs.ListPatchJobInstanceDetailsRequest.newBuilder() 686 * .setParent(PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString()) 687 * .setPageSize(883849137) 688 * .setPageToken("pageToken873572522") 689 * .setFilter("filter-1274492040") 690 * .build(); 691 * for (PatchJobs.PatchJobInstanceDetails element : 692 * osConfigServiceClient.listPatchJobInstanceDetails(request).iterateAll()) { 693 * // doThingsWith(element); 694 * } 695 * } 696 * }</pre> 697 * 698 * @param request The request object containing all of the parameters for the API call. 699 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 700 */ listPatchJobInstanceDetails( PatchJobs.ListPatchJobInstanceDetailsRequest request)701 public final ListPatchJobInstanceDetailsPagedResponse listPatchJobInstanceDetails( 702 PatchJobs.ListPatchJobInstanceDetailsRequest request) { 703 return listPatchJobInstanceDetailsPagedCallable().call(request); 704 } 705 706 // AUTO-GENERATED DOCUMENTATION AND METHOD. 707 /** 708 * Get a list of instance details for a given patch job. 709 * 710 * <p>Sample code: 711 * 712 * <pre>{@code 713 * // This snippet has been automatically generated and should be regarded as a code template only. 714 * // It will require modifications to work: 715 * // - It may require correct/in-range values for request initialization. 716 * // - It may require specifying regional endpoints when creating the service client as shown in 717 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 718 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 719 * PatchJobs.ListPatchJobInstanceDetailsRequest request = 720 * PatchJobs.ListPatchJobInstanceDetailsRequest.newBuilder() 721 * .setParent(PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString()) 722 * .setPageSize(883849137) 723 * .setPageToken("pageToken873572522") 724 * .setFilter("filter-1274492040") 725 * .build(); 726 * ApiFuture<PatchJobs.PatchJobInstanceDetails> future = 727 * osConfigServiceClient.listPatchJobInstanceDetailsPagedCallable().futureCall(request); 728 * // Do something. 729 * for (PatchJobs.PatchJobInstanceDetails element : future.get().iterateAll()) { 730 * // doThingsWith(element); 731 * } 732 * } 733 * }</pre> 734 */ 735 public final UnaryCallable< 736 PatchJobs.ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsPagedResponse> listPatchJobInstanceDetailsPagedCallable()737 listPatchJobInstanceDetailsPagedCallable() { 738 return stub.listPatchJobInstanceDetailsPagedCallable(); 739 } 740 741 // AUTO-GENERATED DOCUMENTATION AND METHOD. 742 /** 743 * Get a list of instance details for a given patch job. 744 * 745 * <p>Sample code: 746 * 747 * <pre>{@code 748 * // This snippet has been automatically generated and should be regarded as a code template only. 749 * // It will require modifications to work: 750 * // - It may require correct/in-range values for request initialization. 751 * // - It may require specifying regional endpoints when creating the service client as shown in 752 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 753 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 754 * PatchJobs.ListPatchJobInstanceDetailsRequest request = 755 * PatchJobs.ListPatchJobInstanceDetailsRequest.newBuilder() 756 * .setParent(PatchJobName.of("[PROJECT]", "[PATCH_JOB]").toString()) 757 * .setPageSize(883849137) 758 * .setPageToken("pageToken873572522") 759 * .setFilter("filter-1274492040") 760 * .build(); 761 * while (true) { 762 * PatchJobs.ListPatchJobInstanceDetailsResponse response = 763 * osConfigServiceClient.listPatchJobInstanceDetailsCallable().call(request); 764 * for (PatchJobs.PatchJobInstanceDetails element : 765 * response.getPatchJobInstanceDetailsList()) { 766 * // doThingsWith(element); 767 * } 768 * String nextPageToken = response.getNextPageToken(); 769 * if (!Strings.isNullOrEmpty(nextPageToken)) { 770 * request = request.toBuilder().setPageToken(nextPageToken).build(); 771 * } else { 772 * break; 773 * } 774 * } 775 * } 776 * }</pre> 777 */ 778 public final UnaryCallable< 779 PatchJobs.ListPatchJobInstanceDetailsRequest, 780 PatchJobs.ListPatchJobInstanceDetailsResponse> listPatchJobInstanceDetailsCallable()781 listPatchJobInstanceDetailsCallable() { 782 return stub.listPatchJobInstanceDetailsCallable(); 783 } 784 785 // AUTO-GENERATED DOCUMENTATION AND METHOD. 786 /** 787 * Create an OS Config patch deployment. 788 * 789 * <p>Sample code: 790 * 791 * <pre>{@code 792 * // This snippet has been automatically generated and should be regarded as a code template only. 793 * // It will require modifications to work: 794 * // - It may require correct/in-range values for request initialization. 795 * // - It may require specifying regional endpoints when creating the service client as shown in 796 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 797 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 798 * ProjectName parent = ProjectName.of("[PROJECT]"); 799 * PatchDeployments.PatchDeployment patchDeployment = 800 * PatchDeployments.PatchDeployment.newBuilder().build(); 801 * String patchDeploymentId = "patchDeploymentId-1180405976"; 802 * PatchDeployments.PatchDeployment response = 803 * osConfigServiceClient.createPatchDeployment(parent, patchDeployment, patchDeploymentId); 804 * } 805 * }</pre> 806 * 807 * @param parent Required. The project to apply this patch deployment to in the form 808 * `projects/*`. 809 * @param patchDeployment Required. The patch deployment to create. 810 * @param patchDeploymentId Required. A name for the patch deployment in the project. When 811 * creating a name the following rules apply: 812 * <ul> 813 * <li>Must contain only lowercase letters, numbers, and hyphens. 814 * <li>Must start with a letter. 815 * <li>Must be between 1-63 characters. 816 * <li>Must end with a number or a letter. 817 * <li>Must be unique within the project. 818 * </ul> 819 * 820 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 821 */ createPatchDeployment( ProjectName parent, PatchDeployments.PatchDeployment patchDeployment, String patchDeploymentId)822 public final PatchDeployments.PatchDeployment createPatchDeployment( 823 ProjectName parent, 824 PatchDeployments.PatchDeployment patchDeployment, 825 String patchDeploymentId) { 826 PatchDeployments.CreatePatchDeploymentRequest request = 827 PatchDeployments.CreatePatchDeploymentRequest.newBuilder() 828 .setParent(parent == null ? null : parent.toString()) 829 .setPatchDeployment(patchDeployment) 830 .setPatchDeploymentId(patchDeploymentId) 831 .build(); 832 return createPatchDeployment(request); 833 } 834 835 // AUTO-GENERATED DOCUMENTATION AND METHOD. 836 /** 837 * Create an OS Config patch deployment. 838 * 839 * <p>Sample code: 840 * 841 * <pre>{@code 842 * // This snippet has been automatically generated and should be regarded as a code template only. 843 * // It will require modifications to work: 844 * // - It may require correct/in-range values for request initialization. 845 * // - It may require specifying regional endpoints when creating the service client as shown in 846 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 847 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 848 * String parent = ProjectName.of("[PROJECT]").toString(); 849 * PatchDeployments.PatchDeployment patchDeployment = 850 * PatchDeployments.PatchDeployment.newBuilder().build(); 851 * String patchDeploymentId = "patchDeploymentId-1180405976"; 852 * PatchDeployments.PatchDeployment response = 853 * osConfigServiceClient.createPatchDeployment(parent, patchDeployment, patchDeploymentId); 854 * } 855 * }</pre> 856 * 857 * @param parent Required. The project to apply this patch deployment to in the form 858 * `projects/*`. 859 * @param patchDeployment Required. The patch deployment to create. 860 * @param patchDeploymentId Required. A name for the patch deployment in the project. When 861 * creating a name the following rules apply: 862 * <ul> 863 * <li>Must contain only lowercase letters, numbers, and hyphens. 864 * <li>Must start with a letter. 865 * <li>Must be between 1-63 characters. 866 * <li>Must end with a number or a letter. 867 * <li>Must be unique within the project. 868 * </ul> 869 * 870 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 871 */ createPatchDeployment( String parent, PatchDeployments.PatchDeployment patchDeployment, String patchDeploymentId)872 public final PatchDeployments.PatchDeployment createPatchDeployment( 873 String parent, PatchDeployments.PatchDeployment patchDeployment, String patchDeploymentId) { 874 PatchDeployments.CreatePatchDeploymentRequest request = 875 PatchDeployments.CreatePatchDeploymentRequest.newBuilder() 876 .setParent(parent) 877 .setPatchDeployment(patchDeployment) 878 .setPatchDeploymentId(patchDeploymentId) 879 .build(); 880 return createPatchDeployment(request); 881 } 882 883 // AUTO-GENERATED DOCUMENTATION AND METHOD. 884 /** 885 * Create an OS Config patch deployment. 886 * 887 * <p>Sample code: 888 * 889 * <pre>{@code 890 * // This snippet has been automatically generated and should be regarded as a code template only. 891 * // It will require modifications to work: 892 * // - It may require correct/in-range values for request initialization. 893 * // - It may require specifying regional endpoints when creating the service client as shown in 894 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 895 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 896 * PatchDeployments.CreatePatchDeploymentRequest request = 897 * PatchDeployments.CreatePatchDeploymentRequest.newBuilder() 898 * .setParent(ProjectName.of("[PROJECT]").toString()) 899 * .setPatchDeploymentId("patchDeploymentId-1180405976") 900 * .setPatchDeployment(PatchDeployments.PatchDeployment.newBuilder().build()) 901 * .build(); 902 * PatchDeployments.PatchDeployment response = 903 * osConfigServiceClient.createPatchDeployment(request); 904 * } 905 * }</pre> 906 * 907 * @param request The request object containing all of the parameters for the API call. 908 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 909 */ createPatchDeployment( PatchDeployments.CreatePatchDeploymentRequest request)910 public final PatchDeployments.PatchDeployment createPatchDeployment( 911 PatchDeployments.CreatePatchDeploymentRequest request) { 912 return createPatchDeploymentCallable().call(request); 913 } 914 915 // AUTO-GENERATED DOCUMENTATION AND METHOD. 916 /** 917 * Create an OS Config patch deployment. 918 * 919 * <p>Sample code: 920 * 921 * <pre>{@code 922 * // This snippet has been automatically generated and should be regarded as a code template only. 923 * // It will require modifications to work: 924 * // - It may require correct/in-range values for request initialization. 925 * // - It may require specifying regional endpoints when creating the service client as shown in 926 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 927 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 928 * PatchDeployments.CreatePatchDeploymentRequest request = 929 * PatchDeployments.CreatePatchDeploymentRequest.newBuilder() 930 * .setParent(ProjectName.of("[PROJECT]").toString()) 931 * .setPatchDeploymentId("patchDeploymentId-1180405976") 932 * .setPatchDeployment(PatchDeployments.PatchDeployment.newBuilder().build()) 933 * .build(); 934 * ApiFuture<PatchDeployments.PatchDeployment> future = 935 * osConfigServiceClient.createPatchDeploymentCallable().futureCall(request); 936 * // Do something. 937 * PatchDeployments.PatchDeployment response = future.get(); 938 * } 939 * }</pre> 940 */ 941 public final UnaryCallable< 942 PatchDeployments.CreatePatchDeploymentRequest, PatchDeployments.PatchDeployment> createPatchDeploymentCallable()943 createPatchDeploymentCallable() { 944 return stub.createPatchDeploymentCallable(); 945 } 946 947 // AUTO-GENERATED DOCUMENTATION AND METHOD. 948 /** 949 * Get an OS Config patch deployment. 950 * 951 * <p>Sample code: 952 * 953 * <pre>{@code 954 * // This snippet has been automatically generated and should be regarded as a code template only. 955 * // It will require modifications to work: 956 * // - It may require correct/in-range values for request initialization. 957 * // - It may require specifying regional endpoints when creating the service client as shown in 958 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 959 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 960 * PatchDeploymentName name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]"); 961 * PatchDeployments.PatchDeployment response = osConfigServiceClient.getPatchDeployment(name); 962 * } 963 * }</pre> 964 * 965 * @param name Required. The resource name of the patch deployment in the form 966 * `projects/*/patchDeployments/*`. 967 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 968 */ getPatchDeployment(PatchDeploymentName name)969 public final PatchDeployments.PatchDeployment getPatchDeployment(PatchDeploymentName name) { 970 PatchDeployments.GetPatchDeploymentRequest request = 971 PatchDeployments.GetPatchDeploymentRequest.newBuilder() 972 .setName(name == null ? null : name.toString()) 973 .build(); 974 return getPatchDeployment(request); 975 } 976 977 // AUTO-GENERATED DOCUMENTATION AND METHOD. 978 /** 979 * Get an OS Config patch deployment. 980 * 981 * <p>Sample code: 982 * 983 * <pre>{@code 984 * // This snippet has been automatically generated and should be regarded as a code template only. 985 * // It will require modifications to work: 986 * // - It may require correct/in-range values for request initialization. 987 * // - It may require specifying regional endpoints when creating the service client as shown in 988 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 989 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 990 * String name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString(); 991 * PatchDeployments.PatchDeployment response = osConfigServiceClient.getPatchDeployment(name); 992 * } 993 * }</pre> 994 * 995 * @param name Required. The resource name of the patch deployment in the form 996 * `projects/*/patchDeployments/*`. 997 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 998 */ getPatchDeployment(String name)999 public final PatchDeployments.PatchDeployment getPatchDeployment(String name) { 1000 PatchDeployments.GetPatchDeploymentRequest request = 1001 PatchDeployments.GetPatchDeploymentRequest.newBuilder().setName(name).build(); 1002 return getPatchDeployment(request); 1003 } 1004 1005 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1006 /** 1007 * Get an OS Config patch deployment. 1008 * 1009 * <p>Sample code: 1010 * 1011 * <pre>{@code 1012 * // This snippet has been automatically generated and should be regarded as a code template only. 1013 * // It will require modifications to work: 1014 * // - It may require correct/in-range values for request initialization. 1015 * // - It may require specifying regional endpoints when creating the service client as shown in 1016 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1017 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1018 * PatchDeployments.GetPatchDeploymentRequest request = 1019 * PatchDeployments.GetPatchDeploymentRequest.newBuilder() 1020 * .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString()) 1021 * .build(); 1022 * PatchDeployments.PatchDeployment response = osConfigServiceClient.getPatchDeployment(request); 1023 * } 1024 * }</pre> 1025 * 1026 * @param request The request object containing all of the parameters for the API call. 1027 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1028 */ getPatchDeployment( PatchDeployments.GetPatchDeploymentRequest request)1029 public final PatchDeployments.PatchDeployment getPatchDeployment( 1030 PatchDeployments.GetPatchDeploymentRequest request) { 1031 return getPatchDeploymentCallable().call(request); 1032 } 1033 1034 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1035 /** 1036 * Get an OS Config patch deployment. 1037 * 1038 * <p>Sample code: 1039 * 1040 * <pre>{@code 1041 * // This snippet has been automatically generated and should be regarded as a code template only. 1042 * // It will require modifications to work: 1043 * // - It may require correct/in-range values for request initialization. 1044 * // - It may require specifying regional endpoints when creating the service client as shown in 1045 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1046 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1047 * PatchDeployments.GetPatchDeploymentRequest request = 1048 * PatchDeployments.GetPatchDeploymentRequest.newBuilder() 1049 * .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString()) 1050 * .build(); 1051 * ApiFuture<PatchDeployments.PatchDeployment> future = 1052 * osConfigServiceClient.getPatchDeploymentCallable().futureCall(request); 1053 * // Do something. 1054 * PatchDeployments.PatchDeployment response = future.get(); 1055 * } 1056 * }</pre> 1057 */ 1058 public final UnaryCallable< 1059 PatchDeployments.GetPatchDeploymentRequest, PatchDeployments.PatchDeployment> getPatchDeploymentCallable()1060 getPatchDeploymentCallable() { 1061 return stub.getPatchDeploymentCallable(); 1062 } 1063 1064 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1065 /** 1066 * Get a page of OS Config patch deployments. 1067 * 1068 * <p>Sample code: 1069 * 1070 * <pre>{@code 1071 * // This snippet has been automatically generated and should be regarded as a code template only. 1072 * // It will require modifications to work: 1073 * // - It may require correct/in-range values for request initialization. 1074 * // - It may require specifying regional endpoints when creating the service client as shown in 1075 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1076 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1077 * ProjectName parent = ProjectName.of("[PROJECT]"); 1078 * for (PatchDeployments.PatchDeployment element : 1079 * osConfigServiceClient.listPatchDeployments(parent).iterateAll()) { 1080 * // doThingsWith(element); 1081 * } 1082 * } 1083 * }</pre> 1084 * 1085 * @param parent Required. The resource name of the parent in the form `projects/*`. 1086 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1087 */ listPatchDeployments(ProjectName parent)1088 public final ListPatchDeploymentsPagedResponse listPatchDeployments(ProjectName parent) { 1089 PatchDeployments.ListPatchDeploymentsRequest request = 1090 PatchDeployments.ListPatchDeploymentsRequest.newBuilder() 1091 .setParent(parent == null ? null : parent.toString()) 1092 .build(); 1093 return listPatchDeployments(request); 1094 } 1095 1096 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1097 /** 1098 * Get a page of OS Config patch deployments. 1099 * 1100 * <p>Sample code: 1101 * 1102 * <pre>{@code 1103 * // This snippet has been automatically generated and should be regarded as a code template only. 1104 * // It will require modifications to work: 1105 * // - It may require correct/in-range values for request initialization. 1106 * // - It may require specifying regional endpoints when creating the service client as shown in 1107 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1108 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1109 * String parent = ProjectName.of("[PROJECT]").toString(); 1110 * for (PatchDeployments.PatchDeployment element : 1111 * osConfigServiceClient.listPatchDeployments(parent).iterateAll()) { 1112 * // doThingsWith(element); 1113 * } 1114 * } 1115 * }</pre> 1116 * 1117 * @param parent Required. The resource name of the parent in the form `projects/*`. 1118 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1119 */ listPatchDeployments(String parent)1120 public final ListPatchDeploymentsPagedResponse listPatchDeployments(String parent) { 1121 PatchDeployments.ListPatchDeploymentsRequest request = 1122 PatchDeployments.ListPatchDeploymentsRequest.newBuilder().setParent(parent).build(); 1123 return listPatchDeployments(request); 1124 } 1125 1126 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1127 /** 1128 * Get a page of OS Config patch deployments. 1129 * 1130 * <p>Sample code: 1131 * 1132 * <pre>{@code 1133 * // This snippet has been automatically generated and should be regarded as a code template only. 1134 * // It will require modifications to work: 1135 * // - It may require correct/in-range values for request initialization. 1136 * // - It may require specifying regional endpoints when creating the service client as shown in 1137 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1138 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1139 * PatchDeployments.ListPatchDeploymentsRequest request = 1140 * PatchDeployments.ListPatchDeploymentsRequest.newBuilder() 1141 * .setParent(ProjectName.of("[PROJECT]").toString()) 1142 * .setPageSize(883849137) 1143 * .setPageToken("pageToken873572522") 1144 * .build(); 1145 * for (PatchDeployments.PatchDeployment element : 1146 * osConfigServiceClient.listPatchDeployments(request).iterateAll()) { 1147 * // doThingsWith(element); 1148 * } 1149 * } 1150 * }</pre> 1151 * 1152 * @param request The request object containing all of the parameters for the API call. 1153 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1154 */ listPatchDeployments( PatchDeployments.ListPatchDeploymentsRequest request)1155 public final ListPatchDeploymentsPagedResponse listPatchDeployments( 1156 PatchDeployments.ListPatchDeploymentsRequest request) { 1157 return listPatchDeploymentsPagedCallable().call(request); 1158 } 1159 1160 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1161 /** 1162 * Get a page of OS Config patch deployments. 1163 * 1164 * <p>Sample code: 1165 * 1166 * <pre>{@code 1167 * // This snippet has been automatically generated and should be regarded as a code template only. 1168 * // It will require modifications to work: 1169 * // - It may require correct/in-range values for request initialization. 1170 * // - It may require specifying regional endpoints when creating the service client as shown in 1171 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1172 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1173 * PatchDeployments.ListPatchDeploymentsRequest request = 1174 * PatchDeployments.ListPatchDeploymentsRequest.newBuilder() 1175 * .setParent(ProjectName.of("[PROJECT]").toString()) 1176 * .setPageSize(883849137) 1177 * .setPageToken("pageToken873572522") 1178 * .build(); 1179 * ApiFuture<PatchDeployments.PatchDeployment> future = 1180 * osConfigServiceClient.listPatchDeploymentsPagedCallable().futureCall(request); 1181 * // Do something. 1182 * for (PatchDeployments.PatchDeployment element : future.get().iterateAll()) { 1183 * // doThingsWith(element); 1184 * } 1185 * } 1186 * }</pre> 1187 */ 1188 public final UnaryCallable< 1189 PatchDeployments.ListPatchDeploymentsRequest, ListPatchDeploymentsPagedResponse> listPatchDeploymentsPagedCallable()1190 listPatchDeploymentsPagedCallable() { 1191 return stub.listPatchDeploymentsPagedCallable(); 1192 } 1193 1194 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1195 /** 1196 * Get a page of OS Config patch deployments. 1197 * 1198 * <p>Sample code: 1199 * 1200 * <pre>{@code 1201 * // This snippet has been automatically generated and should be regarded as a code template only. 1202 * // It will require modifications to work: 1203 * // - It may require correct/in-range values for request initialization. 1204 * // - It may require specifying regional endpoints when creating the service client as shown in 1205 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1206 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1207 * PatchDeployments.ListPatchDeploymentsRequest request = 1208 * PatchDeployments.ListPatchDeploymentsRequest.newBuilder() 1209 * .setParent(ProjectName.of("[PROJECT]").toString()) 1210 * .setPageSize(883849137) 1211 * .setPageToken("pageToken873572522") 1212 * .build(); 1213 * while (true) { 1214 * PatchDeployments.ListPatchDeploymentsResponse response = 1215 * osConfigServiceClient.listPatchDeploymentsCallable().call(request); 1216 * for (PatchDeployments.PatchDeployment element : response.getPatchDeploymentsList()) { 1217 * // doThingsWith(element); 1218 * } 1219 * String nextPageToken = response.getNextPageToken(); 1220 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1221 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1222 * } else { 1223 * break; 1224 * } 1225 * } 1226 * } 1227 * }</pre> 1228 */ 1229 public final UnaryCallable< 1230 PatchDeployments.ListPatchDeploymentsRequest, 1231 PatchDeployments.ListPatchDeploymentsResponse> listPatchDeploymentsCallable()1232 listPatchDeploymentsCallable() { 1233 return stub.listPatchDeploymentsCallable(); 1234 } 1235 1236 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1237 /** 1238 * Delete an OS Config patch deployment. 1239 * 1240 * <p>Sample code: 1241 * 1242 * <pre>{@code 1243 * // This snippet has been automatically generated and should be regarded as a code template only. 1244 * // It will require modifications to work: 1245 * // - It may require correct/in-range values for request initialization. 1246 * // - It may require specifying regional endpoints when creating the service client as shown in 1247 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1248 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1249 * PatchDeploymentName name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]"); 1250 * osConfigServiceClient.deletePatchDeployment(name); 1251 * } 1252 * }</pre> 1253 * 1254 * @param name Required. The resource name of the patch deployment in the form 1255 * `projects/*/patchDeployments/*`. 1256 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1257 */ deletePatchDeployment(PatchDeploymentName name)1258 public final void deletePatchDeployment(PatchDeploymentName name) { 1259 PatchDeployments.DeletePatchDeploymentRequest request = 1260 PatchDeployments.DeletePatchDeploymentRequest.newBuilder() 1261 .setName(name == null ? null : name.toString()) 1262 .build(); 1263 deletePatchDeployment(request); 1264 } 1265 1266 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1267 /** 1268 * Delete an OS Config patch deployment. 1269 * 1270 * <p>Sample code: 1271 * 1272 * <pre>{@code 1273 * // This snippet has been automatically generated and should be regarded as a code template only. 1274 * // It will require modifications to work: 1275 * // - It may require correct/in-range values for request initialization. 1276 * // - It may require specifying regional endpoints when creating the service client as shown in 1277 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1278 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1279 * String name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString(); 1280 * osConfigServiceClient.deletePatchDeployment(name); 1281 * } 1282 * }</pre> 1283 * 1284 * @param name Required. The resource name of the patch deployment in the form 1285 * `projects/*/patchDeployments/*`. 1286 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1287 */ deletePatchDeployment(String name)1288 public final void deletePatchDeployment(String name) { 1289 PatchDeployments.DeletePatchDeploymentRequest request = 1290 PatchDeployments.DeletePatchDeploymentRequest.newBuilder().setName(name).build(); 1291 deletePatchDeployment(request); 1292 } 1293 1294 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1295 /** 1296 * Delete an OS Config patch deployment. 1297 * 1298 * <p>Sample code: 1299 * 1300 * <pre>{@code 1301 * // This snippet has been automatically generated and should be regarded as a code template only. 1302 * // It will require modifications to work: 1303 * // - It may require correct/in-range values for request initialization. 1304 * // - It may require specifying regional endpoints when creating the service client as shown in 1305 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1306 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1307 * PatchDeployments.DeletePatchDeploymentRequest request = 1308 * PatchDeployments.DeletePatchDeploymentRequest.newBuilder() 1309 * .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString()) 1310 * .build(); 1311 * osConfigServiceClient.deletePatchDeployment(request); 1312 * } 1313 * }</pre> 1314 * 1315 * @param request The request object containing all of the parameters for the API call. 1316 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1317 */ deletePatchDeployment(PatchDeployments.DeletePatchDeploymentRequest request)1318 public final void deletePatchDeployment(PatchDeployments.DeletePatchDeploymentRequest request) { 1319 deletePatchDeploymentCallable().call(request); 1320 } 1321 1322 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1323 /** 1324 * Delete an OS Config patch deployment. 1325 * 1326 * <p>Sample code: 1327 * 1328 * <pre>{@code 1329 * // This snippet has been automatically generated and should be regarded as a code template only. 1330 * // It will require modifications to work: 1331 * // - It may require correct/in-range values for request initialization. 1332 * // - It may require specifying regional endpoints when creating the service client as shown in 1333 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1334 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1335 * PatchDeployments.DeletePatchDeploymentRequest request = 1336 * PatchDeployments.DeletePatchDeploymentRequest.newBuilder() 1337 * .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString()) 1338 * .build(); 1339 * ApiFuture<Empty> future = 1340 * osConfigServiceClient.deletePatchDeploymentCallable().futureCall(request); 1341 * // Do something. 1342 * future.get(); 1343 * } 1344 * }</pre> 1345 */ 1346 public final UnaryCallable<PatchDeployments.DeletePatchDeploymentRequest, Empty> deletePatchDeploymentCallable()1347 deletePatchDeploymentCallable() { 1348 return stub.deletePatchDeploymentCallable(); 1349 } 1350 1351 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1352 /** 1353 * Update an OS Config patch deployment. 1354 * 1355 * <p>Sample code: 1356 * 1357 * <pre>{@code 1358 * // This snippet has been automatically generated and should be regarded as a code template only. 1359 * // It will require modifications to work: 1360 * // - It may require correct/in-range values for request initialization. 1361 * // - It may require specifying regional endpoints when creating the service client as shown in 1362 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1363 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1364 * PatchDeployments.PatchDeployment patchDeployment = 1365 * PatchDeployments.PatchDeployment.newBuilder().build(); 1366 * FieldMask updateMask = FieldMask.newBuilder().build(); 1367 * PatchDeployments.PatchDeployment response = 1368 * osConfigServiceClient.updatePatchDeployment(patchDeployment, updateMask); 1369 * } 1370 * }</pre> 1371 * 1372 * @param patchDeployment Required. The patch deployment to Update. 1373 * @param updateMask Optional. Field mask that controls which fields of the patch deployment 1374 * should be updated. 1375 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1376 */ updatePatchDeployment( PatchDeployments.PatchDeployment patchDeployment, FieldMask updateMask)1377 public final PatchDeployments.PatchDeployment updatePatchDeployment( 1378 PatchDeployments.PatchDeployment patchDeployment, FieldMask updateMask) { 1379 PatchDeployments.UpdatePatchDeploymentRequest request = 1380 PatchDeployments.UpdatePatchDeploymentRequest.newBuilder() 1381 .setPatchDeployment(patchDeployment) 1382 .setUpdateMask(updateMask) 1383 .build(); 1384 return updatePatchDeployment(request); 1385 } 1386 1387 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1388 /** 1389 * Update an OS Config patch deployment. 1390 * 1391 * <p>Sample code: 1392 * 1393 * <pre>{@code 1394 * // This snippet has been automatically generated and should be regarded as a code template only. 1395 * // It will require modifications to work: 1396 * // - It may require correct/in-range values for request initialization. 1397 * // - It may require specifying regional endpoints when creating the service client as shown in 1398 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1399 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1400 * PatchDeployments.UpdatePatchDeploymentRequest request = 1401 * PatchDeployments.UpdatePatchDeploymentRequest.newBuilder() 1402 * .setPatchDeployment(PatchDeployments.PatchDeployment.newBuilder().build()) 1403 * .setUpdateMask(FieldMask.newBuilder().build()) 1404 * .build(); 1405 * PatchDeployments.PatchDeployment response = 1406 * osConfigServiceClient.updatePatchDeployment(request); 1407 * } 1408 * }</pre> 1409 * 1410 * @param request The request object containing all of the parameters for the API call. 1411 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1412 */ updatePatchDeployment( PatchDeployments.UpdatePatchDeploymentRequest request)1413 public final PatchDeployments.PatchDeployment updatePatchDeployment( 1414 PatchDeployments.UpdatePatchDeploymentRequest request) { 1415 return updatePatchDeploymentCallable().call(request); 1416 } 1417 1418 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1419 /** 1420 * Update an OS Config patch deployment. 1421 * 1422 * <p>Sample code: 1423 * 1424 * <pre>{@code 1425 * // This snippet has been automatically generated and should be regarded as a code template only. 1426 * // It will require modifications to work: 1427 * // - It may require correct/in-range values for request initialization. 1428 * // - It may require specifying regional endpoints when creating the service client as shown in 1429 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1430 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1431 * PatchDeployments.UpdatePatchDeploymentRequest request = 1432 * PatchDeployments.UpdatePatchDeploymentRequest.newBuilder() 1433 * .setPatchDeployment(PatchDeployments.PatchDeployment.newBuilder().build()) 1434 * .setUpdateMask(FieldMask.newBuilder().build()) 1435 * .build(); 1436 * ApiFuture<PatchDeployments.PatchDeployment> future = 1437 * osConfigServiceClient.updatePatchDeploymentCallable().futureCall(request); 1438 * // Do something. 1439 * PatchDeployments.PatchDeployment response = future.get(); 1440 * } 1441 * }</pre> 1442 */ 1443 public final UnaryCallable< 1444 PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment> updatePatchDeploymentCallable()1445 updatePatchDeploymentCallable() { 1446 return stub.updatePatchDeploymentCallable(); 1447 } 1448 1449 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1450 /** 1451 * Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate 1452 * patch jobs. 1453 * 1454 * <p>Sample code: 1455 * 1456 * <pre>{@code 1457 * // This snippet has been automatically generated and should be regarded as a code template only. 1458 * // It will require modifications to work: 1459 * // - It may require correct/in-range values for request initialization. 1460 * // - It may require specifying regional endpoints when creating the service client as shown in 1461 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1462 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1463 * PatchDeploymentName name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]"); 1464 * PatchDeployments.PatchDeployment response = osConfigServiceClient.pausePatchDeployment(name); 1465 * } 1466 * }</pre> 1467 * 1468 * @param name Required. The resource name of the patch deployment in the form 1469 * `projects/*/patchDeployments/*`. 1470 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1471 */ pausePatchDeployment(PatchDeploymentName name)1472 public final PatchDeployments.PatchDeployment pausePatchDeployment(PatchDeploymentName name) { 1473 PatchDeployments.PausePatchDeploymentRequest request = 1474 PatchDeployments.PausePatchDeploymentRequest.newBuilder() 1475 .setName(name == null ? null : name.toString()) 1476 .build(); 1477 return pausePatchDeployment(request); 1478 } 1479 1480 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1481 /** 1482 * Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate 1483 * patch jobs. 1484 * 1485 * <p>Sample code: 1486 * 1487 * <pre>{@code 1488 * // This snippet has been automatically generated and should be regarded as a code template only. 1489 * // It will require modifications to work: 1490 * // - It may require correct/in-range values for request initialization. 1491 * // - It may require specifying regional endpoints when creating the service client as shown in 1492 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1493 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1494 * String name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString(); 1495 * PatchDeployments.PatchDeployment response = osConfigServiceClient.pausePatchDeployment(name); 1496 * } 1497 * }</pre> 1498 * 1499 * @param name Required. The resource name of the patch deployment in the form 1500 * `projects/*/patchDeployments/*`. 1501 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1502 */ pausePatchDeployment(String name)1503 public final PatchDeployments.PatchDeployment pausePatchDeployment(String name) { 1504 PatchDeployments.PausePatchDeploymentRequest request = 1505 PatchDeployments.PausePatchDeploymentRequest.newBuilder().setName(name).build(); 1506 return pausePatchDeployment(request); 1507 } 1508 1509 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1510 /** 1511 * Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate 1512 * patch jobs. 1513 * 1514 * <p>Sample code: 1515 * 1516 * <pre>{@code 1517 * // This snippet has been automatically generated and should be regarded as a code template only. 1518 * // It will require modifications to work: 1519 * // - It may require correct/in-range values for request initialization. 1520 * // - It may require specifying regional endpoints when creating the service client as shown in 1521 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1522 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1523 * PatchDeployments.PausePatchDeploymentRequest request = 1524 * PatchDeployments.PausePatchDeploymentRequest.newBuilder() 1525 * .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString()) 1526 * .build(); 1527 * PatchDeployments.PatchDeployment response = 1528 * osConfigServiceClient.pausePatchDeployment(request); 1529 * } 1530 * }</pre> 1531 * 1532 * @param request The request object containing all of the parameters for the API call. 1533 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1534 */ pausePatchDeployment( PatchDeployments.PausePatchDeploymentRequest request)1535 public final PatchDeployments.PatchDeployment pausePatchDeployment( 1536 PatchDeployments.PausePatchDeploymentRequest request) { 1537 return pausePatchDeploymentCallable().call(request); 1538 } 1539 1540 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1541 /** 1542 * Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate 1543 * patch jobs. 1544 * 1545 * <p>Sample code: 1546 * 1547 * <pre>{@code 1548 * // This snippet has been automatically generated and should be regarded as a code template only. 1549 * // It will require modifications to work: 1550 * // - It may require correct/in-range values for request initialization. 1551 * // - It may require specifying regional endpoints when creating the service client as shown in 1552 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1553 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1554 * PatchDeployments.PausePatchDeploymentRequest request = 1555 * PatchDeployments.PausePatchDeploymentRequest.newBuilder() 1556 * .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString()) 1557 * .build(); 1558 * ApiFuture<PatchDeployments.PatchDeployment> future = 1559 * osConfigServiceClient.pausePatchDeploymentCallable().futureCall(request); 1560 * // Do something. 1561 * PatchDeployments.PatchDeployment response = future.get(); 1562 * } 1563 * }</pre> 1564 */ 1565 public final UnaryCallable< 1566 PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment> pausePatchDeploymentCallable()1567 pausePatchDeploymentCallable() { 1568 return stub.pausePatchDeploymentCallable(); 1569 } 1570 1571 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1572 /** 1573 * Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues 1574 * to generate patch jobs. 1575 * 1576 * <p>Sample code: 1577 * 1578 * <pre>{@code 1579 * // This snippet has been automatically generated and should be regarded as a code template only. 1580 * // It will require modifications to work: 1581 * // - It may require correct/in-range values for request initialization. 1582 * // - It may require specifying regional endpoints when creating the service client as shown in 1583 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1584 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1585 * PatchDeploymentName name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]"); 1586 * PatchDeployments.PatchDeployment response = osConfigServiceClient.resumePatchDeployment(name); 1587 * } 1588 * }</pre> 1589 * 1590 * @param name Required. The resource name of the patch deployment in the form 1591 * `projects/*/patchDeployments/*`. 1592 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1593 */ resumePatchDeployment(PatchDeploymentName name)1594 public final PatchDeployments.PatchDeployment resumePatchDeployment(PatchDeploymentName name) { 1595 PatchDeployments.ResumePatchDeploymentRequest request = 1596 PatchDeployments.ResumePatchDeploymentRequest.newBuilder() 1597 .setName(name == null ? null : name.toString()) 1598 .build(); 1599 return resumePatchDeployment(request); 1600 } 1601 1602 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1603 /** 1604 * Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues 1605 * to generate patch jobs. 1606 * 1607 * <p>Sample code: 1608 * 1609 * <pre>{@code 1610 * // This snippet has been automatically generated and should be regarded as a code template only. 1611 * // It will require modifications to work: 1612 * // - It may require correct/in-range values for request initialization. 1613 * // - It may require specifying regional endpoints when creating the service client as shown in 1614 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1615 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1616 * String name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString(); 1617 * PatchDeployments.PatchDeployment response = osConfigServiceClient.resumePatchDeployment(name); 1618 * } 1619 * }</pre> 1620 * 1621 * @param name Required. The resource name of the patch deployment in the form 1622 * `projects/*/patchDeployments/*`. 1623 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1624 */ resumePatchDeployment(String name)1625 public final PatchDeployments.PatchDeployment resumePatchDeployment(String name) { 1626 PatchDeployments.ResumePatchDeploymentRequest request = 1627 PatchDeployments.ResumePatchDeploymentRequest.newBuilder().setName(name).build(); 1628 return resumePatchDeployment(request); 1629 } 1630 1631 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1632 /** 1633 * Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues 1634 * to generate patch jobs. 1635 * 1636 * <p>Sample code: 1637 * 1638 * <pre>{@code 1639 * // This snippet has been automatically generated and should be regarded as a code template only. 1640 * // It will require modifications to work: 1641 * // - It may require correct/in-range values for request initialization. 1642 * // - It may require specifying regional endpoints when creating the service client as shown in 1643 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1644 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1645 * PatchDeployments.ResumePatchDeploymentRequest request = 1646 * PatchDeployments.ResumePatchDeploymentRequest.newBuilder() 1647 * .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString()) 1648 * .build(); 1649 * PatchDeployments.PatchDeployment response = 1650 * osConfigServiceClient.resumePatchDeployment(request); 1651 * } 1652 * }</pre> 1653 * 1654 * @param request The request object containing all of the parameters for the API call. 1655 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1656 */ resumePatchDeployment( PatchDeployments.ResumePatchDeploymentRequest request)1657 public final PatchDeployments.PatchDeployment resumePatchDeployment( 1658 PatchDeployments.ResumePatchDeploymentRequest request) { 1659 return resumePatchDeploymentCallable().call(request); 1660 } 1661 1662 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1663 /** 1664 * Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues 1665 * to generate patch jobs. 1666 * 1667 * <p>Sample code: 1668 * 1669 * <pre>{@code 1670 * // This snippet has been automatically generated and should be regarded as a code template only. 1671 * // It will require modifications to work: 1672 * // - It may require correct/in-range values for request initialization. 1673 * // - It may require specifying regional endpoints when creating the service client as shown in 1674 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1675 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) { 1676 * PatchDeployments.ResumePatchDeploymentRequest request = 1677 * PatchDeployments.ResumePatchDeploymentRequest.newBuilder() 1678 * .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString()) 1679 * .build(); 1680 * ApiFuture<PatchDeployments.PatchDeployment> future = 1681 * osConfigServiceClient.resumePatchDeploymentCallable().futureCall(request); 1682 * // Do something. 1683 * PatchDeployments.PatchDeployment response = future.get(); 1684 * } 1685 * }</pre> 1686 */ 1687 public final UnaryCallable< 1688 PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment> resumePatchDeploymentCallable()1689 resumePatchDeploymentCallable() { 1690 return stub.resumePatchDeploymentCallable(); 1691 } 1692 1693 @Override close()1694 public final void close() { 1695 stub.close(); 1696 } 1697 1698 @Override shutdown()1699 public void shutdown() { 1700 stub.shutdown(); 1701 } 1702 1703 @Override isShutdown()1704 public boolean isShutdown() { 1705 return stub.isShutdown(); 1706 } 1707 1708 @Override isTerminated()1709 public boolean isTerminated() { 1710 return stub.isTerminated(); 1711 } 1712 1713 @Override shutdownNow()1714 public void shutdownNow() { 1715 stub.shutdownNow(); 1716 } 1717 1718 @Override awaitTermination(long duration, TimeUnit unit)1719 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 1720 return stub.awaitTermination(duration, unit); 1721 } 1722 1723 public static class ListPatchJobsPagedResponse 1724 extends AbstractPagedListResponse< 1725 PatchJobs.ListPatchJobsRequest, 1726 PatchJobs.ListPatchJobsResponse, 1727 PatchJobs.PatchJob, 1728 ListPatchJobsPage, 1729 ListPatchJobsFixedSizeCollection> { 1730 createAsync( PageContext< PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse, PatchJobs.PatchJob> context, ApiFuture<PatchJobs.ListPatchJobsResponse> futureResponse)1731 public static ApiFuture<ListPatchJobsPagedResponse> createAsync( 1732 PageContext< 1733 PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse, PatchJobs.PatchJob> 1734 context, 1735 ApiFuture<PatchJobs.ListPatchJobsResponse> futureResponse) { 1736 ApiFuture<ListPatchJobsPage> futurePage = 1737 ListPatchJobsPage.createEmptyPage().createPageAsync(context, futureResponse); 1738 return ApiFutures.transform( 1739 futurePage, 1740 input -> new ListPatchJobsPagedResponse(input), 1741 MoreExecutors.directExecutor()); 1742 } 1743 ListPatchJobsPagedResponse(ListPatchJobsPage page)1744 private ListPatchJobsPagedResponse(ListPatchJobsPage page) { 1745 super(page, ListPatchJobsFixedSizeCollection.createEmptyCollection()); 1746 } 1747 } 1748 1749 public static class ListPatchJobsPage 1750 extends AbstractPage< 1751 PatchJobs.ListPatchJobsRequest, 1752 PatchJobs.ListPatchJobsResponse, 1753 PatchJobs.PatchJob, 1754 ListPatchJobsPage> { 1755 ListPatchJobsPage( PageContext< PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse, PatchJobs.PatchJob> context, PatchJobs.ListPatchJobsResponse response)1756 private ListPatchJobsPage( 1757 PageContext< 1758 PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse, PatchJobs.PatchJob> 1759 context, 1760 PatchJobs.ListPatchJobsResponse response) { 1761 super(context, response); 1762 } 1763 createEmptyPage()1764 private static ListPatchJobsPage createEmptyPage() { 1765 return new ListPatchJobsPage(null, null); 1766 } 1767 1768 @Override createPage( PageContext< PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse, PatchJobs.PatchJob> context, PatchJobs.ListPatchJobsResponse response)1769 protected ListPatchJobsPage createPage( 1770 PageContext< 1771 PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse, PatchJobs.PatchJob> 1772 context, 1773 PatchJobs.ListPatchJobsResponse response) { 1774 return new ListPatchJobsPage(context, response); 1775 } 1776 1777 @Override createPageAsync( PageContext< PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse, PatchJobs.PatchJob> context, ApiFuture<PatchJobs.ListPatchJobsResponse> futureResponse)1778 public ApiFuture<ListPatchJobsPage> createPageAsync( 1779 PageContext< 1780 PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse, PatchJobs.PatchJob> 1781 context, 1782 ApiFuture<PatchJobs.ListPatchJobsResponse> futureResponse) { 1783 return super.createPageAsync(context, futureResponse); 1784 } 1785 } 1786 1787 public static class ListPatchJobsFixedSizeCollection 1788 extends AbstractFixedSizeCollection< 1789 PatchJobs.ListPatchJobsRequest, 1790 PatchJobs.ListPatchJobsResponse, 1791 PatchJobs.PatchJob, 1792 ListPatchJobsPage, 1793 ListPatchJobsFixedSizeCollection> { 1794 ListPatchJobsFixedSizeCollection(List<ListPatchJobsPage> pages, int collectionSize)1795 private ListPatchJobsFixedSizeCollection(List<ListPatchJobsPage> pages, int collectionSize) { 1796 super(pages, collectionSize); 1797 } 1798 createEmptyCollection()1799 private static ListPatchJobsFixedSizeCollection createEmptyCollection() { 1800 return new ListPatchJobsFixedSizeCollection(null, 0); 1801 } 1802 1803 @Override createCollection( List<ListPatchJobsPage> pages, int collectionSize)1804 protected ListPatchJobsFixedSizeCollection createCollection( 1805 List<ListPatchJobsPage> pages, int collectionSize) { 1806 return new ListPatchJobsFixedSizeCollection(pages, collectionSize); 1807 } 1808 } 1809 1810 public static class ListPatchJobInstanceDetailsPagedResponse 1811 extends AbstractPagedListResponse< 1812 PatchJobs.ListPatchJobInstanceDetailsRequest, 1813 PatchJobs.ListPatchJobInstanceDetailsResponse, 1814 PatchJobs.PatchJobInstanceDetails, 1815 ListPatchJobInstanceDetailsPage, 1816 ListPatchJobInstanceDetailsFixedSizeCollection> { 1817 createAsync( PageContext< PatchJobs.ListPatchJobInstanceDetailsRequest, PatchJobs.ListPatchJobInstanceDetailsResponse, PatchJobs.PatchJobInstanceDetails> context, ApiFuture<PatchJobs.ListPatchJobInstanceDetailsResponse> futureResponse)1818 public static ApiFuture<ListPatchJobInstanceDetailsPagedResponse> createAsync( 1819 PageContext< 1820 PatchJobs.ListPatchJobInstanceDetailsRequest, 1821 PatchJobs.ListPatchJobInstanceDetailsResponse, 1822 PatchJobs.PatchJobInstanceDetails> 1823 context, 1824 ApiFuture<PatchJobs.ListPatchJobInstanceDetailsResponse> futureResponse) { 1825 ApiFuture<ListPatchJobInstanceDetailsPage> futurePage = 1826 ListPatchJobInstanceDetailsPage.createEmptyPage() 1827 .createPageAsync(context, futureResponse); 1828 return ApiFutures.transform( 1829 futurePage, 1830 input -> new ListPatchJobInstanceDetailsPagedResponse(input), 1831 MoreExecutors.directExecutor()); 1832 } 1833 ListPatchJobInstanceDetailsPagedResponse(ListPatchJobInstanceDetailsPage page)1834 private ListPatchJobInstanceDetailsPagedResponse(ListPatchJobInstanceDetailsPage page) { 1835 super(page, ListPatchJobInstanceDetailsFixedSizeCollection.createEmptyCollection()); 1836 } 1837 } 1838 1839 public static class ListPatchJobInstanceDetailsPage 1840 extends AbstractPage< 1841 PatchJobs.ListPatchJobInstanceDetailsRequest, 1842 PatchJobs.ListPatchJobInstanceDetailsResponse, 1843 PatchJobs.PatchJobInstanceDetails, 1844 ListPatchJobInstanceDetailsPage> { 1845 ListPatchJobInstanceDetailsPage( PageContext< PatchJobs.ListPatchJobInstanceDetailsRequest, PatchJobs.ListPatchJobInstanceDetailsResponse, PatchJobs.PatchJobInstanceDetails> context, PatchJobs.ListPatchJobInstanceDetailsResponse response)1846 private ListPatchJobInstanceDetailsPage( 1847 PageContext< 1848 PatchJobs.ListPatchJobInstanceDetailsRequest, 1849 PatchJobs.ListPatchJobInstanceDetailsResponse, 1850 PatchJobs.PatchJobInstanceDetails> 1851 context, 1852 PatchJobs.ListPatchJobInstanceDetailsResponse response) { 1853 super(context, response); 1854 } 1855 createEmptyPage()1856 private static ListPatchJobInstanceDetailsPage createEmptyPage() { 1857 return new ListPatchJobInstanceDetailsPage(null, null); 1858 } 1859 1860 @Override createPage( PageContext< PatchJobs.ListPatchJobInstanceDetailsRequest, PatchJobs.ListPatchJobInstanceDetailsResponse, PatchJobs.PatchJobInstanceDetails> context, PatchJobs.ListPatchJobInstanceDetailsResponse response)1861 protected ListPatchJobInstanceDetailsPage createPage( 1862 PageContext< 1863 PatchJobs.ListPatchJobInstanceDetailsRequest, 1864 PatchJobs.ListPatchJobInstanceDetailsResponse, 1865 PatchJobs.PatchJobInstanceDetails> 1866 context, 1867 PatchJobs.ListPatchJobInstanceDetailsResponse response) { 1868 return new ListPatchJobInstanceDetailsPage(context, response); 1869 } 1870 1871 @Override createPageAsync( PageContext< PatchJobs.ListPatchJobInstanceDetailsRequest, PatchJobs.ListPatchJobInstanceDetailsResponse, PatchJobs.PatchJobInstanceDetails> context, ApiFuture<PatchJobs.ListPatchJobInstanceDetailsResponse> futureResponse)1872 public ApiFuture<ListPatchJobInstanceDetailsPage> createPageAsync( 1873 PageContext< 1874 PatchJobs.ListPatchJobInstanceDetailsRequest, 1875 PatchJobs.ListPatchJobInstanceDetailsResponse, 1876 PatchJobs.PatchJobInstanceDetails> 1877 context, 1878 ApiFuture<PatchJobs.ListPatchJobInstanceDetailsResponse> futureResponse) { 1879 return super.createPageAsync(context, futureResponse); 1880 } 1881 } 1882 1883 public static class ListPatchJobInstanceDetailsFixedSizeCollection 1884 extends AbstractFixedSizeCollection< 1885 PatchJobs.ListPatchJobInstanceDetailsRequest, 1886 PatchJobs.ListPatchJobInstanceDetailsResponse, 1887 PatchJobs.PatchJobInstanceDetails, 1888 ListPatchJobInstanceDetailsPage, 1889 ListPatchJobInstanceDetailsFixedSizeCollection> { 1890 ListPatchJobInstanceDetailsFixedSizeCollection( List<ListPatchJobInstanceDetailsPage> pages, int collectionSize)1891 private ListPatchJobInstanceDetailsFixedSizeCollection( 1892 List<ListPatchJobInstanceDetailsPage> pages, int collectionSize) { 1893 super(pages, collectionSize); 1894 } 1895 createEmptyCollection()1896 private static ListPatchJobInstanceDetailsFixedSizeCollection createEmptyCollection() { 1897 return new ListPatchJobInstanceDetailsFixedSizeCollection(null, 0); 1898 } 1899 1900 @Override createCollection( List<ListPatchJobInstanceDetailsPage> pages, int collectionSize)1901 protected ListPatchJobInstanceDetailsFixedSizeCollection createCollection( 1902 List<ListPatchJobInstanceDetailsPage> pages, int collectionSize) { 1903 return new ListPatchJobInstanceDetailsFixedSizeCollection(pages, collectionSize); 1904 } 1905 } 1906 1907 public static class ListPatchDeploymentsPagedResponse 1908 extends AbstractPagedListResponse< 1909 PatchDeployments.ListPatchDeploymentsRequest, 1910 PatchDeployments.ListPatchDeploymentsResponse, 1911 PatchDeployments.PatchDeployment, 1912 ListPatchDeploymentsPage, 1913 ListPatchDeploymentsFixedSizeCollection> { 1914 createAsync( PageContext< PatchDeployments.ListPatchDeploymentsRequest, PatchDeployments.ListPatchDeploymentsResponse, PatchDeployments.PatchDeployment> context, ApiFuture<PatchDeployments.ListPatchDeploymentsResponse> futureResponse)1915 public static ApiFuture<ListPatchDeploymentsPagedResponse> createAsync( 1916 PageContext< 1917 PatchDeployments.ListPatchDeploymentsRequest, 1918 PatchDeployments.ListPatchDeploymentsResponse, 1919 PatchDeployments.PatchDeployment> 1920 context, 1921 ApiFuture<PatchDeployments.ListPatchDeploymentsResponse> futureResponse) { 1922 ApiFuture<ListPatchDeploymentsPage> futurePage = 1923 ListPatchDeploymentsPage.createEmptyPage().createPageAsync(context, futureResponse); 1924 return ApiFutures.transform( 1925 futurePage, 1926 input -> new ListPatchDeploymentsPagedResponse(input), 1927 MoreExecutors.directExecutor()); 1928 } 1929 ListPatchDeploymentsPagedResponse(ListPatchDeploymentsPage page)1930 private ListPatchDeploymentsPagedResponse(ListPatchDeploymentsPage page) { 1931 super(page, ListPatchDeploymentsFixedSizeCollection.createEmptyCollection()); 1932 } 1933 } 1934 1935 public static class ListPatchDeploymentsPage 1936 extends AbstractPage< 1937 PatchDeployments.ListPatchDeploymentsRequest, 1938 PatchDeployments.ListPatchDeploymentsResponse, 1939 PatchDeployments.PatchDeployment, 1940 ListPatchDeploymentsPage> { 1941 ListPatchDeploymentsPage( PageContext< PatchDeployments.ListPatchDeploymentsRequest, PatchDeployments.ListPatchDeploymentsResponse, PatchDeployments.PatchDeployment> context, PatchDeployments.ListPatchDeploymentsResponse response)1942 private ListPatchDeploymentsPage( 1943 PageContext< 1944 PatchDeployments.ListPatchDeploymentsRequest, 1945 PatchDeployments.ListPatchDeploymentsResponse, 1946 PatchDeployments.PatchDeployment> 1947 context, 1948 PatchDeployments.ListPatchDeploymentsResponse response) { 1949 super(context, response); 1950 } 1951 createEmptyPage()1952 private static ListPatchDeploymentsPage createEmptyPage() { 1953 return new ListPatchDeploymentsPage(null, null); 1954 } 1955 1956 @Override createPage( PageContext< PatchDeployments.ListPatchDeploymentsRequest, PatchDeployments.ListPatchDeploymentsResponse, PatchDeployments.PatchDeployment> context, PatchDeployments.ListPatchDeploymentsResponse response)1957 protected ListPatchDeploymentsPage createPage( 1958 PageContext< 1959 PatchDeployments.ListPatchDeploymentsRequest, 1960 PatchDeployments.ListPatchDeploymentsResponse, 1961 PatchDeployments.PatchDeployment> 1962 context, 1963 PatchDeployments.ListPatchDeploymentsResponse response) { 1964 return new ListPatchDeploymentsPage(context, response); 1965 } 1966 1967 @Override createPageAsync( PageContext< PatchDeployments.ListPatchDeploymentsRequest, PatchDeployments.ListPatchDeploymentsResponse, PatchDeployments.PatchDeployment> context, ApiFuture<PatchDeployments.ListPatchDeploymentsResponse> futureResponse)1968 public ApiFuture<ListPatchDeploymentsPage> createPageAsync( 1969 PageContext< 1970 PatchDeployments.ListPatchDeploymentsRequest, 1971 PatchDeployments.ListPatchDeploymentsResponse, 1972 PatchDeployments.PatchDeployment> 1973 context, 1974 ApiFuture<PatchDeployments.ListPatchDeploymentsResponse> futureResponse) { 1975 return super.createPageAsync(context, futureResponse); 1976 } 1977 } 1978 1979 public static class ListPatchDeploymentsFixedSizeCollection 1980 extends AbstractFixedSizeCollection< 1981 PatchDeployments.ListPatchDeploymentsRequest, 1982 PatchDeployments.ListPatchDeploymentsResponse, 1983 PatchDeployments.PatchDeployment, 1984 ListPatchDeploymentsPage, 1985 ListPatchDeploymentsFixedSizeCollection> { 1986 ListPatchDeploymentsFixedSizeCollection( List<ListPatchDeploymentsPage> pages, int collectionSize)1987 private ListPatchDeploymentsFixedSizeCollection( 1988 List<ListPatchDeploymentsPage> pages, int collectionSize) { 1989 super(pages, collectionSize); 1990 } 1991 createEmptyCollection()1992 private static ListPatchDeploymentsFixedSizeCollection createEmptyCollection() { 1993 return new ListPatchDeploymentsFixedSizeCollection(null, 0); 1994 } 1995 1996 @Override createCollection( List<ListPatchDeploymentsPage> pages, int collectionSize)1997 protected ListPatchDeploymentsFixedSizeCollection createCollection( 1998 List<ListPatchDeploymentsPage> pages, int collectionSize) { 1999 return new ListPatchDeploymentsFixedSizeCollection(pages, collectionSize); 2000 } 2001 } 2002 } 2003