Skip to main content

google_cloud_appengine_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 [Applications][crate::client::Applications].
18pub mod applications {
19    use crate::Result;
20
21    /// A builder for [Applications][crate::client::Applications].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_appengine_v1::*;
26    /// # use builder::applications::ClientBuilder;
27    /// # use client::Applications;
28    /// let builder : ClientBuilder = Applications::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://appengine.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::Applications;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = Applications;
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::Applications] 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::Applications>,
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::Applications>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Applications::get_application][crate::client::Applications::get_application] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_appengine_v1::builder::applications::GetApplication;
79    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> GetApplication {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
92
93    impl GetApplication {
94        pub(crate) fn new(
95            stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
96        ) -> Self {
97            Self(RequestBuilder::new(stub))
98        }
99
100        /// Sets the full request, replacing any prior values.
101        pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
102            self.0.request = v.into();
103            self
104        }
105
106        /// Sets all the options, replacing any prior values.
107        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108            self.0.options = v.into();
109            self
110        }
111
112        /// Sends the request.
113        pub async fn send(self) -> Result<crate::model::Application> {
114            (*self.0.stub)
115                .get_application(self.0.request, self.0.options)
116                .await
117                .map(crate::Response::into_body)
118        }
119
120        /// Sets the value of [name][crate::model::GetApplicationRequest::name].
121        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
122            self.0.request.name = v.into();
123            self
124        }
125    }
126
127    #[doc(hidden)]
128    impl crate::RequestBuilder for GetApplication {
129        fn request_options(&mut self) -> &mut crate::RequestOptions {
130            &mut self.0.options
131        }
132    }
133
134    /// The request builder for [Applications::create_application][crate::client::Applications::create_application] calls.
135    ///
136    /// # Example
137    /// ```
138    /// # use google_cloud_appengine_v1::builder::applications::CreateApplication;
139    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
140    /// use google_cloud_lro::Poller;
141    ///
142    /// let builder = prepare_request_builder();
143    /// let response = builder.poller().until_done().await?;
144    /// # Ok(()) }
145    ///
146    /// fn prepare_request_builder() -> CreateApplication {
147    ///   # panic!();
148    ///   // ... details omitted ...
149    /// }
150    /// ```
151    #[derive(Clone, Debug)]
152    pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
153
154    impl CreateApplication {
155        pub(crate) fn new(
156            stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
157        ) -> Self {
158            Self(RequestBuilder::new(stub))
159        }
160
161        /// Sets the full request, replacing any prior values.
162        pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
163            mut self,
164            v: V,
165        ) -> Self {
166            self.0.request = v.into();
167            self
168        }
169
170        /// Sets all the options, replacing any prior values.
171        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
172            self.0.options = v.into();
173            self
174        }
175
176        /// Sends the request.
177        ///
178        /// # Long running operations
179        ///
180        /// This starts, but does not poll, a longrunning operation. More information
181        /// on [create_application][crate::client::Applications::create_application].
182        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
183            (*self.0.stub)
184                .create_application(self.0.request, self.0.options)
185                .await
186                .map(crate::Response::into_body)
187        }
188
189        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_application`.
190        pub fn poller(
191            self,
192        ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
193        {
194            type Operation = google_cloud_lro::internal::Operation<
195                crate::model::Application,
196                crate::model::OperationMetadataV1,
197            >;
198            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
199            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
200            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
201            if let Some(ref mut details) = poller_options.tracing {
202                details.method_name = "google_cloud_appengine_v1::client::Applications::create_application::until_done";
203            }
204
205            let stub = self.0.stub.clone();
206            let mut options = self.0.options.clone();
207            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
208            let query = move |name| {
209                let stub = stub.clone();
210                let options = options.clone();
211                async {
212                    let op = GetOperation::new(stub)
213                        .set_name(name)
214                        .with_options(options)
215                        .send()
216                        .await?;
217                    Ok(Operation::new(op))
218                }
219            };
220
221            let start = move || async {
222                let op = self.send().await?;
223                Ok(Operation::new(op))
224            };
225
226            use google_cloud_lro::internal::PollerExt;
227            {
228                google_cloud_lro::internal::new_poller(
229                    polling_error_policy,
230                    polling_backoff_policy,
231                    start,
232                    query,
233                )
234            }
235            .with_options(poller_options)
236        }
237
238        /// Sets the value of [application][crate::model::CreateApplicationRequest::application].
239        pub fn set_application<T>(mut self, v: T) -> Self
240        where
241            T: std::convert::Into<crate::model::Application>,
242        {
243            self.0.request.application = std::option::Option::Some(v.into());
244            self
245        }
246
247        /// Sets or clears the value of [application][crate::model::CreateApplicationRequest::application].
248        pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
249        where
250            T: std::convert::Into<crate::model::Application>,
251        {
252            self.0.request.application = v.map(|x| x.into());
253            self
254        }
255    }
256
257    #[doc(hidden)]
258    impl crate::RequestBuilder for CreateApplication {
259        fn request_options(&mut self) -> &mut crate::RequestOptions {
260            &mut self.0.options
261        }
262    }
263
264    /// The request builder for [Applications::update_application][crate::client::Applications::update_application] calls.
265    ///
266    /// # Example
267    /// ```
268    /// # use google_cloud_appengine_v1::builder::applications::UpdateApplication;
269    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
270    /// use google_cloud_lro::Poller;
271    ///
272    /// let builder = prepare_request_builder();
273    /// let response = builder.poller().until_done().await?;
274    /// # Ok(()) }
275    ///
276    /// fn prepare_request_builder() -> UpdateApplication {
277    ///   # panic!();
278    ///   // ... details omitted ...
279    /// }
280    /// ```
281    #[derive(Clone, Debug)]
282    pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
283
284    impl UpdateApplication {
285        pub(crate) fn new(
286            stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
287        ) -> Self {
288            Self(RequestBuilder::new(stub))
289        }
290
291        /// Sets the full request, replacing any prior values.
292        pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
293            mut self,
294            v: V,
295        ) -> Self {
296            self.0.request = v.into();
297            self
298        }
299
300        /// Sets all the options, replacing any prior values.
301        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
302            self.0.options = v.into();
303            self
304        }
305
306        /// Sends the request.
307        ///
308        /// # Long running operations
309        ///
310        /// This starts, but does not poll, a longrunning operation. More information
311        /// on [update_application][crate::client::Applications::update_application].
312        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
313            (*self.0.stub)
314                .update_application(self.0.request, self.0.options)
315                .await
316                .map(crate::Response::into_body)
317        }
318
319        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_application`.
320        pub fn poller(
321            self,
322        ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
323        {
324            type Operation = google_cloud_lro::internal::Operation<
325                crate::model::Application,
326                crate::model::OperationMetadataV1,
327            >;
328            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
329            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
330            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
331            if let Some(ref mut details) = poller_options.tracing {
332                details.method_name = "google_cloud_appengine_v1::client::Applications::update_application::until_done";
333            }
334
335            let stub = self.0.stub.clone();
336            let mut options = self.0.options.clone();
337            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
338            let query = move |name| {
339                let stub = stub.clone();
340                let options = options.clone();
341                async {
342                    let op = GetOperation::new(stub)
343                        .set_name(name)
344                        .with_options(options)
345                        .send()
346                        .await?;
347                    Ok(Operation::new(op))
348                }
349            };
350
351            let start = move || async {
352                let op = self.send().await?;
353                Ok(Operation::new(op))
354            };
355
356            use google_cloud_lro::internal::PollerExt;
357            {
358                google_cloud_lro::internal::new_poller(
359                    polling_error_policy,
360                    polling_backoff_policy,
361                    start,
362                    query,
363                )
364            }
365            .with_options(poller_options)
366        }
367
368        /// Sets the value of [name][crate::model::UpdateApplicationRequest::name].
369        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
370            self.0.request.name = v.into();
371            self
372        }
373
374        /// Sets the value of [application][crate::model::UpdateApplicationRequest::application].
375        pub fn set_application<T>(mut self, v: T) -> Self
376        where
377            T: std::convert::Into<crate::model::Application>,
378        {
379            self.0.request.application = std::option::Option::Some(v.into());
380            self
381        }
382
383        /// Sets or clears the value of [application][crate::model::UpdateApplicationRequest::application].
384        pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
385        where
386            T: std::convert::Into<crate::model::Application>,
387        {
388            self.0.request.application = v.map(|x| x.into());
389            self
390        }
391
392        /// Sets the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
393        pub fn set_update_mask<T>(mut self, v: T) -> Self
394        where
395            T: std::convert::Into<wkt::FieldMask>,
396        {
397            self.0.request.update_mask = std::option::Option::Some(v.into());
398            self
399        }
400
401        /// Sets or clears the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
402        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
403        where
404            T: std::convert::Into<wkt::FieldMask>,
405        {
406            self.0.request.update_mask = v.map(|x| x.into());
407            self
408        }
409    }
410
411    #[doc(hidden)]
412    impl crate::RequestBuilder for UpdateApplication {
413        fn request_options(&mut self) -> &mut crate::RequestOptions {
414            &mut self.0.options
415        }
416    }
417
418    /// The request builder for [Applications::repair_application][crate::client::Applications::repair_application] calls.
419    ///
420    /// # Example
421    /// ```
422    /// # use google_cloud_appengine_v1::builder::applications::RepairApplication;
423    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
424    /// use google_cloud_lro::Poller;
425    ///
426    /// let builder = prepare_request_builder();
427    /// let response = builder.poller().until_done().await?;
428    /// # Ok(()) }
429    ///
430    /// fn prepare_request_builder() -> RepairApplication {
431    ///   # panic!();
432    ///   // ... details omitted ...
433    /// }
434    /// ```
435    #[derive(Clone, Debug)]
436    pub struct RepairApplication(RequestBuilder<crate::model::RepairApplicationRequest>);
437
438    impl RepairApplication {
439        pub(crate) fn new(
440            stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
441        ) -> Self {
442            Self(RequestBuilder::new(stub))
443        }
444
445        /// Sets the full request, replacing any prior values.
446        pub fn with_request<V: Into<crate::model::RepairApplicationRequest>>(
447            mut self,
448            v: V,
449        ) -> Self {
450            self.0.request = v.into();
451            self
452        }
453
454        /// Sets all the options, replacing any prior values.
455        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
456            self.0.options = v.into();
457            self
458        }
459
460        /// Sends the request.
461        ///
462        /// # Long running operations
463        ///
464        /// This starts, but does not poll, a longrunning operation. More information
465        /// on [repair_application][crate::client::Applications::repair_application].
466        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
467            (*self.0.stub)
468                .repair_application(self.0.request, self.0.options)
469                .await
470                .map(crate::Response::into_body)
471        }
472
473        /// Creates a [Poller][google_cloud_lro::Poller] to work with `repair_application`.
474        pub fn poller(
475            self,
476        ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
477        {
478            type Operation = google_cloud_lro::internal::Operation<
479                crate::model::Application,
480                crate::model::OperationMetadataV1,
481            >;
482            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
483            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
484            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
485            if let Some(ref mut details) = poller_options.tracing {
486                details.method_name = "google_cloud_appengine_v1::client::Applications::repair_application::until_done";
487            }
488
489            let stub = self.0.stub.clone();
490            let mut options = self.0.options.clone();
491            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
492            let query = move |name| {
493                let stub = stub.clone();
494                let options = options.clone();
495                async {
496                    let op = GetOperation::new(stub)
497                        .set_name(name)
498                        .with_options(options)
499                        .send()
500                        .await?;
501                    Ok(Operation::new(op))
502                }
503            };
504
505            let start = move || async {
506                let op = self.send().await?;
507                Ok(Operation::new(op))
508            };
509
510            use google_cloud_lro::internal::PollerExt;
511            {
512                google_cloud_lro::internal::new_poller(
513                    polling_error_policy,
514                    polling_backoff_policy,
515                    start,
516                    query,
517                )
518            }
519            .with_options(poller_options)
520        }
521
522        /// Sets the value of [name][crate::model::RepairApplicationRequest::name].
523        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
524            self.0.request.name = v.into();
525            self
526        }
527    }
528
529    #[doc(hidden)]
530    impl crate::RequestBuilder for RepairApplication {
531        fn request_options(&mut self) -> &mut crate::RequestOptions {
532            &mut self.0.options
533        }
534    }
535
536    /// The request builder for [Applications::list_operations][crate::client::Applications::list_operations] calls.
537    ///
538    /// # Example
539    /// ```
540    /// # use google_cloud_appengine_v1::builder::applications::ListOperations;
541    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
542    /// use google_cloud_gax::paginator::ItemPaginator;
543    ///
544    /// let builder = prepare_request_builder();
545    /// let mut items = builder.by_item();
546    /// while let Some(result) = items.next().await {
547    ///   let item = result?;
548    /// }
549    /// # Ok(()) }
550    ///
551    /// fn prepare_request_builder() -> ListOperations {
552    ///   # panic!();
553    ///   // ... details omitted ...
554    /// }
555    /// ```
556    #[derive(Clone, Debug)]
557    pub struct ListOperations(
558        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
559    );
560
561    impl ListOperations {
562        pub(crate) fn new(
563            stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
564        ) -> Self {
565            Self(RequestBuilder::new(stub))
566        }
567
568        /// Sets the full request, replacing any prior values.
569        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
570            mut self,
571            v: V,
572        ) -> Self {
573            self.0.request = v.into();
574            self
575        }
576
577        /// Sets all the options, replacing any prior values.
578        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
579            self.0.options = v.into();
580            self
581        }
582
583        /// Sends the request.
584        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
585            (*self.0.stub)
586                .list_operations(self.0.request, self.0.options)
587                .await
588                .map(crate::Response::into_body)
589        }
590
591        /// Streams each page in the collection.
592        pub fn by_page(
593            self,
594        ) -> impl google_cloud_gax::paginator::Paginator<
595            google_cloud_longrunning::model::ListOperationsResponse,
596            crate::Error,
597        > {
598            use std::clone::Clone;
599            let token = self.0.request.page_token.clone();
600            let execute = move |token: String| {
601                let mut builder = self.clone();
602                builder.0.request = builder.0.request.set_page_token(token);
603                builder.send()
604            };
605            google_cloud_gax::paginator::internal::new_paginator(token, execute)
606        }
607
608        /// Streams each item in the collection.
609        pub fn by_item(
610            self,
611        ) -> impl google_cloud_gax::paginator::ItemPaginator<
612            google_cloud_longrunning::model::ListOperationsResponse,
613            crate::Error,
614        > {
615            use google_cloud_gax::paginator::Paginator;
616            self.by_page().items()
617        }
618
619        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
620        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
621            self.0.request.name = v.into();
622            self
623        }
624
625        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
626        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
627            self.0.request.filter = v.into();
628            self
629        }
630
631        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
632        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
633            self.0.request.page_size = v.into();
634            self
635        }
636
637        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
638        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
639            self.0.request.page_token = v.into();
640            self
641        }
642
643        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
644        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
645            self.0.request.return_partial_success = v.into();
646            self
647        }
648    }
649
650    #[doc(hidden)]
651    impl crate::RequestBuilder for ListOperations {
652        fn request_options(&mut self) -> &mut crate::RequestOptions {
653            &mut self.0.options
654        }
655    }
656
657    /// The request builder for [Applications::get_operation][crate::client::Applications::get_operation] calls.
658    ///
659    /// # Example
660    /// ```
661    /// # use google_cloud_appengine_v1::builder::applications::GetOperation;
662    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
663    ///
664    /// let builder = prepare_request_builder();
665    /// let response = builder.send().await?;
666    /// # Ok(()) }
667    ///
668    /// fn prepare_request_builder() -> GetOperation {
669    ///   # panic!();
670    ///   // ... details omitted ...
671    /// }
672    /// ```
673    #[derive(Clone, Debug)]
674    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
675
676    impl GetOperation {
677        pub(crate) fn new(
678            stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
679        ) -> Self {
680            Self(RequestBuilder::new(stub))
681        }
682
683        /// Sets the full request, replacing any prior values.
684        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
685            mut self,
686            v: V,
687        ) -> Self {
688            self.0.request = v.into();
689            self
690        }
691
692        /// Sets all the options, replacing any prior values.
693        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
694            self.0.options = v.into();
695            self
696        }
697
698        /// Sends the request.
699        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
700            (*self.0.stub)
701                .get_operation(self.0.request, self.0.options)
702                .await
703                .map(crate::Response::into_body)
704        }
705
706        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
707        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
708            self.0.request.name = v.into();
709            self
710        }
711    }
712
713    #[doc(hidden)]
714    impl crate::RequestBuilder for GetOperation {
715        fn request_options(&mut self) -> &mut crate::RequestOptions {
716            &mut self.0.options
717        }
718    }
719}
720
721/// Request and client builders for [Services][crate::client::Services].
722pub mod services {
723    use crate::Result;
724
725    /// A builder for [Services][crate::client::Services].
726    ///
727    /// ```
728    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
729    /// # use google_cloud_appengine_v1::*;
730    /// # use builder::services::ClientBuilder;
731    /// # use client::Services;
732    /// let builder : ClientBuilder = Services::builder();
733    /// let client = builder
734    ///     .with_endpoint("https://appengine.googleapis.com")
735    ///     .build().await?;
736    /// # Ok(()) }
737    /// ```
738    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
739
740    pub(crate) mod client {
741        use super::super::super::client::Services;
742        pub struct Factory;
743        impl crate::ClientFactory for Factory {
744            type Client = Services;
745            type Credentials = gaxi::options::Credentials;
746            async fn build(
747                self,
748                config: gaxi::options::ClientConfig,
749            ) -> crate::ClientBuilderResult<Self::Client> {
750                Self::Client::new(config).await
751            }
752        }
753    }
754
755    /// Common implementation for [crate::client::Services] request builders.
756    #[derive(Clone, Debug)]
757    pub(crate) struct RequestBuilder<R: std::default::Default> {
758        stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
759        request: R,
760        options: crate::RequestOptions,
761    }
762
763    impl<R> RequestBuilder<R>
764    where
765        R: std::default::Default,
766    {
767        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
768            Self {
769                stub,
770                request: R::default(),
771                options: crate::RequestOptions::default(),
772            }
773        }
774    }
775
776    /// The request builder for [Services::list_services][crate::client::Services::list_services] calls.
777    ///
778    /// # Example
779    /// ```
780    /// # use google_cloud_appengine_v1::builder::services::ListServices;
781    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
782    /// use google_cloud_gax::paginator::ItemPaginator;
783    ///
784    /// let builder = prepare_request_builder();
785    /// let mut items = builder.by_item();
786    /// while let Some(result) = items.next().await {
787    ///   let item = result?;
788    /// }
789    /// # Ok(()) }
790    ///
791    /// fn prepare_request_builder() -> ListServices {
792    ///   # panic!();
793    ///   // ... details omitted ...
794    /// }
795    /// ```
796    #[derive(Clone, Debug)]
797    pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
798
799    impl ListServices {
800        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
801            Self(RequestBuilder::new(stub))
802        }
803
804        /// Sets the full request, replacing any prior values.
805        pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
806            self.0.request = v.into();
807            self
808        }
809
810        /// Sets all the options, replacing any prior values.
811        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
812            self.0.options = v.into();
813            self
814        }
815
816        /// Sends the request.
817        pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
818            (*self.0.stub)
819                .list_services(self.0.request, self.0.options)
820                .await
821                .map(crate::Response::into_body)
822        }
823
824        /// Streams each page in the collection.
825        pub fn by_page(
826            self,
827        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListServicesResponse, crate::Error>
828        {
829            use std::clone::Clone;
830            let token = self.0.request.page_token.clone();
831            let execute = move |token: String| {
832                let mut builder = self.clone();
833                builder.0.request = builder.0.request.set_page_token(token);
834                builder.send()
835            };
836            google_cloud_gax::paginator::internal::new_paginator(token, execute)
837        }
838
839        /// Streams each item in the collection.
840        pub fn by_item(
841            self,
842        ) -> impl google_cloud_gax::paginator::ItemPaginator<
843            crate::model::ListServicesResponse,
844            crate::Error,
845        > {
846            use google_cloud_gax::paginator::Paginator;
847            self.by_page().items()
848        }
849
850        /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
851        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
852            self.0.request.parent = v.into();
853            self
854        }
855
856        /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
857        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
858            self.0.request.page_size = v.into();
859            self
860        }
861
862        /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
863        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
864            self.0.request.page_token = v.into();
865            self
866        }
867    }
868
869    #[doc(hidden)]
870    impl crate::RequestBuilder for ListServices {
871        fn request_options(&mut self) -> &mut crate::RequestOptions {
872            &mut self.0.options
873        }
874    }
875
876    /// The request builder for [Services::get_service][crate::client::Services::get_service] calls.
877    ///
878    /// # Example
879    /// ```
880    /// # use google_cloud_appengine_v1::builder::services::GetService;
881    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
882    ///
883    /// let builder = prepare_request_builder();
884    /// let response = builder.send().await?;
885    /// # Ok(()) }
886    ///
887    /// fn prepare_request_builder() -> GetService {
888    ///   # panic!();
889    ///   // ... details omitted ...
890    /// }
891    /// ```
892    #[derive(Clone, Debug)]
893    pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
894
895    impl GetService {
896        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
897            Self(RequestBuilder::new(stub))
898        }
899
900        /// Sets the full request, replacing any prior values.
901        pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
902            self.0.request = v.into();
903            self
904        }
905
906        /// Sets all the options, replacing any prior values.
907        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
908            self.0.options = v.into();
909            self
910        }
911
912        /// Sends the request.
913        pub async fn send(self) -> Result<crate::model::Service> {
914            (*self.0.stub)
915                .get_service(self.0.request, self.0.options)
916                .await
917                .map(crate::Response::into_body)
918        }
919
920        /// Sets the value of [name][crate::model::GetServiceRequest::name].
921        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
922            self.0.request.name = v.into();
923            self
924        }
925    }
926
927    #[doc(hidden)]
928    impl crate::RequestBuilder for GetService {
929        fn request_options(&mut self) -> &mut crate::RequestOptions {
930            &mut self.0.options
931        }
932    }
933
934    /// The request builder for [Services::update_service][crate::client::Services::update_service] calls.
935    ///
936    /// # Example
937    /// ```
938    /// # use google_cloud_appengine_v1::builder::services::UpdateService;
939    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
940    /// use google_cloud_lro::Poller;
941    ///
942    /// let builder = prepare_request_builder();
943    /// let response = builder.poller().until_done().await?;
944    /// # Ok(()) }
945    ///
946    /// fn prepare_request_builder() -> UpdateService {
947    ///   # panic!();
948    ///   // ... details omitted ...
949    /// }
950    /// ```
951    #[derive(Clone, Debug)]
952    pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
953
954    impl UpdateService {
955        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
956            Self(RequestBuilder::new(stub))
957        }
958
959        /// Sets the full request, replacing any prior values.
960        pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
961            self.0.request = v.into();
962            self
963        }
964
965        /// Sets all the options, replacing any prior values.
966        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
967            self.0.options = v.into();
968            self
969        }
970
971        /// Sends the request.
972        ///
973        /// # Long running operations
974        ///
975        /// This starts, but does not poll, a longrunning operation. More information
976        /// on [update_service][crate::client::Services::update_service].
977        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
978            (*self.0.stub)
979                .update_service(self.0.request, self.0.options)
980                .await
981                .map(crate::Response::into_body)
982        }
983
984        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service`.
985        pub fn poller(
986            self,
987        ) -> impl google_cloud_lro::Poller<crate::model::Service, crate::model::OperationMetadataV1>
988        {
989            type Operation = google_cloud_lro::internal::Operation<
990                crate::model::Service,
991                crate::model::OperationMetadataV1,
992            >;
993            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
994            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
995            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
996            if let Some(ref mut details) = poller_options.tracing {
997                details.method_name =
998                    "google_cloud_appengine_v1::client::Services::update_service::until_done";
999            }
1000
1001            let stub = self.0.stub.clone();
1002            let mut options = self.0.options.clone();
1003            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1004            let query = move |name| {
1005                let stub = stub.clone();
1006                let options = options.clone();
1007                async {
1008                    let op = GetOperation::new(stub)
1009                        .set_name(name)
1010                        .with_options(options)
1011                        .send()
1012                        .await?;
1013                    Ok(Operation::new(op))
1014                }
1015            };
1016
1017            let start = move || async {
1018                let op = self.send().await?;
1019                Ok(Operation::new(op))
1020            };
1021
1022            use google_cloud_lro::internal::PollerExt;
1023            {
1024                google_cloud_lro::internal::new_poller(
1025                    polling_error_policy,
1026                    polling_backoff_policy,
1027                    start,
1028                    query,
1029                )
1030            }
1031            .with_options(poller_options)
1032        }
1033
1034        /// Sets the value of [name][crate::model::UpdateServiceRequest::name].
1035        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1036            self.0.request.name = v.into();
1037            self
1038        }
1039
1040        /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
1041        pub fn set_service<T>(mut self, v: T) -> Self
1042        where
1043            T: std::convert::Into<crate::model::Service>,
1044        {
1045            self.0.request.service = std::option::Option::Some(v.into());
1046            self
1047        }
1048
1049        /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
1050        pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
1051        where
1052            T: std::convert::Into<crate::model::Service>,
1053        {
1054            self.0.request.service = v.map(|x| x.into());
1055            self
1056        }
1057
1058        /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
1059        pub fn set_update_mask<T>(mut self, v: T) -> Self
1060        where
1061            T: std::convert::Into<wkt::FieldMask>,
1062        {
1063            self.0.request.update_mask = std::option::Option::Some(v.into());
1064            self
1065        }
1066
1067        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
1068        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1069        where
1070            T: std::convert::Into<wkt::FieldMask>,
1071        {
1072            self.0.request.update_mask = v.map(|x| x.into());
1073            self
1074        }
1075
1076        /// Sets the value of [migrate_traffic][crate::model::UpdateServiceRequest::migrate_traffic].
1077        pub fn set_migrate_traffic<T: Into<bool>>(mut self, v: T) -> Self {
1078            self.0.request.migrate_traffic = v.into();
1079            self
1080        }
1081    }
1082
1083    #[doc(hidden)]
1084    impl crate::RequestBuilder for UpdateService {
1085        fn request_options(&mut self) -> &mut crate::RequestOptions {
1086            &mut self.0.options
1087        }
1088    }
1089
1090    /// The request builder for [Services::delete_service][crate::client::Services::delete_service] calls.
1091    ///
1092    /// # Example
1093    /// ```
1094    /// # use google_cloud_appengine_v1::builder::services::DeleteService;
1095    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
1096    /// use google_cloud_lro::Poller;
1097    ///
1098    /// let builder = prepare_request_builder();
1099    /// let response = builder.poller().until_done().await?;
1100    /// # Ok(()) }
1101    ///
1102    /// fn prepare_request_builder() -> DeleteService {
1103    ///   # panic!();
1104    ///   // ... details omitted ...
1105    /// }
1106    /// ```
1107    #[derive(Clone, Debug)]
1108    pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1109
1110    impl DeleteService {
1111        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1112            Self(RequestBuilder::new(stub))
1113        }
1114
1115        /// Sets the full request, replacing any prior values.
1116        pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1117            self.0.request = v.into();
1118            self
1119        }
1120
1121        /// Sets all the options, replacing any prior values.
1122        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1123            self.0.options = v.into();
1124            self
1125        }
1126
1127        /// Sends the request.
1128        ///
1129        /// # Long running operations
1130        ///
1131        /// This starts, but does not poll, a longrunning operation. More information
1132        /// on [delete_service][crate::client::Services::delete_service].
1133        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1134            (*self.0.stub)
1135                .delete_service(self.0.request, self.0.options)
1136                .await
1137                .map(crate::Response::into_body)
1138        }
1139
1140        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service`.
1141        pub fn poller(
1142            self,
1143        ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
1144            type Operation = google_cloud_lro::internal::Operation<
1145                wkt::Empty,
1146                crate::model::OperationMetadataV1,
1147            >;
1148            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1149            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1150            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1151            if let Some(ref mut details) = poller_options.tracing {
1152                details.method_name =
1153                    "google_cloud_appengine_v1::client::Services::delete_service::until_done";
1154            }
1155
1156            let stub = self.0.stub.clone();
1157            let mut options = self.0.options.clone();
1158            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1159            let query = move |name| {
1160                let stub = stub.clone();
1161                let options = options.clone();
1162                async {
1163                    let op = GetOperation::new(stub)
1164                        .set_name(name)
1165                        .with_options(options)
1166                        .send()
1167                        .await?;
1168                    Ok(Operation::new(op))
1169                }
1170            };
1171
1172            let start = move || async {
1173                let op = self.send().await?;
1174                Ok(Operation::new(op))
1175            };
1176
1177            use google_cloud_lro::internal::PollerExt;
1178            {
1179                google_cloud_lro::internal::new_unit_response_poller(
1180                    polling_error_policy,
1181                    polling_backoff_policy,
1182                    start,
1183                    query,
1184                )
1185            }
1186            .with_options(poller_options)
1187        }
1188
1189        /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
1190        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1191            self.0.request.name = v.into();
1192            self
1193        }
1194    }
1195
1196    #[doc(hidden)]
1197    impl crate::RequestBuilder for DeleteService {
1198        fn request_options(&mut self) -> &mut crate::RequestOptions {
1199            &mut self.0.options
1200        }
1201    }
1202
1203    /// The request builder for [Services::list_operations][crate::client::Services::list_operations] calls.
1204    ///
1205    /// # Example
1206    /// ```
1207    /// # use google_cloud_appengine_v1::builder::services::ListOperations;
1208    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
1209    /// use google_cloud_gax::paginator::ItemPaginator;
1210    ///
1211    /// let builder = prepare_request_builder();
1212    /// let mut items = builder.by_item();
1213    /// while let Some(result) = items.next().await {
1214    ///   let item = result?;
1215    /// }
1216    /// # Ok(()) }
1217    ///
1218    /// fn prepare_request_builder() -> ListOperations {
1219    ///   # panic!();
1220    ///   // ... details omitted ...
1221    /// }
1222    /// ```
1223    #[derive(Clone, Debug)]
1224    pub struct ListOperations(
1225        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1226    );
1227
1228    impl ListOperations {
1229        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1230            Self(RequestBuilder::new(stub))
1231        }
1232
1233        /// Sets the full request, replacing any prior values.
1234        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1235            mut self,
1236            v: V,
1237        ) -> Self {
1238            self.0.request = v.into();
1239            self
1240        }
1241
1242        /// Sets all the options, replacing any prior values.
1243        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1244            self.0.options = v.into();
1245            self
1246        }
1247
1248        /// Sends the request.
1249        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1250            (*self.0.stub)
1251                .list_operations(self.0.request, self.0.options)
1252                .await
1253                .map(crate::Response::into_body)
1254        }
1255
1256        /// Streams each page in the collection.
1257        pub fn by_page(
1258            self,
1259        ) -> impl google_cloud_gax::paginator::Paginator<
1260            google_cloud_longrunning::model::ListOperationsResponse,
1261            crate::Error,
1262        > {
1263            use std::clone::Clone;
1264            let token = self.0.request.page_token.clone();
1265            let execute = move |token: String| {
1266                let mut builder = self.clone();
1267                builder.0.request = builder.0.request.set_page_token(token);
1268                builder.send()
1269            };
1270            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1271        }
1272
1273        /// Streams each item in the collection.
1274        pub fn by_item(
1275            self,
1276        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1277            google_cloud_longrunning::model::ListOperationsResponse,
1278            crate::Error,
1279        > {
1280            use google_cloud_gax::paginator::Paginator;
1281            self.by_page().items()
1282        }
1283
1284        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1285        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1286            self.0.request.name = v.into();
1287            self
1288        }
1289
1290        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1291        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1292            self.0.request.filter = v.into();
1293            self
1294        }
1295
1296        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1297        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1298            self.0.request.page_size = v.into();
1299            self
1300        }
1301
1302        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1303        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1304            self.0.request.page_token = v.into();
1305            self
1306        }
1307
1308        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1309        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1310            self.0.request.return_partial_success = v.into();
1311            self
1312        }
1313    }
1314
1315    #[doc(hidden)]
1316    impl crate::RequestBuilder for ListOperations {
1317        fn request_options(&mut self) -> &mut crate::RequestOptions {
1318            &mut self.0.options
1319        }
1320    }
1321
1322    /// The request builder for [Services::get_operation][crate::client::Services::get_operation] calls.
1323    ///
1324    /// # Example
1325    /// ```
1326    /// # use google_cloud_appengine_v1::builder::services::GetOperation;
1327    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
1328    ///
1329    /// let builder = prepare_request_builder();
1330    /// let response = builder.send().await?;
1331    /// # Ok(()) }
1332    ///
1333    /// fn prepare_request_builder() -> GetOperation {
1334    ///   # panic!();
1335    ///   // ... details omitted ...
1336    /// }
1337    /// ```
1338    #[derive(Clone, Debug)]
1339    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1340
1341    impl GetOperation {
1342        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1343            Self(RequestBuilder::new(stub))
1344        }
1345
1346        /// Sets the full request, replacing any prior values.
1347        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1348            mut self,
1349            v: V,
1350        ) -> Self {
1351            self.0.request = v.into();
1352            self
1353        }
1354
1355        /// Sets all the options, replacing any prior values.
1356        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1357            self.0.options = v.into();
1358            self
1359        }
1360
1361        /// Sends the request.
1362        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1363            (*self.0.stub)
1364                .get_operation(self.0.request, self.0.options)
1365                .await
1366                .map(crate::Response::into_body)
1367        }
1368
1369        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1370        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1371            self.0.request.name = v.into();
1372            self
1373        }
1374    }
1375
1376    #[doc(hidden)]
1377    impl crate::RequestBuilder for GetOperation {
1378        fn request_options(&mut self) -> &mut crate::RequestOptions {
1379            &mut self.0.options
1380        }
1381    }
1382}
1383
1384/// Request and client builders for [Versions][crate::client::Versions].
1385pub mod versions {
1386    use crate::Result;
1387
1388    /// A builder for [Versions][crate::client::Versions].
1389    ///
1390    /// ```
1391    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1392    /// # use google_cloud_appengine_v1::*;
1393    /// # use builder::versions::ClientBuilder;
1394    /// # use client::Versions;
1395    /// let builder : ClientBuilder = Versions::builder();
1396    /// let client = builder
1397    ///     .with_endpoint("https://appengine.googleapis.com")
1398    ///     .build().await?;
1399    /// # Ok(()) }
1400    /// ```
1401    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1402
1403    pub(crate) mod client {
1404        use super::super::super::client::Versions;
1405        pub struct Factory;
1406        impl crate::ClientFactory for Factory {
1407            type Client = Versions;
1408            type Credentials = gaxi::options::Credentials;
1409            async fn build(
1410                self,
1411                config: gaxi::options::ClientConfig,
1412            ) -> crate::ClientBuilderResult<Self::Client> {
1413                Self::Client::new(config).await
1414            }
1415        }
1416    }
1417
1418    /// Common implementation for [crate::client::Versions] request builders.
1419    #[derive(Clone, Debug)]
1420    pub(crate) struct RequestBuilder<R: std::default::Default> {
1421        stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
1422        request: R,
1423        options: crate::RequestOptions,
1424    }
1425
1426    impl<R> RequestBuilder<R>
1427    where
1428        R: std::default::Default,
1429    {
1430        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1431            Self {
1432                stub,
1433                request: R::default(),
1434                options: crate::RequestOptions::default(),
1435            }
1436        }
1437    }
1438
1439    /// The request builder for [Versions::list_versions][crate::client::Versions::list_versions] calls.
1440    ///
1441    /// # Example
1442    /// ```
1443    /// # use google_cloud_appengine_v1::builder::versions::ListVersions;
1444    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
1445    /// use google_cloud_gax::paginator::ItemPaginator;
1446    ///
1447    /// let builder = prepare_request_builder();
1448    /// let mut items = builder.by_item();
1449    /// while let Some(result) = items.next().await {
1450    ///   let item = result?;
1451    /// }
1452    /// # Ok(()) }
1453    ///
1454    /// fn prepare_request_builder() -> ListVersions {
1455    ///   # panic!();
1456    ///   // ... details omitted ...
1457    /// }
1458    /// ```
1459    #[derive(Clone, Debug)]
1460    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
1461
1462    impl ListVersions {
1463        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1464            Self(RequestBuilder::new(stub))
1465        }
1466
1467        /// Sets the full request, replacing any prior values.
1468        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
1469            self.0.request = v.into();
1470            self
1471        }
1472
1473        /// Sets all the options, replacing any prior values.
1474        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1475            self.0.options = v.into();
1476            self
1477        }
1478
1479        /// Sends the request.
1480        pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
1481            (*self.0.stub)
1482                .list_versions(self.0.request, self.0.options)
1483                .await
1484                .map(crate::Response::into_body)
1485        }
1486
1487        /// Streams each page in the collection.
1488        pub fn by_page(
1489            self,
1490        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
1491        {
1492            use std::clone::Clone;
1493            let token = self.0.request.page_token.clone();
1494            let execute = move |token: String| {
1495                let mut builder = self.clone();
1496                builder.0.request = builder.0.request.set_page_token(token);
1497                builder.send()
1498            };
1499            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1500        }
1501
1502        /// Streams each item in the collection.
1503        pub fn by_item(
1504            self,
1505        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1506            crate::model::ListVersionsResponse,
1507            crate::Error,
1508        > {
1509            use google_cloud_gax::paginator::Paginator;
1510            self.by_page().items()
1511        }
1512
1513        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
1514        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1515            self.0.request.parent = v.into();
1516            self
1517        }
1518
1519        /// Sets the value of [view][crate::model::ListVersionsRequest::view].
1520        pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1521            self.0.request.view = v.into();
1522            self
1523        }
1524
1525        /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
1526        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1527            self.0.request.page_size = v.into();
1528            self
1529        }
1530
1531        /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
1532        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1533            self.0.request.page_token = v.into();
1534            self
1535        }
1536    }
1537
1538    #[doc(hidden)]
1539    impl crate::RequestBuilder for ListVersions {
1540        fn request_options(&mut self) -> &mut crate::RequestOptions {
1541            &mut self.0.options
1542        }
1543    }
1544
1545    /// The request builder for [Versions::get_version][crate::client::Versions::get_version] calls.
1546    ///
1547    /// # Example
1548    /// ```
1549    /// # use google_cloud_appengine_v1::builder::versions::GetVersion;
1550    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
1551    ///
1552    /// let builder = prepare_request_builder();
1553    /// let response = builder.send().await?;
1554    /// # Ok(()) }
1555    ///
1556    /// fn prepare_request_builder() -> GetVersion {
1557    ///   # panic!();
1558    ///   // ... details omitted ...
1559    /// }
1560    /// ```
1561    #[derive(Clone, Debug)]
1562    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
1563
1564    impl GetVersion {
1565        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1566            Self(RequestBuilder::new(stub))
1567        }
1568
1569        /// Sets the full request, replacing any prior values.
1570        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> 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<crate::model::Version> {
1583            (*self.0.stub)
1584                .get_version(self.0.request, self.0.options)
1585                .await
1586                .map(crate::Response::into_body)
1587        }
1588
1589        /// Sets the value of [name][crate::model::GetVersionRequest::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        /// Sets the value of [view][crate::model::GetVersionRequest::view].
1596        pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1597            self.0.request.view = v.into();
1598            self
1599        }
1600    }
1601
1602    #[doc(hidden)]
1603    impl crate::RequestBuilder for GetVersion {
1604        fn request_options(&mut self) -> &mut crate::RequestOptions {
1605            &mut self.0.options
1606        }
1607    }
1608
1609    /// The request builder for [Versions::create_version][crate::client::Versions::create_version] calls.
1610    ///
1611    /// # Example
1612    /// ```
1613    /// # use google_cloud_appengine_v1::builder::versions::CreateVersion;
1614    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
1615    /// use google_cloud_lro::Poller;
1616    ///
1617    /// let builder = prepare_request_builder();
1618    /// let response = builder.poller().until_done().await?;
1619    /// # Ok(()) }
1620    ///
1621    /// fn prepare_request_builder() -> CreateVersion {
1622    ///   # panic!();
1623    ///   // ... details omitted ...
1624    /// }
1625    /// ```
1626    #[derive(Clone, Debug)]
1627    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
1628
1629    impl CreateVersion {
1630        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1631            Self(RequestBuilder::new(stub))
1632        }
1633
1634        /// Sets the full request, replacing any prior values.
1635        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
1636            self.0.request = v.into();
1637            self
1638        }
1639
1640        /// Sets all the options, replacing any prior values.
1641        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1642            self.0.options = v.into();
1643            self
1644        }
1645
1646        /// Sends the request.
1647        ///
1648        /// # Long running operations
1649        ///
1650        /// This starts, but does not poll, a longrunning operation. More information
1651        /// on [create_version][crate::client::Versions::create_version].
1652        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1653            (*self.0.stub)
1654                .create_version(self.0.request, self.0.options)
1655                .await
1656                .map(crate::Response::into_body)
1657        }
1658
1659        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_version`.
1660        pub fn poller(
1661            self,
1662        ) -> impl google_cloud_lro::Poller<crate::model::Version, crate::model::CreateVersionMetadataV1>
1663        {
1664            type Operation = google_cloud_lro::internal::Operation<
1665                crate::model::Version,
1666                crate::model::CreateVersionMetadataV1,
1667            >;
1668            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1669            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1670            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1671            if let Some(ref mut details) = poller_options.tracing {
1672                details.method_name =
1673                    "google_cloud_appengine_v1::client::Versions::create_version::until_done";
1674            }
1675
1676            let stub = self.0.stub.clone();
1677            let mut options = self.0.options.clone();
1678            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1679            let query = move |name| {
1680                let stub = stub.clone();
1681                let options = options.clone();
1682                async {
1683                    let op = GetOperation::new(stub)
1684                        .set_name(name)
1685                        .with_options(options)
1686                        .send()
1687                        .await?;
1688                    Ok(Operation::new(op))
1689                }
1690            };
1691
1692            let start = move || async {
1693                let op = self.send().await?;
1694                Ok(Operation::new(op))
1695            };
1696
1697            use google_cloud_lro::internal::PollerExt;
1698            {
1699                google_cloud_lro::internal::new_poller(
1700                    polling_error_policy,
1701                    polling_backoff_policy,
1702                    start,
1703                    query,
1704                )
1705            }
1706            .with_options(poller_options)
1707        }
1708
1709        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
1710        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1711            self.0.request.parent = v.into();
1712            self
1713        }
1714
1715        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
1716        pub fn set_version<T>(mut self, v: T) -> Self
1717        where
1718            T: std::convert::Into<crate::model::Version>,
1719        {
1720            self.0.request.version = std::option::Option::Some(v.into());
1721            self
1722        }
1723
1724        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
1725        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1726        where
1727            T: std::convert::Into<crate::model::Version>,
1728        {
1729            self.0.request.version = v.map(|x| x.into());
1730            self
1731        }
1732    }
1733
1734    #[doc(hidden)]
1735    impl crate::RequestBuilder for CreateVersion {
1736        fn request_options(&mut self) -> &mut crate::RequestOptions {
1737            &mut self.0.options
1738        }
1739    }
1740
1741    /// The request builder for [Versions::update_version][crate::client::Versions::update_version] calls.
1742    ///
1743    /// # Example
1744    /// ```
1745    /// # use google_cloud_appengine_v1::builder::versions::UpdateVersion;
1746    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
1747    /// use google_cloud_lro::Poller;
1748    ///
1749    /// let builder = prepare_request_builder();
1750    /// let response = builder.poller().until_done().await?;
1751    /// # Ok(()) }
1752    ///
1753    /// fn prepare_request_builder() -> UpdateVersion {
1754    ///   # panic!();
1755    ///   // ... details omitted ...
1756    /// }
1757    /// ```
1758    #[derive(Clone, Debug)]
1759    pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
1760
1761    impl UpdateVersion {
1762        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1763            Self(RequestBuilder::new(stub))
1764        }
1765
1766        /// Sets the full request, replacing any prior values.
1767        pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
1768            self.0.request = v.into();
1769            self
1770        }
1771
1772        /// Sets all the options, replacing any prior values.
1773        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1774            self.0.options = v.into();
1775            self
1776        }
1777
1778        /// Sends the request.
1779        ///
1780        /// # Long running operations
1781        ///
1782        /// This starts, but does not poll, a longrunning operation. More information
1783        /// on [update_version][crate::client::Versions::update_version].
1784        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1785            (*self.0.stub)
1786                .update_version(self.0.request, self.0.options)
1787                .await
1788                .map(crate::Response::into_body)
1789        }
1790
1791        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_version`.
1792        pub fn poller(
1793            self,
1794        ) -> impl google_cloud_lro::Poller<crate::model::Version, crate::model::OperationMetadataV1>
1795        {
1796            type Operation = google_cloud_lro::internal::Operation<
1797                crate::model::Version,
1798                crate::model::OperationMetadataV1,
1799            >;
1800            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1801            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1802            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1803            if let Some(ref mut details) = poller_options.tracing {
1804                details.method_name =
1805                    "google_cloud_appengine_v1::client::Versions::update_version::until_done";
1806            }
1807
1808            let stub = self.0.stub.clone();
1809            let mut options = self.0.options.clone();
1810            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1811            let query = move |name| {
1812                let stub = stub.clone();
1813                let options = options.clone();
1814                async {
1815                    let op = GetOperation::new(stub)
1816                        .set_name(name)
1817                        .with_options(options)
1818                        .send()
1819                        .await?;
1820                    Ok(Operation::new(op))
1821                }
1822            };
1823
1824            let start = move || async {
1825                let op = self.send().await?;
1826                Ok(Operation::new(op))
1827            };
1828
1829            use google_cloud_lro::internal::PollerExt;
1830            {
1831                google_cloud_lro::internal::new_poller(
1832                    polling_error_policy,
1833                    polling_backoff_policy,
1834                    start,
1835                    query,
1836                )
1837            }
1838            .with_options(poller_options)
1839        }
1840
1841        /// Sets the value of [name][crate::model::UpdateVersionRequest::name].
1842        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1843            self.0.request.name = v.into();
1844            self
1845        }
1846
1847        /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
1848        pub fn set_version<T>(mut self, v: T) -> Self
1849        where
1850            T: std::convert::Into<crate::model::Version>,
1851        {
1852            self.0.request.version = std::option::Option::Some(v.into());
1853            self
1854        }
1855
1856        /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
1857        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1858        where
1859            T: std::convert::Into<crate::model::Version>,
1860        {
1861            self.0.request.version = v.map(|x| x.into());
1862            self
1863        }
1864
1865        /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
1866        pub fn set_update_mask<T>(mut self, v: T) -> Self
1867        where
1868            T: std::convert::Into<wkt::FieldMask>,
1869        {
1870            self.0.request.update_mask = std::option::Option::Some(v.into());
1871            self
1872        }
1873
1874        /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
1875        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1876        where
1877            T: std::convert::Into<wkt::FieldMask>,
1878        {
1879            self.0.request.update_mask = v.map(|x| x.into());
1880            self
1881        }
1882    }
1883
1884    #[doc(hidden)]
1885    impl crate::RequestBuilder for UpdateVersion {
1886        fn request_options(&mut self) -> &mut crate::RequestOptions {
1887            &mut self.0.options
1888        }
1889    }
1890
1891    /// The request builder for [Versions::delete_version][crate::client::Versions::delete_version] calls.
1892    ///
1893    /// # Example
1894    /// ```
1895    /// # use google_cloud_appengine_v1::builder::versions::DeleteVersion;
1896    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
1897    /// use google_cloud_lro::Poller;
1898    ///
1899    /// let builder = prepare_request_builder();
1900    /// let response = builder.poller().until_done().await?;
1901    /// # Ok(()) }
1902    ///
1903    /// fn prepare_request_builder() -> DeleteVersion {
1904    ///   # panic!();
1905    ///   // ... details omitted ...
1906    /// }
1907    /// ```
1908    #[derive(Clone, Debug)]
1909    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
1910
1911    impl DeleteVersion {
1912        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1913            Self(RequestBuilder::new(stub))
1914        }
1915
1916        /// Sets the full request, replacing any prior values.
1917        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
1918            self.0.request = v.into();
1919            self
1920        }
1921
1922        /// Sets all the options, replacing any prior values.
1923        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1924            self.0.options = v.into();
1925            self
1926        }
1927
1928        /// Sends the request.
1929        ///
1930        /// # Long running operations
1931        ///
1932        /// This starts, but does not poll, a longrunning operation. More information
1933        /// on [delete_version][crate::client::Versions::delete_version].
1934        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1935            (*self.0.stub)
1936                .delete_version(self.0.request, self.0.options)
1937                .await
1938                .map(crate::Response::into_body)
1939        }
1940
1941        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_version`.
1942        pub fn poller(
1943            self,
1944        ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
1945            type Operation = google_cloud_lro::internal::Operation<
1946                wkt::Empty,
1947                crate::model::OperationMetadataV1,
1948            >;
1949            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1950            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1951            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1952            if let Some(ref mut details) = poller_options.tracing {
1953                details.method_name =
1954                    "google_cloud_appengine_v1::client::Versions::delete_version::until_done";
1955            }
1956
1957            let stub = self.0.stub.clone();
1958            let mut options = self.0.options.clone();
1959            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1960            let query = move |name| {
1961                let stub = stub.clone();
1962                let options = options.clone();
1963                async {
1964                    let op = GetOperation::new(stub)
1965                        .set_name(name)
1966                        .with_options(options)
1967                        .send()
1968                        .await?;
1969                    Ok(Operation::new(op))
1970                }
1971            };
1972
1973            let start = move || async {
1974                let op = self.send().await?;
1975                Ok(Operation::new(op))
1976            };
1977
1978            use google_cloud_lro::internal::PollerExt;
1979            {
1980                google_cloud_lro::internal::new_unit_response_poller(
1981                    polling_error_policy,
1982                    polling_backoff_policy,
1983                    start,
1984                    query,
1985                )
1986            }
1987            .with_options(poller_options)
1988        }
1989
1990        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
1991        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1992            self.0.request.name = v.into();
1993            self
1994        }
1995    }
1996
1997    #[doc(hidden)]
1998    impl crate::RequestBuilder for DeleteVersion {
1999        fn request_options(&mut self) -> &mut crate::RequestOptions {
2000            &mut self.0.options
2001        }
2002    }
2003
2004    /// The request builder for [Versions::list_operations][crate::client::Versions::list_operations] calls.
2005    ///
2006    /// # Example
2007    /// ```
2008    /// # use google_cloud_appengine_v1::builder::versions::ListOperations;
2009    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2010    /// use google_cloud_gax::paginator::ItemPaginator;
2011    ///
2012    /// let builder = prepare_request_builder();
2013    /// let mut items = builder.by_item();
2014    /// while let Some(result) = items.next().await {
2015    ///   let item = result?;
2016    /// }
2017    /// # Ok(()) }
2018    ///
2019    /// fn prepare_request_builder() -> ListOperations {
2020    ///   # panic!();
2021    ///   // ... details omitted ...
2022    /// }
2023    /// ```
2024    #[derive(Clone, Debug)]
2025    pub struct ListOperations(
2026        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2027    );
2028
2029    impl ListOperations {
2030        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2031            Self(RequestBuilder::new(stub))
2032        }
2033
2034        /// Sets the full request, replacing any prior values.
2035        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2036            mut self,
2037            v: V,
2038        ) -> Self {
2039            self.0.request = v.into();
2040            self
2041        }
2042
2043        /// Sets all the options, replacing any prior values.
2044        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2045            self.0.options = v.into();
2046            self
2047        }
2048
2049        /// Sends the request.
2050        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2051            (*self.0.stub)
2052                .list_operations(self.0.request, self.0.options)
2053                .await
2054                .map(crate::Response::into_body)
2055        }
2056
2057        /// Streams each page in the collection.
2058        pub fn by_page(
2059            self,
2060        ) -> impl google_cloud_gax::paginator::Paginator<
2061            google_cloud_longrunning::model::ListOperationsResponse,
2062            crate::Error,
2063        > {
2064            use std::clone::Clone;
2065            let token = self.0.request.page_token.clone();
2066            let execute = move |token: String| {
2067                let mut builder = self.clone();
2068                builder.0.request = builder.0.request.set_page_token(token);
2069                builder.send()
2070            };
2071            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2072        }
2073
2074        /// Streams each item in the collection.
2075        pub fn by_item(
2076            self,
2077        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2078            google_cloud_longrunning::model::ListOperationsResponse,
2079            crate::Error,
2080        > {
2081            use google_cloud_gax::paginator::Paginator;
2082            self.by_page().items()
2083        }
2084
2085        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2086        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2087            self.0.request.name = v.into();
2088            self
2089        }
2090
2091        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2092        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2093            self.0.request.filter = v.into();
2094            self
2095        }
2096
2097        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2098        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2099            self.0.request.page_size = v.into();
2100            self
2101        }
2102
2103        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2104        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2105            self.0.request.page_token = v.into();
2106            self
2107        }
2108
2109        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2110        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2111            self.0.request.return_partial_success = v.into();
2112            self
2113        }
2114    }
2115
2116    #[doc(hidden)]
2117    impl crate::RequestBuilder for ListOperations {
2118        fn request_options(&mut self) -> &mut crate::RequestOptions {
2119            &mut self.0.options
2120        }
2121    }
2122
2123    /// The request builder for [Versions::get_operation][crate::client::Versions::get_operation] calls.
2124    ///
2125    /// # Example
2126    /// ```
2127    /// # use google_cloud_appengine_v1::builder::versions::GetOperation;
2128    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2129    ///
2130    /// let builder = prepare_request_builder();
2131    /// let response = builder.send().await?;
2132    /// # Ok(()) }
2133    ///
2134    /// fn prepare_request_builder() -> GetOperation {
2135    ///   # panic!();
2136    ///   // ... details omitted ...
2137    /// }
2138    /// ```
2139    #[derive(Clone, Debug)]
2140    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2141
2142    impl GetOperation {
2143        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2144            Self(RequestBuilder::new(stub))
2145        }
2146
2147        /// Sets the full request, replacing any prior values.
2148        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2149            mut self,
2150            v: V,
2151        ) -> Self {
2152            self.0.request = v.into();
2153            self
2154        }
2155
2156        /// Sets all the options, replacing any prior values.
2157        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2158            self.0.options = v.into();
2159            self
2160        }
2161
2162        /// Sends the request.
2163        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2164            (*self.0.stub)
2165                .get_operation(self.0.request, self.0.options)
2166                .await
2167                .map(crate::Response::into_body)
2168        }
2169
2170        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2171        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2172            self.0.request.name = v.into();
2173            self
2174        }
2175    }
2176
2177    #[doc(hidden)]
2178    impl crate::RequestBuilder for GetOperation {
2179        fn request_options(&mut self) -> &mut crate::RequestOptions {
2180            &mut self.0.options
2181        }
2182    }
2183}
2184
2185/// Request and client builders for [Instances][crate::client::Instances].
2186pub mod instances {
2187    use crate::Result;
2188
2189    /// A builder for [Instances][crate::client::Instances].
2190    ///
2191    /// ```
2192    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2193    /// # use google_cloud_appengine_v1::*;
2194    /// # use builder::instances::ClientBuilder;
2195    /// # use client::Instances;
2196    /// let builder : ClientBuilder = Instances::builder();
2197    /// let client = builder
2198    ///     .with_endpoint("https://appengine.googleapis.com")
2199    ///     .build().await?;
2200    /// # Ok(()) }
2201    /// ```
2202    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2203
2204    pub(crate) mod client {
2205        use super::super::super::client::Instances;
2206        pub struct Factory;
2207        impl crate::ClientFactory for Factory {
2208            type Client = Instances;
2209            type Credentials = gaxi::options::Credentials;
2210            async fn build(
2211                self,
2212                config: gaxi::options::ClientConfig,
2213            ) -> crate::ClientBuilderResult<Self::Client> {
2214                Self::Client::new(config).await
2215            }
2216        }
2217    }
2218
2219    /// Common implementation for [crate::client::Instances] request builders.
2220    #[derive(Clone, Debug)]
2221    pub(crate) struct RequestBuilder<R: std::default::Default> {
2222        stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2223        request: R,
2224        options: crate::RequestOptions,
2225    }
2226
2227    impl<R> RequestBuilder<R>
2228    where
2229        R: std::default::Default,
2230    {
2231        pub(crate) fn new(
2232            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2233        ) -> Self {
2234            Self {
2235                stub,
2236                request: R::default(),
2237                options: crate::RequestOptions::default(),
2238            }
2239        }
2240    }
2241
2242    /// The request builder for [Instances::list_instances][crate::client::Instances::list_instances] calls.
2243    ///
2244    /// # Example
2245    /// ```
2246    /// # use google_cloud_appengine_v1::builder::instances::ListInstances;
2247    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2248    /// use google_cloud_gax::paginator::ItemPaginator;
2249    ///
2250    /// let builder = prepare_request_builder();
2251    /// let mut items = builder.by_item();
2252    /// while let Some(result) = items.next().await {
2253    ///   let item = result?;
2254    /// }
2255    /// # Ok(()) }
2256    ///
2257    /// fn prepare_request_builder() -> ListInstances {
2258    ///   # panic!();
2259    ///   // ... details omitted ...
2260    /// }
2261    /// ```
2262    #[derive(Clone, Debug)]
2263    pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
2264
2265    impl ListInstances {
2266        pub(crate) fn new(
2267            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2268        ) -> Self {
2269            Self(RequestBuilder::new(stub))
2270        }
2271
2272        /// Sets the full request, replacing any prior values.
2273        pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
2274            self.0.request = v.into();
2275            self
2276        }
2277
2278        /// Sets all the options, replacing any prior values.
2279        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2280            self.0.options = v.into();
2281            self
2282        }
2283
2284        /// Sends the request.
2285        pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
2286            (*self.0.stub)
2287                .list_instances(self.0.request, self.0.options)
2288                .await
2289                .map(crate::Response::into_body)
2290        }
2291
2292        /// Streams each page in the collection.
2293        pub fn by_page(
2294            self,
2295        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
2296        {
2297            use std::clone::Clone;
2298            let token = self.0.request.page_token.clone();
2299            let execute = move |token: String| {
2300                let mut builder = self.clone();
2301                builder.0.request = builder.0.request.set_page_token(token);
2302                builder.send()
2303            };
2304            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2305        }
2306
2307        /// Streams each item in the collection.
2308        pub fn by_item(
2309            self,
2310        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2311            crate::model::ListInstancesResponse,
2312            crate::Error,
2313        > {
2314            use google_cloud_gax::paginator::Paginator;
2315            self.by_page().items()
2316        }
2317
2318        /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
2319        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2320            self.0.request.parent = v.into();
2321            self
2322        }
2323
2324        /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
2325        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2326            self.0.request.page_size = v.into();
2327            self
2328        }
2329
2330        /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
2331        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2332            self.0.request.page_token = v.into();
2333            self
2334        }
2335    }
2336
2337    #[doc(hidden)]
2338    impl crate::RequestBuilder for ListInstances {
2339        fn request_options(&mut self) -> &mut crate::RequestOptions {
2340            &mut self.0.options
2341        }
2342    }
2343
2344    /// The request builder for [Instances::get_instance][crate::client::Instances::get_instance] calls.
2345    ///
2346    /// # Example
2347    /// ```
2348    /// # use google_cloud_appengine_v1::builder::instances::GetInstance;
2349    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2350    ///
2351    /// let builder = prepare_request_builder();
2352    /// let response = builder.send().await?;
2353    /// # Ok(()) }
2354    ///
2355    /// fn prepare_request_builder() -> GetInstance {
2356    ///   # panic!();
2357    ///   // ... details omitted ...
2358    /// }
2359    /// ```
2360    #[derive(Clone, Debug)]
2361    pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2362
2363    impl GetInstance {
2364        pub(crate) fn new(
2365            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2366        ) -> Self {
2367            Self(RequestBuilder::new(stub))
2368        }
2369
2370        /// Sets the full request, replacing any prior values.
2371        pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2372            self.0.request = v.into();
2373            self
2374        }
2375
2376        /// Sets all the options, replacing any prior values.
2377        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2378            self.0.options = v.into();
2379            self
2380        }
2381
2382        /// Sends the request.
2383        pub async fn send(self) -> Result<crate::model::Instance> {
2384            (*self.0.stub)
2385                .get_instance(self.0.request, self.0.options)
2386                .await
2387                .map(crate::Response::into_body)
2388        }
2389
2390        /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2391        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2392            self.0.request.name = v.into();
2393            self
2394        }
2395    }
2396
2397    #[doc(hidden)]
2398    impl crate::RequestBuilder for GetInstance {
2399        fn request_options(&mut self) -> &mut crate::RequestOptions {
2400            &mut self.0.options
2401        }
2402    }
2403
2404    /// The request builder for [Instances::delete_instance][crate::client::Instances::delete_instance] calls.
2405    ///
2406    /// # Example
2407    /// ```
2408    /// # use google_cloud_appengine_v1::builder::instances::DeleteInstance;
2409    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2410    /// use google_cloud_lro::Poller;
2411    ///
2412    /// let builder = prepare_request_builder();
2413    /// let response = builder.poller().until_done().await?;
2414    /// # Ok(()) }
2415    ///
2416    /// fn prepare_request_builder() -> DeleteInstance {
2417    ///   # panic!();
2418    ///   // ... details omitted ...
2419    /// }
2420    /// ```
2421    #[derive(Clone, Debug)]
2422    pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
2423
2424    impl DeleteInstance {
2425        pub(crate) fn new(
2426            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2427        ) -> Self {
2428            Self(RequestBuilder::new(stub))
2429        }
2430
2431        /// Sets the full request, replacing any prior values.
2432        pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
2433            self.0.request = v.into();
2434            self
2435        }
2436
2437        /// Sets all the options, replacing any prior values.
2438        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2439            self.0.options = v.into();
2440            self
2441        }
2442
2443        /// Sends the request.
2444        ///
2445        /// # Long running operations
2446        ///
2447        /// This starts, but does not poll, a longrunning operation. More information
2448        /// on [delete_instance][crate::client::Instances::delete_instance].
2449        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2450            (*self.0.stub)
2451                .delete_instance(self.0.request, self.0.options)
2452                .await
2453                .map(crate::Response::into_body)
2454        }
2455
2456        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_instance`.
2457        pub fn poller(
2458            self,
2459        ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
2460            type Operation = google_cloud_lro::internal::Operation<
2461                wkt::Empty,
2462                crate::model::OperationMetadataV1,
2463            >;
2464            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2465            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2466            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2467            if let Some(ref mut details) = poller_options.tracing {
2468                details.method_name =
2469                    "google_cloud_appengine_v1::client::Instances::delete_instance::until_done";
2470            }
2471
2472            let stub = self.0.stub.clone();
2473            let mut options = self.0.options.clone();
2474            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2475            let query = move |name| {
2476                let stub = stub.clone();
2477                let options = options.clone();
2478                async {
2479                    let op = GetOperation::new(stub)
2480                        .set_name(name)
2481                        .with_options(options)
2482                        .send()
2483                        .await?;
2484                    Ok(Operation::new(op))
2485                }
2486            };
2487
2488            let start = move || async {
2489                let op = self.send().await?;
2490                Ok(Operation::new(op))
2491            };
2492
2493            use google_cloud_lro::internal::PollerExt;
2494            {
2495                google_cloud_lro::internal::new_unit_response_poller(
2496                    polling_error_policy,
2497                    polling_backoff_policy,
2498                    start,
2499                    query,
2500                )
2501            }
2502            .with_options(poller_options)
2503        }
2504
2505        /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
2506        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2507            self.0.request.name = v.into();
2508            self
2509        }
2510    }
2511
2512    #[doc(hidden)]
2513    impl crate::RequestBuilder for DeleteInstance {
2514        fn request_options(&mut self) -> &mut crate::RequestOptions {
2515            &mut self.0.options
2516        }
2517    }
2518
2519    /// The request builder for [Instances::debug_instance][crate::client::Instances::debug_instance] calls.
2520    ///
2521    /// # Example
2522    /// ```
2523    /// # use google_cloud_appengine_v1::builder::instances::DebugInstance;
2524    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2525    /// use google_cloud_lro::Poller;
2526    ///
2527    /// let builder = prepare_request_builder();
2528    /// let response = builder.poller().until_done().await?;
2529    /// # Ok(()) }
2530    ///
2531    /// fn prepare_request_builder() -> DebugInstance {
2532    ///   # panic!();
2533    ///   // ... details omitted ...
2534    /// }
2535    /// ```
2536    #[derive(Clone, Debug)]
2537    pub struct DebugInstance(RequestBuilder<crate::model::DebugInstanceRequest>);
2538
2539    impl DebugInstance {
2540        pub(crate) fn new(
2541            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2542        ) -> Self {
2543            Self(RequestBuilder::new(stub))
2544        }
2545
2546        /// Sets the full request, replacing any prior values.
2547        pub fn with_request<V: Into<crate::model::DebugInstanceRequest>>(mut self, v: V) -> Self {
2548            self.0.request = v.into();
2549            self
2550        }
2551
2552        /// Sets all the options, replacing any prior values.
2553        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2554            self.0.options = v.into();
2555            self
2556        }
2557
2558        /// Sends the request.
2559        ///
2560        /// # Long running operations
2561        ///
2562        /// This starts, but does not poll, a longrunning operation. More information
2563        /// on [debug_instance][crate::client::Instances::debug_instance].
2564        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2565            (*self.0.stub)
2566                .debug_instance(self.0.request, self.0.options)
2567                .await
2568                .map(crate::Response::into_body)
2569        }
2570
2571        /// Creates a [Poller][google_cloud_lro::Poller] to work with `debug_instance`.
2572        pub fn poller(
2573            self,
2574        ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadataV1>
2575        {
2576            type Operation = google_cloud_lro::internal::Operation<
2577                crate::model::Instance,
2578                crate::model::OperationMetadataV1,
2579            >;
2580            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2581            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2582            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2583            if let Some(ref mut details) = poller_options.tracing {
2584                details.method_name =
2585                    "google_cloud_appengine_v1::client::Instances::debug_instance::until_done";
2586            }
2587
2588            let stub = self.0.stub.clone();
2589            let mut options = self.0.options.clone();
2590            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2591            let query = move |name| {
2592                let stub = stub.clone();
2593                let options = options.clone();
2594                async {
2595                    let op = GetOperation::new(stub)
2596                        .set_name(name)
2597                        .with_options(options)
2598                        .send()
2599                        .await?;
2600                    Ok(Operation::new(op))
2601                }
2602            };
2603
2604            let start = move || async {
2605                let op = self.send().await?;
2606                Ok(Operation::new(op))
2607            };
2608
2609            use google_cloud_lro::internal::PollerExt;
2610            {
2611                google_cloud_lro::internal::new_poller(
2612                    polling_error_policy,
2613                    polling_backoff_policy,
2614                    start,
2615                    query,
2616                )
2617            }
2618            .with_options(poller_options)
2619        }
2620
2621        /// Sets the value of [name][crate::model::DebugInstanceRequest::name].
2622        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2623            self.0.request.name = v.into();
2624            self
2625        }
2626
2627        /// Sets the value of [ssh_key][crate::model::DebugInstanceRequest::ssh_key].
2628        pub fn set_ssh_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
2629            self.0.request.ssh_key = v.into();
2630            self
2631        }
2632    }
2633
2634    #[doc(hidden)]
2635    impl crate::RequestBuilder for DebugInstance {
2636        fn request_options(&mut self) -> &mut crate::RequestOptions {
2637            &mut self.0.options
2638        }
2639    }
2640
2641    /// The request builder for [Instances::list_operations][crate::client::Instances::list_operations] calls.
2642    ///
2643    /// # Example
2644    /// ```
2645    /// # use google_cloud_appengine_v1::builder::instances::ListOperations;
2646    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2647    /// use google_cloud_gax::paginator::ItemPaginator;
2648    ///
2649    /// let builder = prepare_request_builder();
2650    /// let mut items = builder.by_item();
2651    /// while let Some(result) = items.next().await {
2652    ///   let item = result?;
2653    /// }
2654    /// # Ok(()) }
2655    ///
2656    /// fn prepare_request_builder() -> ListOperations {
2657    ///   # panic!();
2658    ///   // ... details omitted ...
2659    /// }
2660    /// ```
2661    #[derive(Clone, Debug)]
2662    pub struct ListOperations(
2663        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2664    );
2665
2666    impl ListOperations {
2667        pub(crate) fn new(
2668            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2669        ) -> Self {
2670            Self(RequestBuilder::new(stub))
2671        }
2672
2673        /// Sets the full request, replacing any prior values.
2674        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2675            mut self,
2676            v: V,
2677        ) -> Self {
2678            self.0.request = v.into();
2679            self
2680        }
2681
2682        /// Sets all the options, replacing any prior values.
2683        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2684            self.0.options = v.into();
2685            self
2686        }
2687
2688        /// Sends the request.
2689        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2690            (*self.0.stub)
2691                .list_operations(self.0.request, self.0.options)
2692                .await
2693                .map(crate::Response::into_body)
2694        }
2695
2696        /// Streams each page in the collection.
2697        pub fn by_page(
2698            self,
2699        ) -> impl google_cloud_gax::paginator::Paginator<
2700            google_cloud_longrunning::model::ListOperationsResponse,
2701            crate::Error,
2702        > {
2703            use std::clone::Clone;
2704            let token = self.0.request.page_token.clone();
2705            let execute = move |token: String| {
2706                let mut builder = self.clone();
2707                builder.0.request = builder.0.request.set_page_token(token);
2708                builder.send()
2709            };
2710            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2711        }
2712
2713        /// Streams each item in the collection.
2714        pub fn by_item(
2715            self,
2716        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2717            google_cloud_longrunning::model::ListOperationsResponse,
2718            crate::Error,
2719        > {
2720            use google_cloud_gax::paginator::Paginator;
2721            self.by_page().items()
2722        }
2723
2724        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2725        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2726            self.0.request.name = v.into();
2727            self
2728        }
2729
2730        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2731        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2732            self.0.request.filter = v.into();
2733            self
2734        }
2735
2736        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2737        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2738            self.0.request.page_size = v.into();
2739            self
2740        }
2741
2742        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2743        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2744            self.0.request.page_token = v.into();
2745            self
2746        }
2747
2748        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2749        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2750            self.0.request.return_partial_success = v.into();
2751            self
2752        }
2753    }
2754
2755    #[doc(hidden)]
2756    impl crate::RequestBuilder for ListOperations {
2757        fn request_options(&mut self) -> &mut crate::RequestOptions {
2758            &mut self.0.options
2759        }
2760    }
2761
2762    /// The request builder for [Instances::get_operation][crate::client::Instances::get_operation] calls.
2763    ///
2764    /// # Example
2765    /// ```
2766    /// # use google_cloud_appengine_v1::builder::instances::GetOperation;
2767    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2768    ///
2769    /// let builder = prepare_request_builder();
2770    /// let response = builder.send().await?;
2771    /// # Ok(()) }
2772    ///
2773    /// fn prepare_request_builder() -> GetOperation {
2774    ///   # panic!();
2775    ///   // ... details omitted ...
2776    /// }
2777    /// ```
2778    #[derive(Clone, Debug)]
2779    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2780
2781    impl GetOperation {
2782        pub(crate) fn new(
2783            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2784        ) -> Self {
2785            Self(RequestBuilder::new(stub))
2786        }
2787
2788        /// Sets the full request, replacing any prior values.
2789        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2790            mut self,
2791            v: V,
2792        ) -> Self {
2793            self.0.request = v.into();
2794            self
2795        }
2796
2797        /// Sets all the options, replacing any prior values.
2798        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2799            self.0.options = v.into();
2800            self
2801        }
2802
2803        /// Sends the request.
2804        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2805            (*self.0.stub)
2806                .get_operation(self.0.request, self.0.options)
2807                .await
2808                .map(crate::Response::into_body)
2809        }
2810
2811        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2812        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2813            self.0.request.name = v.into();
2814            self
2815        }
2816    }
2817
2818    #[doc(hidden)]
2819    impl crate::RequestBuilder for GetOperation {
2820        fn request_options(&mut self) -> &mut crate::RequestOptions {
2821            &mut self.0.options
2822        }
2823    }
2824}
2825
2826/// Request and client builders for [Firewall][crate::client::Firewall].
2827pub mod firewall {
2828    use crate::Result;
2829
2830    /// A builder for [Firewall][crate::client::Firewall].
2831    ///
2832    /// ```
2833    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2834    /// # use google_cloud_appengine_v1::*;
2835    /// # use builder::firewall::ClientBuilder;
2836    /// # use client::Firewall;
2837    /// let builder : ClientBuilder = Firewall::builder();
2838    /// let client = builder
2839    ///     .with_endpoint("https://appengine.googleapis.com")
2840    ///     .build().await?;
2841    /// # Ok(()) }
2842    /// ```
2843    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2844
2845    pub(crate) mod client {
2846        use super::super::super::client::Firewall;
2847        pub struct Factory;
2848        impl crate::ClientFactory for Factory {
2849            type Client = Firewall;
2850            type Credentials = gaxi::options::Credentials;
2851            async fn build(
2852                self,
2853                config: gaxi::options::ClientConfig,
2854            ) -> crate::ClientBuilderResult<Self::Client> {
2855                Self::Client::new(config).await
2856            }
2857        }
2858    }
2859
2860    /// Common implementation for [crate::client::Firewall] request builders.
2861    #[derive(Clone, Debug)]
2862    pub(crate) struct RequestBuilder<R: std::default::Default> {
2863        stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>,
2864        request: R,
2865        options: crate::RequestOptions,
2866    }
2867
2868    impl<R> RequestBuilder<R>
2869    where
2870        R: std::default::Default,
2871    {
2872        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2873            Self {
2874                stub,
2875                request: R::default(),
2876                options: crate::RequestOptions::default(),
2877            }
2878        }
2879    }
2880
2881    /// The request builder for [Firewall::list_ingress_rules][crate::client::Firewall::list_ingress_rules] calls.
2882    ///
2883    /// # Example
2884    /// ```
2885    /// # use google_cloud_appengine_v1::builder::firewall::ListIngressRules;
2886    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2887    /// use google_cloud_gax::paginator::ItemPaginator;
2888    ///
2889    /// let builder = prepare_request_builder();
2890    /// let mut items = builder.by_item();
2891    /// while let Some(result) = items.next().await {
2892    ///   let item = result?;
2893    /// }
2894    /// # Ok(()) }
2895    ///
2896    /// fn prepare_request_builder() -> ListIngressRules {
2897    ///   # panic!();
2898    ///   // ... details omitted ...
2899    /// }
2900    /// ```
2901    #[derive(Clone, Debug)]
2902    pub struct ListIngressRules(RequestBuilder<crate::model::ListIngressRulesRequest>);
2903
2904    impl ListIngressRules {
2905        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2906            Self(RequestBuilder::new(stub))
2907        }
2908
2909        /// Sets the full request, replacing any prior values.
2910        pub fn with_request<V: Into<crate::model::ListIngressRulesRequest>>(
2911            mut self,
2912            v: V,
2913        ) -> Self {
2914            self.0.request = v.into();
2915            self
2916        }
2917
2918        /// Sets all the options, replacing any prior values.
2919        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2920            self.0.options = v.into();
2921            self
2922        }
2923
2924        /// Sends the request.
2925        pub async fn send(self) -> Result<crate::model::ListIngressRulesResponse> {
2926            (*self.0.stub)
2927                .list_ingress_rules(self.0.request, self.0.options)
2928                .await
2929                .map(crate::Response::into_body)
2930        }
2931
2932        /// Streams each page in the collection.
2933        pub fn by_page(
2934            self,
2935        ) -> impl google_cloud_gax::paginator::Paginator<
2936            crate::model::ListIngressRulesResponse,
2937            crate::Error,
2938        > {
2939            use std::clone::Clone;
2940            let token = self.0.request.page_token.clone();
2941            let execute = move |token: String| {
2942                let mut builder = self.clone();
2943                builder.0.request = builder.0.request.set_page_token(token);
2944                builder.send()
2945            };
2946            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2947        }
2948
2949        /// Streams each item in the collection.
2950        pub fn by_item(
2951            self,
2952        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2953            crate::model::ListIngressRulesResponse,
2954            crate::Error,
2955        > {
2956            use google_cloud_gax::paginator::Paginator;
2957            self.by_page().items()
2958        }
2959
2960        /// Sets the value of [parent][crate::model::ListIngressRulesRequest::parent].
2961        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2962            self.0.request.parent = v.into();
2963            self
2964        }
2965
2966        /// Sets the value of [page_size][crate::model::ListIngressRulesRequest::page_size].
2967        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2968            self.0.request.page_size = v.into();
2969            self
2970        }
2971
2972        /// Sets the value of [page_token][crate::model::ListIngressRulesRequest::page_token].
2973        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974            self.0.request.page_token = v.into();
2975            self
2976        }
2977
2978        /// Sets the value of [matching_address][crate::model::ListIngressRulesRequest::matching_address].
2979        pub fn set_matching_address<T: Into<std::string::String>>(mut self, v: T) -> Self {
2980            self.0.request.matching_address = v.into();
2981            self
2982        }
2983    }
2984
2985    #[doc(hidden)]
2986    impl crate::RequestBuilder for ListIngressRules {
2987        fn request_options(&mut self) -> &mut crate::RequestOptions {
2988            &mut self.0.options
2989        }
2990    }
2991
2992    /// The request builder for [Firewall::batch_update_ingress_rules][crate::client::Firewall::batch_update_ingress_rules] calls.
2993    ///
2994    /// # Example
2995    /// ```
2996    /// # use google_cloud_appengine_v1::builder::firewall::BatchUpdateIngressRules;
2997    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
2998    ///
2999    /// let builder = prepare_request_builder();
3000    /// let response = builder.send().await?;
3001    /// # Ok(()) }
3002    ///
3003    /// fn prepare_request_builder() -> BatchUpdateIngressRules {
3004    ///   # panic!();
3005    ///   // ... details omitted ...
3006    /// }
3007    /// ```
3008    #[derive(Clone, Debug)]
3009    pub struct BatchUpdateIngressRules(
3010        RequestBuilder<crate::model::BatchUpdateIngressRulesRequest>,
3011    );
3012
3013    impl BatchUpdateIngressRules {
3014        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3015            Self(RequestBuilder::new(stub))
3016        }
3017
3018        /// Sets the full request, replacing any prior values.
3019        pub fn with_request<V: Into<crate::model::BatchUpdateIngressRulesRequest>>(
3020            mut self,
3021            v: V,
3022        ) -> Self {
3023            self.0.request = v.into();
3024            self
3025        }
3026
3027        /// Sets all the options, replacing any prior values.
3028        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3029            self.0.options = v.into();
3030            self
3031        }
3032
3033        /// Sends the request.
3034        pub async fn send(self) -> Result<crate::model::BatchUpdateIngressRulesResponse> {
3035            (*self.0.stub)
3036                .batch_update_ingress_rules(self.0.request, self.0.options)
3037                .await
3038                .map(crate::Response::into_body)
3039        }
3040
3041        /// Sets the value of [name][crate::model::BatchUpdateIngressRulesRequest::name].
3042        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3043            self.0.request.name = v.into();
3044            self
3045        }
3046
3047        /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesRequest::ingress_rules].
3048        pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3049        where
3050            T: std::iter::IntoIterator<Item = V>,
3051            V: std::convert::Into<crate::model::FirewallRule>,
3052        {
3053            use std::iter::Iterator;
3054            self.0.request.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3055            self
3056        }
3057    }
3058
3059    #[doc(hidden)]
3060    impl crate::RequestBuilder for BatchUpdateIngressRules {
3061        fn request_options(&mut self) -> &mut crate::RequestOptions {
3062            &mut self.0.options
3063        }
3064    }
3065
3066    /// The request builder for [Firewall::create_ingress_rule][crate::client::Firewall::create_ingress_rule] calls.
3067    ///
3068    /// # Example
3069    /// ```
3070    /// # use google_cloud_appengine_v1::builder::firewall::CreateIngressRule;
3071    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3072    ///
3073    /// let builder = prepare_request_builder();
3074    /// let response = builder.send().await?;
3075    /// # Ok(()) }
3076    ///
3077    /// fn prepare_request_builder() -> CreateIngressRule {
3078    ///   # panic!();
3079    ///   // ... details omitted ...
3080    /// }
3081    /// ```
3082    #[derive(Clone, Debug)]
3083    pub struct CreateIngressRule(RequestBuilder<crate::model::CreateIngressRuleRequest>);
3084
3085    impl CreateIngressRule {
3086        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3087            Self(RequestBuilder::new(stub))
3088        }
3089
3090        /// Sets the full request, replacing any prior values.
3091        pub fn with_request<V: Into<crate::model::CreateIngressRuleRequest>>(
3092            mut self,
3093            v: V,
3094        ) -> Self {
3095            self.0.request = v.into();
3096            self
3097        }
3098
3099        /// Sets all the options, replacing any prior values.
3100        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3101            self.0.options = v.into();
3102            self
3103        }
3104
3105        /// Sends the request.
3106        pub async fn send(self) -> Result<crate::model::FirewallRule> {
3107            (*self.0.stub)
3108                .create_ingress_rule(self.0.request, self.0.options)
3109                .await
3110                .map(crate::Response::into_body)
3111        }
3112
3113        /// Sets the value of [parent][crate::model::CreateIngressRuleRequest::parent].
3114        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3115            self.0.request.parent = v.into();
3116            self
3117        }
3118
3119        /// Sets the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3120        pub fn set_rule<T>(mut self, v: T) -> Self
3121        where
3122            T: std::convert::Into<crate::model::FirewallRule>,
3123        {
3124            self.0.request.rule = std::option::Option::Some(v.into());
3125            self
3126        }
3127
3128        /// Sets or clears the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3129        pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3130        where
3131            T: std::convert::Into<crate::model::FirewallRule>,
3132        {
3133            self.0.request.rule = v.map(|x| x.into());
3134            self
3135        }
3136    }
3137
3138    #[doc(hidden)]
3139    impl crate::RequestBuilder for CreateIngressRule {
3140        fn request_options(&mut self) -> &mut crate::RequestOptions {
3141            &mut self.0.options
3142        }
3143    }
3144
3145    /// The request builder for [Firewall::get_ingress_rule][crate::client::Firewall::get_ingress_rule] calls.
3146    ///
3147    /// # Example
3148    /// ```
3149    /// # use google_cloud_appengine_v1::builder::firewall::GetIngressRule;
3150    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3151    ///
3152    /// let builder = prepare_request_builder();
3153    /// let response = builder.send().await?;
3154    /// # Ok(()) }
3155    ///
3156    /// fn prepare_request_builder() -> GetIngressRule {
3157    ///   # panic!();
3158    ///   // ... details omitted ...
3159    /// }
3160    /// ```
3161    #[derive(Clone, Debug)]
3162    pub struct GetIngressRule(RequestBuilder<crate::model::GetIngressRuleRequest>);
3163
3164    impl GetIngressRule {
3165        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3166            Self(RequestBuilder::new(stub))
3167        }
3168
3169        /// Sets the full request, replacing any prior values.
3170        pub fn with_request<V: Into<crate::model::GetIngressRuleRequest>>(mut self, v: V) -> Self {
3171            self.0.request = v.into();
3172            self
3173        }
3174
3175        /// Sets all the options, replacing any prior values.
3176        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3177            self.0.options = v.into();
3178            self
3179        }
3180
3181        /// Sends the request.
3182        pub async fn send(self) -> Result<crate::model::FirewallRule> {
3183            (*self.0.stub)
3184                .get_ingress_rule(self.0.request, self.0.options)
3185                .await
3186                .map(crate::Response::into_body)
3187        }
3188
3189        /// Sets the value of [name][crate::model::GetIngressRuleRequest::name].
3190        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3191            self.0.request.name = v.into();
3192            self
3193        }
3194    }
3195
3196    #[doc(hidden)]
3197    impl crate::RequestBuilder for GetIngressRule {
3198        fn request_options(&mut self) -> &mut crate::RequestOptions {
3199            &mut self.0.options
3200        }
3201    }
3202
3203    /// The request builder for [Firewall::update_ingress_rule][crate::client::Firewall::update_ingress_rule] calls.
3204    ///
3205    /// # Example
3206    /// ```
3207    /// # use google_cloud_appengine_v1::builder::firewall::UpdateIngressRule;
3208    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3209    ///
3210    /// let builder = prepare_request_builder();
3211    /// let response = builder.send().await?;
3212    /// # Ok(()) }
3213    ///
3214    /// fn prepare_request_builder() -> UpdateIngressRule {
3215    ///   # panic!();
3216    ///   // ... details omitted ...
3217    /// }
3218    /// ```
3219    #[derive(Clone, Debug)]
3220    pub struct UpdateIngressRule(RequestBuilder<crate::model::UpdateIngressRuleRequest>);
3221
3222    impl UpdateIngressRule {
3223        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3224            Self(RequestBuilder::new(stub))
3225        }
3226
3227        /// Sets the full request, replacing any prior values.
3228        pub fn with_request<V: Into<crate::model::UpdateIngressRuleRequest>>(
3229            mut self,
3230            v: V,
3231        ) -> Self {
3232            self.0.request = v.into();
3233            self
3234        }
3235
3236        /// Sets all the options, replacing any prior values.
3237        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3238            self.0.options = v.into();
3239            self
3240        }
3241
3242        /// Sends the request.
3243        pub async fn send(self) -> Result<crate::model::FirewallRule> {
3244            (*self.0.stub)
3245                .update_ingress_rule(self.0.request, self.0.options)
3246                .await
3247                .map(crate::Response::into_body)
3248        }
3249
3250        /// Sets the value of [name][crate::model::UpdateIngressRuleRequest::name].
3251        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3252            self.0.request.name = v.into();
3253            self
3254        }
3255
3256        /// Sets the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3257        pub fn set_rule<T>(mut self, v: T) -> Self
3258        where
3259            T: std::convert::Into<crate::model::FirewallRule>,
3260        {
3261            self.0.request.rule = std::option::Option::Some(v.into());
3262            self
3263        }
3264
3265        /// Sets or clears the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3266        pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3267        where
3268            T: std::convert::Into<crate::model::FirewallRule>,
3269        {
3270            self.0.request.rule = v.map(|x| x.into());
3271            self
3272        }
3273
3274        /// Sets the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3275        pub fn set_update_mask<T>(mut self, v: T) -> Self
3276        where
3277            T: std::convert::Into<wkt::FieldMask>,
3278        {
3279            self.0.request.update_mask = std::option::Option::Some(v.into());
3280            self
3281        }
3282
3283        /// Sets or clears the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3284        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3285        where
3286            T: std::convert::Into<wkt::FieldMask>,
3287        {
3288            self.0.request.update_mask = v.map(|x| x.into());
3289            self
3290        }
3291    }
3292
3293    #[doc(hidden)]
3294    impl crate::RequestBuilder for UpdateIngressRule {
3295        fn request_options(&mut self) -> &mut crate::RequestOptions {
3296            &mut self.0.options
3297        }
3298    }
3299
3300    /// The request builder for [Firewall::delete_ingress_rule][crate::client::Firewall::delete_ingress_rule] calls.
3301    ///
3302    /// # Example
3303    /// ```
3304    /// # use google_cloud_appengine_v1::builder::firewall::DeleteIngressRule;
3305    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3306    ///
3307    /// let builder = prepare_request_builder();
3308    /// let response = builder.send().await?;
3309    /// # Ok(()) }
3310    ///
3311    /// fn prepare_request_builder() -> DeleteIngressRule {
3312    ///   # panic!();
3313    ///   // ... details omitted ...
3314    /// }
3315    /// ```
3316    #[derive(Clone, Debug)]
3317    pub struct DeleteIngressRule(RequestBuilder<crate::model::DeleteIngressRuleRequest>);
3318
3319    impl DeleteIngressRule {
3320        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3321            Self(RequestBuilder::new(stub))
3322        }
3323
3324        /// Sets the full request, replacing any prior values.
3325        pub fn with_request<V: Into<crate::model::DeleteIngressRuleRequest>>(
3326            mut self,
3327            v: V,
3328        ) -> Self {
3329            self.0.request = v.into();
3330            self
3331        }
3332
3333        /// Sets all the options, replacing any prior values.
3334        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3335            self.0.options = v.into();
3336            self
3337        }
3338
3339        /// Sends the request.
3340        pub async fn send(self) -> Result<()> {
3341            (*self.0.stub)
3342                .delete_ingress_rule(self.0.request, self.0.options)
3343                .await
3344                .map(crate::Response::into_body)
3345        }
3346
3347        /// Sets the value of [name][crate::model::DeleteIngressRuleRequest::name].
3348        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3349            self.0.request.name = v.into();
3350            self
3351        }
3352    }
3353
3354    #[doc(hidden)]
3355    impl crate::RequestBuilder for DeleteIngressRule {
3356        fn request_options(&mut self) -> &mut crate::RequestOptions {
3357            &mut self.0.options
3358        }
3359    }
3360
3361    /// The request builder for [Firewall::list_operations][crate::client::Firewall::list_operations] calls.
3362    ///
3363    /// # Example
3364    /// ```
3365    /// # use google_cloud_appengine_v1::builder::firewall::ListOperations;
3366    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3367    /// use google_cloud_gax::paginator::ItemPaginator;
3368    ///
3369    /// let builder = prepare_request_builder();
3370    /// let mut items = builder.by_item();
3371    /// while let Some(result) = items.next().await {
3372    ///   let item = result?;
3373    /// }
3374    /// # Ok(()) }
3375    ///
3376    /// fn prepare_request_builder() -> ListOperations {
3377    ///   # panic!();
3378    ///   // ... details omitted ...
3379    /// }
3380    /// ```
3381    #[derive(Clone, Debug)]
3382    pub struct ListOperations(
3383        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3384    );
3385
3386    impl ListOperations {
3387        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3388            Self(RequestBuilder::new(stub))
3389        }
3390
3391        /// Sets the full request, replacing any prior values.
3392        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3393            mut self,
3394            v: V,
3395        ) -> Self {
3396            self.0.request = v.into();
3397            self
3398        }
3399
3400        /// Sets all the options, replacing any prior values.
3401        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3402            self.0.options = v.into();
3403            self
3404        }
3405
3406        /// Sends the request.
3407        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3408            (*self.0.stub)
3409                .list_operations(self.0.request, self.0.options)
3410                .await
3411                .map(crate::Response::into_body)
3412        }
3413
3414        /// Streams each page in the collection.
3415        pub fn by_page(
3416            self,
3417        ) -> impl google_cloud_gax::paginator::Paginator<
3418            google_cloud_longrunning::model::ListOperationsResponse,
3419            crate::Error,
3420        > {
3421            use std::clone::Clone;
3422            let token = self.0.request.page_token.clone();
3423            let execute = move |token: String| {
3424                let mut builder = self.clone();
3425                builder.0.request = builder.0.request.set_page_token(token);
3426                builder.send()
3427            };
3428            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3429        }
3430
3431        /// Streams each item in the collection.
3432        pub fn by_item(
3433            self,
3434        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3435            google_cloud_longrunning::model::ListOperationsResponse,
3436            crate::Error,
3437        > {
3438            use google_cloud_gax::paginator::Paginator;
3439            self.by_page().items()
3440        }
3441
3442        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3443        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3444            self.0.request.name = v.into();
3445            self
3446        }
3447
3448        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3449        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3450            self.0.request.filter = v.into();
3451            self
3452        }
3453
3454        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3455        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3456            self.0.request.page_size = v.into();
3457            self
3458        }
3459
3460        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3461        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3462            self.0.request.page_token = v.into();
3463            self
3464        }
3465
3466        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3467        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3468            self.0.request.return_partial_success = v.into();
3469            self
3470        }
3471    }
3472
3473    #[doc(hidden)]
3474    impl crate::RequestBuilder for ListOperations {
3475        fn request_options(&mut self) -> &mut crate::RequestOptions {
3476            &mut self.0.options
3477        }
3478    }
3479
3480    /// The request builder for [Firewall::get_operation][crate::client::Firewall::get_operation] calls.
3481    ///
3482    /// # Example
3483    /// ```
3484    /// # use google_cloud_appengine_v1::builder::firewall::GetOperation;
3485    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3486    ///
3487    /// let builder = prepare_request_builder();
3488    /// let response = builder.send().await?;
3489    /// # Ok(()) }
3490    ///
3491    /// fn prepare_request_builder() -> GetOperation {
3492    ///   # panic!();
3493    ///   // ... details omitted ...
3494    /// }
3495    /// ```
3496    #[derive(Clone, Debug)]
3497    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3498
3499    impl GetOperation {
3500        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3501            Self(RequestBuilder::new(stub))
3502        }
3503
3504        /// Sets the full request, replacing any prior values.
3505        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3506            mut self,
3507            v: V,
3508        ) -> Self {
3509            self.0.request = v.into();
3510            self
3511        }
3512
3513        /// Sets all the options, replacing any prior values.
3514        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3515            self.0.options = v.into();
3516            self
3517        }
3518
3519        /// Sends the request.
3520        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3521            (*self.0.stub)
3522                .get_operation(self.0.request, self.0.options)
3523                .await
3524                .map(crate::Response::into_body)
3525        }
3526
3527        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3528        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3529            self.0.request.name = v.into();
3530            self
3531        }
3532    }
3533
3534    #[doc(hidden)]
3535    impl crate::RequestBuilder for GetOperation {
3536        fn request_options(&mut self) -> &mut crate::RequestOptions {
3537            &mut self.0.options
3538        }
3539    }
3540}
3541
3542/// Request and client builders for [AuthorizedDomains][crate::client::AuthorizedDomains].
3543pub mod authorized_domains {
3544    use crate::Result;
3545
3546    /// A builder for [AuthorizedDomains][crate::client::AuthorizedDomains].
3547    ///
3548    /// ```
3549    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3550    /// # use google_cloud_appengine_v1::*;
3551    /// # use builder::authorized_domains::ClientBuilder;
3552    /// # use client::AuthorizedDomains;
3553    /// let builder : ClientBuilder = AuthorizedDomains::builder();
3554    /// let client = builder
3555    ///     .with_endpoint("https://appengine.googleapis.com")
3556    ///     .build().await?;
3557    /// # Ok(()) }
3558    /// ```
3559    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3560
3561    pub(crate) mod client {
3562        use super::super::super::client::AuthorizedDomains;
3563        pub struct Factory;
3564        impl crate::ClientFactory for Factory {
3565            type Client = AuthorizedDomains;
3566            type Credentials = gaxi::options::Credentials;
3567            async fn build(
3568                self,
3569                config: gaxi::options::ClientConfig,
3570            ) -> crate::ClientBuilderResult<Self::Client> {
3571                Self::Client::new(config).await
3572            }
3573        }
3574    }
3575
3576    /// Common implementation for [crate::client::AuthorizedDomains] request builders.
3577    #[derive(Clone, Debug)]
3578    pub(crate) struct RequestBuilder<R: std::default::Default> {
3579        stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3580        request: R,
3581        options: crate::RequestOptions,
3582    }
3583
3584    impl<R> RequestBuilder<R>
3585    where
3586        R: std::default::Default,
3587    {
3588        pub(crate) fn new(
3589            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3590        ) -> Self {
3591            Self {
3592                stub,
3593                request: R::default(),
3594                options: crate::RequestOptions::default(),
3595            }
3596        }
3597    }
3598
3599    /// The request builder for [AuthorizedDomains::list_authorized_domains][crate::client::AuthorizedDomains::list_authorized_domains] calls.
3600    ///
3601    /// # Example
3602    /// ```
3603    /// # use google_cloud_appengine_v1::builder::authorized_domains::ListAuthorizedDomains;
3604    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3605    /// use google_cloud_gax::paginator::ItemPaginator;
3606    ///
3607    /// let builder = prepare_request_builder();
3608    /// let mut items = builder.by_item();
3609    /// while let Some(result) = items.next().await {
3610    ///   let item = result?;
3611    /// }
3612    /// # Ok(()) }
3613    ///
3614    /// fn prepare_request_builder() -> ListAuthorizedDomains {
3615    ///   # panic!();
3616    ///   // ... details omitted ...
3617    /// }
3618    /// ```
3619    #[derive(Clone, Debug)]
3620    pub struct ListAuthorizedDomains(RequestBuilder<crate::model::ListAuthorizedDomainsRequest>);
3621
3622    impl ListAuthorizedDomains {
3623        pub(crate) fn new(
3624            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3625        ) -> Self {
3626            Self(RequestBuilder::new(stub))
3627        }
3628
3629        /// Sets the full request, replacing any prior values.
3630        pub fn with_request<V: Into<crate::model::ListAuthorizedDomainsRequest>>(
3631            mut self,
3632            v: V,
3633        ) -> Self {
3634            self.0.request = v.into();
3635            self
3636        }
3637
3638        /// Sets all the options, replacing any prior values.
3639        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3640            self.0.options = v.into();
3641            self
3642        }
3643
3644        /// Sends the request.
3645        pub async fn send(self) -> Result<crate::model::ListAuthorizedDomainsResponse> {
3646            (*self.0.stub)
3647                .list_authorized_domains(self.0.request, self.0.options)
3648                .await
3649                .map(crate::Response::into_body)
3650        }
3651
3652        /// Streams each page in the collection.
3653        pub fn by_page(
3654            self,
3655        ) -> impl google_cloud_gax::paginator::Paginator<
3656            crate::model::ListAuthorizedDomainsResponse,
3657            crate::Error,
3658        > {
3659            use std::clone::Clone;
3660            let token = self.0.request.page_token.clone();
3661            let execute = move |token: String| {
3662                let mut builder = self.clone();
3663                builder.0.request = builder.0.request.set_page_token(token);
3664                builder.send()
3665            };
3666            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3667        }
3668
3669        /// Streams each item in the collection.
3670        pub fn by_item(
3671            self,
3672        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3673            crate::model::ListAuthorizedDomainsResponse,
3674            crate::Error,
3675        > {
3676            use google_cloud_gax::paginator::Paginator;
3677            self.by_page().items()
3678        }
3679
3680        /// Sets the value of [parent][crate::model::ListAuthorizedDomainsRequest::parent].
3681        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3682            self.0.request.parent = v.into();
3683            self
3684        }
3685
3686        /// Sets the value of [page_size][crate::model::ListAuthorizedDomainsRequest::page_size].
3687        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3688            self.0.request.page_size = v.into();
3689            self
3690        }
3691
3692        /// Sets the value of [page_token][crate::model::ListAuthorizedDomainsRequest::page_token].
3693        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3694            self.0.request.page_token = v.into();
3695            self
3696        }
3697    }
3698
3699    #[doc(hidden)]
3700    impl crate::RequestBuilder for ListAuthorizedDomains {
3701        fn request_options(&mut self) -> &mut crate::RequestOptions {
3702            &mut self.0.options
3703        }
3704    }
3705
3706    /// The request builder for [AuthorizedDomains::list_operations][crate::client::AuthorizedDomains::list_operations] calls.
3707    ///
3708    /// # Example
3709    /// ```
3710    /// # use google_cloud_appengine_v1::builder::authorized_domains::ListOperations;
3711    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3712    /// use google_cloud_gax::paginator::ItemPaginator;
3713    ///
3714    /// let builder = prepare_request_builder();
3715    /// let mut items = builder.by_item();
3716    /// while let Some(result) = items.next().await {
3717    ///   let item = result?;
3718    /// }
3719    /// # Ok(()) }
3720    ///
3721    /// fn prepare_request_builder() -> ListOperations {
3722    ///   # panic!();
3723    ///   // ... details omitted ...
3724    /// }
3725    /// ```
3726    #[derive(Clone, Debug)]
3727    pub struct ListOperations(
3728        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3729    );
3730
3731    impl ListOperations {
3732        pub(crate) fn new(
3733            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3734        ) -> Self {
3735            Self(RequestBuilder::new(stub))
3736        }
3737
3738        /// Sets the full request, replacing any prior values.
3739        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3740            mut self,
3741            v: V,
3742        ) -> Self {
3743            self.0.request = v.into();
3744            self
3745        }
3746
3747        /// Sets all the options, replacing any prior values.
3748        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3749            self.0.options = v.into();
3750            self
3751        }
3752
3753        /// Sends the request.
3754        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3755            (*self.0.stub)
3756                .list_operations(self.0.request, self.0.options)
3757                .await
3758                .map(crate::Response::into_body)
3759        }
3760
3761        /// Streams each page in the collection.
3762        pub fn by_page(
3763            self,
3764        ) -> impl google_cloud_gax::paginator::Paginator<
3765            google_cloud_longrunning::model::ListOperationsResponse,
3766            crate::Error,
3767        > {
3768            use std::clone::Clone;
3769            let token = self.0.request.page_token.clone();
3770            let execute = move |token: String| {
3771                let mut builder = self.clone();
3772                builder.0.request = builder.0.request.set_page_token(token);
3773                builder.send()
3774            };
3775            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3776        }
3777
3778        /// Streams each item in the collection.
3779        pub fn by_item(
3780            self,
3781        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3782            google_cloud_longrunning::model::ListOperationsResponse,
3783            crate::Error,
3784        > {
3785            use google_cloud_gax::paginator::Paginator;
3786            self.by_page().items()
3787        }
3788
3789        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3790        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3791            self.0.request.name = v.into();
3792            self
3793        }
3794
3795        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3796        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3797            self.0.request.filter = v.into();
3798            self
3799        }
3800
3801        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3802        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3803            self.0.request.page_size = v.into();
3804            self
3805        }
3806
3807        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3808        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3809            self.0.request.page_token = v.into();
3810            self
3811        }
3812
3813        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3814        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3815            self.0.request.return_partial_success = v.into();
3816            self
3817        }
3818    }
3819
3820    #[doc(hidden)]
3821    impl crate::RequestBuilder for ListOperations {
3822        fn request_options(&mut self) -> &mut crate::RequestOptions {
3823            &mut self.0.options
3824        }
3825    }
3826
3827    /// The request builder for [AuthorizedDomains::get_operation][crate::client::AuthorizedDomains::get_operation] calls.
3828    ///
3829    /// # Example
3830    /// ```
3831    /// # use google_cloud_appengine_v1::builder::authorized_domains::GetOperation;
3832    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3833    ///
3834    /// let builder = prepare_request_builder();
3835    /// let response = builder.send().await?;
3836    /// # Ok(()) }
3837    ///
3838    /// fn prepare_request_builder() -> GetOperation {
3839    ///   # panic!();
3840    ///   // ... details omitted ...
3841    /// }
3842    /// ```
3843    #[derive(Clone, Debug)]
3844    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3845
3846    impl GetOperation {
3847        pub(crate) fn new(
3848            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3849        ) -> Self {
3850            Self(RequestBuilder::new(stub))
3851        }
3852
3853        /// Sets the full request, replacing any prior values.
3854        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3855            mut self,
3856            v: V,
3857        ) -> Self {
3858            self.0.request = v.into();
3859            self
3860        }
3861
3862        /// Sets all the options, replacing any prior values.
3863        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3864            self.0.options = v.into();
3865            self
3866        }
3867
3868        /// Sends the request.
3869        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3870            (*self.0.stub)
3871                .get_operation(self.0.request, self.0.options)
3872                .await
3873                .map(crate::Response::into_body)
3874        }
3875
3876        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3877        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3878            self.0.request.name = v.into();
3879            self
3880        }
3881    }
3882
3883    #[doc(hidden)]
3884    impl crate::RequestBuilder for GetOperation {
3885        fn request_options(&mut self) -> &mut crate::RequestOptions {
3886            &mut self.0.options
3887        }
3888    }
3889}
3890
3891/// Request and client builders for [AuthorizedCertificates][crate::client::AuthorizedCertificates].
3892pub mod authorized_certificates {
3893    use crate::Result;
3894
3895    /// A builder for [AuthorizedCertificates][crate::client::AuthorizedCertificates].
3896    ///
3897    /// ```
3898    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3899    /// # use google_cloud_appengine_v1::*;
3900    /// # use builder::authorized_certificates::ClientBuilder;
3901    /// # use client::AuthorizedCertificates;
3902    /// let builder : ClientBuilder = AuthorizedCertificates::builder();
3903    /// let client = builder
3904    ///     .with_endpoint("https://appengine.googleapis.com")
3905    ///     .build().await?;
3906    /// # Ok(()) }
3907    /// ```
3908    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3909
3910    pub(crate) mod client {
3911        use super::super::super::client::AuthorizedCertificates;
3912        pub struct Factory;
3913        impl crate::ClientFactory for Factory {
3914            type Client = AuthorizedCertificates;
3915            type Credentials = gaxi::options::Credentials;
3916            async fn build(
3917                self,
3918                config: gaxi::options::ClientConfig,
3919            ) -> crate::ClientBuilderResult<Self::Client> {
3920                Self::Client::new(config).await
3921            }
3922        }
3923    }
3924
3925    /// Common implementation for [crate::client::AuthorizedCertificates] request builders.
3926    #[derive(Clone, Debug)]
3927    pub(crate) struct RequestBuilder<R: std::default::Default> {
3928        stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3929        request: R,
3930        options: crate::RequestOptions,
3931    }
3932
3933    impl<R> RequestBuilder<R>
3934    where
3935        R: std::default::Default,
3936    {
3937        pub(crate) fn new(
3938            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3939        ) -> Self {
3940            Self {
3941                stub,
3942                request: R::default(),
3943                options: crate::RequestOptions::default(),
3944            }
3945        }
3946    }
3947
3948    /// The request builder for [AuthorizedCertificates::list_authorized_certificates][crate::client::AuthorizedCertificates::list_authorized_certificates] calls.
3949    ///
3950    /// # Example
3951    /// ```
3952    /// # use google_cloud_appengine_v1::builder::authorized_certificates::ListAuthorizedCertificates;
3953    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
3954    /// use google_cloud_gax::paginator::ItemPaginator;
3955    ///
3956    /// let builder = prepare_request_builder();
3957    /// let mut items = builder.by_item();
3958    /// while let Some(result) = items.next().await {
3959    ///   let item = result?;
3960    /// }
3961    /// # Ok(()) }
3962    ///
3963    /// fn prepare_request_builder() -> ListAuthorizedCertificates {
3964    ///   # panic!();
3965    ///   // ... details omitted ...
3966    /// }
3967    /// ```
3968    #[derive(Clone, Debug)]
3969    pub struct ListAuthorizedCertificates(
3970        RequestBuilder<crate::model::ListAuthorizedCertificatesRequest>,
3971    );
3972
3973    impl ListAuthorizedCertificates {
3974        pub(crate) fn new(
3975            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3976        ) -> Self {
3977            Self(RequestBuilder::new(stub))
3978        }
3979
3980        /// Sets the full request, replacing any prior values.
3981        pub fn with_request<V: Into<crate::model::ListAuthorizedCertificatesRequest>>(
3982            mut self,
3983            v: V,
3984        ) -> Self {
3985            self.0.request = v.into();
3986            self
3987        }
3988
3989        /// Sets all the options, replacing any prior values.
3990        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3991            self.0.options = v.into();
3992            self
3993        }
3994
3995        /// Sends the request.
3996        pub async fn send(self) -> Result<crate::model::ListAuthorizedCertificatesResponse> {
3997            (*self.0.stub)
3998                .list_authorized_certificates(self.0.request, self.0.options)
3999                .await
4000                .map(crate::Response::into_body)
4001        }
4002
4003        /// Streams each page in the collection.
4004        pub fn by_page(
4005            self,
4006        ) -> impl google_cloud_gax::paginator::Paginator<
4007            crate::model::ListAuthorizedCertificatesResponse,
4008            crate::Error,
4009        > {
4010            use std::clone::Clone;
4011            let token = self.0.request.page_token.clone();
4012            let execute = move |token: String| {
4013                let mut builder = self.clone();
4014                builder.0.request = builder.0.request.set_page_token(token);
4015                builder.send()
4016            };
4017            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4018        }
4019
4020        /// Streams each item in the collection.
4021        pub fn by_item(
4022            self,
4023        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4024            crate::model::ListAuthorizedCertificatesResponse,
4025            crate::Error,
4026        > {
4027            use google_cloud_gax::paginator::Paginator;
4028            self.by_page().items()
4029        }
4030
4031        /// Sets the value of [parent][crate::model::ListAuthorizedCertificatesRequest::parent].
4032        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4033            self.0.request.parent = v.into();
4034            self
4035        }
4036
4037        /// Sets the value of [view][crate::model::ListAuthorizedCertificatesRequest::view].
4038        pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
4039            self.0.request.view = v.into();
4040            self
4041        }
4042
4043        /// Sets the value of [page_size][crate::model::ListAuthorizedCertificatesRequest::page_size].
4044        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4045            self.0.request.page_size = v.into();
4046            self
4047        }
4048
4049        /// Sets the value of [page_token][crate::model::ListAuthorizedCertificatesRequest::page_token].
4050        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4051            self.0.request.page_token = v.into();
4052            self
4053        }
4054    }
4055
4056    #[doc(hidden)]
4057    impl crate::RequestBuilder for ListAuthorizedCertificates {
4058        fn request_options(&mut self) -> &mut crate::RequestOptions {
4059            &mut self.0.options
4060        }
4061    }
4062
4063    /// The request builder for [AuthorizedCertificates::get_authorized_certificate][crate::client::AuthorizedCertificates::get_authorized_certificate] calls.
4064    ///
4065    /// # Example
4066    /// ```
4067    /// # use google_cloud_appengine_v1::builder::authorized_certificates::GetAuthorizedCertificate;
4068    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4069    ///
4070    /// let builder = prepare_request_builder();
4071    /// let response = builder.send().await?;
4072    /// # Ok(()) }
4073    ///
4074    /// fn prepare_request_builder() -> GetAuthorizedCertificate {
4075    ///   # panic!();
4076    ///   // ... details omitted ...
4077    /// }
4078    /// ```
4079    #[derive(Clone, Debug)]
4080    pub struct GetAuthorizedCertificate(
4081        RequestBuilder<crate::model::GetAuthorizedCertificateRequest>,
4082    );
4083
4084    impl GetAuthorizedCertificate {
4085        pub(crate) fn new(
4086            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4087        ) -> Self {
4088            Self(RequestBuilder::new(stub))
4089        }
4090
4091        /// Sets the full request, replacing any prior values.
4092        pub fn with_request<V: Into<crate::model::GetAuthorizedCertificateRequest>>(
4093            mut self,
4094            v: V,
4095        ) -> Self {
4096            self.0.request = v.into();
4097            self
4098        }
4099
4100        /// Sets all the options, replacing any prior values.
4101        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4102            self.0.options = v.into();
4103            self
4104        }
4105
4106        /// Sends the request.
4107        pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4108            (*self.0.stub)
4109                .get_authorized_certificate(self.0.request, self.0.options)
4110                .await
4111                .map(crate::Response::into_body)
4112        }
4113
4114        /// Sets the value of [name][crate::model::GetAuthorizedCertificateRequest::name].
4115        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4116            self.0.request.name = v.into();
4117            self
4118        }
4119
4120        /// Sets the value of [view][crate::model::GetAuthorizedCertificateRequest::view].
4121        pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
4122            self.0.request.view = v.into();
4123            self
4124        }
4125    }
4126
4127    #[doc(hidden)]
4128    impl crate::RequestBuilder for GetAuthorizedCertificate {
4129        fn request_options(&mut self) -> &mut crate::RequestOptions {
4130            &mut self.0.options
4131        }
4132    }
4133
4134    /// The request builder for [AuthorizedCertificates::create_authorized_certificate][crate::client::AuthorizedCertificates::create_authorized_certificate] calls.
4135    ///
4136    /// # Example
4137    /// ```
4138    /// # use google_cloud_appengine_v1::builder::authorized_certificates::CreateAuthorizedCertificate;
4139    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4140    ///
4141    /// let builder = prepare_request_builder();
4142    /// let response = builder.send().await?;
4143    /// # Ok(()) }
4144    ///
4145    /// fn prepare_request_builder() -> CreateAuthorizedCertificate {
4146    ///   # panic!();
4147    ///   // ... details omitted ...
4148    /// }
4149    /// ```
4150    #[derive(Clone, Debug)]
4151    pub struct CreateAuthorizedCertificate(
4152        RequestBuilder<crate::model::CreateAuthorizedCertificateRequest>,
4153    );
4154
4155    impl CreateAuthorizedCertificate {
4156        pub(crate) fn new(
4157            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4158        ) -> Self {
4159            Self(RequestBuilder::new(stub))
4160        }
4161
4162        /// Sets the full request, replacing any prior values.
4163        pub fn with_request<V: Into<crate::model::CreateAuthorizedCertificateRequest>>(
4164            mut self,
4165            v: V,
4166        ) -> Self {
4167            self.0.request = v.into();
4168            self
4169        }
4170
4171        /// Sets all the options, replacing any prior values.
4172        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4173            self.0.options = v.into();
4174            self
4175        }
4176
4177        /// Sends the request.
4178        pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4179            (*self.0.stub)
4180                .create_authorized_certificate(self.0.request, self.0.options)
4181                .await
4182                .map(crate::Response::into_body)
4183        }
4184
4185        /// Sets the value of [parent][crate::model::CreateAuthorizedCertificateRequest::parent].
4186        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4187            self.0.request.parent = v.into();
4188            self
4189        }
4190
4191        /// Sets the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
4192        pub fn set_certificate<T>(mut self, v: T) -> Self
4193        where
4194            T: std::convert::Into<crate::model::AuthorizedCertificate>,
4195        {
4196            self.0.request.certificate = std::option::Option::Some(v.into());
4197            self
4198        }
4199
4200        /// Sets or clears the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
4201        pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4202        where
4203            T: std::convert::Into<crate::model::AuthorizedCertificate>,
4204        {
4205            self.0.request.certificate = v.map(|x| x.into());
4206            self
4207        }
4208    }
4209
4210    #[doc(hidden)]
4211    impl crate::RequestBuilder for CreateAuthorizedCertificate {
4212        fn request_options(&mut self) -> &mut crate::RequestOptions {
4213            &mut self.0.options
4214        }
4215    }
4216
4217    /// The request builder for [AuthorizedCertificates::update_authorized_certificate][crate::client::AuthorizedCertificates::update_authorized_certificate] calls.
4218    ///
4219    /// # Example
4220    /// ```
4221    /// # use google_cloud_appengine_v1::builder::authorized_certificates::UpdateAuthorizedCertificate;
4222    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4223    ///
4224    /// let builder = prepare_request_builder();
4225    /// let response = builder.send().await?;
4226    /// # Ok(()) }
4227    ///
4228    /// fn prepare_request_builder() -> UpdateAuthorizedCertificate {
4229    ///   # panic!();
4230    ///   // ... details omitted ...
4231    /// }
4232    /// ```
4233    #[derive(Clone, Debug)]
4234    pub struct UpdateAuthorizedCertificate(
4235        RequestBuilder<crate::model::UpdateAuthorizedCertificateRequest>,
4236    );
4237
4238    impl UpdateAuthorizedCertificate {
4239        pub(crate) fn new(
4240            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4241        ) -> Self {
4242            Self(RequestBuilder::new(stub))
4243        }
4244
4245        /// Sets the full request, replacing any prior values.
4246        pub fn with_request<V: Into<crate::model::UpdateAuthorizedCertificateRequest>>(
4247            mut self,
4248            v: V,
4249        ) -> Self {
4250            self.0.request = v.into();
4251            self
4252        }
4253
4254        /// Sets all the options, replacing any prior values.
4255        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4256            self.0.options = v.into();
4257            self
4258        }
4259
4260        /// Sends the request.
4261        pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4262            (*self.0.stub)
4263                .update_authorized_certificate(self.0.request, self.0.options)
4264                .await
4265                .map(crate::Response::into_body)
4266        }
4267
4268        /// Sets the value of [name][crate::model::UpdateAuthorizedCertificateRequest::name].
4269        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4270            self.0.request.name = v.into();
4271            self
4272        }
4273
4274        /// Sets the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
4275        pub fn set_certificate<T>(mut self, v: T) -> Self
4276        where
4277            T: std::convert::Into<crate::model::AuthorizedCertificate>,
4278        {
4279            self.0.request.certificate = std::option::Option::Some(v.into());
4280            self
4281        }
4282
4283        /// Sets or clears the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
4284        pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4285        where
4286            T: std::convert::Into<crate::model::AuthorizedCertificate>,
4287        {
4288            self.0.request.certificate = v.map(|x| x.into());
4289            self
4290        }
4291
4292        /// Sets the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
4293        pub fn set_update_mask<T>(mut self, v: T) -> Self
4294        where
4295            T: std::convert::Into<wkt::FieldMask>,
4296        {
4297            self.0.request.update_mask = std::option::Option::Some(v.into());
4298            self
4299        }
4300
4301        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
4302        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4303        where
4304            T: std::convert::Into<wkt::FieldMask>,
4305        {
4306            self.0.request.update_mask = v.map(|x| x.into());
4307            self
4308        }
4309    }
4310
4311    #[doc(hidden)]
4312    impl crate::RequestBuilder for UpdateAuthorizedCertificate {
4313        fn request_options(&mut self) -> &mut crate::RequestOptions {
4314            &mut self.0.options
4315        }
4316    }
4317
4318    /// The request builder for [AuthorizedCertificates::delete_authorized_certificate][crate::client::AuthorizedCertificates::delete_authorized_certificate] calls.
4319    ///
4320    /// # Example
4321    /// ```
4322    /// # use google_cloud_appengine_v1::builder::authorized_certificates::DeleteAuthorizedCertificate;
4323    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4324    ///
4325    /// let builder = prepare_request_builder();
4326    /// let response = builder.send().await?;
4327    /// # Ok(()) }
4328    ///
4329    /// fn prepare_request_builder() -> DeleteAuthorizedCertificate {
4330    ///   # panic!();
4331    ///   // ... details omitted ...
4332    /// }
4333    /// ```
4334    #[derive(Clone, Debug)]
4335    pub struct DeleteAuthorizedCertificate(
4336        RequestBuilder<crate::model::DeleteAuthorizedCertificateRequest>,
4337    );
4338
4339    impl DeleteAuthorizedCertificate {
4340        pub(crate) fn new(
4341            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4342        ) -> Self {
4343            Self(RequestBuilder::new(stub))
4344        }
4345
4346        /// Sets the full request, replacing any prior values.
4347        pub fn with_request<V: Into<crate::model::DeleteAuthorizedCertificateRequest>>(
4348            mut self,
4349            v: V,
4350        ) -> Self {
4351            self.0.request = v.into();
4352            self
4353        }
4354
4355        /// Sets all the options, replacing any prior values.
4356        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4357            self.0.options = v.into();
4358            self
4359        }
4360
4361        /// Sends the request.
4362        pub async fn send(self) -> Result<()> {
4363            (*self.0.stub)
4364                .delete_authorized_certificate(self.0.request, self.0.options)
4365                .await
4366                .map(crate::Response::into_body)
4367        }
4368
4369        /// Sets the value of [name][crate::model::DeleteAuthorizedCertificateRequest::name].
4370        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4371            self.0.request.name = v.into();
4372            self
4373        }
4374    }
4375
4376    #[doc(hidden)]
4377    impl crate::RequestBuilder for DeleteAuthorizedCertificate {
4378        fn request_options(&mut self) -> &mut crate::RequestOptions {
4379            &mut self.0.options
4380        }
4381    }
4382
4383    /// The request builder for [AuthorizedCertificates::list_operations][crate::client::AuthorizedCertificates::list_operations] calls.
4384    ///
4385    /// # Example
4386    /// ```
4387    /// # use google_cloud_appengine_v1::builder::authorized_certificates::ListOperations;
4388    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4389    /// use google_cloud_gax::paginator::ItemPaginator;
4390    ///
4391    /// let builder = prepare_request_builder();
4392    /// let mut items = builder.by_item();
4393    /// while let Some(result) = items.next().await {
4394    ///   let item = result?;
4395    /// }
4396    /// # Ok(()) }
4397    ///
4398    /// fn prepare_request_builder() -> ListOperations {
4399    ///   # panic!();
4400    ///   // ... details omitted ...
4401    /// }
4402    /// ```
4403    #[derive(Clone, Debug)]
4404    pub struct ListOperations(
4405        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4406    );
4407
4408    impl ListOperations {
4409        pub(crate) fn new(
4410            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4411        ) -> Self {
4412            Self(RequestBuilder::new(stub))
4413        }
4414
4415        /// Sets the full request, replacing any prior values.
4416        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4417            mut self,
4418            v: V,
4419        ) -> Self {
4420            self.0.request = v.into();
4421            self
4422        }
4423
4424        /// Sets all the options, replacing any prior values.
4425        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4426            self.0.options = v.into();
4427            self
4428        }
4429
4430        /// Sends the request.
4431        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4432            (*self.0.stub)
4433                .list_operations(self.0.request, self.0.options)
4434                .await
4435                .map(crate::Response::into_body)
4436        }
4437
4438        /// Streams each page in the collection.
4439        pub fn by_page(
4440            self,
4441        ) -> impl google_cloud_gax::paginator::Paginator<
4442            google_cloud_longrunning::model::ListOperationsResponse,
4443            crate::Error,
4444        > {
4445            use std::clone::Clone;
4446            let token = self.0.request.page_token.clone();
4447            let execute = move |token: String| {
4448                let mut builder = self.clone();
4449                builder.0.request = builder.0.request.set_page_token(token);
4450                builder.send()
4451            };
4452            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4453        }
4454
4455        /// Streams each item in the collection.
4456        pub fn by_item(
4457            self,
4458        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4459            google_cloud_longrunning::model::ListOperationsResponse,
4460            crate::Error,
4461        > {
4462            use google_cloud_gax::paginator::Paginator;
4463            self.by_page().items()
4464        }
4465
4466        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4467        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4468            self.0.request.name = v.into();
4469            self
4470        }
4471
4472        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4473        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4474            self.0.request.filter = v.into();
4475            self
4476        }
4477
4478        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4479        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4480            self.0.request.page_size = v.into();
4481            self
4482        }
4483
4484        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4485        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4486            self.0.request.page_token = v.into();
4487            self
4488        }
4489
4490        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4491        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4492            self.0.request.return_partial_success = v.into();
4493            self
4494        }
4495    }
4496
4497    #[doc(hidden)]
4498    impl crate::RequestBuilder for ListOperations {
4499        fn request_options(&mut self) -> &mut crate::RequestOptions {
4500            &mut self.0.options
4501        }
4502    }
4503
4504    /// The request builder for [AuthorizedCertificates::get_operation][crate::client::AuthorizedCertificates::get_operation] calls.
4505    ///
4506    /// # Example
4507    /// ```
4508    /// # use google_cloud_appengine_v1::builder::authorized_certificates::GetOperation;
4509    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4510    ///
4511    /// let builder = prepare_request_builder();
4512    /// let response = builder.send().await?;
4513    /// # Ok(()) }
4514    ///
4515    /// fn prepare_request_builder() -> GetOperation {
4516    ///   # panic!();
4517    ///   // ... details omitted ...
4518    /// }
4519    /// ```
4520    #[derive(Clone, Debug)]
4521    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4522
4523    impl GetOperation {
4524        pub(crate) fn new(
4525            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4526        ) -> Self {
4527            Self(RequestBuilder::new(stub))
4528        }
4529
4530        /// Sets the full request, replacing any prior values.
4531        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4532            mut self,
4533            v: V,
4534        ) -> Self {
4535            self.0.request = v.into();
4536            self
4537        }
4538
4539        /// Sets all the options, replacing any prior values.
4540        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4541            self.0.options = v.into();
4542            self
4543        }
4544
4545        /// Sends the request.
4546        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4547            (*self.0.stub)
4548                .get_operation(self.0.request, self.0.options)
4549                .await
4550                .map(crate::Response::into_body)
4551        }
4552
4553        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4554        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4555            self.0.request.name = v.into();
4556            self
4557        }
4558    }
4559
4560    #[doc(hidden)]
4561    impl crate::RequestBuilder for GetOperation {
4562        fn request_options(&mut self) -> &mut crate::RequestOptions {
4563            &mut self.0.options
4564        }
4565    }
4566}
4567
4568/// Request and client builders for [DomainMappings][crate::client::DomainMappings].
4569pub mod domain_mappings {
4570    use crate::Result;
4571
4572    /// A builder for [DomainMappings][crate::client::DomainMappings].
4573    ///
4574    /// ```
4575    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4576    /// # use google_cloud_appengine_v1::*;
4577    /// # use builder::domain_mappings::ClientBuilder;
4578    /// # use client::DomainMappings;
4579    /// let builder : ClientBuilder = DomainMappings::builder();
4580    /// let client = builder
4581    ///     .with_endpoint("https://appengine.googleapis.com")
4582    ///     .build().await?;
4583    /// # Ok(()) }
4584    /// ```
4585    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4586
4587    pub(crate) mod client {
4588        use super::super::super::client::DomainMappings;
4589        pub struct Factory;
4590        impl crate::ClientFactory for Factory {
4591            type Client = DomainMappings;
4592            type Credentials = gaxi::options::Credentials;
4593            async fn build(
4594                self,
4595                config: gaxi::options::ClientConfig,
4596            ) -> crate::ClientBuilderResult<Self::Client> {
4597                Self::Client::new(config).await
4598            }
4599        }
4600    }
4601
4602    /// Common implementation for [crate::client::DomainMappings] request builders.
4603    #[derive(Clone, Debug)]
4604    pub(crate) struct RequestBuilder<R: std::default::Default> {
4605        stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4606        request: R,
4607        options: crate::RequestOptions,
4608    }
4609
4610    impl<R> RequestBuilder<R>
4611    where
4612        R: std::default::Default,
4613    {
4614        pub(crate) fn new(
4615            stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4616        ) -> Self {
4617            Self {
4618                stub,
4619                request: R::default(),
4620                options: crate::RequestOptions::default(),
4621            }
4622        }
4623    }
4624
4625    /// The request builder for [DomainMappings::list_domain_mappings][crate::client::DomainMappings::list_domain_mappings] calls.
4626    ///
4627    /// # Example
4628    /// ```
4629    /// # use google_cloud_appengine_v1::builder::domain_mappings::ListDomainMappings;
4630    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4631    /// use google_cloud_gax::paginator::ItemPaginator;
4632    ///
4633    /// let builder = prepare_request_builder();
4634    /// let mut items = builder.by_item();
4635    /// while let Some(result) = items.next().await {
4636    ///   let item = result?;
4637    /// }
4638    /// # Ok(()) }
4639    ///
4640    /// fn prepare_request_builder() -> ListDomainMappings {
4641    ///   # panic!();
4642    ///   // ... details omitted ...
4643    /// }
4644    /// ```
4645    #[derive(Clone, Debug)]
4646    pub struct ListDomainMappings(RequestBuilder<crate::model::ListDomainMappingsRequest>);
4647
4648    impl ListDomainMappings {
4649        pub(crate) fn new(
4650            stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4651        ) -> Self {
4652            Self(RequestBuilder::new(stub))
4653        }
4654
4655        /// Sets the full request, replacing any prior values.
4656        pub fn with_request<V: Into<crate::model::ListDomainMappingsRequest>>(
4657            mut self,
4658            v: V,
4659        ) -> Self {
4660            self.0.request = v.into();
4661            self
4662        }
4663
4664        /// Sets all the options, replacing any prior values.
4665        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4666            self.0.options = v.into();
4667            self
4668        }
4669
4670        /// Sends the request.
4671        pub async fn send(self) -> Result<crate::model::ListDomainMappingsResponse> {
4672            (*self.0.stub)
4673                .list_domain_mappings(self.0.request, self.0.options)
4674                .await
4675                .map(crate::Response::into_body)
4676        }
4677
4678        /// Streams each page in the collection.
4679        pub fn by_page(
4680            self,
4681        ) -> impl google_cloud_gax::paginator::Paginator<
4682            crate::model::ListDomainMappingsResponse,
4683            crate::Error,
4684        > {
4685            use std::clone::Clone;
4686            let token = self.0.request.page_token.clone();
4687            let execute = move |token: String| {
4688                let mut builder = self.clone();
4689                builder.0.request = builder.0.request.set_page_token(token);
4690                builder.send()
4691            };
4692            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4693        }
4694
4695        /// Streams each item in the collection.
4696        pub fn by_item(
4697            self,
4698        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4699            crate::model::ListDomainMappingsResponse,
4700            crate::Error,
4701        > {
4702            use google_cloud_gax::paginator::Paginator;
4703            self.by_page().items()
4704        }
4705
4706        /// Sets the value of [parent][crate::model::ListDomainMappingsRequest::parent].
4707        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4708            self.0.request.parent = v.into();
4709            self
4710        }
4711
4712        /// Sets the value of [page_size][crate::model::ListDomainMappingsRequest::page_size].
4713        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4714            self.0.request.page_size = v.into();
4715            self
4716        }
4717
4718        /// Sets the value of [page_token][crate::model::ListDomainMappingsRequest::page_token].
4719        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4720            self.0.request.page_token = v.into();
4721            self
4722        }
4723    }
4724
4725    #[doc(hidden)]
4726    impl crate::RequestBuilder for ListDomainMappings {
4727        fn request_options(&mut self) -> &mut crate::RequestOptions {
4728            &mut self.0.options
4729        }
4730    }
4731
4732    /// The request builder for [DomainMappings::get_domain_mapping][crate::client::DomainMappings::get_domain_mapping] calls.
4733    ///
4734    /// # Example
4735    /// ```
4736    /// # use google_cloud_appengine_v1::builder::domain_mappings::GetDomainMapping;
4737    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4738    ///
4739    /// let builder = prepare_request_builder();
4740    /// let response = builder.send().await?;
4741    /// # Ok(()) }
4742    ///
4743    /// fn prepare_request_builder() -> GetDomainMapping {
4744    ///   # panic!();
4745    ///   // ... details omitted ...
4746    /// }
4747    /// ```
4748    #[derive(Clone, Debug)]
4749    pub struct GetDomainMapping(RequestBuilder<crate::model::GetDomainMappingRequest>);
4750
4751    impl GetDomainMapping {
4752        pub(crate) fn new(
4753            stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4754        ) -> Self {
4755            Self(RequestBuilder::new(stub))
4756        }
4757
4758        /// Sets the full request, replacing any prior values.
4759        pub fn with_request<V: Into<crate::model::GetDomainMappingRequest>>(
4760            mut self,
4761            v: V,
4762        ) -> Self {
4763            self.0.request = v.into();
4764            self
4765        }
4766
4767        /// Sets all the options, replacing any prior values.
4768        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4769            self.0.options = v.into();
4770            self
4771        }
4772
4773        /// Sends the request.
4774        pub async fn send(self) -> Result<crate::model::DomainMapping> {
4775            (*self.0.stub)
4776                .get_domain_mapping(self.0.request, self.0.options)
4777                .await
4778                .map(crate::Response::into_body)
4779        }
4780
4781        /// Sets the value of [name][crate::model::GetDomainMappingRequest::name].
4782        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4783            self.0.request.name = v.into();
4784            self
4785        }
4786    }
4787
4788    #[doc(hidden)]
4789    impl crate::RequestBuilder for GetDomainMapping {
4790        fn request_options(&mut self) -> &mut crate::RequestOptions {
4791            &mut self.0.options
4792        }
4793    }
4794
4795    /// The request builder for [DomainMappings::create_domain_mapping][crate::client::DomainMappings::create_domain_mapping] calls.
4796    ///
4797    /// # Example
4798    /// ```
4799    /// # use google_cloud_appengine_v1::builder::domain_mappings::CreateDomainMapping;
4800    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4801    /// use google_cloud_lro::Poller;
4802    ///
4803    /// let builder = prepare_request_builder();
4804    /// let response = builder.poller().until_done().await?;
4805    /// # Ok(()) }
4806    ///
4807    /// fn prepare_request_builder() -> CreateDomainMapping {
4808    ///   # panic!();
4809    ///   // ... details omitted ...
4810    /// }
4811    /// ```
4812    #[derive(Clone, Debug)]
4813    pub struct CreateDomainMapping(RequestBuilder<crate::model::CreateDomainMappingRequest>);
4814
4815    impl CreateDomainMapping {
4816        pub(crate) fn new(
4817            stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4818        ) -> Self {
4819            Self(RequestBuilder::new(stub))
4820        }
4821
4822        /// Sets the full request, replacing any prior values.
4823        pub fn with_request<V: Into<crate::model::CreateDomainMappingRequest>>(
4824            mut self,
4825            v: V,
4826        ) -> Self {
4827            self.0.request = v.into();
4828            self
4829        }
4830
4831        /// Sets all the options, replacing any prior values.
4832        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4833            self.0.options = v.into();
4834            self
4835        }
4836
4837        /// Sends the request.
4838        ///
4839        /// # Long running operations
4840        ///
4841        /// This starts, but does not poll, a longrunning operation. More information
4842        /// on [create_domain_mapping][crate::client::DomainMappings::create_domain_mapping].
4843        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4844            (*self.0.stub)
4845                .create_domain_mapping(self.0.request, self.0.options)
4846                .await
4847                .map(crate::Response::into_body)
4848        }
4849
4850        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_domain_mapping`.
4851        pub fn poller(
4852            self,
4853        ) -> impl google_cloud_lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4854        {
4855            type Operation = google_cloud_lro::internal::Operation<
4856                crate::model::DomainMapping,
4857                crate::model::OperationMetadataV1,
4858            >;
4859            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4860            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4861            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4862            if let Some(ref mut details) = poller_options.tracing {
4863                details.method_name = "google_cloud_appengine_v1::client::DomainMappings::create_domain_mapping::until_done";
4864            }
4865
4866            let stub = self.0.stub.clone();
4867            let mut options = self.0.options.clone();
4868            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4869            let query = move |name| {
4870                let stub = stub.clone();
4871                let options = options.clone();
4872                async {
4873                    let op = GetOperation::new(stub)
4874                        .set_name(name)
4875                        .with_options(options)
4876                        .send()
4877                        .await?;
4878                    Ok(Operation::new(op))
4879                }
4880            };
4881
4882            let start = move || async {
4883                let op = self.send().await?;
4884                Ok(Operation::new(op))
4885            };
4886
4887            use google_cloud_lro::internal::PollerExt;
4888            {
4889                google_cloud_lro::internal::new_poller(
4890                    polling_error_policy,
4891                    polling_backoff_policy,
4892                    start,
4893                    query,
4894                )
4895            }
4896            .with_options(poller_options)
4897        }
4898
4899        /// Sets the value of [parent][crate::model::CreateDomainMappingRequest::parent].
4900        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4901            self.0.request.parent = v.into();
4902            self
4903        }
4904
4905        /// Sets the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4906        pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4907        where
4908            T: std::convert::Into<crate::model::DomainMapping>,
4909        {
4910            self.0.request.domain_mapping = std::option::Option::Some(v.into());
4911            self
4912        }
4913
4914        /// Sets or clears the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4915        pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4916        where
4917            T: std::convert::Into<crate::model::DomainMapping>,
4918        {
4919            self.0.request.domain_mapping = v.map(|x| x.into());
4920            self
4921        }
4922
4923        /// Sets the value of [override_strategy][crate::model::CreateDomainMappingRequest::override_strategy].
4924        pub fn set_override_strategy<T: Into<crate::model::DomainOverrideStrategy>>(
4925            mut self,
4926            v: T,
4927        ) -> Self {
4928            self.0.request.override_strategy = v.into();
4929            self
4930        }
4931    }
4932
4933    #[doc(hidden)]
4934    impl crate::RequestBuilder for CreateDomainMapping {
4935        fn request_options(&mut self) -> &mut crate::RequestOptions {
4936            &mut self.0.options
4937        }
4938    }
4939
4940    /// The request builder for [DomainMappings::update_domain_mapping][crate::client::DomainMappings::update_domain_mapping] calls.
4941    ///
4942    /// # Example
4943    /// ```
4944    /// # use google_cloud_appengine_v1::builder::domain_mappings::UpdateDomainMapping;
4945    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
4946    /// use google_cloud_lro::Poller;
4947    ///
4948    /// let builder = prepare_request_builder();
4949    /// let response = builder.poller().until_done().await?;
4950    /// # Ok(()) }
4951    ///
4952    /// fn prepare_request_builder() -> UpdateDomainMapping {
4953    ///   # panic!();
4954    ///   // ... details omitted ...
4955    /// }
4956    /// ```
4957    #[derive(Clone, Debug)]
4958    pub struct UpdateDomainMapping(RequestBuilder<crate::model::UpdateDomainMappingRequest>);
4959
4960    impl UpdateDomainMapping {
4961        pub(crate) fn new(
4962            stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4963        ) -> Self {
4964            Self(RequestBuilder::new(stub))
4965        }
4966
4967        /// Sets the full request, replacing any prior values.
4968        pub fn with_request<V: Into<crate::model::UpdateDomainMappingRequest>>(
4969            mut self,
4970            v: V,
4971        ) -> Self {
4972            self.0.request = v.into();
4973            self
4974        }
4975
4976        /// Sets all the options, replacing any prior values.
4977        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4978            self.0.options = v.into();
4979            self
4980        }
4981
4982        /// Sends the request.
4983        ///
4984        /// # Long running operations
4985        ///
4986        /// This starts, but does not poll, a longrunning operation. More information
4987        /// on [update_domain_mapping][crate::client::DomainMappings::update_domain_mapping].
4988        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4989            (*self.0.stub)
4990                .update_domain_mapping(self.0.request, self.0.options)
4991                .await
4992                .map(crate::Response::into_body)
4993        }
4994
4995        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_domain_mapping`.
4996        pub fn poller(
4997            self,
4998        ) -> impl google_cloud_lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4999        {
5000            type Operation = google_cloud_lro::internal::Operation<
5001                crate::model::DomainMapping,
5002                crate::model::OperationMetadataV1,
5003            >;
5004            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5005            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5006            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5007            if let Some(ref mut details) = poller_options.tracing {
5008                details.method_name = "google_cloud_appengine_v1::client::DomainMappings::update_domain_mapping::until_done";
5009            }
5010
5011            let stub = self.0.stub.clone();
5012            let mut options = self.0.options.clone();
5013            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5014            let query = move |name| {
5015                let stub = stub.clone();
5016                let options = options.clone();
5017                async {
5018                    let op = GetOperation::new(stub)
5019                        .set_name(name)
5020                        .with_options(options)
5021                        .send()
5022                        .await?;
5023                    Ok(Operation::new(op))
5024                }
5025            };
5026
5027            let start = move || async {
5028                let op = self.send().await?;
5029                Ok(Operation::new(op))
5030            };
5031
5032            use google_cloud_lro::internal::PollerExt;
5033            {
5034                google_cloud_lro::internal::new_poller(
5035                    polling_error_policy,
5036                    polling_backoff_policy,
5037                    start,
5038                    query,
5039                )
5040            }
5041            .with_options(poller_options)
5042        }
5043
5044        /// Sets the value of [name][crate::model::UpdateDomainMappingRequest::name].
5045        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5046            self.0.request.name = v.into();
5047            self
5048        }
5049
5050        /// Sets the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
5051        pub fn set_domain_mapping<T>(mut self, v: T) -> Self
5052        where
5053            T: std::convert::Into<crate::model::DomainMapping>,
5054        {
5055            self.0.request.domain_mapping = std::option::Option::Some(v.into());
5056            self
5057        }
5058
5059        /// Sets or clears the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
5060        pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
5061        where
5062            T: std::convert::Into<crate::model::DomainMapping>,
5063        {
5064            self.0.request.domain_mapping = v.map(|x| x.into());
5065            self
5066        }
5067
5068        /// Sets the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
5069        pub fn set_update_mask<T>(mut self, v: T) -> Self
5070        where
5071            T: std::convert::Into<wkt::FieldMask>,
5072        {
5073            self.0.request.update_mask = std::option::Option::Some(v.into());
5074            self
5075        }
5076
5077        /// Sets or clears the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
5078        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5079        where
5080            T: std::convert::Into<wkt::FieldMask>,
5081        {
5082            self.0.request.update_mask = v.map(|x| x.into());
5083            self
5084        }
5085    }
5086
5087    #[doc(hidden)]
5088    impl crate::RequestBuilder for UpdateDomainMapping {
5089        fn request_options(&mut self) -> &mut crate::RequestOptions {
5090            &mut self.0.options
5091        }
5092    }
5093
5094    /// The request builder for [DomainMappings::delete_domain_mapping][crate::client::DomainMappings::delete_domain_mapping] calls.
5095    ///
5096    /// # Example
5097    /// ```
5098    /// # use google_cloud_appengine_v1::builder::domain_mappings::DeleteDomainMapping;
5099    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
5100    /// use google_cloud_lro::Poller;
5101    ///
5102    /// let builder = prepare_request_builder();
5103    /// let response = builder.poller().until_done().await?;
5104    /// # Ok(()) }
5105    ///
5106    /// fn prepare_request_builder() -> DeleteDomainMapping {
5107    ///   # panic!();
5108    ///   // ... details omitted ...
5109    /// }
5110    /// ```
5111    #[derive(Clone, Debug)]
5112    pub struct DeleteDomainMapping(RequestBuilder<crate::model::DeleteDomainMappingRequest>);
5113
5114    impl DeleteDomainMapping {
5115        pub(crate) fn new(
5116            stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5117        ) -> Self {
5118            Self(RequestBuilder::new(stub))
5119        }
5120
5121        /// Sets the full request, replacing any prior values.
5122        pub fn with_request<V: Into<crate::model::DeleteDomainMappingRequest>>(
5123            mut self,
5124            v: V,
5125        ) -> Self {
5126            self.0.request = v.into();
5127            self
5128        }
5129
5130        /// Sets all the options, replacing any prior values.
5131        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5132            self.0.options = v.into();
5133            self
5134        }
5135
5136        /// Sends the request.
5137        ///
5138        /// # Long running operations
5139        ///
5140        /// This starts, but does not poll, a longrunning operation. More information
5141        /// on [delete_domain_mapping][crate::client::DomainMappings::delete_domain_mapping].
5142        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5143            (*self.0.stub)
5144                .delete_domain_mapping(self.0.request, self.0.options)
5145                .await
5146                .map(crate::Response::into_body)
5147        }
5148
5149        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_domain_mapping`.
5150        pub fn poller(
5151            self,
5152        ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
5153            type Operation = google_cloud_lro::internal::Operation<
5154                wkt::Empty,
5155                crate::model::OperationMetadataV1,
5156            >;
5157            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5158            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5159            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5160            if let Some(ref mut details) = poller_options.tracing {
5161                details.method_name = "google_cloud_appengine_v1::client::DomainMappings::delete_domain_mapping::until_done";
5162            }
5163
5164            let stub = self.0.stub.clone();
5165            let mut options = self.0.options.clone();
5166            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5167            let query = move |name| {
5168                let stub = stub.clone();
5169                let options = options.clone();
5170                async {
5171                    let op = GetOperation::new(stub)
5172                        .set_name(name)
5173                        .with_options(options)
5174                        .send()
5175                        .await?;
5176                    Ok(Operation::new(op))
5177                }
5178            };
5179
5180            let start = move || async {
5181                let op = self.send().await?;
5182                Ok(Operation::new(op))
5183            };
5184
5185            use google_cloud_lro::internal::PollerExt;
5186            {
5187                google_cloud_lro::internal::new_unit_response_poller(
5188                    polling_error_policy,
5189                    polling_backoff_policy,
5190                    start,
5191                    query,
5192                )
5193            }
5194            .with_options(poller_options)
5195        }
5196
5197        /// Sets the value of [name][crate::model::DeleteDomainMappingRequest::name].
5198        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5199            self.0.request.name = v.into();
5200            self
5201        }
5202    }
5203
5204    #[doc(hidden)]
5205    impl crate::RequestBuilder for DeleteDomainMapping {
5206        fn request_options(&mut self) -> &mut crate::RequestOptions {
5207            &mut self.0.options
5208        }
5209    }
5210
5211    /// The request builder for [DomainMappings::list_operations][crate::client::DomainMappings::list_operations] calls.
5212    ///
5213    /// # Example
5214    /// ```
5215    /// # use google_cloud_appengine_v1::builder::domain_mappings::ListOperations;
5216    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
5217    /// use google_cloud_gax::paginator::ItemPaginator;
5218    ///
5219    /// let builder = prepare_request_builder();
5220    /// let mut items = builder.by_item();
5221    /// while let Some(result) = items.next().await {
5222    ///   let item = result?;
5223    /// }
5224    /// # Ok(()) }
5225    ///
5226    /// fn prepare_request_builder() -> ListOperations {
5227    ///   # panic!();
5228    ///   // ... details omitted ...
5229    /// }
5230    /// ```
5231    #[derive(Clone, Debug)]
5232    pub struct ListOperations(
5233        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5234    );
5235
5236    impl ListOperations {
5237        pub(crate) fn new(
5238            stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5239        ) -> Self {
5240            Self(RequestBuilder::new(stub))
5241        }
5242
5243        /// Sets the full request, replacing any prior values.
5244        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5245            mut self,
5246            v: V,
5247        ) -> Self {
5248            self.0.request = v.into();
5249            self
5250        }
5251
5252        /// Sets all the options, replacing any prior values.
5253        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5254            self.0.options = v.into();
5255            self
5256        }
5257
5258        /// Sends the request.
5259        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5260            (*self.0.stub)
5261                .list_operations(self.0.request, self.0.options)
5262                .await
5263                .map(crate::Response::into_body)
5264        }
5265
5266        /// Streams each page in the collection.
5267        pub fn by_page(
5268            self,
5269        ) -> impl google_cloud_gax::paginator::Paginator<
5270            google_cloud_longrunning::model::ListOperationsResponse,
5271            crate::Error,
5272        > {
5273            use std::clone::Clone;
5274            let token = self.0.request.page_token.clone();
5275            let execute = move |token: String| {
5276                let mut builder = self.clone();
5277                builder.0.request = builder.0.request.set_page_token(token);
5278                builder.send()
5279            };
5280            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5281        }
5282
5283        /// Streams each item in the collection.
5284        pub fn by_item(
5285            self,
5286        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5287            google_cloud_longrunning::model::ListOperationsResponse,
5288            crate::Error,
5289        > {
5290            use google_cloud_gax::paginator::Paginator;
5291            self.by_page().items()
5292        }
5293
5294        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5295        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5296            self.0.request.name = v.into();
5297            self
5298        }
5299
5300        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5301        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5302            self.0.request.filter = v.into();
5303            self
5304        }
5305
5306        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5307        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5308            self.0.request.page_size = v.into();
5309            self
5310        }
5311
5312        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5313        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5314            self.0.request.page_token = v.into();
5315            self
5316        }
5317
5318        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5319        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5320            self.0.request.return_partial_success = v.into();
5321            self
5322        }
5323    }
5324
5325    #[doc(hidden)]
5326    impl crate::RequestBuilder for ListOperations {
5327        fn request_options(&mut self) -> &mut crate::RequestOptions {
5328            &mut self.0.options
5329        }
5330    }
5331
5332    /// The request builder for [DomainMappings::get_operation][crate::client::DomainMappings::get_operation] calls.
5333    ///
5334    /// # Example
5335    /// ```
5336    /// # use google_cloud_appengine_v1::builder::domain_mappings::GetOperation;
5337    /// # async fn sample() -> google_cloud_appengine_v1::Result<()> {
5338    ///
5339    /// let builder = prepare_request_builder();
5340    /// let response = builder.send().await?;
5341    /// # Ok(()) }
5342    ///
5343    /// fn prepare_request_builder() -> GetOperation {
5344    ///   # panic!();
5345    ///   // ... details omitted ...
5346    /// }
5347    /// ```
5348    #[derive(Clone, Debug)]
5349    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5350
5351    impl GetOperation {
5352        pub(crate) fn new(
5353            stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5354        ) -> Self {
5355            Self(RequestBuilder::new(stub))
5356        }
5357
5358        /// Sets the full request, replacing any prior values.
5359        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5360            mut self,
5361            v: V,
5362        ) -> Self {
5363            self.0.request = v.into();
5364            self
5365        }
5366
5367        /// Sets all the options, replacing any prior values.
5368        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5369            self.0.options = v.into();
5370            self
5371        }
5372
5373        /// Sends the request.
5374        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5375            (*self.0.stub)
5376                .get_operation(self.0.request, self.0.options)
5377                .await
5378                .map(crate::Response::into_body)
5379        }
5380
5381        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5382        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5383            self.0.request.name = v.into();
5384            self
5385        }
5386    }
5387
5388    #[doc(hidden)]
5389    impl crate::RequestBuilder for GetOperation {
5390        fn request_options(&mut self) -> &mut crate::RequestOptions {
5391            &mut self.0.options
5392        }
5393    }
5394}