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