pub struct BigqueryJobClient { /* private fields */ }Implementations§
source§impl BigqueryJobClient
impl BigqueryJobClient
pub fn new(inner: Arc<BigqueryClient>) -> Self
sourcepub async fn create(&self, metadata: &Job) -> Result<Job, Error>
pub async fn create(&self, metadata: &Job) -> Result<Job, Error>
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/create
use google_cloud_bigquery::http::bigquery_job_client::BigqueryJobClient;
use google_cloud_bigquery::http::error::Error;
use google_cloud_bigquery::http::job::{CreateDisposition, Job, JobConfiguration, JobConfigurationSourceTable, JobConfigurationTableCopy, JobReference, JobState, JobType, OperationType, WriteDisposition};
use google_cloud_bigquery::http::table::TableReference;
async fn run(client: BigqueryJobClient) {
let job = Job {
job_reference: JobReference {
project_id: "project".to_string(),
job_id: "job".to_string(),
location: Some("asia-northeast1".to_string()),
},
configuration: JobConfiguration {
job: JobType::Copy(JobConfigurationTableCopy {
source_table: JobConfigurationSourceTable::SourceTable(TableReference {
project_id: "project".to_string(),
dataset_id: "dataset".to_string(),
table_id: "source_table".to_string(),
}),
destination_table: TableReference {
project_id: "project".to_string(),
dataset_id: "dataset".to_string(),
table_id: "destination_table".to_string(),
},
create_disposition: Some(CreateDisposition::CreateIfNeeded),
write_disposition: Some(WriteDisposition::WriteTruncate),
operation_type: Some(OperationType::Copy),
..Default::default()
}),
..Default::default()
},
..Default::default()
};
let created = client.create(&job).await.unwrap();
assert!(created.status.errors.is_none());
assert!(created.status.error_result.is_none());
assert!(created.status.state == JobState::Running || created.status.state == JobState::Done);
}sourcepub async fn delete(&self, project_id: &str, job_id: &str) -> Result<(), Error>
pub async fn delete(&self, project_id: &str, job_id: &str) -> Result<(), Error>
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/delete
sourcepub async fn get(
&self,
project_id: &str,
job_id: &str,
data: &GetJobRequest
) -> Result<Job, Error>
pub async fn get( &self, project_id: &str, job_id: &str, data: &GetJobRequest ) -> Result<Job, Error>
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
sourcepub async fn cancel(
&self,
project_id: &str,
job_id: &str,
data: &CancelJobRequest
) -> Result<CancelJobResponse, Error>
pub async fn cancel( &self, project_id: &str, job_id: &str, data: &CancelJobRequest ) -> Result<CancelJobResponse, Error>
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/cancel
use google_cloud_bigquery::http::bigquery_job_client::BigqueryJobClient;
use google_cloud_bigquery::http::error::Error;
use google_cloud_bigquery::http::job::cancel::CancelJobRequest;
use google_cloud_bigquery::http::job::{Job, JobReference, JobState};
async fn run(client: BigqueryJobClient, job: JobReference) {
let request = CancelJobRequest {
location: job.location,
};
let cancelled = client.cancel(&job.project_id, &job.job_id, &request).await.unwrap();
}sourcepub async fn query(
&self,
project_id: &str,
data: &QueryRequest
) -> Result<QueryResponse, Error>
pub async fn query( &self, project_id: &str, data: &QueryRequest ) -> Result<QueryResponse, Error>
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query
sourcepub async fn get_query_results(
&self,
project_id: &str,
job_id: &str,
data: &GetQueryResultsRequest
) -> Result<GetQueryResultsResponse, Error>
pub async fn get_query_results( &self, project_id: &str, job_id: &str, data: &GetQueryResultsRequest ) -> Result<GetQueryResultsResponse, Error>
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get_query_results
sourcepub async fn list(
&self,
project_id: &str,
req: &ListJobsRequest
) -> Result<Vec<JobOverview>, Error>
pub async fn list( &self, project_id: &str, req: &ListJobsRequest ) -> Result<Vec<JobOverview>, Error>
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/list
Trait Implementations§
source§impl Clone for BigqueryJobClient
impl Clone for BigqueryJobClient
source§fn clone(&self) -> BigqueryJobClient
fn clone(&self) -> BigqueryJobClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BigqueryJobClient
impl Send for BigqueryJobClient
impl Sync for BigqueryJobClient
impl Unpin for BigqueryJobClient
impl !UnwindSafe for BigqueryJobClient
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T in a tonic::Request