#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#[derive(Clone, Debug)]
pub struct ImageAnnotator {
inner: std::sync::Arc<dyn super::stub::dynamic::ImageAnnotator>,
}
impl ImageAnnotator {
pub fn builder() -> super::builder::image_annotator::ClientBuilder {
crate::new_client_builder(super::builder::image_annotator::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::ImageAnnotator + '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::ImageAnnotator>> {
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::ImageAnnotator> {
super::transport::ImageAnnotator::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::ImageAnnotator> {
Self::build_transport(conf)
.await
.map(super::tracing::ImageAnnotator::new)
}
pub fn batch_annotate_images(&self) -> super::builder::image_annotator::BatchAnnotateImages {
super::builder::image_annotator::BatchAnnotateImages::new(self.inner.clone())
}
pub fn batch_annotate_files(&self) -> super::builder::image_annotator::BatchAnnotateFiles {
super::builder::image_annotator::BatchAnnotateFiles::new(self.inner.clone())
}
pub fn async_batch_annotate_images(
&self,
) -> super::builder::image_annotator::AsyncBatchAnnotateImages {
super::builder::image_annotator::AsyncBatchAnnotateImages::new(self.inner.clone())
}
pub fn async_batch_annotate_files(
&self,
) -> super::builder::image_annotator::AsyncBatchAnnotateFiles {
super::builder::image_annotator::AsyncBatchAnnotateFiles::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::image_annotator::GetOperation {
super::builder::image_annotator::GetOperation::new(self.inner.clone())
}
}
#[derive(Clone, Debug)]
pub struct ProductSearch {
inner: std::sync::Arc<dyn super::stub::dynamic::ProductSearch>,
}
impl ProductSearch {
pub fn builder() -> super::builder::product_search::ClientBuilder {
crate::new_client_builder(super::builder::product_search::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::ProductSearch + '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::ProductSearch>> {
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::ProductSearch> {
super::transport::ProductSearch::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::ProductSearch> {
Self::build_transport(conf)
.await
.map(super::tracing::ProductSearch::new)
}
pub fn create_product_set(&self) -> super::builder::product_search::CreateProductSet {
super::builder::product_search::CreateProductSet::new(self.inner.clone())
}
pub fn list_product_sets(&self) -> super::builder::product_search::ListProductSets {
super::builder::product_search::ListProductSets::new(self.inner.clone())
}
pub fn get_product_set(&self) -> super::builder::product_search::GetProductSet {
super::builder::product_search::GetProductSet::new(self.inner.clone())
}
pub fn update_product_set(&self) -> super::builder::product_search::UpdateProductSet {
super::builder::product_search::UpdateProductSet::new(self.inner.clone())
}
pub fn delete_product_set(&self) -> super::builder::product_search::DeleteProductSet {
super::builder::product_search::DeleteProductSet::new(self.inner.clone())
}
pub fn create_product(&self) -> super::builder::product_search::CreateProduct {
super::builder::product_search::CreateProduct::new(self.inner.clone())
}
pub fn list_products(&self) -> super::builder::product_search::ListProducts {
super::builder::product_search::ListProducts::new(self.inner.clone())
}
pub fn get_product(&self) -> super::builder::product_search::GetProduct {
super::builder::product_search::GetProduct::new(self.inner.clone())
}
pub fn update_product(&self) -> super::builder::product_search::UpdateProduct {
super::builder::product_search::UpdateProduct::new(self.inner.clone())
}
pub fn delete_product(&self) -> super::builder::product_search::DeleteProduct {
super::builder::product_search::DeleteProduct::new(self.inner.clone())
}
pub fn create_reference_image(&self) -> super::builder::product_search::CreateReferenceImage {
super::builder::product_search::CreateReferenceImage::new(self.inner.clone())
}
pub fn delete_reference_image(&self) -> super::builder::product_search::DeleteReferenceImage {
super::builder::product_search::DeleteReferenceImage::new(self.inner.clone())
}
pub fn list_reference_images(&self) -> super::builder::product_search::ListReferenceImages {
super::builder::product_search::ListReferenceImages::new(self.inner.clone())
}
pub fn get_reference_image(&self) -> super::builder::product_search::GetReferenceImage {
super::builder::product_search::GetReferenceImage::new(self.inner.clone())
}
pub fn add_product_to_product_set(
&self,
) -> super::builder::product_search::AddProductToProductSet {
super::builder::product_search::AddProductToProductSet::new(self.inner.clone())
}
pub fn remove_product_from_product_set(
&self,
) -> super::builder::product_search::RemoveProductFromProductSet {
super::builder::product_search::RemoveProductFromProductSet::new(self.inner.clone())
}
pub fn list_products_in_product_set(
&self,
) -> super::builder::product_search::ListProductsInProductSet {
super::builder::product_search::ListProductsInProductSet::new(self.inner.clone())
}
pub fn import_product_sets(&self) -> super::builder::product_search::ImportProductSets {
super::builder::product_search::ImportProductSets::new(self.inner.clone())
}
pub fn purge_products(&self) -> super::builder::product_search::PurgeProducts {
super::builder::product_search::PurgeProducts::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::product_search::GetOperation {
super::builder::product_search::GetOperation::new(self.inner.clone())
}
}