Struct gcp_bigquery_client::dataset::DatasetApi [−][src]
pub struct DatasetApi { /* fields omitted */ }
Expand description
A dataset API handler.
Implementations
Creates a new empty dataset.
Argument
dataset
- The dataset to create
Example
let (ref project_id, ref dataset_id, ref _table_id, ref sa_key) = env_vars();
let dataset_id = &format!("{}_dataset", dataset_id);
let client = Client::from_service_account_key_file(sa_key).await;
client.dataset().create(Dataset::new(project_id, dataset_id)).await?;
Lists all datasets in the specified project to which the user has been granted the READER dataset role.
Arguments
project_id
- Project ID of the datasets to be listedoptions
- Options
Example
let (ref project_id, ref dataset_id, ref _table_id, ref sa_key) = env_vars();
let dataset_id = &format!("{}_dataset", dataset_id);
let client = Client::from_service_account_key_file(sa_key).await;
let datasets = client.dataset().list(project_id, ListOptions::default().all(true)).await?;
for dataset in datasets.datasets.iter() {
// Do some stuff
}
Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
Arguments
project_id
- Project ID of the dataset being deleteddataset_id
- Dataset ID of dataset being deleteddelete_contents
- If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False
Example
let (ref project_id, ref dataset_id, ref _table_id, ref sa_key) = env_vars();
let dataset_id = &format!("{}_dataset", dataset_id);
let client = Client::from_service_account_key_file(sa_key).await;
client.dataset().create(Dataset::new(project_id, dataset_id)).await?;
client.dataset().delete(project_id, dataset_id, true).await?;
Deletes the dataset specified by the datasetId value and returns true or returs false when the dataset doesn’t exist. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
Arguments
project_id
- Project ID of the dataset being deleteddataset_id
- Dataset ID of dataset being deleteddelete_contents
- If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False
Example
let (ref project_id, ref dataset_id, ref _table_id, ref sa_key) = env_vars();
let dataset_id = &format!("{}_dataset", dataset_id);
let client = Client::from_service_account_key_file(sa_key).await;
client.dataset().delete_if_exists(project_id, dataset_id, true);
Returns the dataset specified by datasetID.
Arguments
project_id
- Project ID of the requested datasetdataset_id
- Dataset ID of the requested dataset
Example
let (ref project_id, ref dataset_id, ref _table_id, ref sa_key) = env_vars();
let dataset_id = &format!("{}_dataset", dataset_id);
let client = Client::from_service_account_key_file(sa_key).await;
client.dataset().create(Dataset::new(project_id, dataset_id)).await?;
let dataset = client.dataset().get(project_id, dataset_id).await?;
Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.
Arguments
- dataset - The request body contains an instance of Dataset.
Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.
Arguments
- dataset - The request body contains an instance of Dataset.
Auto Trait Implementations
impl !RefUnwindSafe for DatasetApi
impl Send for DatasetApi
impl Sync for DatasetApi
impl Unpin for DatasetApi
impl !UnwindSafe for DatasetApi
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more