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.aiplatform.v1beta1; 18 19 import com.google.api.core.ApiFuture; 20 import com.google.api.core.ApiFutures; 21 import com.google.api.core.BetaApi; 22 import com.google.api.gax.core.BackgroundResource; 23 import com.google.api.gax.longrunning.OperationFuture; 24 import com.google.api.gax.paging.AbstractFixedSizeCollection; 25 import com.google.api.gax.paging.AbstractPage; 26 import com.google.api.gax.paging.AbstractPagedListResponse; 27 import com.google.api.gax.rpc.OperationCallable; 28 import com.google.api.gax.rpc.PageContext; 29 import com.google.api.gax.rpc.UnaryCallable; 30 import com.google.cloud.aiplatform.v1beta1.stub.JobServiceStub; 31 import com.google.cloud.aiplatform.v1beta1.stub.JobServiceStubSettings; 32 import com.google.cloud.location.GetLocationRequest; 33 import com.google.cloud.location.ListLocationsRequest; 34 import com.google.cloud.location.ListLocationsResponse; 35 import com.google.cloud.location.Location; 36 import com.google.common.util.concurrent.MoreExecutors; 37 import com.google.iam.v1.GetIamPolicyRequest; 38 import com.google.iam.v1.Policy; 39 import com.google.iam.v1.SetIamPolicyRequest; 40 import com.google.iam.v1.TestIamPermissionsRequest; 41 import com.google.iam.v1.TestIamPermissionsResponse; 42 import com.google.longrunning.Operation; 43 import com.google.longrunning.OperationsClient; 44 import com.google.protobuf.Empty; 45 import com.google.protobuf.FieldMask; 46 import java.io.IOException; 47 import java.util.List; 48 import java.util.concurrent.TimeUnit; 49 import javax.annotation.Generated; 50 51 // AUTO-GENERATED DOCUMENTATION AND CLASS. 52 /** 53 * Service Description: A service for creating and managing Vertex AI's jobs. 54 * 55 * <p>This class provides the ability to make remote calls to the backing service through method 56 * calls that map to API methods. Sample code to get started: 57 * 58 * <pre>{@code 59 * // This snippet has been automatically generated and should be regarded as a code template only. 60 * // It will require modifications to work: 61 * // - It may require correct/in-range values for request initialization. 62 * // - It may require specifying regional endpoints when creating the service client as shown in 63 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 64 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 65 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 66 * CustomJob customJob = CustomJob.newBuilder().build(); 67 * CustomJob response = jobServiceClient.createCustomJob(parent, customJob); 68 * } 69 * }</pre> 70 * 71 * <p>Note: close() needs to be called on the JobServiceClient object to clean up resources such as 72 * threads. In the example above, try-with-resources is used, which automatically calls close(). 73 * 74 * <p>The surface of this class includes several types of Java methods for each of the API's 75 * methods: 76 * 77 * <ol> 78 * <li>A "flattened" method. With this type of method, the fields of the request type have been 79 * converted into function parameters. It may be the case that not all fields are available as 80 * parameters, and not every API method will have a flattened method entry point. 81 * <li>A "request object" method. This type of method only takes one parameter, a request object, 82 * which must be constructed before the call. Not every API method will have a request object 83 * method. 84 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 85 * callable object, which can be used to initiate calls to the service. 86 * </ol> 87 * 88 * <p>See the individual methods for example code. 89 * 90 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 91 * these names, this class includes a format method for each type of name, and additionally a parse 92 * method to extract the individual identifiers contained within names that are returned. 93 * 94 * <p>This class can be customized by passing in a custom instance of JobServiceSettings to 95 * create(). For example: 96 * 97 * <p>To customize credentials: 98 * 99 * <pre>{@code 100 * // This snippet has been automatically generated and should be regarded as a code template only. 101 * // It will require modifications to work: 102 * // - It may require correct/in-range values for request initialization. 103 * // - It may require specifying regional endpoints when creating the service client as shown in 104 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 105 * JobServiceSettings jobServiceSettings = 106 * JobServiceSettings.newBuilder() 107 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 108 * .build(); 109 * JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings); 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 * JobServiceSettings jobServiceSettings = 121 * JobServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); 122 * JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings); 123 * }</pre> 124 * 125 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 126 */ 127 @BetaApi 128 @Generated("by gapic-generator-java") 129 public class JobServiceClient implements BackgroundResource { 130 private final JobServiceSettings settings; 131 private final JobServiceStub stub; 132 private final OperationsClient operationsClient; 133 134 /** Constructs an instance of JobServiceClient with default settings. */ create()135 public static final JobServiceClient create() throws IOException { 136 return create(JobServiceSettings.newBuilder().build()); 137 } 138 139 /** 140 * Constructs an instance of JobServiceClient, using the given settings. The channels are created 141 * based on the settings passed in, or defaults for any settings that are not set. 142 */ create(JobServiceSettings settings)143 public static final JobServiceClient create(JobServiceSettings settings) throws IOException { 144 return new JobServiceClient(settings); 145 } 146 147 /** 148 * Constructs an instance of JobServiceClient, using the given stub for making calls. This is for 149 * advanced usage - prefer using create(JobServiceSettings). 150 */ create(JobServiceStub stub)151 public static final JobServiceClient create(JobServiceStub stub) { 152 return new JobServiceClient(stub); 153 } 154 155 /** 156 * Constructs an instance of JobServiceClient, using the given settings. This is protected so that 157 * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. 158 */ JobServiceClient(JobServiceSettings settings)159 protected JobServiceClient(JobServiceSettings settings) throws IOException { 160 this.settings = settings; 161 this.stub = ((JobServiceStubSettings) settings.getStubSettings()).createStub(); 162 this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); 163 } 164 JobServiceClient(JobServiceStub stub)165 protected JobServiceClient(JobServiceStub stub) { 166 this.settings = null; 167 this.stub = stub; 168 this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); 169 } 170 getSettings()171 public final JobServiceSettings getSettings() { 172 return settings; 173 } 174 getStub()175 public JobServiceStub getStub() { 176 return stub; 177 } 178 179 /** 180 * Returns the OperationsClient that can be used to query the status of a long-running operation 181 * returned by another API method call. 182 */ getOperationsClient()183 public final OperationsClient getOperationsClient() { 184 return operationsClient; 185 } 186 187 // AUTO-GENERATED DOCUMENTATION AND METHOD. 188 /** 189 * Creates a CustomJob. A created CustomJob right away will be attempted to be run. 190 * 191 * <p>Sample code: 192 * 193 * <pre>{@code 194 * // This snippet has been automatically generated and should be regarded as a code template only. 195 * // It will require modifications to work: 196 * // - It may require correct/in-range values for request initialization. 197 * // - It may require specifying regional endpoints when creating the service client as shown in 198 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 199 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 200 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 201 * CustomJob customJob = CustomJob.newBuilder().build(); 202 * CustomJob response = jobServiceClient.createCustomJob(parent, customJob); 203 * } 204 * }</pre> 205 * 206 * @param parent Required. The resource name of the Location to create the CustomJob in. Format: 207 * `projects/{project}/locations/{location}` 208 * @param customJob Required. The CustomJob to create. 209 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 210 */ createCustomJob(LocationName parent, CustomJob customJob)211 public final CustomJob createCustomJob(LocationName parent, CustomJob customJob) { 212 CreateCustomJobRequest request = 213 CreateCustomJobRequest.newBuilder() 214 .setParent(parent == null ? null : parent.toString()) 215 .setCustomJob(customJob) 216 .build(); 217 return createCustomJob(request); 218 } 219 220 // AUTO-GENERATED DOCUMENTATION AND METHOD. 221 /** 222 * Creates a CustomJob. A created CustomJob right away will be attempted to be run. 223 * 224 * <p>Sample code: 225 * 226 * <pre>{@code 227 * // This snippet has been automatically generated and should be regarded as a code template only. 228 * // It will require modifications to work: 229 * // - It may require correct/in-range values for request initialization. 230 * // - It may require specifying regional endpoints when creating the service client as shown in 231 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 232 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 233 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 234 * CustomJob customJob = CustomJob.newBuilder().build(); 235 * CustomJob response = jobServiceClient.createCustomJob(parent, customJob); 236 * } 237 * }</pre> 238 * 239 * @param parent Required. The resource name of the Location to create the CustomJob in. Format: 240 * `projects/{project}/locations/{location}` 241 * @param customJob Required. The CustomJob to create. 242 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 243 */ createCustomJob(String parent, CustomJob customJob)244 public final CustomJob createCustomJob(String parent, CustomJob customJob) { 245 CreateCustomJobRequest request = 246 CreateCustomJobRequest.newBuilder().setParent(parent).setCustomJob(customJob).build(); 247 return createCustomJob(request); 248 } 249 250 // AUTO-GENERATED DOCUMENTATION AND METHOD. 251 /** 252 * Creates a CustomJob. A created CustomJob right away will be attempted to be run. 253 * 254 * <p>Sample code: 255 * 256 * <pre>{@code 257 * // This snippet has been automatically generated and should be regarded as a code template only. 258 * // It will require modifications to work: 259 * // - It may require correct/in-range values for request initialization. 260 * // - It may require specifying regional endpoints when creating the service client as shown in 261 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 262 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 263 * CreateCustomJobRequest request = 264 * CreateCustomJobRequest.newBuilder() 265 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 266 * .setCustomJob(CustomJob.newBuilder().build()) 267 * .build(); 268 * CustomJob response = jobServiceClient.createCustomJob(request); 269 * } 270 * }</pre> 271 * 272 * @param request The request object containing all of the parameters for the API call. 273 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 274 */ createCustomJob(CreateCustomJobRequest request)275 public final CustomJob createCustomJob(CreateCustomJobRequest request) { 276 return createCustomJobCallable().call(request); 277 } 278 279 // AUTO-GENERATED DOCUMENTATION AND METHOD. 280 /** 281 * Creates a CustomJob. A created CustomJob right away will be attempted to be run. 282 * 283 * <p>Sample code: 284 * 285 * <pre>{@code 286 * // This snippet has been automatically generated and should be regarded as a code template only. 287 * // It will require modifications to work: 288 * // - It may require correct/in-range values for request initialization. 289 * // - It may require specifying regional endpoints when creating the service client as shown in 290 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 291 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 292 * CreateCustomJobRequest request = 293 * CreateCustomJobRequest.newBuilder() 294 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 295 * .setCustomJob(CustomJob.newBuilder().build()) 296 * .build(); 297 * ApiFuture<CustomJob> future = jobServiceClient.createCustomJobCallable().futureCall(request); 298 * // Do something. 299 * CustomJob response = future.get(); 300 * } 301 * }</pre> 302 */ createCustomJobCallable()303 public final UnaryCallable<CreateCustomJobRequest, CustomJob> createCustomJobCallable() { 304 return stub.createCustomJobCallable(); 305 } 306 307 // AUTO-GENERATED DOCUMENTATION AND METHOD. 308 /** 309 * Gets a CustomJob. 310 * 311 * <p>Sample code: 312 * 313 * <pre>{@code 314 * // This snippet has been automatically generated and should be regarded as a code template only. 315 * // It will require modifications to work: 316 * // - It may require correct/in-range values for request initialization. 317 * // - It may require specifying regional endpoints when creating the service client as shown in 318 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 319 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 320 * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]"); 321 * CustomJob response = jobServiceClient.getCustomJob(name); 322 * } 323 * }</pre> 324 * 325 * @param name Required. The name of the CustomJob resource. Format: 326 * `projects/{project}/locations/{location}/customJobs/{custom_job}` 327 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 328 */ getCustomJob(CustomJobName name)329 public final CustomJob getCustomJob(CustomJobName name) { 330 GetCustomJobRequest request = 331 GetCustomJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 332 return getCustomJob(request); 333 } 334 335 // AUTO-GENERATED DOCUMENTATION AND METHOD. 336 /** 337 * Gets a CustomJob. 338 * 339 * <p>Sample code: 340 * 341 * <pre>{@code 342 * // This snippet has been automatically generated and should be regarded as a code template only. 343 * // It will require modifications to work: 344 * // - It may require correct/in-range values for request initialization. 345 * // - It may require specifying regional endpoints when creating the service client as shown in 346 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 347 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 348 * String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString(); 349 * CustomJob response = jobServiceClient.getCustomJob(name); 350 * } 351 * }</pre> 352 * 353 * @param name Required. The name of the CustomJob resource. Format: 354 * `projects/{project}/locations/{location}/customJobs/{custom_job}` 355 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 356 */ getCustomJob(String name)357 public final CustomJob getCustomJob(String name) { 358 GetCustomJobRequest request = GetCustomJobRequest.newBuilder().setName(name).build(); 359 return getCustomJob(request); 360 } 361 362 // AUTO-GENERATED DOCUMENTATION AND METHOD. 363 /** 364 * Gets a CustomJob. 365 * 366 * <p>Sample code: 367 * 368 * <pre>{@code 369 * // This snippet has been automatically generated and should be regarded as a code template only. 370 * // It will require modifications to work: 371 * // - It may require correct/in-range values for request initialization. 372 * // - It may require specifying regional endpoints when creating the service client as shown in 373 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 374 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 375 * GetCustomJobRequest request = 376 * GetCustomJobRequest.newBuilder() 377 * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) 378 * .build(); 379 * CustomJob response = jobServiceClient.getCustomJob(request); 380 * } 381 * }</pre> 382 * 383 * @param request The request object containing all of the parameters for the API call. 384 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 385 */ getCustomJob(GetCustomJobRequest request)386 public final CustomJob getCustomJob(GetCustomJobRequest request) { 387 return getCustomJobCallable().call(request); 388 } 389 390 // AUTO-GENERATED DOCUMENTATION AND METHOD. 391 /** 392 * Gets a CustomJob. 393 * 394 * <p>Sample code: 395 * 396 * <pre>{@code 397 * // This snippet has been automatically generated and should be regarded as a code template only. 398 * // It will require modifications to work: 399 * // - It may require correct/in-range values for request initialization. 400 * // - It may require specifying regional endpoints when creating the service client as shown in 401 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 402 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 403 * GetCustomJobRequest request = 404 * GetCustomJobRequest.newBuilder() 405 * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) 406 * .build(); 407 * ApiFuture<CustomJob> future = jobServiceClient.getCustomJobCallable().futureCall(request); 408 * // Do something. 409 * CustomJob response = future.get(); 410 * } 411 * }</pre> 412 */ getCustomJobCallable()413 public final UnaryCallable<GetCustomJobRequest, CustomJob> getCustomJobCallable() { 414 return stub.getCustomJobCallable(); 415 } 416 417 // AUTO-GENERATED DOCUMENTATION AND METHOD. 418 /** 419 * Lists CustomJobs in a Location. 420 * 421 * <p>Sample code: 422 * 423 * <pre>{@code 424 * // This snippet has been automatically generated and should be regarded as a code template only. 425 * // It will require modifications to work: 426 * // - It may require correct/in-range values for request initialization. 427 * // - It may require specifying regional endpoints when creating the service client as shown in 428 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 429 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 430 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 431 * for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) { 432 * // doThingsWith(element); 433 * } 434 * } 435 * }</pre> 436 * 437 * @param parent Required. The resource name of the Location to list the CustomJobs from. Format: 438 * `projects/{project}/locations/{location}` 439 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 440 */ listCustomJobs(LocationName parent)441 public final ListCustomJobsPagedResponse listCustomJobs(LocationName parent) { 442 ListCustomJobsRequest request = 443 ListCustomJobsRequest.newBuilder() 444 .setParent(parent == null ? null : parent.toString()) 445 .build(); 446 return listCustomJobs(request); 447 } 448 449 // AUTO-GENERATED DOCUMENTATION AND METHOD. 450 /** 451 * Lists CustomJobs in a Location. 452 * 453 * <p>Sample code: 454 * 455 * <pre>{@code 456 * // This snippet has been automatically generated and should be regarded as a code template only. 457 * // It will require modifications to work: 458 * // - It may require correct/in-range values for request initialization. 459 * // - It may require specifying regional endpoints when creating the service client as shown in 460 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 461 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 462 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 463 * for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) { 464 * // doThingsWith(element); 465 * } 466 * } 467 * }</pre> 468 * 469 * @param parent Required. The resource name of the Location to list the CustomJobs from. Format: 470 * `projects/{project}/locations/{location}` 471 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 472 */ listCustomJobs(String parent)473 public final ListCustomJobsPagedResponse listCustomJobs(String parent) { 474 ListCustomJobsRequest request = ListCustomJobsRequest.newBuilder().setParent(parent).build(); 475 return listCustomJobs(request); 476 } 477 478 // AUTO-GENERATED DOCUMENTATION AND METHOD. 479 /** 480 * Lists CustomJobs in a Location. 481 * 482 * <p>Sample code: 483 * 484 * <pre>{@code 485 * // This snippet has been automatically generated and should be regarded as a code template only. 486 * // It will require modifications to work: 487 * // - It may require correct/in-range values for request initialization. 488 * // - It may require specifying regional endpoints when creating the service client as shown in 489 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 490 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 491 * ListCustomJobsRequest request = 492 * ListCustomJobsRequest.newBuilder() 493 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 494 * .setFilter("filter-1274492040") 495 * .setPageSize(883849137) 496 * .setPageToken("pageToken873572522") 497 * .setReadMask(FieldMask.newBuilder().build()) 498 * .build(); 499 * for (CustomJob element : jobServiceClient.listCustomJobs(request).iterateAll()) { 500 * // doThingsWith(element); 501 * } 502 * } 503 * }</pre> 504 * 505 * @param request The request object containing all of the parameters for the API call. 506 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 507 */ listCustomJobs(ListCustomJobsRequest request)508 public final ListCustomJobsPagedResponse listCustomJobs(ListCustomJobsRequest request) { 509 return listCustomJobsPagedCallable().call(request); 510 } 511 512 // AUTO-GENERATED DOCUMENTATION AND METHOD. 513 /** 514 * Lists CustomJobs in a Location. 515 * 516 * <p>Sample code: 517 * 518 * <pre>{@code 519 * // This snippet has been automatically generated and should be regarded as a code template only. 520 * // It will require modifications to work: 521 * // - It may require correct/in-range values for request initialization. 522 * // - It may require specifying regional endpoints when creating the service client as shown in 523 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 524 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 525 * ListCustomJobsRequest request = 526 * ListCustomJobsRequest.newBuilder() 527 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 528 * .setFilter("filter-1274492040") 529 * .setPageSize(883849137) 530 * .setPageToken("pageToken873572522") 531 * .setReadMask(FieldMask.newBuilder().build()) 532 * .build(); 533 * ApiFuture<CustomJob> future = 534 * jobServiceClient.listCustomJobsPagedCallable().futureCall(request); 535 * // Do something. 536 * for (CustomJob element : future.get().iterateAll()) { 537 * // doThingsWith(element); 538 * } 539 * } 540 * }</pre> 541 */ 542 public final UnaryCallable<ListCustomJobsRequest, ListCustomJobsPagedResponse> listCustomJobsPagedCallable()543 listCustomJobsPagedCallable() { 544 return stub.listCustomJobsPagedCallable(); 545 } 546 547 // AUTO-GENERATED DOCUMENTATION AND METHOD. 548 /** 549 * Lists CustomJobs in a Location. 550 * 551 * <p>Sample code: 552 * 553 * <pre>{@code 554 * // This snippet has been automatically generated and should be regarded as a code template only. 555 * // It will require modifications to work: 556 * // - It may require correct/in-range values for request initialization. 557 * // - It may require specifying regional endpoints when creating the service client as shown in 558 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 559 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 560 * ListCustomJobsRequest request = 561 * ListCustomJobsRequest.newBuilder() 562 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 563 * .setFilter("filter-1274492040") 564 * .setPageSize(883849137) 565 * .setPageToken("pageToken873572522") 566 * .setReadMask(FieldMask.newBuilder().build()) 567 * .build(); 568 * while (true) { 569 * ListCustomJobsResponse response = jobServiceClient.listCustomJobsCallable().call(request); 570 * for (CustomJob element : response.getCustomJobsList()) { 571 * // doThingsWith(element); 572 * } 573 * String nextPageToken = response.getNextPageToken(); 574 * if (!Strings.isNullOrEmpty(nextPageToken)) { 575 * request = request.toBuilder().setPageToken(nextPageToken).build(); 576 * } else { 577 * break; 578 * } 579 * } 580 * } 581 * }</pre> 582 */ 583 public final UnaryCallable<ListCustomJobsRequest, ListCustomJobsResponse> listCustomJobsCallable()584 listCustomJobsCallable() { 585 return stub.listCustomJobsCallable(); 586 } 587 588 // AUTO-GENERATED DOCUMENTATION AND METHOD. 589 /** 590 * Deletes a CustomJob. 591 * 592 * <p>Sample code: 593 * 594 * <pre>{@code 595 * // This snippet has been automatically generated and should be regarded as a code template only. 596 * // It will require modifications to work: 597 * // - It may require correct/in-range values for request initialization. 598 * // - It may require specifying regional endpoints when creating the service client as shown in 599 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 600 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 601 * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]"); 602 * jobServiceClient.deleteCustomJobAsync(name).get(); 603 * } 604 * }</pre> 605 * 606 * @param name Required. The name of the CustomJob resource to be deleted. Format: 607 * `projects/{project}/locations/{location}/customJobs/{custom_job}` 608 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 609 */ deleteCustomJobAsync( CustomJobName name)610 public final OperationFuture<Empty, DeleteOperationMetadata> deleteCustomJobAsync( 611 CustomJobName name) { 612 DeleteCustomJobRequest request = 613 DeleteCustomJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 614 return deleteCustomJobAsync(request); 615 } 616 617 // AUTO-GENERATED DOCUMENTATION AND METHOD. 618 /** 619 * Deletes a CustomJob. 620 * 621 * <p>Sample code: 622 * 623 * <pre>{@code 624 * // This snippet has been automatically generated and should be regarded as a code template only. 625 * // It will require modifications to work: 626 * // - It may require correct/in-range values for request initialization. 627 * // - It may require specifying regional endpoints when creating the service client as shown in 628 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 629 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 630 * String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString(); 631 * jobServiceClient.deleteCustomJobAsync(name).get(); 632 * } 633 * }</pre> 634 * 635 * @param name Required. The name of the CustomJob resource to be deleted. Format: 636 * `projects/{project}/locations/{location}/customJobs/{custom_job}` 637 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 638 */ deleteCustomJobAsync(String name)639 public final OperationFuture<Empty, DeleteOperationMetadata> deleteCustomJobAsync(String name) { 640 DeleteCustomJobRequest request = DeleteCustomJobRequest.newBuilder().setName(name).build(); 641 return deleteCustomJobAsync(request); 642 } 643 644 // AUTO-GENERATED DOCUMENTATION AND METHOD. 645 /** 646 * Deletes a CustomJob. 647 * 648 * <p>Sample code: 649 * 650 * <pre>{@code 651 * // This snippet has been automatically generated and should be regarded as a code template only. 652 * // It will require modifications to work: 653 * // - It may require correct/in-range values for request initialization. 654 * // - It may require specifying regional endpoints when creating the service client as shown in 655 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 656 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 657 * DeleteCustomJobRequest request = 658 * DeleteCustomJobRequest.newBuilder() 659 * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) 660 * .build(); 661 * jobServiceClient.deleteCustomJobAsync(request).get(); 662 * } 663 * }</pre> 664 * 665 * @param request The request object containing all of the parameters for the API call. 666 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 667 */ deleteCustomJobAsync( DeleteCustomJobRequest request)668 public final OperationFuture<Empty, DeleteOperationMetadata> deleteCustomJobAsync( 669 DeleteCustomJobRequest request) { 670 return deleteCustomJobOperationCallable().futureCall(request); 671 } 672 673 // AUTO-GENERATED DOCUMENTATION AND METHOD. 674 /** 675 * Deletes a CustomJob. 676 * 677 * <p>Sample code: 678 * 679 * <pre>{@code 680 * // This snippet has been automatically generated and should be regarded as a code template only. 681 * // It will require modifications to work: 682 * // - It may require correct/in-range values for request initialization. 683 * // - It may require specifying regional endpoints when creating the service client as shown in 684 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 685 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 686 * DeleteCustomJobRequest request = 687 * DeleteCustomJobRequest.newBuilder() 688 * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) 689 * .build(); 690 * OperationFuture<Empty, DeleteOperationMetadata> future = 691 * jobServiceClient.deleteCustomJobOperationCallable().futureCall(request); 692 * // Do something. 693 * future.get(); 694 * } 695 * }</pre> 696 */ 697 public final OperationCallable<DeleteCustomJobRequest, Empty, DeleteOperationMetadata> deleteCustomJobOperationCallable()698 deleteCustomJobOperationCallable() { 699 return stub.deleteCustomJobOperationCallable(); 700 } 701 702 // AUTO-GENERATED DOCUMENTATION AND METHOD. 703 /** 704 * Deletes a CustomJob. 705 * 706 * <p>Sample code: 707 * 708 * <pre>{@code 709 * // This snippet has been automatically generated and should be regarded as a code template only. 710 * // It will require modifications to work: 711 * // - It may require correct/in-range values for request initialization. 712 * // - It may require specifying regional endpoints when creating the service client as shown in 713 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 714 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 715 * DeleteCustomJobRequest request = 716 * DeleteCustomJobRequest.newBuilder() 717 * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) 718 * .build(); 719 * ApiFuture<Operation> future = jobServiceClient.deleteCustomJobCallable().futureCall(request); 720 * // Do something. 721 * future.get(); 722 * } 723 * }</pre> 724 */ deleteCustomJobCallable()725 public final UnaryCallable<DeleteCustomJobRequest, Operation> deleteCustomJobCallable() { 726 return stub.deleteCustomJobCallable(); 727 } 728 729 // AUTO-GENERATED DOCUMENTATION AND METHOD. 730 /** 731 * Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best 732 * effort to cancel the job, but success is not guaranteed. Clients can use 733 * [JobService.GetCustomJob][google.cloud.aiplatform.v1beta1.JobService.GetCustomJob] or other 734 * methods to check whether the cancellation succeeded or whether the job completed despite 735 * cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a 736 * job with a [CustomJob.error][google.cloud.aiplatform.v1beta1.CustomJob.error] value with a 737 * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and 738 * [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to `CANCELLED`. 739 * 740 * <p>Sample code: 741 * 742 * <pre>{@code 743 * // This snippet has been automatically generated and should be regarded as a code template only. 744 * // It will require modifications to work: 745 * // - It may require correct/in-range values for request initialization. 746 * // - It may require specifying regional endpoints when creating the service client as shown in 747 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 748 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 749 * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]"); 750 * jobServiceClient.cancelCustomJob(name); 751 * } 752 * }</pre> 753 * 754 * @param name Required. The name of the CustomJob to cancel. Format: 755 * `projects/{project}/locations/{location}/customJobs/{custom_job}` 756 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 757 */ cancelCustomJob(CustomJobName name)758 public final void cancelCustomJob(CustomJobName name) { 759 CancelCustomJobRequest request = 760 CancelCustomJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 761 cancelCustomJob(request); 762 } 763 764 // AUTO-GENERATED DOCUMENTATION AND METHOD. 765 /** 766 * Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best 767 * effort to cancel the job, but success is not guaranteed. Clients can use 768 * [JobService.GetCustomJob][google.cloud.aiplatform.v1beta1.JobService.GetCustomJob] or other 769 * methods to check whether the cancellation succeeded or whether the job completed despite 770 * cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a 771 * job with a [CustomJob.error][google.cloud.aiplatform.v1beta1.CustomJob.error] value with a 772 * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and 773 * [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to `CANCELLED`. 774 * 775 * <p>Sample code: 776 * 777 * <pre>{@code 778 * // This snippet has been automatically generated and should be regarded as a code template only. 779 * // It will require modifications to work: 780 * // - It may require correct/in-range values for request initialization. 781 * // - It may require specifying regional endpoints when creating the service client as shown in 782 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 783 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 784 * String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString(); 785 * jobServiceClient.cancelCustomJob(name); 786 * } 787 * }</pre> 788 * 789 * @param name Required. The name of the CustomJob to cancel. Format: 790 * `projects/{project}/locations/{location}/customJobs/{custom_job}` 791 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 792 */ cancelCustomJob(String name)793 public final void cancelCustomJob(String name) { 794 CancelCustomJobRequest request = CancelCustomJobRequest.newBuilder().setName(name).build(); 795 cancelCustomJob(request); 796 } 797 798 // AUTO-GENERATED DOCUMENTATION AND METHOD. 799 /** 800 * Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best 801 * effort to cancel the job, but success is not guaranteed. Clients can use 802 * [JobService.GetCustomJob][google.cloud.aiplatform.v1beta1.JobService.GetCustomJob] or other 803 * methods to check whether the cancellation succeeded or whether the job completed despite 804 * cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a 805 * job with a [CustomJob.error][google.cloud.aiplatform.v1beta1.CustomJob.error] value with a 806 * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and 807 * [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to `CANCELLED`. 808 * 809 * <p>Sample code: 810 * 811 * <pre>{@code 812 * // This snippet has been automatically generated and should be regarded as a code template only. 813 * // It will require modifications to work: 814 * // - It may require correct/in-range values for request initialization. 815 * // - It may require specifying regional endpoints when creating the service client as shown in 816 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 817 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 818 * CancelCustomJobRequest request = 819 * CancelCustomJobRequest.newBuilder() 820 * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) 821 * .build(); 822 * jobServiceClient.cancelCustomJob(request); 823 * } 824 * }</pre> 825 * 826 * @param request The request object containing all of the parameters for the API call. 827 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 828 */ cancelCustomJob(CancelCustomJobRequest request)829 public final void cancelCustomJob(CancelCustomJobRequest request) { 830 cancelCustomJobCallable().call(request); 831 } 832 833 // AUTO-GENERATED DOCUMENTATION AND METHOD. 834 /** 835 * Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best 836 * effort to cancel the job, but success is not guaranteed. Clients can use 837 * [JobService.GetCustomJob][google.cloud.aiplatform.v1beta1.JobService.GetCustomJob] or other 838 * methods to check whether the cancellation succeeded or whether the job completed despite 839 * cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a 840 * job with a [CustomJob.error][google.cloud.aiplatform.v1beta1.CustomJob.error] value with a 841 * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and 842 * [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to `CANCELLED`. 843 * 844 * <p>Sample code: 845 * 846 * <pre>{@code 847 * // This snippet has been automatically generated and should be regarded as a code template only. 848 * // It will require modifications to work: 849 * // - It may require correct/in-range values for request initialization. 850 * // - It may require specifying regional endpoints when creating the service client as shown in 851 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 852 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 853 * CancelCustomJobRequest request = 854 * CancelCustomJobRequest.newBuilder() 855 * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) 856 * .build(); 857 * ApiFuture<Empty> future = jobServiceClient.cancelCustomJobCallable().futureCall(request); 858 * // Do something. 859 * future.get(); 860 * } 861 * }</pre> 862 */ cancelCustomJobCallable()863 public final UnaryCallable<CancelCustomJobRequest, Empty> cancelCustomJobCallable() { 864 return stub.cancelCustomJobCallable(); 865 } 866 867 // AUTO-GENERATED DOCUMENTATION AND METHOD. 868 /** 869 * Creates a DataLabelingJob. 870 * 871 * <p>Sample code: 872 * 873 * <pre>{@code 874 * // This snippet has been automatically generated and should be regarded as a code template only. 875 * // It will require modifications to work: 876 * // - It may require correct/in-range values for request initialization. 877 * // - It may require specifying regional endpoints when creating the service client as shown in 878 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 879 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 880 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 881 * DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build(); 882 * DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob); 883 * } 884 * }</pre> 885 * 886 * @param parent Required. The parent of the DataLabelingJob. Format: 887 * `projects/{project}/locations/{location}` 888 * @param dataLabelingJob Required. The DataLabelingJob to create. 889 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 890 */ createDataLabelingJob( LocationName parent, DataLabelingJob dataLabelingJob)891 public final DataLabelingJob createDataLabelingJob( 892 LocationName parent, DataLabelingJob dataLabelingJob) { 893 CreateDataLabelingJobRequest request = 894 CreateDataLabelingJobRequest.newBuilder() 895 .setParent(parent == null ? null : parent.toString()) 896 .setDataLabelingJob(dataLabelingJob) 897 .build(); 898 return createDataLabelingJob(request); 899 } 900 901 // AUTO-GENERATED DOCUMENTATION AND METHOD. 902 /** 903 * Creates a DataLabelingJob. 904 * 905 * <p>Sample code: 906 * 907 * <pre>{@code 908 * // This snippet has been automatically generated and should be regarded as a code template only. 909 * // It will require modifications to work: 910 * // - It may require correct/in-range values for request initialization. 911 * // - It may require specifying regional endpoints when creating the service client as shown in 912 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 913 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 914 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 915 * DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build(); 916 * DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob); 917 * } 918 * }</pre> 919 * 920 * @param parent Required. The parent of the DataLabelingJob. Format: 921 * `projects/{project}/locations/{location}` 922 * @param dataLabelingJob Required. The DataLabelingJob to create. 923 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 924 */ createDataLabelingJob( String parent, DataLabelingJob dataLabelingJob)925 public final DataLabelingJob createDataLabelingJob( 926 String parent, DataLabelingJob dataLabelingJob) { 927 CreateDataLabelingJobRequest request = 928 CreateDataLabelingJobRequest.newBuilder() 929 .setParent(parent) 930 .setDataLabelingJob(dataLabelingJob) 931 .build(); 932 return createDataLabelingJob(request); 933 } 934 935 // AUTO-GENERATED DOCUMENTATION AND METHOD. 936 /** 937 * Creates a DataLabelingJob. 938 * 939 * <p>Sample code: 940 * 941 * <pre>{@code 942 * // This snippet has been automatically generated and should be regarded as a code template only. 943 * // It will require modifications to work: 944 * // - It may require correct/in-range values for request initialization. 945 * // - It may require specifying regional endpoints when creating the service client as shown in 946 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 947 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 948 * CreateDataLabelingJobRequest request = 949 * CreateDataLabelingJobRequest.newBuilder() 950 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 951 * .setDataLabelingJob(DataLabelingJob.newBuilder().build()) 952 * .build(); 953 * DataLabelingJob response = jobServiceClient.createDataLabelingJob(request); 954 * } 955 * }</pre> 956 * 957 * @param request The request object containing all of the parameters for the API call. 958 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 959 */ createDataLabelingJob(CreateDataLabelingJobRequest request)960 public final DataLabelingJob createDataLabelingJob(CreateDataLabelingJobRequest request) { 961 return createDataLabelingJobCallable().call(request); 962 } 963 964 // AUTO-GENERATED DOCUMENTATION AND METHOD. 965 /** 966 * Creates a DataLabelingJob. 967 * 968 * <p>Sample code: 969 * 970 * <pre>{@code 971 * // This snippet has been automatically generated and should be regarded as a code template only. 972 * // It will require modifications to work: 973 * // - It may require correct/in-range values for request initialization. 974 * // - It may require specifying regional endpoints when creating the service client as shown in 975 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 976 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 977 * CreateDataLabelingJobRequest request = 978 * CreateDataLabelingJobRequest.newBuilder() 979 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 980 * .setDataLabelingJob(DataLabelingJob.newBuilder().build()) 981 * .build(); 982 * ApiFuture<DataLabelingJob> future = 983 * jobServiceClient.createDataLabelingJobCallable().futureCall(request); 984 * // Do something. 985 * DataLabelingJob response = future.get(); 986 * } 987 * }</pre> 988 */ 989 public final UnaryCallable<CreateDataLabelingJobRequest, DataLabelingJob> createDataLabelingJobCallable()990 createDataLabelingJobCallable() { 991 return stub.createDataLabelingJobCallable(); 992 } 993 994 // AUTO-GENERATED DOCUMENTATION AND METHOD. 995 /** 996 * Gets a DataLabelingJob. 997 * 998 * <p>Sample code: 999 * 1000 * <pre>{@code 1001 * // This snippet has been automatically generated and should be regarded as a code template only. 1002 * // It will require modifications to work: 1003 * // - It may require correct/in-range values for request initialization. 1004 * // - It may require specifying regional endpoints when creating the service client as shown in 1005 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1006 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1007 * DataLabelingJobName name = 1008 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]"); 1009 * DataLabelingJob response = jobServiceClient.getDataLabelingJob(name); 1010 * } 1011 * }</pre> 1012 * 1013 * @param name Required. The name of the DataLabelingJob. Format: 1014 * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` 1015 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1016 */ getDataLabelingJob(DataLabelingJobName name)1017 public final DataLabelingJob getDataLabelingJob(DataLabelingJobName name) { 1018 GetDataLabelingJobRequest request = 1019 GetDataLabelingJobRequest.newBuilder() 1020 .setName(name == null ? null : name.toString()) 1021 .build(); 1022 return getDataLabelingJob(request); 1023 } 1024 1025 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1026 /** 1027 * Gets a DataLabelingJob. 1028 * 1029 * <p>Sample code: 1030 * 1031 * <pre>{@code 1032 * // This snippet has been automatically generated and should be regarded as a code template only. 1033 * // It will require modifications to work: 1034 * // - It may require correct/in-range values for request initialization. 1035 * // - It may require specifying regional endpoints when creating the service client as shown in 1036 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1037 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1038 * String name = 1039 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString(); 1040 * DataLabelingJob response = jobServiceClient.getDataLabelingJob(name); 1041 * } 1042 * }</pre> 1043 * 1044 * @param name Required. The name of the DataLabelingJob. Format: 1045 * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` 1046 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1047 */ getDataLabelingJob(String name)1048 public final DataLabelingJob getDataLabelingJob(String name) { 1049 GetDataLabelingJobRequest request = 1050 GetDataLabelingJobRequest.newBuilder().setName(name).build(); 1051 return getDataLabelingJob(request); 1052 } 1053 1054 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1055 /** 1056 * Gets a DataLabelingJob. 1057 * 1058 * <p>Sample code: 1059 * 1060 * <pre>{@code 1061 * // This snippet has been automatically generated and should be regarded as a code template only. 1062 * // It will require modifications to work: 1063 * // - It may require correct/in-range values for request initialization. 1064 * // - It may require specifying regional endpoints when creating the service client as shown in 1065 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1066 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1067 * GetDataLabelingJobRequest request = 1068 * GetDataLabelingJobRequest.newBuilder() 1069 * .setName( 1070 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") 1071 * .toString()) 1072 * .build(); 1073 * DataLabelingJob response = jobServiceClient.getDataLabelingJob(request); 1074 * } 1075 * }</pre> 1076 * 1077 * @param request The request object containing all of the parameters for the API call. 1078 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1079 */ getDataLabelingJob(GetDataLabelingJobRequest request)1080 public final DataLabelingJob getDataLabelingJob(GetDataLabelingJobRequest request) { 1081 return getDataLabelingJobCallable().call(request); 1082 } 1083 1084 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1085 /** 1086 * Gets a DataLabelingJob. 1087 * 1088 * <p>Sample code: 1089 * 1090 * <pre>{@code 1091 * // This snippet has been automatically generated and should be regarded as a code template only. 1092 * // It will require modifications to work: 1093 * // - It may require correct/in-range values for request initialization. 1094 * // - It may require specifying regional endpoints when creating the service client as shown in 1095 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1096 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1097 * GetDataLabelingJobRequest request = 1098 * GetDataLabelingJobRequest.newBuilder() 1099 * .setName( 1100 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") 1101 * .toString()) 1102 * .build(); 1103 * ApiFuture<DataLabelingJob> future = 1104 * jobServiceClient.getDataLabelingJobCallable().futureCall(request); 1105 * // Do something. 1106 * DataLabelingJob response = future.get(); 1107 * } 1108 * }</pre> 1109 */ 1110 public final UnaryCallable<GetDataLabelingJobRequest, DataLabelingJob> getDataLabelingJobCallable()1111 getDataLabelingJobCallable() { 1112 return stub.getDataLabelingJobCallable(); 1113 } 1114 1115 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1116 /** 1117 * Lists DataLabelingJobs in a Location. 1118 * 1119 * <p>Sample code: 1120 * 1121 * <pre>{@code 1122 * // This snippet has been automatically generated and should be regarded as a code template only. 1123 * // It will require modifications to work: 1124 * // - It may require correct/in-range values for request initialization. 1125 * // - It may require specifying regional endpoints when creating the service client as shown in 1126 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1127 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1128 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 1129 * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) { 1130 * // doThingsWith(element); 1131 * } 1132 * } 1133 * }</pre> 1134 * 1135 * @param parent Required. The parent of the DataLabelingJob. Format: 1136 * `projects/{project}/locations/{location}` 1137 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1138 */ listDataLabelingJobs(LocationName parent)1139 public final ListDataLabelingJobsPagedResponse listDataLabelingJobs(LocationName parent) { 1140 ListDataLabelingJobsRequest request = 1141 ListDataLabelingJobsRequest.newBuilder() 1142 .setParent(parent == null ? null : parent.toString()) 1143 .build(); 1144 return listDataLabelingJobs(request); 1145 } 1146 1147 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1148 /** 1149 * Lists DataLabelingJobs in a Location. 1150 * 1151 * <p>Sample code: 1152 * 1153 * <pre>{@code 1154 * // This snippet has been automatically generated and should be regarded as a code template only. 1155 * // It will require modifications to work: 1156 * // - It may require correct/in-range values for request initialization. 1157 * // - It may require specifying regional endpoints when creating the service client as shown in 1158 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1159 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1160 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 1161 * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) { 1162 * // doThingsWith(element); 1163 * } 1164 * } 1165 * }</pre> 1166 * 1167 * @param parent Required. The parent of the DataLabelingJob. Format: 1168 * `projects/{project}/locations/{location}` 1169 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1170 */ listDataLabelingJobs(String parent)1171 public final ListDataLabelingJobsPagedResponse listDataLabelingJobs(String parent) { 1172 ListDataLabelingJobsRequest request = 1173 ListDataLabelingJobsRequest.newBuilder().setParent(parent).build(); 1174 return listDataLabelingJobs(request); 1175 } 1176 1177 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1178 /** 1179 * Lists DataLabelingJobs in a Location. 1180 * 1181 * <p>Sample code: 1182 * 1183 * <pre>{@code 1184 * // This snippet has been automatically generated and should be regarded as a code template only. 1185 * // It will require modifications to work: 1186 * // - It may require correct/in-range values for request initialization. 1187 * // - It may require specifying regional endpoints when creating the service client as shown in 1188 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1189 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1190 * ListDataLabelingJobsRequest request = 1191 * ListDataLabelingJobsRequest.newBuilder() 1192 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1193 * .setFilter("filter-1274492040") 1194 * .setPageSize(883849137) 1195 * .setPageToken("pageToken873572522") 1196 * .setReadMask(FieldMask.newBuilder().build()) 1197 * .setOrderBy("orderBy-1207110587") 1198 * .build(); 1199 * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(request).iterateAll()) { 1200 * // doThingsWith(element); 1201 * } 1202 * } 1203 * }</pre> 1204 * 1205 * @param request The request object containing all of the parameters for the API call. 1206 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1207 */ listDataLabelingJobs( ListDataLabelingJobsRequest request)1208 public final ListDataLabelingJobsPagedResponse listDataLabelingJobs( 1209 ListDataLabelingJobsRequest request) { 1210 return listDataLabelingJobsPagedCallable().call(request); 1211 } 1212 1213 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1214 /** 1215 * Lists DataLabelingJobs in a Location. 1216 * 1217 * <p>Sample code: 1218 * 1219 * <pre>{@code 1220 * // This snippet has been automatically generated and should be regarded as a code template only. 1221 * // It will require modifications to work: 1222 * // - It may require correct/in-range values for request initialization. 1223 * // - It may require specifying regional endpoints when creating the service client as shown in 1224 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1225 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1226 * ListDataLabelingJobsRequest request = 1227 * ListDataLabelingJobsRequest.newBuilder() 1228 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1229 * .setFilter("filter-1274492040") 1230 * .setPageSize(883849137) 1231 * .setPageToken("pageToken873572522") 1232 * .setReadMask(FieldMask.newBuilder().build()) 1233 * .setOrderBy("orderBy-1207110587") 1234 * .build(); 1235 * ApiFuture<DataLabelingJob> future = 1236 * jobServiceClient.listDataLabelingJobsPagedCallable().futureCall(request); 1237 * // Do something. 1238 * for (DataLabelingJob element : future.get().iterateAll()) { 1239 * // doThingsWith(element); 1240 * } 1241 * } 1242 * }</pre> 1243 */ 1244 public final UnaryCallable<ListDataLabelingJobsRequest, ListDataLabelingJobsPagedResponse> listDataLabelingJobsPagedCallable()1245 listDataLabelingJobsPagedCallable() { 1246 return stub.listDataLabelingJobsPagedCallable(); 1247 } 1248 1249 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1250 /** 1251 * Lists DataLabelingJobs in a Location. 1252 * 1253 * <p>Sample code: 1254 * 1255 * <pre>{@code 1256 * // This snippet has been automatically generated and should be regarded as a code template only. 1257 * // It will require modifications to work: 1258 * // - It may require correct/in-range values for request initialization. 1259 * // - It may require specifying regional endpoints when creating the service client as shown in 1260 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1261 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1262 * ListDataLabelingJobsRequest request = 1263 * ListDataLabelingJobsRequest.newBuilder() 1264 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1265 * .setFilter("filter-1274492040") 1266 * .setPageSize(883849137) 1267 * .setPageToken("pageToken873572522") 1268 * .setReadMask(FieldMask.newBuilder().build()) 1269 * .setOrderBy("orderBy-1207110587") 1270 * .build(); 1271 * while (true) { 1272 * ListDataLabelingJobsResponse response = 1273 * jobServiceClient.listDataLabelingJobsCallable().call(request); 1274 * for (DataLabelingJob element : response.getDataLabelingJobsList()) { 1275 * // doThingsWith(element); 1276 * } 1277 * String nextPageToken = response.getNextPageToken(); 1278 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1279 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1280 * } else { 1281 * break; 1282 * } 1283 * } 1284 * } 1285 * }</pre> 1286 */ 1287 public final UnaryCallable<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse> listDataLabelingJobsCallable()1288 listDataLabelingJobsCallable() { 1289 return stub.listDataLabelingJobsCallable(); 1290 } 1291 1292 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1293 /** 1294 * Deletes a DataLabelingJob. 1295 * 1296 * <p>Sample code: 1297 * 1298 * <pre>{@code 1299 * // This snippet has been automatically generated and should be regarded as a code template only. 1300 * // It will require modifications to work: 1301 * // - It may require correct/in-range values for request initialization. 1302 * // - It may require specifying regional endpoints when creating the service client as shown in 1303 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1304 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1305 * DataLabelingJobName name = 1306 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]"); 1307 * jobServiceClient.deleteDataLabelingJobAsync(name).get(); 1308 * } 1309 * }</pre> 1310 * 1311 * @param name Required. The name of the DataLabelingJob to be deleted. Format: 1312 * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` 1313 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1314 */ deleteDataLabelingJobAsync( DataLabelingJobName name)1315 public final OperationFuture<Empty, DeleteOperationMetadata> deleteDataLabelingJobAsync( 1316 DataLabelingJobName name) { 1317 DeleteDataLabelingJobRequest request = 1318 DeleteDataLabelingJobRequest.newBuilder() 1319 .setName(name == null ? null : name.toString()) 1320 .build(); 1321 return deleteDataLabelingJobAsync(request); 1322 } 1323 1324 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1325 /** 1326 * Deletes a DataLabelingJob. 1327 * 1328 * <p>Sample code: 1329 * 1330 * <pre>{@code 1331 * // This snippet has been automatically generated and should be regarded as a code template only. 1332 * // It will require modifications to work: 1333 * // - It may require correct/in-range values for request initialization. 1334 * // - It may require specifying regional endpoints when creating the service client as shown in 1335 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1336 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1337 * String name = 1338 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString(); 1339 * jobServiceClient.deleteDataLabelingJobAsync(name).get(); 1340 * } 1341 * }</pre> 1342 * 1343 * @param name Required. The name of the DataLabelingJob to be deleted. Format: 1344 * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` 1345 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1346 */ deleteDataLabelingJobAsync( String name)1347 public final OperationFuture<Empty, DeleteOperationMetadata> deleteDataLabelingJobAsync( 1348 String name) { 1349 DeleteDataLabelingJobRequest request = 1350 DeleteDataLabelingJobRequest.newBuilder().setName(name).build(); 1351 return deleteDataLabelingJobAsync(request); 1352 } 1353 1354 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1355 /** 1356 * Deletes a DataLabelingJob. 1357 * 1358 * <p>Sample code: 1359 * 1360 * <pre>{@code 1361 * // This snippet has been automatically generated and should be regarded as a code template only. 1362 * // It will require modifications to work: 1363 * // - It may require correct/in-range values for request initialization. 1364 * // - It may require specifying regional endpoints when creating the service client as shown in 1365 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1366 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1367 * DeleteDataLabelingJobRequest request = 1368 * DeleteDataLabelingJobRequest.newBuilder() 1369 * .setName( 1370 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") 1371 * .toString()) 1372 * .build(); 1373 * jobServiceClient.deleteDataLabelingJobAsync(request).get(); 1374 * } 1375 * }</pre> 1376 * 1377 * @param request The request object containing all of the parameters for the API call. 1378 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1379 */ deleteDataLabelingJobAsync( DeleteDataLabelingJobRequest request)1380 public final OperationFuture<Empty, DeleteOperationMetadata> deleteDataLabelingJobAsync( 1381 DeleteDataLabelingJobRequest request) { 1382 return deleteDataLabelingJobOperationCallable().futureCall(request); 1383 } 1384 1385 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1386 /** 1387 * Deletes a DataLabelingJob. 1388 * 1389 * <p>Sample code: 1390 * 1391 * <pre>{@code 1392 * // This snippet has been automatically generated and should be regarded as a code template only. 1393 * // It will require modifications to work: 1394 * // - It may require correct/in-range values for request initialization. 1395 * // - It may require specifying regional endpoints when creating the service client as shown in 1396 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1397 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1398 * DeleteDataLabelingJobRequest request = 1399 * DeleteDataLabelingJobRequest.newBuilder() 1400 * .setName( 1401 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") 1402 * .toString()) 1403 * .build(); 1404 * OperationFuture<Empty, DeleteOperationMetadata> future = 1405 * jobServiceClient.deleteDataLabelingJobOperationCallable().futureCall(request); 1406 * // Do something. 1407 * future.get(); 1408 * } 1409 * }</pre> 1410 */ 1411 public final OperationCallable<DeleteDataLabelingJobRequest, Empty, DeleteOperationMetadata> deleteDataLabelingJobOperationCallable()1412 deleteDataLabelingJobOperationCallable() { 1413 return stub.deleteDataLabelingJobOperationCallable(); 1414 } 1415 1416 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1417 /** 1418 * Deletes a DataLabelingJob. 1419 * 1420 * <p>Sample code: 1421 * 1422 * <pre>{@code 1423 * // This snippet has been automatically generated and should be regarded as a code template only. 1424 * // It will require modifications to work: 1425 * // - It may require correct/in-range values for request initialization. 1426 * // - It may require specifying regional endpoints when creating the service client as shown in 1427 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1428 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1429 * DeleteDataLabelingJobRequest request = 1430 * DeleteDataLabelingJobRequest.newBuilder() 1431 * .setName( 1432 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") 1433 * .toString()) 1434 * .build(); 1435 * ApiFuture<Operation> future = 1436 * jobServiceClient.deleteDataLabelingJobCallable().futureCall(request); 1437 * // Do something. 1438 * future.get(); 1439 * } 1440 * }</pre> 1441 */ 1442 public final UnaryCallable<DeleteDataLabelingJobRequest, Operation> deleteDataLabelingJobCallable()1443 deleteDataLabelingJobCallable() { 1444 return stub.deleteDataLabelingJobCallable(); 1445 } 1446 1447 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1448 /** 1449 * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. 1450 * 1451 * <p>Sample code: 1452 * 1453 * <pre>{@code 1454 * // This snippet has been automatically generated and should be regarded as a code template only. 1455 * // It will require modifications to work: 1456 * // - It may require correct/in-range values for request initialization. 1457 * // - It may require specifying regional endpoints when creating the service client as shown in 1458 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1459 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1460 * DataLabelingJobName name = 1461 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]"); 1462 * jobServiceClient.cancelDataLabelingJob(name); 1463 * } 1464 * }</pre> 1465 * 1466 * @param name Required. The name of the DataLabelingJob. Format: 1467 * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` 1468 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1469 */ cancelDataLabelingJob(DataLabelingJobName name)1470 public final void cancelDataLabelingJob(DataLabelingJobName name) { 1471 CancelDataLabelingJobRequest request = 1472 CancelDataLabelingJobRequest.newBuilder() 1473 .setName(name == null ? null : name.toString()) 1474 .build(); 1475 cancelDataLabelingJob(request); 1476 } 1477 1478 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1479 /** 1480 * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. 1481 * 1482 * <p>Sample code: 1483 * 1484 * <pre>{@code 1485 * // This snippet has been automatically generated and should be regarded as a code template only. 1486 * // It will require modifications to work: 1487 * // - It may require correct/in-range values for request initialization. 1488 * // - It may require specifying regional endpoints when creating the service client as shown in 1489 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1490 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1491 * String name = 1492 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString(); 1493 * jobServiceClient.cancelDataLabelingJob(name); 1494 * } 1495 * }</pre> 1496 * 1497 * @param name Required. The name of the DataLabelingJob. Format: 1498 * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` 1499 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1500 */ cancelDataLabelingJob(String name)1501 public final void cancelDataLabelingJob(String name) { 1502 CancelDataLabelingJobRequest request = 1503 CancelDataLabelingJobRequest.newBuilder().setName(name).build(); 1504 cancelDataLabelingJob(request); 1505 } 1506 1507 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1508 /** 1509 * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. 1510 * 1511 * <p>Sample code: 1512 * 1513 * <pre>{@code 1514 * // This snippet has been automatically generated and should be regarded as a code template only. 1515 * // It will require modifications to work: 1516 * // - It may require correct/in-range values for request initialization. 1517 * // - It may require specifying regional endpoints when creating the service client as shown in 1518 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1519 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1520 * CancelDataLabelingJobRequest request = 1521 * CancelDataLabelingJobRequest.newBuilder() 1522 * .setName( 1523 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") 1524 * .toString()) 1525 * .build(); 1526 * jobServiceClient.cancelDataLabelingJob(request); 1527 * } 1528 * }</pre> 1529 * 1530 * @param request The request object containing all of the parameters for the API call. 1531 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1532 */ cancelDataLabelingJob(CancelDataLabelingJobRequest request)1533 public final void cancelDataLabelingJob(CancelDataLabelingJobRequest request) { 1534 cancelDataLabelingJobCallable().call(request); 1535 } 1536 1537 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1538 /** 1539 * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. 1540 * 1541 * <p>Sample code: 1542 * 1543 * <pre>{@code 1544 * // This snippet has been automatically generated and should be regarded as a code template only. 1545 * // It will require modifications to work: 1546 * // - It may require correct/in-range values for request initialization. 1547 * // - It may require specifying regional endpoints when creating the service client as shown in 1548 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1549 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1550 * CancelDataLabelingJobRequest request = 1551 * CancelDataLabelingJobRequest.newBuilder() 1552 * .setName( 1553 * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") 1554 * .toString()) 1555 * .build(); 1556 * ApiFuture<Empty> future = 1557 * jobServiceClient.cancelDataLabelingJobCallable().futureCall(request); 1558 * // Do something. 1559 * future.get(); 1560 * } 1561 * }</pre> 1562 */ cancelDataLabelingJobCallable()1563 public final UnaryCallable<CancelDataLabelingJobRequest, Empty> cancelDataLabelingJobCallable() { 1564 return stub.cancelDataLabelingJobCallable(); 1565 } 1566 1567 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1568 /** 1569 * Creates a HyperparameterTuningJob 1570 * 1571 * <p>Sample code: 1572 * 1573 * <pre>{@code 1574 * // This snippet has been automatically generated and should be regarded as a code template only. 1575 * // It will require modifications to work: 1576 * // - It may require correct/in-range values for request initialization. 1577 * // - It may require specifying regional endpoints when creating the service client as shown in 1578 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1579 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1580 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 1581 * HyperparameterTuningJob hyperparameterTuningJob = 1582 * HyperparameterTuningJob.newBuilder().build(); 1583 * HyperparameterTuningJob response = 1584 * jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob); 1585 * } 1586 * }</pre> 1587 * 1588 * @param parent Required. The resource name of the Location to create the HyperparameterTuningJob 1589 * in. Format: `projects/{project}/locations/{location}` 1590 * @param hyperparameterTuningJob Required. The HyperparameterTuningJob to create. 1591 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1592 */ createHyperparameterTuningJob( LocationName parent, HyperparameterTuningJob hyperparameterTuningJob)1593 public final HyperparameterTuningJob createHyperparameterTuningJob( 1594 LocationName parent, HyperparameterTuningJob hyperparameterTuningJob) { 1595 CreateHyperparameterTuningJobRequest request = 1596 CreateHyperparameterTuningJobRequest.newBuilder() 1597 .setParent(parent == null ? null : parent.toString()) 1598 .setHyperparameterTuningJob(hyperparameterTuningJob) 1599 .build(); 1600 return createHyperparameterTuningJob(request); 1601 } 1602 1603 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1604 /** 1605 * Creates a HyperparameterTuningJob 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 (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1616 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 1617 * HyperparameterTuningJob hyperparameterTuningJob = 1618 * HyperparameterTuningJob.newBuilder().build(); 1619 * HyperparameterTuningJob response = 1620 * jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob); 1621 * } 1622 * }</pre> 1623 * 1624 * @param parent Required. The resource name of the Location to create the HyperparameterTuningJob 1625 * in. Format: `projects/{project}/locations/{location}` 1626 * @param hyperparameterTuningJob Required. The HyperparameterTuningJob to create. 1627 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1628 */ createHyperparameterTuningJob( String parent, HyperparameterTuningJob hyperparameterTuningJob)1629 public final HyperparameterTuningJob createHyperparameterTuningJob( 1630 String parent, HyperparameterTuningJob hyperparameterTuningJob) { 1631 CreateHyperparameterTuningJobRequest request = 1632 CreateHyperparameterTuningJobRequest.newBuilder() 1633 .setParent(parent) 1634 .setHyperparameterTuningJob(hyperparameterTuningJob) 1635 .build(); 1636 return createHyperparameterTuningJob(request); 1637 } 1638 1639 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1640 /** 1641 * Creates a HyperparameterTuningJob 1642 * 1643 * <p>Sample code: 1644 * 1645 * <pre>{@code 1646 * // This snippet has been automatically generated and should be regarded as a code template only. 1647 * // It will require modifications to work: 1648 * // - It may require correct/in-range values for request initialization. 1649 * // - It may require specifying regional endpoints when creating the service client as shown in 1650 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1651 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1652 * CreateHyperparameterTuningJobRequest request = 1653 * CreateHyperparameterTuningJobRequest.newBuilder() 1654 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1655 * .setHyperparameterTuningJob(HyperparameterTuningJob.newBuilder().build()) 1656 * .build(); 1657 * HyperparameterTuningJob response = jobServiceClient.createHyperparameterTuningJob(request); 1658 * } 1659 * }</pre> 1660 * 1661 * @param request The request object containing all of the parameters for the API call. 1662 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1663 */ createHyperparameterTuningJob( CreateHyperparameterTuningJobRequest request)1664 public final HyperparameterTuningJob createHyperparameterTuningJob( 1665 CreateHyperparameterTuningJobRequest request) { 1666 return createHyperparameterTuningJobCallable().call(request); 1667 } 1668 1669 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1670 /** 1671 * Creates a HyperparameterTuningJob 1672 * 1673 * <p>Sample code: 1674 * 1675 * <pre>{@code 1676 * // This snippet has been automatically generated and should be regarded as a code template only. 1677 * // It will require modifications to work: 1678 * // - It may require correct/in-range values for request initialization. 1679 * // - It may require specifying regional endpoints when creating the service client as shown in 1680 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1681 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1682 * CreateHyperparameterTuningJobRequest request = 1683 * CreateHyperparameterTuningJobRequest.newBuilder() 1684 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1685 * .setHyperparameterTuningJob(HyperparameterTuningJob.newBuilder().build()) 1686 * .build(); 1687 * ApiFuture<HyperparameterTuningJob> future = 1688 * jobServiceClient.createHyperparameterTuningJobCallable().futureCall(request); 1689 * // Do something. 1690 * HyperparameterTuningJob response = future.get(); 1691 * } 1692 * }</pre> 1693 */ 1694 public final UnaryCallable<CreateHyperparameterTuningJobRequest, HyperparameterTuningJob> createHyperparameterTuningJobCallable()1695 createHyperparameterTuningJobCallable() { 1696 return stub.createHyperparameterTuningJobCallable(); 1697 } 1698 1699 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1700 /** 1701 * Gets a HyperparameterTuningJob 1702 * 1703 * <p>Sample code: 1704 * 1705 * <pre>{@code 1706 * // This snippet has been automatically generated and should be regarded as a code template only. 1707 * // It will require modifications to work: 1708 * // - It may require correct/in-range values for request initialization. 1709 * // - It may require specifying regional endpoints when creating the service client as shown in 1710 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1711 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1712 * HyperparameterTuningJobName name = 1713 * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]"); 1714 * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name); 1715 * } 1716 * }</pre> 1717 * 1718 * @param name Required. The name of the HyperparameterTuningJob resource. Format: 1719 * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` 1720 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1721 */ getHyperparameterTuningJob( HyperparameterTuningJobName name)1722 public final HyperparameterTuningJob getHyperparameterTuningJob( 1723 HyperparameterTuningJobName name) { 1724 GetHyperparameterTuningJobRequest request = 1725 GetHyperparameterTuningJobRequest.newBuilder() 1726 .setName(name == null ? null : name.toString()) 1727 .build(); 1728 return getHyperparameterTuningJob(request); 1729 } 1730 1731 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1732 /** 1733 * Gets a HyperparameterTuningJob 1734 * 1735 * <p>Sample code: 1736 * 1737 * <pre>{@code 1738 * // This snippet has been automatically generated and should be regarded as a code template only. 1739 * // It will require modifications to work: 1740 * // - It may require correct/in-range values for request initialization. 1741 * // - It may require specifying regional endpoints when creating the service client as shown in 1742 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1743 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1744 * String name = 1745 * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 1746 * .toString(); 1747 * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name); 1748 * } 1749 * }</pre> 1750 * 1751 * @param name Required. The name of the HyperparameterTuningJob resource. Format: 1752 * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` 1753 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1754 */ getHyperparameterTuningJob(String name)1755 public final HyperparameterTuningJob getHyperparameterTuningJob(String name) { 1756 GetHyperparameterTuningJobRequest request = 1757 GetHyperparameterTuningJobRequest.newBuilder().setName(name).build(); 1758 return getHyperparameterTuningJob(request); 1759 } 1760 1761 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1762 /** 1763 * Gets a HyperparameterTuningJob 1764 * 1765 * <p>Sample code: 1766 * 1767 * <pre>{@code 1768 * // This snippet has been automatically generated and should be regarded as a code template only. 1769 * // It will require modifications to work: 1770 * // - It may require correct/in-range values for request initialization. 1771 * // - It may require specifying regional endpoints when creating the service client as shown in 1772 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1773 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1774 * GetHyperparameterTuningJobRequest request = 1775 * GetHyperparameterTuningJobRequest.newBuilder() 1776 * .setName( 1777 * HyperparameterTuningJobName.of( 1778 * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 1779 * .toString()) 1780 * .build(); 1781 * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(request); 1782 * } 1783 * }</pre> 1784 * 1785 * @param request The request object containing all of the parameters for the API call. 1786 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1787 */ getHyperparameterTuningJob( GetHyperparameterTuningJobRequest request)1788 public final HyperparameterTuningJob getHyperparameterTuningJob( 1789 GetHyperparameterTuningJobRequest request) { 1790 return getHyperparameterTuningJobCallable().call(request); 1791 } 1792 1793 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1794 /** 1795 * Gets a HyperparameterTuningJob 1796 * 1797 * <p>Sample code: 1798 * 1799 * <pre>{@code 1800 * // This snippet has been automatically generated and should be regarded as a code template only. 1801 * // It will require modifications to work: 1802 * // - It may require correct/in-range values for request initialization. 1803 * // - It may require specifying regional endpoints when creating the service client as shown in 1804 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1805 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1806 * GetHyperparameterTuningJobRequest request = 1807 * GetHyperparameterTuningJobRequest.newBuilder() 1808 * .setName( 1809 * HyperparameterTuningJobName.of( 1810 * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 1811 * .toString()) 1812 * .build(); 1813 * ApiFuture<HyperparameterTuningJob> future = 1814 * jobServiceClient.getHyperparameterTuningJobCallable().futureCall(request); 1815 * // Do something. 1816 * HyperparameterTuningJob response = future.get(); 1817 * } 1818 * }</pre> 1819 */ 1820 public final UnaryCallable<GetHyperparameterTuningJobRequest, HyperparameterTuningJob> getHyperparameterTuningJobCallable()1821 getHyperparameterTuningJobCallable() { 1822 return stub.getHyperparameterTuningJobCallable(); 1823 } 1824 1825 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1826 /** 1827 * Lists HyperparameterTuningJobs in a Location. 1828 * 1829 * <p>Sample code: 1830 * 1831 * <pre>{@code 1832 * // This snippet has been automatically generated and should be regarded as a code template only. 1833 * // It will require modifications to work: 1834 * // - It may require correct/in-range values for request initialization. 1835 * // - It may require specifying regional endpoints when creating the service client as shown in 1836 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1837 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1838 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 1839 * for (HyperparameterTuningJob element : 1840 * jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) { 1841 * // doThingsWith(element); 1842 * } 1843 * } 1844 * }</pre> 1845 * 1846 * @param parent Required. The resource name of the Location to list the HyperparameterTuningJobs 1847 * from. Format: `projects/{project}/locations/{location}` 1848 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1849 */ listHyperparameterTuningJobs( LocationName parent)1850 public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs( 1851 LocationName parent) { 1852 ListHyperparameterTuningJobsRequest request = 1853 ListHyperparameterTuningJobsRequest.newBuilder() 1854 .setParent(parent == null ? null : parent.toString()) 1855 .build(); 1856 return listHyperparameterTuningJobs(request); 1857 } 1858 1859 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1860 /** 1861 * Lists HyperparameterTuningJobs in a Location. 1862 * 1863 * <p>Sample code: 1864 * 1865 * <pre>{@code 1866 * // This snippet has been automatically generated and should be regarded as a code template only. 1867 * // It will require modifications to work: 1868 * // - It may require correct/in-range values for request initialization. 1869 * // - It may require specifying regional endpoints when creating the service client as shown in 1870 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1871 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1872 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 1873 * for (HyperparameterTuningJob element : 1874 * jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) { 1875 * // doThingsWith(element); 1876 * } 1877 * } 1878 * }</pre> 1879 * 1880 * @param parent Required. The resource name of the Location to list the HyperparameterTuningJobs 1881 * from. Format: `projects/{project}/locations/{location}` 1882 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1883 */ listHyperparameterTuningJobs( String parent)1884 public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs( 1885 String parent) { 1886 ListHyperparameterTuningJobsRequest request = 1887 ListHyperparameterTuningJobsRequest.newBuilder().setParent(parent).build(); 1888 return listHyperparameterTuningJobs(request); 1889 } 1890 1891 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1892 /** 1893 * Lists HyperparameterTuningJobs in a Location. 1894 * 1895 * <p>Sample code: 1896 * 1897 * <pre>{@code 1898 * // This snippet has been automatically generated and should be regarded as a code template only. 1899 * // It will require modifications to work: 1900 * // - It may require correct/in-range values for request initialization. 1901 * // - It may require specifying regional endpoints when creating the service client as shown in 1902 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1903 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1904 * ListHyperparameterTuningJobsRequest request = 1905 * ListHyperparameterTuningJobsRequest.newBuilder() 1906 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1907 * .setFilter("filter-1274492040") 1908 * .setPageSize(883849137) 1909 * .setPageToken("pageToken873572522") 1910 * .setReadMask(FieldMask.newBuilder().build()) 1911 * .build(); 1912 * for (HyperparameterTuningJob element : 1913 * jobServiceClient.listHyperparameterTuningJobs(request).iterateAll()) { 1914 * // doThingsWith(element); 1915 * } 1916 * } 1917 * }</pre> 1918 * 1919 * @param request The request object containing all of the parameters for the API call. 1920 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1921 */ listHyperparameterTuningJobs( ListHyperparameterTuningJobsRequest request)1922 public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs( 1923 ListHyperparameterTuningJobsRequest request) { 1924 return listHyperparameterTuningJobsPagedCallable().call(request); 1925 } 1926 1927 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1928 /** 1929 * Lists HyperparameterTuningJobs in a Location. 1930 * 1931 * <p>Sample code: 1932 * 1933 * <pre>{@code 1934 * // This snippet has been automatically generated and should be regarded as a code template only. 1935 * // It will require modifications to work: 1936 * // - It may require correct/in-range values for request initialization. 1937 * // - It may require specifying regional endpoints when creating the service client as shown in 1938 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1939 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1940 * ListHyperparameterTuningJobsRequest request = 1941 * ListHyperparameterTuningJobsRequest.newBuilder() 1942 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1943 * .setFilter("filter-1274492040") 1944 * .setPageSize(883849137) 1945 * .setPageToken("pageToken873572522") 1946 * .setReadMask(FieldMask.newBuilder().build()) 1947 * .build(); 1948 * ApiFuture<HyperparameterTuningJob> future = 1949 * jobServiceClient.listHyperparameterTuningJobsPagedCallable().futureCall(request); 1950 * // Do something. 1951 * for (HyperparameterTuningJob element : future.get().iterateAll()) { 1952 * // doThingsWith(element); 1953 * } 1954 * } 1955 * }</pre> 1956 */ 1957 public final UnaryCallable< 1958 ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsPagedResponse> listHyperparameterTuningJobsPagedCallable()1959 listHyperparameterTuningJobsPagedCallable() { 1960 return stub.listHyperparameterTuningJobsPagedCallable(); 1961 } 1962 1963 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1964 /** 1965 * Lists HyperparameterTuningJobs in a Location. 1966 * 1967 * <p>Sample code: 1968 * 1969 * <pre>{@code 1970 * // This snippet has been automatically generated and should be regarded as a code template only. 1971 * // It will require modifications to work: 1972 * // - It may require correct/in-range values for request initialization. 1973 * // - It may require specifying regional endpoints when creating the service client as shown in 1974 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1975 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 1976 * ListHyperparameterTuningJobsRequest request = 1977 * ListHyperparameterTuningJobsRequest.newBuilder() 1978 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1979 * .setFilter("filter-1274492040") 1980 * .setPageSize(883849137) 1981 * .setPageToken("pageToken873572522") 1982 * .setReadMask(FieldMask.newBuilder().build()) 1983 * .build(); 1984 * while (true) { 1985 * ListHyperparameterTuningJobsResponse response = 1986 * jobServiceClient.listHyperparameterTuningJobsCallable().call(request); 1987 * for (HyperparameterTuningJob element : response.getHyperparameterTuningJobsList()) { 1988 * // doThingsWith(element); 1989 * } 1990 * String nextPageToken = response.getNextPageToken(); 1991 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1992 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1993 * } else { 1994 * break; 1995 * } 1996 * } 1997 * } 1998 * }</pre> 1999 */ 2000 public final UnaryCallable< 2001 ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsResponse> listHyperparameterTuningJobsCallable()2002 listHyperparameterTuningJobsCallable() { 2003 return stub.listHyperparameterTuningJobsCallable(); 2004 } 2005 2006 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2007 /** 2008 * Deletes a HyperparameterTuningJob. 2009 * 2010 * <p>Sample code: 2011 * 2012 * <pre>{@code 2013 * // This snippet has been automatically generated and should be regarded as a code template only. 2014 * // It will require modifications to work: 2015 * // - It may require correct/in-range values for request initialization. 2016 * // - It may require specifying regional endpoints when creating the service client as shown in 2017 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2018 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2019 * HyperparameterTuningJobName name = 2020 * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]"); 2021 * jobServiceClient.deleteHyperparameterTuningJobAsync(name).get(); 2022 * } 2023 * }</pre> 2024 * 2025 * @param name Required. The name of the HyperparameterTuningJob resource to be deleted. Format: 2026 * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` 2027 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2028 */ deleteHyperparameterTuningJobAsync( HyperparameterTuningJobName name)2029 public final OperationFuture<Empty, DeleteOperationMetadata> deleteHyperparameterTuningJobAsync( 2030 HyperparameterTuningJobName name) { 2031 DeleteHyperparameterTuningJobRequest request = 2032 DeleteHyperparameterTuningJobRequest.newBuilder() 2033 .setName(name == null ? null : name.toString()) 2034 .build(); 2035 return deleteHyperparameterTuningJobAsync(request); 2036 } 2037 2038 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2039 /** 2040 * Deletes a HyperparameterTuningJob. 2041 * 2042 * <p>Sample code: 2043 * 2044 * <pre>{@code 2045 * // This snippet has been automatically generated and should be regarded as a code template only. 2046 * // It will require modifications to work: 2047 * // - It may require correct/in-range values for request initialization. 2048 * // - It may require specifying regional endpoints when creating the service client as shown in 2049 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2050 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2051 * String name = 2052 * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 2053 * .toString(); 2054 * jobServiceClient.deleteHyperparameterTuningJobAsync(name).get(); 2055 * } 2056 * }</pre> 2057 * 2058 * @param name Required. The name of the HyperparameterTuningJob resource to be deleted. Format: 2059 * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` 2060 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2061 */ deleteHyperparameterTuningJobAsync( String name)2062 public final OperationFuture<Empty, DeleteOperationMetadata> deleteHyperparameterTuningJobAsync( 2063 String name) { 2064 DeleteHyperparameterTuningJobRequest request = 2065 DeleteHyperparameterTuningJobRequest.newBuilder().setName(name).build(); 2066 return deleteHyperparameterTuningJobAsync(request); 2067 } 2068 2069 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2070 /** 2071 * Deletes a HyperparameterTuningJob. 2072 * 2073 * <p>Sample code: 2074 * 2075 * <pre>{@code 2076 * // This snippet has been automatically generated and should be regarded as a code template only. 2077 * // It will require modifications to work: 2078 * // - It may require correct/in-range values for request initialization. 2079 * // - It may require specifying regional endpoints when creating the service client as shown in 2080 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2081 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2082 * DeleteHyperparameterTuningJobRequest request = 2083 * DeleteHyperparameterTuningJobRequest.newBuilder() 2084 * .setName( 2085 * HyperparameterTuningJobName.of( 2086 * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 2087 * .toString()) 2088 * .build(); 2089 * jobServiceClient.deleteHyperparameterTuningJobAsync(request).get(); 2090 * } 2091 * }</pre> 2092 * 2093 * @param request The request object containing all of the parameters for the API call. 2094 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2095 */ deleteHyperparameterTuningJobAsync( DeleteHyperparameterTuningJobRequest request)2096 public final OperationFuture<Empty, DeleteOperationMetadata> deleteHyperparameterTuningJobAsync( 2097 DeleteHyperparameterTuningJobRequest request) { 2098 return deleteHyperparameterTuningJobOperationCallable().futureCall(request); 2099 } 2100 2101 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2102 /** 2103 * Deletes a HyperparameterTuningJob. 2104 * 2105 * <p>Sample code: 2106 * 2107 * <pre>{@code 2108 * // This snippet has been automatically generated and should be regarded as a code template only. 2109 * // It will require modifications to work: 2110 * // - It may require correct/in-range values for request initialization. 2111 * // - It may require specifying regional endpoints when creating the service client as shown in 2112 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2113 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2114 * DeleteHyperparameterTuningJobRequest request = 2115 * DeleteHyperparameterTuningJobRequest.newBuilder() 2116 * .setName( 2117 * HyperparameterTuningJobName.of( 2118 * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 2119 * .toString()) 2120 * .build(); 2121 * OperationFuture<Empty, DeleteOperationMetadata> future = 2122 * jobServiceClient.deleteHyperparameterTuningJobOperationCallable().futureCall(request); 2123 * // Do something. 2124 * future.get(); 2125 * } 2126 * }</pre> 2127 */ 2128 public final OperationCallable< 2129 DeleteHyperparameterTuningJobRequest, Empty, DeleteOperationMetadata> deleteHyperparameterTuningJobOperationCallable()2130 deleteHyperparameterTuningJobOperationCallable() { 2131 return stub.deleteHyperparameterTuningJobOperationCallable(); 2132 } 2133 2134 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2135 /** 2136 * Deletes a HyperparameterTuningJob. 2137 * 2138 * <p>Sample code: 2139 * 2140 * <pre>{@code 2141 * // This snippet has been automatically generated and should be regarded as a code template only. 2142 * // It will require modifications to work: 2143 * // - It may require correct/in-range values for request initialization. 2144 * // - It may require specifying regional endpoints when creating the service client as shown in 2145 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2146 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2147 * DeleteHyperparameterTuningJobRequest request = 2148 * DeleteHyperparameterTuningJobRequest.newBuilder() 2149 * .setName( 2150 * HyperparameterTuningJobName.of( 2151 * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 2152 * .toString()) 2153 * .build(); 2154 * ApiFuture<Operation> future = 2155 * jobServiceClient.deleteHyperparameterTuningJobCallable().futureCall(request); 2156 * // Do something. 2157 * future.get(); 2158 * } 2159 * }</pre> 2160 */ 2161 public final UnaryCallable<DeleteHyperparameterTuningJobRequest, Operation> deleteHyperparameterTuningJobCallable()2162 deleteHyperparameterTuningJobCallable() { 2163 return stub.deleteHyperparameterTuningJobCallable(); 2164 } 2165 2166 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2167 /** 2168 * Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the 2169 * HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not 2170 * guaranteed. Clients can use 2171 * [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob] 2172 * or other methods to check whether the cancellation succeeded or whether the job completed 2173 * despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; 2174 * instead it becomes a job with a 2175 * [HyperparameterTuningJob.error][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.error] 2176 * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to 2177 * `Code.CANCELLED`, and 2178 * [HyperparameterTuningJob.state][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state] 2179 * is set to `CANCELLED`. 2180 * 2181 * <p>Sample code: 2182 * 2183 * <pre>{@code 2184 * // This snippet has been automatically generated and should be regarded as a code template only. 2185 * // It will require modifications to work: 2186 * // - It may require correct/in-range values for request initialization. 2187 * // - It may require specifying regional endpoints when creating the service client as shown in 2188 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2189 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2190 * HyperparameterTuningJobName name = 2191 * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]"); 2192 * jobServiceClient.cancelHyperparameterTuningJob(name); 2193 * } 2194 * }</pre> 2195 * 2196 * @param name Required. The name of the HyperparameterTuningJob to cancel. Format: 2197 * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` 2198 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2199 */ cancelHyperparameterTuningJob(HyperparameterTuningJobName name)2200 public final void cancelHyperparameterTuningJob(HyperparameterTuningJobName name) { 2201 CancelHyperparameterTuningJobRequest request = 2202 CancelHyperparameterTuningJobRequest.newBuilder() 2203 .setName(name == null ? null : name.toString()) 2204 .build(); 2205 cancelHyperparameterTuningJob(request); 2206 } 2207 2208 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2209 /** 2210 * Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the 2211 * HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not 2212 * guaranteed. Clients can use 2213 * [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob] 2214 * or other methods to check whether the cancellation succeeded or whether the job completed 2215 * despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; 2216 * instead it becomes a job with a 2217 * [HyperparameterTuningJob.error][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.error] 2218 * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to 2219 * `Code.CANCELLED`, and 2220 * [HyperparameterTuningJob.state][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state] 2221 * is set to `CANCELLED`. 2222 * 2223 * <p>Sample code: 2224 * 2225 * <pre>{@code 2226 * // This snippet has been automatically generated and should be regarded as a code template only. 2227 * // It will require modifications to work: 2228 * // - It may require correct/in-range values for request initialization. 2229 * // - It may require specifying regional endpoints when creating the service client as shown in 2230 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2231 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2232 * String name = 2233 * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 2234 * .toString(); 2235 * jobServiceClient.cancelHyperparameterTuningJob(name); 2236 * } 2237 * }</pre> 2238 * 2239 * @param name Required. The name of the HyperparameterTuningJob to cancel. Format: 2240 * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` 2241 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2242 */ cancelHyperparameterTuningJob(String name)2243 public final void cancelHyperparameterTuningJob(String name) { 2244 CancelHyperparameterTuningJobRequest request = 2245 CancelHyperparameterTuningJobRequest.newBuilder().setName(name).build(); 2246 cancelHyperparameterTuningJob(request); 2247 } 2248 2249 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2250 /** 2251 * Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the 2252 * HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not 2253 * guaranteed. Clients can use 2254 * [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob] 2255 * or other methods to check whether the cancellation succeeded or whether the job completed 2256 * despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; 2257 * instead it becomes a job with a 2258 * [HyperparameterTuningJob.error][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.error] 2259 * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to 2260 * `Code.CANCELLED`, and 2261 * [HyperparameterTuningJob.state][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state] 2262 * is set to `CANCELLED`. 2263 * 2264 * <p>Sample code: 2265 * 2266 * <pre>{@code 2267 * // This snippet has been automatically generated and should be regarded as a code template only. 2268 * // It will require modifications to work: 2269 * // - It may require correct/in-range values for request initialization. 2270 * // - It may require specifying regional endpoints when creating the service client as shown in 2271 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2272 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2273 * CancelHyperparameterTuningJobRequest request = 2274 * CancelHyperparameterTuningJobRequest.newBuilder() 2275 * .setName( 2276 * HyperparameterTuningJobName.of( 2277 * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 2278 * .toString()) 2279 * .build(); 2280 * jobServiceClient.cancelHyperparameterTuningJob(request); 2281 * } 2282 * }</pre> 2283 * 2284 * @param request The request object containing all of the parameters for the API call. 2285 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2286 */ cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest request)2287 public final void cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest request) { 2288 cancelHyperparameterTuningJobCallable().call(request); 2289 } 2290 2291 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2292 /** 2293 * Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the 2294 * HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not 2295 * guaranteed. Clients can use 2296 * [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob] 2297 * or other methods to check whether the cancellation succeeded or whether the job completed 2298 * despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; 2299 * instead it becomes a job with a 2300 * [HyperparameterTuningJob.error][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.error] 2301 * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to 2302 * `Code.CANCELLED`, and 2303 * [HyperparameterTuningJob.state][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state] 2304 * is set to `CANCELLED`. 2305 * 2306 * <p>Sample code: 2307 * 2308 * <pre>{@code 2309 * // This snippet has been automatically generated and should be regarded as a code template only. 2310 * // It will require modifications to work: 2311 * // - It may require correct/in-range values for request initialization. 2312 * // - It may require specifying regional endpoints when creating the service client as shown in 2313 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2314 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2315 * CancelHyperparameterTuningJobRequest request = 2316 * CancelHyperparameterTuningJobRequest.newBuilder() 2317 * .setName( 2318 * HyperparameterTuningJobName.of( 2319 * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]") 2320 * .toString()) 2321 * .build(); 2322 * ApiFuture<Empty> future = 2323 * jobServiceClient.cancelHyperparameterTuningJobCallable().futureCall(request); 2324 * // Do something. 2325 * future.get(); 2326 * } 2327 * }</pre> 2328 */ 2329 public final UnaryCallable<CancelHyperparameterTuningJobRequest, Empty> cancelHyperparameterTuningJobCallable()2330 cancelHyperparameterTuningJobCallable() { 2331 return stub.cancelHyperparameterTuningJobCallable(); 2332 } 2333 2334 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2335 /** 2336 * Creates a NasJob 2337 * 2338 * <p>Sample code: 2339 * 2340 * <pre>{@code 2341 * // This snippet has been automatically generated and should be regarded as a code template only. 2342 * // It will require modifications to work: 2343 * // - It may require correct/in-range values for request initialization. 2344 * // - It may require specifying regional endpoints when creating the service client as shown in 2345 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2346 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2347 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 2348 * NasJob nasJob = NasJob.newBuilder().build(); 2349 * NasJob response = jobServiceClient.createNasJob(parent, nasJob); 2350 * } 2351 * }</pre> 2352 * 2353 * @param parent Required. The resource name of the Location to create the NasJob in. Format: 2354 * `projects/{project}/locations/{location}` 2355 * @param nasJob Required. The NasJob to create. 2356 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2357 */ createNasJob(LocationName parent, NasJob nasJob)2358 public final NasJob createNasJob(LocationName parent, NasJob nasJob) { 2359 CreateNasJobRequest request = 2360 CreateNasJobRequest.newBuilder() 2361 .setParent(parent == null ? null : parent.toString()) 2362 .setNasJob(nasJob) 2363 .build(); 2364 return createNasJob(request); 2365 } 2366 2367 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2368 /** 2369 * Creates a NasJob 2370 * 2371 * <p>Sample code: 2372 * 2373 * <pre>{@code 2374 * // This snippet has been automatically generated and should be regarded as a code template only. 2375 * // It will require modifications to work: 2376 * // - It may require correct/in-range values for request initialization. 2377 * // - It may require specifying regional endpoints when creating the service client as shown in 2378 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2379 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2380 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 2381 * NasJob nasJob = NasJob.newBuilder().build(); 2382 * NasJob response = jobServiceClient.createNasJob(parent, nasJob); 2383 * } 2384 * }</pre> 2385 * 2386 * @param parent Required. The resource name of the Location to create the NasJob in. Format: 2387 * `projects/{project}/locations/{location}` 2388 * @param nasJob Required. The NasJob to create. 2389 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2390 */ createNasJob(String parent, NasJob nasJob)2391 public final NasJob createNasJob(String parent, NasJob nasJob) { 2392 CreateNasJobRequest request = 2393 CreateNasJobRequest.newBuilder().setParent(parent).setNasJob(nasJob).build(); 2394 return createNasJob(request); 2395 } 2396 2397 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2398 /** 2399 * Creates a NasJob 2400 * 2401 * <p>Sample code: 2402 * 2403 * <pre>{@code 2404 * // This snippet has been automatically generated and should be regarded as a code template only. 2405 * // It will require modifications to work: 2406 * // - It may require correct/in-range values for request initialization. 2407 * // - It may require specifying regional endpoints when creating the service client as shown in 2408 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2409 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2410 * CreateNasJobRequest request = 2411 * CreateNasJobRequest.newBuilder() 2412 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2413 * .setNasJob(NasJob.newBuilder().build()) 2414 * .build(); 2415 * NasJob response = jobServiceClient.createNasJob(request); 2416 * } 2417 * }</pre> 2418 * 2419 * @param request The request object containing all of the parameters for the API call. 2420 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2421 */ createNasJob(CreateNasJobRequest request)2422 public final NasJob createNasJob(CreateNasJobRequest request) { 2423 return createNasJobCallable().call(request); 2424 } 2425 2426 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2427 /** 2428 * Creates a NasJob 2429 * 2430 * <p>Sample code: 2431 * 2432 * <pre>{@code 2433 * // This snippet has been automatically generated and should be regarded as a code template only. 2434 * // It will require modifications to work: 2435 * // - It may require correct/in-range values for request initialization. 2436 * // - It may require specifying regional endpoints when creating the service client as shown in 2437 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2438 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2439 * CreateNasJobRequest request = 2440 * CreateNasJobRequest.newBuilder() 2441 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2442 * .setNasJob(NasJob.newBuilder().build()) 2443 * .build(); 2444 * ApiFuture<NasJob> future = jobServiceClient.createNasJobCallable().futureCall(request); 2445 * // Do something. 2446 * NasJob response = future.get(); 2447 * } 2448 * }</pre> 2449 */ createNasJobCallable()2450 public final UnaryCallable<CreateNasJobRequest, NasJob> createNasJobCallable() { 2451 return stub.createNasJobCallable(); 2452 } 2453 2454 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2455 /** 2456 * Gets a NasJob 2457 * 2458 * <p>Sample code: 2459 * 2460 * <pre>{@code 2461 * // This snippet has been automatically generated and should be regarded as a code template only. 2462 * // It will require modifications to work: 2463 * // - It may require correct/in-range values for request initialization. 2464 * // - It may require specifying regional endpoints when creating the service client as shown in 2465 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2466 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2467 * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); 2468 * NasJob response = jobServiceClient.getNasJob(name); 2469 * } 2470 * }</pre> 2471 * 2472 * @param name Required. The name of the NasJob resource. Format: 2473 * `projects/{project}/locations/{location}/nasJobs/{nas_job}` 2474 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2475 */ getNasJob(NasJobName name)2476 public final NasJob getNasJob(NasJobName name) { 2477 GetNasJobRequest request = 2478 GetNasJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2479 return getNasJob(request); 2480 } 2481 2482 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2483 /** 2484 * Gets a NasJob 2485 * 2486 * <p>Sample code: 2487 * 2488 * <pre>{@code 2489 * // This snippet has been automatically generated and should be regarded as a code template only. 2490 * // It will require modifications to work: 2491 * // - It may require correct/in-range values for request initialization. 2492 * // - It may require specifying regional endpoints when creating the service client as shown in 2493 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2494 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2495 * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); 2496 * NasJob response = jobServiceClient.getNasJob(name); 2497 * } 2498 * }</pre> 2499 * 2500 * @param name Required. The name of the NasJob resource. Format: 2501 * `projects/{project}/locations/{location}/nasJobs/{nas_job}` 2502 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2503 */ getNasJob(String name)2504 public final NasJob getNasJob(String name) { 2505 GetNasJobRequest request = GetNasJobRequest.newBuilder().setName(name).build(); 2506 return getNasJob(request); 2507 } 2508 2509 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2510 /** 2511 * Gets a NasJob 2512 * 2513 * <p>Sample code: 2514 * 2515 * <pre>{@code 2516 * // This snippet has been automatically generated and should be regarded as a code template only. 2517 * // It will require modifications to work: 2518 * // - It may require correct/in-range values for request initialization. 2519 * // - It may require specifying regional endpoints when creating the service client as shown in 2520 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2521 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2522 * GetNasJobRequest request = 2523 * GetNasJobRequest.newBuilder() 2524 * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 2525 * .build(); 2526 * NasJob response = jobServiceClient.getNasJob(request); 2527 * } 2528 * }</pre> 2529 * 2530 * @param request The request object containing all of the parameters for the API call. 2531 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2532 */ getNasJob(GetNasJobRequest request)2533 public final NasJob getNasJob(GetNasJobRequest request) { 2534 return getNasJobCallable().call(request); 2535 } 2536 2537 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2538 /** 2539 * Gets a NasJob 2540 * 2541 * <p>Sample code: 2542 * 2543 * <pre>{@code 2544 * // This snippet has been automatically generated and should be regarded as a code template only. 2545 * // It will require modifications to work: 2546 * // - It may require correct/in-range values for request initialization. 2547 * // - It may require specifying regional endpoints when creating the service client as shown in 2548 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2549 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2550 * GetNasJobRequest request = 2551 * GetNasJobRequest.newBuilder() 2552 * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 2553 * .build(); 2554 * ApiFuture<NasJob> future = jobServiceClient.getNasJobCallable().futureCall(request); 2555 * // Do something. 2556 * NasJob response = future.get(); 2557 * } 2558 * }</pre> 2559 */ getNasJobCallable()2560 public final UnaryCallable<GetNasJobRequest, NasJob> getNasJobCallable() { 2561 return stub.getNasJobCallable(); 2562 } 2563 2564 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2565 /** 2566 * Lists NasJobs in a Location. 2567 * 2568 * <p>Sample code: 2569 * 2570 * <pre>{@code 2571 * // This snippet has been automatically generated and should be regarded as a code template only. 2572 * // It will require modifications to work: 2573 * // - It may require correct/in-range values for request initialization. 2574 * // - It may require specifying regional endpoints when creating the service client as shown in 2575 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2576 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2577 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 2578 * for (NasJob element : jobServiceClient.listNasJobs(parent).iterateAll()) { 2579 * // doThingsWith(element); 2580 * } 2581 * } 2582 * }</pre> 2583 * 2584 * @param parent Required. The resource name of the Location to list the NasJobs from. Format: 2585 * `projects/{project}/locations/{location}` 2586 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2587 */ listNasJobs(LocationName parent)2588 public final ListNasJobsPagedResponse listNasJobs(LocationName parent) { 2589 ListNasJobsRequest request = 2590 ListNasJobsRequest.newBuilder() 2591 .setParent(parent == null ? null : parent.toString()) 2592 .build(); 2593 return listNasJobs(request); 2594 } 2595 2596 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2597 /** 2598 * Lists NasJobs in a Location. 2599 * 2600 * <p>Sample code: 2601 * 2602 * <pre>{@code 2603 * // This snippet has been automatically generated and should be regarded as a code template only. 2604 * // It will require modifications to work: 2605 * // - It may require correct/in-range values for request initialization. 2606 * // - It may require specifying regional endpoints when creating the service client as shown in 2607 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2608 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2609 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 2610 * for (NasJob element : jobServiceClient.listNasJobs(parent).iterateAll()) { 2611 * // doThingsWith(element); 2612 * } 2613 * } 2614 * }</pre> 2615 * 2616 * @param parent Required. The resource name of the Location to list the NasJobs from. Format: 2617 * `projects/{project}/locations/{location}` 2618 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2619 */ listNasJobs(String parent)2620 public final ListNasJobsPagedResponse listNasJobs(String parent) { 2621 ListNasJobsRequest request = ListNasJobsRequest.newBuilder().setParent(parent).build(); 2622 return listNasJobs(request); 2623 } 2624 2625 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2626 /** 2627 * Lists NasJobs in a Location. 2628 * 2629 * <p>Sample code: 2630 * 2631 * <pre>{@code 2632 * // This snippet has been automatically generated and should be regarded as a code template only. 2633 * // It will require modifications to work: 2634 * // - It may require correct/in-range values for request initialization. 2635 * // - It may require specifying regional endpoints when creating the service client as shown in 2636 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2637 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2638 * ListNasJobsRequest request = 2639 * ListNasJobsRequest.newBuilder() 2640 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2641 * .setFilter("filter-1274492040") 2642 * .setPageSize(883849137) 2643 * .setPageToken("pageToken873572522") 2644 * .setReadMask(FieldMask.newBuilder().build()) 2645 * .build(); 2646 * for (NasJob element : jobServiceClient.listNasJobs(request).iterateAll()) { 2647 * // doThingsWith(element); 2648 * } 2649 * } 2650 * }</pre> 2651 * 2652 * @param request The request object containing all of the parameters for the API call. 2653 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2654 */ listNasJobs(ListNasJobsRequest request)2655 public final ListNasJobsPagedResponse listNasJobs(ListNasJobsRequest request) { 2656 return listNasJobsPagedCallable().call(request); 2657 } 2658 2659 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2660 /** 2661 * Lists NasJobs in a Location. 2662 * 2663 * <p>Sample code: 2664 * 2665 * <pre>{@code 2666 * // This snippet has been automatically generated and should be regarded as a code template only. 2667 * // It will require modifications to work: 2668 * // - It may require correct/in-range values for request initialization. 2669 * // - It may require specifying regional endpoints when creating the service client as shown in 2670 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2671 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2672 * ListNasJobsRequest request = 2673 * ListNasJobsRequest.newBuilder() 2674 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2675 * .setFilter("filter-1274492040") 2676 * .setPageSize(883849137) 2677 * .setPageToken("pageToken873572522") 2678 * .setReadMask(FieldMask.newBuilder().build()) 2679 * .build(); 2680 * ApiFuture<NasJob> future = jobServiceClient.listNasJobsPagedCallable().futureCall(request); 2681 * // Do something. 2682 * for (NasJob element : future.get().iterateAll()) { 2683 * // doThingsWith(element); 2684 * } 2685 * } 2686 * }</pre> 2687 */ 2688 public final UnaryCallable<ListNasJobsRequest, ListNasJobsPagedResponse> listNasJobsPagedCallable()2689 listNasJobsPagedCallable() { 2690 return stub.listNasJobsPagedCallable(); 2691 } 2692 2693 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2694 /** 2695 * Lists NasJobs in a Location. 2696 * 2697 * <p>Sample code: 2698 * 2699 * <pre>{@code 2700 * // This snippet has been automatically generated and should be regarded as a code template only. 2701 * // It will require modifications to work: 2702 * // - It may require correct/in-range values for request initialization. 2703 * // - It may require specifying regional endpoints when creating the service client as shown in 2704 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2705 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2706 * ListNasJobsRequest request = 2707 * ListNasJobsRequest.newBuilder() 2708 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2709 * .setFilter("filter-1274492040") 2710 * .setPageSize(883849137) 2711 * .setPageToken("pageToken873572522") 2712 * .setReadMask(FieldMask.newBuilder().build()) 2713 * .build(); 2714 * while (true) { 2715 * ListNasJobsResponse response = jobServiceClient.listNasJobsCallable().call(request); 2716 * for (NasJob element : response.getNasJobsList()) { 2717 * // doThingsWith(element); 2718 * } 2719 * String nextPageToken = response.getNextPageToken(); 2720 * if (!Strings.isNullOrEmpty(nextPageToken)) { 2721 * request = request.toBuilder().setPageToken(nextPageToken).build(); 2722 * } else { 2723 * break; 2724 * } 2725 * } 2726 * } 2727 * }</pre> 2728 */ listNasJobsCallable()2729 public final UnaryCallable<ListNasJobsRequest, ListNasJobsResponse> listNasJobsCallable() { 2730 return stub.listNasJobsCallable(); 2731 } 2732 2733 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2734 /** 2735 * Deletes a NasJob. 2736 * 2737 * <p>Sample code: 2738 * 2739 * <pre>{@code 2740 * // This snippet has been automatically generated and should be regarded as a code template only. 2741 * // It will require modifications to work: 2742 * // - It may require correct/in-range values for request initialization. 2743 * // - It may require specifying regional endpoints when creating the service client as shown in 2744 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2745 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2746 * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); 2747 * jobServiceClient.deleteNasJobAsync(name).get(); 2748 * } 2749 * }</pre> 2750 * 2751 * @param name Required. The name of the NasJob resource to be deleted. Format: 2752 * `projects/{project}/locations/{location}/nasJobs/{nas_job}` 2753 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2754 */ deleteNasJobAsync(NasJobName name)2755 public final OperationFuture<Empty, DeleteOperationMetadata> deleteNasJobAsync(NasJobName name) { 2756 DeleteNasJobRequest request = 2757 DeleteNasJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2758 return deleteNasJobAsync(request); 2759 } 2760 2761 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2762 /** 2763 * Deletes a NasJob. 2764 * 2765 * <p>Sample code: 2766 * 2767 * <pre>{@code 2768 * // This snippet has been automatically generated and should be regarded as a code template only. 2769 * // It will require modifications to work: 2770 * // - It may require correct/in-range values for request initialization. 2771 * // - It may require specifying regional endpoints when creating the service client as shown in 2772 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2773 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2774 * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); 2775 * jobServiceClient.deleteNasJobAsync(name).get(); 2776 * } 2777 * }</pre> 2778 * 2779 * @param name Required. The name of the NasJob resource to be deleted. Format: 2780 * `projects/{project}/locations/{location}/nasJobs/{nas_job}` 2781 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2782 */ deleteNasJobAsync(String name)2783 public final OperationFuture<Empty, DeleteOperationMetadata> deleteNasJobAsync(String name) { 2784 DeleteNasJobRequest request = DeleteNasJobRequest.newBuilder().setName(name).build(); 2785 return deleteNasJobAsync(request); 2786 } 2787 2788 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2789 /** 2790 * Deletes a NasJob. 2791 * 2792 * <p>Sample code: 2793 * 2794 * <pre>{@code 2795 * // This snippet has been automatically generated and should be regarded as a code template only. 2796 * // It will require modifications to work: 2797 * // - It may require correct/in-range values for request initialization. 2798 * // - It may require specifying regional endpoints when creating the service client as shown in 2799 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2800 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2801 * DeleteNasJobRequest request = 2802 * DeleteNasJobRequest.newBuilder() 2803 * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 2804 * .build(); 2805 * jobServiceClient.deleteNasJobAsync(request).get(); 2806 * } 2807 * }</pre> 2808 * 2809 * @param request The request object containing all of the parameters for the API call. 2810 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2811 */ deleteNasJobAsync( DeleteNasJobRequest request)2812 public final OperationFuture<Empty, DeleteOperationMetadata> deleteNasJobAsync( 2813 DeleteNasJobRequest request) { 2814 return deleteNasJobOperationCallable().futureCall(request); 2815 } 2816 2817 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2818 /** 2819 * Deletes a NasJob. 2820 * 2821 * <p>Sample code: 2822 * 2823 * <pre>{@code 2824 * // This snippet has been automatically generated and should be regarded as a code template only. 2825 * // It will require modifications to work: 2826 * // - It may require correct/in-range values for request initialization. 2827 * // - It may require specifying regional endpoints when creating the service client as shown in 2828 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2829 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2830 * DeleteNasJobRequest request = 2831 * DeleteNasJobRequest.newBuilder() 2832 * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 2833 * .build(); 2834 * OperationFuture<Empty, DeleteOperationMetadata> future = 2835 * jobServiceClient.deleteNasJobOperationCallable().futureCall(request); 2836 * // Do something. 2837 * future.get(); 2838 * } 2839 * }</pre> 2840 */ 2841 public final OperationCallable<DeleteNasJobRequest, Empty, DeleteOperationMetadata> deleteNasJobOperationCallable()2842 deleteNasJobOperationCallable() { 2843 return stub.deleteNasJobOperationCallable(); 2844 } 2845 2846 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2847 /** 2848 * Deletes a NasJob. 2849 * 2850 * <p>Sample code: 2851 * 2852 * <pre>{@code 2853 * // This snippet has been automatically generated and should be regarded as a code template only. 2854 * // It will require modifications to work: 2855 * // - It may require correct/in-range values for request initialization. 2856 * // - It may require specifying regional endpoints when creating the service client as shown in 2857 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2858 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2859 * DeleteNasJobRequest request = 2860 * DeleteNasJobRequest.newBuilder() 2861 * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 2862 * .build(); 2863 * ApiFuture<Operation> future = jobServiceClient.deleteNasJobCallable().futureCall(request); 2864 * // Do something. 2865 * future.get(); 2866 * } 2867 * }</pre> 2868 */ deleteNasJobCallable()2869 public final UnaryCallable<DeleteNasJobRequest, Operation> deleteNasJobCallable() { 2870 return stub.deleteNasJobCallable(); 2871 } 2872 2873 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2874 /** 2875 * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best 2876 * effort to cancel the job, but success is not guaranteed. Clients can use 2877 * [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] or other methods 2878 * to check whether the cancellation succeeded or whether the job completed despite cancellation. 2879 * On successful cancellation, the NasJob is not deleted; instead it becomes a job with a 2880 * [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a 2881 * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and 2882 * [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to `CANCELLED`. 2883 * 2884 * <p>Sample code: 2885 * 2886 * <pre>{@code 2887 * // This snippet has been automatically generated and should be regarded as a code template only. 2888 * // It will require modifications to work: 2889 * // - It may require correct/in-range values for request initialization. 2890 * // - It may require specifying regional endpoints when creating the service client as shown in 2891 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2892 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2893 * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); 2894 * jobServiceClient.cancelNasJob(name); 2895 * } 2896 * }</pre> 2897 * 2898 * @param name Required. The name of the NasJob to cancel. Format: 2899 * `projects/{project}/locations/{location}/nasJobs/{nas_job}` 2900 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2901 */ cancelNasJob(NasJobName name)2902 public final void cancelNasJob(NasJobName name) { 2903 CancelNasJobRequest request = 2904 CancelNasJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2905 cancelNasJob(request); 2906 } 2907 2908 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2909 /** 2910 * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best 2911 * effort to cancel the job, but success is not guaranteed. Clients can use 2912 * [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] or other methods 2913 * to check whether the cancellation succeeded or whether the job completed despite cancellation. 2914 * On successful cancellation, the NasJob is not deleted; instead it becomes a job with a 2915 * [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a 2916 * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and 2917 * [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to `CANCELLED`. 2918 * 2919 * <p>Sample code: 2920 * 2921 * <pre>{@code 2922 * // This snippet has been automatically generated and should be regarded as a code template only. 2923 * // It will require modifications to work: 2924 * // - It may require correct/in-range values for request initialization. 2925 * // - It may require specifying regional endpoints when creating the service client as shown in 2926 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2927 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2928 * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); 2929 * jobServiceClient.cancelNasJob(name); 2930 * } 2931 * }</pre> 2932 * 2933 * @param name Required. The name of the NasJob to cancel. Format: 2934 * `projects/{project}/locations/{location}/nasJobs/{nas_job}` 2935 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2936 */ cancelNasJob(String name)2937 public final void cancelNasJob(String name) { 2938 CancelNasJobRequest request = CancelNasJobRequest.newBuilder().setName(name).build(); 2939 cancelNasJob(request); 2940 } 2941 2942 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2943 /** 2944 * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best 2945 * effort to cancel the job, but success is not guaranteed. Clients can use 2946 * [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] or other methods 2947 * to check whether the cancellation succeeded or whether the job completed despite cancellation. 2948 * On successful cancellation, the NasJob is not deleted; instead it becomes a job with a 2949 * [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a 2950 * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and 2951 * [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to `CANCELLED`. 2952 * 2953 * <p>Sample code: 2954 * 2955 * <pre>{@code 2956 * // This snippet has been automatically generated and should be regarded as a code template only. 2957 * // It will require modifications to work: 2958 * // - It may require correct/in-range values for request initialization. 2959 * // - It may require specifying regional endpoints when creating the service client as shown in 2960 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2961 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2962 * CancelNasJobRequest request = 2963 * CancelNasJobRequest.newBuilder() 2964 * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 2965 * .build(); 2966 * jobServiceClient.cancelNasJob(request); 2967 * } 2968 * }</pre> 2969 * 2970 * @param request The request object containing all of the parameters for the API call. 2971 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2972 */ cancelNasJob(CancelNasJobRequest request)2973 public final void cancelNasJob(CancelNasJobRequest request) { 2974 cancelNasJobCallable().call(request); 2975 } 2976 2977 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2978 /** 2979 * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best 2980 * effort to cancel the job, but success is not guaranteed. Clients can use 2981 * [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] or other methods 2982 * to check whether the cancellation succeeded or whether the job completed despite cancellation. 2983 * On successful cancellation, the NasJob is not deleted; instead it becomes a job with a 2984 * [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a 2985 * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and 2986 * [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to `CANCELLED`. 2987 * 2988 * <p>Sample code: 2989 * 2990 * <pre>{@code 2991 * // This snippet has been automatically generated and should be regarded as a code template only. 2992 * // It will require modifications to work: 2993 * // - It may require correct/in-range values for request initialization. 2994 * // - It may require specifying regional endpoints when creating the service client as shown in 2995 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2996 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 2997 * CancelNasJobRequest request = 2998 * CancelNasJobRequest.newBuilder() 2999 * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 3000 * .build(); 3001 * ApiFuture<Empty> future = jobServiceClient.cancelNasJobCallable().futureCall(request); 3002 * // Do something. 3003 * future.get(); 3004 * } 3005 * }</pre> 3006 */ cancelNasJobCallable()3007 public final UnaryCallable<CancelNasJobRequest, Empty> cancelNasJobCallable() { 3008 return stub.cancelNasJobCallable(); 3009 } 3010 3011 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3012 /** 3013 * Gets a NasTrialDetail. 3014 * 3015 * <p>Sample code: 3016 * 3017 * <pre>{@code 3018 * // This snippet has been automatically generated and should be regarded as a code template only. 3019 * // It will require modifications to work: 3020 * // - It may require correct/in-range values for request initialization. 3021 * // - It may require specifying regional endpoints when creating the service client as shown in 3022 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3023 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3024 * NasTrialDetailName name = 3025 * NasTrialDetailName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]"); 3026 * NasTrialDetail response = jobServiceClient.getNasTrialDetail(name); 3027 * } 3028 * }</pre> 3029 * 3030 * @param name Required. The name of the NasTrialDetail resource. Format: 3031 * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` 3032 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3033 */ getNasTrialDetail(NasTrialDetailName name)3034 public final NasTrialDetail getNasTrialDetail(NasTrialDetailName name) { 3035 GetNasTrialDetailRequest request = 3036 GetNasTrialDetailRequest.newBuilder() 3037 .setName(name == null ? null : name.toString()) 3038 .build(); 3039 return getNasTrialDetail(request); 3040 } 3041 3042 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3043 /** 3044 * Gets a NasTrialDetail. 3045 * 3046 * <p>Sample code: 3047 * 3048 * <pre>{@code 3049 * // This snippet has been automatically generated and should be regarded as a code template only. 3050 * // It will require modifications to work: 3051 * // - It may require correct/in-range values for request initialization. 3052 * // - It may require specifying regional endpoints when creating the service client as shown in 3053 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3054 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3055 * String name = 3056 * NasTrialDetailName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") 3057 * .toString(); 3058 * NasTrialDetail response = jobServiceClient.getNasTrialDetail(name); 3059 * } 3060 * }</pre> 3061 * 3062 * @param name Required. The name of the NasTrialDetail resource. Format: 3063 * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` 3064 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3065 */ getNasTrialDetail(String name)3066 public final NasTrialDetail getNasTrialDetail(String name) { 3067 GetNasTrialDetailRequest request = GetNasTrialDetailRequest.newBuilder().setName(name).build(); 3068 return getNasTrialDetail(request); 3069 } 3070 3071 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3072 /** 3073 * Gets a NasTrialDetail. 3074 * 3075 * <p>Sample code: 3076 * 3077 * <pre>{@code 3078 * // This snippet has been automatically generated and should be regarded as a code template only. 3079 * // It will require modifications to work: 3080 * // - It may require correct/in-range values for request initialization. 3081 * // - It may require specifying regional endpoints when creating the service client as shown in 3082 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3083 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3084 * GetNasTrialDetailRequest request = 3085 * GetNasTrialDetailRequest.newBuilder() 3086 * .setName( 3087 * NasTrialDetailName.of( 3088 * "[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") 3089 * .toString()) 3090 * .build(); 3091 * NasTrialDetail response = jobServiceClient.getNasTrialDetail(request); 3092 * } 3093 * }</pre> 3094 * 3095 * @param request The request object containing all of the parameters for the API call. 3096 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3097 */ getNasTrialDetail(GetNasTrialDetailRequest request)3098 public final NasTrialDetail getNasTrialDetail(GetNasTrialDetailRequest request) { 3099 return getNasTrialDetailCallable().call(request); 3100 } 3101 3102 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3103 /** 3104 * Gets a NasTrialDetail. 3105 * 3106 * <p>Sample code: 3107 * 3108 * <pre>{@code 3109 * // This snippet has been automatically generated and should be regarded as a code template only. 3110 * // It will require modifications to work: 3111 * // - It may require correct/in-range values for request initialization. 3112 * // - It may require specifying regional endpoints when creating the service client as shown in 3113 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3114 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3115 * GetNasTrialDetailRequest request = 3116 * GetNasTrialDetailRequest.newBuilder() 3117 * .setName( 3118 * NasTrialDetailName.of( 3119 * "[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") 3120 * .toString()) 3121 * .build(); 3122 * ApiFuture<NasTrialDetail> future = 3123 * jobServiceClient.getNasTrialDetailCallable().futureCall(request); 3124 * // Do something. 3125 * NasTrialDetail response = future.get(); 3126 * } 3127 * }</pre> 3128 */ getNasTrialDetailCallable()3129 public final UnaryCallable<GetNasTrialDetailRequest, NasTrialDetail> getNasTrialDetailCallable() { 3130 return stub.getNasTrialDetailCallable(); 3131 } 3132 3133 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3134 /** 3135 * List top NasTrialDetails of a NasJob. 3136 * 3137 * <p>Sample code: 3138 * 3139 * <pre>{@code 3140 * // This snippet has been automatically generated and should be regarded as a code template only. 3141 * // It will require modifications to work: 3142 * // - It may require correct/in-range values for request initialization. 3143 * // - It may require specifying regional endpoints when creating the service client as shown in 3144 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3145 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3146 * NasJobName parent = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); 3147 * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(parent).iterateAll()) { 3148 * // doThingsWith(element); 3149 * } 3150 * } 3151 * }</pre> 3152 * 3153 * @param parent Required. The name of the NasJob resource. Format: 3154 * `projects/{project}/locations/{location}/nasJobs/{nas_job}` 3155 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3156 */ listNasTrialDetails(NasJobName parent)3157 public final ListNasTrialDetailsPagedResponse listNasTrialDetails(NasJobName parent) { 3158 ListNasTrialDetailsRequest request = 3159 ListNasTrialDetailsRequest.newBuilder() 3160 .setParent(parent == null ? null : parent.toString()) 3161 .build(); 3162 return listNasTrialDetails(request); 3163 } 3164 3165 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3166 /** 3167 * List top NasTrialDetails of a NasJob. 3168 * 3169 * <p>Sample code: 3170 * 3171 * <pre>{@code 3172 * // This snippet has been automatically generated and should be regarded as a code template only. 3173 * // It will require modifications to work: 3174 * // - It may require correct/in-range values for request initialization. 3175 * // - It may require specifying regional endpoints when creating the service client as shown in 3176 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3177 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3178 * String parent = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); 3179 * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(parent).iterateAll()) { 3180 * // doThingsWith(element); 3181 * } 3182 * } 3183 * }</pre> 3184 * 3185 * @param parent Required. The name of the NasJob resource. Format: 3186 * `projects/{project}/locations/{location}/nasJobs/{nas_job}` 3187 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3188 */ listNasTrialDetails(String parent)3189 public final ListNasTrialDetailsPagedResponse listNasTrialDetails(String parent) { 3190 ListNasTrialDetailsRequest request = 3191 ListNasTrialDetailsRequest.newBuilder().setParent(parent).build(); 3192 return listNasTrialDetails(request); 3193 } 3194 3195 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3196 /** 3197 * List top NasTrialDetails of a NasJob. 3198 * 3199 * <p>Sample code: 3200 * 3201 * <pre>{@code 3202 * // This snippet has been automatically generated and should be regarded as a code template only. 3203 * // It will require modifications to work: 3204 * // - It may require correct/in-range values for request initialization. 3205 * // - It may require specifying regional endpoints when creating the service client as shown in 3206 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3207 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3208 * ListNasTrialDetailsRequest request = 3209 * ListNasTrialDetailsRequest.newBuilder() 3210 * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 3211 * .setPageSize(883849137) 3212 * .setPageToken("pageToken873572522") 3213 * .build(); 3214 * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(request).iterateAll()) { 3215 * // doThingsWith(element); 3216 * } 3217 * } 3218 * }</pre> 3219 * 3220 * @param request The request object containing all of the parameters for the API call. 3221 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3222 */ listNasTrialDetails( ListNasTrialDetailsRequest request)3223 public final ListNasTrialDetailsPagedResponse listNasTrialDetails( 3224 ListNasTrialDetailsRequest request) { 3225 return listNasTrialDetailsPagedCallable().call(request); 3226 } 3227 3228 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3229 /** 3230 * List top NasTrialDetails of a NasJob. 3231 * 3232 * <p>Sample code: 3233 * 3234 * <pre>{@code 3235 * // This snippet has been automatically generated and should be regarded as a code template only. 3236 * // It will require modifications to work: 3237 * // - It may require correct/in-range values for request initialization. 3238 * // - It may require specifying regional endpoints when creating the service client as shown in 3239 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3240 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3241 * ListNasTrialDetailsRequest request = 3242 * ListNasTrialDetailsRequest.newBuilder() 3243 * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 3244 * .setPageSize(883849137) 3245 * .setPageToken("pageToken873572522") 3246 * .build(); 3247 * ApiFuture<NasTrialDetail> future = 3248 * jobServiceClient.listNasTrialDetailsPagedCallable().futureCall(request); 3249 * // Do something. 3250 * for (NasTrialDetail element : future.get().iterateAll()) { 3251 * // doThingsWith(element); 3252 * } 3253 * } 3254 * }</pre> 3255 */ 3256 public final UnaryCallable<ListNasTrialDetailsRequest, ListNasTrialDetailsPagedResponse> listNasTrialDetailsPagedCallable()3257 listNasTrialDetailsPagedCallable() { 3258 return stub.listNasTrialDetailsPagedCallable(); 3259 } 3260 3261 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3262 /** 3263 * List top NasTrialDetails of a NasJob. 3264 * 3265 * <p>Sample code: 3266 * 3267 * <pre>{@code 3268 * // This snippet has been automatically generated and should be regarded as a code template only. 3269 * // It will require modifications to work: 3270 * // - It may require correct/in-range values for request initialization. 3271 * // - It may require specifying regional endpoints when creating the service client as shown in 3272 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3273 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3274 * ListNasTrialDetailsRequest request = 3275 * ListNasTrialDetailsRequest.newBuilder() 3276 * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) 3277 * .setPageSize(883849137) 3278 * .setPageToken("pageToken873572522") 3279 * .build(); 3280 * while (true) { 3281 * ListNasTrialDetailsResponse response = 3282 * jobServiceClient.listNasTrialDetailsCallable().call(request); 3283 * for (NasTrialDetail element : response.getNasTrialDetailsList()) { 3284 * // doThingsWith(element); 3285 * } 3286 * String nextPageToken = response.getNextPageToken(); 3287 * if (!Strings.isNullOrEmpty(nextPageToken)) { 3288 * request = request.toBuilder().setPageToken(nextPageToken).build(); 3289 * } else { 3290 * break; 3291 * } 3292 * } 3293 * } 3294 * }</pre> 3295 */ 3296 public final UnaryCallable<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse> listNasTrialDetailsCallable()3297 listNasTrialDetailsCallable() { 3298 return stub.listNasTrialDetailsCallable(); 3299 } 3300 3301 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3302 /** 3303 * Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to 3304 * start. 3305 * 3306 * <p>Sample code: 3307 * 3308 * <pre>{@code 3309 * // This snippet has been automatically generated and should be regarded as a code template only. 3310 * // It will require modifications to work: 3311 * // - It may require correct/in-range values for request initialization. 3312 * // - It may require specifying regional endpoints when creating the service client as shown in 3313 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3314 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3315 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 3316 * BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build(); 3317 * BatchPredictionJob response = 3318 * jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob); 3319 * } 3320 * }</pre> 3321 * 3322 * @param parent Required. The resource name of the Location to create the BatchPredictionJob in. 3323 * Format: `projects/{project}/locations/{location}` 3324 * @param batchPredictionJob Required. The BatchPredictionJob to create. 3325 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3326 */ createBatchPredictionJob( LocationName parent, BatchPredictionJob batchPredictionJob)3327 public final BatchPredictionJob createBatchPredictionJob( 3328 LocationName parent, BatchPredictionJob batchPredictionJob) { 3329 CreateBatchPredictionJobRequest request = 3330 CreateBatchPredictionJobRequest.newBuilder() 3331 .setParent(parent == null ? null : parent.toString()) 3332 .setBatchPredictionJob(batchPredictionJob) 3333 .build(); 3334 return createBatchPredictionJob(request); 3335 } 3336 3337 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3338 /** 3339 * Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to 3340 * start. 3341 * 3342 * <p>Sample code: 3343 * 3344 * <pre>{@code 3345 * // This snippet has been automatically generated and should be regarded as a code template only. 3346 * // It will require modifications to work: 3347 * // - It may require correct/in-range values for request initialization. 3348 * // - It may require specifying regional endpoints when creating the service client as shown in 3349 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3350 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3351 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 3352 * BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build(); 3353 * BatchPredictionJob response = 3354 * jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob); 3355 * } 3356 * }</pre> 3357 * 3358 * @param parent Required. The resource name of the Location to create the BatchPredictionJob in. 3359 * Format: `projects/{project}/locations/{location}` 3360 * @param batchPredictionJob Required. The BatchPredictionJob to create. 3361 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3362 */ createBatchPredictionJob( String parent, BatchPredictionJob batchPredictionJob)3363 public final BatchPredictionJob createBatchPredictionJob( 3364 String parent, BatchPredictionJob batchPredictionJob) { 3365 CreateBatchPredictionJobRequest request = 3366 CreateBatchPredictionJobRequest.newBuilder() 3367 .setParent(parent) 3368 .setBatchPredictionJob(batchPredictionJob) 3369 .build(); 3370 return createBatchPredictionJob(request); 3371 } 3372 3373 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3374 /** 3375 * Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to 3376 * start. 3377 * 3378 * <p>Sample code: 3379 * 3380 * <pre>{@code 3381 * // This snippet has been automatically generated and should be regarded as a code template only. 3382 * // It will require modifications to work: 3383 * // - It may require correct/in-range values for request initialization. 3384 * // - It may require specifying regional endpoints when creating the service client as shown in 3385 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3386 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3387 * CreateBatchPredictionJobRequest request = 3388 * CreateBatchPredictionJobRequest.newBuilder() 3389 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 3390 * .setBatchPredictionJob(BatchPredictionJob.newBuilder().build()) 3391 * .build(); 3392 * BatchPredictionJob response = jobServiceClient.createBatchPredictionJob(request); 3393 * } 3394 * }</pre> 3395 * 3396 * @param request The request object containing all of the parameters for the API call. 3397 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3398 */ createBatchPredictionJob( CreateBatchPredictionJobRequest request)3399 public final BatchPredictionJob createBatchPredictionJob( 3400 CreateBatchPredictionJobRequest request) { 3401 return createBatchPredictionJobCallable().call(request); 3402 } 3403 3404 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3405 /** 3406 * Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to 3407 * start. 3408 * 3409 * <p>Sample code: 3410 * 3411 * <pre>{@code 3412 * // This snippet has been automatically generated and should be regarded as a code template only. 3413 * // It will require modifications to work: 3414 * // - It may require correct/in-range values for request initialization. 3415 * // - It may require specifying regional endpoints when creating the service client as shown in 3416 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3417 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3418 * CreateBatchPredictionJobRequest request = 3419 * CreateBatchPredictionJobRequest.newBuilder() 3420 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 3421 * .setBatchPredictionJob(BatchPredictionJob.newBuilder().build()) 3422 * .build(); 3423 * ApiFuture<BatchPredictionJob> future = 3424 * jobServiceClient.createBatchPredictionJobCallable().futureCall(request); 3425 * // Do something. 3426 * BatchPredictionJob response = future.get(); 3427 * } 3428 * }</pre> 3429 */ 3430 public final UnaryCallable<CreateBatchPredictionJobRequest, BatchPredictionJob> createBatchPredictionJobCallable()3431 createBatchPredictionJobCallable() { 3432 return stub.createBatchPredictionJobCallable(); 3433 } 3434 3435 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3436 /** 3437 * Gets a BatchPredictionJob 3438 * 3439 * <p>Sample code: 3440 * 3441 * <pre>{@code 3442 * // This snippet has been automatically generated and should be regarded as a code template only. 3443 * // It will require modifications to work: 3444 * // - It may require correct/in-range values for request initialization. 3445 * // - It may require specifying regional endpoints when creating the service client as shown in 3446 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3447 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3448 * BatchPredictionJobName name = 3449 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]"); 3450 * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name); 3451 * } 3452 * }</pre> 3453 * 3454 * @param name Required. The name of the BatchPredictionJob resource. Format: 3455 * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` 3456 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3457 */ getBatchPredictionJob(BatchPredictionJobName name)3458 public final BatchPredictionJob getBatchPredictionJob(BatchPredictionJobName name) { 3459 GetBatchPredictionJobRequest request = 3460 GetBatchPredictionJobRequest.newBuilder() 3461 .setName(name == null ? null : name.toString()) 3462 .build(); 3463 return getBatchPredictionJob(request); 3464 } 3465 3466 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3467 /** 3468 * Gets a BatchPredictionJob 3469 * 3470 * <p>Sample code: 3471 * 3472 * <pre>{@code 3473 * // This snippet has been automatically generated and should be regarded as a code template only. 3474 * // It will require modifications to work: 3475 * // - It may require correct/in-range values for request initialization. 3476 * // - It may require specifying regional endpoints when creating the service client as shown in 3477 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3478 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3479 * String name = 3480 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString(); 3481 * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name); 3482 * } 3483 * }</pre> 3484 * 3485 * @param name Required. The name of the BatchPredictionJob resource. Format: 3486 * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` 3487 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3488 */ getBatchPredictionJob(String name)3489 public final BatchPredictionJob getBatchPredictionJob(String name) { 3490 GetBatchPredictionJobRequest request = 3491 GetBatchPredictionJobRequest.newBuilder().setName(name).build(); 3492 return getBatchPredictionJob(request); 3493 } 3494 3495 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3496 /** 3497 * Gets a BatchPredictionJob 3498 * 3499 * <p>Sample code: 3500 * 3501 * <pre>{@code 3502 * // This snippet has been automatically generated and should be regarded as a code template only. 3503 * // It will require modifications to work: 3504 * // - It may require correct/in-range values for request initialization. 3505 * // - It may require specifying regional endpoints when creating the service client as shown in 3506 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3507 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3508 * GetBatchPredictionJobRequest request = 3509 * GetBatchPredictionJobRequest.newBuilder() 3510 * .setName( 3511 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]") 3512 * .toString()) 3513 * .build(); 3514 * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(request); 3515 * } 3516 * }</pre> 3517 * 3518 * @param request The request object containing all of the parameters for the API call. 3519 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3520 */ getBatchPredictionJob(GetBatchPredictionJobRequest request)3521 public final BatchPredictionJob getBatchPredictionJob(GetBatchPredictionJobRequest request) { 3522 return getBatchPredictionJobCallable().call(request); 3523 } 3524 3525 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3526 /** 3527 * Gets a BatchPredictionJob 3528 * 3529 * <p>Sample code: 3530 * 3531 * <pre>{@code 3532 * // This snippet has been automatically generated and should be regarded as a code template only. 3533 * // It will require modifications to work: 3534 * // - It may require correct/in-range values for request initialization. 3535 * // - It may require specifying regional endpoints when creating the service client as shown in 3536 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3537 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3538 * GetBatchPredictionJobRequest request = 3539 * GetBatchPredictionJobRequest.newBuilder() 3540 * .setName( 3541 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]") 3542 * .toString()) 3543 * .build(); 3544 * ApiFuture<BatchPredictionJob> future = 3545 * jobServiceClient.getBatchPredictionJobCallable().futureCall(request); 3546 * // Do something. 3547 * BatchPredictionJob response = future.get(); 3548 * } 3549 * }</pre> 3550 */ 3551 public final UnaryCallable<GetBatchPredictionJobRequest, BatchPredictionJob> getBatchPredictionJobCallable()3552 getBatchPredictionJobCallable() { 3553 return stub.getBatchPredictionJobCallable(); 3554 } 3555 3556 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3557 /** 3558 * Lists BatchPredictionJobs in a Location. 3559 * 3560 * <p>Sample code: 3561 * 3562 * <pre>{@code 3563 * // This snippet has been automatically generated and should be regarded as a code template only. 3564 * // It will require modifications to work: 3565 * // - It may require correct/in-range values for request initialization. 3566 * // - It may require specifying regional endpoints when creating the service client as shown in 3567 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3568 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3569 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 3570 * for (BatchPredictionJob element : 3571 * jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) { 3572 * // doThingsWith(element); 3573 * } 3574 * } 3575 * }</pre> 3576 * 3577 * @param parent Required. The resource name of the Location to list the BatchPredictionJobs from. 3578 * Format: `projects/{project}/locations/{location}` 3579 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3580 */ listBatchPredictionJobs(LocationName parent)3581 public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(LocationName parent) { 3582 ListBatchPredictionJobsRequest request = 3583 ListBatchPredictionJobsRequest.newBuilder() 3584 .setParent(parent == null ? null : parent.toString()) 3585 .build(); 3586 return listBatchPredictionJobs(request); 3587 } 3588 3589 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3590 /** 3591 * Lists BatchPredictionJobs in a Location. 3592 * 3593 * <p>Sample code: 3594 * 3595 * <pre>{@code 3596 * // This snippet has been automatically generated and should be regarded as a code template only. 3597 * // It will require modifications to work: 3598 * // - It may require correct/in-range values for request initialization. 3599 * // - It may require specifying regional endpoints when creating the service client as shown in 3600 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3601 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3602 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 3603 * for (BatchPredictionJob element : 3604 * jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) { 3605 * // doThingsWith(element); 3606 * } 3607 * } 3608 * }</pre> 3609 * 3610 * @param parent Required. The resource name of the Location to list the BatchPredictionJobs from. 3611 * Format: `projects/{project}/locations/{location}` 3612 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3613 */ listBatchPredictionJobs(String parent)3614 public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(String parent) { 3615 ListBatchPredictionJobsRequest request = 3616 ListBatchPredictionJobsRequest.newBuilder().setParent(parent).build(); 3617 return listBatchPredictionJobs(request); 3618 } 3619 3620 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3621 /** 3622 * Lists BatchPredictionJobs in a Location. 3623 * 3624 * <p>Sample code: 3625 * 3626 * <pre>{@code 3627 * // This snippet has been automatically generated and should be regarded as a code template only. 3628 * // It will require modifications to work: 3629 * // - It may require correct/in-range values for request initialization. 3630 * // - It may require specifying regional endpoints when creating the service client as shown in 3631 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3632 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3633 * ListBatchPredictionJobsRequest request = 3634 * ListBatchPredictionJobsRequest.newBuilder() 3635 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 3636 * .setFilter("filter-1274492040") 3637 * .setPageSize(883849137) 3638 * .setPageToken("pageToken873572522") 3639 * .setReadMask(FieldMask.newBuilder().build()) 3640 * .build(); 3641 * for (BatchPredictionJob element : 3642 * jobServiceClient.listBatchPredictionJobs(request).iterateAll()) { 3643 * // doThingsWith(element); 3644 * } 3645 * } 3646 * }</pre> 3647 * 3648 * @param request The request object containing all of the parameters for the API call. 3649 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3650 */ listBatchPredictionJobs( ListBatchPredictionJobsRequest request)3651 public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs( 3652 ListBatchPredictionJobsRequest request) { 3653 return listBatchPredictionJobsPagedCallable().call(request); 3654 } 3655 3656 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3657 /** 3658 * Lists BatchPredictionJobs in a Location. 3659 * 3660 * <p>Sample code: 3661 * 3662 * <pre>{@code 3663 * // This snippet has been automatically generated and should be regarded as a code template only. 3664 * // It will require modifications to work: 3665 * // - It may require correct/in-range values for request initialization. 3666 * // - It may require specifying regional endpoints when creating the service client as shown in 3667 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3668 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3669 * ListBatchPredictionJobsRequest request = 3670 * ListBatchPredictionJobsRequest.newBuilder() 3671 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 3672 * .setFilter("filter-1274492040") 3673 * .setPageSize(883849137) 3674 * .setPageToken("pageToken873572522") 3675 * .setReadMask(FieldMask.newBuilder().build()) 3676 * .build(); 3677 * ApiFuture<BatchPredictionJob> future = 3678 * jobServiceClient.listBatchPredictionJobsPagedCallable().futureCall(request); 3679 * // Do something. 3680 * for (BatchPredictionJob element : future.get().iterateAll()) { 3681 * // doThingsWith(element); 3682 * } 3683 * } 3684 * }</pre> 3685 */ 3686 public final UnaryCallable<ListBatchPredictionJobsRequest, ListBatchPredictionJobsPagedResponse> listBatchPredictionJobsPagedCallable()3687 listBatchPredictionJobsPagedCallable() { 3688 return stub.listBatchPredictionJobsPagedCallable(); 3689 } 3690 3691 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3692 /** 3693 * Lists BatchPredictionJobs in a Location. 3694 * 3695 * <p>Sample code: 3696 * 3697 * <pre>{@code 3698 * // This snippet has been automatically generated and should be regarded as a code template only. 3699 * // It will require modifications to work: 3700 * // - It may require correct/in-range values for request initialization. 3701 * // - It may require specifying regional endpoints when creating the service client as shown in 3702 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3703 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3704 * ListBatchPredictionJobsRequest request = 3705 * ListBatchPredictionJobsRequest.newBuilder() 3706 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 3707 * .setFilter("filter-1274492040") 3708 * .setPageSize(883849137) 3709 * .setPageToken("pageToken873572522") 3710 * .setReadMask(FieldMask.newBuilder().build()) 3711 * .build(); 3712 * while (true) { 3713 * ListBatchPredictionJobsResponse response = 3714 * jobServiceClient.listBatchPredictionJobsCallable().call(request); 3715 * for (BatchPredictionJob element : response.getBatchPredictionJobsList()) { 3716 * // doThingsWith(element); 3717 * } 3718 * String nextPageToken = response.getNextPageToken(); 3719 * if (!Strings.isNullOrEmpty(nextPageToken)) { 3720 * request = request.toBuilder().setPageToken(nextPageToken).build(); 3721 * } else { 3722 * break; 3723 * } 3724 * } 3725 * } 3726 * }</pre> 3727 */ 3728 public final UnaryCallable<ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse> listBatchPredictionJobsCallable()3729 listBatchPredictionJobsCallable() { 3730 return stub.listBatchPredictionJobsCallable(); 3731 } 3732 3733 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3734 /** 3735 * Deletes a BatchPredictionJob. Can only be called on jobs that already finished. 3736 * 3737 * <p>Sample code: 3738 * 3739 * <pre>{@code 3740 * // This snippet has been automatically generated and should be regarded as a code template only. 3741 * // It will require modifications to work: 3742 * // - It may require correct/in-range values for request initialization. 3743 * // - It may require specifying regional endpoints when creating the service client as shown in 3744 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3745 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3746 * BatchPredictionJobName name = 3747 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]"); 3748 * jobServiceClient.deleteBatchPredictionJobAsync(name).get(); 3749 * } 3750 * }</pre> 3751 * 3752 * @param name Required. The name of the BatchPredictionJob resource to be deleted. Format: 3753 * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` 3754 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3755 */ deleteBatchPredictionJobAsync( BatchPredictionJobName name)3756 public final OperationFuture<Empty, DeleteOperationMetadata> deleteBatchPredictionJobAsync( 3757 BatchPredictionJobName name) { 3758 DeleteBatchPredictionJobRequest request = 3759 DeleteBatchPredictionJobRequest.newBuilder() 3760 .setName(name == null ? null : name.toString()) 3761 .build(); 3762 return deleteBatchPredictionJobAsync(request); 3763 } 3764 3765 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3766 /** 3767 * Deletes a BatchPredictionJob. Can only be called on jobs that already finished. 3768 * 3769 * <p>Sample code: 3770 * 3771 * <pre>{@code 3772 * // This snippet has been automatically generated and should be regarded as a code template only. 3773 * // It will require modifications to work: 3774 * // - It may require correct/in-range values for request initialization. 3775 * // - It may require specifying regional endpoints when creating the service client as shown in 3776 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3777 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3778 * String name = 3779 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString(); 3780 * jobServiceClient.deleteBatchPredictionJobAsync(name).get(); 3781 * } 3782 * }</pre> 3783 * 3784 * @param name Required. The name of the BatchPredictionJob resource to be deleted. Format: 3785 * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` 3786 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3787 */ deleteBatchPredictionJobAsync( String name)3788 public final OperationFuture<Empty, DeleteOperationMetadata> deleteBatchPredictionJobAsync( 3789 String name) { 3790 DeleteBatchPredictionJobRequest request = 3791 DeleteBatchPredictionJobRequest.newBuilder().setName(name).build(); 3792 return deleteBatchPredictionJobAsync(request); 3793 } 3794 3795 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3796 /** 3797 * Deletes a BatchPredictionJob. Can only be called on jobs that already finished. 3798 * 3799 * <p>Sample code: 3800 * 3801 * <pre>{@code 3802 * // This snippet has been automatically generated and should be regarded as a code template only. 3803 * // It will require modifications to work: 3804 * // - It may require correct/in-range values for request initialization. 3805 * // - It may require specifying regional endpoints when creating the service client as shown in 3806 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3807 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3808 * DeleteBatchPredictionJobRequest request = 3809 * DeleteBatchPredictionJobRequest.newBuilder() 3810 * .setName( 3811 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]") 3812 * .toString()) 3813 * .build(); 3814 * jobServiceClient.deleteBatchPredictionJobAsync(request).get(); 3815 * } 3816 * }</pre> 3817 * 3818 * @param request The request object containing all of the parameters for the API call. 3819 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3820 */ deleteBatchPredictionJobAsync( DeleteBatchPredictionJobRequest request)3821 public final OperationFuture<Empty, DeleteOperationMetadata> deleteBatchPredictionJobAsync( 3822 DeleteBatchPredictionJobRequest request) { 3823 return deleteBatchPredictionJobOperationCallable().futureCall(request); 3824 } 3825 3826 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3827 /** 3828 * Deletes a BatchPredictionJob. Can only be called on jobs that already finished. 3829 * 3830 * <p>Sample code: 3831 * 3832 * <pre>{@code 3833 * // This snippet has been automatically generated and should be regarded as a code template only. 3834 * // It will require modifications to work: 3835 * // - It may require correct/in-range values for request initialization. 3836 * // - It may require specifying regional endpoints when creating the service client as shown in 3837 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3838 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3839 * DeleteBatchPredictionJobRequest request = 3840 * DeleteBatchPredictionJobRequest.newBuilder() 3841 * .setName( 3842 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]") 3843 * .toString()) 3844 * .build(); 3845 * OperationFuture<Empty, DeleteOperationMetadata> future = 3846 * jobServiceClient.deleteBatchPredictionJobOperationCallable().futureCall(request); 3847 * // Do something. 3848 * future.get(); 3849 * } 3850 * }</pre> 3851 */ 3852 public final OperationCallable<DeleteBatchPredictionJobRequest, Empty, DeleteOperationMetadata> deleteBatchPredictionJobOperationCallable()3853 deleteBatchPredictionJobOperationCallable() { 3854 return stub.deleteBatchPredictionJobOperationCallable(); 3855 } 3856 3857 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3858 /** 3859 * Deletes a BatchPredictionJob. Can only be called on jobs that already finished. 3860 * 3861 * <p>Sample code: 3862 * 3863 * <pre>{@code 3864 * // This snippet has been automatically generated and should be regarded as a code template only. 3865 * // It will require modifications to work: 3866 * // - It may require correct/in-range values for request initialization. 3867 * // - It may require specifying regional endpoints when creating the service client as shown in 3868 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3869 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3870 * DeleteBatchPredictionJobRequest request = 3871 * DeleteBatchPredictionJobRequest.newBuilder() 3872 * .setName( 3873 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]") 3874 * .toString()) 3875 * .build(); 3876 * ApiFuture<Operation> future = 3877 * jobServiceClient.deleteBatchPredictionJobCallable().futureCall(request); 3878 * // Do something. 3879 * future.get(); 3880 * } 3881 * }</pre> 3882 */ 3883 public final UnaryCallable<DeleteBatchPredictionJobRequest, Operation> deleteBatchPredictionJobCallable()3884 deleteBatchPredictionJobCallable() { 3885 return stub.deleteBatchPredictionJobCallable(); 3886 } 3887 3888 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3889 /** 3890 * Cancels a BatchPredictionJob. 3891 * 3892 * <p>Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort 3893 * to cancel the job, but success is not guaranteed. Clients can use 3894 * [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] 3895 * or other methods to check whether the cancellation succeeded or whether the job completed 3896 * despite cancellation. On a successful cancellation, the BatchPredictionJob is not 3897 * deleted;instead its 3898 * [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.BatchPredictionJob.state] is set to 3899 * `CANCELLED`. Any files already outputted by the job are not deleted. 3900 * 3901 * <p>Sample code: 3902 * 3903 * <pre>{@code 3904 * // This snippet has been automatically generated and should be regarded as a code template only. 3905 * // It will require modifications to work: 3906 * // - It may require correct/in-range values for request initialization. 3907 * // - It may require specifying regional endpoints when creating the service client as shown in 3908 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3909 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3910 * BatchPredictionJobName name = 3911 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]"); 3912 * jobServiceClient.cancelBatchPredictionJob(name); 3913 * } 3914 * }</pre> 3915 * 3916 * @param name Required. The name of the BatchPredictionJob to cancel. Format: 3917 * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` 3918 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3919 */ cancelBatchPredictionJob(BatchPredictionJobName name)3920 public final void cancelBatchPredictionJob(BatchPredictionJobName name) { 3921 CancelBatchPredictionJobRequest request = 3922 CancelBatchPredictionJobRequest.newBuilder() 3923 .setName(name == null ? null : name.toString()) 3924 .build(); 3925 cancelBatchPredictionJob(request); 3926 } 3927 3928 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3929 /** 3930 * Cancels a BatchPredictionJob. 3931 * 3932 * <p>Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort 3933 * to cancel the job, but success is not guaranteed. Clients can use 3934 * [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] 3935 * or other methods to check whether the cancellation succeeded or whether the job completed 3936 * despite cancellation. On a successful cancellation, the BatchPredictionJob is not 3937 * deleted;instead its 3938 * [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.BatchPredictionJob.state] is set to 3939 * `CANCELLED`. Any files already outputted by the job are not deleted. 3940 * 3941 * <p>Sample code: 3942 * 3943 * <pre>{@code 3944 * // This snippet has been automatically generated and should be regarded as a code template only. 3945 * // It will require modifications to work: 3946 * // - It may require correct/in-range values for request initialization. 3947 * // - It may require specifying regional endpoints when creating the service client as shown in 3948 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3949 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3950 * String name = 3951 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString(); 3952 * jobServiceClient.cancelBatchPredictionJob(name); 3953 * } 3954 * }</pre> 3955 * 3956 * @param name Required. The name of the BatchPredictionJob to cancel. Format: 3957 * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` 3958 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3959 */ cancelBatchPredictionJob(String name)3960 public final void cancelBatchPredictionJob(String name) { 3961 CancelBatchPredictionJobRequest request = 3962 CancelBatchPredictionJobRequest.newBuilder().setName(name).build(); 3963 cancelBatchPredictionJob(request); 3964 } 3965 3966 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3967 /** 3968 * Cancels a BatchPredictionJob. 3969 * 3970 * <p>Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort 3971 * to cancel the job, but success is not guaranteed. Clients can use 3972 * [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] 3973 * or other methods to check whether the cancellation succeeded or whether the job completed 3974 * despite cancellation. On a successful cancellation, the BatchPredictionJob is not 3975 * deleted;instead its 3976 * [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.BatchPredictionJob.state] is set to 3977 * `CANCELLED`. Any files already outputted by the job are not deleted. 3978 * 3979 * <p>Sample code: 3980 * 3981 * <pre>{@code 3982 * // This snippet has been automatically generated and should be regarded as a code template only. 3983 * // It will require modifications to work: 3984 * // - It may require correct/in-range values for request initialization. 3985 * // - It may require specifying regional endpoints when creating the service client as shown in 3986 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3987 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 3988 * CancelBatchPredictionJobRequest request = 3989 * CancelBatchPredictionJobRequest.newBuilder() 3990 * .setName( 3991 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]") 3992 * .toString()) 3993 * .build(); 3994 * jobServiceClient.cancelBatchPredictionJob(request); 3995 * } 3996 * }</pre> 3997 * 3998 * @param request The request object containing all of the parameters for the API call. 3999 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4000 */ cancelBatchPredictionJob(CancelBatchPredictionJobRequest request)4001 public final void cancelBatchPredictionJob(CancelBatchPredictionJobRequest request) { 4002 cancelBatchPredictionJobCallable().call(request); 4003 } 4004 4005 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4006 /** 4007 * Cancels a BatchPredictionJob. 4008 * 4009 * <p>Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort 4010 * to cancel the job, but success is not guaranteed. Clients can use 4011 * [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] 4012 * or other methods to check whether the cancellation succeeded or whether the job completed 4013 * despite cancellation. On a successful cancellation, the BatchPredictionJob is not 4014 * deleted;instead its 4015 * [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.BatchPredictionJob.state] is set to 4016 * `CANCELLED`. Any files already outputted by the job are not deleted. 4017 * 4018 * <p>Sample code: 4019 * 4020 * <pre>{@code 4021 * // This snippet has been automatically generated and should be regarded as a code template only. 4022 * // It will require modifications to work: 4023 * // - It may require correct/in-range values for request initialization. 4024 * // - It may require specifying regional endpoints when creating the service client as shown in 4025 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4026 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4027 * CancelBatchPredictionJobRequest request = 4028 * CancelBatchPredictionJobRequest.newBuilder() 4029 * .setName( 4030 * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]") 4031 * .toString()) 4032 * .build(); 4033 * ApiFuture<Empty> future = 4034 * jobServiceClient.cancelBatchPredictionJobCallable().futureCall(request); 4035 * // Do something. 4036 * future.get(); 4037 * } 4038 * }</pre> 4039 */ 4040 public final UnaryCallable<CancelBatchPredictionJobRequest, Empty> cancelBatchPredictionJobCallable()4041 cancelBatchPredictionJobCallable() { 4042 return stub.cancelBatchPredictionJobCallable(); 4043 } 4044 4045 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4046 /** 4047 * Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval. 4048 * 4049 * <p>Sample code: 4050 * 4051 * <pre>{@code 4052 * // This snippet has been automatically generated and should be regarded as a code template only. 4053 * // It will require modifications to work: 4054 * // - It may require correct/in-range values for request initialization. 4055 * // - It may require specifying regional endpoints when creating the service client as shown in 4056 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4057 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4058 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 4059 * ModelDeploymentMonitoringJob modelDeploymentMonitoringJob = 4060 * ModelDeploymentMonitoringJob.newBuilder().build(); 4061 * ModelDeploymentMonitoringJob response = 4062 * jobServiceClient.createModelDeploymentMonitoringJob(parent, modelDeploymentMonitoringJob); 4063 * } 4064 * }</pre> 4065 * 4066 * @param parent Required. The parent of the ModelDeploymentMonitoringJob. Format: 4067 * `projects/{project}/locations/{location}` 4068 * @param modelDeploymentMonitoringJob Required. The ModelDeploymentMonitoringJob to create 4069 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4070 */ createModelDeploymentMonitoringJob( LocationName parent, ModelDeploymentMonitoringJob modelDeploymentMonitoringJob)4071 public final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob( 4072 LocationName parent, ModelDeploymentMonitoringJob modelDeploymentMonitoringJob) { 4073 CreateModelDeploymentMonitoringJobRequest request = 4074 CreateModelDeploymentMonitoringJobRequest.newBuilder() 4075 .setParent(parent == null ? null : parent.toString()) 4076 .setModelDeploymentMonitoringJob(modelDeploymentMonitoringJob) 4077 .build(); 4078 return createModelDeploymentMonitoringJob(request); 4079 } 4080 4081 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4082 /** 4083 * Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval. 4084 * 4085 * <p>Sample code: 4086 * 4087 * <pre>{@code 4088 * // This snippet has been automatically generated and should be regarded as a code template only. 4089 * // It will require modifications to work: 4090 * // - It may require correct/in-range values for request initialization. 4091 * // - It may require specifying regional endpoints when creating the service client as shown in 4092 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4093 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4094 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 4095 * ModelDeploymentMonitoringJob modelDeploymentMonitoringJob = 4096 * ModelDeploymentMonitoringJob.newBuilder().build(); 4097 * ModelDeploymentMonitoringJob response = 4098 * jobServiceClient.createModelDeploymentMonitoringJob(parent, modelDeploymentMonitoringJob); 4099 * } 4100 * }</pre> 4101 * 4102 * @param parent Required. The parent of the ModelDeploymentMonitoringJob. Format: 4103 * `projects/{project}/locations/{location}` 4104 * @param modelDeploymentMonitoringJob Required. The ModelDeploymentMonitoringJob to create 4105 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4106 */ createModelDeploymentMonitoringJob( String parent, ModelDeploymentMonitoringJob modelDeploymentMonitoringJob)4107 public final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob( 4108 String parent, ModelDeploymentMonitoringJob modelDeploymentMonitoringJob) { 4109 CreateModelDeploymentMonitoringJobRequest request = 4110 CreateModelDeploymentMonitoringJobRequest.newBuilder() 4111 .setParent(parent) 4112 .setModelDeploymentMonitoringJob(modelDeploymentMonitoringJob) 4113 .build(); 4114 return createModelDeploymentMonitoringJob(request); 4115 } 4116 4117 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4118 /** 4119 * Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval. 4120 * 4121 * <p>Sample code: 4122 * 4123 * <pre>{@code 4124 * // This snippet has been automatically generated and should be regarded as a code template only. 4125 * // It will require modifications to work: 4126 * // - It may require correct/in-range values for request initialization. 4127 * // - It may require specifying regional endpoints when creating the service client as shown in 4128 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4129 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4130 * CreateModelDeploymentMonitoringJobRequest request = 4131 * CreateModelDeploymentMonitoringJobRequest.newBuilder() 4132 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 4133 * .setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build()) 4134 * .build(); 4135 * ModelDeploymentMonitoringJob response = 4136 * jobServiceClient.createModelDeploymentMonitoringJob(request); 4137 * } 4138 * }</pre> 4139 * 4140 * @param request The request object containing all of the parameters for the API call. 4141 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4142 */ createModelDeploymentMonitoringJob( CreateModelDeploymentMonitoringJobRequest request)4143 public final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob( 4144 CreateModelDeploymentMonitoringJobRequest request) { 4145 return createModelDeploymentMonitoringJobCallable().call(request); 4146 } 4147 4148 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4149 /** 4150 * Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval. 4151 * 4152 * <p>Sample code: 4153 * 4154 * <pre>{@code 4155 * // This snippet has been automatically generated and should be regarded as a code template only. 4156 * // It will require modifications to work: 4157 * // - It may require correct/in-range values for request initialization. 4158 * // - It may require specifying regional endpoints when creating the service client as shown in 4159 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4160 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4161 * CreateModelDeploymentMonitoringJobRequest request = 4162 * CreateModelDeploymentMonitoringJobRequest.newBuilder() 4163 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 4164 * .setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build()) 4165 * .build(); 4166 * ApiFuture<ModelDeploymentMonitoringJob> future = 4167 * jobServiceClient.createModelDeploymentMonitoringJobCallable().futureCall(request); 4168 * // Do something. 4169 * ModelDeploymentMonitoringJob response = future.get(); 4170 * } 4171 * }</pre> 4172 */ 4173 public final UnaryCallable< 4174 CreateModelDeploymentMonitoringJobRequest, ModelDeploymentMonitoringJob> createModelDeploymentMonitoringJobCallable()4175 createModelDeploymentMonitoringJobCallable() { 4176 return stub.createModelDeploymentMonitoringJobCallable(); 4177 } 4178 4179 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4180 /** 4181 * Searches Model Monitoring Statistics generated within a given time window. 4182 * 4183 * <p>Sample code: 4184 * 4185 * <pre>{@code 4186 * // This snippet has been automatically generated and should be regarded as a code template only. 4187 * // It will require modifications to work: 4188 * // - It may require correct/in-range values for request initialization. 4189 * // - It may require specifying regional endpoints when creating the service client as shown in 4190 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4191 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4192 * ModelDeploymentMonitoringJobName modelDeploymentMonitoringJob = 4193 * ModelDeploymentMonitoringJobName.of( 4194 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]"); 4195 * String deployedModelId = "deployedModelId-1817547906"; 4196 * for (ModelMonitoringStatsAnomalies element : 4197 * jobServiceClient 4198 * .searchModelDeploymentMonitoringStatsAnomalies( 4199 * modelDeploymentMonitoringJob, deployedModelId) 4200 * .iterateAll()) { 4201 * // doThingsWith(element); 4202 * } 4203 * } 4204 * }</pre> 4205 * 4206 * @param modelDeploymentMonitoringJob Required. ModelDeploymentMonitoring Job resource name. 4207 * Format: 4208 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 4209 * @param deployedModelId Required. The DeployedModel ID of the 4210 * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. 4211 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4212 */ 4213 public final SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse searchModelDeploymentMonitoringStatsAnomalies( ModelDeploymentMonitoringJobName modelDeploymentMonitoringJob, String deployedModelId)4214 searchModelDeploymentMonitoringStatsAnomalies( 4215 ModelDeploymentMonitoringJobName modelDeploymentMonitoringJob, String deployedModelId) { 4216 SearchModelDeploymentMonitoringStatsAnomaliesRequest request = 4217 SearchModelDeploymentMonitoringStatsAnomaliesRequest.newBuilder() 4218 .setModelDeploymentMonitoringJob( 4219 modelDeploymentMonitoringJob == null 4220 ? null 4221 : modelDeploymentMonitoringJob.toString()) 4222 .setDeployedModelId(deployedModelId) 4223 .build(); 4224 return searchModelDeploymentMonitoringStatsAnomalies(request); 4225 } 4226 4227 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4228 /** 4229 * Searches Model Monitoring Statistics generated within a given time window. 4230 * 4231 * <p>Sample code: 4232 * 4233 * <pre>{@code 4234 * // This snippet has been automatically generated and should be regarded as a code template only. 4235 * // It will require modifications to work: 4236 * // - It may require correct/in-range values for request initialization. 4237 * // - It may require specifying regional endpoints when creating the service client as shown in 4238 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4239 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4240 * String modelDeploymentMonitoringJob = 4241 * ModelDeploymentMonitoringJobName.of( 4242 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4243 * .toString(); 4244 * String deployedModelId = "deployedModelId-1817547906"; 4245 * for (ModelMonitoringStatsAnomalies element : 4246 * jobServiceClient 4247 * .searchModelDeploymentMonitoringStatsAnomalies( 4248 * modelDeploymentMonitoringJob, deployedModelId) 4249 * .iterateAll()) { 4250 * // doThingsWith(element); 4251 * } 4252 * } 4253 * }</pre> 4254 * 4255 * @param modelDeploymentMonitoringJob Required. ModelDeploymentMonitoring Job resource name. 4256 * Format: 4257 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 4258 * @param deployedModelId Required. The DeployedModel ID of the 4259 * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. 4260 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4261 */ 4262 public final SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse searchModelDeploymentMonitoringStatsAnomalies( String modelDeploymentMonitoringJob, String deployedModelId)4263 searchModelDeploymentMonitoringStatsAnomalies( 4264 String modelDeploymentMonitoringJob, String deployedModelId) { 4265 SearchModelDeploymentMonitoringStatsAnomaliesRequest request = 4266 SearchModelDeploymentMonitoringStatsAnomaliesRequest.newBuilder() 4267 .setModelDeploymentMonitoringJob(modelDeploymentMonitoringJob) 4268 .setDeployedModelId(deployedModelId) 4269 .build(); 4270 return searchModelDeploymentMonitoringStatsAnomalies(request); 4271 } 4272 4273 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4274 /** 4275 * Searches Model Monitoring Statistics generated within a given time window. 4276 * 4277 * <p>Sample code: 4278 * 4279 * <pre>{@code 4280 * // This snippet has been automatically generated and should be regarded as a code template only. 4281 * // It will require modifications to work: 4282 * // - It may require correct/in-range values for request initialization. 4283 * // - It may require specifying regional endpoints when creating the service client as shown in 4284 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4285 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4286 * SearchModelDeploymentMonitoringStatsAnomaliesRequest request = 4287 * SearchModelDeploymentMonitoringStatsAnomaliesRequest.newBuilder() 4288 * .setModelDeploymentMonitoringJob( 4289 * ModelDeploymentMonitoringJobName.of( 4290 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4291 * .toString()) 4292 * .setDeployedModelId("deployedModelId-1817547906") 4293 * .setFeatureDisplayName("featureDisplayName-1741181545") 4294 * .addAllObjectives( 4295 * new ArrayList< 4296 * SearchModelDeploymentMonitoringStatsAnomaliesRequest 4297 * .StatsAnomaliesObjective>()) 4298 * .setPageSize(883849137) 4299 * .setPageToken("pageToken873572522") 4300 * .setStartTime(Timestamp.newBuilder().build()) 4301 * .setEndTime(Timestamp.newBuilder().build()) 4302 * .build(); 4303 * for (ModelMonitoringStatsAnomalies element : 4304 * jobServiceClient.searchModelDeploymentMonitoringStatsAnomalies(request).iterateAll()) { 4305 * // doThingsWith(element); 4306 * } 4307 * } 4308 * }</pre> 4309 * 4310 * @param request The request object containing all of the parameters for the API call. 4311 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4312 */ 4313 public final SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse searchModelDeploymentMonitoringStatsAnomalies( SearchModelDeploymentMonitoringStatsAnomaliesRequest request)4314 searchModelDeploymentMonitoringStatsAnomalies( 4315 SearchModelDeploymentMonitoringStatsAnomaliesRequest request) { 4316 return searchModelDeploymentMonitoringStatsAnomaliesPagedCallable().call(request); 4317 } 4318 4319 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4320 /** 4321 * Searches Model Monitoring Statistics generated within a given time window. 4322 * 4323 * <p>Sample code: 4324 * 4325 * <pre>{@code 4326 * // This snippet has been automatically generated and should be regarded as a code template only. 4327 * // It will require modifications to work: 4328 * // - It may require correct/in-range values for request initialization. 4329 * // - It may require specifying regional endpoints when creating the service client as shown in 4330 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4331 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4332 * SearchModelDeploymentMonitoringStatsAnomaliesRequest request = 4333 * SearchModelDeploymentMonitoringStatsAnomaliesRequest.newBuilder() 4334 * .setModelDeploymentMonitoringJob( 4335 * ModelDeploymentMonitoringJobName.of( 4336 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4337 * .toString()) 4338 * .setDeployedModelId("deployedModelId-1817547906") 4339 * .setFeatureDisplayName("featureDisplayName-1741181545") 4340 * .addAllObjectives( 4341 * new ArrayList< 4342 * SearchModelDeploymentMonitoringStatsAnomaliesRequest 4343 * .StatsAnomaliesObjective>()) 4344 * .setPageSize(883849137) 4345 * .setPageToken("pageToken873572522") 4346 * .setStartTime(Timestamp.newBuilder().build()) 4347 * .setEndTime(Timestamp.newBuilder().build()) 4348 * .build(); 4349 * ApiFuture<ModelMonitoringStatsAnomalies> future = 4350 * jobServiceClient 4351 * .searchModelDeploymentMonitoringStatsAnomaliesPagedCallable() 4352 * .futureCall(request); 4353 * // Do something. 4354 * for (ModelMonitoringStatsAnomalies element : future.get().iterateAll()) { 4355 * // doThingsWith(element); 4356 * } 4357 * } 4358 * }</pre> 4359 */ 4360 public final UnaryCallable< 4361 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 4362 SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse> searchModelDeploymentMonitoringStatsAnomaliesPagedCallable()4363 searchModelDeploymentMonitoringStatsAnomaliesPagedCallable() { 4364 return stub.searchModelDeploymentMonitoringStatsAnomaliesPagedCallable(); 4365 } 4366 4367 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4368 /** 4369 * Searches Model Monitoring Statistics generated within a given time window. 4370 * 4371 * <p>Sample code: 4372 * 4373 * <pre>{@code 4374 * // This snippet has been automatically generated and should be regarded as a code template only. 4375 * // It will require modifications to work: 4376 * // - It may require correct/in-range values for request initialization. 4377 * // - It may require specifying regional endpoints when creating the service client as shown in 4378 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4379 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4380 * SearchModelDeploymentMonitoringStatsAnomaliesRequest request = 4381 * SearchModelDeploymentMonitoringStatsAnomaliesRequest.newBuilder() 4382 * .setModelDeploymentMonitoringJob( 4383 * ModelDeploymentMonitoringJobName.of( 4384 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4385 * .toString()) 4386 * .setDeployedModelId("deployedModelId-1817547906") 4387 * .setFeatureDisplayName("featureDisplayName-1741181545") 4388 * .addAllObjectives( 4389 * new ArrayList< 4390 * SearchModelDeploymentMonitoringStatsAnomaliesRequest 4391 * .StatsAnomaliesObjective>()) 4392 * .setPageSize(883849137) 4393 * .setPageToken("pageToken873572522") 4394 * .setStartTime(Timestamp.newBuilder().build()) 4395 * .setEndTime(Timestamp.newBuilder().build()) 4396 * .build(); 4397 * while (true) { 4398 * SearchModelDeploymentMonitoringStatsAnomaliesResponse response = 4399 * jobServiceClient.searchModelDeploymentMonitoringStatsAnomaliesCallable().call(request); 4400 * for (ModelMonitoringStatsAnomalies element : response.getMonitoringStatsList()) { 4401 * // doThingsWith(element); 4402 * } 4403 * String nextPageToken = response.getNextPageToken(); 4404 * if (!Strings.isNullOrEmpty(nextPageToken)) { 4405 * request = request.toBuilder().setPageToken(nextPageToken).build(); 4406 * } else { 4407 * break; 4408 * } 4409 * } 4410 * } 4411 * }</pre> 4412 */ 4413 public final UnaryCallable< 4414 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 4415 SearchModelDeploymentMonitoringStatsAnomaliesResponse> searchModelDeploymentMonitoringStatsAnomaliesCallable()4416 searchModelDeploymentMonitoringStatsAnomaliesCallable() { 4417 return stub.searchModelDeploymentMonitoringStatsAnomaliesCallable(); 4418 } 4419 4420 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4421 /** 4422 * Gets a ModelDeploymentMonitoringJob. 4423 * 4424 * <p>Sample code: 4425 * 4426 * <pre>{@code 4427 * // This snippet has been automatically generated and should be regarded as a code template only. 4428 * // It will require modifications to work: 4429 * // - It may require correct/in-range values for request initialization. 4430 * // - It may require specifying regional endpoints when creating the service client as shown in 4431 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4432 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4433 * ModelDeploymentMonitoringJobName name = 4434 * ModelDeploymentMonitoringJobName.of( 4435 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]"); 4436 * ModelDeploymentMonitoringJob response = 4437 * jobServiceClient.getModelDeploymentMonitoringJob(name); 4438 * } 4439 * }</pre> 4440 * 4441 * @param name Required. The resource name of the ModelDeploymentMonitoringJob. Format: 4442 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 4443 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4444 */ getModelDeploymentMonitoringJob( ModelDeploymentMonitoringJobName name)4445 public final ModelDeploymentMonitoringJob getModelDeploymentMonitoringJob( 4446 ModelDeploymentMonitoringJobName name) { 4447 GetModelDeploymentMonitoringJobRequest request = 4448 GetModelDeploymentMonitoringJobRequest.newBuilder() 4449 .setName(name == null ? null : name.toString()) 4450 .build(); 4451 return getModelDeploymentMonitoringJob(request); 4452 } 4453 4454 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4455 /** 4456 * Gets a ModelDeploymentMonitoringJob. 4457 * 4458 * <p>Sample code: 4459 * 4460 * <pre>{@code 4461 * // This snippet has been automatically generated and should be regarded as a code template only. 4462 * // It will require modifications to work: 4463 * // - It may require correct/in-range values for request initialization. 4464 * // - It may require specifying regional endpoints when creating the service client as shown in 4465 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4466 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4467 * String name = 4468 * ModelDeploymentMonitoringJobName.of( 4469 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4470 * .toString(); 4471 * ModelDeploymentMonitoringJob response = 4472 * jobServiceClient.getModelDeploymentMonitoringJob(name); 4473 * } 4474 * }</pre> 4475 * 4476 * @param name Required. The resource name of the ModelDeploymentMonitoringJob. Format: 4477 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 4478 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4479 */ getModelDeploymentMonitoringJob(String name)4480 public final ModelDeploymentMonitoringJob getModelDeploymentMonitoringJob(String name) { 4481 GetModelDeploymentMonitoringJobRequest request = 4482 GetModelDeploymentMonitoringJobRequest.newBuilder().setName(name).build(); 4483 return getModelDeploymentMonitoringJob(request); 4484 } 4485 4486 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4487 /** 4488 * Gets a ModelDeploymentMonitoringJob. 4489 * 4490 * <p>Sample code: 4491 * 4492 * <pre>{@code 4493 * // This snippet has been automatically generated and should be regarded as a code template only. 4494 * // It will require modifications to work: 4495 * // - It may require correct/in-range values for request initialization. 4496 * // - It may require specifying regional endpoints when creating the service client as shown in 4497 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4498 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4499 * GetModelDeploymentMonitoringJobRequest request = 4500 * GetModelDeploymentMonitoringJobRequest.newBuilder() 4501 * .setName( 4502 * ModelDeploymentMonitoringJobName.of( 4503 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4504 * .toString()) 4505 * .build(); 4506 * ModelDeploymentMonitoringJob response = 4507 * jobServiceClient.getModelDeploymentMonitoringJob(request); 4508 * } 4509 * }</pre> 4510 * 4511 * @param request The request object containing all of the parameters for the API call. 4512 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4513 */ getModelDeploymentMonitoringJob( GetModelDeploymentMonitoringJobRequest request)4514 public final ModelDeploymentMonitoringJob getModelDeploymentMonitoringJob( 4515 GetModelDeploymentMonitoringJobRequest request) { 4516 return getModelDeploymentMonitoringJobCallable().call(request); 4517 } 4518 4519 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4520 /** 4521 * Gets a ModelDeploymentMonitoringJob. 4522 * 4523 * <p>Sample code: 4524 * 4525 * <pre>{@code 4526 * // This snippet has been automatically generated and should be regarded as a code template only. 4527 * // It will require modifications to work: 4528 * // - It may require correct/in-range values for request initialization. 4529 * // - It may require specifying regional endpoints when creating the service client as shown in 4530 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4531 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4532 * GetModelDeploymentMonitoringJobRequest request = 4533 * GetModelDeploymentMonitoringJobRequest.newBuilder() 4534 * .setName( 4535 * ModelDeploymentMonitoringJobName.of( 4536 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4537 * .toString()) 4538 * .build(); 4539 * ApiFuture<ModelDeploymentMonitoringJob> future = 4540 * jobServiceClient.getModelDeploymentMonitoringJobCallable().futureCall(request); 4541 * // Do something. 4542 * ModelDeploymentMonitoringJob response = future.get(); 4543 * } 4544 * }</pre> 4545 */ 4546 public final UnaryCallable<GetModelDeploymentMonitoringJobRequest, ModelDeploymentMonitoringJob> getModelDeploymentMonitoringJobCallable()4547 getModelDeploymentMonitoringJobCallable() { 4548 return stub.getModelDeploymentMonitoringJobCallable(); 4549 } 4550 4551 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4552 /** 4553 * Lists ModelDeploymentMonitoringJobs in a Location. 4554 * 4555 * <p>Sample code: 4556 * 4557 * <pre>{@code 4558 * // This snippet has been automatically generated and should be regarded as a code template only. 4559 * // It will require modifications to work: 4560 * // - It may require correct/in-range values for request initialization. 4561 * // - It may require specifying regional endpoints when creating the service client as shown in 4562 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4563 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4564 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 4565 * for (ModelDeploymentMonitoringJob element : 4566 * jobServiceClient.listModelDeploymentMonitoringJobs(parent).iterateAll()) { 4567 * // doThingsWith(element); 4568 * } 4569 * } 4570 * }</pre> 4571 * 4572 * @param parent Required. The parent of the ModelDeploymentMonitoringJob. Format: 4573 * `projects/{project}/locations/{location}` 4574 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4575 */ listModelDeploymentMonitoringJobs( LocationName parent)4576 public final ListModelDeploymentMonitoringJobsPagedResponse listModelDeploymentMonitoringJobs( 4577 LocationName parent) { 4578 ListModelDeploymentMonitoringJobsRequest request = 4579 ListModelDeploymentMonitoringJobsRequest.newBuilder() 4580 .setParent(parent == null ? null : parent.toString()) 4581 .build(); 4582 return listModelDeploymentMonitoringJobs(request); 4583 } 4584 4585 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4586 /** 4587 * Lists ModelDeploymentMonitoringJobs in a Location. 4588 * 4589 * <p>Sample code: 4590 * 4591 * <pre>{@code 4592 * // This snippet has been automatically generated and should be regarded as a code template only. 4593 * // It will require modifications to work: 4594 * // - It may require correct/in-range values for request initialization. 4595 * // - It may require specifying regional endpoints when creating the service client as shown in 4596 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4597 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4598 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 4599 * for (ModelDeploymentMonitoringJob element : 4600 * jobServiceClient.listModelDeploymentMonitoringJobs(parent).iterateAll()) { 4601 * // doThingsWith(element); 4602 * } 4603 * } 4604 * }</pre> 4605 * 4606 * @param parent Required. The parent of the ModelDeploymentMonitoringJob. Format: 4607 * `projects/{project}/locations/{location}` 4608 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4609 */ listModelDeploymentMonitoringJobs( String parent)4610 public final ListModelDeploymentMonitoringJobsPagedResponse listModelDeploymentMonitoringJobs( 4611 String parent) { 4612 ListModelDeploymentMonitoringJobsRequest request = 4613 ListModelDeploymentMonitoringJobsRequest.newBuilder().setParent(parent).build(); 4614 return listModelDeploymentMonitoringJobs(request); 4615 } 4616 4617 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4618 /** 4619 * Lists ModelDeploymentMonitoringJobs in a Location. 4620 * 4621 * <p>Sample code: 4622 * 4623 * <pre>{@code 4624 * // This snippet has been automatically generated and should be regarded as a code template only. 4625 * // It will require modifications to work: 4626 * // - It may require correct/in-range values for request initialization. 4627 * // - It may require specifying regional endpoints when creating the service client as shown in 4628 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4629 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4630 * ListModelDeploymentMonitoringJobsRequest request = 4631 * ListModelDeploymentMonitoringJobsRequest.newBuilder() 4632 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 4633 * .setFilter("filter-1274492040") 4634 * .setPageSize(883849137) 4635 * .setPageToken("pageToken873572522") 4636 * .setReadMask(FieldMask.newBuilder().build()) 4637 * .build(); 4638 * for (ModelDeploymentMonitoringJob element : 4639 * jobServiceClient.listModelDeploymentMonitoringJobs(request).iterateAll()) { 4640 * // doThingsWith(element); 4641 * } 4642 * } 4643 * }</pre> 4644 * 4645 * @param request The request object containing all of the parameters for the API call. 4646 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4647 */ listModelDeploymentMonitoringJobs( ListModelDeploymentMonitoringJobsRequest request)4648 public final ListModelDeploymentMonitoringJobsPagedResponse listModelDeploymentMonitoringJobs( 4649 ListModelDeploymentMonitoringJobsRequest request) { 4650 return listModelDeploymentMonitoringJobsPagedCallable().call(request); 4651 } 4652 4653 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4654 /** 4655 * Lists ModelDeploymentMonitoringJobs in a Location. 4656 * 4657 * <p>Sample code: 4658 * 4659 * <pre>{@code 4660 * // This snippet has been automatically generated and should be regarded as a code template only. 4661 * // It will require modifications to work: 4662 * // - It may require correct/in-range values for request initialization. 4663 * // - It may require specifying regional endpoints when creating the service client as shown in 4664 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4665 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4666 * ListModelDeploymentMonitoringJobsRequest request = 4667 * ListModelDeploymentMonitoringJobsRequest.newBuilder() 4668 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 4669 * .setFilter("filter-1274492040") 4670 * .setPageSize(883849137) 4671 * .setPageToken("pageToken873572522") 4672 * .setReadMask(FieldMask.newBuilder().build()) 4673 * .build(); 4674 * ApiFuture<ModelDeploymentMonitoringJob> future = 4675 * jobServiceClient.listModelDeploymentMonitoringJobsPagedCallable().futureCall(request); 4676 * // Do something. 4677 * for (ModelDeploymentMonitoringJob element : future.get().iterateAll()) { 4678 * // doThingsWith(element); 4679 * } 4680 * } 4681 * }</pre> 4682 */ 4683 public final UnaryCallable< 4684 ListModelDeploymentMonitoringJobsRequest, ListModelDeploymentMonitoringJobsPagedResponse> listModelDeploymentMonitoringJobsPagedCallable()4685 listModelDeploymentMonitoringJobsPagedCallable() { 4686 return stub.listModelDeploymentMonitoringJobsPagedCallable(); 4687 } 4688 4689 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4690 /** 4691 * Lists ModelDeploymentMonitoringJobs in a Location. 4692 * 4693 * <p>Sample code: 4694 * 4695 * <pre>{@code 4696 * // This snippet has been automatically generated and should be regarded as a code template only. 4697 * // It will require modifications to work: 4698 * // - It may require correct/in-range values for request initialization. 4699 * // - It may require specifying regional endpoints when creating the service client as shown in 4700 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4701 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4702 * ListModelDeploymentMonitoringJobsRequest request = 4703 * ListModelDeploymentMonitoringJobsRequest.newBuilder() 4704 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 4705 * .setFilter("filter-1274492040") 4706 * .setPageSize(883849137) 4707 * .setPageToken("pageToken873572522") 4708 * .setReadMask(FieldMask.newBuilder().build()) 4709 * .build(); 4710 * while (true) { 4711 * ListModelDeploymentMonitoringJobsResponse response = 4712 * jobServiceClient.listModelDeploymentMonitoringJobsCallable().call(request); 4713 * for (ModelDeploymentMonitoringJob element : 4714 * response.getModelDeploymentMonitoringJobsList()) { 4715 * // doThingsWith(element); 4716 * } 4717 * String nextPageToken = response.getNextPageToken(); 4718 * if (!Strings.isNullOrEmpty(nextPageToken)) { 4719 * request = request.toBuilder().setPageToken(nextPageToken).build(); 4720 * } else { 4721 * break; 4722 * } 4723 * } 4724 * } 4725 * }</pre> 4726 */ 4727 public final UnaryCallable< 4728 ListModelDeploymentMonitoringJobsRequest, ListModelDeploymentMonitoringJobsResponse> listModelDeploymentMonitoringJobsCallable()4729 listModelDeploymentMonitoringJobsCallable() { 4730 return stub.listModelDeploymentMonitoringJobsCallable(); 4731 } 4732 4733 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4734 /** 4735 * Updates a ModelDeploymentMonitoringJob. 4736 * 4737 * <p>Sample code: 4738 * 4739 * <pre>{@code 4740 * // This snippet has been automatically generated and should be regarded as a code template only. 4741 * // It will require modifications to work: 4742 * // - It may require correct/in-range values for request initialization. 4743 * // - It may require specifying regional endpoints when creating the service client as shown in 4744 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4745 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4746 * ModelDeploymentMonitoringJob modelDeploymentMonitoringJob = 4747 * ModelDeploymentMonitoringJob.newBuilder().build(); 4748 * FieldMask updateMask = FieldMask.newBuilder().build(); 4749 * ModelDeploymentMonitoringJob response = 4750 * jobServiceClient 4751 * .updateModelDeploymentMonitoringJobAsync(modelDeploymentMonitoringJob, updateMask) 4752 * .get(); 4753 * } 4754 * }</pre> 4755 * 4756 * @param modelDeploymentMonitoringJob Required. The model monitoring configuration which replaces 4757 * the resource on the server. 4758 * @param updateMask Required. The update mask is used to specify the fields to be overwritten in 4759 * the ModelDeploymentMonitoringJob resource by the update. The fields specified in the 4760 * update_mask are relative to the resource, not the full request. A field will be overwritten 4761 * if it is in the mask. If the user does not provide a mask then only the non-empty fields 4762 * present in the request will be overwritten. Set the update_mask to `*` to override all 4763 * fields. For the objective config, the user can either provide the update mask for 4764 * model_deployment_monitoring_objective_configs or any combination of its nested fields, such 4765 * as: model_deployment_monitoring_objective_configs.objective_config.training_dataset. 4766 * <p>Updatable fields: 4767 * <p>* `display_name` * `model_deployment_monitoring_schedule_config` * 4768 * `model_monitoring_alert_config` * `logging_sampling_strategy` * `labels` * 4769 * `log_ttl` * `enable_monitoring_pipeline_logs` . and * 4770 * `model_deployment_monitoring_objective_configs` . or * 4771 * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` * 4772 * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` 4773 * * 4774 * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` 4775 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4776 */ 4777 public final OperationFuture< 4778 ModelDeploymentMonitoringJob, UpdateModelDeploymentMonitoringJobOperationMetadata> updateModelDeploymentMonitoringJobAsync( ModelDeploymentMonitoringJob modelDeploymentMonitoringJob, FieldMask updateMask)4779 updateModelDeploymentMonitoringJobAsync( 4780 ModelDeploymentMonitoringJob modelDeploymentMonitoringJob, FieldMask updateMask) { 4781 UpdateModelDeploymentMonitoringJobRequest request = 4782 UpdateModelDeploymentMonitoringJobRequest.newBuilder() 4783 .setModelDeploymentMonitoringJob(modelDeploymentMonitoringJob) 4784 .setUpdateMask(updateMask) 4785 .build(); 4786 return updateModelDeploymentMonitoringJobAsync(request); 4787 } 4788 4789 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4790 /** 4791 * Updates a ModelDeploymentMonitoringJob. 4792 * 4793 * <p>Sample code: 4794 * 4795 * <pre>{@code 4796 * // This snippet has been automatically generated and should be regarded as a code template only. 4797 * // It will require modifications to work: 4798 * // - It may require correct/in-range values for request initialization. 4799 * // - It may require specifying regional endpoints when creating the service client as shown in 4800 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4801 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4802 * UpdateModelDeploymentMonitoringJobRequest request = 4803 * UpdateModelDeploymentMonitoringJobRequest.newBuilder() 4804 * .setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build()) 4805 * .setUpdateMask(FieldMask.newBuilder().build()) 4806 * .build(); 4807 * ModelDeploymentMonitoringJob response = 4808 * jobServiceClient.updateModelDeploymentMonitoringJobAsync(request).get(); 4809 * } 4810 * }</pre> 4811 * 4812 * @param request The request object containing all of the parameters for the API call. 4813 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4814 */ 4815 public final OperationFuture< 4816 ModelDeploymentMonitoringJob, UpdateModelDeploymentMonitoringJobOperationMetadata> updateModelDeploymentMonitoringJobAsync(UpdateModelDeploymentMonitoringJobRequest request)4817 updateModelDeploymentMonitoringJobAsync(UpdateModelDeploymentMonitoringJobRequest request) { 4818 return updateModelDeploymentMonitoringJobOperationCallable().futureCall(request); 4819 } 4820 4821 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4822 /** 4823 * Updates a ModelDeploymentMonitoringJob. 4824 * 4825 * <p>Sample code: 4826 * 4827 * <pre>{@code 4828 * // This snippet has been automatically generated and should be regarded as a code template only. 4829 * // It will require modifications to work: 4830 * // - It may require correct/in-range values for request initialization. 4831 * // - It may require specifying regional endpoints when creating the service client as shown in 4832 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4833 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4834 * UpdateModelDeploymentMonitoringJobRequest request = 4835 * UpdateModelDeploymentMonitoringJobRequest.newBuilder() 4836 * .setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build()) 4837 * .setUpdateMask(FieldMask.newBuilder().build()) 4838 * .build(); 4839 * OperationFuture< 4840 * ModelDeploymentMonitoringJob, UpdateModelDeploymentMonitoringJobOperationMetadata> 4841 * future = 4842 * jobServiceClient 4843 * .updateModelDeploymentMonitoringJobOperationCallable() 4844 * .futureCall(request); 4845 * // Do something. 4846 * ModelDeploymentMonitoringJob response = future.get(); 4847 * } 4848 * }</pre> 4849 */ 4850 public final OperationCallable< 4851 UpdateModelDeploymentMonitoringJobRequest, 4852 ModelDeploymentMonitoringJob, 4853 UpdateModelDeploymentMonitoringJobOperationMetadata> updateModelDeploymentMonitoringJobOperationCallable()4854 updateModelDeploymentMonitoringJobOperationCallable() { 4855 return stub.updateModelDeploymentMonitoringJobOperationCallable(); 4856 } 4857 4858 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4859 /** 4860 * Updates a ModelDeploymentMonitoringJob. 4861 * 4862 * <p>Sample code: 4863 * 4864 * <pre>{@code 4865 * // This snippet has been automatically generated and should be regarded as a code template only. 4866 * // It will require modifications to work: 4867 * // - It may require correct/in-range values for request initialization. 4868 * // - It may require specifying regional endpoints when creating the service client as shown in 4869 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4870 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4871 * UpdateModelDeploymentMonitoringJobRequest request = 4872 * UpdateModelDeploymentMonitoringJobRequest.newBuilder() 4873 * .setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build()) 4874 * .setUpdateMask(FieldMask.newBuilder().build()) 4875 * .build(); 4876 * ApiFuture<Operation> future = 4877 * jobServiceClient.updateModelDeploymentMonitoringJobCallable().futureCall(request); 4878 * // Do something. 4879 * Operation response = future.get(); 4880 * } 4881 * }</pre> 4882 */ 4883 public final UnaryCallable<UpdateModelDeploymentMonitoringJobRequest, Operation> updateModelDeploymentMonitoringJobCallable()4884 updateModelDeploymentMonitoringJobCallable() { 4885 return stub.updateModelDeploymentMonitoringJobCallable(); 4886 } 4887 4888 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4889 /** 4890 * Deletes a ModelDeploymentMonitoringJob. 4891 * 4892 * <p>Sample code: 4893 * 4894 * <pre>{@code 4895 * // This snippet has been automatically generated and should be regarded as a code template only. 4896 * // It will require modifications to work: 4897 * // - It may require correct/in-range values for request initialization. 4898 * // - It may require specifying regional endpoints when creating the service client as shown in 4899 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4900 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4901 * ModelDeploymentMonitoringJobName name = 4902 * ModelDeploymentMonitoringJobName.of( 4903 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]"); 4904 * jobServiceClient.deleteModelDeploymentMonitoringJobAsync(name).get(); 4905 * } 4906 * }</pre> 4907 * 4908 * @param name Required. The resource name of the model monitoring job to delete. Format: 4909 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 4910 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4911 */ 4912 public final OperationFuture<Empty, DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(ModelDeploymentMonitoringJobName name)4913 deleteModelDeploymentMonitoringJobAsync(ModelDeploymentMonitoringJobName name) { 4914 DeleteModelDeploymentMonitoringJobRequest request = 4915 DeleteModelDeploymentMonitoringJobRequest.newBuilder() 4916 .setName(name == null ? null : name.toString()) 4917 .build(); 4918 return deleteModelDeploymentMonitoringJobAsync(request); 4919 } 4920 4921 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4922 /** 4923 * Deletes a ModelDeploymentMonitoringJob. 4924 * 4925 * <p>Sample code: 4926 * 4927 * <pre>{@code 4928 * // This snippet has been automatically generated and should be regarded as a code template only. 4929 * // It will require modifications to work: 4930 * // - It may require correct/in-range values for request initialization. 4931 * // - It may require specifying regional endpoints when creating the service client as shown in 4932 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4933 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4934 * String name = 4935 * ModelDeploymentMonitoringJobName.of( 4936 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4937 * .toString(); 4938 * jobServiceClient.deleteModelDeploymentMonitoringJobAsync(name).get(); 4939 * } 4940 * }</pre> 4941 * 4942 * @param name Required. The resource name of the model monitoring job to delete. Format: 4943 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 4944 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4945 */ 4946 public final OperationFuture<Empty, DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(String name)4947 deleteModelDeploymentMonitoringJobAsync(String name) { 4948 DeleteModelDeploymentMonitoringJobRequest request = 4949 DeleteModelDeploymentMonitoringJobRequest.newBuilder().setName(name).build(); 4950 return deleteModelDeploymentMonitoringJobAsync(request); 4951 } 4952 4953 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4954 /** 4955 * Deletes a ModelDeploymentMonitoringJob. 4956 * 4957 * <p>Sample code: 4958 * 4959 * <pre>{@code 4960 * // This snippet has been automatically generated and should be regarded as a code template only. 4961 * // It will require modifications to work: 4962 * // - It may require correct/in-range values for request initialization. 4963 * // - It may require specifying regional endpoints when creating the service client as shown in 4964 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4965 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4966 * DeleteModelDeploymentMonitoringJobRequest request = 4967 * DeleteModelDeploymentMonitoringJobRequest.newBuilder() 4968 * .setName( 4969 * ModelDeploymentMonitoringJobName.of( 4970 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 4971 * .toString()) 4972 * .build(); 4973 * jobServiceClient.deleteModelDeploymentMonitoringJobAsync(request).get(); 4974 * } 4975 * }</pre> 4976 * 4977 * @param request The request object containing all of the parameters for the API call. 4978 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4979 */ 4980 public final OperationFuture<Empty, DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(DeleteModelDeploymentMonitoringJobRequest request)4981 deleteModelDeploymentMonitoringJobAsync(DeleteModelDeploymentMonitoringJobRequest request) { 4982 return deleteModelDeploymentMonitoringJobOperationCallable().futureCall(request); 4983 } 4984 4985 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4986 /** 4987 * Deletes a ModelDeploymentMonitoringJob. 4988 * 4989 * <p>Sample code: 4990 * 4991 * <pre>{@code 4992 * // This snippet has been automatically generated and should be regarded as a code template only. 4993 * // It will require modifications to work: 4994 * // - It may require correct/in-range values for request initialization. 4995 * // - It may require specifying regional endpoints when creating the service client as shown in 4996 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4997 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 4998 * DeleteModelDeploymentMonitoringJobRequest request = 4999 * DeleteModelDeploymentMonitoringJobRequest.newBuilder() 5000 * .setName( 5001 * ModelDeploymentMonitoringJobName.of( 5002 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 5003 * .toString()) 5004 * .build(); 5005 * OperationFuture<Empty, DeleteOperationMetadata> future = 5006 * jobServiceClient 5007 * .deleteModelDeploymentMonitoringJobOperationCallable() 5008 * .futureCall(request); 5009 * // Do something. 5010 * future.get(); 5011 * } 5012 * }</pre> 5013 */ 5014 public final OperationCallable< 5015 DeleteModelDeploymentMonitoringJobRequest, Empty, DeleteOperationMetadata> deleteModelDeploymentMonitoringJobOperationCallable()5016 deleteModelDeploymentMonitoringJobOperationCallable() { 5017 return stub.deleteModelDeploymentMonitoringJobOperationCallable(); 5018 } 5019 5020 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5021 /** 5022 * Deletes a ModelDeploymentMonitoringJob. 5023 * 5024 * <p>Sample code: 5025 * 5026 * <pre>{@code 5027 * // This snippet has been automatically generated and should be regarded as a code template only. 5028 * // It will require modifications to work: 5029 * // - It may require correct/in-range values for request initialization. 5030 * // - It may require specifying regional endpoints when creating the service client as shown in 5031 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5032 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5033 * DeleteModelDeploymentMonitoringJobRequest request = 5034 * DeleteModelDeploymentMonitoringJobRequest.newBuilder() 5035 * .setName( 5036 * ModelDeploymentMonitoringJobName.of( 5037 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 5038 * .toString()) 5039 * .build(); 5040 * ApiFuture<Operation> future = 5041 * jobServiceClient.deleteModelDeploymentMonitoringJobCallable().futureCall(request); 5042 * // Do something. 5043 * future.get(); 5044 * } 5045 * }</pre> 5046 */ 5047 public final UnaryCallable<DeleteModelDeploymentMonitoringJobRequest, Operation> deleteModelDeploymentMonitoringJobCallable()5048 deleteModelDeploymentMonitoringJobCallable() { 5049 return stub.deleteModelDeploymentMonitoringJobCallable(); 5050 } 5051 5052 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5053 /** 5054 * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server makes a best effort to 5055 * cancel the job. Will mark 5056 * [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.state] 5057 * to 'PAUSED'. 5058 * 5059 * <p>Sample code: 5060 * 5061 * <pre>{@code 5062 * // This snippet has been automatically generated and should be regarded as a code template only. 5063 * // It will require modifications to work: 5064 * // - It may require correct/in-range values for request initialization. 5065 * // - It may require specifying regional endpoints when creating the service client as shown in 5066 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5067 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5068 * ModelDeploymentMonitoringJobName name = 5069 * ModelDeploymentMonitoringJobName.of( 5070 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]"); 5071 * jobServiceClient.pauseModelDeploymentMonitoringJob(name); 5072 * } 5073 * }</pre> 5074 * 5075 * @param name Required. The resource name of the ModelDeploymentMonitoringJob to pause. Format: 5076 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 5077 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5078 */ pauseModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name)5079 public final void pauseModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name) { 5080 PauseModelDeploymentMonitoringJobRequest request = 5081 PauseModelDeploymentMonitoringJobRequest.newBuilder() 5082 .setName(name == null ? null : name.toString()) 5083 .build(); 5084 pauseModelDeploymentMonitoringJob(request); 5085 } 5086 5087 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5088 /** 5089 * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server makes a best effort to 5090 * cancel the job. Will mark 5091 * [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.state] 5092 * to 'PAUSED'. 5093 * 5094 * <p>Sample code: 5095 * 5096 * <pre>{@code 5097 * // This snippet has been automatically generated and should be regarded as a code template only. 5098 * // It will require modifications to work: 5099 * // - It may require correct/in-range values for request initialization. 5100 * // - It may require specifying regional endpoints when creating the service client as shown in 5101 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5102 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5103 * String name = 5104 * ModelDeploymentMonitoringJobName.of( 5105 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 5106 * .toString(); 5107 * jobServiceClient.pauseModelDeploymentMonitoringJob(name); 5108 * } 5109 * }</pre> 5110 * 5111 * @param name Required. The resource name of the ModelDeploymentMonitoringJob to pause. Format: 5112 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 5113 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5114 */ pauseModelDeploymentMonitoringJob(String name)5115 public final void pauseModelDeploymentMonitoringJob(String name) { 5116 PauseModelDeploymentMonitoringJobRequest request = 5117 PauseModelDeploymentMonitoringJobRequest.newBuilder().setName(name).build(); 5118 pauseModelDeploymentMonitoringJob(request); 5119 } 5120 5121 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5122 /** 5123 * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server makes a best effort to 5124 * cancel the job. Will mark 5125 * [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.state] 5126 * to 'PAUSED'. 5127 * 5128 * <p>Sample code: 5129 * 5130 * <pre>{@code 5131 * // This snippet has been automatically generated and should be regarded as a code template only. 5132 * // It will require modifications to work: 5133 * // - It may require correct/in-range values for request initialization. 5134 * // - It may require specifying regional endpoints when creating the service client as shown in 5135 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5136 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5137 * PauseModelDeploymentMonitoringJobRequest request = 5138 * PauseModelDeploymentMonitoringJobRequest.newBuilder() 5139 * .setName( 5140 * ModelDeploymentMonitoringJobName.of( 5141 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 5142 * .toString()) 5143 * .build(); 5144 * jobServiceClient.pauseModelDeploymentMonitoringJob(request); 5145 * } 5146 * }</pre> 5147 * 5148 * @param request The request object containing all of the parameters for the API call. 5149 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5150 */ pauseModelDeploymentMonitoringJob( PauseModelDeploymentMonitoringJobRequest request)5151 public final void pauseModelDeploymentMonitoringJob( 5152 PauseModelDeploymentMonitoringJobRequest request) { 5153 pauseModelDeploymentMonitoringJobCallable().call(request); 5154 } 5155 5156 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5157 /** 5158 * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server makes a best effort to 5159 * cancel the job. Will mark 5160 * [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.state] 5161 * to 'PAUSED'. 5162 * 5163 * <p>Sample code: 5164 * 5165 * <pre>{@code 5166 * // This snippet has been automatically generated and should be regarded as a code template only. 5167 * // It will require modifications to work: 5168 * // - It may require correct/in-range values for request initialization. 5169 * // - It may require specifying regional endpoints when creating the service client as shown in 5170 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5171 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5172 * PauseModelDeploymentMonitoringJobRequest request = 5173 * PauseModelDeploymentMonitoringJobRequest.newBuilder() 5174 * .setName( 5175 * ModelDeploymentMonitoringJobName.of( 5176 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 5177 * .toString()) 5178 * .build(); 5179 * ApiFuture<Empty> future = 5180 * jobServiceClient.pauseModelDeploymentMonitoringJobCallable().futureCall(request); 5181 * // Do something. 5182 * future.get(); 5183 * } 5184 * }</pre> 5185 */ 5186 public final UnaryCallable<PauseModelDeploymentMonitoringJobRequest, Empty> pauseModelDeploymentMonitoringJobCallable()5187 pauseModelDeploymentMonitoringJobCallable() { 5188 return stub.pauseModelDeploymentMonitoringJobCallable(); 5189 } 5190 5191 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5192 /** 5193 * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from next scheduled time. A 5194 * deleted ModelDeploymentMonitoringJob can't be resumed. 5195 * 5196 * <p>Sample code: 5197 * 5198 * <pre>{@code 5199 * // This snippet has been automatically generated and should be regarded as a code template only. 5200 * // It will require modifications to work: 5201 * // - It may require correct/in-range values for request initialization. 5202 * // - It may require specifying regional endpoints when creating the service client as shown in 5203 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5204 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5205 * ModelDeploymentMonitoringJobName name = 5206 * ModelDeploymentMonitoringJobName.of( 5207 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]"); 5208 * jobServiceClient.resumeModelDeploymentMonitoringJob(name); 5209 * } 5210 * }</pre> 5211 * 5212 * @param name Required. The resource name of the ModelDeploymentMonitoringJob to resume. Format: 5213 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 5214 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5215 */ resumeModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name)5216 public final void resumeModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name) { 5217 ResumeModelDeploymentMonitoringJobRequest request = 5218 ResumeModelDeploymentMonitoringJobRequest.newBuilder() 5219 .setName(name == null ? null : name.toString()) 5220 .build(); 5221 resumeModelDeploymentMonitoringJob(request); 5222 } 5223 5224 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5225 /** 5226 * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from next scheduled time. A 5227 * deleted ModelDeploymentMonitoringJob can't be resumed. 5228 * 5229 * <p>Sample code: 5230 * 5231 * <pre>{@code 5232 * // This snippet has been automatically generated and should be regarded as a code template only. 5233 * // It will require modifications to work: 5234 * // - It may require correct/in-range values for request initialization. 5235 * // - It may require specifying regional endpoints when creating the service client as shown in 5236 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5237 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5238 * String name = 5239 * ModelDeploymentMonitoringJobName.of( 5240 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 5241 * .toString(); 5242 * jobServiceClient.resumeModelDeploymentMonitoringJob(name); 5243 * } 5244 * }</pre> 5245 * 5246 * @param name Required. The resource name of the ModelDeploymentMonitoringJob to resume. Format: 5247 * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` 5248 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5249 */ resumeModelDeploymentMonitoringJob(String name)5250 public final void resumeModelDeploymentMonitoringJob(String name) { 5251 ResumeModelDeploymentMonitoringJobRequest request = 5252 ResumeModelDeploymentMonitoringJobRequest.newBuilder().setName(name).build(); 5253 resumeModelDeploymentMonitoringJob(request); 5254 } 5255 5256 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5257 /** 5258 * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from next scheduled time. A 5259 * deleted ModelDeploymentMonitoringJob can't be resumed. 5260 * 5261 * <p>Sample code: 5262 * 5263 * <pre>{@code 5264 * // This snippet has been automatically generated and should be regarded as a code template only. 5265 * // It will require modifications to work: 5266 * // - It may require correct/in-range values for request initialization. 5267 * // - It may require specifying regional endpoints when creating the service client as shown in 5268 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5269 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5270 * ResumeModelDeploymentMonitoringJobRequest request = 5271 * ResumeModelDeploymentMonitoringJobRequest.newBuilder() 5272 * .setName( 5273 * ModelDeploymentMonitoringJobName.of( 5274 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 5275 * .toString()) 5276 * .build(); 5277 * jobServiceClient.resumeModelDeploymentMonitoringJob(request); 5278 * } 5279 * }</pre> 5280 * 5281 * @param request The request object containing all of the parameters for the API call. 5282 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5283 */ resumeModelDeploymentMonitoringJob( ResumeModelDeploymentMonitoringJobRequest request)5284 public final void resumeModelDeploymentMonitoringJob( 5285 ResumeModelDeploymentMonitoringJobRequest request) { 5286 resumeModelDeploymentMonitoringJobCallable().call(request); 5287 } 5288 5289 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5290 /** 5291 * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from next scheduled time. A 5292 * deleted ModelDeploymentMonitoringJob can't be resumed. 5293 * 5294 * <p>Sample code: 5295 * 5296 * <pre>{@code 5297 * // This snippet has been automatically generated and should be regarded as a code template only. 5298 * // It will require modifications to work: 5299 * // - It may require correct/in-range values for request initialization. 5300 * // - It may require specifying regional endpoints when creating the service client as shown in 5301 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5302 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5303 * ResumeModelDeploymentMonitoringJobRequest request = 5304 * ResumeModelDeploymentMonitoringJobRequest.newBuilder() 5305 * .setName( 5306 * ModelDeploymentMonitoringJobName.of( 5307 * "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]") 5308 * .toString()) 5309 * .build(); 5310 * ApiFuture<Empty> future = 5311 * jobServiceClient.resumeModelDeploymentMonitoringJobCallable().futureCall(request); 5312 * // Do something. 5313 * future.get(); 5314 * } 5315 * }</pre> 5316 */ 5317 public final UnaryCallable<ResumeModelDeploymentMonitoringJobRequest, Empty> resumeModelDeploymentMonitoringJobCallable()5318 resumeModelDeploymentMonitoringJobCallable() { 5319 return stub.resumeModelDeploymentMonitoringJobCallable(); 5320 } 5321 5322 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5323 /** 5324 * Lists information about the supported locations for this service. 5325 * 5326 * <p>Sample code: 5327 * 5328 * <pre>{@code 5329 * // This snippet has been automatically generated and should be regarded as a code template only. 5330 * // It will require modifications to work: 5331 * // - It may require correct/in-range values for request initialization. 5332 * // - It may require specifying regional endpoints when creating the service client as shown in 5333 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5334 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5335 * ListLocationsRequest request = 5336 * ListLocationsRequest.newBuilder() 5337 * .setName("name3373707") 5338 * .setFilter("filter-1274492040") 5339 * .setPageSize(883849137) 5340 * .setPageToken("pageToken873572522") 5341 * .build(); 5342 * for (Location element : jobServiceClient.listLocations(request).iterateAll()) { 5343 * // doThingsWith(element); 5344 * } 5345 * } 5346 * }</pre> 5347 * 5348 * @param request The request object containing all of the parameters for the API call. 5349 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5350 */ listLocations(ListLocationsRequest request)5351 public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { 5352 return listLocationsPagedCallable().call(request); 5353 } 5354 5355 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5356 /** 5357 * Lists information about the supported locations for this service. 5358 * 5359 * <p>Sample code: 5360 * 5361 * <pre>{@code 5362 * // This snippet has been automatically generated and should be regarded as a code template only. 5363 * // It will require modifications to work: 5364 * // - It may require correct/in-range values for request initialization. 5365 * // - It may require specifying regional endpoints when creating the service client as shown in 5366 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5367 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5368 * ListLocationsRequest request = 5369 * ListLocationsRequest.newBuilder() 5370 * .setName("name3373707") 5371 * .setFilter("filter-1274492040") 5372 * .setPageSize(883849137) 5373 * .setPageToken("pageToken873572522") 5374 * .build(); 5375 * ApiFuture<Location> future = 5376 * jobServiceClient.listLocationsPagedCallable().futureCall(request); 5377 * // Do something. 5378 * for (Location element : future.get().iterateAll()) { 5379 * // doThingsWith(element); 5380 * } 5381 * } 5382 * }</pre> 5383 */ 5384 public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse> listLocationsPagedCallable()5385 listLocationsPagedCallable() { 5386 return stub.listLocationsPagedCallable(); 5387 } 5388 5389 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5390 /** 5391 * Lists information about the supported locations for this service. 5392 * 5393 * <p>Sample code: 5394 * 5395 * <pre>{@code 5396 * // This snippet has been automatically generated and should be regarded as a code template only. 5397 * // It will require modifications to work: 5398 * // - It may require correct/in-range values for request initialization. 5399 * // - It may require specifying regional endpoints when creating the service client as shown in 5400 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5401 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5402 * ListLocationsRequest request = 5403 * ListLocationsRequest.newBuilder() 5404 * .setName("name3373707") 5405 * .setFilter("filter-1274492040") 5406 * .setPageSize(883849137) 5407 * .setPageToken("pageToken873572522") 5408 * .build(); 5409 * while (true) { 5410 * ListLocationsResponse response = jobServiceClient.listLocationsCallable().call(request); 5411 * for (Location element : response.getLocationsList()) { 5412 * // doThingsWith(element); 5413 * } 5414 * String nextPageToken = response.getNextPageToken(); 5415 * if (!Strings.isNullOrEmpty(nextPageToken)) { 5416 * request = request.toBuilder().setPageToken(nextPageToken).build(); 5417 * } else { 5418 * break; 5419 * } 5420 * } 5421 * } 5422 * }</pre> 5423 */ listLocationsCallable()5424 public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() { 5425 return stub.listLocationsCallable(); 5426 } 5427 5428 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5429 /** 5430 * Gets information about a location. 5431 * 5432 * <p>Sample code: 5433 * 5434 * <pre>{@code 5435 * // This snippet has been automatically generated and should be regarded as a code template only. 5436 * // It will require modifications to work: 5437 * // - It may require correct/in-range values for request initialization. 5438 * // - It may require specifying regional endpoints when creating the service client as shown in 5439 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5440 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5441 * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); 5442 * Location response = jobServiceClient.getLocation(request); 5443 * } 5444 * }</pre> 5445 * 5446 * @param request The request object containing all of the parameters for the API call. 5447 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5448 */ getLocation(GetLocationRequest request)5449 public final Location getLocation(GetLocationRequest request) { 5450 return getLocationCallable().call(request); 5451 } 5452 5453 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5454 /** 5455 * Gets information about a location. 5456 * 5457 * <p>Sample code: 5458 * 5459 * <pre>{@code 5460 * // This snippet has been automatically generated and should be regarded as a code template only. 5461 * // It will require modifications to work: 5462 * // - It may require correct/in-range values for request initialization. 5463 * // - It may require specifying regional endpoints when creating the service client as shown in 5464 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5465 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5466 * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); 5467 * ApiFuture<Location> future = jobServiceClient.getLocationCallable().futureCall(request); 5468 * // Do something. 5469 * Location response = future.get(); 5470 * } 5471 * }</pre> 5472 */ getLocationCallable()5473 public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() { 5474 return stub.getLocationCallable(); 5475 } 5476 5477 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5478 /** 5479 * Sets the access control policy on the specified resource. Replacesany existing policy. 5480 * 5481 * <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. 5482 * 5483 * <p>Sample code: 5484 * 5485 * <pre>{@code 5486 * // This snippet has been automatically generated and should be regarded as a code template only. 5487 * // It will require modifications to work: 5488 * // - It may require correct/in-range values for request initialization. 5489 * // - It may require specifying regional endpoints when creating the service client as shown in 5490 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5491 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5492 * SetIamPolicyRequest request = 5493 * SetIamPolicyRequest.newBuilder() 5494 * .setResource( 5495 * EndpointName.ofProjectLocationEndpointName( 5496 * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") 5497 * .toString()) 5498 * .setPolicy(Policy.newBuilder().build()) 5499 * .setUpdateMask(FieldMask.newBuilder().build()) 5500 * .build(); 5501 * Policy response = jobServiceClient.setIamPolicy(request); 5502 * } 5503 * }</pre> 5504 * 5505 * @param request The request object containing all of the parameters for the API call. 5506 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5507 */ setIamPolicy(SetIamPolicyRequest request)5508 public final Policy setIamPolicy(SetIamPolicyRequest request) { 5509 return setIamPolicyCallable().call(request); 5510 } 5511 5512 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5513 /** 5514 * Sets the access control policy on the specified resource. Replacesany existing policy. 5515 * 5516 * <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. 5517 * 5518 * <p>Sample code: 5519 * 5520 * <pre>{@code 5521 * // This snippet has been automatically generated and should be regarded as a code template only. 5522 * // It will require modifications to work: 5523 * // - It may require correct/in-range values for request initialization. 5524 * // - It may require specifying regional endpoints when creating the service client as shown in 5525 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5526 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5527 * SetIamPolicyRequest request = 5528 * SetIamPolicyRequest.newBuilder() 5529 * .setResource( 5530 * EndpointName.ofProjectLocationEndpointName( 5531 * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") 5532 * .toString()) 5533 * .setPolicy(Policy.newBuilder().build()) 5534 * .setUpdateMask(FieldMask.newBuilder().build()) 5535 * .build(); 5536 * ApiFuture<Policy> future = jobServiceClient.setIamPolicyCallable().futureCall(request); 5537 * // Do something. 5538 * Policy response = future.get(); 5539 * } 5540 * }</pre> 5541 */ setIamPolicyCallable()5542 public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() { 5543 return stub.setIamPolicyCallable(); 5544 } 5545 5546 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5547 /** 5548 * Gets the access control policy for a resource. Returns an empty policyif the resource exists 5549 * and does not have a policy set. 5550 * 5551 * <p>Sample code: 5552 * 5553 * <pre>{@code 5554 * // This snippet has been automatically generated and should be regarded as a code template only. 5555 * // It will require modifications to work: 5556 * // - It may require correct/in-range values for request initialization. 5557 * // - It may require specifying regional endpoints when creating the service client as shown in 5558 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5559 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5560 * GetIamPolicyRequest request = 5561 * GetIamPolicyRequest.newBuilder() 5562 * .setResource( 5563 * EndpointName.ofProjectLocationEndpointName( 5564 * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") 5565 * .toString()) 5566 * .setOptions(GetPolicyOptions.newBuilder().build()) 5567 * .build(); 5568 * Policy response = jobServiceClient.getIamPolicy(request); 5569 * } 5570 * }</pre> 5571 * 5572 * @param request The request object containing all of the parameters for the API call. 5573 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5574 */ getIamPolicy(GetIamPolicyRequest request)5575 public final Policy getIamPolicy(GetIamPolicyRequest request) { 5576 return getIamPolicyCallable().call(request); 5577 } 5578 5579 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5580 /** 5581 * Gets the access control policy for a resource. Returns an empty policyif the resource exists 5582 * and does not have a policy set. 5583 * 5584 * <p>Sample code: 5585 * 5586 * <pre>{@code 5587 * // This snippet has been automatically generated and should be regarded as a code template only. 5588 * // It will require modifications to work: 5589 * // - It may require correct/in-range values for request initialization. 5590 * // - It may require specifying regional endpoints when creating the service client as shown in 5591 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5592 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5593 * GetIamPolicyRequest request = 5594 * GetIamPolicyRequest.newBuilder() 5595 * .setResource( 5596 * EndpointName.ofProjectLocationEndpointName( 5597 * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") 5598 * .toString()) 5599 * .setOptions(GetPolicyOptions.newBuilder().build()) 5600 * .build(); 5601 * ApiFuture<Policy> future = jobServiceClient.getIamPolicyCallable().futureCall(request); 5602 * // Do something. 5603 * Policy response = future.get(); 5604 * } 5605 * }</pre> 5606 */ getIamPolicyCallable()5607 public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() { 5608 return stub.getIamPolicyCallable(); 5609 } 5610 5611 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5612 /** 5613 * Returns permissions that a caller has on the specified resource. If theresource does not exist, 5614 * this will return an empty set ofpermissions, not a `NOT_FOUND` error. 5615 * 5616 * <p>Note: This operation is designed to be used for buildingpermission-aware UIs and 5617 * command-line tools, not for authorizationchecking. This operation may "fail open" without 5618 * warning. 5619 * 5620 * <p>Sample code: 5621 * 5622 * <pre>{@code 5623 * // This snippet has been automatically generated and should be regarded as a code template only. 5624 * // It will require modifications to work: 5625 * // - It may require correct/in-range values for request initialization. 5626 * // - It may require specifying regional endpoints when creating the service client as shown in 5627 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5628 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5629 * TestIamPermissionsRequest request = 5630 * TestIamPermissionsRequest.newBuilder() 5631 * .setResource( 5632 * EndpointName.ofProjectLocationEndpointName( 5633 * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") 5634 * .toString()) 5635 * .addAllPermissions(new ArrayList<String>()) 5636 * .build(); 5637 * TestIamPermissionsResponse response = jobServiceClient.testIamPermissions(request); 5638 * } 5639 * }</pre> 5640 * 5641 * @param request The request object containing all of the parameters for the API call. 5642 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5643 */ testIamPermissions(TestIamPermissionsRequest request)5644 public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { 5645 return testIamPermissionsCallable().call(request); 5646 } 5647 5648 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5649 /** 5650 * Returns permissions that a caller has on the specified resource. If theresource does not exist, 5651 * this will return an empty set ofpermissions, not a `NOT_FOUND` error. 5652 * 5653 * <p>Note: This operation is designed to be used for buildingpermission-aware UIs and 5654 * command-line tools, not for authorizationchecking. This operation may "fail open" without 5655 * warning. 5656 * 5657 * <p>Sample code: 5658 * 5659 * <pre>{@code 5660 * // This snippet has been automatically generated and should be regarded as a code template only. 5661 * // It will require modifications to work: 5662 * // - It may require correct/in-range values for request initialization. 5663 * // - It may require specifying regional endpoints when creating the service client as shown in 5664 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5665 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 5666 * TestIamPermissionsRequest request = 5667 * TestIamPermissionsRequest.newBuilder() 5668 * .setResource( 5669 * EndpointName.ofProjectLocationEndpointName( 5670 * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") 5671 * .toString()) 5672 * .addAllPermissions(new ArrayList<String>()) 5673 * .build(); 5674 * ApiFuture<TestIamPermissionsResponse> future = 5675 * jobServiceClient.testIamPermissionsCallable().futureCall(request); 5676 * // Do something. 5677 * TestIamPermissionsResponse response = future.get(); 5678 * } 5679 * }</pre> 5680 */ 5681 public final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsCallable()5682 testIamPermissionsCallable() { 5683 return stub.testIamPermissionsCallable(); 5684 } 5685 5686 @Override close()5687 public final void close() { 5688 stub.close(); 5689 } 5690 5691 @Override shutdown()5692 public void shutdown() { 5693 stub.shutdown(); 5694 } 5695 5696 @Override isShutdown()5697 public boolean isShutdown() { 5698 return stub.isShutdown(); 5699 } 5700 5701 @Override isTerminated()5702 public boolean isTerminated() { 5703 return stub.isTerminated(); 5704 } 5705 5706 @Override shutdownNow()5707 public void shutdownNow() { 5708 stub.shutdownNow(); 5709 } 5710 5711 @Override awaitTermination(long duration, TimeUnit unit)5712 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 5713 return stub.awaitTermination(duration, unit); 5714 } 5715 5716 public static class ListCustomJobsPagedResponse 5717 extends AbstractPagedListResponse< 5718 ListCustomJobsRequest, 5719 ListCustomJobsResponse, 5720 CustomJob, 5721 ListCustomJobsPage, 5722 ListCustomJobsFixedSizeCollection> { 5723 createAsync( PageContext<ListCustomJobsRequest, ListCustomJobsResponse, CustomJob> context, ApiFuture<ListCustomJobsResponse> futureResponse)5724 public static ApiFuture<ListCustomJobsPagedResponse> createAsync( 5725 PageContext<ListCustomJobsRequest, ListCustomJobsResponse, CustomJob> context, 5726 ApiFuture<ListCustomJobsResponse> futureResponse) { 5727 ApiFuture<ListCustomJobsPage> futurePage = 5728 ListCustomJobsPage.createEmptyPage().createPageAsync(context, futureResponse); 5729 return ApiFutures.transform( 5730 futurePage, 5731 input -> new ListCustomJobsPagedResponse(input), 5732 MoreExecutors.directExecutor()); 5733 } 5734 ListCustomJobsPagedResponse(ListCustomJobsPage page)5735 private ListCustomJobsPagedResponse(ListCustomJobsPage page) { 5736 super(page, ListCustomJobsFixedSizeCollection.createEmptyCollection()); 5737 } 5738 } 5739 5740 public static class ListCustomJobsPage 5741 extends AbstractPage< 5742 ListCustomJobsRequest, ListCustomJobsResponse, CustomJob, ListCustomJobsPage> { 5743 ListCustomJobsPage( PageContext<ListCustomJobsRequest, ListCustomJobsResponse, CustomJob> context, ListCustomJobsResponse response)5744 private ListCustomJobsPage( 5745 PageContext<ListCustomJobsRequest, ListCustomJobsResponse, CustomJob> context, 5746 ListCustomJobsResponse response) { 5747 super(context, response); 5748 } 5749 createEmptyPage()5750 private static ListCustomJobsPage createEmptyPage() { 5751 return new ListCustomJobsPage(null, null); 5752 } 5753 5754 @Override createPage( PageContext<ListCustomJobsRequest, ListCustomJobsResponse, CustomJob> context, ListCustomJobsResponse response)5755 protected ListCustomJobsPage createPage( 5756 PageContext<ListCustomJobsRequest, ListCustomJobsResponse, CustomJob> context, 5757 ListCustomJobsResponse response) { 5758 return new ListCustomJobsPage(context, response); 5759 } 5760 5761 @Override createPageAsync( PageContext<ListCustomJobsRequest, ListCustomJobsResponse, CustomJob> context, ApiFuture<ListCustomJobsResponse> futureResponse)5762 public ApiFuture<ListCustomJobsPage> createPageAsync( 5763 PageContext<ListCustomJobsRequest, ListCustomJobsResponse, CustomJob> context, 5764 ApiFuture<ListCustomJobsResponse> futureResponse) { 5765 return super.createPageAsync(context, futureResponse); 5766 } 5767 } 5768 5769 public static class ListCustomJobsFixedSizeCollection 5770 extends AbstractFixedSizeCollection< 5771 ListCustomJobsRequest, 5772 ListCustomJobsResponse, 5773 CustomJob, 5774 ListCustomJobsPage, 5775 ListCustomJobsFixedSizeCollection> { 5776 ListCustomJobsFixedSizeCollection(List<ListCustomJobsPage> pages, int collectionSize)5777 private ListCustomJobsFixedSizeCollection(List<ListCustomJobsPage> pages, int collectionSize) { 5778 super(pages, collectionSize); 5779 } 5780 createEmptyCollection()5781 private static ListCustomJobsFixedSizeCollection createEmptyCollection() { 5782 return new ListCustomJobsFixedSizeCollection(null, 0); 5783 } 5784 5785 @Override createCollection( List<ListCustomJobsPage> pages, int collectionSize)5786 protected ListCustomJobsFixedSizeCollection createCollection( 5787 List<ListCustomJobsPage> pages, int collectionSize) { 5788 return new ListCustomJobsFixedSizeCollection(pages, collectionSize); 5789 } 5790 } 5791 5792 public static class ListDataLabelingJobsPagedResponse 5793 extends AbstractPagedListResponse< 5794 ListDataLabelingJobsRequest, 5795 ListDataLabelingJobsResponse, 5796 DataLabelingJob, 5797 ListDataLabelingJobsPage, 5798 ListDataLabelingJobsFixedSizeCollection> { 5799 createAsync( PageContext<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse, DataLabelingJob> context, ApiFuture<ListDataLabelingJobsResponse> futureResponse)5800 public static ApiFuture<ListDataLabelingJobsPagedResponse> createAsync( 5801 PageContext<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse, DataLabelingJob> 5802 context, 5803 ApiFuture<ListDataLabelingJobsResponse> futureResponse) { 5804 ApiFuture<ListDataLabelingJobsPage> futurePage = 5805 ListDataLabelingJobsPage.createEmptyPage().createPageAsync(context, futureResponse); 5806 return ApiFutures.transform( 5807 futurePage, 5808 input -> new ListDataLabelingJobsPagedResponse(input), 5809 MoreExecutors.directExecutor()); 5810 } 5811 ListDataLabelingJobsPagedResponse(ListDataLabelingJobsPage page)5812 private ListDataLabelingJobsPagedResponse(ListDataLabelingJobsPage page) { 5813 super(page, ListDataLabelingJobsFixedSizeCollection.createEmptyCollection()); 5814 } 5815 } 5816 5817 public static class ListDataLabelingJobsPage 5818 extends AbstractPage< 5819 ListDataLabelingJobsRequest, 5820 ListDataLabelingJobsResponse, 5821 DataLabelingJob, 5822 ListDataLabelingJobsPage> { 5823 ListDataLabelingJobsPage( PageContext<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse, DataLabelingJob> context, ListDataLabelingJobsResponse response)5824 private ListDataLabelingJobsPage( 5825 PageContext<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse, DataLabelingJob> 5826 context, 5827 ListDataLabelingJobsResponse response) { 5828 super(context, response); 5829 } 5830 createEmptyPage()5831 private static ListDataLabelingJobsPage createEmptyPage() { 5832 return new ListDataLabelingJobsPage(null, null); 5833 } 5834 5835 @Override createPage( PageContext<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse, DataLabelingJob> context, ListDataLabelingJobsResponse response)5836 protected ListDataLabelingJobsPage createPage( 5837 PageContext<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse, DataLabelingJob> 5838 context, 5839 ListDataLabelingJobsResponse response) { 5840 return new ListDataLabelingJobsPage(context, response); 5841 } 5842 5843 @Override createPageAsync( PageContext<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse, DataLabelingJob> context, ApiFuture<ListDataLabelingJobsResponse> futureResponse)5844 public ApiFuture<ListDataLabelingJobsPage> createPageAsync( 5845 PageContext<ListDataLabelingJobsRequest, ListDataLabelingJobsResponse, DataLabelingJob> 5846 context, 5847 ApiFuture<ListDataLabelingJobsResponse> futureResponse) { 5848 return super.createPageAsync(context, futureResponse); 5849 } 5850 } 5851 5852 public static class ListDataLabelingJobsFixedSizeCollection 5853 extends AbstractFixedSizeCollection< 5854 ListDataLabelingJobsRequest, 5855 ListDataLabelingJobsResponse, 5856 DataLabelingJob, 5857 ListDataLabelingJobsPage, 5858 ListDataLabelingJobsFixedSizeCollection> { 5859 ListDataLabelingJobsFixedSizeCollection( List<ListDataLabelingJobsPage> pages, int collectionSize)5860 private ListDataLabelingJobsFixedSizeCollection( 5861 List<ListDataLabelingJobsPage> pages, int collectionSize) { 5862 super(pages, collectionSize); 5863 } 5864 createEmptyCollection()5865 private static ListDataLabelingJobsFixedSizeCollection createEmptyCollection() { 5866 return new ListDataLabelingJobsFixedSizeCollection(null, 0); 5867 } 5868 5869 @Override createCollection( List<ListDataLabelingJobsPage> pages, int collectionSize)5870 protected ListDataLabelingJobsFixedSizeCollection createCollection( 5871 List<ListDataLabelingJobsPage> pages, int collectionSize) { 5872 return new ListDataLabelingJobsFixedSizeCollection(pages, collectionSize); 5873 } 5874 } 5875 5876 public static class ListHyperparameterTuningJobsPagedResponse 5877 extends AbstractPagedListResponse< 5878 ListHyperparameterTuningJobsRequest, 5879 ListHyperparameterTuningJobsResponse, 5880 HyperparameterTuningJob, 5881 ListHyperparameterTuningJobsPage, 5882 ListHyperparameterTuningJobsFixedSizeCollection> { 5883 createAsync( PageContext< ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsResponse, HyperparameterTuningJob> context, ApiFuture<ListHyperparameterTuningJobsResponse> futureResponse)5884 public static ApiFuture<ListHyperparameterTuningJobsPagedResponse> createAsync( 5885 PageContext< 5886 ListHyperparameterTuningJobsRequest, 5887 ListHyperparameterTuningJobsResponse, 5888 HyperparameterTuningJob> 5889 context, 5890 ApiFuture<ListHyperparameterTuningJobsResponse> futureResponse) { 5891 ApiFuture<ListHyperparameterTuningJobsPage> futurePage = 5892 ListHyperparameterTuningJobsPage.createEmptyPage() 5893 .createPageAsync(context, futureResponse); 5894 return ApiFutures.transform( 5895 futurePage, 5896 input -> new ListHyperparameterTuningJobsPagedResponse(input), 5897 MoreExecutors.directExecutor()); 5898 } 5899 ListHyperparameterTuningJobsPagedResponse(ListHyperparameterTuningJobsPage page)5900 private ListHyperparameterTuningJobsPagedResponse(ListHyperparameterTuningJobsPage page) { 5901 super(page, ListHyperparameterTuningJobsFixedSizeCollection.createEmptyCollection()); 5902 } 5903 } 5904 5905 public static class ListHyperparameterTuningJobsPage 5906 extends AbstractPage< 5907 ListHyperparameterTuningJobsRequest, 5908 ListHyperparameterTuningJobsResponse, 5909 HyperparameterTuningJob, 5910 ListHyperparameterTuningJobsPage> { 5911 ListHyperparameterTuningJobsPage( PageContext< ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsResponse, HyperparameterTuningJob> context, ListHyperparameterTuningJobsResponse response)5912 private ListHyperparameterTuningJobsPage( 5913 PageContext< 5914 ListHyperparameterTuningJobsRequest, 5915 ListHyperparameterTuningJobsResponse, 5916 HyperparameterTuningJob> 5917 context, 5918 ListHyperparameterTuningJobsResponse response) { 5919 super(context, response); 5920 } 5921 createEmptyPage()5922 private static ListHyperparameterTuningJobsPage createEmptyPage() { 5923 return new ListHyperparameterTuningJobsPage(null, null); 5924 } 5925 5926 @Override createPage( PageContext< ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsResponse, HyperparameterTuningJob> context, ListHyperparameterTuningJobsResponse response)5927 protected ListHyperparameterTuningJobsPage createPage( 5928 PageContext< 5929 ListHyperparameterTuningJobsRequest, 5930 ListHyperparameterTuningJobsResponse, 5931 HyperparameterTuningJob> 5932 context, 5933 ListHyperparameterTuningJobsResponse response) { 5934 return new ListHyperparameterTuningJobsPage(context, response); 5935 } 5936 5937 @Override createPageAsync( PageContext< ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsResponse, HyperparameterTuningJob> context, ApiFuture<ListHyperparameterTuningJobsResponse> futureResponse)5938 public ApiFuture<ListHyperparameterTuningJobsPage> createPageAsync( 5939 PageContext< 5940 ListHyperparameterTuningJobsRequest, 5941 ListHyperparameterTuningJobsResponse, 5942 HyperparameterTuningJob> 5943 context, 5944 ApiFuture<ListHyperparameterTuningJobsResponse> futureResponse) { 5945 return super.createPageAsync(context, futureResponse); 5946 } 5947 } 5948 5949 public static class ListHyperparameterTuningJobsFixedSizeCollection 5950 extends AbstractFixedSizeCollection< 5951 ListHyperparameterTuningJobsRequest, 5952 ListHyperparameterTuningJobsResponse, 5953 HyperparameterTuningJob, 5954 ListHyperparameterTuningJobsPage, 5955 ListHyperparameterTuningJobsFixedSizeCollection> { 5956 ListHyperparameterTuningJobsFixedSizeCollection( List<ListHyperparameterTuningJobsPage> pages, int collectionSize)5957 private ListHyperparameterTuningJobsFixedSizeCollection( 5958 List<ListHyperparameterTuningJobsPage> pages, int collectionSize) { 5959 super(pages, collectionSize); 5960 } 5961 createEmptyCollection()5962 private static ListHyperparameterTuningJobsFixedSizeCollection createEmptyCollection() { 5963 return new ListHyperparameterTuningJobsFixedSizeCollection(null, 0); 5964 } 5965 5966 @Override createCollection( List<ListHyperparameterTuningJobsPage> pages, int collectionSize)5967 protected ListHyperparameterTuningJobsFixedSizeCollection createCollection( 5968 List<ListHyperparameterTuningJobsPage> pages, int collectionSize) { 5969 return new ListHyperparameterTuningJobsFixedSizeCollection(pages, collectionSize); 5970 } 5971 } 5972 5973 public static class ListNasJobsPagedResponse 5974 extends AbstractPagedListResponse< 5975 ListNasJobsRequest, 5976 ListNasJobsResponse, 5977 NasJob, 5978 ListNasJobsPage, 5979 ListNasJobsFixedSizeCollection> { 5980 createAsync( PageContext<ListNasJobsRequest, ListNasJobsResponse, NasJob> context, ApiFuture<ListNasJobsResponse> futureResponse)5981 public static ApiFuture<ListNasJobsPagedResponse> createAsync( 5982 PageContext<ListNasJobsRequest, ListNasJobsResponse, NasJob> context, 5983 ApiFuture<ListNasJobsResponse> futureResponse) { 5984 ApiFuture<ListNasJobsPage> futurePage = 5985 ListNasJobsPage.createEmptyPage().createPageAsync(context, futureResponse); 5986 return ApiFutures.transform( 5987 futurePage, input -> new ListNasJobsPagedResponse(input), MoreExecutors.directExecutor()); 5988 } 5989 ListNasJobsPagedResponse(ListNasJobsPage page)5990 private ListNasJobsPagedResponse(ListNasJobsPage page) { 5991 super(page, ListNasJobsFixedSizeCollection.createEmptyCollection()); 5992 } 5993 } 5994 5995 public static class ListNasJobsPage 5996 extends AbstractPage<ListNasJobsRequest, ListNasJobsResponse, NasJob, ListNasJobsPage> { 5997 ListNasJobsPage( PageContext<ListNasJobsRequest, ListNasJobsResponse, NasJob> context, ListNasJobsResponse response)5998 private ListNasJobsPage( 5999 PageContext<ListNasJobsRequest, ListNasJobsResponse, NasJob> context, 6000 ListNasJobsResponse response) { 6001 super(context, response); 6002 } 6003 createEmptyPage()6004 private static ListNasJobsPage createEmptyPage() { 6005 return new ListNasJobsPage(null, null); 6006 } 6007 6008 @Override createPage( PageContext<ListNasJobsRequest, ListNasJobsResponse, NasJob> context, ListNasJobsResponse response)6009 protected ListNasJobsPage createPage( 6010 PageContext<ListNasJobsRequest, ListNasJobsResponse, NasJob> context, 6011 ListNasJobsResponse response) { 6012 return new ListNasJobsPage(context, response); 6013 } 6014 6015 @Override createPageAsync( PageContext<ListNasJobsRequest, ListNasJobsResponse, NasJob> context, ApiFuture<ListNasJobsResponse> futureResponse)6016 public ApiFuture<ListNasJobsPage> createPageAsync( 6017 PageContext<ListNasJobsRequest, ListNasJobsResponse, NasJob> context, 6018 ApiFuture<ListNasJobsResponse> futureResponse) { 6019 return super.createPageAsync(context, futureResponse); 6020 } 6021 } 6022 6023 public static class ListNasJobsFixedSizeCollection 6024 extends AbstractFixedSizeCollection< 6025 ListNasJobsRequest, 6026 ListNasJobsResponse, 6027 NasJob, 6028 ListNasJobsPage, 6029 ListNasJobsFixedSizeCollection> { 6030 ListNasJobsFixedSizeCollection(List<ListNasJobsPage> pages, int collectionSize)6031 private ListNasJobsFixedSizeCollection(List<ListNasJobsPage> pages, int collectionSize) { 6032 super(pages, collectionSize); 6033 } 6034 createEmptyCollection()6035 private static ListNasJobsFixedSizeCollection createEmptyCollection() { 6036 return new ListNasJobsFixedSizeCollection(null, 0); 6037 } 6038 6039 @Override createCollection( List<ListNasJobsPage> pages, int collectionSize)6040 protected ListNasJobsFixedSizeCollection createCollection( 6041 List<ListNasJobsPage> pages, int collectionSize) { 6042 return new ListNasJobsFixedSizeCollection(pages, collectionSize); 6043 } 6044 } 6045 6046 public static class ListNasTrialDetailsPagedResponse 6047 extends AbstractPagedListResponse< 6048 ListNasTrialDetailsRequest, 6049 ListNasTrialDetailsResponse, 6050 NasTrialDetail, 6051 ListNasTrialDetailsPage, 6052 ListNasTrialDetailsFixedSizeCollection> { 6053 createAsync( PageContext<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, NasTrialDetail> context, ApiFuture<ListNasTrialDetailsResponse> futureResponse)6054 public static ApiFuture<ListNasTrialDetailsPagedResponse> createAsync( 6055 PageContext<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, NasTrialDetail> 6056 context, 6057 ApiFuture<ListNasTrialDetailsResponse> futureResponse) { 6058 ApiFuture<ListNasTrialDetailsPage> futurePage = 6059 ListNasTrialDetailsPage.createEmptyPage().createPageAsync(context, futureResponse); 6060 return ApiFutures.transform( 6061 futurePage, 6062 input -> new ListNasTrialDetailsPagedResponse(input), 6063 MoreExecutors.directExecutor()); 6064 } 6065 ListNasTrialDetailsPagedResponse(ListNasTrialDetailsPage page)6066 private ListNasTrialDetailsPagedResponse(ListNasTrialDetailsPage page) { 6067 super(page, ListNasTrialDetailsFixedSizeCollection.createEmptyCollection()); 6068 } 6069 } 6070 6071 public static class ListNasTrialDetailsPage 6072 extends AbstractPage< 6073 ListNasTrialDetailsRequest, 6074 ListNasTrialDetailsResponse, 6075 NasTrialDetail, 6076 ListNasTrialDetailsPage> { 6077 ListNasTrialDetailsPage( PageContext<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, NasTrialDetail> context, ListNasTrialDetailsResponse response)6078 private ListNasTrialDetailsPage( 6079 PageContext<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, NasTrialDetail> 6080 context, 6081 ListNasTrialDetailsResponse response) { 6082 super(context, response); 6083 } 6084 createEmptyPage()6085 private static ListNasTrialDetailsPage createEmptyPage() { 6086 return new ListNasTrialDetailsPage(null, null); 6087 } 6088 6089 @Override createPage( PageContext<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, NasTrialDetail> context, ListNasTrialDetailsResponse response)6090 protected ListNasTrialDetailsPage createPage( 6091 PageContext<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, NasTrialDetail> 6092 context, 6093 ListNasTrialDetailsResponse response) { 6094 return new ListNasTrialDetailsPage(context, response); 6095 } 6096 6097 @Override createPageAsync( PageContext<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, NasTrialDetail> context, ApiFuture<ListNasTrialDetailsResponse> futureResponse)6098 public ApiFuture<ListNasTrialDetailsPage> createPageAsync( 6099 PageContext<ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, NasTrialDetail> 6100 context, 6101 ApiFuture<ListNasTrialDetailsResponse> futureResponse) { 6102 return super.createPageAsync(context, futureResponse); 6103 } 6104 } 6105 6106 public static class ListNasTrialDetailsFixedSizeCollection 6107 extends AbstractFixedSizeCollection< 6108 ListNasTrialDetailsRequest, 6109 ListNasTrialDetailsResponse, 6110 NasTrialDetail, 6111 ListNasTrialDetailsPage, 6112 ListNasTrialDetailsFixedSizeCollection> { 6113 ListNasTrialDetailsFixedSizeCollection( List<ListNasTrialDetailsPage> pages, int collectionSize)6114 private ListNasTrialDetailsFixedSizeCollection( 6115 List<ListNasTrialDetailsPage> pages, int collectionSize) { 6116 super(pages, collectionSize); 6117 } 6118 createEmptyCollection()6119 private static ListNasTrialDetailsFixedSizeCollection createEmptyCollection() { 6120 return new ListNasTrialDetailsFixedSizeCollection(null, 0); 6121 } 6122 6123 @Override createCollection( List<ListNasTrialDetailsPage> pages, int collectionSize)6124 protected ListNasTrialDetailsFixedSizeCollection createCollection( 6125 List<ListNasTrialDetailsPage> pages, int collectionSize) { 6126 return new ListNasTrialDetailsFixedSizeCollection(pages, collectionSize); 6127 } 6128 } 6129 6130 public static class ListBatchPredictionJobsPagedResponse 6131 extends AbstractPagedListResponse< 6132 ListBatchPredictionJobsRequest, 6133 ListBatchPredictionJobsResponse, 6134 BatchPredictionJob, 6135 ListBatchPredictionJobsPage, 6136 ListBatchPredictionJobsFixedSizeCollection> { 6137 createAsync( PageContext< ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse, BatchPredictionJob> context, ApiFuture<ListBatchPredictionJobsResponse> futureResponse)6138 public static ApiFuture<ListBatchPredictionJobsPagedResponse> createAsync( 6139 PageContext< 6140 ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse, BatchPredictionJob> 6141 context, 6142 ApiFuture<ListBatchPredictionJobsResponse> futureResponse) { 6143 ApiFuture<ListBatchPredictionJobsPage> futurePage = 6144 ListBatchPredictionJobsPage.createEmptyPage().createPageAsync(context, futureResponse); 6145 return ApiFutures.transform( 6146 futurePage, 6147 input -> new ListBatchPredictionJobsPagedResponse(input), 6148 MoreExecutors.directExecutor()); 6149 } 6150 ListBatchPredictionJobsPagedResponse(ListBatchPredictionJobsPage page)6151 private ListBatchPredictionJobsPagedResponse(ListBatchPredictionJobsPage page) { 6152 super(page, ListBatchPredictionJobsFixedSizeCollection.createEmptyCollection()); 6153 } 6154 } 6155 6156 public static class ListBatchPredictionJobsPage 6157 extends AbstractPage< 6158 ListBatchPredictionJobsRequest, 6159 ListBatchPredictionJobsResponse, 6160 BatchPredictionJob, 6161 ListBatchPredictionJobsPage> { 6162 ListBatchPredictionJobsPage( PageContext< ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse, BatchPredictionJob> context, ListBatchPredictionJobsResponse response)6163 private ListBatchPredictionJobsPage( 6164 PageContext< 6165 ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse, BatchPredictionJob> 6166 context, 6167 ListBatchPredictionJobsResponse response) { 6168 super(context, response); 6169 } 6170 createEmptyPage()6171 private static ListBatchPredictionJobsPage createEmptyPage() { 6172 return new ListBatchPredictionJobsPage(null, null); 6173 } 6174 6175 @Override createPage( PageContext< ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse, BatchPredictionJob> context, ListBatchPredictionJobsResponse response)6176 protected ListBatchPredictionJobsPage createPage( 6177 PageContext< 6178 ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse, BatchPredictionJob> 6179 context, 6180 ListBatchPredictionJobsResponse response) { 6181 return new ListBatchPredictionJobsPage(context, response); 6182 } 6183 6184 @Override createPageAsync( PageContext< ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse, BatchPredictionJob> context, ApiFuture<ListBatchPredictionJobsResponse> futureResponse)6185 public ApiFuture<ListBatchPredictionJobsPage> createPageAsync( 6186 PageContext< 6187 ListBatchPredictionJobsRequest, ListBatchPredictionJobsResponse, BatchPredictionJob> 6188 context, 6189 ApiFuture<ListBatchPredictionJobsResponse> futureResponse) { 6190 return super.createPageAsync(context, futureResponse); 6191 } 6192 } 6193 6194 public static class ListBatchPredictionJobsFixedSizeCollection 6195 extends AbstractFixedSizeCollection< 6196 ListBatchPredictionJobsRequest, 6197 ListBatchPredictionJobsResponse, 6198 BatchPredictionJob, 6199 ListBatchPredictionJobsPage, 6200 ListBatchPredictionJobsFixedSizeCollection> { 6201 ListBatchPredictionJobsFixedSizeCollection( List<ListBatchPredictionJobsPage> pages, int collectionSize)6202 private ListBatchPredictionJobsFixedSizeCollection( 6203 List<ListBatchPredictionJobsPage> pages, int collectionSize) { 6204 super(pages, collectionSize); 6205 } 6206 createEmptyCollection()6207 private static ListBatchPredictionJobsFixedSizeCollection createEmptyCollection() { 6208 return new ListBatchPredictionJobsFixedSizeCollection(null, 0); 6209 } 6210 6211 @Override createCollection( List<ListBatchPredictionJobsPage> pages, int collectionSize)6212 protected ListBatchPredictionJobsFixedSizeCollection createCollection( 6213 List<ListBatchPredictionJobsPage> pages, int collectionSize) { 6214 return new ListBatchPredictionJobsFixedSizeCollection(pages, collectionSize); 6215 } 6216 } 6217 6218 public static class SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse 6219 extends AbstractPagedListResponse< 6220 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 6221 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 6222 ModelMonitoringStatsAnomalies, 6223 SearchModelDeploymentMonitoringStatsAnomaliesPage, 6224 SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection> { 6225 createAsync( PageContext< SearchModelDeploymentMonitoringStatsAnomaliesRequest, SearchModelDeploymentMonitoringStatsAnomaliesResponse, ModelMonitoringStatsAnomalies> context, ApiFuture<SearchModelDeploymentMonitoringStatsAnomaliesResponse> futureResponse)6226 public static ApiFuture<SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse> createAsync( 6227 PageContext< 6228 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 6229 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 6230 ModelMonitoringStatsAnomalies> 6231 context, 6232 ApiFuture<SearchModelDeploymentMonitoringStatsAnomaliesResponse> futureResponse) { 6233 ApiFuture<SearchModelDeploymentMonitoringStatsAnomaliesPage> futurePage = 6234 SearchModelDeploymentMonitoringStatsAnomaliesPage.createEmptyPage() 6235 .createPageAsync(context, futureResponse); 6236 return ApiFutures.transform( 6237 futurePage, 6238 input -> new SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse(input), 6239 MoreExecutors.directExecutor()); 6240 } 6241 SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse( SearchModelDeploymentMonitoringStatsAnomaliesPage page)6242 private SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse( 6243 SearchModelDeploymentMonitoringStatsAnomaliesPage page) { 6244 super( 6245 page, 6246 SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection.createEmptyCollection()); 6247 } 6248 } 6249 6250 public static class SearchModelDeploymentMonitoringStatsAnomaliesPage 6251 extends AbstractPage< 6252 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 6253 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 6254 ModelMonitoringStatsAnomalies, 6255 SearchModelDeploymentMonitoringStatsAnomaliesPage> { 6256 SearchModelDeploymentMonitoringStatsAnomaliesPage( PageContext< SearchModelDeploymentMonitoringStatsAnomaliesRequest, SearchModelDeploymentMonitoringStatsAnomaliesResponse, ModelMonitoringStatsAnomalies> context, SearchModelDeploymentMonitoringStatsAnomaliesResponse response)6257 private SearchModelDeploymentMonitoringStatsAnomaliesPage( 6258 PageContext< 6259 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 6260 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 6261 ModelMonitoringStatsAnomalies> 6262 context, 6263 SearchModelDeploymentMonitoringStatsAnomaliesResponse response) { 6264 super(context, response); 6265 } 6266 createEmptyPage()6267 private static SearchModelDeploymentMonitoringStatsAnomaliesPage createEmptyPage() { 6268 return new SearchModelDeploymentMonitoringStatsAnomaliesPage(null, null); 6269 } 6270 6271 @Override createPage( PageContext< SearchModelDeploymentMonitoringStatsAnomaliesRequest, SearchModelDeploymentMonitoringStatsAnomaliesResponse, ModelMonitoringStatsAnomalies> context, SearchModelDeploymentMonitoringStatsAnomaliesResponse response)6272 protected SearchModelDeploymentMonitoringStatsAnomaliesPage createPage( 6273 PageContext< 6274 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 6275 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 6276 ModelMonitoringStatsAnomalies> 6277 context, 6278 SearchModelDeploymentMonitoringStatsAnomaliesResponse response) { 6279 return new SearchModelDeploymentMonitoringStatsAnomaliesPage(context, response); 6280 } 6281 6282 @Override createPageAsync( PageContext< SearchModelDeploymentMonitoringStatsAnomaliesRequest, SearchModelDeploymentMonitoringStatsAnomaliesResponse, ModelMonitoringStatsAnomalies> context, ApiFuture<SearchModelDeploymentMonitoringStatsAnomaliesResponse> futureResponse)6283 public ApiFuture<SearchModelDeploymentMonitoringStatsAnomaliesPage> createPageAsync( 6284 PageContext< 6285 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 6286 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 6287 ModelMonitoringStatsAnomalies> 6288 context, 6289 ApiFuture<SearchModelDeploymentMonitoringStatsAnomaliesResponse> futureResponse) { 6290 return super.createPageAsync(context, futureResponse); 6291 } 6292 } 6293 6294 public static class SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection 6295 extends AbstractFixedSizeCollection< 6296 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 6297 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 6298 ModelMonitoringStatsAnomalies, 6299 SearchModelDeploymentMonitoringStatsAnomaliesPage, 6300 SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection> { 6301 SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection( List<SearchModelDeploymentMonitoringStatsAnomaliesPage> pages, int collectionSize)6302 private SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection( 6303 List<SearchModelDeploymentMonitoringStatsAnomaliesPage> pages, int collectionSize) { 6304 super(pages, collectionSize); 6305 } 6306 6307 private static SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection createEmptyCollection()6308 createEmptyCollection() { 6309 return new SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection(null, 0); 6310 } 6311 6312 @Override createCollection( List<SearchModelDeploymentMonitoringStatsAnomaliesPage> pages, int collectionSize)6313 protected SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection createCollection( 6314 List<SearchModelDeploymentMonitoringStatsAnomaliesPage> pages, int collectionSize) { 6315 return new SearchModelDeploymentMonitoringStatsAnomaliesFixedSizeCollection( 6316 pages, collectionSize); 6317 } 6318 } 6319 6320 public static class ListModelDeploymentMonitoringJobsPagedResponse 6321 extends AbstractPagedListResponse< 6322 ListModelDeploymentMonitoringJobsRequest, 6323 ListModelDeploymentMonitoringJobsResponse, 6324 ModelDeploymentMonitoringJob, 6325 ListModelDeploymentMonitoringJobsPage, 6326 ListModelDeploymentMonitoringJobsFixedSizeCollection> { 6327 createAsync( PageContext< ListModelDeploymentMonitoringJobsRequest, ListModelDeploymentMonitoringJobsResponse, ModelDeploymentMonitoringJob> context, ApiFuture<ListModelDeploymentMonitoringJobsResponse> futureResponse)6328 public static ApiFuture<ListModelDeploymentMonitoringJobsPagedResponse> createAsync( 6329 PageContext< 6330 ListModelDeploymentMonitoringJobsRequest, 6331 ListModelDeploymentMonitoringJobsResponse, 6332 ModelDeploymentMonitoringJob> 6333 context, 6334 ApiFuture<ListModelDeploymentMonitoringJobsResponse> futureResponse) { 6335 ApiFuture<ListModelDeploymentMonitoringJobsPage> futurePage = 6336 ListModelDeploymentMonitoringJobsPage.createEmptyPage() 6337 .createPageAsync(context, futureResponse); 6338 return ApiFutures.transform( 6339 futurePage, 6340 input -> new ListModelDeploymentMonitoringJobsPagedResponse(input), 6341 MoreExecutors.directExecutor()); 6342 } 6343 ListModelDeploymentMonitoringJobsPagedResponse( ListModelDeploymentMonitoringJobsPage page)6344 private ListModelDeploymentMonitoringJobsPagedResponse( 6345 ListModelDeploymentMonitoringJobsPage page) { 6346 super(page, ListModelDeploymentMonitoringJobsFixedSizeCollection.createEmptyCollection()); 6347 } 6348 } 6349 6350 public static class ListModelDeploymentMonitoringJobsPage 6351 extends AbstractPage< 6352 ListModelDeploymentMonitoringJobsRequest, 6353 ListModelDeploymentMonitoringJobsResponse, 6354 ModelDeploymentMonitoringJob, 6355 ListModelDeploymentMonitoringJobsPage> { 6356 ListModelDeploymentMonitoringJobsPage( PageContext< ListModelDeploymentMonitoringJobsRequest, ListModelDeploymentMonitoringJobsResponse, ModelDeploymentMonitoringJob> context, ListModelDeploymentMonitoringJobsResponse response)6357 private ListModelDeploymentMonitoringJobsPage( 6358 PageContext< 6359 ListModelDeploymentMonitoringJobsRequest, 6360 ListModelDeploymentMonitoringJobsResponse, 6361 ModelDeploymentMonitoringJob> 6362 context, 6363 ListModelDeploymentMonitoringJobsResponse response) { 6364 super(context, response); 6365 } 6366 createEmptyPage()6367 private static ListModelDeploymentMonitoringJobsPage createEmptyPage() { 6368 return new ListModelDeploymentMonitoringJobsPage(null, null); 6369 } 6370 6371 @Override createPage( PageContext< ListModelDeploymentMonitoringJobsRequest, ListModelDeploymentMonitoringJobsResponse, ModelDeploymentMonitoringJob> context, ListModelDeploymentMonitoringJobsResponse response)6372 protected ListModelDeploymentMonitoringJobsPage createPage( 6373 PageContext< 6374 ListModelDeploymentMonitoringJobsRequest, 6375 ListModelDeploymentMonitoringJobsResponse, 6376 ModelDeploymentMonitoringJob> 6377 context, 6378 ListModelDeploymentMonitoringJobsResponse response) { 6379 return new ListModelDeploymentMonitoringJobsPage(context, response); 6380 } 6381 6382 @Override createPageAsync( PageContext< ListModelDeploymentMonitoringJobsRequest, ListModelDeploymentMonitoringJobsResponse, ModelDeploymentMonitoringJob> context, ApiFuture<ListModelDeploymentMonitoringJobsResponse> futureResponse)6383 public ApiFuture<ListModelDeploymentMonitoringJobsPage> createPageAsync( 6384 PageContext< 6385 ListModelDeploymentMonitoringJobsRequest, 6386 ListModelDeploymentMonitoringJobsResponse, 6387 ModelDeploymentMonitoringJob> 6388 context, 6389 ApiFuture<ListModelDeploymentMonitoringJobsResponse> futureResponse) { 6390 return super.createPageAsync(context, futureResponse); 6391 } 6392 } 6393 6394 public static class ListModelDeploymentMonitoringJobsFixedSizeCollection 6395 extends AbstractFixedSizeCollection< 6396 ListModelDeploymentMonitoringJobsRequest, 6397 ListModelDeploymentMonitoringJobsResponse, 6398 ModelDeploymentMonitoringJob, 6399 ListModelDeploymentMonitoringJobsPage, 6400 ListModelDeploymentMonitoringJobsFixedSizeCollection> { 6401 ListModelDeploymentMonitoringJobsFixedSizeCollection( List<ListModelDeploymentMonitoringJobsPage> pages, int collectionSize)6402 private ListModelDeploymentMonitoringJobsFixedSizeCollection( 6403 List<ListModelDeploymentMonitoringJobsPage> pages, int collectionSize) { 6404 super(pages, collectionSize); 6405 } 6406 createEmptyCollection()6407 private static ListModelDeploymentMonitoringJobsFixedSizeCollection createEmptyCollection() { 6408 return new ListModelDeploymentMonitoringJobsFixedSizeCollection(null, 0); 6409 } 6410 6411 @Override createCollection( List<ListModelDeploymentMonitoringJobsPage> pages, int collectionSize)6412 protected ListModelDeploymentMonitoringJobsFixedSizeCollection createCollection( 6413 List<ListModelDeploymentMonitoringJobsPage> pages, int collectionSize) { 6414 return new ListModelDeploymentMonitoringJobsFixedSizeCollection(pages, collectionSize); 6415 } 6416 } 6417 6418 public static class ListLocationsPagedResponse 6419 extends AbstractPagedListResponse< 6420 ListLocationsRequest, 6421 ListLocationsResponse, 6422 Location, 6423 ListLocationsPage, 6424 ListLocationsFixedSizeCollection> { 6425 createAsync( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ApiFuture<ListLocationsResponse> futureResponse)6426 public static ApiFuture<ListLocationsPagedResponse> createAsync( 6427 PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, 6428 ApiFuture<ListLocationsResponse> futureResponse) { 6429 ApiFuture<ListLocationsPage> futurePage = 6430 ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); 6431 return ApiFutures.transform( 6432 futurePage, 6433 input -> new ListLocationsPagedResponse(input), 6434 MoreExecutors.directExecutor()); 6435 } 6436 ListLocationsPagedResponse(ListLocationsPage page)6437 private ListLocationsPagedResponse(ListLocationsPage page) { 6438 super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); 6439 } 6440 } 6441 6442 public static class ListLocationsPage 6443 extends AbstractPage< 6444 ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { 6445 ListLocationsPage( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ListLocationsResponse response)6446 private ListLocationsPage( 6447 PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, 6448 ListLocationsResponse response) { 6449 super(context, response); 6450 } 6451 createEmptyPage()6452 private static ListLocationsPage createEmptyPage() { 6453 return new ListLocationsPage(null, null); 6454 } 6455 6456 @Override createPage( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ListLocationsResponse response)6457 protected ListLocationsPage createPage( 6458 PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, 6459 ListLocationsResponse response) { 6460 return new ListLocationsPage(context, response); 6461 } 6462 6463 @Override createPageAsync( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ApiFuture<ListLocationsResponse> futureResponse)6464 public ApiFuture<ListLocationsPage> createPageAsync( 6465 PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, 6466 ApiFuture<ListLocationsResponse> futureResponse) { 6467 return super.createPageAsync(context, futureResponse); 6468 } 6469 } 6470 6471 public static class ListLocationsFixedSizeCollection 6472 extends AbstractFixedSizeCollection< 6473 ListLocationsRequest, 6474 ListLocationsResponse, 6475 Location, 6476 ListLocationsPage, 6477 ListLocationsFixedSizeCollection> { 6478 ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize)6479 private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) { 6480 super(pages, collectionSize); 6481 } 6482 createEmptyCollection()6483 private static ListLocationsFixedSizeCollection createEmptyCollection() { 6484 return new ListLocationsFixedSizeCollection(null, 0); 6485 } 6486 6487 @Override createCollection( List<ListLocationsPage> pages, int collectionSize)6488 protected ListLocationsFixedSizeCollection createCollection( 6489 List<ListLocationsPage> pages, int collectionSize) { 6490 return new ListLocationsFixedSizeCollection(pages, collectionSize); 6491 } 6492 } 6493 } 6494