google_cloud_memcache_v1/
builder.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
17pub mod cloud_memcache {
18    use crate::Result;
19
20    /// A builder for [CloudMemcache][crate::client::CloudMemcache].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_memcache_v1::*;
25    /// # use builder::cloud_memcache::ClientBuilder;
26    /// # use client::CloudMemcache;
27    /// let builder : ClientBuilder = CloudMemcache::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://memcache.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::CloudMemcache;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = CloudMemcache;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::CloudMemcache] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [CloudMemcache::list_instances][crate::client::CloudMemcache::list_instances] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_memcache_v1::builder;
79    /// use builder::cloud_memcache::ListInstances;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListInstances {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
97
98    impl ListInstances {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
107            self.0.request = v.into();
108            self
109        }
110
111        /// Sets all the options, replacing any prior values.
112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113            self.0.options = v.into();
114            self
115        }
116
117        /// Sends the request.
118        pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
119            (*self.0.stub)
120                .list_instances(self.0.request, self.0.options)
121                .await
122                .map(gax::response::Response::into_body)
123        }
124
125        /// Streams each page in the collection.
126        pub fn by_page(
127            self,
128        ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
129        {
130            use std::clone::Clone;
131            let token = self.0.request.page_token.clone();
132            let execute = move |token: String| {
133                let mut builder = self.clone();
134                builder.0.request = builder.0.request.set_page_token(token);
135                builder.send()
136            };
137            gax::paginator::internal::new_paginator(token, execute)
138        }
139
140        /// Streams each item in the collection.
141        pub fn by_item(
142            self,
143        ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
144        {
145            use gax::paginator::Paginator;
146            self.by_page().items()
147        }
148
149        /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
150        ///
151        /// This is a **required** field for requests.
152        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153            self.0.request.parent = v.into();
154            self
155        }
156
157        /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
158        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159            self.0.request.page_size = v.into();
160            self
161        }
162
163        /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
164        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165            self.0.request.page_token = v.into();
166            self
167        }
168
169        /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
170        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171            self.0.request.filter = v.into();
172            self
173        }
174
175        /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
176        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177            self.0.request.order_by = v.into();
178            self
179        }
180    }
181
182    #[doc(hidden)]
183    impl gax::options::internal::RequestBuilder for ListInstances {
184        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
185            &mut self.0.options
186        }
187    }
188
189    /// The request builder for [CloudMemcache::get_instance][crate::client::CloudMemcache::get_instance] calls.
190    ///
191    /// # Example
192    /// ```no_run
193    /// # use google_cloud_memcache_v1::builder;
194    /// use builder::cloud_memcache::GetInstance;
195    /// # tokio_test::block_on(async {
196    ///
197    /// let builder = prepare_request_builder();
198    /// let response = builder.send().await?;
199    /// # gax::Result::<()>::Ok(()) });
200    ///
201    /// fn prepare_request_builder() -> GetInstance {
202    ///   # panic!();
203    ///   // ... details omitted ...
204    /// }
205    /// ```
206    #[derive(Clone, Debug)]
207    pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
208
209    impl GetInstance {
210        pub(crate) fn new(
211            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
212        ) -> Self {
213            Self(RequestBuilder::new(stub))
214        }
215
216        /// Sets the full request, replacing any prior values.
217        pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
218            self.0.request = v.into();
219            self
220        }
221
222        /// Sets all the options, replacing any prior values.
223        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
224            self.0.options = v.into();
225            self
226        }
227
228        /// Sends the request.
229        pub async fn send(self) -> Result<crate::model::Instance> {
230            (*self.0.stub)
231                .get_instance(self.0.request, self.0.options)
232                .await
233                .map(gax::response::Response::into_body)
234        }
235
236        /// Sets the value of [name][crate::model::GetInstanceRequest::name].
237        ///
238        /// This is a **required** field for requests.
239        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240            self.0.request.name = v.into();
241            self
242        }
243    }
244
245    #[doc(hidden)]
246    impl gax::options::internal::RequestBuilder for GetInstance {
247        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
248            &mut self.0.options
249        }
250    }
251
252    /// The request builder for [CloudMemcache::create_instance][crate::client::CloudMemcache::create_instance] calls.
253    ///
254    /// # Example
255    /// ```no_run
256    /// # use google_cloud_memcache_v1::builder;
257    /// use builder::cloud_memcache::CreateInstance;
258    /// # tokio_test::block_on(async {
259    /// use lro::Poller;
260    ///
261    /// let builder = prepare_request_builder();
262    /// let response = builder.poller().until_done().await?;
263    /// # gax::Result::<()>::Ok(()) });
264    ///
265    /// fn prepare_request_builder() -> CreateInstance {
266    ///   # panic!();
267    ///   // ... details omitted ...
268    /// }
269    /// ```
270    #[derive(Clone, Debug)]
271    pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
272
273    impl CreateInstance {
274        pub(crate) fn new(
275            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
276        ) -> Self {
277            Self(RequestBuilder::new(stub))
278        }
279
280        /// Sets the full request, replacing any prior values.
281        pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
282            self.0.request = v.into();
283            self
284        }
285
286        /// Sets all the options, replacing any prior values.
287        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
288            self.0.options = v.into();
289            self
290        }
291
292        /// Sends the request.
293        ///
294        /// # Long running operations
295        ///
296        /// This starts, but does not poll, a longrunning operation. More information
297        /// on [create_instance][crate::client::CloudMemcache::create_instance].
298        pub async fn send(self) -> Result<longrunning::model::Operation> {
299            (*self.0.stub)
300                .create_instance(self.0.request, self.0.options)
301                .await
302                .map(gax::response::Response::into_body)
303        }
304
305        /// Creates a [Poller][lro::Poller] to work with `create_instance`.
306        pub fn poller(
307            self,
308        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
309            type Operation =
310                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
311            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
312            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
313
314            let stub = self.0.stub.clone();
315            let mut options = self.0.options.clone();
316            options.set_retry_policy(gax::retry_policy::NeverRetry);
317            let query = move |name| {
318                let stub = stub.clone();
319                let options = options.clone();
320                async {
321                    let op = GetOperation::new(stub)
322                        .set_name(name)
323                        .with_options(options)
324                        .send()
325                        .await?;
326                    Ok(Operation::new(op))
327                }
328            };
329
330            let start = move || async {
331                let op = self.send().await?;
332                Ok(Operation::new(op))
333            };
334
335            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
336        }
337
338        /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
339        ///
340        /// This is a **required** field for requests.
341        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
342            self.0.request.parent = v.into();
343            self
344        }
345
346        /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
347        ///
348        /// This is a **required** field for requests.
349        pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
350            self.0.request.instance_id = v.into();
351            self
352        }
353
354        /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
355        ///
356        /// This is a **required** field for requests.
357        pub fn set_instance<T>(mut self, v: T) -> Self
358        where
359            T: std::convert::Into<crate::model::Instance>,
360        {
361            self.0.request.instance = std::option::Option::Some(v.into());
362            self
363        }
364
365        /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
366        ///
367        /// This is a **required** field for requests.
368        pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
369        where
370            T: std::convert::Into<crate::model::Instance>,
371        {
372            self.0.request.instance = v.map(|x| x.into());
373            self
374        }
375    }
376
377    #[doc(hidden)]
378    impl gax::options::internal::RequestBuilder for CreateInstance {
379        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
380            &mut self.0.options
381        }
382    }
383
384    /// The request builder for [CloudMemcache::update_instance][crate::client::CloudMemcache::update_instance] calls.
385    ///
386    /// # Example
387    /// ```no_run
388    /// # use google_cloud_memcache_v1::builder;
389    /// use builder::cloud_memcache::UpdateInstance;
390    /// # tokio_test::block_on(async {
391    /// use lro::Poller;
392    ///
393    /// let builder = prepare_request_builder();
394    /// let response = builder.poller().until_done().await?;
395    /// # gax::Result::<()>::Ok(()) });
396    ///
397    /// fn prepare_request_builder() -> UpdateInstance {
398    ///   # panic!();
399    ///   // ... details omitted ...
400    /// }
401    /// ```
402    #[derive(Clone, Debug)]
403    pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
404
405    impl UpdateInstance {
406        pub(crate) fn new(
407            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
408        ) -> Self {
409            Self(RequestBuilder::new(stub))
410        }
411
412        /// Sets the full request, replacing any prior values.
413        pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
414            self.0.request = v.into();
415            self
416        }
417
418        /// Sets all the options, replacing any prior values.
419        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
420            self.0.options = v.into();
421            self
422        }
423
424        /// Sends the request.
425        ///
426        /// # Long running operations
427        ///
428        /// This starts, but does not poll, a longrunning operation. More information
429        /// on [update_instance][crate::client::CloudMemcache::update_instance].
430        pub async fn send(self) -> Result<longrunning::model::Operation> {
431            (*self.0.stub)
432                .update_instance(self.0.request, self.0.options)
433                .await
434                .map(gax::response::Response::into_body)
435        }
436
437        /// Creates a [Poller][lro::Poller] to work with `update_instance`.
438        pub fn poller(
439            self,
440        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
441            type Operation =
442                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
443            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
444            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
445
446            let stub = self.0.stub.clone();
447            let mut options = self.0.options.clone();
448            options.set_retry_policy(gax::retry_policy::NeverRetry);
449            let query = move |name| {
450                let stub = stub.clone();
451                let options = options.clone();
452                async {
453                    let op = GetOperation::new(stub)
454                        .set_name(name)
455                        .with_options(options)
456                        .send()
457                        .await?;
458                    Ok(Operation::new(op))
459                }
460            };
461
462            let start = move || async {
463                let op = self.send().await?;
464                Ok(Operation::new(op))
465            };
466
467            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
468        }
469
470        /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
471        ///
472        /// This is a **required** field for requests.
473        pub fn set_update_mask<T>(mut self, v: T) -> Self
474        where
475            T: std::convert::Into<wkt::FieldMask>,
476        {
477            self.0.request.update_mask = std::option::Option::Some(v.into());
478            self
479        }
480
481        /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
482        ///
483        /// This is a **required** field for requests.
484        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
485        where
486            T: std::convert::Into<wkt::FieldMask>,
487        {
488            self.0.request.update_mask = v.map(|x| x.into());
489            self
490        }
491
492        /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
493        ///
494        /// This is a **required** field for requests.
495        pub fn set_instance<T>(mut self, v: T) -> Self
496        where
497            T: std::convert::Into<crate::model::Instance>,
498        {
499            self.0.request.instance = std::option::Option::Some(v.into());
500            self
501        }
502
503        /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
504        ///
505        /// This is a **required** field for requests.
506        pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
507        where
508            T: std::convert::Into<crate::model::Instance>,
509        {
510            self.0.request.instance = v.map(|x| x.into());
511            self
512        }
513    }
514
515    #[doc(hidden)]
516    impl gax::options::internal::RequestBuilder for UpdateInstance {
517        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
518            &mut self.0.options
519        }
520    }
521
522    /// The request builder for [CloudMemcache::update_parameters][crate::client::CloudMemcache::update_parameters] calls.
523    ///
524    /// # Example
525    /// ```no_run
526    /// # use google_cloud_memcache_v1::builder;
527    /// use builder::cloud_memcache::UpdateParameters;
528    /// # tokio_test::block_on(async {
529    /// use lro::Poller;
530    ///
531    /// let builder = prepare_request_builder();
532    /// let response = builder.poller().until_done().await?;
533    /// # gax::Result::<()>::Ok(()) });
534    ///
535    /// fn prepare_request_builder() -> UpdateParameters {
536    ///   # panic!();
537    ///   // ... details omitted ...
538    /// }
539    /// ```
540    #[derive(Clone, Debug)]
541    pub struct UpdateParameters(RequestBuilder<crate::model::UpdateParametersRequest>);
542
543    impl UpdateParameters {
544        pub(crate) fn new(
545            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
546        ) -> Self {
547            Self(RequestBuilder::new(stub))
548        }
549
550        /// Sets the full request, replacing any prior values.
551        pub fn with_request<V: Into<crate::model::UpdateParametersRequest>>(
552            mut self,
553            v: V,
554        ) -> Self {
555            self.0.request = v.into();
556            self
557        }
558
559        /// Sets all the options, replacing any prior values.
560        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
561            self.0.options = v.into();
562            self
563        }
564
565        /// Sends the request.
566        ///
567        /// # Long running operations
568        ///
569        /// This starts, but does not poll, a longrunning operation. More information
570        /// on [update_parameters][crate::client::CloudMemcache::update_parameters].
571        pub async fn send(self) -> Result<longrunning::model::Operation> {
572            (*self.0.stub)
573                .update_parameters(self.0.request, self.0.options)
574                .await
575                .map(gax::response::Response::into_body)
576        }
577
578        /// Creates a [Poller][lro::Poller] to work with `update_parameters`.
579        pub fn poller(
580            self,
581        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
582            type Operation =
583                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
584            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
585            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
586
587            let stub = self.0.stub.clone();
588            let mut options = self.0.options.clone();
589            options.set_retry_policy(gax::retry_policy::NeverRetry);
590            let query = move |name| {
591                let stub = stub.clone();
592                let options = options.clone();
593                async {
594                    let op = GetOperation::new(stub)
595                        .set_name(name)
596                        .with_options(options)
597                        .send()
598                        .await?;
599                    Ok(Operation::new(op))
600                }
601            };
602
603            let start = move || async {
604                let op = self.send().await?;
605                Ok(Operation::new(op))
606            };
607
608            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
609        }
610
611        /// Sets the value of [name][crate::model::UpdateParametersRequest::name].
612        ///
613        /// This is a **required** field for requests.
614        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
615            self.0.request.name = v.into();
616            self
617        }
618
619        /// Sets the value of [update_mask][crate::model::UpdateParametersRequest::update_mask].
620        ///
621        /// This is a **required** field for requests.
622        pub fn set_update_mask<T>(mut self, v: T) -> Self
623        where
624            T: std::convert::Into<wkt::FieldMask>,
625        {
626            self.0.request.update_mask = std::option::Option::Some(v.into());
627            self
628        }
629
630        /// Sets or clears the value of [update_mask][crate::model::UpdateParametersRequest::update_mask].
631        ///
632        /// This is a **required** field for requests.
633        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
634        where
635            T: std::convert::Into<wkt::FieldMask>,
636        {
637            self.0.request.update_mask = v.map(|x| x.into());
638            self
639        }
640
641        /// Sets the value of [parameters][crate::model::UpdateParametersRequest::parameters].
642        pub fn set_parameters<T>(mut self, v: T) -> Self
643        where
644            T: std::convert::Into<crate::model::MemcacheParameters>,
645        {
646            self.0.request.parameters = std::option::Option::Some(v.into());
647            self
648        }
649
650        /// Sets or clears the value of [parameters][crate::model::UpdateParametersRequest::parameters].
651        pub fn set_or_clear_parameters<T>(mut self, v: std::option::Option<T>) -> Self
652        where
653            T: std::convert::Into<crate::model::MemcacheParameters>,
654        {
655            self.0.request.parameters = v.map(|x| x.into());
656            self
657        }
658    }
659
660    #[doc(hidden)]
661    impl gax::options::internal::RequestBuilder for UpdateParameters {
662        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
663            &mut self.0.options
664        }
665    }
666
667    /// The request builder for [CloudMemcache::delete_instance][crate::client::CloudMemcache::delete_instance] calls.
668    ///
669    /// # Example
670    /// ```no_run
671    /// # use google_cloud_memcache_v1::builder;
672    /// use builder::cloud_memcache::DeleteInstance;
673    /// # tokio_test::block_on(async {
674    /// use lro::Poller;
675    ///
676    /// let builder = prepare_request_builder();
677    /// let response = builder.poller().until_done().await?;
678    /// # gax::Result::<()>::Ok(()) });
679    ///
680    /// fn prepare_request_builder() -> DeleteInstance {
681    ///   # panic!();
682    ///   // ... details omitted ...
683    /// }
684    /// ```
685    #[derive(Clone, Debug)]
686    pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
687
688    impl DeleteInstance {
689        pub(crate) fn new(
690            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
691        ) -> Self {
692            Self(RequestBuilder::new(stub))
693        }
694
695        /// Sets the full request, replacing any prior values.
696        pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
697            self.0.request = v.into();
698            self
699        }
700
701        /// Sets all the options, replacing any prior values.
702        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
703            self.0.options = v.into();
704            self
705        }
706
707        /// Sends the request.
708        ///
709        /// # Long running operations
710        ///
711        /// This starts, but does not poll, a longrunning operation. More information
712        /// on [delete_instance][crate::client::CloudMemcache::delete_instance].
713        pub async fn send(self) -> Result<longrunning::model::Operation> {
714            (*self.0.stub)
715                .delete_instance(self.0.request, self.0.options)
716                .await
717                .map(gax::response::Response::into_body)
718        }
719
720        /// Creates a [Poller][lro::Poller] to work with `delete_instance`.
721        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
722            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
723            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
724            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
725
726            let stub = self.0.stub.clone();
727            let mut options = self.0.options.clone();
728            options.set_retry_policy(gax::retry_policy::NeverRetry);
729            let query = move |name| {
730                let stub = stub.clone();
731                let options = options.clone();
732                async {
733                    let op = GetOperation::new(stub)
734                        .set_name(name)
735                        .with_options(options)
736                        .send()
737                        .await?;
738                    Ok(Operation::new(op))
739                }
740            };
741
742            let start = move || async {
743                let op = self.send().await?;
744                Ok(Operation::new(op))
745            };
746
747            lro::internal::new_unit_response_poller(
748                polling_error_policy,
749                polling_backoff_policy,
750                start,
751                query,
752            )
753        }
754
755        /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
756        ///
757        /// This is a **required** field for requests.
758        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
759            self.0.request.name = v.into();
760            self
761        }
762    }
763
764    #[doc(hidden)]
765    impl gax::options::internal::RequestBuilder for DeleteInstance {
766        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
767            &mut self.0.options
768        }
769    }
770
771    /// The request builder for [CloudMemcache::apply_parameters][crate::client::CloudMemcache::apply_parameters] calls.
772    ///
773    /// # Example
774    /// ```no_run
775    /// # use google_cloud_memcache_v1::builder;
776    /// use builder::cloud_memcache::ApplyParameters;
777    /// # tokio_test::block_on(async {
778    /// use lro::Poller;
779    ///
780    /// let builder = prepare_request_builder();
781    /// let response = builder.poller().until_done().await?;
782    /// # gax::Result::<()>::Ok(()) });
783    ///
784    /// fn prepare_request_builder() -> ApplyParameters {
785    ///   # panic!();
786    ///   // ... details omitted ...
787    /// }
788    /// ```
789    #[derive(Clone, Debug)]
790    pub struct ApplyParameters(RequestBuilder<crate::model::ApplyParametersRequest>);
791
792    impl ApplyParameters {
793        pub(crate) fn new(
794            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
795        ) -> Self {
796            Self(RequestBuilder::new(stub))
797        }
798
799        /// Sets the full request, replacing any prior values.
800        pub fn with_request<V: Into<crate::model::ApplyParametersRequest>>(mut self, v: V) -> Self {
801            self.0.request = v.into();
802            self
803        }
804
805        /// Sets all the options, replacing any prior values.
806        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
807            self.0.options = v.into();
808            self
809        }
810
811        /// Sends the request.
812        ///
813        /// # Long running operations
814        ///
815        /// This starts, but does not poll, a longrunning operation. More information
816        /// on [apply_parameters][crate::client::CloudMemcache::apply_parameters].
817        pub async fn send(self) -> Result<longrunning::model::Operation> {
818            (*self.0.stub)
819                .apply_parameters(self.0.request, self.0.options)
820                .await
821                .map(gax::response::Response::into_body)
822        }
823
824        /// Creates a [Poller][lro::Poller] to work with `apply_parameters`.
825        pub fn poller(
826            self,
827        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
828            type Operation =
829                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
830            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
831            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
832
833            let stub = self.0.stub.clone();
834            let mut options = self.0.options.clone();
835            options.set_retry_policy(gax::retry_policy::NeverRetry);
836            let query = move |name| {
837                let stub = stub.clone();
838                let options = options.clone();
839                async {
840                    let op = GetOperation::new(stub)
841                        .set_name(name)
842                        .with_options(options)
843                        .send()
844                        .await?;
845                    Ok(Operation::new(op))
846                }
847            };
848
849            let start = move || async {
850                let op = self.send().await?;
851                Ok(Operation::new(op))
852            };
853
854            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
855        }
856
857        /// Sets the value of [name][crate::model::ApplyParametersRequest::name].
858        ///
859        /// This is a **required** field for requests.
860        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
861            self.0.request.name = v.into();
862            self
863        }
864
865        /// Sets the value of [node_ids][crate::model::ApplyParametersRequest::node_ids].
866        pub fn set_node_ids<T, V>(mut self, v: T) -> Self
867        where
868            T: std::iter::IntoIterator<Item = V>,
869            V: std::convert::Into<std::string::String>,
870        {
871            use std::iter::Iterator;
872            self.0.request.node_ids = v.into_iter().map(|i| i.into()).collect();
873            self
874        }
875
876        /// Sets the value of [apply_all][crate::model::ApplyParametersRequest::apply_all].
877        pub fn set_apply_all<T: Into<bool>>(mut self, v: T) -> Self {
878            self.0.request.apply_all = v.into();
879            self
880        }
881    }
882
883    #[doc(hidden)]
884    impl gax::options::internal::RequestBuilder for ApplyParameters {
885        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
886            &mut self.0.options
887        }
888    }
889
890    /// The request builder for [CloudMemcache::reschedule_maintenance][crate::client::CloudMemcache::reschedule_maintenance] calls.
891    ///
892    /// # Example
893    /// ```no_run
894    /// # use google_cloud_memcache_v1::builder;
895    /// use builder::cloud_memcache::RescheduleMaintenance;
896    /// # tokio_test::block_on(async {
897    /// use lro::Poller;
898    ///
899    /// let builder = prepare_request_builder();
900    /// let response = builder.poller().until_done().await?;
901    /// # gax::Result::<()>::Ok(()) });
902    ///
903    /// fn prepare_request_builder() -> RescheduleMaintenance {
904    ///   # panic!();
905    ///   // ... details omitted ...
906    /// }
907    /// ```
908    #[derive(Clone, Debug)]
909    pub struct RescheduleMaintenance(RequestBuilder<crate::model::RescheduleMaintenanceRequest>);
910
911    impl RescheduleMaintenance {
912        pub(crate) fn new(
913            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
914        ) -> Self {
915            Self(RequestBuilder::new(stub))
916        }
917
918        /// Sets the full request, replacing any prior values.
919        pub fn with_request<V: Into<crate::model::RescheduleMaintenanceRequest>>(
920            mut self,
921            v: V,
922        ) -> Self {
923            self.0.request = v.into();
924            self
925        }
926
927        /// Sets all the options, replacing any prior values.
928        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
929            self.0.options = v.into();
930            self
931        }
932
933        /// Sends the request.
934        ///
935        /// # Long running operations
936        ///
937        /// This starts, but does not poll, a longrunning operation. More information
938        /// on [reschedule_maintenance][crate::client::CloudMemcache::reschedule_maintenance].
939        pub async fn send(self) -> Result<longrunning::model::Operation> {
940            (*self.0.stub)
941                .reschedule_maintenance(self.0.request, self.0.options)
942                .await
943                .map(gax::response::Response::into_body)
944        }
945
946        /// Creates a [Poller][lro::Poller] to work with `reschedule_maintenance`.
947        pub fn poller(
948            self,
949        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
950            type Operation =
951                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
952            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
953            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
954
955            let stub = self.0.stub.clone();
956            let mut options = self.0.options.clone();
957            options.set_retry_policy(gax::retry_policy::NeverRetry);
958            let query = move |name| {
959                let stub = stub.clone();
960                let options = options.clone();
961                async {
962                    let op = GetOperation::new(stub)
963                        .set_name(name)
964                        .with_options(options)
965                        .send()
966                        .await?;
967                    Ok(Operation::new(op))
968                }
969            };
970
971            let start = move || async {
972                let op = self.send().await?;
973                Ok(Operation::new(op))
974            };
975
976            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
977        }
978
979        /// Sets the value of [instance][crate::model::RescheduleMaintenanceRequest::instance].
980        ///
981        /// This is a **required** field for requests.
982        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
983            self.0.request.instance = v.into();
984            self
985        }
986
987        /// Sets the value of [reschedule_type][crate::model::RescheduleMaintenanceRequest::reschedule_type].
988        ///
989        /// This is a **required** field for requests.
990        pub fn set_reschedule_type<
991            T: Into<crate::model::reschedule_maintenance_request::RescheduleType>,
992        >(
993            mut self,
994            v: T,
995        ) -> Self {
996            self.0.request.reschedule_type = v.into();
997            self
998        }
999
1000        /// Sets the value of [schedule_time][crate::model::RescheduleMaintenanceRequest::schedule_time].
1001        pub fn set_schedule_time<T>(mut self, v: T) -> Self
1002        where
1003            T: std::convert::Into<wkt::Timestamp>,
1004        {
1005            self.0.request.schedule_time = std::option::Option::Some(v.into());
1006            self
1007        }
1008
1009        /// Sets or clears the value of [schedule_time][crate::model::RescheduleMaintenanceRequest::schedule_time].
1010        pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
1011        where
1012            T: std::convert::Into<wkt::Timestamp>,
1013        {
1014            self.0.request.schedule_time = v.map(|x| x.into());
1015            self
1016        }
1017    }
1018
1019    #[doc(hidden)]
1020    impl gax::options::internal::RequestBuilder for RescheduleMaintenance {
1021        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1022            &mut self.0.options
1023        }
1024    }
1025
1026    /// The request builder for [CloudMemcache::list_locations][crate::client::CloudMemcache::list_locations] calls.
1027    ///
1028    /// # Example
1029    /// ```no_run
1030    /// # use google_cloud_memcache_v1::builder;
1031    /// use builder::cloud_memcache::ListLocations;
1032    /// # tokio_test::block_on(async {
1033    /// use gax::paginator::ItemPaginator;
1034    ///
1035    /// let builder = prepare_request_builder();
1036    /// let mut items = builder.by_item();
1037    /// while let Some(result) = items.next().await {
1038    ///   let item = result?;
1039    /// }
1040    /// # gax::Result::<()>::Ok(()) });
1041    ///
1042    /// fn prepare_request_builder() -> ListLocations {
1043    ///   # panic!();
1044    ///   // ... details omitted ...
1045    /// }
1046    /// ```
1047    #[derive(Clone, Debug)]
1048    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1049
1050    impl ListLocations {
1051        pub(crate) fn new(
1052            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
1053        ) -> Self {
1054            Self(RequestBuilder::new(stub))
1055        }
1056
1057        /// Sets the full request, replacing any prior values.
1058        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1059            mut self,
1060            v: V,
1061        ) -> Self {
1062            self.0.request = v.into();
1063            self
1064        }
1065
1066        /// Sets all the options, replacing any prior values.
1067        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1068            self.0.options = v.into();
1069            self
1070        }
1071
1072        /// Sends the request.
1073        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1074            (*self.0.stub)
1075                .list_locations(self.0.request, self.0.options)
1076                .await
1077                .map(gax::response::Response::into_body)
1078        }
1079
1080        /// Streams each page in the collection.
1081        pub fn by_page(
1082            self,
1083        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1084        {
1085            use std::clone::Clone;
1086            let token = self.0.request.page_token.clone();
1087            let execute = move |token: String| {
1088                let mut builder = self.clone();
1089                builder.0.request = builder.0.request.set_page_token(token);
1090                builder.send()
1091            };
1092            gax::paginator::internal::new_paginator(token, execute)
1093        }
1094
1095        /// Streams each item in the collection.
1096        pub fn by_item(
1097            self,
1098        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1099        {
1100            use gax::paginator::Paginator;
1101            self.by_page().items()
1102        }
1103
1104        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1105        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1106            self.0.request.name = v.into();
1107            self
1108        }
1109
1110        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1111        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1112            self.0.request.filter = v.into();
1113            self
1114        }
1115
1116        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1117        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1118            self.0.request.page_size = v.into();
1119            self
1120        }
1121
1122        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1123        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1124            self.0.request.page_token = v.into();
1125            self
1126        }
1127    }
1128
1129    #[doc(hidden)]
1130    impl gax::options::internal::RequestBuilder for ListLocations {
1131        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1132            &mut self.0.options
1133        }
1134    }
1135
1136    /// The request builder for [CloudMemcache::get_location][crate::client::CloudMemcache::get_location] calls.
1137    ///
1138    /// # Example
1139    /// ```no_run
1140    /// # use google_cloud_memcache_v1::builder;
1141    /// use builder::cloud_memcache::GetLocation;
1142    /// # tokio_test::block_on(async {
1143    ///
1144    /// let builder = prepare_request_builder();
1145    /// let response = builder.send().await?;
1146    /// # gax::Result::<()>::Ok(()) });
1147    ///
1148    /// fn prepare_request_builder() -> GetLocation {
1149    ///   # panic!();
1150    ///   // ... details omitted ...
1151    /// }
1152    /// ```
1153    #[derive(Clone, Debug)]
1154    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1155
1156    impl GetLocation {
1157        pub(crate) fn new(
1158            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
1159        ) -> Self {
1160            Self(RequestBuilder::new(stub))
1161        }
1162
1163        /// Sets the full request, replacing any prior values.
1164        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1165            self.0.request = v.into();
1166            self
1167        }
1168
1169        /// Sets all the options, replacing any prior values.
1170        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1171            self.0.options = v.into();
1172            self
1173        }
1174
1175        /// Sends the request.
1176        pub async fn send(self) -> Result<location::model::Location> {
1177            (*self.0.stub)
1178                .get_location(self.0.request, self.0.options)
1179                .await
1180                .map(gax::response::Response::into_body)
1181        }
1182
1183        /// Sets the value of [name][location::model::GetLocationRequest::name].
1184        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185            self.0.request.name = v.into();
1186            self
1187        }
1188    }
1189
1190    #[doc(hidden)]
1191    impl gax::options::internal::RequestBuilder for GetLocation {
1192        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1193            &mut self.0.options
1194        }
1195    }
1196
1197    /// The request builder for [CloudMemcache::list_operations][crate::client::CloudMemcache::list_operations] calls.
1198    ///
1199    /// # Example
1200    /// ```no_run
1201    /// # use google_cloud_memcache_v1::builder;
1202    /// use builder::cloud_memcache::ListOperations;
1203    /// # tokio_test::block_on(async {
1204    /// use gax::paginator::ItemPaginator;
1205    ///
1206    /// let builder = prepare_request_builder();
1207    /// let mut items = builder.by_item();
1208    /// while let Some(result) = items.next().await {
1209    ///   let item = result?;
1210    /// }
1211    /// # gax::Result::<()>::Ok(()) });
1212    ///
1213    /// fn prepare_request_builder() -> ListOperations {
1214    ///   # panic!();
1215    ///   // ... details omitted ...
1216    /// }
1217    /// ```
1218    #[derive(Clone, Debug)]
1219    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1220
1221    impl ListOperations {
1222        pub(crate) fn new(
1223            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
1224        ) -> Self {
1225            Self(RequestBuilder::new(stub))
1226        }
1227
1228        /// Sets the full request, replacing any prior values.
1229        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1230            mut self,
1231            v: V,
1232        ) -> Self {
1233            self.0.request = v.into();
1234            self
1235        }
1236
1237        /// Sets all the options, replacing any prior values.
1238        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1239            self.0.options = v.into();
1240            self
1241        }
1242
1243        /// Sends the request.
1244        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1245            (*self.0.stub)
1246                .list_operations(self.0.request, self.0.options)
1247                .await
1248                .map(gax::response::Response::into_body)
1249        }
1250
1251        /// Streams each page in the collection.
1252        pub fn by_page(
1253            self,
1254        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1255        {
1256            use std::clone::Clone;
1257            let token = self.0.request.page_token.clone();
1258            let execute = move |token: String| {
1259                let mut builder = self.clone();
1260                builder.0.request = builder.0.request.set_page_token(token);
1261                builder.send()
1262            };
1263            gax::paginator::internal::new_paginator(token, execute)
1264        }
1265
1266        /// Streams each item in the collection.
1267        pub fn by_item(
1268            self,
1269        ) -> impl gax::paginator::ItemPaginator<
1270            longrunning::model::ListOperationsResponse,
1271            gax::error::Error,
1272        > {
1273            use gax::paginator::Paginator;
1274            self.by_page().items()
1275        }
1276
1277        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1278        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1279            self.0.request.name = v.into();
1280            self
1281        }
1282
1283        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1284        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1285            self.0.request.filter = v.into();
1286            self
1287        }
1288
1289        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1290        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1291            self.0.request.page_size = v.into();
1292            self
1293        }
1294
1295        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1296        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1297            self.0.request.page_token = v.into();
1298            self
1299        }
1300
1301        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1302        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1303            self.0.request.return_partial_success = v.into();
1304            self
1305        }
1306    }
1307
1308    #[doc(hidden)]
1309    impl gax::options::internal::RequestBuilder for ListOperations {
1310        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1311            &mut self.0.options
1312        }
1313    }
1314
1315    /// The request builder for [CloudMemcache::get_operation][crate::client::CloudMemcache::get_operation] calls.
1316    ///
1317    /// # Example
1318    /// ```no_run
1319    /// # use google_cloud_memcache_v1::builder;
1320    /// use builder::cloud_memcache::GetOperation;
1321    /// # tokio_test::block_on(async {
1322    ///
1323    /// let builder = prepare_request_builder();
1324    /// let response = builder.send().await?;
1325    /// # gax::Result::<()>::Ok(()) });
1326    ///
1327    /// fn prepare_request_builder() -> GetOperation {
1328    ///   # panic!();
1329    ///   // ... details omitted ...
1330    /// }
1331    /// ```
1332    #[derive(Clone, Debug)]
1333    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1334
1335    impl GetOperation {
1336        pub(crate) fn new(
1337            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
1338        ) -> Self {
1339            Self(RequestBuilder::new(stub))
1340        }
1341
1342        /// Sets the full request, replacing any prior values.
1343        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1344            mut self,
1345            v: V,
1346        ) -> Self {
1347            self.0.request = v.into();
1348            self
1349        }
1350
1351        /// Sets all the options, replacing any prior values.
1352        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1353            self.0.options = v.into();
1354            self
1355        }
1356
1357        /// Sends the request.
1358        pub async fn send(self) -> Result<longrunning::model::Operation> {
1359            (*self.0.stub)
1360                .get_operation(self.0.request, self.0.options)
1361                .await
1362                .map(gax::response::Response::into_body)
1363        }
1364
1365        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1366        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1367            self.0.request.name = v.into();
1368            self
1369        }
1370    }
1371
1372    #[doc(hidden)]
1373    impl gax::options::internal::RequestBuilder for GetOperation {
1374        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1375            &mut self.0.options
1376        }
1377    }
1378
1379    /// The request builder for [CloudMemcache::delete_operation][crate::client::CloudMemcache::delete_operation] calls.
1380    ///
1381    /// # Example
1382    /// ```no_run
1383    /// # use google_cloud_memcache_v1::builder;
1384    /// use builder::cloud_memcache::DeleteOperation;
1385    /// # tokio_test::block_on(async {
1386    ///
1387    /// let builder = prepare_request_builder();
1388    /// let response = builder.send().await?;
1389    /// # gax::Result::<()>::Ok(()) });
1390    ///
1391    /// fn prepare_request_builder() -> DeleteOperation {
1392    ///   # panic!();
1393    ///   // ... details omitted ...
1394    /// }
1395    /// ```
1396    #[derive(Clone, Debug)]
1397    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1398
1399    impl DeleteOperation {
1400        pub(crate) fn new(
1401            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
1402        ) -> Self {
1403            Self(RequestBuilder::new(stub))
1404        }
1405
1406        /// Sets the full request, replacing any prior values.
1407        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1408            mut self,
1409            v: V,
1410        ) -> Self {
1411            self.0.request = v.into();
1412            self
1413        }
1414
1415        /// Sets all the options, replacing any prior values.
1416        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1417            self.0.options = v.into();
1418            self
1419        }
1420
1421        /// Sends the request.
1422        pub async fn send(self) -> Result<()> {
1423            (*self.0.stub)
1424                .delete_operation(self.0.request, self.0.options)
1425                .await
1426                .map(gax::response::Response::into_body)
1427        }
1428
1429        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1430        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1431            self.0.request.name = v.into();
1432            self
1433        }
1434    }
1435
1436    #[doc(hidden)]
1437    impl gax::options::internal::RequestBuilder for DeleteOperation {
1438        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1439            &mut self.0.options
1440        }
1441    }
1442
1443    /// The request builder for [CloudMemcache::cancel_operation][crate::client::CloudMemcache::cancel_operation] calls.
1444    ///
1445    /// # Example
1446    /// ```no_run
1447    /// # use google_cloud_memcache_v1::builder;
1448    /// use builder::cloud_memcache::CancelOperation;
1449    /// # tokio_test::block_on(async {
1450    ///
1451    /// let builder = prepare_request_builder();
1452    /// let response = builder.send().await?;
1453    /// # gax::Result::<()>::Ok(()) });
1454    ///
1455    /// fn prepare_request_builder() -> CancelOperation {
1456    ///   # panic!();
1457    ///   // ... details omitted ...
1458    /// }
1459    /// ```
1460    #[derive(Clone, Debug)]
1461    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1462
1463    impl CancelOperation {
1464        pub(crate) fn new(
1465            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudMemcache>,
1466        ) -> Self {
1467            Self(RequestBuilder::new(stub))
1468        }
1469
1470        /// Sets the full request, replacing any prior values.
1471        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1472            mut self,
1473            v: V,
1474        ) -> Self {
1475            self.0.request = v.into();
1476            self
1477        }
1478
1479        /// Sets all the options, replacing any prior values.
1480        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1481            self.0.options = v.into();
1482            self
1483        }
1484
1485        /// Sends the request.
1486        pub async fn send(self) -> Result<()> {
1487            (*self.0.stub)
1488                .cancel_operation(self.0.request, self.0.options)
1489                .await
1490                .map(gax::response::Response::into_body)
1491        }
1492
1493        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1494        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1495            self.0.request.name = v.into();
1496            self
1497        }
1498    }
1499
1500    #[doc(hidden)]
1501    impl gax::options::internal::RequestBuilder for CancelOperation {
1502        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1503            &mut self.0.options
1504        }
1505    }
1506}