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