#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#[derive(Clone, Debug)]
pub struct AdvisoryNotificationsService {
inner: std::sync::Arc<dyn super::stub::dynamic::AdvisoryNotificationsService>,
}
impl AdvisoryNotificationsService {
pub fn builder() -> super::builder::advisory_notifications_service::ClientBuilder {
crate::new_client_builder(super::builder::advisory_notifications_service::client::Factory)
}
pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
where
T: super::stub::AdvisoryNotificationsService + '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::AdvisoryNotificationsService>,
> {
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::AdvisoryNotificationsService> {
super::transport::AdvisoryNotificationsService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::AdvisoryNotificationsService> {
Self::build_transport(conf)
.await
.map(super::tracing::AdvisoryNotificationsService::new)
}
pub fn list_notifications(
&self,
) -> super::builder::advisory_notifications_service::ListNotifications {
super::builder::advisory_notifications_service::ListNotifications::new(self.inner.clone())
}
pub fn get_notification(
&self,
) -> super::builder::advisory_notifications_service::GetNotification {
super::builder::advisory_notifications_service::GetNotification::new(self.inner.clone())
}
pub fn get_settings(&self) -> super::builder::advisory_notifications_service::GetSettings {
super::builder::advisory_notifications_service::GetSettings::new(self.inner.clone())
}
pub fn update_settings(
&self,
) -> super::builder::advisory_notifications_service::UpdateSettings {
super::builder::advisory_notifications_service::UpdateSettings::new(self.inner.clone())
}
}