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 duplicate 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 Freeze for BigqueryJobClient
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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