google-cloud-cloudcontrolspartner-v1 1.7.0

Google Cloud Client Libraries for Rust - Cloud Controls Partner API
Documentation
// Copyright 2025 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 [CloudControlsPartnerCore](super::stub::CloudControlsPartnerCore) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct CloudControlsPartnerCore<T>
where
    T: super::stub::CloudControlsPartnerCore + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> CloudControlsPartnerCore<T>
where
    T: super::stub::CloudControlsPartnerCore + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::CloudControlsPartnerCore for CloudControlsPartnerCore<T>
where
    T: super::stub::CloudControlsPartnerCore + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn get_workload(
        &self,
        req: crate::model::GetWorkloadRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::Workload>> {
        self.inner.get_workload(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_workloads(
        &self,
        req: crate::model::ListWorkloadsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListWorkloadsResponse>> {
        self.inner.list_workloads(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_customer(
        &self,
        req: crate::model::GetCustomerRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::Customer>> {
        self.inner.get_customer(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_customers(
        &self,
        req: crate::model::ListCustomersRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListCustomersResponse>> {
        self.inner.list_customers(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_ekm_connections(
        &self,
        req: crate::model::GetEkmConnectionsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::EkmConnections>> {
        self.inner.get_ekm_connections(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_partner_permissions(
        &self,
        req: crate::model::GetPartnerPermissionsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::PartnerPermissions>> {
        self.inner.get_partner_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_access_approval_requests(
        &self,
        req: crate::model::ListAccessApprovalRequestsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListAccessApprovalRequestsResponse>> {
        self.inner.list_access_approval_requests(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_partner(
        &self,
        req: crate::model::GetPartnerRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::Partner>> {
        self.inner.get_partner(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_customer(
        &self,
        req: crate::model::CreateCustomerRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::Customer>> {
        self.inner.create_customer(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_customer(
        &self,
        req: crate::model::UpdateCustomerRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::Customer>> {
        self.inner.update_customer(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_customer(
        &self,
        req: crate::model::DeleteCustomerRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<()>> {
        self.inner.delete_customer(req, options).await
    }
}

/// Implements a [CloudControlsPartnerMonitoring](super::stub::CloudControlsPartnerMonitoring) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct CloudControlsPartnerMonitoring<T>
where
    T: super::stub::CloudControlsPartnerMonitoring + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> CloudControlsPartnerMonitoring<T>
where
    T: super::stub::CloudControlsPartnerMonitoring + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::CloudControlsPartnerMonitoring for CloudControlsPartnerMonitoring<T>
where
    T: super::stub::CloudControlsPartnerMonitoring + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_violations(
        &self,
        req: crate::model::ListViolationsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListViolationsResponse>> {
        self.inner.list_violations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_violation(
        &self,
        req: crate::model::GetViolationRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::Violation>> {
        self.inner.get_violation(req, options).await
    }
}