Skip to main content

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