pub struct JobService { /* private fields */ }Expand description
Implements a client for the Cloud Talent Solution API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
project_id: &str,
tenant_id: &str,
) -> anyhow::Result<()> {
let client = JobService::builder().build().await?;
let mut list = client.list_jobs()
.set_parent(format!("projects/{project_id}/tenants/{tenant_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}§Service Description
A service handles job management, including job CRUD, enumeration and search.
§Configuration
To configure JobService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://jobs.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured with Private Google Access with VPC Service Controls) may want to override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
JobService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap JobService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl JobService
impl JobService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for JobService.
let client = JobService::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: JobService + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: JobService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_job(&self) -> CreateJob
pub fn create_job(&self) -> CreateJob
Creates a new job.
Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes.
§Example
use google_cloud_talent_v4::model::Job;
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService, project_id: &str, tenant_id: &str
) -> Result<()> {
let response = client.create_job()
.set_parent(format!("projects/{project_id}/tenants/{tenant_id}"))
.set_job(
Job::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn batch_create_jobs(&self) -> BatchCreateJobs
pub fn batch_create_jobs(&self) -> BatchCreateJobs
Begins executing a batch create jobs operation.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService
) -> Result<()> {
let response = client.batch_create_jobs()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_job(&self) -> GetJob
pub fn get_job(&self) -> GetJob
Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.
§Example
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService, project_id: &str, tenant_id: &str, job_id: &str
) -> Result<()> {
let response = client.get_job()
.set_name(format!("projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_job(&self) -> UpdateJob
pub fn update_job(&self) -> UpdateJob
Updates specified job.
Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes.
§Example
use google_cloud_wkt::FieldMask;
use google_cloud_talent_v4::model::Job;
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService, project_id: &str, tenant_id: &str, job_id: &str
) -> Result<()> {
let response = client.update_job()
.set_job(
Job::new().set_name(format!("projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}"))/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn batch_update_jobs(&self) -> BatchUpdateJobs
pub fn batch_update_jobs(&self) -> BatchUpdateJobs
Begins executing a batch update jobs operation.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService
) -> Result<()> {
let response = client.batch_update_jobs()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_job(&self) -> DeleteJob
pub fn delete_job(&self) -> DeleteJob
Deletes the specified job.
Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes.
§Example
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService, project_id: &str, tenant_id: &str, job_id: &str
) -> Result<()> {
client.delete_job()
.set_name(format!("projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}"))
.send().await?;
Ok(())
}Sourcepub fn batch_delete_jobs(&self) -> BatchDeleteJobs
pub fn batch_delete_jobs(&self) -> BatchDeleteJobs
Begins executing a batch delete jobs operation.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService
) -> Result<()> {
let response = client.batch_delete_jobs()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_jobs(&self) -> ListJobs
pub fn list_jobs(&self) -> ListJobs
Lists jobs by filter.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService, project_id: &str, tenant_id: &str
) -> Result<()> {
let mut list = client.list_jobs()
.set_parent(format!("projects/{project_id}/tenants/{tenant_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn search_jobs(&self) -> SearchJobs
pub fn search_jobs(&self) -> SearchJobs
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.
§Example
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService
) -> Result<()> {
let response = client.search_jobs()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn search_jobs_for_alert(&self) -> SearchJobsForAlert
pub fn search_jobs_for_alert(&self) -> SearchJobsForAlert
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), it has different algorithmic adjustments that are designed to specifically target 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.
§Example
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService
) -> Result<()> {
let response = client.search_jobs_for_alert()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_talent_v4::Result;
async fn sample(
client: &JobService
) -> Result<()> {
let response = client.get_operation()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Trait Implementations§
Source§impl Clone for JobService
impl Clone for JobService
Source§fn clone(&self) -> JobService
fn clone(&self) -> JobService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for JobService
impl !UnwindSafe for JobService
impl Freeze for JobService
impl Send for JobService
impl Sync for JobService
impl Unpin for JobService
impl UnsafeUnpin for JobService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request