google-shopping-css-v1 1.0.0

Google Cloud Client Libraries for Rust - CSS API
Documentation
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [AccountsService](super::stub::AccountsService) decorator for logging and tracing.
#[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
    }
}

/// Implements a [AccountLabelsService](super::stub::AccountLabelsService) decorator for logging and tracing.
#[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
    }
}

/// Implements a [CssProductInputsService](super::stub::CssProductInputsService) decorator for logging and tracing.
#[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
    }
}

/// Implements a [CssProductsService](super::stub::CssProductsService) decorator for logging and tracing.
#[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
    }
}

/// Implements a [QuotaService](super::stub::QuotaService) decorator for logging and tracing.
#[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
    });
}