google-cloud-osconfig-v1 1.7.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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