#
google_cloud_pubsub/generated/gapic/
tracing.rs

    1// Copyright 2025 Google LLC
    2//
    3// Licensed under the Apache License, Version 2.0 (the "License");
    4// you may not use this file except in compliance with the License.
    5// You may obtain a copy of the License at
    6//
    7//     https://www.apache.org/licenses/LICENSE-2.0
    8//
    9// Unless required by applicable law or agreed to in writing, software
    10// distributed under the License is distributed on an "AS IS" BASIS,
    11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12// See the License for the specific language governing permissions and
    13// limitations under the License.
    14//
    15// Code generated by sidekick. DO NOT EDIT.
    16use crate::Result;
    17
    18/// Implements a [TopicAdmin](super::stub::TopicAdmin) decorator for logging and tracing.
    19#[derive(Clone, Debug)]
    20pub struct TopicAdmin<T>
    21where
    22    T: super::stub::TopicAdmin + std::fmt::Debug + Send + Sync,
    23{
    24    inner: T,
    25}
    26
    27impl<T> TopicAdmin<T>
    28where
    29    T: super::stub::TopicAdmin + std::fmt::Debug + Send + Sync,
    30{
    31    pub fn new(inner: T) -> Self {
    32        Self { inner }
    33    }
    34}
    35
    36impl<T> super::stub::TopicAdmin for TopicAdmin<T>
    37where
    38    T: super::stub::TopicAdmin + std::fmt::Debug + Send + Sync,
    39{
    40    #[tracing::instrument(ret)]
    41    async fn create_topic(
    42        &self,
    43        req: crate::model::Topic,
    44        options: gax::options::RequestOptions,
    45    ) -> Result<gax::response::Response<crate::model::Topic>> {
    46        self.inner.create_topic(req, options).await
    47    }
    48
    49    #[tracing::instrument(ret)]
    50    async fn update_topic(
    51        &self,
    52        req: crate::model::UpdateTopicRequest,
    53        options: gax::options::RequestOptions,
    54    ) -> Result<gax::response::Response<crate::model::Topic>> {
    55        self.inner.update_topic(req, options).await
    56    }
    57
    58    #[tracing::instrument(ret)]
    59    async fn get_topic(
    60        &self,
    61        req: crate::model::GetTopicRequest,
    62        options: gax::options::RequestOptions,
    63    ) -> Result<gax::response::Response<crate::model::Topic>> {
    64        self.inner.get_topic(req, options).await
    65    }
    66
    67    #[tracing::instrument(ret)]
    68    async fn list_topics(
    69        &self,
    70        req: crate::model::ListTopicsRequest,
    71        options: gax::options::RequestOptions,
    72    ) -> Result<gax::response::Response<crate::model::ListTopicsResponse>> {
    73        self.inner.list_topics(req, options).await
    74    }
    75
    76    #[tracing::instrument(ret)]
    77    async fn list_topic_subscriptions(
    78        &self,
    79        req: crate::model::ListTopicSubscriptionsRequest,
    80        options: gax::options::RequestOptions,
    81    ) -> Result<gax::response::Response<crate::model::ListTopicSubscriptionsResponse>> {
    82        self.inner.list_topic_subscriptions(req, options).await
    83    }
    84
    85    #[tracing::instrument(ret)]
    86    async fn list_topic_snapshots(
    87        &self,
    88        req: crate::model::ListTopicSnapshotsRequest,
    89        options: gax::options::RequestOptions,
    90    ) -> Result<gax::response::Response<crate::model::ListTopicSnapshotsResponse>> {
    91        self.inner.list_topic_snapshots(req, options).await
    92    }
    93
    94    #[tracing::instrument(ret)]
    95    async fn delete_topic(
    96        &self,
    97        req: crate::model::DeleteTopicRequest,
    98        options: gax::options::RequestOptions,
    99    ) -> Result<gax::response::Response<()>> {
    100        self.inner.delete_topic(req, options).await
    101    }
    102
    103    #[tracing::instrument(ret)]
    104    async fn detach_subscription(
    105        &self,
    106        req: crate::model::DetachSubscriptionRequest,
    107        options: gax::options::RequestOptions,
    108    ) -> Result<gax::response::Response<crate::model::DetachSubscriptionResponse>> {
    109        self.inner.detach_subscription(req, options).await
    110    }
    111}
    112
    113/// Implements a [SubscriptionAdmin](super::stub::SubscriptionAdmin) decorator for logging and tracing.
    114#[derive(Clone, Debug)]
    115pub struct SubscriptionAdmin<T>
    116where
    117    T: super::stub::SubscriptionAdmin + std::fmt::Debug + Send + Sync,
    118{
    119    inner: T,
    120}
    121
    122impl<T> SubscriptionAdmin<T>
    123where
    124    T: super::stub::SubscriptionAdmin + std::fmt::Debug + Send + Sync,
    125{
    126    pub fn new(inner: T) -> Self {
    127        Self { inner }
    128    }
    129}
    130
    131impl<T> super::stub::SubscriptionAdmin for SubscriptionAdmin<T>
    132where
    133    T: super::stub::SubscriptionAdmin + std::fmt::Debug + Send + Sync,
    134{
    135    #[tracing::instrument(ret)]
    136    async fn create_subscription(
    137        &self,
    138        req: crate::model::Subscription,
    139        options: gax::options::RequestOptions,
    140    ) -> Result<gax::response::Response<crate::model::Subscription>> {
    141        self.inner.create_subscription(req, options).await
    142    }
    143
    144    #[tracing::instrument(ret)]
    145    async fn get_subscription(
    146        &self,
    147        req: crate::model::GetSubscriptionRequest,
    148        options: gax::options::RequestOptions,
    149    ) -> Result<gax::response::Response<crate::model::Subscription>> {
    150        self.inner.get_subscription(req, options).await
    151    }
    152
    153    #[tracing::instrument(ret)]
    154    async fn update_subscription(
    155        &self,
    156        req: crate::model::UpdateSubscriptionRequest,
    157        options: gax::options::RequestOptions,
    158    ) -> Result<gax::response::Response<crate::model::Subscription>> {
    159        self.inner.update_subscription(req, options).await
    160    }
    161
    162    #[tracing::instrument(ret)]
    163    async fn list_subscriptions(
    164        &self,
    165        req: crate::model::ListSubscriptionsRequest,
    166        options: gax::options::RequestOptions,
    167    ) -> Result<gax::response::Response<crate::model::ListSubscriptionsResponse>> {
    168        self.inner.list_subscriptions(req, options).await
    169    }
    170
    171    #[tracing::instrument(ret)]
    172    async fn delete_subscription(
    173        &self,
    174        req: crate::model::DeleteSubscriptionRequest,
    175        options: gax::options::RequestOptions,
    176    ) -> Result<gax::response::Response<()>> {
    177        self.inner.delete_subscription(req, options).await
    178    }
    179
    180    #[tracing::instrument(ret)]
    181    async fn modify_push_config(
    182        &self,
    183        req: crate::model::ModifyPushConfigRequest,
    184        options: gax::options::RequestOptions,
    185    ) -> Result<gax::response::Response<()>> {
    186        self.inner.modify_push_config(req, options).await
    187    }
    188
    189    #[tracing::instrument(ret)]
    190    async fn get_snapshot(
    191        &self,
    192        req: crate::model::GetSnapshotRequest,
    193        options: gax::options::RequestOptions,
    194    ) -> Result<gax::response::Response<crate::model::Snapshot>> {
    195        self.inner.get_snapshot(req, options).await
    196    }
    197
    198    #[tracing::instrument(ret)]
    199    async fn list_snapshots(
    200        &self,
    201        req: crate::model::ListSnapshotsRequest,
    202        options: gax::options::RequestOptions,
    203    ) -> Result<gax::response::Response<crate::model::ListSnapshotsResponse>> {
    204        self.inner.list_snapshots(req, options).await
    205    }
    206
    207    #[tracing::instrument(ret)]
    208    async fn create_snapshot(
    209        &self,
    210        req: crate::model::CreateSnapshotRequest,
    211        options: gax::options::RequestOptions,
    212    ) -> Result<gax::response::Response<crate::model::Snapshot>> {
    213        self.inner.create_snapshot(req, options).await
    214    }
    215
    216    #[tracing::instrument(ret)]
    217    async fn update_snapshot(
    218        &self,
    219        req: crate::model::UpdateSnapshotRequest,
    220        options: gax::options::RequestOptions,
    221    ) -> Result<gax::response::Response<crate::model::Snapshot>> {
    222        self.inner.update_snapshot(req, options).await
    223    }
    224
    225    #[tracing::instrument(ret)]
    226    async fn delete_snapshot(
    227        &self,
    228        req: crate::model::DeleteSnapshotRequest,
    229        options: gax::options::RequestOptions,
    230    ) -> Result<gax::response::Response<()>> {
    231        self.inner.delete_snapshot(req, options).await
    232    }
    233
    234    #[tracing::instrument(ret)]
    235    async fn seek(
    236        &self,
    237        req: crate::model::SeekRequest,
    238        options: gax::options::RequestOptions,
    239    ) -> Result<gax::response::Response<crate::model::SeekResponse>> {
    240        self.inner.seek(req, options).await
    241    }
    242}
    243
    244/// Implements a [SchemaService](super::stub::SchemaService) decorator for logging and tracing.
    245#[derive(Clone, Debug)]
    246pub struct SchemaService<T>
    247where
    248    T: super::stub::SchemaService + std::fmt::Debug + Send + Sync,
    249{
    250    inner: T,
    251}
    252
    253impl<T> SchemaService<T>
    254where
    255    T: super::stub::SchemaService + std::fmt::Debug + Send + Sync,
    256{
    257    pub fn new(inner: T) -> Self {
    258        Self { inner }
    259    }
    260}
    261
    262impl<T> super::stub::SchemaService for SchemaService<T>
    263where
    264    T: super::stub::SchemaService + std::fmt::Debug + Send + Sync,
    265{
    266    #[tracing::instrument(ret)]
    267    async fn create_schema(
    268        &self,
    269        req: crate::model::CreateSchemaRequest,
    270        options: gax::options::RequestOptions,
    271    ) -> Result<gax::response::Response<crate::model::Schema>> {
    272        self.inner.create_schema(req, options).await
    273    }
    274
    275    #[tracing::instrument(ret)]
    276    async fn get_schema(
    277        &self,
    278        req: crate::model::GetSchemaRequest,
    279        options: gax::options::RequestOptions,
    280    ) -> Result<gax::response::Response<crate::model::Schema>> {
    281        self.inner.get_schema(req, options).await
    282    }
    283
    284    #[tracing::instrument(ret)]
    285    async fn list_schemas(
    286        &self,
    287        req: crate::model::ListSchemasRequest,
    288        options: gax::options::RequestOptions,
    289    ) -> Result<gax::response::Response<crate::model::ListSchemasResponse>> {
    290        self.inner.list_schemas(req, options).await
    291    }
    292
    293    #[tracing::instrument(ret)]
    294    async fn list_schema_revisions(
    295        &self,
    296        req: crate::model::ListSchemaRevisionsRequest,
    297        options: gax::options::RequestOptions,
    298    ) -> Result<gax::response::Response<crate::model::ListSchemaRevisionsResponse>> {
    299        self.inner.list_schema_revisions(req, options).await
    300    }
    301
    302    #[tracing::instrument(ret)]
    303    async fn commit_schema(
    304        &self,
    305        req: crate::model::CommitSchemaRequest,
    306        options: gax::options::RequestOptions,
    307    ) -> Result<gax::response::Response<crate::model::Schema>> {
    308        self.inner.commit_schema(req, options).await
    309    }
    310
    311    #[tracing::instrument(ret)]
    312    async fn rollback_schema(
    313        &self,
    314        req: crate::model::RollbackSchemaRequest,
    315        options: gax::options::RequestOptions,
    316    ) -> Result<gax::response::Response<crate::model::Schema>> {
    317        self.inner.rollback_schema(req, options).await
    318    }
    319
    320    #[tracing::instrument(ret)]
    321    async fn delete_schema_revision(
    322        &self,
    323        req: crate::model::DeleteSchemaRevisionRequest,
    324        options: gax::options::RequestOptions,
    325    ) -> Result<gax::response::Response<crate::model::Schema>> {
    326        self.inner.delete_schema_revision(req, options).await
    327    }
    328
    329    #[tracing::instrument(ret)]
    330    async fn delete_schema(
    331        &self,
    332        req: crate::model::DeleteSchemaRequest,
    333        options: gax::options::RequestOptions,
    334    ) -> Result<gax::response::Response<()>> {
    335        self.inner.delete_schema(req, options).await
    336    }
    337
    338    #[tracing::instrument(ret)]
    339    async fn validate_schema(
    340        &self,
    341        req: crate::model::ValidateSchemaRequest,
    342        options: gax::options::RequestOptions,
    343    ) -> Result<gax::response::Response<crate::model::ValidateSchemaResponse>> {
    344        self.inner.validate_schema(req, options).await
    345    }
    346
    347    #[tracing::instrument(ret)]
    348    async fn validate_message(
    349        &self,
    350        req: crate::model::ValidateMessageRequest,
    351        options: gax::options::RequestOptions,
    352    ) -> Result<gax::response::Response<crate::model::ValidateMessageResponse>> {
    353        self.inner.validate_message(req, options).await
    354    }
    355
    356    #[tracing::instrument(ret)]
    357    async fn set_iam_policy(
    358        &self,
    359        req: iam_v1::model::SetIamPolicyRequest,
    360        options: gax::options::RequestOptions,
    361    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
    362        self.inner.set_iam_policy(req, options).await
    363    }
    364
    365    #[tracing::instrument(ret)]
    366    async fn get_iam_policy(
    367        &self,
    368        req: iam_v1::model::GetIamPolicyRequest,
    369        options: gax::options::RequestOptions,
    370    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
    371        self.inner.get_iam_policy(req, options).await
    372    }
    373
    374    #[tracing::instrument(ret)]
    375    async fn test_iam_permissions(
    376        &self,
    377        req: iam_v1::model::TestIamPermissionsRequest,
    378        options: gax::options::RequestOptions,
    379    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
    380        self.inner.test_iam_permissions(req, options).await
    381    }
    382}