google-cloud-pubsub 0.32.3-preview

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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