google_cloud_tasks_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
27use gax::error::Error;
28
29pub(crate) mod dynamic;
30
31/// Defines the trait used to implement [super::client::CloudTasks].
32///
33/// Application developers may need to implement this trait to mock
34/// `client::CloudTasks`.  In other use-cases, application developers only
35/// use `client::CloudTasks` and need not be concerned with this trait or
36/// its implementations.
37///
38/// Services gain new RPCs routinely. Consequently, this trait gains new methods
39/// too. To avoid breaking applications the trait provides a default
40/// implementation of each method. Most of these implementations just return an
41/// error.
42pub trait CloudTasks: std::fmt::Debug + Send + Sync {
43    /// Implements [super::client::CloudTasks::list_queues].
44    fn list_queues(
45        &self,
46        _req: crate::model::ListQueuesRequest,
47        _options: gax::options::RequestOptions,
48    ) -> impl std::future::Future<
49        Output = crate::Result<gax::response::Response<crate::model::ListQueuesResponse>>,
50    > + Send {
51        std::future::ready::<crate::Result<gax::response::Response<crate::model::ListQueuesResponse>>>(
52            Err(Error::other("unimplemented")),
53        )
54    }
55
56    /// Implements [super::client::CloudTasks::get_queue].
57    fn get_queue(
58        &self,
59        _req: crate::model::GetQueueRequest,
60        _options: gax::options::RequestOptions,
61    ) -> impl std::future::Future<
62        Output = crate::Result<gax::response::Response<crate::model::Queue>>,
63    > + Send {
64        std::future::ready::<crate::Result<gax::response::Response<crate::model::Queue>>>(Err(
65            Error::other("unimplemented"),
66        ))
67    }
68
69    /// Implements [super::client::CloudTasks::create_queue].
70    fn create_queue(
71        &self,
72        _req: crate::model::CreateQueueRequest,
73        _options: gax::options::RequestOptions,
74    ) -> impl std::future::Future<
75        Output = crate::Result<gax::response::Response<crate::model::Queue>>,
76    > + Send {
77        std::future::ready::<crate::Result<gax::response::Response<crate::model::Queue>>>(Err(
78            Error::other("unimplemented"),
79        ))
80    }
81
82    /// Implements [super::client::CloudTasks::update_queue].
83    fn update_queue(
84        &self,
85        _req: crate::model::UpdateQueueRequest,
86        _options: gax::options::RequestOptions,
87    ) -> impl std::future::Future<
88        Output = crate::Result<gax::response::Response<crate::model::Queue>>,
89    > + Send {
90        std::future::ready::<crate::Result<gax::response::Response<crate::model::Queue>>>(Err(
91            Error::other("unimplemented"),
92        ))
93    }
94
95    /// Implements [super::client::CloudTasks::delete_queue].
96    fn delete_queue(
97        &self,
98        _req: crate::model::DeleteQueueRequest,
99        _options: gax::options::RequestOptions,
100    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
101        std::future::ready::<crate::Result<gax::response::Response<()>>>(Err(Error::other(
102            "unimplemented",
103        )))
104    }
105
106    /// Implements [super::client::CloudTasks::purge_queue].
107    fn purge_queue(
108        &self,
109        _req: crate::model::PurgeQueueRequest,
110        _options: gax::options::RequestOptions,
111    ) -> impl std::future::Future<
112        Output = crate::Result<gax::response::Response<crate::model::Queue>>,
113    > + Send {
114        std::future::ready::<crate::Result<gax::response::Response<crate::model::Queue>>>(Err(
115            Error::other("unimplemented"),
116        ))
117    }
118
119    /// Implements [super::client::CloudTasks::pause_queue].
120    fn pause_queue(
121        &self,
122        _req: crate::model::PauseQueueRequest,
123        _options: gax::options::RequestOptions,
124    ) -> impl std::future::Future<
125        Output = crate::Result<gax::response::Response<crate::model::Queue>>,
126    > + Send {
127        std::future::ready::<crate::Result<gax::response::Response<crate::model::Queue>>>(Err(
128            Error::other("unimplemented"),
129        ))
130    }
131
132    /// Implements [super::client::CloudTasks::resume_queue].
133    fn resume_queue(
134        &self,
135        _req: crate::model::ResumeQueueRequest,
136        _options: gax::options::RequestOptions,
137    ) -> impl std::future::Future<
138        Output = crate::Result<gax::response::Response<crate::model::Queue>>,
139    > + Send {
140        std::future::ready::<crate::Result<gax::response::Response<crate::model::Queue>>>(Err(
141            Error::other("unimplemented"),
142        ))
143    }
144
145    /// Implements [super::client::CloudTasks::get_iam_policy].
146    fn get_iam_policy(
147        &self,
148        _req: iam_v1::model::GetIamPolicyRequest,
149        _options: gax::options::RequestOptions,
150    ) -> impl std::future::Future<
151        Output = crate::Result<gax::response::Response<iam_v1::model::Policy>>,
152    > + Send {
153        std::future::ready::<crate::Result<gax::response::Response<iam_v1::model::Policy>>>(Err(
154            Error::other("unimplemented"),
155        ))
156    }
157
158    /// Implements [super::client::CloudTasks::set_iam_policy].
159    fn set_iam_policy(
160        &self,
161        _req: iam_v1::model::SetIamPolicyRequest,
162        _options: gax::options::RequestOptions,
163    ) -> impl std::future::Future<
164        Output = crate::Result<gax::response::Response<iam_v1::model::Policy>>,
165    > + Send {
166        std::future::ready::<crate::Result<gax::response::Response<iam_v1::model::Policy>>>(Err(
167            Error::other("unimplemented"),
168        ))
169    }
170
171    /// Implements [super::client::CloudTasks::test_iam_permissions].
172    fn test_iam_permissions(
173        &self,
174        _req: iam_v1::model::TestIamPermissionsRequest,
175        _options: gax::options::RequestOptions,
176    ) -> impl std::future::Future<
177        Output = crate::Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>>,
178    > + Send {
179        std::future::ready::<
180            crate::Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>>,
181        >(Err(Error::other("unimplemented")))
182    }
183
184    /// Implements [super::client::CloudTasks::list_tasks].
185    fn list_tasks(
186        &self,
187        _req: crate::model::ListTasksRequest,
188        _options: gax::options::RequestOptions,
189    ) -> impl std::future::Future<
190        Output = crate::Result<gax::response::Response<crate::model::ListTasksResponse>>,
191    > + Send {
192        std::future::ready::<crate::Result<gax::response::Response<crate::model::ListTasksResponse>>>(
193            Err(Error::other("unimplemented")),
194        )
195    }
196
197    /// Implements [super::client::CloudTasks::get_task].
198    fn get_task(
199        &self,
200        _req: crate::model::GetTaskRequest,
201        _options: gax::options::RequestOptions,
202    ) -> impl std::future::Future<
203        Output = crate::Result<gax::response::Response<crate::model::Task>>,
204    > + Send {
205        std::future::ready::<crate::Result<gax::response::Response<crate::model::Task>>>(Err(
206            Error::other("unimplemented"),
207        ))
208    }
209
210    /// Implements [super::client::CloudTasks::create_task].
211    fn create_task(
212        &self,
213        _req: crate::model::CreateTaskRequest,
214        _options: gax::options::RequestOptions,
215    ) -> impl std::future::Future<
216        Output = crate::Result<gax::response::Response<crate::model::Task>>,
217    > + Send {
218        std::future::ready::<crate::Result<gax::response::Response<crate::model::Task>>>(Err(
219            Error::other("unimplemented"),
220        ))
221    }
222
223    /// Implements [super::client::CloudTasks::delete_task].
224    fn delete_task(
225        &self,
226        _req: crate::model::DeleteTaskRequest,
227        _options: gax::options::RequestOptions,
228    ) -> impl std::future::Future<Output = crate::Result<gax::response::Response<()>>> + Send {
229        std::future::ready::<crate::Result<gax::response::Response<()>>>(Err(Error::other(
230            "unimplemented",
231        )))
232    }
233
234    /// Implements [super::client::CloudTasks::run_task].
235    fn run_task(
236        &self,
237        _req: crate::model::RunTaskRequest,
238        _options: gax::options::RequestOptions,
239    ) -> impl std::future::Future<
240        Output = crate::Result<gax::response::Response<crate::model::Task>>,
241    > + Send {
242        std::future::ready::<crate::Result<gax::response::Response<crate::model::Task>>>(Err(
243            Error::other("unimplemented"),
244        ))
245    }
246
247    /// Implements [super::client::CloudTasks::list_locations].
248    fn list_locations(
249        &self,
250        _req: location::model::ListLocationsRequest,
251        _options: gax::options::RequestOptions,
252    ) -> impl std::future::Future<
253        Output = crate::Result<gax::response::Response<location::model::ListLocationsResponse>>,
254    > + Send {
255        std::future::ready::<
256            crate::Result<gax::response::Response<location::model::ListLocationsResponse>>,
257        >(Err(Error::other("unimplemented")))
258    }
259
260    /// Implements [super::client::CloudTasks::get_location].
261    fn get_location(
262        &self,
263        _req: location::model::GetLocationRequest,
264        _options: gax::options::RequestOptions,
265    ) -> impl std::future::Future<
266        Output = crate::Result<gax::response::Response<location::model::Location>>,
267    > + Send {
268        std::future::ready::<crate::Result<gax::response::Response<location::model::Location>>>(
269            Err(Error::other("unimplemented")),
270        )
271    }
272}