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