pub struct MapsPlatformDatasets { /* private fields */ }Expand description
Implements a client for the Maps Platform Datasets API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
parent: &str,
) -> anyhow::Result<()> {
let client = MapsPlatformDatasets::builder().build().await?;
let mut list = client.list_datasets()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}§Service Description
Service definition for the Maps Platform Datasets API.
§Configuration
To configure MapsPlatformDatasets 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://mapsplatformdatasets.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
MapsPlatformDatasets holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap MapsPlatformDatasets in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl MapsPlatformDatasets
impl MapsPlatformDatasets
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for MapsPlatformDatasets.
let client = MapsPlatformDatasets::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: MapsPlatformDatasets + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: MapsPlatformDatasets + '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_dataset(&self) -> CreateDataset
pub fn create_dataset(&self) -> CreateDataset
Creates a new dataset for the specified project.
§Example
use google_maps_mapsplatformdatasets_v1::model::Dataset;
use google_maps_mapsplatformdatasets_v1::Result;
async fn sample(
client: &MapsPlatformDatasets, parent: &str
) -> Result<()> {
let response = client.create_dataset()
.set_parent(parent)
.set_dataset(
Dataset::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_dataset_metadata(&self) -> UpdateDatasetMetadata
pub fn update_dataset_metadata(&self) -> UpdateDatasetMetadata
Updates the metadata for the dataset.
§Example
use google_cloud_wkt::FieldMask;
use google_maps_mapsplatformdatasets_v1::model::Dataset;
use google_maps_mapsplatformdatasets_v1::Result;
async fn sample(
client: &MapsPlatformDatasets, project_id: &str, dataset_id: &str
) -> Result<()> {
let response = client.update_dataset_metadata()
.set_dataset(
Dataset::new().set_name(format!("projects/{project_id}/datasets/{dataset_id}"))/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_dataset(&self) -> GetDataset
pub fn get_dataset(&self) -> GetDataset
Gets the dataset.
§Example
use google_maps_mapsplatformdatasets_v1::Result;
async fn sample(
client: &MapsPlatformDatasets, project_id: &str, dataset_id: &str
) -> Result<()> {
let response = client.get_dataset()
.set_name(format!("projects/{project_id}/datasets/{dataset_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn fetch_dataset_errors(&self) -> FetchDatasetErrors
pub fn fetch_dataset_errors(&self) -> FetchDatasetErrors
Gets all the errors of a dataset.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_maps_mapsplatformdatasets_v1::Result;
async fn sample(
client: &MapsPlatformDatasets
) -> Result<()> {
let mut list = client.fetch_dataset_errors()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn list_datasets(&self) -> ListDatasets
pub fn list_datasets(&self) -> ListDatasets
Lists all the datasets for the specified project.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_maps_mapsplatformdatasets_v1::Result;
async fn sample(
client: &MapsPlatformDatasets, parent: &str
) -> Result<()> {
let mut list = client.list_datasets()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn delete_dataset(&self) -> DeleteDataset
pub fn delete_dataset(&self) -> DeleteDataset
Deletes the specified dataset.
§Example
use google_maps_mapsplatformdatasets_v1::Result;
async fn sample(
client: &MapsPlatformDatasets, project_id: &str, dataset_id: &str
) -> Result<()> {
client.delete_dataset()
.set_name(format!("projects/{project_id}/datasets/{dataset_id}"))
.send().await?;
Ok(())
}Trait Implementations§
Source§impl Clone for MapsPlatformDatasets
impl Clone for MapsPlatformDatasets
Source§fn clone(&self) -> MapsPlatformDatasets
fn clone(&self) -> MapsPlatformDatasets
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more