google_cloud_appengine_v1/
builder.rs

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