google-cloud-storage 1.2.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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