#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#[derive(Clone, Debug)]
pub struct SecurityPosture {
inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPosture>,
}
impl SecurityPosture {
pub fn builder() -> super::builder::security_posture::ClientBuilder {
crate::new_client_builder(super::builder::security_posture::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::SecurityPosture + '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::SecurityPosture>> {
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::SecurityPosture> {
super::transport::SecurityPosture::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::SecurityPosture> {
Self::build_transport(conf)
.await
.map(super::tracing::SecurityPosture::new)
}
pub fn list_postures(&self) -> super::builder::security_posture::ListPostures {
super::builder::security_posture::ListPostures::new(self.inner.clone())
}
pub fn list_posture_revisions(&self) -> super::builder::security_posture::ListPostureRevisions {
super::builder::security_posture::ListPostureRevisions::new(self.inner.clone())
}
pub fn get_posture(&self) -> super::builder::security_posture::GetPosture {
super::builder::security_posture::GetPosture::new(self.inner.clone())
}
pub fn create_posture(&self) -> super::builder::security_posture::CreatePosture {
super::builder::security_posture::CreatePosture::new(self.inner.clone())
}
pub fn update_posture(&self) -> super::builder::security_posture::UpdatePosture {
super::builder::security_posture::UpdatePosture::new(self.inner.clone())
}
pub fn delete_posture(&self) -> super::builder::security_posture::DeletePosture {
super::builder::security_posture::DeletePosture::new(self.inner.clone())
}
pub fn extract_posture(&self) -> super::builder::security_posture::ExtractPosture {
super::builder::security_posture::ExtractPosture::new(self.inner.clone())
}
pub fn list_posture_deployments(
&self,
) -> super::builder::security_posture::ListPostureDeployments {
super::builder::security_posture::ListPostureDeployments::new(self.inner.clone())
}
pub fn get_posture_deployment(&self) -> super::builder::security_posture::GetPostureDeployment {
super::builder::security_posture::GetPostureDeployment::new(self.inner.clone())
}
pub fn create_posture_deployment(
&self,
) -> super::builder::security_posture::CreatePostureDeployment {
super::builder::security_posture::CreatePostureDeployment::new(self.inner.clone())
}
pub fn update_posture_deployment(
&self,
) -> super::builder::security_posture::UpdatePostureDeployment {
super::builder::security_posture::UpdatePostureDeployment::new(self.inner.clone())
}
pub fn delete_posture_deployment(
&self,
) -> super::builder::security_posture::DeletePostureDeployment {
super::builder::security_posture::DeletePostureDeployment::new(self.inner.clone())
}
pub fn list_posture_templates(&self) -> super::builder::security_posture::ListPostureTemplates {
super::builder::security_posture::ListPostureTemplates::new(self.inner.clone())
}
pub fn get_posture_template(&self) -> super::builder::security_posture::GetPostureTemplate {
super::builder::security_posture::GetPostureTemplate::new(self.inner.clone())
}
pub fn list_locations(&self) -> super::builder::security_posture::ListLocations {
super::builder::security_posture::ListLocations::new(self.inner.clone())
}
pub fn get_location(&self) -> super::builder::security_posture::GetLocation {
super::builder::security_posture::GetLocation::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::security_posture::ListOperations {
super::builder::security_posture::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::security_posture::GetOperation {
super::builder::security_posture::GetOperation::new(self.inner.clone())
}
pub fn delete_operation(&self) -> super::builder::security_posture::DeleteOperation {
super::builder::security_posture::DeleteOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::security_posture::CancelOperation {
super::builder::security_posture::CancelOperation::new(self.inner.clone())
}
}