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