#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::redundant_explicit_links)]
#[derive(Clone, Debug)]
pub struct VideoIntelligenceService {
inner: std::sync::Arc<dyn super::stub::dynamic::VideoIntelligenceService>,
}
impl VideoIntelligenceService {
pub fn builder() -> super::builder::video_intelligence_service::ClientBuilder {
crate::new_client_builder(super::builder::video_intelligence_service::client::Factory)
}
pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
where
T: super::stub::VideoIntelligenceService + 'static,
{
Self { inner: stub.into() }
}
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::VideoIntelligenceService>,
> {
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::VideoIntelligenceService> {
super::transport::VideoIntelligenceService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::VideoIntelligenceService> {
Self::build_transport(conf)
.await
.map(super::tracing::VideoIntelligenceService::new)
}
pub fn annotate_video(&self) -> super::builder::video_intelligence_service::AnnotateVideo {
super::builder::video_intelligence_service::AnnotateVideo::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::video_intelligence_service::ListOperations {
super::builder::video_intelligence_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::video_intelligence_service::GetOperation {
super::builder::video_intelligence_service::GetOperation::new(self.inner.clone())
}
pub fn delete_operation(&self) -> super::builder::video_intelligence_service::DeleteOperation {
super::builder::video_intelligence_service::DeleteOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::video_intelligence_service::CancelOperation {
super::builder::video_intelligence_service::CancelOperation::new(self.inner.clone())
}
}