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