#
google_cloud_pubsub/generated/gapic/stub/
dynamic.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.
    16
    17/// A dyn-compatible, crate-private version of [super::TopicAdmin].
    18#[async_trait::async_trait]
    19pub trait TopicAdmin: std::fmt::Debug + Send + Sync {
    20    async fn create_topic(
    21        &self,
    22        req: crate::model::Topic,
    23        options: gax::options::RequestOptions,
    24    ) -> crate::Result<gax::response::Response<crate::model::Topic>>;
    25
    26    async fn update_topic(
    27        &self,
    28        req: crate::model::UpdateTopicRequest,
    29        options: gax::options::RequestOptions,
    30    ) -> crate::Result<gax::response::Response<crate::model::Topic>>;
    31
    32    async fn get_topic(
    33        &self,
    34        req: crate::model::GetTopicRequest,
    35        options: gax::options::RequestOptions,
    36    ) -> crate::Result<gax::response::Response<crate::model::Topic>>;
    37
    38    async fn list_topics(
    39        &self,
    40        req: crate::model::ListTopicsRequest,
    41        options: gax::options::RequestOptions,
    42    ) -> crate::Result<gax::response::Response<crate::model::ListTopicsResponse>>;
    43
    44    async fn list_topic_subscriptions(
    45        &self,
    46        req: crate::model::ListTopicSubscriptionsRequest,
    47        options: gax::options::RequestOptions,
    48    ) -> crate::Result<gax::response::Response<crate::model::ListTopicSubscriptionsResponse>>;
    49
    50    async fn list_topic_snapshots(
    51        &self,
    52        req: crate::model::ListTopicSnapshotsRequest,
    53        options: gax::options::RequestOptions,
    54    ) -> crate::Result<gax::response::Response<crate::model::ListTopicSnapshotsResponse>>;
    55
    56    async fn delete_topic(
    57        &self,
    58        req: crate::model::DeleteTopicRequest,
    59        options: gax::options::RequestOptions,
    60    ) -> crate::Result<gax::response::Response<()>>;
    61
    62    async fn detach_subscription(
    63        &self,
    64        req: crate::model::DetachSubscriptionRequest,
    65        options: gax::options::RequestOptions,
    66    ) -> crate::Result<gax::response::Response<crate::model::DetachSubscriptionResponse>>;
    67}
    68
    69/// All implementations of [super::TopicAdmin] also implement [TopicAdmin].
    70#[async_trait::async_trait]
    71impl<T: super::TopicAdmin> TopicAdmin for T {
    72    /// Forwards the call to the implementation provided by `T`.
    73    async fn create_topic(
    74        &self,
    75        req: crate::model::Topic,
    76        options: gax::options::RequestOptions,
    77    ) -> crate::Result<gax::response::Response<crate::model::Topic>> {
    78        T::create_topic(self, req, options).await
    79    }
    80
    81    /// Forwards the call to the implementation provided by `T`.
    82    async fn update_topic(
    83        &self,
    84        req: crate::model::UpdateTopicRequest,
    85        options: gax::options::RequestOptions,
    86    ) -> crate::Result<gax::response::Response<crate::model::Topic>> {
    87        T::update_topic(self, req, options).await
    88    }
    89
    90    /// Forwards the call to the implementation provided by `T`.
    91    async fn get_topic(
    92        &self,
    93        req: crate::model::GetTopicRequest,
    94        options: gax::options::RequestOptions,
    95    ) -> crate::Result<gax::response::Response<crate::model::Topic>> {
    96        T::get_topic(self, req, options).await
    97    }
    98
    99    /// Forwards the call to the implementation provided by `T`.
    100    async fn list_topics(
    101        &self,
    102        req: crate::model::ListTopicsRequest,
    103        options: gax::options::RequestOptions,
    104    ) -> crate::Result<gax::response::Response<crate::model::ListTopicsResponse>> {
    105        T::list_topics(self, req, options).await
    106    }
    107
    108    /// Forwards the call to the implementation provided by `T`.
    109    async fn list_topic_subscriptions(
    110        &self,
    111        req: crate::model::ListTopicSubscriptionsRequest,
    112        options: gax::options::RequestOptions,
    113    ) -> crate::Result<gax::response::Response<crate::model::ListTopicSubscriptionsResponse>> {
    114        T::list_topic_subscriptions(self, req, options).await
    115    }
    116
    117    /// Forwards the call to the implementation provided by `T`.
    118    async fn list_topic_snapshots(
    119        &self,
    120        req: crate::model::ListTopicSnapshotsRequest,
    121        options: gax::options::RequestOptions,
    122    ) -> crate::Result<gax::response::Response<crate::model::ListTopicSnapshotsResponse>> {
    123        T::list_topic_snapshots(self, req, options).await
    124    }
    125
    126    /// Forwards the call to the implementation provided by `T`.
    127    async fn delete_topic(
    128        &self,
    129        req: crate::model::DeleteTopicRequest,
    130        options: gax::options::RequestOptions,
    131    ) -> crate::Result<gax::response::Response<()>> {
    132        T::delete_topic(self, req, options).await
    133    }
    134
    135    /// Forwards the call to the implementation provided by `T`.
    136    async fn detach_subscription(
    137        &self,
    138        req: crate::model::DetachSubscriptionRequest,
    139        options: gax::options::RequestOptions,
    140    ) -> crate::Result<gax::response::Response<crate::model::DetachSubscriptionResponse>> {
    141        T::detach_subscription(self, req, options).await
    142    }
    143}
    144
    145/// A dyn-compatible, crate-private version of [super::SubscriptionAdmin].
    146#[async_trait::async_trait]
    147pub trait SubscriptionAdmin: std::fmt::Debug + Send + Sync {
    148    async fn create_subscription(
    149        &self,
    150        req: crate::model::Subscription,
    151        options: gax::options::RequestOptions,
    152    ) -> crate::Result<gax::response::Response<crate::model::Subscription>>;
    153
    154    async fn get_subscription(
    155        &self,
    156        req: crate::model::GetSubscriptionRequest,
    157        options: gax::options::RequestOptions,
    158    ) -> crate::Result<gax::response::Response<crate::model::Subscription>>;
    159
    160    async fn update_subscription(
    161        &self,
    162        req: crate::model::UpdateSubscriptionRequest,
    163        options: gax::options::RequestOptions,
    164    ) -> crate::Result<gax::response::Response<crate::model::Subscription>>;
    165
    166    async fn list_subscriptions(
    167        &self,
    168        req: crate::model::ListSubscriptionsRequest,
    169        options: gax::options::RequestOptions,
    170    ) -> crate::Result<gax::response::Response<crate::model::ListSubscriptionsResponse>>;
    171
    172    async fn delete_subscription(
    173        &self,
    174        req: crate::model::DeleteSubscriptionRequest,
    175        options: gax::options::RequestOptions,
    176    ) -> crate::Result<gax::response::Response<()>>;
    177
    178    async fn modify_push_config(
    179        &self,
    180        req: crate::model::ModifyPushConfigRequest,
    181        options: gax::options::RequestOptions,
    182    ) -> crate::Result<gax::response::Response<()>>;
    183
    184    async fn get_snapshot(
    185        &self,
    186        req: crate::model::GetSnapshotRequest,
    187        options: gax::options::RequestOptions,
    188    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>>;
    189
    190    async fn list_snapshots(
    191        &self,
    192        req: crate::model::ListSnapshotsRequest,
    193        options: gax::options::RequestOptions,
    194    ) -> crate::Result<gax::response::Response<crate::model::ListSnapshotsResponse>>;
    195
    196    async fn create_snapshot(
    197        &self,
    198        req: crate::model::CreateSnapshotRequest,
    199        options: gax::options::RequestOptions,
    200    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>>;
    201
    202    async fn update_snapshot(
    203        &self,
    204        req: crate::model::UpdateSnapshotRequest,
    205        options: gax::options::RequestOptions,
    206    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>>;
    207
    208    async fn delete_snapshot(
    209        &self,
    210        req: crate::model::DeleteSnapshotRequest,
    211        options: gax::options::RequestOptions,
    212    ) -> crate::Result<gax::response::Response<()>>;
    213
    214    async fn seek(
    215        &self,
    216        req: crate::model::SeekRequest,
    217        options: gax::options::RequestOptions,
    218    ) -> crate::Result<gax::response::Response<crate::model::SeekResponse>>;
    219}
    220
    221/// All implementations of [super::SubscriptionAdmin] also implement [SubscriptionAdmin].
    222#[async_trait::async_trait]
    223impl<T: super::SubscriptionAdmin> SubscriptionAdmin for T {
    224    /// Forwards the call to the implementation provided by `T`.
    225    async fn create_subscription(
    226        &self,
    227        req: crate::model::Subscription,
    228        options: gax::options::RequestOptions,
    229    ) -> crate::Result<gax::response::Response<crate::model::Subscription>> {
    230        T::create_subscription(self, req, options).await
    231    }
    232
    233    /// Forwards the call to the implementation provided by `T`.
    234    async fn get_subscription(
    235        &self,
    236        req: crate::model::GetSubscriptionRequest,
    237        options: gax::options::RequestOptions,
    238    ) -> crate::Result<gax::response::Response<crate::model::Subscription>> {
    239        T::get_subscription(self, req, options).await
    240    }
    241
    242    /// Forwards the call to the implementation provided by `T`.
    243    async fn update_subscription(
    244        &self,
    245        req: crate::model::UpdateSubscriptionRequest,
    246        options: gax::options::RequestOptions,
    247    ) -> crate::Result<gax::response::Response<crate::model::Subscription>> {
    248        T::update_subscription(self, req, options).await
    249    }
    250
    251    /// Forwards the call to the implementation provided by `T`.
    252    async fn list_subscriptions(
    253        &self,
    254        req: crate::model::ListSubscriptionsRequest,
    255        options: gax::options::RequestOptions,
    256    ) -> crate::Result<gax::response::Response<crate::model::ListSubscriptionsResponse>> {
    257        T::list_subscriptions(self, req, options).await
    258    }
    259
    260    /// Forwards the call to the implementation provided by `T`.
    261    async fn delete_subscription(
    262        &self,
    263        req: crate::model::DeleteSubscriptionRequest,
    264        options: gax::options::RequestOptions,
    265    ) -> crate::Result<gax::response::Response<()>> {
    266        T::delete_subscription(self, req, options).await
    267    }
    268
    269    /// Forwards the call to the implementation provided by `T`.
    270    async fn modify_push_config(
    271        &self,
    272        req: crate::model::ModifyPushConfigRequest,
    273        options: gax::options::RequestOptions,
    274    ) -> crate::Result<gax::response::Response<()>> {
    275        T::modify_push_config(self, req, options).await
    276    }
    277
    278    /// Forwards the call to the implementation provided by `T`.
    279    async fn get_snapshot(
    280        &self,
    281        req: crate::model::GetSnapshotRequest,
    282        options: gax::options::RequestOptions,
    283    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>> {
    284        T::get_snapshot(self, req, options).await
    285    }
    286
    287    /// Forwards the call to the implementation provided by `T`.
    288    async fn list_snapshots(
    289        &self,
    290        req: crate::model::ListSnapshotsRequest,
    291        options: gax::options::RequestOptions,
    292    ) -> crate::Result<gax::response::Response<crate::model::ListSnapshotsResponse>> {
    293        T::list_snapshots(self, req, options).await
    294    }
    295
    296    /// Forwards the call to the implementation provided by `T`.
    297    async fn create_snapshot(
    298        &self,
    299        req: crate::model::CreateSnapshotRequest,
    300        options: gax::options::RequestOptions,
    301    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>> {
    302        T::create_snapshot(self, req, options).await
    303    }
    304
    305    /// Forwards the call to the implementation provided by `T`.
    306    async fn update_snapshot(
    307        &self,
    308        req: crate::model::UpdateSnapshotRequest,
    309        options: gax::options::RequestOptions,
    310    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>> {
    311        T::update_snapshot(self, req, options).await
    312    }
    313
    314    /// Forwards the call to the implementation provided by `T`.
    315    async fn delete_snapshot(
    316        &self,
    317        req: crate::model::DeleteSnapshotRequest,
    318        options: gax::options::RequestOptions,
    319    ) -> crate::Result<gax::response::Response<()>> {
    320        T::delete_snapshot(self, req, options).await
    321    }
    322
    323    /// Forwards the call to the implementation provided by `T`.
    324    async fn seek(
    325        &self,
    326        req: crate::model::SeekRequest,
    327        options: gax::options::RequestOptions,
    328    ) -> crate::Result<gax::response::Response<crate::model::SeekResponse>> {
    329        T::seek(self, req, options).await
    330    }
    331}
    332
    333/// A dyn-compatible, crate-private version of [super::SchemaService].
    334#[async_trait::async_trait]
    335pub trait SchemaService: std::fmt::Debug + Send + Sync {
    336    async fn create_schema(
    337        &self,
    338        req: crate::model::CreateSchemaRequest,
    339        options: gax::options::RequestOptions,
    340    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;
    341
    342    async fn get_schema(
    343        &self,
    344        req: crate::model::GetSchemaRequest,
    345        options: gax::options::RequestOptions,
    346    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;
    347
    348    async fn list_schemas(
    349        &self,
    350        req: crate::model::ListSchemasRequest,
    351        options: gax::options::RequestOptions,
    352    ) -> crate::Result<gax::response::Response<crate::model::ListSchemasResponse>>;
    353
    354    async fn list_schema_revisions(
    355        &self,
    356        req: crate::model::ListSchemaRevisionsRequest,
    357        options: gax::options::RequestOptions,
    358    ) -> crate::Result<gax::response::Response<crate::model::ListSchemaRevisionsResponse>>;
    359
    360    async fn commit_schema(
    361        &self,
    362        req: crate::model::CommitSchemaRequest,
    363        options: gax::options::RequestOptions,
    364    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;
    365
    366    async fn rollback_schema(
    367        &self,
    368        req: crate::model::RollbackSchemaRequest,
    369        options: gax::options::RequestOptions,
    370    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;
    371
    372    async fn delete_schema_revision(
    373        &self,
    374        req: crate::model::DeleteSchemaRevisionRequest,
    375        options: gax::options::RequestOptions,
    376    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;
    377
    378    async fn delete_schema(
    379        &self,
    380        req: crate::model::DeleteSchemaRequest,
    381        options: gax::options::RequestOptions,
    382    ) -> crate::Result<gax::response::Response<()>>;
    383
    384    async fn validate_schema(
    385        &self,
    386        req: crate::model::ValidateSchemaRequest,
    387        options: gax::options::RequestOptions,
    388    ) -> crate::Result<gax::response::Response<crate::model::ValidateSchemaResponse>>;
    389
    390    async fn validate_message(
    391        &self,
    392        req: crate::model::ValidateMessageRequest,
    393        options: gax::options::RequestOptions,
    394    ) -> crate::Result<gax::response::Response<crate::model::ValidateMessageResponse>>;
    395
    396    async fn set_iam_policy(
    397        &self,
    398        req: iam_v1::model::SetIamPolicyRequest,
    399        options: gax::options::RequestOptions,
    400    ) -> crate::Result<gax::response::Response<iam_v1::model::Policy>>;
    401
    402    async fn get_iam_policy(
    403        &self,
    404        req: iam_v1::model::GetIamPolicyRequest,
    405        options: gax::options::RequestOptions,
    406    ) -> crate::Result<gax::response::Response<iam_v1::model::Policy>>;
    407
    408    async fn test_iam_permissions(
    409        &self,
    410        req: iam_v1::model::TestIamPermissionsRequest,
    411        options: gax::options::RequestOptions,
    412    ) -> crate::Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>>;
    413}
    414
    415/// All implementations of [super::SchemaService] also implement [SchemaService].
    416#[async_trait::async_trait]
    417impl<T: super::SchemaService> SchemaService for T {
    418    /// Forwards the call to the implementation provided by `T`.
    419    async fn create_schema(
    420        &self,
    421        req: crate::model::CreateSchemaRequest,
    422        options: gax::options::RequestOptions,
    423    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
    424        T::create_schema(self, req, options).await
    425    }
    426
    427    /// Forwards the call to the implementation provided by `T`.
    428    async fn get_schema(
    429        &self,
    430        req: crate::model::GetSchemaRequest,
    431        options: gax::options::RequestOptions,
    432    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
    433        T::get_schema(self, req, options).await
    434    }
    435
    436    /// Forwards the call to the implementation provided by `T`.
    437    async fn list_schemas(
    438        &self,
    439        req: crate::model::ListSchemasRequest,
    440        options: gax::options::RequestOptions,
    441    ) -> crate::Result<gax::response::Response<crate::model::ListSchemasResponse>> {
    442        T::list_schemas(self, req, options).await
    443    }
    444
    445    /// Forwards the call to the implementation provided by `T`.
    446    async fn list_schema_revisions(
    447        &self,
    448        req: crate::model::ListSchemaRevisionsRequest,
    449        options: gax::options::RequestOptions,
    450    ) -> crate::Result<gax::response::Response<crate::model::ListSchemaRevisionsResponse>> {
    451        T::list_schema_revisions(self, req, options).await
    452    }
    453
    454    /// Forwards the call to the implementation provided by `T`.
    455    async fn commit_schema(
    456        &self,
    457        req: crate::model::CommitSchemaRequest,
    458        options: gax::options::RequestOptions,
    459    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
    460        T::commit_schema(self, req, options).await
    461    }
    462
    463    /// Forwards the call to the implementation provided by `T`.
    464    async fn rollback_schema(
    465        &self,
    466        req: crate::model::RollbackSchemaRequest,
    467        options: gax::options::RequestOptions,
    468    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
    469        T::rollback_schema(self, req, options).await
    470    }
    471
    472    /// Forwards the call to the implementation provided by `T`.
    473    async fn delete_schema_revision(
    474        &self,
    475        req: crate::model::DeleteSchemaRevisionRequest,
    476        options: gax::options::RequestOptions,
    477    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
    478        T::delete_schema_revision(self, req, options).await
    479    }
    480
    481    /// Forwards the call to the implementation provided by `T`.
    482    async fn delete_schema(
    483        &self,
    484        req: crate::model::DeleteSchemaRequest,
    485        options: gax::options::RequestOptions,
    486    ) -> crate::Result<gax::response::Response<()>> {
    487        T::delete_schema(self, req, options).await
    488    }
    489
    490    /// Forwards the call to the implementation provided by `T`.
    491    async fn validate_schema(
    492        &self,
    493        req: crate::model::ValidateSchemaRequest,
    494        options: gax::options::RequestOptions,
    495    ) -> crate::Result<gax::response::Response<crate::model::ValidateSchemaResponse>> {
    496        T::validate_schema(self, req, options).await
    497    }
    498
    499    /// Forwards the call to the implementation provided by `T`.
    500    async fn validate_message(
    501        &self,
    502        req: crate::model::ValidateMessageRequest,
    503        options: gax::options::RequestOptions,
    504    ) -> crate::Result<gax::response::Response<crate::model::ValidateMessageResponse>> {
    505        T::validate_message(self, req, options).await
    506    }
    507
    508    /// Forwards the call to the implementation provided by `T`.
    509    async fn set_iam_policy(
    510        &self,
    511        req: iam_v1::model::SetIamPolicyRequest,
    512        options: gax::options::RequestOptions,
    513    ) -> crate::Result<gax::response::Response<iam_v1::model::Policy>> {
    514        T::set_iam_policy(self, req, options).await
    515    }
    516
    517    /// Forwards the call to the implementation provided by `T`.
    518    async fn get_iam_policy(
    519        &self,
    520        req: iam_v1::model::GetIamPolicyRequest,
    521        options: gax::options::RequestOptions,
    522    ) -> crate::Result<gax::response::Response<iam_v1::model::Policy>> {
    523        T::get_iam_policy(self, req, options).await
    524    }
    525
    526    /// Forwards the call to the implementation provided by `T`.
    527    async fn test_iam_permissions(
    528        &self,
    529        req: iam_v1::model::TestIamPermissionsRequest,
    530        options: gax::options::RequestOptions,
    531    ) -> crate::Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
    532        T::test_iam_permissions(self, req, options).await
    533    }
    534}