#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#[derive(Clone, Debug)]
pub struct StorageBatchOperations {
inner: std::sync::Arc<dyn super::stub::dynamic::StorageBatchOperations>,
}
impl StorageBatchOperations {
pub fn builder() -> super::builder::storage_batch_operations::ClientBuilder {
crate::new_client_builder(super::builder::storage_batch_operations::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::StorageBatchOperations + 'static,
{
Self {
inner: std::sync::Arc::new(stub),
}
}
pub(crate) async fn new(
config: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<Self> {
let inner = Self::build_inner(config).await?;
Ok(Self { inner })
}
async fn build_inner(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StorageBatchOperations>>
{
if gaxi::options::tracing_enabled(&conf) {
return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
}
Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
}
async fn build_transport(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::StorageBatchOperations> {
super::transport::StorageBatchOperations::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::StorageBatchOperations> {
Self::build_transport(conf)
.await
.map(super::tracing::StorageBatchOperations::new)
}
pub fn list_jobs(&self) -> super::builder::storage_batch_operations::ListJobs {
super::builder::storage_batch_operations::ListJobs::new(self.inner.clone())
}
pub fn get_job(&self) -> super::builder::storage_batch_operations::GetJob {
super::builder::storage_batch_operations::GetJob::new(self.inner.clone())
}
pub fn create_job(&self) -> super::builder::storage_batch_operations::CreateJob {
super::builder::storage_batch_operations::CreateJob::new(self.inner.clone())
}
pub fn delete_job(&self) -> super::builder::storage_batch_operations::DeleteJob {
super::builder::storage_batch_operations::DeleteJob::new(self.inner.clone())
}
pub fn cancel_job(&self) -> super::builder::storage_batch_operations::CancelJob {
super::builder::storage_batch_operations::CancelJob::new(self.inner.clone())
}
pub fn list_bucket_operations(
&self,
) -> super::builder::storage_batch_operations::ListBucketOperations {
super::builder::storage_batch_operations::ListBucketOperations::new(self.inner.clone())
}
pub fn get_bucket_operation(
&self,
) -> super::builder::storage_batch_operations::GetBucketOperation {
super::builder::storage_batch_operations::GetBucketOperation::new(self.inner.clone())
}
pub fn list_locations(&self) -> super::builder::storage_batch_operations::ListLocations {
super::builder::storage_batch_operations::ListLocations::new(self.inner.clone())
}
pub fn get_location(&self) -> super::builder::storage_batch_operations::GetLocation {
super::builder::storage_batch_operations::GetLocation::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::storage_batch_operations::ListOperations {
super::builder::storage_batch_operations::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::storage_batch_operations::GetOperation {
super::builder::storage_batch_operations::GetOperation::new(self.inner.clone())
}
pub fn delete_operation(&self) -> super::builder::storage_batch_operations::DeleteOperation {
super::builder::storage_batch_operations::DeleteOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::storage_batch_operations::CancelOperation {
super::builder::storage_batch_operations::CancelOperation::new(self.inner.clone())
}
}