Skip to main content

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