Class JobServiceClient
- java.lang.Object
-
- com.google.cloud.talent.v4beta1.JobServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@BetaApi @Generated("by gapic-generator-java") public class JobServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: A service handles job management, including job CRUD, enumeration and search.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()) { ProjectName parent = ProjectName.of("[PROJECT]"); 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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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 Classes Modifier and Type Class Description static class
JobServiceClient.ListJobsFixedSizeCollection
static class
JobServiceClient.ListJobsPage
static class
JobServiceClient.ListJobsPagedResponse
static class
JobServiceClient.SearchJobsFixedSizeCollection
static class
JobServiceClient.SearchJobsForAlertFixedSizeCollection
static class
JobServiceClient.SearchJobsForAlertPage
static class
JobServiceClient.SearchJobsForAlertPagedResponse
static class
JobServiceClient.SearchJobsPage
static class
JobServiceClient.SearchJobsPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
JobServiceClient(JobServiceSettings settings)
Constructs an instance of JobServiceClient, using the given settings.protected
JobServiceClient(JobServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata>
batchCreateJobsAsync(BatchCreateJobsRequest request)
Begins executing a batch create jobs operation.com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata>
batchCreateJobsAsync(ProjectName parent, List<Job> jobs)
Begins executing a batch create jobs operation.com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata>
batchCreateJobsAsync(TenantName parent, List<Job> jobs)
Begins executing a batch create jobs operation.com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata>
batchCreateJobsAsync(String parent, List<Job> jobs)
Begins executing a batch create jobs operation.com.google.api.gax.rpc.UnaryCallable<BatchCreateJobsRequest,com.google.longrunning.Operation>
batchCreateJobsCallable()
Begins executing a batch create jobs operation.com.google.api.gax.rpc.OperationCallable<BatchCreateJobsRequest,JobOperationResult,BatchOperationMetadata>
batchCreateJobsOperationCallable()
Begins executing a batch create jobs operation.void
batchDeleteJobs(BatchDeleteJobsRequest request)
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.void
batchDeleteJobs(ProjectName parent, String filter)
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.void
batchDeleteJobs(TenantName parent, String filter)
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.void
batchDeleteJobs(String parent, String filter)
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.com.google.api.gax.rpc.UnaryCallable<BatchDeleteJobsRequest,com.google.protobuf.Empty>
batchDeleteJobsCallable()
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata>
batchUpdateJobsAsync(BatchUpdateJobsRequest request)
Begins executing a batch update jobs operation.com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata>
batchUpdateJobsAsync(ProjectName parent, List<Job> jobs)
Begins executing a batch update jobs operation.com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata>
batchUpdateJobsAsync(TenantName parent, List<Job> jobs)
Begins executing a batch update jobs operation.com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata>
batchUpdateJobsAsync(String parent, List<Job> jobs)
Begins executing a batch update jobs operation.com.google.api.gax.rpc.UnaryCallable<BatchUpdateJobsRequest,com.google.longrunning.Operation>
batchUpdateJobsCallable()
Begins executing a batch update jobs operation.com.google.api.gax.rpc.OperationCallable<BatchUpdateJobsRequest,JobOperationResult,BatchOperationMetadata>
batchUpdateJobsOperationCallable()
Begins executing a batch update jobs operation.void
close()
static JobServiceClient
create()
Constructs an instance of JobServiceClient with default settings.static JobServiceClient
create(JobServiceSettings settings)
Constructs an instance of JobServiceClient, using the given settings.static JobServiceClient
create(JobServiceStub stub)
Constructs an instance of JobServiceClient, using the given stub for making calls.Job
createJob(CreateJobRequest request)
Creates a new job.Job
createJob(ProjectName parent, Job job)
Creates a new job.Job
createJob(TenantName parent, Job job)
Creates a new job.Job
createJob(String parent, Job job)
Creates a new job.com.google.api.gax.rpc.UnaryCallable<CreateJobRequest,Job>
createJobCallable()
Creates a new job.void
deleteJob(DeleteJobRequest request)
Deletes the specified job.void
deleteJob(JobName name)
Deletes the specified job.void
deleteJob(String name)
Deletes the specified job.com.google.api.gax.rpc.UnaryCallable<DeleteJobRequest,com.google.protobuf.Empty>
deleteJobCallable()
Deletes the specified job.com.google.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.Job
getJob(GetJobRequest request)
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.Job
getJob(JobName name)
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.Job
getJob(String name)
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.com.google.api.gax.rpc.UnaryCallable<GetJobRequest,Job>
getJobCallable()
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.JobServiceSettings
getSettings()
JobServiceStub
getStub()
boolean
isShutdown()
boolean
isTerminated()
JobServiceClient.ListJobsPagedResponse
listJobs(ListJobsRequest request)
Lists jobs by filter.JobServiceClient.ListJobsPagedResponse
listJobs(ProjectName parent, String filter)
Lists jobs by filter.JobServiceClient.ListJobsPagedResponse
listJobs(TenantName parent, String filter)
Lists jobs by filter.JobServiceClient.ListJobsPagedResponse
listJobs(String parent, String filter)
Lists jobs by filter.com.google.api.gax.rpc.UnaryCallable<ListJobsRequest,ListJobsResponse>
listJobsCallable()
Lists jobs by filter.com.google.api.gax.rpc.UnaryCallable<ListJobsRequest,JobServiceClient.ListJobsPagedResponse>
listJobsPagedCallable()
Lists jobs by filter.JobServiceClient.SearchJobsPagedResponse
searchJobs(SearchJobsRequest request)
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].com.google.api.gax.rpc.UnaryCallable<SearchJobsRequest,SearchJobsResponse>
searchJobsCallable()
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].JobServiceClient.SearchJobsForAlertPagedResponse
searchJobsForAlert(SearchJobsRequest request)
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].com.google.api.gax.rpc.UnaryCallable<SearchJobsRequest,SearchJobsResponse>
searchJobsForAlertCallable()
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].com.google.api.gax.rpc.UnaryCallable<SearchJobsRequest,JobServiceClient.SearchJobsForAlertPagedResponse>
searchJobsForAlertPagedCallable()
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].com.google.api.gax.rpc.UnaryCallable<SearchJobsRequest,JobServiceClient.SearchJobsPagedResponse>
searchJobsPagedCallable()
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].void
shutdown()
void
shutdownNow()
Job
updateJob(Job job)
Updates specified job.Job
updateJob(UpdateJobRequest request)
Updates specified job.com.google.api.gax.rpc.UnaryCallable<UpdateJobRequest,Job>
updateJobCallable()
Updates specified job.
-
-
-
Constructor Detail
-
JobServiceClient
protected JobServiceClient(JobServiceSettings settings) throws IOException
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
protected JobServiceClient(JobServiceStub stub)
-
-
Method Detail
-
create
public static final JobServiceClient create() throws IOException
Constructs an instance of JobServiceClient with default settings.- Throws:
IOException
-
create
public static final JobServiceClient create(JobServiceSettings settings) throws IOException
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
public static final JobServiceClient create(JobServiceStub stub)
Constructs an instance of JobServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(JobServiceSettings).
-
getSettings
public final JobServiceSettings getSettings()
-
getStub
public JobServiceStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getHttpJsonOperationsClient
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
createJob
public final Job createJob(ProjectName parent, Job job)
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()) { ProjectName parent = ProjectName.of("[PROJECT]"); 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/tenant/bar". If tenant id is unspecified a default tenant is created. For example, "projects/foo".
job
- Required. The Job to be created.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createJob
public final Job createJob(TenantName parent, Job job)
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/tenant/bar". If tenant id is unspecified a default tenant is created. For example, "projects/foo".
job
- Required. The Job to be created.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createJob
public final Job createJob(String parent, Job job)
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/tenant/bar". If tenant id is unspecified a default tenant is created. For example, "projects/foo".
job
- Required. The Job to be created.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createJob
public final Job createJob(CreateJobRequest request)
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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createJobCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateJobRequest,Job> 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 com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata> batchCreateJobsAsync(ProjectName 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()) { ProjectName parent = ProjectName.of("[PROJECT]"); List<Job> jobs = new ArrayList<>(); JobOperationResult 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
jobs
- Required. The jobs to be created.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateJobsAsync
public final com.google.api.gax.longrunning.OperationFuture<JobOperationResult,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<>(); JobOperationResult 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
jobs
- Required. The jobs to be created.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateJobsAsync
public final com.google.api.gax.longrunning.OperationFuture<JobOperationResult,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<>(); JobOperationResult 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
jobs
- Required. The jobs to be created.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateJobsAsync
public final com.google.api.gax.longrunning.OperationFuture<JobOperationResult,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(); JobOperationResult response = jobServiceClient.batchCreateJobsAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateJobsOperationCallable
public final com.google.api.gax.rpc.OperationCallable<BatchCreateJobsRequest,JobOperationResult,BatchOperationMetadata> batchCreateJobsOperationCallable()
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<JobOperationResult, BatchOperationMetadata> future = jobServiceClient.batchCreateJobsOperationCallable().futureCall(request); // Do something. JobOperationResult response = future.get(); }
-
batchCreateJobsCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchCreateJobsRequest,com.google.longrunning.Operation> 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
public final Job getJob(JobName name)
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.ofProjectTenantJobName("[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".
If tenant id is unspecified, the default tenant is used. For example, "projects/foo/jobs/bar".
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getJob
public final Job getJob(String name)
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.ofProjectTenantJobName("[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".
If tenant id is unspecified, the default tenant is used. For example, "projects/foo/jobs/bar".
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getJob
public final Job getJob(GetJobRequest request)
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.ofProjectTenantJobName("[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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getJobCallable
public final com.google.api.gax.rpc.UnaryCallable<GetJobRequest,Job> 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.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]").toString()) .build(); ApiFuture<Job> future = jobServiceClient.getJobCallable().futureCall(request); // Do something. Job response = future.get(); }
-
updateJob
public final Job updateJob(Job job)
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(); Job response = jobServiceClient.updateJob(job); }
- Parameters:
job
- Required. The Job to be updated.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateJob
public final Job updateJob(UpdateJobRequest request)
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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateJobCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateJobRequest,Job> 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 com.google.api.gax.longrunning.OperationFuture<JobOperationResult,BatchOperationMetadata> batchUpdateJobsAsync(ProjectName 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()) { ProjectName parent = ProjectName.of("[PROJECT]"); List<Job> jobs = new ArrayList<>(); JobOperationResult 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
jobs
- Required. The jobs to be updated.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateJobsAsync
public final com.google.api.gax.longrunning.OperationFuture<JobOperationResult,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<>(); JobOperationResult 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
jobs
- Required. The jobs to be updated.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateJobsAsync
public final com.google.api.gax.longrunning.OperationFuture<JobOperationResult,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<>(); JobOperationResult 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
jobs
- Required. The jobs to be updated.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateJobsAsync
public final com.google.api.gax.longrunning.OperationFuture<JobOperationResult,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(); JobOperationResult response = jobServiceClient.batchUpdateJobsAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateJobsOperationCallable
public final com.google.api.gax.rpc.OperationCallable<BatchUpdateJobsRequest,JobOperationResult,BatchOperationMetadata> batchUpdateJobsOperationCallable()
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<JobOperationResult, BatchOperationMetadata> future = jobServiceClient.batchUpdateJobsOperationCallable().futureCall(request); // Do something. JobOperationResult response = future.get(); }
-
batchUpdateJobsCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchUpdateJobsRequest,com.google.longrunning.Operation> 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
public final void deleteJob(JobName name)
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.ofProjectTenantJobName("[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".
If tenant id is unspecified, the default tenant is used. For example, "projects/foo/jobs/bar".
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteJob
public final void deleteJob(String name)
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.ofProjectTenantJobName("[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".
If tenant id is unspecified, the default tenant is used. For example, "projects/foo/jobs/bar".
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteJob
public final void deleteJob(DeleteJobRequest request)
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.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]").toString()) .build(); jobServiceClient.deleteJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteJobCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteJobRequest,com.google.protobuf.Empty> 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.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]").toString()) .build(); ApiFuture<Empty> future = jobServiceClient.deleteJobCallable().futureCall(request); // Do something. future.get(); }
-
batchDeleteJobs
public final void batchDeleteJobs(ProjectName parent, String filter)
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s 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()) { ProjectName parent = ProjectName.of("[PROJECT]"); String filter = "filter-1274492040"; jobServiceClient.batchDeleteJobs(parent, filter); }
- 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
filter
- Required. The filter string specifies the jobs to be deleted.Supported operator: =, AND
The fields eligible for filtering are:
- `companyName` (Required)
- `requisitionId` (Required)
Sample Query: companyName = "projects/foo/companies/bar" AND requisitionId = "req-1"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteJobs
public final void batchDeleteJobs(TenantName parent, String filter)
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s 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"; jobServiceClient.batchDeleteJobs(parent, filter); }
- 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
filter
- Required. The filter string specifies the jobs to be deleted.Supported operator: =, AND
The fields eligible for filtering are:
- `companyName` (Required)
- `requisitionId` (Required)
Sample Query: companyName = "projects/foo/companies/bar" AND requisitionId = "req-1"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteJobs
public final void batchDeleteJobs(String parent, String filter)
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s 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"; jobServiceClient.batchDeleteJobs(parent, filter); }
- 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
filter
- Required. The filter string specifies the jobs to be deleted.Supported operator: =, AND
The fields eligible for filtering are:
- `companyName` (Required)
- `requisitionId` (Required)
Sample Query: companyName = "projects/foo/companies/bar" AND requisitionId = "req-1"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteJobs
public final void batchDeleteJobs(BatchDeleteJobsRequest request)
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s 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()) { BatchDeleteJobsRequest request = BatchDeleteJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setFilter("filter-1274492040") .build(); jobServiceClient.batchDeleteJobs(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteJobsCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchDeleteJobsRequest,com.google.protobuf.Empty> batchDeleteJobsCallable()
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s 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()) { BatchDeleteJobsRequest request = BatchDeleteJobsRequest.newBuilder() .setParent(TenantName.of("[PROJECT]", "[TENANT]").toString()) .setFilter("filter-1274492040") .build(); ApiFuture<Empty> future = jobServiceClient.batchDeleteJobsCallable().futureCall(request); // Do something. future.get(); }
-
listJobs
public final JobServiceClient.ListJobsPagedResponse listJobs(ProjectName parent, String filter)
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()) { ProjectName parent = ProjectName.of("[PROJECT]"); 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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listJobs
public final JobServiceClient.ListJobsPagedResponse listJobs(TenantName parent, String filter)
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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listJobs
public final JobServiceClient.ListJobsPagedResponse listJobs(String parent, String filter)
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/tenant/bar". If tenant id is unspecified, a default tenant is created. For example, "projects/foo".
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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listJobs
public final JobServiceClient.ListJobsPagedResponse listJobs(ListJobsRequest request)
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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listJobsPagedCallable
public final com.google.api.gax.rpc.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
public final com.google.api.gax.rpc.UnaryCallable<ListJobsRequest,ListJobsResponse> 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
public final JobServiceClient.SearchJobsPagedResponse searchJobs(SearchJobsRequest request)
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].This call constrains the [visibility][google.cloud.talent.v4beta1.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) .setRequirePreciseResultSize(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); for (SearchJobsResponse.MatchingJob element : jobServiceClient.searchJobs(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
searchJobsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<SearchJobsRequest,JobServiceClient.SearchJobsPagedResponse> searchJobsPagedCallable()
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].This call constrains the [visibility][google.cloud.talent.v4beta1.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) .setRequirePreciseResultSize(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); ApiFuture<SearchJobsResponse.MatchingJob> future = jobServiceClient.searchJobsPagedCallable().futureCall(request); // Do something. for (SearchJobsResponse.MatchingJob element : future.get().iterateAll()) { // doThingsWith(element); } }
-
searchJobsCallable
public final com.google.api.gax.rpc.UnaryCallable<SearchJobsRequest,SearchJobsResponse> searchJobsCallable()
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].This call constrains the [visibility][google.cloud.talent.v4beta1.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) .setRequirePreciseResultSize(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); while (true) { SearchJobsResponse response = jobServiceClient.searchJobsCallable().call(request); for (SearchJobsResponse.MatchingJob element : response.getMatchingJobsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
searchJobsForAlert
public final JobServiceClient.SearchJobsForAlertPagedResponse searchJobsForAlert(SearchJobsRequest request)
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.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), and has different algorithmic adjustments that are targeted to passive job seekers.
This call constrains the [visibility][google.cloud.talent.v4beta1.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) .setRequirePreciseResultSize(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); for (SearchJobsResponse.MatchingJob element : jobServiceClient.searchJobsForAlert(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
searchJobsForAlertPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<SearchJobsRequest,JobServiceClient.SearchJobsForAlertPagedResponse> searchJobsForAlertPagedCallable()
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.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), and has different algorithmic adjustments that are targeted to passive job seekers.
This call constrains the [visibility][google.cloud.talent.v4beta1.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) .setRequirePreciseResultSize(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); ApiFuture<SearchJobsResponse.MatchingJob> future = jobServiceClient.searchJobsForAlertPagedCallable().futureCall(request); // Do something. for (SearchJobsResponse.MatchingJob element : future.get().iterateAll()) { // doThingsWith(element); } }
-
searchJobsForAlertCallable
public final com.google.api.gax.rpc.UnaryCallable<SearchJobsRequest,SearchJobsResponse> searchJobsForAlertCallable()
Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.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), and has different algorithmic adjustments that are targeted to passive job seekers.
This call constrains the [visibility][google.cloud.talent.v4beta1.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) .setRequirePreciseResultSize(true) .addAllHistogramQueries(new ArrayList<HistogramQuery>()) .setJobView(JobView.forNumber(0)) .setOffset(-1019779949) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setCustomRankingInfo(SearchJobsRequest.CustomRankingInfo.newBuilder().build()) .setDisableKeywordMatch(true) .build(); while (true) { SearchJobsResponse response = jobServiceClient.searchJobsForAlertCallable().call(request); for (SearchJobsResponse.MatchingJob element : response.getMatchingJobsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-