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