Class JobServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
TenantName parent = TenantName.of("[PROJECT]", "[TENANT]");
Job job = Job.newBuilder().build();
Job response = jobServiceClient.createJob(parent, job);
}
Note: close() needs to be called on the JobServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
CreateJob |
Creates a new job. Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchCreateJobs |
Begins executing a batch create jobs operation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetJob |
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateJob |
Updates specified job. Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchUpdateJobs |
Begins executing a batch update jobs operation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteJob |
Deletes the specified job. Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchDeleteJobs |
Begins executing a batch delete jobs operation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListJobs |
Lists jobs by filter. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SearchJobs |
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the database, and only returns jobs that the caller has permission to search against. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SearchJobsForAlert |
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), it has different algorithmic adjustments that are designed to specifically target passive job seekers. This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the database, and only returns jobs the caller has permission to search against. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of JobServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
JobServiceSettings jobServiceSettings =
JobServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
JobServiceSettings jobServiceSettings =
JobServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
JobServiceSettings jobServiceSettings = JobServiceSettings.newHttpJsonBuilder().build();
JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJobServiceClient(JobServiceSettings settings) Constructs an instance of JobServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) Begins executing a batch create jobs operation.batchCreateJobsAsync(TenantName parent, List<Job> jobs) Begins executing a batch create jobs operation.batchCreateJobsAsync(String parent, List<Job> jobs) Begins executing a batch create jobs operation.Begins executing a batch create jobs operation.Begins executing a batch create jobs operation.Begins executing a batch delete jobs operation.batchDeleteJobsAsync(TenantName parent, List<String> names) Begins executing a batch delete jobs operation.batchDeleteJobsAsync(String parent, List<String> names) Begins executing a batch delete jobs operation.Begins executing a batch delete jobs operation.Begins executing a batch delete jobs operation.Begins executing a batch update jobs operation.batchUpdateJobsAsync(TenantName parent, List<Job> jobs) Begins executing a batch update jobs operation.batchUpdateJobsAsync(String parent, List<Job> jobs) Begins executing a batch update jobs operation.Begins executing a batch update jobs operation.Begins executing a batch update jobs operation.final voidclose()static final JobServiceClientcreate()Constructs an instance of JobServiceClient with default settings.static final JobServiceClientcreate(JobServiceSettings settings) Constructs an instance of JobServiceClient, using the given settings.static final JobServiceClientcreate(JobServiceStub stub) Constructs an instance of JobServiceClient, using the given stub for making calls.final JobcreateJob(CreateJobRequest request) Creates a new job.final JobcreateJob(TenantName parent, Job job) Creates a new job.final JobCreates a new job.final UnaryCallable<CreateJobRequest,Job> Creates a new job.final voiddeleteJob(DeleteJobRequest request) Deletes the specified job.final voidDeletes the specified job.final voidDeletes the specified job.final UnaryCallable<DeleteJobRequest,com.google.protobuf.Empty> Deletes the specified job.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final JobgetJob(GetJobRequest request) Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.final JobRetrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.final JobRetrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.final UnaryCallable<GetJobRequest,Job> Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final JobServiceSettingsgetStub()booleanbooleanlistJobs(ListJobsRequest request) Lists jobs by filter.listJobs(TenantName parent, String filter) Lists jobs by filter.Lists jobs by filter.Lists jobs by filter.Lists jobs by filter.final SearchJobsResponsesearchJobs(SearchJobsRequest request) Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].final SearchJobsResponsesearchJobsForAlert(SearchJobsRequest request) Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].voidshutdown()voidfinal JobUpdates specified job.final JobupdateJob(UpdateJobRequest request) Updates specified job.final UnaryCallable<UpdateJobRequest,Job> Updates specified job.
-
Constructor Details
-
JobServiceClient
Constructs an instance of JobServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
JobServiceClient
-
-
Method Details
-
create
Constructs an instance of JobServiceClient with default settings.- Throws:
IOException
-
create
Constructs an instance of JobServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of JobServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(JobServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createJob
Creates a new job.Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantName parent = TenantName.of("[PROJECT]", "[TENANT]"); Job job = Job.newBuilder().build(); Job response = jobServiceClient.createJob(parent, job); }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
job- Required. The Job to be created.- Throws:
ApiException- if the remote call fails
-
createJob
Creates a new job.Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { String parent = TenantName.of("[PROJECT]", "[TENANT]").toString(); Job job = Job.newBuilder().build(); Job response = jobServiceClient.createJob(parent, job); }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
job- Required. The Job to be created.- Throws:
ApiException- if the remote call fails
-
createJob
Creates a new job.Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { CreateJobRequest request = CreateJobRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setJob(Job.newBuilder().build()) .build(); Job response = jobServiceClient.createJob(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createJobCallable
Creates a new job.Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { CreateJobRequest request = CreateJobRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setJob(Job.newBuilder().build()) .build(); ApiFuture<Job> future = jobServiceClient.createJobCallable().futureCall(request); // Do something. Job response = future.get(); } -
batchCreateJobsAsync
public final OperationFuture<BatchCreateJobsResponse,BatchOperationMetadata> batchCreateJobsAsync(TenantName parent, List<Job> jobs) Begins executing a batch create jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantName parent = TenantName.of("[PROJECT]", "[TENANT]"); List<Job> jobs = new ArrayList<>(); BatchCreateJobsResponse response = jobServiceClient.batchCreateJobsAsync(parent, jobs).get(); }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
jobs- Required. The jobs to be created. A maximum of 200 jobs can be created in a batch.- Throws:
ApiException- if the remote call fails
-
batchCreateJobsAsync
public final OperationFuture<BatchCreateJobsResponse,BatchOperationMetadata> batchCreateJobsAsync(String parent, List<Job> jobs) Begins executing a batch create jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { String parent = TenantName.of("[PROJECT]", "[TENANT]").toString(); List<Job> jobs = new ArrayList<>(); BatchCreateJobsResponse response = jobServiceClient.batchCreateJobsAsync(parent, jobs).get(); }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
jobs- Required. The jobs to be created. A maximum of 200 jobs can be created in a batch.- Throws:
ApiException- if the remote call fails
-
batchCreateJobsAsync
public final OperationFuture<BatchCreateJobsResponse,BatchOperationMetadata> batchCreateJobsAsync(BatchCreateJobsRequest request) Begins executing a batch create jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchCreateJobsRequest request = BatchCreateJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllJobs(new ArrayList<Job>()) .build(); BatchCreateJobsResponse response = jobServiceClient.batchCreateJobsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchCreateJobsOperationCallable
public final OperationCallable<BatchCreateJobsRequest,BatchCreateJobsResponse, batchCreateJobsOperationCallable()BatchOperationMetadata> Begins executing a batch create jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchCreateJobsRequest request = BatchCreateJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllJobs(new ArrayList<Job>()) .build(); OperationFuture<BatchCreateJobsResponse, BatchOperationMetadata> future = jobServiceClient.batchCreateJobsOperationCallable().futureCall(request); // Do something. BatchCreateJobsResponse response = future.get(); } -
batchCreateJobsCallable
Begins executing a batch create jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchCreateJobsRequest request = BatchCreateJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllJobs(new ArrayList<Job>()) .build(); ApiFuture<Operation> future = jobServiceClient.batchCreateJobsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getJob
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { JobName name = JobName.of("[PROJECT]", "[TENANT]", "[JOB]"); Job response = jobServiceClient.getJob(name); }- Parameters:
name- Required. The resource name of the job to retrieve.The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example, "projects/foo/tenants/bar/jobs/baz".
- Throws:
ApiException- if the remote call fails
-
getJob
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { String name = JobName.of("[PROJECT]", "[TENANT]", "[JOB]").toString(); Job response = jobServiceClient.getJob(name); }- Parameters:
name- Required. The resource name of the job to retrieve.The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example, "projects/foo/tenants/bar/jobs/baz".
- Throws:
ApiException- if the remote call fails
-
getJob
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { GetJobRequest request = GetJobRequest.newBuilder() .setName(JobName.of("[PROJECT]", "[TENANT]", "[JOB]").toString()) .build(); Job response = jobServiceClient.getJob(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getJobCallable
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { GetJobRequest request = GetJobRequest.newBuilder() .setName(JobName.of("[PROJECT]", "[TENANT]", "[JOB]").toString()) .build(); ApiFuture<Job> future = jobServiceClient.getJobCallable().futureCall(request); // Do something. Job response = future.get(); } -
updateJob
Updates specified job.Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { Job job = Job.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Job response = jobServiceClient.updateJob(job, updateMask); }- Parameters:
job- Required. The Job to be updated.updateMask- Strongly recommended for the best service experience.If [update_mask][google.cloud.talent.v4.UpdateJobRequest.update_mask] is provided, only the specified fields in [job][google.cloud.talent.v4.UpdateJobRequest.job] are updated. Otherwise all the fields are updated.
A field mask to restrict the fields that are updated. Only top level fields of [Job][google.cloud.talent.v4.Job] are supported.
- Throws:
ApiException- if the remote call fails
-
updateJob
Updates specified job.Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { UpdateJobRequest request = UpdateJobRequest.newBuilder() .setJob(Job.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Job response = jobServiceClient.updateJob(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateJobCallable
Updates specified job.Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { UpdateJobRequest request = UpdateJobRequest.newBuilder() .setJob(Job.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Job> future = jobServiceClient.updateJobCallable().futureCall(request); // Do something. Job response = future.get(); } -
batchUpdateJobsAsync
public final OperationFuture<BatchUpdateJobsResponse,BatchOperationMetadata> batchUpdateJobsAsync(TenantName parent, List<Job> jobs) Begins executing a batch update jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantName parent = TenantName.of("[PROJECT]", "[TENANT]"); List<Job> jobs = new ArrayList<>(); BatchUpdateJobsResponse response = jobServiceClient.batchUpdateJobsAsync(parent, jobs).get(); }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
jobs- Required. The jobs to be updated. A maximum of 200 jobs can be updated in a batch.- Throws:
ApiException- if the remote call fails
-
batchUpdateJobsAsync
public final OperationFuture<BatchUpdateJobsResponse,BatchOperationMetadata> batchUpdateJobsAsync(String parent, List<Job> jobs) Begins executing a batch update jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { String parent = TenantName.of("[PROJECT]", "[TENANT]").toString(); List<Job> jobs = new ArrayList<>(); BatchUpdateJobsResponse response = jobServiceClient.batchUpdateJobsAsync(parent, jobs).get(); }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
jobs- Required. The jobs to be updated. A maximum of 200 jobs can be updated in a batch.- Throws:
ApiException- if the remote call fails
-
batchUpdateJobsAsync
public final OperationFuture<BatchUpdateJobsResponse,BatchOperationMetadata> batchUpdateJobsAsync(BatchUpdateJobsRequest request) Begins executing a batch update jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchUpdateJobsRequest request = BatchUpdateJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllJobs(new ArrayList<Job>()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); BatchUpdateJobsResponse response = jobServiceClient.batchUpdateJobsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchUpdateJobsOperationCallable
public final OperationCallable<BatchUpdateJobsRequest,BatchUpdateJobsResponse, batchUpdateJobsOperationCallable()BatchOperationMetadata> Begins executing a batch update jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchUpdateJobsRequest request = BatchUpdateJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllJobs(new ArrayList<Job>()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); OperationFuture<BatchUpdateJobsResponse, BatchOperationMetadata> future = jobServiceClient.batchUpdateJobsOperationCallable().futureCall(request); // Do something. BatchUpdateJobsResponse response = future.get(); } -
batchUpdateJobsCallable
Begins executing a batch update jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchUpdateJobsRequest request = BatchUpdateJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllJobs(new ArrayList<Job>()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Operation> future = jobServiceClient.batchUpdateJobsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteJob
Deletes the specified job.Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { JobName name = JobName.of("[PROJECT]", "[TENANT]", "[JOB]"); jobServiceClient.deleteJob(name); }- Parameters:
name- Required. The resource name of the job to be deleted.The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example, "projects/foo/tenants/bar/jobs/baz".
- Throws:
ApiException- if the remote call fails
-
deleteJob
Deletes the specified job.Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { String name = JobName.of("[PROJECT]", "[TENANT]", "[JOB]").toString(); jobServiceClient.deleteJob(name); }- Parameters:
name- Required. The resource name of the job to be deleted.The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example, "projects/foo/tenants/bar/jobs/baz".
- Throws:
ApiException- if the remote call fails
-
deleteJob
Deletes the specified job.Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { DeleteJobRequest request = DeleteJobRequest.newBuilder() .setName(JobName.of("[PROJECT]", "[TENANT]", "[JOB]").toString()) .build(); jobServiceClient.deleteJob(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteJobCallable
Deletes the specified job.Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { DeleteJobRequest request = DeleteJobRequest.newBuilder() .setName(JobName.of("[PROJECT]", "[TENANT]", "[JOB]").toString()) .build(); ApiFuture<Empty> future = jobServiceClient.deleteJobCallable().futureCall(request); // Do something. future.get(); } -
batchDeleteJobsAsync
public final OperationFuture<BatchDeleteJobsResponse,BatchOperationMetadata> batchDeleteJobsAsync(TenantName parent, List<String> names) Begins executing a batch delete jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantName parent = TenantName.of("[PROJECT]", "[TENANT]"); List<String> names = new ArrayList<>(); BatchDeleteJobsResponse response = jobServiceClient.batchDeleteJobsAsync(parent, names).get(); }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
The parent of all of the jobs specified in `names` must match this field.
names- The names of the jobs to delete.The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example, "projects/foo/tenants/bar/jobs/baz".
A maximum of 200 jobs can be deleted in a batch.
- Throws:
ApiException- if the remote call fails
-
batchDeleteJobsAsync
public final OperationFuture<BatchDeleteJobsResponse,BatchOperationMetadata> batchDeleteJobsAsync(String parent, List<String> names) Begins executing a batch delete jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { String parent = TenantName.of("[PROJECT]", "[TENANT]").toString(); List<String> names = new ArrayList<>(); BatchDeleteJobsResponse response = jobServiceClient.batchDeleteJobsAsync(parent, names).get(); }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
The parent of all of the jobs specified in `names` must match this field.
names- The names of the jobs to delete.The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example, "projects/foo/tenants/bar/jobs/baz".
A maximum of 200 jobs can be deleted in a batch.
- Throws:
ApiException- if the remote call fails
-
batchDeleteJobsAsync
public final OperationFuture<BatchDeleteJobsResponse,BatchOperationMetadata> batchDeleteJobsAsync(BatchDeleteJobsRequest request) Begins executing a batch delete jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchDeleteJobsRequest request = BatchDeleteJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllNames(new ArrayList<String>()) .build(); BatchDeleteJobsResponse response = jobServiceClient.batchDeleteJobsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchDeleteJobsOperationCallable
public final OperationCallable<BatchDeleteJobsRequest,BatchDeleteJobsResponse, batchDeleteJobsOperationCallable()BatchOperationMetadata> Begins executing a batch delete jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchDeleteJobsRequest request = BatchDeleteJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllNames(new ArrayList<String>()) .build(); OperationFuture<BatchDeleteJobsResponse, BatchOperationMetadata> future = jobServiceClient.batchDeleteJobsOperationCallable().futureCall(request); // Do something. BatchDeleteJobsResponse response = future.get(); } -
batchDeleteJobsCallable
Begins executing a batch delete jobs operation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { BatchDeleteJobsRequest request = BatchDeleteJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .addAllNames(new ArrayList<String>()) .build(); ApiFuture<Operation> future = jobServiceClient.batchDeleteJobsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listJobs
Lists jobs by filter.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantName parent = TenantName.of("[PROJECT]", "[TENANT]"); String filter = "filter-1274492040"; for (Job element : jobServiceClient.listJobs(parent, filter).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
filter- Required. The filter string specifies the jobs to be enumerated.Supported operator: =, AND
The fields eligible for filtering are:
- `companyName`
- `requisitionId`
- `status` Available values: OPEN, EXPIRED, ALL. Defaults to OPEN if no value is specified.
At least one of `companyName` and `requisitionId` must present or an INVALID_ARGUMENT error is thrown.
Sample Query:
- companyName = "projects/foo/tenants/bar/companies/baz"
- companyName = "projects/foo/tenants/bar/companies/baz" AND requisitionId = "req-1"
- companyName = "projects/foo/tenants/bar/companies/baz" AND status = "EXPIRED"
- requisitionId = "req-1"
- requisitionId = "req-1" AND status = "EXPIRED"
- Throws:
ApiException- if the remote call fails
-
listJobs
Lists jobs by filter.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { String parent = TenantName.of("[PROJECT]", "[TENANT]").toString(); String filter = "filter-1274492040"; for (Job element : jobServiceClient.listJobs(parent, filter).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the tenant under which the job is created.The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".
filter- Required. The filter string specifies the jobs to be enumerated.Supported operator: =, AND
The fields eligible for filtering are:
- `companyName`
- `requisitionId`
- `status` Available values: OPEN, EXPIRED, ALL. Defaults to OPEN if no value is specified.
At least one of `companyName` and `requisitionId` must present or an INVALID_ARGUMENT error is thrown.
Sample Query:
- companyName = "projects/foo/tenants/bar/companies/baz"
- companyName = "projects/foo/tenants/bar/companies/baz" AND requisitionId = "req-1"
- companyName = "projects/foo/tenants/bar/companies/baz" AND status = "EXPIRED"
- requisitionId = "req-1"
- requisitionId = "req-1" AND status = "EXPIRED"
- Throws:
ApiException- if the remote call fails
-
listJobs
Lists jobs by filter.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { ListJobsRequest request = ListJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) .setJobView(JobView.forNumber(0)) .build(); for (Job element : jobServiceClient.listJobs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listJobsPagedCallable
public final UnaryCallable<ListJobsRequest,JobServiceClient.ListJobsPagedResponse> listJobsPagedCallable()Lists jobs by filter.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { ListJobsRequest request = ListJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) .setJobView(JobView.forNumber(0)) .build(); ApiFuture<Job> future = jobServiceClient.listJobsPagedCallable().futureCall(request); // Do something. for (Job element : future.get().iterateAll()) { // doThingsWith(element); } } -
listJobsCallable
Lists jobs by filter.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { ListJobsRequest request = ListJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) .setJobView(JobView.forNumber(0)) .build(); while (true) { ListJobsResponse response = jobServiceClient.listJobsCallable().call(request); for (Job element : response.getJobsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
searchJobs
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the database, and only returns jobs that the caller has permission to search against.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { SearchJobsRequest request = SearchJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setRequestMetadata(RequestMetadata.newBuilder().build()) .setJobQuery(JobQuery.newBuilder().build()) .setEnableBroadening(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setMaxPageSize(524069526) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); SearchJobsResponse response = jobServiceClient.searchJobs(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
searchJobsCallable
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the database, and only returns jobs that the caller has permission to search against.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { SearchJobsRequest request = SearchJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setRequestMetadata(RequestMetadata.newBuilder().build()) .setJobQuery(JobQuery.newBuilder().build()) .setEnableBroadening(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setMaxPageSize(524069526) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); ApiFuture<SearchJobsResponse> future = jobServiceClient.searchJobsCallable().futureCall(request); // Do something. SearchJobsResponse response = future.get(); } -
searchJobsForAlert
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), it has different algorithmic adjustments that are designed to specifically target passive job seekers.
This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the database, and only returns jobs the caller has permission to search against.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { SearchJobsRequest request = SearchJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setRequestMetadata(RequestMetadata.newBuilder().build()) .setJobQuery(JobQuery.newBuilder().build()) .setEnableBroadening(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setMaxPageSize(524069526) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); SearchJobsResponse response = jobServiceClient.searchJobsForAlert(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
searchJobsForAlertCallable
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), it has different algorithmic adjustments that are designed to specifically target passive job seekers.
This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the database, and only returns jobs the caller has permission to search against.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (JobServiceClient jobServiceClient = JobServiceClient.create()) { SearchJobsRequest request = SearchJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setRequestMetadata(RequestMetadata.newBuilder().build()) .setJobQuery(JobQuery.newBuilder().build()) .setEnableBroadening(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setMaxPageSize(524069526) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); ApiFuture<SearchJobsResponse> future = jobServiceClient.searchJobsForAlertCallable().futureCall(request); // Do something. SearchJobsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-