pub struct DatasetApi { /* private fields */ }
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 listed
  • options - 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 deleted
  • dataset_id - Dataset ID of dataset being deleted
  • delete_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 deleted
  • dataset_id - Dataset ID of dataset being deleted
  • delete_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 dataset
  • dataset_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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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