google_cloud_memcache_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::CloudMemcache].
33///
34/// Application developers may need to implement this trait to mock
35/// `client::CloudMemcache`.  In other use-cases, application developers only
36/// use `client::CloudMemcache` 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 CloudMemcache: std::fmt::Debug + Send + Sync {
44    /// Implements [crate::client::CloudMemcache::list_instances].
45    fn list_instances(
46        &self,
47        _req: crate::model::ListInstancesRequest,
48        _options: gax::options::RequestOptions,
49    ) -> impl std::future::Future<Output = crate::Result<crate::model::ListInstancesResponse>> + Send
50    {
51        std::future::ready::<crate::Result<crate::model::ListInstancesResponse>>(Err(Error::other(
52            "unimplemented",
53        )))
54    }
55
56    /// Implements [crate::client::CloudMemcache::get_instance].
57    fn get_instance(
58        &self,
59        _req: crate::model::GetInstanceRequest,
60        _options: gax::options::RequestOptions,
61    ) -> impl std::future::Future<Output = crate::Result<crate::model::Instance>> + Send {
62        std::future::ready::<crate::Result<crate::model::Instance>>(Err(Error::other(
63            "unimplemented",
64        )))
65    }
66
67    /// Implements [crate::client::CloudMemcache::create_instance].
68    fn create_instance(
69        &self,
70        _req: crate::model::CreateInstanceRequest,
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::CloudMemcache::update_instance].
80    fn update_instance(
81        &self,
82        _req: crate::model::UpdateInstanceRequest,
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::CloudMemcache::update_parameters].
92    fn update_parameters(
93        &self,
94        _req: crate::model::UpdateParametersRequest,
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::CloudMemcache::delete_instance].
104    fn delete_instance(
105        &self,
106        _req: crate::model::DeleteInstanceRequest,
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::CloudMemcache::apply_parameters].
116    fn apply_parameters(
117        &self,
118        _req: crate::model::ApplyParametersRequest,
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::CloudMemcache::reschedule_maintenance].
128    fn reschedule_maintenance(
129        &self,
130        _req: crate::model::RescheduleMaintenanceRequest,
131        _options: gax::options::RequestOptions,
132    ) -> impl std::future::Future<Output = crate::Result<longrunning::model::Operation>> + Send
133    {
134        std::future::ready::<crate::Result<longrunning::model::Operation>>(Err(Error::other(
135            "unimplemented",
136        )))
137    }
138
139    /// Implements [crate::client::CloudMemcache::list_locations].
140    fn list_locations(
141        &self,
142        _req: location::model::ListLocationsRequest,
143        _options: gax::options::RequestOptions,
144    ) -> impl std::future::Future<Output = crate::Result<location::model::ListLocationsResponse>> + Send
145    {
146        std::future::ready::<crate::Result<location::model::ListLocationsResponse>>(Err(
147            Error::other("unimplemented"),
148        ))
149    }
150
151    /// Implements [crate::client::CloudMemcache::get_location].
152    fn get_location(
153        &self,
154        _req: location::model::GetLocationRequest,
155        _options: gax::options::RequestOptions,
156    ) -> impl std::future::Future<Output = crate::Result<location::model::Location>> + Send {
157        std::future::ready::<crate::Result<location::model::Location>>(Err(Error::other(
158            "unimplemented",
159        )))
160    }
161
162    /// Implements [crate::client::CloudMemcache::list_operations].
163    fn list_operations(
164        &self,
165        _req: longrunning::model::ListOperationsRequest,
166        _options: gax::options::RequestOptions,
167    ) -> impl std::future::Future<Output = crate::Result<longrunning::model::ListOperationsResponse>>
168           + Send {
169        std::future::ready::<crate::Result<longrunning::model::ListOperationsResponse>>(Err(
170            Error::other("unimplemented"),
171        ))
172    }
173
174    /// Implements [crate::client::CloudMemcache::get_operation].
175    fn get_operation(
176        &self,
177        _req: longrunning::model::GetOperationRequest,
178        _options: gax::options::RequestOptions,
179    ) -> impl std::future::Future<Output = crate::Result<longrunning::model::Operation>> + Send
180    {
181        std::future::ready::<crate::Result<longrunning::model::Operation>>(Err(Error::other(
182            "unimplemented",
183        )))
184    }
185
186    /// Implements [crate::client::CloudMemcache::delete_operation].
187    fn delete_operation(
188        &self,
189        _req: longrunning::model::DeleteOperationRequest,
190        _options: gax::options::RequestOptions,
191    ) -> impl std::future::Future<Output = crate::Result<wkt::Empty>> + Send {
192        std::future::ready::<crate::Result<wkt::Empty>>(Err(Error::other("unimplemented")))
193    }
194
195    /// Implements [crate::client::CloudMemcache::cancel_operation].
196    fn cancel_operation(
197        &self,
198        _req: longrunning::model::CancelOperationRequest,
199        _options: gax::options::RequestOptions,
200    ) -> impl std::future::Future<Output = crate::Result<wkt::Empty>> + Send {
201        std::future::ready::<crate::Result<wkt::Empty>>(Err(Error::other("unimplemented")))
202    }
203
204    /// Returns the polling policy.
205    ///
206    /// When mocking, this method is typically irrelevant. Do not try to verify
207    /// it is called by your mocks.
208    fn get_polling_policy(
209        &self,
210        _options: &gax::options::RequestOptions,
211    ) -> Arc<dyn gax::polling_policy::PollingPolicy> {
212        Arc::new(gax::polling_policy::Aip194Strict)
213    }
214
215    /// Returns the polling backoff policy.
216    ///
217    /// When mocking, this method is typically irrelevant. Do not try to verify
218    /// it is called by your mocks.
219    fn get_polling_backoff_policy(
220        &self,
221        _options: &gax::options::RequestOptions,
222    ) -> Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
223        Arc::new(gax::exponential_backoff::ExponentialBackoff::default())
224    }
225}