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