use crate::Result;
#[derive(Clone, Debug)]
pub struct AccountsService<T>
where
T: super::stub::AccountsService + std::fmt::Debug + Send + Sync,
{
inner: T,
duration: gaxi::observability::DurationMetric,
}
impl<T> AccountsService<T>
where
T: super::stub::AccountsService + std::fmt::Debug + Send + Sync,
{
pub fn new(inner: T) -> Self {
Self {
inner,
duration: gaxi::observability::DurationMetric::new(&info::INSTRUMENTATION_CLIENT_INFO),
}
}
}
impl<T> super::stub::AccountsService for AccountsService<T>
where
T: super::stub::AccountsService + std::fmt::Debug + Send + Sync,
{
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn list_child_accounts(
&self,
req: crate::model::ListChildAccountsRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::ListChildAccountsResponse>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::AccountsService::list_child_accounts",
self.inner.list_child_accounts(req, options));
pending.await
}
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn get_account(
&self,
req: crate::model::GetAccountRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::Account>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::AccountsService::get_account",
self.inner.get_account(req, options));
pending.await
}
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn update_labels(
&self,
req: crate::model::UpdateAccountLabelsRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::Account>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::AccountsService::update_labels",
self.inner.update_labels(req, options));
pending.await
}
}
#[derive(Clone, Debug)]
pub struct AccountLabelsService<T>
where
T: super::stub::AccountLabelsService + std::fmt::Debug + Send + Sync,
{
inner: T,
duration: gaxi::observability::DurationMetric,
}
impl<T> AccountLabelsService<T>
where
T: super::stub::AccountLabelsService + std::fmt::Debug + Send + Sync,
{
pub fn new(inner: T) -> Self {
Self {
inner,
duration: gaxi::observability::DurationMetric::new(&info::INSTRUMENTATION_CLIENT_INFO),
}
}
}
impl<T> super::stub::AccountLabelsService for AccountLabelsService<T>
where
T: super::stub::AccountLabelsService + std::fmt::Debug + Send + Sync,
{
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn list_account_labels(
&self,
req: crate::model::ListAccountLabelsRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::ListAccountLabelsResponse>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::AccountLabelsService::list_account_labels",
self.inner.list_account_labels(req, options));
pending.await
}
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn create_account_label(
&self,
req: crate::model::CreateAccountLabelRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::AccountLabel>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::AccountLabelsService::create_account_label",
self.inner.create_account_label(req, options));
pending.await
}
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn update_account_label(
&self,
req: crate::model::UpdateAccountLabelRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::AccountLabel>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::AccountLabelsService::update_account_label",
self.inner.update_account_label(req, options));
pending.await
}
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn delete_account_label(
&self,
req: crate::model::DeleteAccountLabelRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<()>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::AccountLabelsService::delete_account_label",
self.inner.delete_account_label(req, options));
pending.await
}
}
#[derive(Clone, Debug)]
pub struct CssProductInputsService<T>
where
T: super::stub::CssProductInputsService + std::fmt::Debug + Send + Sync,
{
inner: T,
duration: gaxi::observability::DurationMetric,
}
impl<T> CssProductInputsService<T>
where
T: super::stub::CssProductInputsService + std::fmt::Debug + Send + Sync,
{
pub fn new(inner: T) -> Self {
Self {
inner,
duration: gaxi::observability::DurationMetric::new(&info::INSTRUMENTATION_CLIENT_INFO),
}
}
}
impl<T> super::stub::CssProductInputsService for CssProductInputsService<T>
where
T: super::stub::CssProductInputsService + std::fmt::Debug + Send + Sync,
{
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn insert_css_product_input(
&self,
req: crate::model::InsertCssProductInputRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::CssProductInput>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::CssProductInputsService::insert_css_product_input",
self.inner.insert_css_product_input(req, options));
pending.await
}
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn update_css_product_input(
&self,
req: crate::model::UpdateCssProductInputRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::CssProductInput>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::CssProductInputsService::update_css_product_input",
self.inner.update_css_product_input(req, options));
pending.await
}
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn delete_css_product_input(
&self,
req: crate::model::DeleteCssProductInputRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<()>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::CssProductInputsService::delete_css_product_input",
self.inner.delete_css_product_input(req, options));
pending.await
}
}
#[derive(Clone, Debug)]
pub struct CssProductsService<T>
where
T: super::stub::CssProductsService + std::fmt::Debug + Send + Sync,
{
inner: T,
duration: gaxi::observability::DurationMetric,
}
impl<T> CssProductsService<T>
where
T: super::stub::CssProductsService + std::fmt::Debug + Send + Sync,
{
pub fn new(inner: T) -> Self {
Self {
inner,
duration: gaxi::observability::DurationMetric::new(&info::INSTRUMENTATION_CLIENT_INFO),
}
}
}
impl<T> super::stub::CssProductsService for CssProductsService<T>
where
T: super::stub::CssProductsService + std::fmt::Debug + Send + Sync,
{
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn get_css_product(
&self,
req: crate::model::GetCssProductRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::CssProduct>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::CssProductsService::get_css_product",
self.inner.get_css_product(req, options));
pending.await
}
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn list_css_products(
&self,
req: crate::model::ListCssProductsRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::ListCssProductsResponse>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::CssProductsService::list_css_products",
self.inner.list_css_products(req, options));
pending.await
}
}
#[derive(Clone, Debug)]
pub struct QuotaService<T>
where
T: super::stub::QuotaService + std::fmt::Debug + Send + Sync,
{
inner: T,
duration: gaxi::observability::DurationMetric,
}
impl<T> QuotaService<T>
where
T: super::stub::QuotaService + std::fmt::Debug + Send + Sync,
{
pub fn new(inner: T) -> Self {
Self {
inner,
duration: gaxi::observability::DurationMetric::new(&info::INSTRUMENTATION_CLIENT_INFO),
}
}
}
impl<T> super::stub::QuotaService for QuotaService<T>
where
T: super::stub::QuotaService + std::fmt::Debug + Send + Sync,
{
#[tracing::instrument(level = tracing::Level::DEBUG, ret)]
async fn list_quota_groups(
&self,
req: crate::model::ListQuotaGroupsRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::ListQuotaGroupsResponse>> {
let (_span, pending) = gaxi::client_request_signals!(
metric: self.duration.clone(),
info: *info::INSTRUMENTATION_CLIENT_INFO,
method: "client::QuotaService::list_quota_groups",
self.inner.list_quota_groups(req, options));
pending.await
}
}
pub(crate) mod info {
const NAME: &str = env!("CARGO_PKG_NAME");
const VERSION: &str = env!("CARGO_PKG_VERSION");
pub(crate) static INSTRUMENTATION_CLIENT_INFO: std::sync::LazyLock<
gaxi::options::InstrumentationClientInfo,
> = std::sync::LazyLock::new(|| {
let mut info = gaxi::options::InstrumentationClientInfo::default();
info.service_name = "css";
info.client_version = VERSION;
info.client_artifact = NAME;
info.default_host = "css";
info
});
}