google-cloud-grafeas-v1 1.7.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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