google_cloud_developerconnect_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::DeveloperConnect].
33///
34/// Application developers may need to implement this trait to mock
35/// `client::DeveloperConnect`.  In other use-cases, application developers only
36/// use `client::DeveloperConnect` 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 DeveloperConnect: std::fmt::Debug + Send + Sync {
44    /// Implements [super::client::DeveloperConnect::list_connections].
45    fn list_connections(
46        &self,
47        _req: crate::model::ListConnectionsRequest,
48        _options: gax::options::RequestOptions,
49    ) -> impl std::future::Future<
50        Output = crate::Result<gax::response::Response<crate::model::ListConnectionsResponse>>,
51    > + Send {
52        std::future::ready::<
53            crate::Result<gax::response::Response<crate::model::ListConnectionsResponse>>,
54        >(Err(Error::other("unimplemented")))
55    }
56
57    /// Implements [super::client::DeveloperConnect::get_connection].
58    fn get_connection(
59        &self,
60        _req: crate::model::GetConnectionRequest,
61        _options: gax::options::RequestOptions,
62    ) -> impl std::future::Future<
63        Output = crate::Result<gax::response::Response<crate::model::Connection>>,
64    > + Send {
65        std::future::ready::<crate::Result<gax::response::Response<crate::model::Connection>>>(Err(
66            Error::other("unimplemented"),
67        ))
68    }
69
70    /// Implements [super::client::DeveloperConnect::create_connection].
71    fn create_connection(
72        &self,
73        _req: crate::model::CreateConnectionRequest,
74        _options: gax::options::RequestOptions,
75    ) -> impl std::future::Future<
76        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
77    > + Send {
78        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
79            Err(Error::other("unimplemented")),
80        )
81    }
82
83    /// Implements [super::client::DeveloperConnect::update_connection].
84    fn update_connection(
85        &self,
86        _req: crate::model::UpdateConnectionRequest,
87        _options: gax::options::RequestOptions,
88    ) -> impl std::future::Future<
89        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
90    > + Send {
91        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
92            Err(Error::other("unimplemented")),
93        )
94    }
95
96    /// Implements [super::client::DeveloperConnect::delete_connection].
97    fn delete_connection(
98        &self,
99        _req: crate::model::DeleteConnectionRequest,
100        _options: gax::options::RequestOptions,
101    ) -> impl std::future::Future<
102        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
103    > + Send {
104        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
105            Err(Error::other("unimplemented")),
106        )
107    }
108
109    /// Implements [super::client::DeveloperConnect::create_git_repository_link].
110    fn create_git_repository_link(
111        &self,
112        _req: crate::model::CreateGitRepositoryLinkRequest,
113        _options: gax::options::RequestOptions,
114    ) -> impl std::future::Future<
115        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
116    > + Send {
117        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
118            Err(Error::other("unimplemented")),
119        )
120    }
121
122    /// Implements [super::client::DeveloperConnect::delete_git_repository_link].
123    fn delete_git_repository_link(
124        &self,
125        _req: crate::model::DeleteGitRepositoryLinkRequest,
126        _options: gax::options::RequestOptions,
127    ) -> impl std::future::Future<
128        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
129    > + Send {
130        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
131            Err(Error::other("unimplemented")),
132        )
133    }
134
135    /// Implements [super::client::DeveloperConnect::list_git_repository_links].
136    fn list_git_repository_links(
137        &self,
138        _req: crate::model::ListGitRepositoryLinksRequest,
139        _options: gax::options::RequestOptions,
140    ) -> impl std::future::Future<
141        Output = crate::Result<
142            gax::response::Response<crate::model::ListGitRepositoryLinksResponse>,
143        >,
144    > + Send {
145        std::future::ready::<
146            crate::Result<gax::response::Response<crate::model::ListGitRepositoryLinksResponse>>,
147        >(Err(Error::other("unimplemented")))
148    }
149
150    /// Implements [super::client::DeveloperConnect::get_git_repository_link].
151    fn get_git_repository_link(
152        &self,
153        _req: crate::model::GetGitRepositoryLinkRequest,
154        _options: gax::options::RequestOptions,
155    ) -> impl std::future::Future<
156        Output = crate::Result<gax::response::Response<crate::model::GitRepositoryLink>>,
157    > + Send {
158        std::future::ready::<crate::Result<gax::response::Response<crate::model::GitRepositoryLink>>>(
159            Err(Error::other("unimplemented")),
160        )
161    }
162
163    /// Implements [super::client::DeveloperConnect::fetch_read_write_token].
164    fn fetch_read_write_token(
165        &self,
166        _req: crate::model::FetchReadWriteTokenRequest,
167        _options: gax::options::RequestOptions,
168    ) -> impl std::future::Future<
169        Output = crate::Result<gax::response::Response<crate::model::FetchReadWriteTokenResponse>>,
170    > + Send {
171        std::future::ready::<
172            crate::Result<gax::response::Response<crate::model::FetchReadWriteTokenResponse>>,
173        >(Err(Error::other("unimplemented")))
174    }
175
176    /// Implements [super::client::DeveloperConnect::fetch_read_token].
177    fn fetch_read_token(
178        &self,
179        _req: crate::model::FetchReadTokenRequest,
180        _options: gax::options::RequestOptions,
181    ) -> impl std::future::Future<
182        Output = crate::Result<gax::response::Response<crate::model::FetchReadTokenResponse>>,
183    > + Send {
184        std::future::ready::<
185            crate::Result<gax::response::Response<crate::model::FetchReadTokenResponse>>,
186        >(Err(Error::other("unimplemented")))
187    }
188
189    /// Implements [super::client::DeveloperConnect::fetch_linkable_git_repositories].
190    fn fetch_linkable_git_repositories(
191        &self,
192        _req: crate::model::FetchLinkableGitRepositoriesRequest,
193        _options: gax::options::RequestOptions,
194    ) -> impl std::future::Future<
195        Output = crate::Result<
196            gax::response::Response<crate::model::FetchLinkableGitRepositoriesResponse>,
197        >,
198    > + Send {
199        std::future::ready::<
200            crate::Result<
201                gax::response::Response<crate::model::FetchLinkableGitRepositoriesResponse>,
202            >,
203        >(Err(Error::other("unimplemented")))
204    }
205
206    /// Implements [super::client::DeveloperConnect::fetch_git_hub_installations].
207    fn fetch_git_hub_installations(
208        &self,
209        _req: crate::model::FetchGitHubInstallationsRequest,
210        _options: gax::options::RequestOptions,
211    ) -> impl std::future::Future<
212        Output = crate::Result<
213            gax::response::Response<crate::model::FetchGitHubInstallationsResponse>,
214        >,
215    > + Send {
216        std::future::ready::<
217            crate::Result<gax::response::Response<crate::model::FetchGitHubInstallationsResponse>>,
218        >(Err(Error::other("unimplemented")))
219    }
220
221    /// Implements [super::client::DeveloperConnect::fetch_git_refs].
222    fn fetch_git_refs(
223        &self,
224        _req: crate::model::FetchGitRefsRequest,
225        _options: gax::options::RequestOptions,
226    ) -> impl std::future::Future<
227        Output = crate::Result<gax::response::Response<crate::model::FetchGitRefsResponse>>,
228    > + Send {
229        std::future::ready::<
230            crate::Result<gax::response::Response<crate::model::FetchGitRefsResponse>>,
231        >(Err(Error::other("unimplemented")))
232    }
233
234    /// Implements [super::client::DeveloperConnect::list_locations].
235    fn list_locations(
236        &self,
237        _req: location::model::ListLocationsRequest,
238        _options: gax::options::RequestOptions,
239    ) -> impl std::future::Future<
240        Output = crate::Result<gax::response::Response<location::model::ListLocationsResponse>>,
241    > + Send {
242        std::future::ready::<
243            crate::Result<gax::response::Response<location::model::ListLocationsResponse>>,
244        >(Err(Error::other("unimplemented")))
245    }
246
247    /// Implements [super::client::DeveloperConnect::get_location].
248    fn get_location(
249        &self,
250        _req: location::model::GetLocationRequest,
251        _options: gax::options::RequestOptions,
252    ) -> impl std::future::Future<
253        Output = crate::Result<gax::response::Response<location::model::Location>>,
254    > + Send {
255        std::future::ready::<crate::Result<gax::response::Response<location::model::Location>>>(
256            Err(Error::other("unimplemented")),
257        )
258    }
259
260    /// Implements [super::client::DeveloperConnect::list_operations].
261    fn list_operations(
262        &self,
263        _req: longrunning::model::ListOperationsRequest,
264        _options: gax::options::RequestOptions,
265    ) -> impl std::future::Future<
266        Output = crate::Result<gax::response::Response<longrunning::model::ListOperationsResponse>>,
267    > + Send {
268        std::future::ready::<
269            crate::Result<gax::response::Response<longrunning::model::ListOperationsResponse>>,
270        >(Err(Error::other("unimplemented")))
271    }
272
273    /// Implements [super::client::DeveloperConnect::get_operation].
274    fn get_operation(
275        &self,
276        _req: longrunning::model::GetOperationRequest,
277        _options: gax::options::RequestOptions,
278    ) -> impl std::future::Future<
279        Output = crate::Result<gax::response::Response<longrunning::model::Operation>>,
280    > + Send {
281        std::future::ready::<crate::Result<gax::response::Response<longrunning::model::Operation>>>(
282            Err(Error::other("unimplemented")),
283        )
284    }
285
286    /// Implements [super::client::DeveloperConnect::delete_operation].
287    fn delete_operation(
288        &self,
289        _req: longrunning::model::DeleteOperationRequest,
290        _options: gax::options::RequestOptions,
291    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
292        std::future::ready::<crate::Result<gax::response::Response<()>>>(Err(Error::other(
293            "unimplemented",
294        )))
295    }
296
297    /// Implements [super::client::DeveloperConnect::cancel_operation].
298    fn cancel_operation(
299        &self,
300        _req: longrunning::model::CancelOperationRequest,
301        _options: gax::options::RequestOptions,
302    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
303        std::future::ready::<crate::Result<gax::response::Response<()>>>(Err(Error::other(
304            "unimplemented",
305        )))
306    }
307
308    /// Returns the polling error policy.
309    ///
310    /// When mocking, this method is typically irrelevant. Do not try to verify
311    /// it is called by your mocks.
312    fn get_polling_error_policy(
313        &self,
314        _options: &gax::options::RequestOptions,
315    ) -> Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
316        Arc::new(gax::polling_error_policy::Aip194Strict)
317    }
318
319    /// Returns the polling backoff policy.
320    ///
321    /// When mocking, this method is typically irrelevant. Do not try to verify
322    /// it is called by your mocks.
323    fn get_polling_backoff_policy(
324        &self,
325        _options: &gax::options::RequestOptions,
326    ) -> Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
327        Arc::new(gax::exponential_backoff::ExponentialBackoff::default())
328    }
329}