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