google-cloud-functions-v2 1.9.0

Google Cloud Client Libraries for Rust - Cloud Functions 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.

/// A dyn-compatible, crate-private version of [super::FunctionService].
#[async_trait::async_trait]
pub trait FunctionService: std::fmt::Debug + Send + Sync {
    async fn get_function(
        &self,
        req: crate::model::GetFunctionRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::Function>>;

    async fn list_functions(
        &self,
        req: crate::model::ListFunctionsRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::ListFunctionsResponse>>;

    async fn create_function(
        &self,
        req: crate::model::CreateFunctionRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>;

    async fn update_function(
        &self,
        req: crate::model::UpdateFunctionRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>;

    async fn delete_function(
        &self,
        req: crate::model::DeleteFunctionRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>;

    async fn generate_upload_url(
        &self,
        req: crate::model::GenerateUploadUrlRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::GenerateUploadUrlResponse>>;

    async fn generate_download_url(
        &self,
        req: crate::model::GenerateDownloadUrlRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::GenerateDownloadUrlResponse>>;

    async fn list_runtimes(
        &self,
        req: crate::model::ListRuntimesRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::ListRuntimesResponse>>;

    async fn list_locations(
        &self,
        req: google_cloud_location::model::ListLocationsRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_location::model::ListLocationsResponse>>;

    async fn set_iam_policy(
        &self,
        req: google_cloud_iam_v1::model::SetIamPolicyRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_iam_v1::model::Policy>>;

    async fn get_iam_policy(
        &self,
        req: google_cloud_iam_v1::model::GetIamPolicyRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_iam_v1::model::Policy>>;

    async fn test_iam_permissions(
        &self,
        req: google_cloud_iam_v1::model::TestIamPermissionsRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_iam_v1::model::TestIamPermissionsResponse>>;

    async fn list_operations(
        &self,
        req: google_cloud_longrunning::model::ListOperationsRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::ListOperationsResponse>>;

    async fn get_operation(
        &self,
        req: google_cloud_longrunning::model::GetOperationRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>;

    fn get_polling_error_policy(
        &self,
        options: &crate::RequestOptions,
    ) -> std::sync::Arc<dyn google_cloud_gax::polling_error_policy::PollingErrorPolicy>;

    fn get_polling_backoff_policy(
        &self,
        options: &crate::RequestOptions,
    ) -> std::sync::Arc<dyn google_cloud_gax::polling_backoff_policy::PollingBackoffPolicy>;
}

/// All implementations of [super::FunctionService] also implement [FunctionService].
#[async_trait::async_trait]
impl<T: super::FunctionService> FunctionService for T {
    /// Forwards the call to the implementation provided by `T`.
    async fn get_function(
        &self,
        req: crate::model::GetFunctionRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::Function>> {
        T::get_function(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_functions(
        &self,
        req: crate::model::ListFunctionsRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::ListFunctionsResponse>> {
        T::list_functions(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn create_function(
        &self,
        req: crate::model::CreateFunctionRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        T::create_function(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn update_function(
        &self,
        req: crate::model::UpdateFunctionRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        T::update_function(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_function(
        &self,
        req: crate::model::DeleteFunctionRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        T::delete_function(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn generate_upload_url(
        &self,
        req: crate::model::GenerateUploadUrlRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::GenerateUploadUrlResponse>> {
        T::generate_upload_url(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn generate_download_url(
        &self,
        req: crate::model::GenerateDownloadUrlRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::GenerateDownloadUrlResponse>> {
        T::generate_download_url(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_runtimes(
        &self,
        req: crate::model::ListRuntimesRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<crate::model::ListRuntimesResponse>> {
        T::list_runtimes(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_locations(
        &self,
        req: google_cloud_location::model::ListLocationsRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_location::model::ListLocationsResponse>> {
        T::list_locations(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn set_iam_policy(
        &self,
        req: google_cloud_iam_v1::model::SetIamPolicyRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_iam_v1::model::Policy>> {
        T::set_iam_policy(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_iam_policy(
        &self,
        req: google_cloud_iam_v1::model::GetIamPolicyRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_iam_v1::model::Policy>> {
        T::get_iam_policy(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn test_iam_permissions(
        &self,
        req: google_cloud_iam_v1::model::TestIamPermissionsRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_iam_v1::model::TestIamPermissionsResponse>>
    {
        T::test_iam_permissions(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_operations(
        &self,
        req: google_cloud_longrunning::model::ListOperationsRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::ListOperationsResponse>>
    {
        T::list_operations(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_operation(
        &self,
        req: google_cloud_longrunning::model::GetOperationRequest,
        options: crate::RequestOptions,
    ) -> crate::Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        T::get_operation(self, req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &crate::RequestOptions,
    ) -> std::sync::Arc<dyn google_cloud_gax::polling_error_policy::PollingErrorPolicy> {
        T::get_polling_error_policy(self, options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &crate::RequestOptions,
    ) -> std::sync::Arc<dyn google_cloud_gax::polling_backoff_policy::PollingBackoffPolicy> {
        T::get_polling_backoff_policy(self, options)
    }
}