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