google-cloud-storage 1.11.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.

//! Traits to mock the clients in this library.
//!
//! Application developers may need to mock the clients in this library to test
//! how their application works with different (and sometimes hard to trigger)
//! client and service behavior. Such test can define mocks implementing the
//! trait(s) defined in this module, initialize the client with an instance of
//! this mock in their tests, and verify their application responds as expected.

#![allow(rustdoc::broken_intra_doc_links)]

pub(crate) mod dynamic;

/// Defines the trait used to implement [super::client::StorageControl].
///
/// Application developers may need to implement this trait to mock
/// `client::StorageControl`.  In other use-cases, application developers only
/// use `client::StorageControl` and need not be concerned with this trait or
/// its implementations.
///
/// Services gain new RPCs routinely. Consequently, this trait gains new methods
/// too. To avoid breaking applications the trait provides a default
/// implementation of each method. Most of these implementations just return an
/// error.
pub trait StorageControl: std::fmt::Debug + Send + Sync {
    /// Implements [super::client::StorageControl::create_folder].
    fn create_folder(
        &self,
        _req: crate::model::CreateFolderRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<Output = crate::Result<crate::Response<crate::model::Folder>>> + Send
    {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::delete_folder].
    fn delete_folder(
        &self,
        _req: crate::model::DeleteFolderRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<Output = crate::Result<crate::Response<()>>> + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_folder].
    fn get_folder(
        &self,
        _req: crate::model::GetFolderRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<Output = crate::Result<crate::Response<crate::model::Folder>>> + Send
    {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::list_folders].
    fn list_folders(
        &self,
        _req: crate::model::ListFoldersRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::ListFoldersResponse>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::rename_folder].
    fn rename_folder(
        &self,
        _req: crate::model::RenameFolderRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::delete_folder_recursive].
    fn delete_folder_recursive(
        &self,
        _req: crate::model::DeleteFolderRecursiveRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_storage_layout].
    fn get_storage_layout(
        &self,
        _req: crate::model::GetStorageLayoutRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::StorageLayout>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::create_managed_folder].
    fn create_managed_folder(
        &self,
        _req: crate::model::CreateManagedFolderRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::ManagedFolder>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::delete_managed_folder].
    fn delete_managed_folder(
        &self,
        _req: crate::model::DeleteManagedFolderRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<Output = crate::Result<crate::Response<()>>> + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_managed_folder].
    fn get_managed_folder(
        &self,
        _req: crate::model::GetManagedFolderRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::ManagedFolder>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::list_managed_folders].
    fn list_managed_folders(
        &self,
        _req: crate::model::ListManagedFoldersRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::ListManagedFoldersResponse>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::create_anywhere_cache].
    fn create_anywhere_cache(
        &self,
        _req: crate::model::CreateAnywhereCacheRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::update_anywhere_cache].
    fn update_anywhere_cache(
        &self,
        _req: crate::model::UpdateAnywhereCacheRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::disable_anywhere_cache].
    fn disable_anywhere_cache(
        &self,
        _req: crate::model::DisableAnywhereCacheRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::AnywhereCache>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::pause_anywhere_cache].
    fn pause_anywhere_cache(
        &self,
        _req: crate::model::PauseAnywhereCacheRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::AnywhereCache>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::resume_anywhere_cache].
    fn resume_anywhere_cache(
        &self,
        _req: crate::model::ResumeAnywhereCacheRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::AnywhereCache>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_anywhere_cache].
    fn get_anywhere_cache(
        &self,
        _req: crate::model::GetAnywhereCacheRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::AnywhereCache>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::list_anywhere_caches].
    fn list_anywhere_caches(
        &self,
        _req: crate::model::ListAnywhereCachesRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::ListAnywhereCachesResponse>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_project_intelligence_config].
    fn get_project_intelligence_config(
        &self,
        _req: crate::model::GetProjectIntelligenceConfigRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::IntelligenceConfig>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::update_project_intelligence_config].
    fn update_project_intelligence_config(
        &self,
        _req: crate::model::UpdateProjectIntelligenceConfigRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::IntelligenceConfig>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_folder_intelligence_config].
    fn get_folder_intelligence_config(
        &self,
        _req: crate::model::GetFolderIntelligenceConfigRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::IntelligenceConfig>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::update_folder_intelligence_config].
    fn update_folder_intelligence_config(
        &self,
        _req: crate::model::UpdateFolderIntelligenceConfigRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::IntelligenceConfig>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_organization_intelligence_config].
    fn get_organization_intelligence_config(
        &self,
        _req: crate::model::GetOrganizationIntelligenceConfigRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::IntelligenceConfig>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::update_organization_intelligence_config].
    fn update_organization_intelligence_config(
        &self,
        _req: crate::model::UpdateOrganizationIntelligenceConfigRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<crate::model::IntelligenceConfig>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_iam_policy].
    fn get_iam_policy(
        &self,
        _req: google_cloud_iam_v1::model::GetIamPolicyRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<google_cloud_iam_v1::model::Policy>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::set_iam_policy].
    fn set_iam_policy(
        &self,
        _req: google_cloud_iam_v1::model::SetIamPolicyRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<google_cloud_iam_v1::model::Policy>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::test_iam_permissions].
    fn test_iam_permissions(
        &self,
        _req: google_cloud_iam_v1::model::TestIamPermissionsRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            crate::Response<google_cloud_iam_v1::model::TestIamPermissionsResponse>,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::StorageControl::get_operation].
    fn get_operation(
        &self,
        _req: google_cloud_longrunning::model::GetOperationRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Returns the polling error policy.
    ///
    /// When mocking, this method is typically irrelevant. Do not try to verify
    /// it is called by your mocks.
    fn get_polling_error_policy(
        &self,
        _options: &crate::RequestOptions,
    ) -> std::sync::Arc<dyn google_cloud_gax::polling_error_policy::PollingErrorPolicy> {
        std::sync::Arc::new(google_cloud_gax::polling_error_policy::Aip194Strict)
    }

    /// Returns the polling backoff policy.
    ///
    /// When mocking, this method is typically irrelevant. Do not try to verify
    /// it is called by your mocks.
    fn get_polling_backoff_policy(
        &self,
        _options: &crate::RequestOptions,
    ) -> std::sync::Arc<dyn google_cloud_gax::polling_backoff_policy::PollingBackoffPolicy> {
        std::sync::Arc::new(google_cloud_gax::exponential_backoff::ExponentialBackoff::default())
    }
}