#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::bare_urls)]
#[derive(Clone, Debug)]
pub struct Workflows {
inner: std::sync::Arc<dyn super::stub::dynamic::Workflows>,
}
impl Workflows {
pub fn builder() -> super::builder::workflows::ClientBuilder {
crate::new_client_builder(super::builder::workflows::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::Workflows + '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::Workflows>> {
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::Workflows> {
super::transport::Workflows::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::Workflows> {
Self::build_transport(conf)
.await
.map(super::tracing::Workflows::new)
}
pub fn list_workflows(&self) -> super::builder::workflows::ListWorkflows {
super::builder::workflows::ListWorkflows::new(self.inner.clone())
}
pub fn get_workflow(&self) -> super::builder::workflows::GetWorkflow {
super::builder::workflows::GetWorkflow::new(self.inner.clone())
}
pub fn create_workflow(&self) -> super::builder::workflows::CreateWorkflow {
super::builder::workflows::CreateWorkflow::new(self.inner.clone())
}
pub fn delete_workflow(&self) -> super::builder::workflows::DeleteWorkflow {
super::builder::workflows::DeleteWorkflow::new(self.inner.clone())
}
pub fn update_workflow(&self) -> super::builder::workflows::UpdateWorkflow {
super::builder::workflows::UpdateWorkflow::new(self.inner.clone())
}
pub fn list_workflow_revisions(&self) -> super::builder::workflows::ListWorkflowRevisions {
super::builder::workflows::ListWorkflowRevisions::new(self.inner.clone())
}
pub fn list_locations(&self) -> super::builder::workflows::ListLocations {
super::builder::workflows::ListLocations::new(self.inner.clone())
}
pub fn get_location(&self) -> super::builder::workflows::GetLocation {
super::builder::workflows::GetLocation::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::workflows::ListOperations {
super::builder::workflows::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::workflows::GetOperation {
super::builder::workflows::GetOperation::new(self.inner.clone())
}
pub fn delete_operation(&self) -> super::builder::workflows::DeleteOperation {
super::builder::workflows::DeleteOperation::new(self.inner.clone())
}
}