#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#[derive(Clone, Debug)]
pub struct CloudBilling {
inner: std::sync::Arc<dyn super::stub::dynamic::CloudBilling>,
}
impl CloudBilling {
pub fn builder() -> super::builder::cloud_billing::ClientBuilder {
crate::new_client_builder(super::builder::cloud_billing::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::CloudBilling + '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::CloudBilling>> {
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::CloudBilling> {
super::transport::CloudBilling::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::CloudBilling> {
Self::build_transport(conf)
.await
.map(super::tracing::CloudBilling::new)
}
pub fn get_billing_account(&self) -> super::builder::cloud_billing::GetBillingAccount {
super::builder::cloud_billing::GetBillingAccount::new(self.inner.clone())
}
pub fn list_billing_accounts(&self) -> super::builder::cloud_billing::ListBillingAccounts {
super::builder::cloud_billing::ListBillingAccounts::new(self.inner.clone())
}
pub fn update_billing_account(&self) -> super::builder::cloud_billing::UpdateBillingAccount {
super::builder::cloud_billing::UpdateBillingAccount::new(self.inner.clone())
}
pub fn create_billing_account(&self) -> super::builder::cloud_billing::CreateBillingAccount {
super::builder::cloud_billing::CreateBillingAccount::new(self.inner.clone())
}
pub fn list_project_billing_info(
&self,
) -> super::builder::cloud_billing::ListProjectBillingInfo {
super::builder::cloud_billing::ListProjectBillingInfo::new(self.inner.clone())
}
pub fn get_project_billing_info(&self) -> super::builder::cloud_billing::GetProjectBillingInfo {
super::builder::cloud_billing::GetProjectBillingInfo::new(self.inner.clone())
}
pub fn update_project_billing_info(
&self,
) -> super::builder::cloud_billing::UpdateProjectBillingInfo {
super::builder::cloud_billing::UpdateProjectBillingInfo::new(self.inner.clone())
}
pub fn get_iam_policy(&self) -> super::builder::cloud_billing::GetIamPolicy {
super::builder::cloud_billing::GetIamPolicy::new(self.inner.clone())
}
pub fn set_iam_policy(&self) -> super::builder::cloud_billing::SetIamPolicy {
super::builder::cloud_billing::SetIamPolicy::new(self.inner.clone())
}
pub fn test_iam_permissions(&self) -> super::builder::cloud_billing::TestIamPermissions {
super::builder::cloud_billing::TestIamPermissions::new(self.inner.clone())
}
pub fn move_billing_account(&self) -> super::builder::cloud_billing::MoveBillingAccount {
super::builder::cloud_billing::MoveBillingAccount::new(self.inner.clone())
}
}
#[derive(Clone, Debug)]
pub struct CloudCatalog {
inner: std::sync::Arc<dyn super::stub::dynamic::CloudCatalog>,
}
impl CloudCatalog {
pub fn builder() -> super::builder::cloud_catalog::ClientBuilder {
crate::new_client_builder(super::builder::cloud_catalog::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::CloudCatalog + '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::CloudCatalog>> {
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::CloudCatalog> {
super::transport::CloudCatalog::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::CloudCatalog> {
Self::build_transport(conf)
.await
.map(super::tracing::CloudCatalog::new)
}
pub fn list_services(&self) -> super::builder::cloud_catalog::ListServices {
super::builder::cloud_catalog::ListServices::new(self.inner.clone())
}
pub fn list_skus(&self) -> super::builder::cloud_catalog::ListSkus {
super::builder::cloud_catalog::ListSkus::new(self.inner.clone())
}
}