JobServiceClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
A service handles job management, including job CRUD, enumeration and search.
Methods
JobServiceClient
JobServiceClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Constructor.
Parameters | |
---|---|
Name | Description |
channel |
grpc.Channel
DEPRECATED. A |
credentials |
google.auth.credentials.Credentials
The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. This argument is mutually exclusive with providing a transport instance to |
client_config |
dict
DEPRECATED. A dictionary of call options for each method. If not specified, the default configuration is used. |
client_info |
google.api_core.gapic_v1.client_info.ClientInfo
The client info used to send a user-agent string along with API requests. If |
client_options |
Union[dict, google.api_core.client_options.ClientOptions]
Client options used to set user options on the client. API Endpoint should be set through client_options. |
batch_create_jobs
batch_create_jobs(parent, jobs, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Begins executing a batch create jobs operation.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
jobs
:jobs = []
response = client.batch_create_jobs(parent, jobs)
def callback(operation_future): ... # Handle result. ... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
Parameters | |
---|---|
Name | Description |
parent |
str
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/api-test-project/tenant/foo". Tenant id is optional and a default tenant is created if unspecified, for example, "projects/api-test-project". |
jobs |
list[Union[dict, Job]]
Required. The jobs to be created. If a dict is provided, it must be of the same form as the protobuf message Job |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
batch_delete_jobs
batch_delete_jobs(parent, filter_, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes a list of Job
\ s by filter.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
filter_
:filter_ = ''
client.batch_delete_jobs(parent, filter_)
Parameters | |
---|---|
Name | Description |
parent |
str
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/api-test-project/tenant/foo". Tenant id is optional and the default tenant is used if unspecified, for example, "projects/api-test-project". |
filter_ |
str
Required. The filter string specifies the jobs to be deleted. Supported operator: =, AND The fields eligible for filtering are: - |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
batch_update_jobs
batch_update_jobs(parent, jobs, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Begins executing a batch update jobs operation.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
jobs
:jobs = []
response = client.batch_update_jobs(parent, jobs)
def callback(operation_future): ... # Handle result. ... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
Parameters | |
---|---|
Name | Description |
parent |
str
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/api-test-project/tenant/foo". Tenant id is optional and the default tenant is used if unspecified, for example, "projects/api-test-project". |
jobs |
list[Union[dict, Job]]
Required. The jobs to be updated. If a dict is provided, it must be of the same form as the protobuf message Job |
update_mask |
Union[dict, FieldMask]
Optional but strongly recommended to be provided for the best service experience, also increase latency when checking status of batch operation. If |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
company_path
company_path(project, tenant, company)
Return a fully-qualified company string.
company_without_tenant_path
company_without_tenant_path(project, company)
Return a fully-qualified company_without_tenant string.
create_job
create_job(parent, job, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Creates a new job.
Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
job
:job = {}
response = client.create_job(parent, job)
Parameters | |
---|---|
Name | Description |
parent |
str
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/api-test-project/tenant/foo". Tenant id is optional and a default tenant is created if unspecified, for example, "projects/api-test-project". |
job |
Union[dict, Job]
Required. The Job to be created. If a dict is provided, it must be of the same form as the protobuf message Job |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
delete_job
delete_job(name, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes the specified job.
Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
name = client.job_path('[PROJECT]', '[TENANT]', '[JOBS]')
client.delete_job(name)
Parameters | |
---|---|
Name | Description |
name |
str
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/api-test-project/tenants/foo/jobs/1234". Tenant id is optional and the default tenant is used if unspecified, for example, "projects/api-test-project/jobs/1234". |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
from_service_account_file
from_service_account_file(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
JobServiceClient | The constructed client. |
from_service_account_json
from_service_account_json(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
JobServiceClient | The constructed client. |
get_job
get_job(name, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
name = client.job_path('[PROJECT]', '[TENANT]', '[JOBS]')
response = client.get_job(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The resource name of the job to retrieve. The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}", for example, "projects/api-test-project/tenants/foo/jobs/1234". Tenant id is optional and the default tenant is used if unspecified, for example, "projects/api-test-project/jobs/1234". |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
job_path
job_path(project, tenant, jobs)
Return a fully-qualified job string.
job_without_tenant_path
job_without_tenant_path(project, jobs)
Return a fully-qualified job_without_tenant string.
list_jobs
list_jobs(parent, filter_, page_size=None, job_view=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Lists jobs by filter.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
filter_
:filter_ = ''
Iterate over all results
for element in client.list_jobs(parent, filter_): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_jobs(parent, filter_).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
parent |
str
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/api-test-project/tenant/foo". Tenant id is optional and the default tenant is used if unspecified, for example, "projects/api-test-project". |
filter_ |
str
Required. The filter string specifies the jobs to be enumerated. Supported operator: =, AND The fields eligible for filtering are: - |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
job_view |
JobView
Optional. The desired job attributes returned for jobs in the search response. Defaults to |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
project_path
project_path(project)
Return a fully-qualified project string.
search_jobs
search_jobs(parent, request_metadata, search_mode=None, job_query=None, enable_broadening=None, require_precise_result_size=None, histogram_queries=None, job_view=None, offset=None, page_size=None, order_by=None, diversification_level=None, custom_ranking_info=None, disable_keyword_match=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Searches for jobs using the provided SearchJobsRequest
.
This call constrains the visibility
of jobs present in the database,
and only returns jobs that the caller has permission to search against.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
request_metadata
:request_metadata = {}
Iterate over all results
for element in client.search_jobs(parent, request_metadata): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.search_jobs(parent, request_metadata).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The resource name of the tenant to search within. The format is "projects/{project_id}/tenants/{tenant_id}", for example, "projects/api-test-project/tenant/foo". Tenant id is optional and the default tenant is used if unspecified, for example, "projects/api-test-project". |
request_metadata |
Union[dict, RequestMetadata]
Required. The meta information collected about the job searcher, used to improve the search quality of the service. The identifiers (such as |
search_mode |
SearchMode
Optional. Mode of a search. Defaults to |
job_query |
Union[dict, JobQuery]
Optional. Query used to search against jobs, such as keyword, location filters, etc. If a dict is provided, it must be of the same form as the protobuf message JobQuery |
enable_broadening |
bool
Optional. Controls whether to broaden the search when it produces sparse results. Broadened queries append results to the end of the matching results list. Defaults to false. |
require_precise_result_size |
bool
Optional. Controls if the search job request requires the return of a precise count of the first 300 results. Setting this to |
histogram_queries |
list[Union[dict, HistogramQuery]]
Optional. An expression specifies a histogram request against matching jobs. Expression syntax is an aggregation function call with histogram facets and other options. Available aggregation function calls are: - |
job_view |
JobView
Optional. The desired job attributes returned for jobs in the search response. Defaults to |
offset |
int
Optional. An integer that specifies the current offset (that is, starting result location, amongst the jobs deemed by the API as relevant) in search results. This field is only considered if |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
order_by |
str
Optional. The criteria determining how search results are sorted. Default is |
diversification_level |
DiversificationLevel
Optional. Controls whether highly similar jobs are returned next to each other in the search results. Jobs are identified as highly similar based on their titles, job categories, and locations. Highly similar results are clustered so that only one representative job of the cluster is displayed to the job seeker higher up in the results, with the other jobs being displayed lower down in the results. Defaults to |
custom_ranking_info |
Union[dict, CustomRankingInfo]
Optional. Controls over how job documents get ranked on top of existing relevance score (determined by API algorithm). If a dict is provided, it must be of the same form as the protobuf message CustomRankingInfo |
disable_keyword_match |
bool
Optional. Controls whether to disable exact keyword match on |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
search_jobs_for_alert
search_jobs_for_alert(parent, request_metadata, search_mode=None, job_query=None, enable_broadening=None, require_precise_result_size=None, histogram_queries=None, job_view=None, offset=None, page_size=None, order_by=None, diversification_level=None, custom_ranking_info=None, disable_keyword_match=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Searches for jobs using the provided 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
of jobs present in the database,
and only returns jobs the caller has permission to search against.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
request_metadata
:request_metadata = {}
Iterate over all results
for element in client.search_jobs_for_alert(parent, request_metadata): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.search_jobs_for_alert(parent, request_metadata).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The resource name of the tenant to search within. The format is "projects/{project_id}/tenants/{tenant_id}", for example, "projects/api-test-project/tenant/foo". Tenant id is optional and the default tenant is used if unspecified, for example, "projects/api-test-project". |
request_metadata |
Union[dict, RequestMetadata]
Required. The meta information collected about the job searcher, used to improve the search quality of the service. The identifiers (such as |
search_mode |
SearchMode
Optional. Mode of a search. Defaults to |
job_query |
Union[dict, JobQuery]
Optional. Query used to search against jobs, such as keyword, location filters, etc. If a dict is provided, it must be of the same form as the protobuf message JobQuery |
enable_broadening |
bool
Optional. Controls whether to broaden the search when it produces sparse results. Broadened queries append results to the end of the matching results list. Defaults to false. |
require_precise_result_size |
bool
Optional. Controls if the search job request requires the return of a precise count of the first 300 results. Setting this to |
histogram_queries |
list[Union[dict, HistogramQuery]]
Optional. An expression specifies a histogram request against matching jobs. Expression syntax is an aggregation function call with histogram facets and other options. Available aggregation function calls are: - |
job_view |
JobView
Optional. The desired job attributes returned for jobs in the search response. Defaults to |
offset |
int
Optional. An integer that specifies the current offset (that is, starting result location, amongst the jobs deemed by the API as relevant) in search results. This field is only considered if |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
order_by |
str
Optional. The criteria determining how search results are sorted. Default is |
diversification_level |
DiversificationLevel
Optional. Controls whether highly similar jobs are returned next to each other in the search results. Jobs are identified as highly similar based on their titles, job categories, and locations. Highly similar results are clustered so that only one representative job of the cluster is displayed to the job seeker higher up in the results, with the other jobs being displayed lower down in the results. Defaults to |
custom_ranking_info |
Union[dict, CustomRankingInfo]
Optional. Controls over how job documents get ranked on top of existing relevance score (determined by API algorithm). If a dict is provided, it must be of the same form as the protobuf message CustomRankingInfo |
disable_keyword_match |
bool
Optional. Controls whether to disable exact keyword match on |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
tenant_path
tenant_path(project, tenant)
Return a fully-qualified tenant string.
update_job
update_job(job, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates specified job.
Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.JobServiceClient()
TODO: Initialize
job
:job = {}
response = client.update_job(job)
Parameters | |
---|---|
Name | Description |
job |
Union[dict, Job]
Required. The Job to be updated. If a dict is provided, it must be of the same form as the protobuf message Job |
update_mask |
Union[dict, FieldMask]
Optional but strongly recommended to be provided for the best service experience. If |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |