google_cloud_datastream_v1/
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
27use gax::error::Error;
28use std::sync::Arc;
29
30pub(crate) mod dynamic;
31
32/// Defines the trait used to implement [super::client::Datastream].
33///
34/// Application developers may need to implement this trait to mock
35/// `client::Datastream`.  In other use-cases, application developers only
36/// use `client::Datastream` and need not be concerned with this trait or
37/// its implementations.
38///
39/// Services gain new RPCs routinely. Consequently, this trait gains new methods
40/// too. To avoid breaking applications the trait provides a default
41/// implementation of each method. Most of these implementations just return an
42/// error.
43pub trait Datastream: std::fmt::Debug + Send + Sync {
44    /// Implements [super::client::Datastream::list_connection_profiles].
45    fn list_connection_profiles(
46        &self,
47        _req: crate::model::ListConnectionProfilesRequest,
48        _options: gax::options::RequestOptions,
49    ) -> impl std::future::Future<
50        Output = crate::Result<
51            gax::response::Response<crate::model::ListConnectionProfilesResponse>,
52        >,
53    > + Send {
54        std::future::ready::<
55            crate::Result<gax::response::Response<crate::model::ListConnectionProfilesResponse>>,
56        >(Err(Error::other("unimplemented")))
57    }
58
59    /// Implements [super::client::Datastream::get_connection_profile].
60    fn get_connection_profile(
61        &self,
62        _req: crate::model::GetConnectionProfileRequest,
63        _options: gax::options::RequestOptions,
64    ) -> impl std::future::Future<
65        Output = crate::Result<gax::response::Response<crate::model::ConnectionProfile>>,
66    > + Send {
67        std::future::ready::<crate::Result<gax::response::Response<crate::model::ConnectionProfile>>>(
68            Err(Error::other("unimplemented")),
69        )
70    }
71
72    /// Implements [super::client::Datastream::create_connection_profile].
73    fn create_connection_profile(
74        &self,
75        _req: crate::model::CreateConnectionProfileRequest,
76        _options: gax::options::RequestOptions,
77    ) -> impl std::future::Future<
78        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
79    > + Send {
80        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
81            Err(Error::other("unimplemented")),
82        )
83    }
84
85    /// Implements [super::client::Datastream::update_connection_profile].
86    fn update_connection_profile(
87        &self,
88        _req: crate::model::UpdateConnectionProfileRequest,
89        _options: gax::options::RequestOptions,
90    ) -> impl std::future::Future<
91        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
92    > + Send {
93        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
94            Err(Error::other("unimplemented")),
95        )
96    }
97
98    /// Implements [super::client::Datastream::delete_connection_profile].
99    fn delete_connection_profile(
100        &self,
101        _req: crate::model::DeleteConnectionProfileRequest,
102        _options: gax::options::RequestOptions,
103    ) -> impl std::future::Future<
104        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
105    > + Send {
106        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
107            Err(Error::other("unimplemented")),
108        )
109    }
110
111    /// Implements [super::client::Datastream::discover_connection_profile].
112    fn discover_connection_profile(
113        &self,
114        _req: crate::model::DiscoverConnectionProfileRequest,
115        _options: gax::options::RequestOptions,
116    ) -> impl std::future::Future<
117        Output = crate::Result<
118            gax::response::Response<crate::model::DiscoverConnectionProfileResponse>,
119        >,
120    > + Send {
121        std::future::ready::<
122            crate::Result<gax::response::Response<crate::model::DiscoverConnectionProfileResponse>>,
123        >(Err(Error::other("unimplemented")))
124    }
125
126    /// Implements [super::client::Datastream::list_streams].
127    fn list_streams(
128        &self,
129        _req: crate::model::ListStreamsRequest,
130        _options: gax::options::RequestOptions,
131    ) -> impl std::future::Future<
132        Output = crate::Result<gax::response::Response<crate::model::ListStreamsResponse>>,
133    > + Send {
134        std::future::ready::<
135            crate::Result<gax::response::Response<crate::model::ListStreamsResponse>>,
136        >(Err(Error::other("unimplemented")))
137    }
138
139    /// Implements [super::client::Datastream::get_stream].
140    fn get_stream(
141        &self,
142        _req: crate::model::GetStreamRequest,
143        _options: gax::options::RequestOptions,
144    ) -> impl std::future::Future<
145        Output = crate::Result<gax::response::Response<crate::model::Stream>>,
146    > + Send {
147        std::future::ready::<crate::Result<gax::response::Response<crate::model::Stream>>>(Err(
148            Error::other("unimplemented"),
149        ))
150    }
151
152    /// Implements [super::client::Datastream::create_stream].
153    fn create_stream(
154        &self,
155        _req: crate::model::CreateStreamRequest,
156        _options: gax::options::RequestOptions,
157    ) -> impl std::future::Future<
158        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
159    > + Send {
160        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
161            Err(Error::other("unimplemented")),
162        )
163    }
164
165    /// Implements [super::client::Datastream::update_stream].
166    fn update_stream(
167        &self,
168        _req: crate::model::UpdateStreamRequest,
169        _options: gax::options::RequestOptions,
170    ) -> impl std::future::Future<
171        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
172    > + Send {
173        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
174            Err(Error::other("unimplemented")),
175        )
176    }
177
178    /// Implements [super::client::Datastream::delete_stream].
179    fn delete_stream(
180        &self,
181        _req: crate::model::DeleteStreamRequest,
182        _options: gax::options::RequestOptions,
183    ) -> impl std::future::Future<
184        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
185    > + Send {
186        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
187            Err(Error::other("unimplemented")),
188        )
189    }
190
191    /// Implements [super::client::Datastream::run_stream].
192    fn run_stream(
193        &self,
194        _req: crate::model::RunStreamRequest,
195        _options: gax::options::RequestOptions,
196    ) -> impl std::future::Future<
197        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
198    > + Send {
199        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
200            Err(Error::other("unimplemented")),
201        )
202    }
203
204    /// Implements [super::client::Datastream::get_stream_object].
205    fn get_stream_object(
206        &self,
207        _req: crate::model::GetStreamObjectRequest,
208        _options: gax::options::RequestOptions,
209    ) -> impl std::future::Future<
210        Output = crate::Result<gax::response::Response<crate::model::StreamObject>>,
211    > + Send {
212        std::future::ready::<crate::Result<gax::response::Response<crate::model::StreamObject>>>(
213            Err(Error::other("unimplemented")),
214        )
215    }
216
217    /// Implements [super::client::Datastream::lookup_stream_object].
218    fn lookup_stream_object(
219        &self,
220        _req: crate::model::LookupStreamObjectRequest,
221        _options: gax::options::RequestOptions,
222    ) -> impl std::future::Future<
223        Output = crate::Result<gax::response::Response<crate::model::StreamObject>>,
224    > + Send {
225        std::future::ready::<crate::Result<gax::response::Response<crate::model::StreamObject>>>(
226            Err(Error::other("unimplemented")),
227        )
228    }
229
230    /// Implements [super::client::Datastream::list_stream_objects].
231    fn list_stream_objects(
232        &self,
233        _req: crate::model::ListStreamObjectsRequest,
234        _options: gax::options::RequestOptions,
235    ) -> impl std::future::Future<
236        Output = crate::Result<gax::response::Response<crate::model::ListStreamObjectsResponse>>,
237    > + Send {
238        std::future::ready::<
239            crate::Result<gax::response::Response<crate::model::ListStreamObjectsResponse>>,
240        >(Err(Error::other("unimplemented")))
241    }
242
243    /// Implements [super::client::Datastream::start_backfill_job].
244    fn start_backfill_job(
245        &self,
246        _req: crate::model::StartBackfillJobRequest,
247        _options: gax::options::RequestOptions,
248    ) -> impl std::future::Future<
249        Output = crate::Result<gax::response::Response<crate::model::StartBackfillJobResponse>>,
250    > + Send {
251        std::future::ready::<
252            crate::Result<gax::response::Response<crate::model::StartBackfillJobResponse>>,
253        >(Err(Error::other("unimplemented")))
254    }
255
256    /// Implements [super::client::Datastream::stop_backfill_job].
257    fn stop_backfill_job(
258        &self,
259        _req: crate::model::StopBackfillJobRequest,
260        _options: gax::options::RequestOptions,
261    ) -> impl std::future::Future<
262        Output = crate::Result<gax::response::Response<crate::model::StopBackfillJobResponse>>,
263    > + Send {
264        std::future::ready::<
265            crate::Result<gax::response::Response<crate::model::StopBackfillJobResponse>>,
266        >(Err(Error::other("unimplemented")))
267    }
268
269    /// Implements [super::client::Datastream::fetch_static_ips].
270    fn fetch_static_ips(
271        &self,
272        _req: crate::model::FetchStaticIpsRequest,
273        _options: gax::options::RequestOptions,
274    ) -> impl std::future::Future<
275        Output = crate::Result<gax::response::Response<crate::model::FetchStaticIpsResponse>>,
276    > + Send {
277        std::future::ready::<
278            crate::Result<gax::response::Response<crate::model::FetchStaticIpsResponse>>,
279        >(Err(Error::other("unimplemented")))
280    }
281
282    /// Implements [super::client::Datastream::create_private_connection].
283    fn create_private_connection(
284        &self,
285        _req: crate::model::CreatePrivateConnectionRequest,
286        _options: gax::options::RequestOptions,
287    ) -> impl std::future::Future<
288        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
289    > + Send {
290        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
291            Err(Error::other("unimplemented")),
292        )
293    }
294
295    /// Implements [super::client::Datastream::get_private_connection].
296    fn get_private_connection(
297        &self,
298        _req: crate::model::GetPrivateConnectionRequest,
299        _options: gax::options::RequestOptions,
300    ) -> impl std::future::Future<
301        Output = crate::Result<gax::response::Response<crate::model::PrivateConnection>>,
302    > + Send {
303        std::future::ready::<crate::Result<gax::response::Response<crate::model::PrivateConnection>>>(
304            Err(Error::other("unimplemented")),
305        )
306    }
307
308    /// Implements [super::client::Datastream::list_private_connections].
309    fn list_private_connections(
310        &self,
311        _req: crate::model::ListPrivateConnectionsRequest,
312        _options: gax::options::RequestOptions,
313    ) -> impl std::future::Future<
314        Output = crate::Result<
315            gax::response::Response<crate::model::ListPrivateConnectionsResponse>,
316        >,
317    > + Send {
318        std::future::ready::<
319            crate::Result<gax::response::Response<crate::model::ListPrivateConnectionsResponse>>,
320        >(Err(Error::other("unimplemented")))
321    }
322
323    /// Implements [super::client::Datastream::delete_private_connection].
324    fn delete_private_connection(
325        &self,
326        _req: crate::model::DeletePrivateConnectionRequest,
327        _options: gax::options::RequestOptions,
328    ) -> impl std::future::Future<
329        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
330    > + Send {
331        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
332            Err(Error::other("unimplemented")),
333        )
334    }
335
336    /// Implements [super::client::Datastream::create_route].
337    fn create_route(
338        &self,
339        _req: crate::model::CreateRouteRequest,
340        _options: gax::options::RequestOptions,
341    ) -> impl std::future::Future<
342        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
343    > + Send {
344        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
345            Err(Error::other("unimplemented")),
346        )
347    }
348
349    /// Implements [super::client::Datastream::get_route].
350    fn get_route(
351        &self,
352        _req: crate::model::GetRouteRequest,
353        _options: gax::options::RequestOptions,
354    ) -> impl std::future::Future<
355        Output = crate::Result<gax::response::Response<crate::model::Route>>,
356    > + Send {
357        std::future::ready::<crate::Result<gax::response::Response<crate::model::Route>>>(Err(
358            Error::other("unimplemented"),
359        ))
360    }
361
362    /// Implements [super::client::Datastream::list_routes].
363    fn list_routes(
364        &self,
365        _req: crate::model::ListRoutesRequest,
366        _options: gax::options::RequestOptions,
367    ) -> impl std::future::Future<
368        Output = crate::Result<gax::response::Response<crate::model::ListRoutesResponse>>,
369    > + Send {
370        std::future::ready::<crate::Result<gax::response::Response<crate::model::ListRoutesResponse>>>(
371            Err(Error::other("unimplemented")),
372        )
373    }
374
375    /// Implements [super::client::Datastream::delete_route].
376    fn delete_route(
377        &self,
378        _req: crate::model::DeleteRouteRequest,
379        _options: gax::options::RequestOptions,
380    ) -> impl std::future::Future<
381        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
382    > + Send {
383        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
384            Err(Error::other("unimplemented")),
385        )
386    }
387
388    /// Implements [super::client::Datastream::list_locations].
389    fn list_locations(
390        &self,
391        _req: location::model::ListLocationsRequest,
392        _options: gax::options::RequestOptions,
393    ) -> impl std::future::Future<
394        Output = crate::Result<gax::response::Response<location::model::ListLocationsResponse>>,
395    > + Send {
396        std::future::ready::<
397            crate::Result<gax::response::Response<location::model::ListLocationsResponse>>,
398        >(Err(Error::other("unimplemented")))
399    }
400
401    /// Implements [super::client::Datastream::get_location].
402    fn get_location(
403        &self,
404        _req: location::model::GetLocationRequest,
405        _options: gax::options::RequestOptions,
406    ) -> impl std::future::Future<
407        Output = crate::Result<gax::response::Response<location::model::Location>>,
408    > + Send {
409        std::future::ready::<crate::Result<gax::response::Response<location::model::Location>>>(
410            Err(Error::other("unimplemented")),
411        )
412    }
413
414    /// Implements [super::client::Datastream::list_operations].
415    fn list_operations(
416        &self,
417        _req: longrunning::model::ListOperationsRequest,
418        _options: gax::options::RequestOptions,
419    ) -> impl std::future::Future<
420        Output = crate::Result<gax::response::Response<longrunning::model::ListOperationsResponse>>,
421    > + Send {
422        std::future::ready::<
423            crate::Result<gax::response::Response<longrunning::model::ListOperationsResponse>>,
424        >(Err(Error::other("unimplemented")))
425    }
426
427    /// Implements [super::client::Datastream::get_operation].
428    fn get_operation(
429        &self,
430        _req: longrunning::model::GetOperationRequest,
431        _options: gax::options::RequestOptions,
432    ) -> impl std::future::Future<
433        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
434    > + Send {
435        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
436            Err(Error::other("unimplemented")),
437        )
438    }
439
440    /// Implements [super::client::Datastream::delete_operation].
441    fn delete_operation(
442        &self,
443        _req: longrunning::model::DeleteOperationRequest,
444        _options: gax::options::RequestOptions,
445    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
446        std::future::ready::<crate::Result<gax::response::Response<()>>>(Err(Error::other(
447            "unimplemented",
448        )))
449    }
450
451    /// Implements [super::client::Datastream::cancel_operation].
452    fn cancel_operation(
453        &self,
454        _req: longrunning::model::CancelOperationRequest,
455        _options: gax::options::RequestOptions,
456    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
457        std::future::ready::<crate::Result<gax::response::Response<()>>>(Err(Error::other(
458            "unimplemented",
459        )))
460    }
461
462    /// Returns the polling error policy.
463    ///
464    /// When mocking, this method is typically irrelevant. Do not try to verify
465    /// it is called by your mocks.
466    fn get_polling_error_policy(
467        &self,
468        _options: &gax::options::RequestOptions,
469    ) -> Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
470        Arc::new(gax::polling_error_policy::Aip194Strict)
471    }
472
473    /// Returns the polling backoff policy.
474    ///
475    /// When mocking, this method is typically irrelevant. Do not try to verify
476    /// it is called by your mocks.
477    fn get_polling_backoff_policy(
478        &self,
479        _options: &gax::options::RequestOptions,
480    ) -> Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
481        Arc::new(gax::exponential_backoff::ExponentialBackoff::default())
482    }
483}