Skip to main content

google_cloud_build_v2/
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::RepositoryManager].
30///
31/// Application developers may need to implement this trait to mock
32/// `client::RepositoryManager`.  In other use-cases, application developers only
33/// use `client::RepositoryManager` 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 RepositoryManager: std::fmt::Debug + Send + Sync {
41    /// Implements [super::client::RepositoryManager::create_connection].
42    fn create_connection(
43        &self,
44        _req: crate::model::CreateConnectionRequest,
45        _options: crate::RequestOptions,
46    ) -> impl std::future::Future<
47        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
48    > + Send {
49        gaxi::unimplemented::unimplemented_stub()
50    }
51
52    /// Implements [super::client::RepositoryManager::get_connection].
53    fn get_connection(
54        &self,
55        _req: crate::model::GetConnectionRequest,
56        _options: crate::RequestOptions,
57    ) -> impl std::future::Future<Output = crate::Result<crate::Response<crate::model::Connection>>> + Send
58    {
59        gaxi::unimplemented::unimplemented_stub()
60    }
61
62    /// Implements [super::client::RepositoryManager::list_connections].
63    fn list_connections(
64        &self,
65        _req: crate::model::ListConnectionsRequest,
66        _options: crate::RequestOptions,
67    ) -> impl std::future::Future<
68        Output = crate::Result<crate::Response<crate::model::ListConnectionsResponse>>,
69    > + Send {
70        gaxi::unimplemented::unimplemented_stub()
71    }
72
73    /// Implements [super::client::RepositoryManager::update_connection].
74    fn update_connection(
75        &self,
76        _req: crate::model::UpdateConnectionRequest,
77        _options: crate::RequestOptions,
78    ) -> impl std::future::Future<
79        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
80    > + Send {
81        gaxi::unimplemented::unimplemented_stub()
82    }
83
84    /// Implements [super::client::RepositoryManager::delete_connection].
85    fn delete_connection(
86        &self,
87        _req: crate::model::DeleteConnectionRequest,
88        _options: crate::RequestOptions,
89    ) -> impl std::future::Future<
90        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
91    > + Send {
92        gaxi::unimplemented::unimplemented_stub()
93    }
94
95    /// Implements [super::client::RepositoryManager::create_repository].
96    fn create_repository(
97        &self,
98        _req: crate::model::CreateRepositoryRequest,
99        _options: crate::RequestOptions,
100    ) -> impl std::future::Future<
101        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
102    > + Send {
103        gaxi::unimplemented::unimplemented_stub()
104    }
105
106    /// Implements [super::client::RepositoryManager::batch_create_repositories].
107    fn batch_create_repositories(
108        &self,
109        _req: crate::model::BatchCreateRepositoriesRequest,
110        _options: crate::RequestOptions,
111    ) -> impl std::future::Future<
112        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
113    > + Send {
114        gaxi::unimplemented::unimplemented_stub()
115    }
116
117    /// Implements [super::client::RepositoryManager::get_repository].
118    fn get_repository(
119        &self,
120        _req: crate::model::GetRepositoryRequest,
121        _options: crate::RequestOptions,
122    ) -> impl std::future::Future<Output = crate::Result<crate::Response<crate::model::Repository>>> + Send
123    {
124        gaxi::unimplemented::unimplemented_stub()
125    }
126
127    /// Implements [super::client::RepositoryManager::list_repositories].
128    fn list_repositories(
129        &self,
130        _req: crate::model::ListRepositoriesRequest,
131        _options: crate::RequestOptions,
132    ) -> impl std::future::Future<
133        Output = crate::Result<crate::Response<crate::model::ListRepositoriesResponse>>,
134    > + Send {
135        gaxi::unimplemented::unimplemented_stub()
136    }
137
138    /// Implements [super::client::RepositoryManager::delete_repository].
139    fn delete_repository(
140        &self,
141        _req: crate::model::DeleteRepositoryRequest,
142        _options: crate::RequestOptions,
143    ) -> impl std::future::Future<
144        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
145    > + Send {
146        gaxi::unimplemented::unimplemented_stub()
147    }
148
149    /// Implements [super::client::RepositoryManager::fetch_read_write_token].
150    fn fetch_read_write_token(
151        &self,
152        _req: crate::model::FetchReadWriteTokenRequest,
153        _options: crate::RequestOptions,
154    ) -> impl std::future::Future<
155        Output = crate::Result<crate::Response<crate::model::FetchReadWriteTokenResponse>>,
156    > + Send {
157        gaxi::unimplemented::unimplemented_stub()
158    }
159
160    /// Implements [super::client::RepositoryManager::fetch_read_token].
161    fn fetch_read_token(
162        &self,
163        _req: crate::model::FetchReadTokenRequest,
164        _options: crate::RequestOptions,
165    ) -> impl std::future::Future<
166        Output = crate::Result<crate::Response<crate::model::FetchReadTokenResponse>>,
167    > + Send {
168        gaxi::unimplemented::unimplemented_stub()
169    }
170
171    /// Implements [super::client::RepositoryManager::fetch_linkable_repositories].
172    fn fetch_linkable_repositories(
173        &self,
174        _req: crate::model::FetchLinkableRepositoriesRequest,
175        _options: crate::RequestOptions,
176    ) -> impl std::future::Future<
177        Output = crate::Result<crate::Response<crate::model::FetchLinkableRepositoriesResponse>>,
178    > + Send {
179        gaxi::unimplemented::unimplemented_stub()
180    }
181
182    /// Implements [super::client::RepositoryManager::fetch_git_refs].
183    fn fetch_git_refs(
184        &self,
185        _req: crate::model::FetchGitRefsRequest,
186        _options: crate::RequestOptions,
187    ) -> impl std::future::Future<
188        Output = crate::Result<crate::Response<crate::model::FetchGitRefsResponse>>,
189    > + Send {
190        gaxi::unimplemented::unimplemented_stub()
191    }
192
193    /// Implements [super::client::RepositoryManager::set_iam_policy].
194    fn set_iam_policy(
195        &self,
196        _req: google_cloud_iam_v1::model::SetIamPolicyRequest,
197        _options: crate::RequestOptions,
198    ) -> impl std::future::Future<
199        Output = crate::Result<crate::Response<google_cloud_iam_v1::model::Policy>>,
200    > + Send {
201        gaxi::unimplemented::unimplemented_stub()
202    }
203
204    /// Implements [super::client::RepositoryManager::get_iam_policy].
205    fn get_iam_policy(
206        &self,
207        _req: google_cloud_iam_v1::model::GetIamPolicyRequest,
208        _options: crate::RequestOptions,
209    ) -> impl std::future::Future<
210        Output = crate::Result<crate::Response<google_cloud_iam_v1::model::Policy>>,
211    > + Send {
212        gaxi::unimplemented::unimplemented_stub()
213    }
214
215    /// Implements [super::client::RepositoryManager::test_iam_permissions].
216    fn test_iam_permissions(
217        &self,
218        _req: google_cloud_iam_v1::model::TestIamPermissionsRequest,
219        _options: crate::RequestOptions,
220    ) -> impl std::future::Future<
221        Output = crate::Result<
222            crate::Response<google_cloud_iam_v1::model::TestIamPermissionsResponse>,
223        >,
224    > + Send {
225        gaxi::unimplemented::unimplemented_stub()
226    }
227
228    /// Implements [super::client::RepositoryManager::get_operation].
229    fn get_operation(
230        &self,
231        _req: google_cloud_longrunning::model::GetOperationRequest,
232        _options: crate::RequestOptions,
233    ) -> impl std::future::Future<
234        Output = crate::Result<crate::Response<google_cloud_longrunning::model::Operation>>,
235    > + Send {
236        gaxi::unimplemented::unimplemented_stub()
237    }
238
239    /// Implements [super::client::RepositoryManager::cancel_operation].
240    fn cancel_operation(
241        &self,
242        _req: google_cloud_longrunning::model::CancelOperationRequest,
243        _options: crate::RequestOptions,
244    ) -> impl std::future::Future<Output = crate::Result<crate::Response<()>>> + Send {
245        gaxi::unimplemented::unimplemented_stub()
246    }
247
248    /// Returns the polling error policy.
249    ///
250    /// When mocking, this method is typically irrelevant. Do not try to verify
251    /// it is called by your mocks.
252    fn get_polling_error_policy(
253        &self,
254        _options: &crate::RequestOptions,
255    ) -> std::sync::Arc<dyn google_cloud_gax::polling_error_policy::PollingErrorPolicy> {
256        std::sync::Arc::new(google_cloud_gax::polling_error_policy::Aip194Strict)
257    }
258
259    /// Returns the polling backoff policy.
260    ///
261    /// When mocking, this method is typically irrelevant. Do not try to verify
262    /// it is called by your mocks.
263    fn get_polling_backoff_policy(
264        &self,
265        _options: &crate::RequestOptions,
266    ) -> std::sync::Arc<dyn google_cloud_gax::polling_backoff_policy::PollingBackoffPolicy> {
267        std::sync::Arc::new(google_cloud_gax::exponential_backoff::ExponentialBackoff::default())
268    }
269
270    #[doc(hidden)]
271    /// Returns the poller options.
272    ///
273    /// When mocking, this method is typically irrelevant. Do not try to verify
274    /// it is called by your mocks.
275    fn get_poller_options(
276        &self,
277        _options: &crate::RequestOptions,
278    ) -> google_cloud_lro::PollerOptions {
279        google_cloud_lro::PollerOptions::default()
280    }
281}