#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#[derive(Clone, Debug)]
pub struct TranscoderService {
inner: std::sync::Arc<dyn super::stub::dynamic::TranscoderService>,
}
impl TranscoderService {
pub fn builder() -> super::builder::transcoder_service::ClientBuilder {
crate::new_client_builder(super::builder::transcoder_service::client::Factory)
}
pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
where
T: super::stub::TranscoderService + '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::TranscoderService>>
{
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::TranscoderService> {
super::transport::TranscoderService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::TranscoderService> {
Self::build_transport(conf)
.await
.map(super::tracing::TranscoderService::new)
}
pub fn create_job(&self) -> super::builder::transcoder_service::CreateJob {
super::builder::transcoder_service::CreateJob::new(self.inner.clone())
}
pub fn list_jobs(&self) -> super::builder::transcoder_service::ListJobs {
super::builder::transcoder_service::ListJobs::new(self.inner.clone())
}
pub fn get_job(&self) -> super::builder::transcoder_service::GetJob {
super::builder::transcoder_service::GetJob::new(self.inner.clone())
}
pub fn delete_job(&self) -> super::builder::transcoder_service::DeleteJob {
super::builder::transcoder_service::DeleteJob::new(self.inner.clone())
}
pub fn create_job_template(&self) -> super::builder::transcoder_service::CreateJobTemplate {
super::builder::transcoder_service::CreateJobTemplate::new(self.inner.clone())
}
pub fn list_job_templates(&self) -> super::builder::transcoder_service::ListJobTemplates {
super::builder::transcoder_service::ListJobTemplates::new(self.inner.clone())
}
pub fn get_job_template(&self) -> super::builder::transcoder_service::GetJobTemplate {
super::builder::transcoder_service::GetJobTemplate::new(self.inner.clone())
}
pub fn delete_job_template(&self) -> super::builder::transcoder_service::DeleteJobTemplate {
super::builder::transcoder_service::DeleteJobTemplate::new(self.inner.clone())
}
}