#
google_cloud_pubsub/generated/gapic/
stub.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//! Traits to mock the clients in this library.
    18//!
    19//! Application developers may need to mock the clients in this library to test
    20//! how their application works with different (and sometimes hard to trigger)
    21//! client and service behavior. Such test can define mocks implementing the
    22//! trait(s) defined in this module, initialize the client with an instance of
    23//! this mock in their tests, and verify their application responds as expected.
    24
    25#![allow(rustdoc::broken_intra_doc_links)]
    26
    27pub(crate) mod dynamic;
    28
    29/// Defines the trait used to implement [super::client::TopicAdmin].
    30///
    31/// Application developers may need to implement this trait to mock
    32/// `client::TopicAdmin`.  In other use-cases, application developers only
    33/// use `client::TopicAdmin` and need not be concerned with this trait or
    34/// its implementations.
    35///
    36/// Services gain new RPCs routinely. Consequently, this trait gains new methods
    37/// too. To avoid breaking applications the trait provides a default
    38/// implementation of each method. Most of these implementations just return an
    39/// error.
    40pub trait TopicAdmin: std::fmt::Debug + Send + Sync {
    41    /// Implements [super::client::TopicAdmin::create_topic].
    42    fn create_topic(
    43        &self,
    44        _req: crate::model::Topic,
    45        _options: gax::options::RequestOptions,
    46    ) -> impl std::future::Future<
    47        Output = crate::Result<gax::response::Response<crate::model::Topic>>,
    48    > + Send {
    49        gaxi::unimplemented::unimplemented_stub()
    50    }
    51
    52    /// Implements [super::client::TopicAdmin::update_topic].
    53    fn update_topic(
    54        &self,
    55        _req: crate::model::UpdateTopicRequest,
    56        _options: gax::options::RequestOptions,
    57    ) -> impl std::future::Future<
    58        Output = crate::Result<gax::response::Response<crate::model::Topic>>,
    59    > + Send {
    60        gaxi::unimplemented::unimplemented_stub()
    61    }
    62
    63    /// Implements [super::client::TopicAdmin::get_topic].
    64    fn get_topic(
    65        &self,
    66        _req: crate::model::GetTopicRequest,
    67        _options: gax::options::RequestOptions,
    68    ) -> impl std::future::Future<
    69        Output = crate::Result<gax::response::Response<crate::model::Topic>>,
    70    > + Send {
    71        gaxi::unimplemented::unimplemented_stub()
    72    }
    73
    74    /// Implements [super::client::TopicAdmin::list_topics].
    75    fn list_topics(
    76        &self,
    77        _req: crate::model::ListTopicsRequest,
    78        _options: gax::options::RequestOptions,
    79    ) -> impl std::future::Future<
    80        Output = crate::Result<gax::response::Response<crate::model::ListTopicsResponse>>,
    81    > + Send {
    82        gaxi::unimplemented::unimplemented_stub()
    83    }
    84
    85    /// Implements [super::client::TopicAdmin::list_topic_subscriptions].
    86    fn list_topic_subscriptions(
    87        &self,
    88        _req: crate::model::ListTopicSubscriptionsRequest,
    89        _options: gax::options::RequestOptions,
    90    ) -> impl std::future::Future<
    91        Output = crate::Result<
    92            gax::response::Response<crate::model::ListTopicSubscriptionsResponse>,
    93        >,
    94    > + Send {
    95        gaxi::unimplemented::unimplemented_stub()
    96    }
    97
    98    /// Implements [super::client::TopicAdmin::list_topic_snapshots].
    99    fn list_topic_snapshots(
    100        &self,
    101        _req: crate::model::ListTopicSnapshotsRequest,
    102        _options: gax::options::RequestOptions,
    103    ) -> impl std::future::Future<
    104        Output = crate::Result<gax::response::Response<crate::model::ListTopicSnapshotsResponse>>,
    105    > + Send {
    106        gaxi::unimplemented::unimplemented_stub()
    107    }
    108
    109    /// Implements [super::client::TopicAdmin::delete_topic].
    110    fn delete_topic(
    111        &self,
    112        _req: crate::model::DeleteTopicRequest,
    113        _options: gax::options::RequestOptions,
    114    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
    115        gaxi::unimplemented::unimplemented_stub()
    116    }
    117
    118    /// Implements [super::client::TopicAdmin::detach_subscription].
    119    fn detach_subscription(
    120        &self,
    121        _req: crate::model::DetachSubscriptionRequest,
    122        _options: gax::options::RequestOptions,
    123    ) -> impl std::future::Future<
    124        Output = crate::Result<gax::response::Response<crate::model::DetachSubscriptionResponse>>,
    125    > + Send {
    126        gaxi::unimplemented::unimplemented_stub()
    127    }
    128}
    129
    130/// Defines the trait used to implement [super::client::SubscriptionAdmin].
    131///
    132/// Application developers may need to implement this trait to mock
    133/// `client::SubscriptionAdmin`.  In other use-cases, application developers only
    134/// use `client::SubscriptionAdmin` and need not be concerned with this trait or
    135/// its implementations.
    136///
    137/// Services gain new RPCs routinely. Consequently, this trait gains new methods
    138/// too. To avoid breaking applications the trait provides a default
    139/// implementation of each method. Most of these implementations just return an
    140/// error.
    141pub trait SubscriptionAdmin: std::fmt::Debug + Send + Sync {
    142    /// Implements [super::client::SubscriptionAdmin::create_subscription].
    143    fn create_subscription(
    144        &self,
    145        _req: crate::model::Subscription,
    146        _options: gax::options::RequestOptions,
    147    ) -> impl std::future::Future<
    148        Output = crate::Result<gax::response::Response<crate::model::Subscription>>,
    149    > + Send {
    150        gaxi::unimplemented::unimplemented_stub()
    151    }
    152
    153    /// Implements [super::client::SubscriptionAdmin::get_subscription].
    154    fn get_subscription(
    155        &self,
    156        _req: crate::model::GetSubscriptionRequest,
    157        _options: gax::options::RequestOptions,
    158    ) -> impl std::future::Future<
    159        Output = crate::Result<gax::response::Response<crate::model::Subscription>>,
    160    > + Send {
    161        gaxi::unimplemented::unimplemented_stub()
    162    }
    163
    164    /// Implements [super::client::SubscriptionAdmin::update_subscription].
    165    fn update_subscription(
    166        &self,
    167        _req: crate::model::UpdateSubscriptionRequest,
    168        _options: gax::options::RequestOptions,
    169    ) -> impl std::future::Future<
    170        Output = crate::Result<gax::response::Response<crate::model::Subscription>>,
    171    > + Send {
    172        gaxi::unimplemented::unimplemented_stub()
    173    }
    174
    175    /// Implements [super::client::SubscriptionAdmin::list_subscriptions].
    176    fn list_subscriptions(
    177        &self,
    178        _req: crate::model::ListSubscriptionsRequest,
    179        _options: gax::options::RequestOptions,
    180    ) -> impl std::future::Future<
    181        Output = crate::Result<gax::response::Response<crate::model::ListSubscriptionsResponse>>,
    182    > + Send {
    183        gaxi::unimplemented::unimplemented_stub()
    184    }
    185
    186    /// Implements [super::client::SubscriptionAdmin::delete_subscription].
    187    fn delete_subscription(
    188        &self,
    189        _req: crate::model::DeleteSubscriptionRequest,
    190        _options: gax::options::RequestOptions,
    191    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
    192        gaxi::unimplemented::unimplemented_stub()
    193    }
    194
    195    /// Implements [super::client::SubscriptionAdmin::modify_push_config].
    196    fn modify_push_config(
    197        &self,
    198        _req: crate::model::ModifyPushConfigRequest,
    199        _options: gax::options::RequestOptions,
    200    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
    201        gaxi::unimplemented::unimplemented_stub()
    202    }
    203
    204    /// Implements [super::client::SubscriptionAdmin::get_snapshot].
    205    fn get_snapshot(
    206        &self,
    207        _req: crate::model::GetSnapshotRequest,
    208        _options: gax::options::RequestOptions,
    209    ) -> impl std::future::Future<
    210        Output = crate::Result<gax::response::Response<crate::model::Snapshot>>,
    211    > + Send {
    212        gaxi::unimplemented::unimplemented_stub()
    213    }
    214
    215    /// Implements [super::client::SubscriptionAdmin::list_snapshots].
    216    fn list_snapshots(
    217        &self,
    218        _req: crate::model::ListSnapshotsRequest,
    219        _options: gax::options::RequestOptions,
    220    ) -> impl std::future::Future<
    221        Output = crate::Result<gax::response::Response<crate::model::ListSnapshotsResponse>>,
    222    > + Send {
    223        gaxi::unimplemented::unimplemented_stub()
    224    }
    225
    226    /// Implements [super::client::SubscriptionAdmin::create_snapshot].
    227    fn create_snapshot(
    228        &self,
    229        _req: crate::model::CreateSnapshotRequest,
    230        _options: gax::options::RequestOptions,
    231    ) -> impl std::future::Future<
    232        Output = crate::Result<gax::response::Response<crate::model::Snapshot>>,
    233    > + Send {
    234        gaxi::unimplemented::unimplemented_stub()
    235    }
    236
    237    /// Implements [super::client::SubscriptionAdmin::update_snapshot].
    238    fn update_snapshot(
    239        &self,
    240        _req: crate::model::UpdateSnapshotRequest,
    241        _options: gax::options::RequestOptions,
    242    ) -> impl std::future::Future<
    243        Output = crate::Result<gax::response::Response<crate::model::Snapshot>>,
    244    > + Send {
    245        gaxi::unimplemented::unimplemented_stub()
    246    }
    247
    248    /// Implements [super::client::SubscriptionAdmin::delete_snapshot].
    249    fn delete_snapshot(
    250        &self,
    251        _req: crate::model::DeleteSnapshotRequest,
    252        _options: gax::options::RequestOptions,
    253    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
    254        gaxi::unimplemented::unimplemented_stub()
    255    }
    256
    257    /// Implements [super::client::SubscriptionAdmin::seek].
    258    fn seek(
    259        &self,
    260        _req: crate::model::SeekRequest,
    261        _options: gax::options::RequestOptions,
    262    ) -> impl std::future::Future<
    263        Output = crate::Result<gax::response::Response<crate::model::SeekResponse>>,
    264    > + Send {
    265        gaxi::unimplemented::unimplemented_stub()
    266    }
    267}
    268
    269/// Defines the trait used to implement [super::client::SchemaService].
    270///
    271/// Application developers may need to implement this trait to mock
    272/// `client::SchemaService`.  In other use-cases, application developers only
    273/// use `client::SchemaService` and need not be concerned with this trait or
    274/// its implementations.
    275///
    276/// Services gain new RPCs routinely. Consequently, this trait gains new methods
    277/// too. To avoid breaking applications the trait provides a default
    278/// implementation of each method. Most of these implementations just return an
    279/// error.
    280pub trait SchemaService: std::fmt::Debug + Send + Sync {
    281    /// Implements [super::client::SchemaService::create_schema].
    282    fn create_schema(
    283        &self,
    284        _req: crate::model::CreateSchemaRequest,
    285        _options: gax::options::RequestOptions,
    286    ) -> impl std::future::Future<
    287        Output = crate::Result<gax::response::Response<crate::model::Schema>>,
    288    > + Send {
    289        gaxi::unimplemented::unimplemented_stub()
    290    }
    291
    292    /// Implements [super::client::SchemaService::get_schema].
    293    fn get_schema(
    294        &self,
    295        _req: crate::model::GetSchemaRequest,
    296        _options: gax::options::RequestOptions,
    297    ) -> impl std::future::Future<
    298        Output = crate::Result<gax::response::Response<crate::model::Schema>>,
    299    > + Send {
    300        gaxi::unimplemented::unimplemented_stub()
    301    }
    302
    303    /// Implements [super::client::SchemaService::list_schemas].
    304    fn list_schemas(
    305        &self,
    306        _req: crate::model::ListSchemasRequest,
    307        _options: gax::options::RequestOptions,
    308    ) -> impl std::future::Future<
    309        Output = crate::Result<gax::response::Response<crate::model::ListSchemasResponse>>,
    310    > + Send {
    311        gaxi::unimplemented::unimplemented_stub()
    312    }
    313
    314    /// Implements [super::client::SchemaService::list_schema_revisions].
    315    fn list_schema_revisions(
    316        &self,
    317        _req: crate::model::ListSchemaRevisionsRequest,
    318        _options: gax::options::RequestOptions,
    319    ) -> impl std::future::Future<
    320        Output = crate::Result<gax::response::Response<crate::model::ListSchemaRevisionsResponse>>,
    321    > + Send {
    322        gaxi::unimplemented::unimplemented_stub()
    323    }
    324
    325    /// Implements [super::client::SchemaService::commit_schema].
    326    fn commit_schema(
    327        &self,
    328        _req: crate::model::CommitSchemaRequest,
    329        _options: gax::options::RequestOptions,
    330    ) -> impl std::future::Future<
    331        Output = crate::Result<gax::response::Response<crate::model::Schema>>,
    332    > + Send {
    333        gaxi::unimplemented::unimplemented_stub()
    334    }
    335
    336    /// Implements [super::client::SchemaService::rollback_schema].
    337    fn rollback_schema(
    338        &self,
    339        _req: crate::model::RollbackSchemaRequest,
    340        _options: gax::options::RequestOptions,
    341    ) -> impl std::future::Future<
    342        Output = crate::Result<gax::response::Response<crate::model::Schema>>,
    343    > + Send {
    344        gaxi::unimplemented::unimplemented_stub()
    345    }
    346
    347    /// Implements [super::client::SchemaService::delete_schema_revision].
    348    fn delete_schema_revision(
    349        &self,
    350        _req: crate::model::DeleteSchemaRevisionRequest,
    351        _options: gax::options::RequestOptions,
    352    ) -> impl std::future::Future<
    353        Output = crate::Result<gax::response::Response<crate::model::Schema>>,
    354    > + Send {
    355        gaxi::unimplemented::unimplemented_stub()
    356    }
    357
    358    /// Implements [super::client::SchemaService::delete_schema].
    359    fn delete_schema(
    360        &self,
    361        _req: crate::model::DeleteSchemaRequest,
    362        _options: gax::options::RequestOptions,
    363    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
    364        gaxi::unimplemented::unimplemented_stub()
    365    }
    366
    367    /// Implements [super::client::SchemaService::validate_schema].
    368    fn validate_schema(
    369        &self,
    370        _req: crate::model::ValidateSchemaRequest,
    371        _options: gax::options::RequestOptions,
    372    ) -> impl std::future::Future<
    373        Output = crate::Result<gax::response::Response<crate::model::ValidateSchemaResponse>>,
    374    > + Send {
    375        gaxi::unimplemented::unimplemented_stub()
    376    }
    377
    378    /// Implements [super::client::SchemaService::validate_message].
    379    fn validate_message(
    380        &self,
    381        _req: crate::model::ValidateMessageRequest,
    382        _options: gax::options::RequestOptions,
    383    ) -> impl std::future::Future<
    384        Output = crate::Result<gax::response::Response<crate::model::ValidateMessageResponse>>,
    385    > + Send {
    386        gaxi::unimplemented::unimplemented_stub()
    387    }
    388
    389    /// Implements [super::client::SchemaService::set_iam_policy].
    390    fn set_iam_policy(
    391        &self,
    392        _req: iam_v1::model::SetIamPolicyRequest,
    393        _options: gax::options::RequestOptions,
    394    ) -> impl std::future::Future<
    395        Output = crate::Result<gax::response::Response<iam_v1::model::Policy>>,
    396    > + Send {
    397        gaxi::unimplemented::unimplemented_stub()
    398    }
    399
    400    /// Implements [super::client::SchemaService::get_iam_policy].
    401    fn get_iam_policy(
    402        &self,
    403        _req: iam_v1::model::GetIamPolicyRequest,
    404        _options: gax::options::RequestOptions,
    405    ) -> impl std::future::Future<
    406        Output = crate::Result<gax::response::Response<iam_v1::model::Policy>>,
    407    > + Send {
    408        gaxi::unimplemented::unimplemented_stub()
    409    }
    410
    411    /// Implements [super::client::SchemaService::test_iam_permissions].
    412    fn test_iam_permissions(
    413        &self,
    414        _req: iam_v1::model::TestIamPermissionsRequest,
    415        _options: gax::options::RequestOptions,
    416    ) -> impl std::future::Future<
    417        Output = crate::Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>>,
    418    > + Send {
    419        gaxi::unimplemented::unimplemented_stub()
    420    }
    421}