Skip to main content

google_cloud_apphub_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [AppHub][crate::client::AppHub].
18pub mod app_hub {
19    use crate::Result;
20
21    /// A builder for [AppHub][crate::client::AppHub].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_apphub_v1::*;
26    /// # use builder::app_hub::ClientBuilder;
27    /// # use client::AppHub;
28    /// let builder : ClientBuilder = AppHub::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://apphub.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::AppHub;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = AppHub;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::AppHub] 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::AppHub>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
64            Self {
65                stub,
66                request: R::default(),
67                options: crate::RequestOptions::default(),
68            }
69        }
70    }
71
72    /// The request builder for [AppHub::lookup_service_project_attachment][crate::client::AppHub::lookup_service_project_attachment] calls.
73    ///
74    /// # Example
75    /// ```
76    /// # use google_cloud_apphub_v1::builder::app_hub::LookupServiceProjectAttachment;
77    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
78    ///
79    /// let builder = prepare_request_builder();
80    /// let response = builder.send().await?;
81    /// # Ok(()) }
82    ///
83    /// fn prepare_request_builder() -> LookupServiceProjectAttachment {
84    ///   # panic!();
85    ///   // ... details omitted ...
86    /// }
87    /// ```
88    #[derive(Clone, Debug)]
89    pub struct LookupServiceProjectAttachment(
90        RequestBuilder<crate::model::LookupServiceProjectAttachmentRequest>,
91    );
92
93    impl LookupServiceProjectAttachment {
94        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
95            Self(RequestBuilder::new(stub))
96        }
97
98        /// Sets the full request, replacing any prior values.
99        pub fn with_request<V: Into<crate::model::LookupServiceProjectAttachmentRequest>>(
100            mut self,
101            v: V,
102        ) -> Self {
103            self.0.request = v.into();
104            self
105        }
106
107        /// Sets all the options, replacing any prior values.
108        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
109            self.0.options = v.into();
110            self
111        }
112
113        /// Sends the request.
114        pub async fn send(self) -> Result<crate::model::LookupServiceProjectAttachmentResponse> {
115            (*self.0.stub)
116                .lookup_service_project_attachment(self.0.request, self.0.options)
117                .await
118                .map(crate::Response::into_body)
119        }
120
121        /// Sets the value of [name][crate::model::LookupServiceProjectAttachmentRequest::name].
122        ///
123        /// This is a **required** field for requests.
124        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
125            self.0.request.name = v.into();
126            self
127        }
128    }
129
130    #[doc(hidden)]
131    impl crate::RequestBuilder for LookupServiceProjectAttachment {
132        fn request_options(&mut self) -> &mut crate::RequestOptions {
133            &mut self.0.options
134        }
135    }
136
137    /// The request builder for [AppHub::list_service_project_attachments][crate::client::AppHub::list_service_project_attachments] calls.
138    ///
139    /// # Example
140    /// ```
141    /// # use google_cloud_apphub_v1::builder::app_hub::ListServiceProjectAttachments;
142    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
143    /// use google_cloud_gax::paginator::ItemPaginator;
144    ///
145    /// let builder = prepare_request_builder();
146    /// let mut items = builder.by_item();
147    /// while let Some(result) = items.next().await {
148    ///   let item = result?;
149    /// }
150    /// # Ok(()) }
151    ///
152    /// fn prepare_request_builder() -> ListServiceProjectAttachments {
153    ///   # panic!();
154    ///   // ... details omitted ...
155    /// }
156    /// ```
157    #[derive(Clone, Debug)]
158    pub struct ListServiceProjectAttachments(
159        RequestBuilder<crate::model::ListServiceProjectAttachmentsRequest>,
160    );
161
162    impl ListServiceProjectAttachments {
163        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
164            Self(RequestBuilder::new(stub))
165        }
166
167        /// Sets the full request, replacing any prior values.
168        pub fn with_request<V: Into<crate::model::ListServiceProjectAttachmentsRequest>>(
169            mut self,
170            v: V,
171        ) -> Self {
172            self.0.request = v.into();
173            self
174        }
175
176        /// Sets all the options, replacing any prior values.
177        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
178            self.0.options = v.into();
179            self
180        }
181
182        /// Sends the request.
183        pub async fn send(self) -> Result<crate::model::ListServiceProjectAttachmentsResponse> {
184            (*self.0.stub)
185                .list_service_project_attachments(self.0.request, self.0.options)
186                .await
187                .map(crate::Response::into_body)
188        }
189
190        /// Streams each page in the collection.
191        pub fn by_page(
192            self,
193        ) -> impl google_cloud_gax::paginator::Paginator<
194            crate::model::ListServiceProjectAttachmentsResponse,
195            crate::Error,
196        > {
197            use std::clone::Clone;
198            let token = self.0.request.page_token.clone();
199            let execute = move |token: String| {
200                let mut builder = self.clone();
201                builder.0.request = builder.0.request.set_page_token(token);
202                builder.send()
203            };
204            google_cloud_gax::paginator::internal::new_paginator(token, execute)
205        }
206
207        /// Streams each item in the collection.
208        pub fn by_item(
209            self,
210        ) -> impl google_cloud_gax::paginator::ItemPaginator<
211            crate::model::ListServiceProjectAttachmentsResponse,
212            crate::Error,
213        > {
214            use google_cloud_gax::paginator::Paginator;
215            self.by_page().items()
216        }
217
218        /// Sets the value of [parent][crate::model::ListServiceProjectAttachmentsRequest::parent].
219        ///
220        /// This is a **required** field for requests.
221        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
222            self.0.request.parent = v.into();
223            self
224        }
225
226        /// Sets the value of [page_size][crate::model::ListServiceProjectAttachmentsRequest::page_size].
227        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
228            self.0.request.page_size = v.into();
229            self
230        }
231
232        /// Sets the value of [page_token][crate::model::ListServiceProjectAttachmentsRequest::page_token].
233        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
234            self.0.request.page_token = v.into();
235            self
236        }
237
238        /// Sets the value of [filter][crate::model::ListServiceProjectAttachmentsRequest::filter].
239        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
240            self.0.request.filter = v.into();
241            self
242        }
243
244        /// Sets the value of [order_by][crate::model::ListServiceProjectAttachmentsRequest::order_by].
245        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
246            self.0.request.order_by = v.into();
247            self
248        }
249    }
250
251    #[doc(hidden)]
252    impl crate::RequestBuilder for ListServiceProjectAttachments {
253        fn request_options(&mut self) -> &mut crate::RequestOptions {
254            &mut self.0.options
255        }
256    }
257
258    /// The request builder for [AppHub::create_service_project_attachment][crate::client::AppHub::create_service_project_attachment] calls.
259    ///
260    /// # Example
261    /// ```
262    /// # use google_cloud_apphub_v1::builder::app_hub::CreateServiceProjectAttachment;
263    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
264    /// use google_cloud_lro::Poller;
265    ///
266    /// let builder = prepare_request_builder();
267    /// let response = builder.poller().until_done().await?;
268    /// # Ok(()) }
269    ///
270    /// fn prepare_request_builder() -> CreateServiceProjectAttachment {
271    ///   # panic!();
272    ///   // ... details omitted ...
273    /// }
274    /// ```
275    #[derive(Clone, Debug)]
276    pub struct CreateServiceProjectAttachment(
277        RequestBuilder<crate::model::CreateServiceProjectAttachmentRequest>,
278    );
279
280    impl CreateServiceProjectAttachment {
281        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
282            Self(RequestBuilder::new(stub))
283        }
284
285        /// Sets the full request, replacing any prior values.
286        pub fn with_request<V: Into<crate::model::CreateServiceProjectAttachmentRequest>>(
287            mut self,
288            v: V,
289        ) -> Self {
290            self.0.request = v.into();
291            self
292        }
293
294        /// Sets all the options, replacing any prior values.
295        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
296            self.0.options = v.into();
297            self
298        }
299
300        /// Sends the request.
301        ///
302        /// # Long running operations
303        ///
304        /// This starts, but does not poll, a longrunning operation. More information
305        /// on [create_service_project_attachment][crate::client::AppHub::create_service_project_attachment].
306        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
307            (*self.0.stub)
308                .create_service_project_attachment(self.0.request, self.0.options)
309                .await
310                .map(crate::Response::into_body)
311        }
312
313        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_project_attachment`.
314        pub fn poller(
315            self,
316        ) -> impl google_cloud_lro::Poller<
317            crate::model::ServiceProjectAttachment,
318            crate::model::OperationMetadata,
319        > {
320            type Operation = google_cloud_lro::internal::Operation<
321                crate::model::ServiceProjectAttachment,
322                crate::model::OperationMetadata,
323            >;
324            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
325            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
326            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
327            if let Some(ref mut details) = poller_options.tracing {
328                details.method_name = "google_cloud_apphub_v1::client::AppHub::create_service_project_attachment::until_done";
329            }
330
331            let stub = self.0.stub.clone();
332            let mut options = self.0.options.clone();
333            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
334            let query = move |name| {
335                let stub = stub.clone();
336                let options = options.clone();
337                async {
338                    let op = GetOperation::new(stub)
339                        .set_name(name)
340                        .with_options(options)
341                        .send()
342                        .await?;
343                    Ok(Operation::new(op))
344                }
345            };
346
347            let start = move || async {
348                let op = self.send().await?;
349                Ok(Operation::new(op))
350            };
351
352            use google_cloud_lro::internal::PollerExt;
353            {
354                google_cloud_lro::internal::new_poller(
355                    polling_error_policy,
356                    polling_backoff_policy,
357                    start,
358                    query,
359                )
360            }
361            .with_options(poller_options)
362        }
363
364        /// Sets the value of [parent][crate::model::CreateServiceProjectAttachmentRequest::parent].
365        ///
366        /// This is a **required** field for requests.
367        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368            self.0.request.parent = v.into();
369            self
370        }
371
372        /// Sets the value of [service_project_attachment_id][crate::model::CreateServiceProjectAttachmentRequest::service_project_attachment_id].
373        ///
374        /// This is a **required** field for requests.
375        pub fn set_service_project_attachment_id<T: Into<std::string::String>>(
376            mut self,
377            v: T,
378        ) -> Self {
379            self.0.request.service_project_attachment_id = v.into();
380            self
381        }
382
383        /// Sets the value of [service_project_attachment][crate::model::CreateServiceProjectAttachmentRequest::service_project_attachment].
384        ///
385        /// This is a **required** field for requests.
386        pub fn set_service_project_attachment<T>(mut self, v: T) -> Self
387        where
388            T: std::convert::Into<crate::model::ServiceProjectAttachment>,
389        {
390            self.0.request.service_project_attachment = std::option::Option::Some(v.into());
391            self
392        }
393
394        /// Sets or clears the value of [service_project_attachment][crate::model::CreateServiceProjectAttachmentRequest::service_project_attachment].
395        ///
396        /// This is a **required** field for requests.
397        pub fn set_or_clear_service_project_attachment<T>(
398            mut self,
399            v: std::option::Option<T>,
400        ) -> Self
401        where
402            T: std::convert::Into<crate::model::ServiceProjectAttachment>,
403        {
404            self.0.request.service_project_attachment = v.map(|x| x.into());
405            self
406        }
407
408        /// Sets the value of [request_id][crate::model::CreateServiceProjectAttachmentRequest::request_id].
409        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
410            self.0.request.request_id = v.into();
411            self
412        }
413    }
414
415    #[doc(hidden)]
416    impl crate::RequestBuilder for CreateServiceProjectAttachment {
417        fn request_options(&mut self) -> &mut crate::RequestOptions {
418            &mut self.0.options
419        }
420    }
421
422    /// The request builder for [AppHub::get_service_project_attachment][crate::client::AppHub::get_service_project_attachment] calls.
423    ///
424    /// # Example
425    /// ```
426    /// # use google_cloud_apphub_v1::builder::app_hub::GetServiceProjectAttachment;
427    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
428    ///
429    /// let builder = prepare_request_builder();
430    /// let response = builder.send().await?;
431    /// # Ok(()) }
432    ///
433    /// fn prepare_request_builder() -> GetServiceProjectAttachment {
434    ///   # panic!();
435    ///   // ... details omitted ...
436    /// }
437    /// ```
438    #[derive(Clone, Debug)]
439    pub struct GetServiceProjectAttachment(
440        RequestBuilder<crate::model::GetServiceProjectAttachmentRequest>,
441    );
442
443    impl GetServiceProjectAttachment {
444        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
445            Self(RequestBuilder::new(stub))
446        }
447
448        /// Sets the full request, replacing any prior values.
449        pub fn with_request<V: Into<crate::model::GetServiceProjectAttachmentRequest>>(
450            mut self,
451            v: V,
452        ) -> Self {
453            self.0.request = v.into();
454            self
455        }
456
457        /// Sets all the options, replacing any prior values.
458        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
459            self.0.options = v.into();
460            self
461        }
462
463        /// Sends the request.
464        pub async fn send(self) -> Result<crate::model::ServiceProjectAttachment> {
465            (*self.0.stub)
466                .get_service_project_attachment(self.0.request, self.0.options)
467                .await
468                .map(crate::Response::into_body)
469        }
470
471        /// Sets the value of [name][crate::model::GetServiceProjectAttachmentRequest::name].
472        ///
473        /// This is a **required** field for requests.
474        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
475            self.0.request.name = v.into();
476            self
477        }
478    }
479
480    #[doc(hidden)]
481    impl crate::RequestBuilder for GetServiceProjectAttachment {
482        fn request_options(&mut self) -> &mut crate::RequestOptions {
483            &mut self.0.options
484        }
485    }
486
487    /// The request builder for [AppHub::delete_service_project_attachment][crate::client::AppHub::delete_service_project_attachment] calls.
488    ///
489    /// # Example
490    /// ```
491    /// # use google_cloud_apphub_v1::builder::app_hub::DeleteServiceProjectAttachment;
492    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
493    /// use google_cloud_lro::Poller;
494    ///
495    /// let builder = prepare_request_builder();
496    /// let response = builder.poller().until_done().await?;
497    /// # Ok(()) }
498    ///
499    /// fn prepare_request_builder() -> DeleteServiceProjectAttachment {
500    ///   # panic!();
501    ///   // ... details omitted ...
502    /// }
503    /// ```
504    #[derive(Clone, Debug)]
505    pub struct DeleteServiceProjectAttachment(
506        RequestBuilder<crate::model::DeleteServiceProjectAttachmentRequest>,
507    );
508
509    impl DeleteServiceProjectAttachment {
510        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
511            Self(RequestBuilder::new(stub))
512        }
513
514        /// Sets the full request, replacing any prior values.
515        pub fn with_request<V: Into<crate::model::DeleteServiceProjectAttachmentRequest>>(
516            mut self,
517            v: V,
518        ) -> Self {
519            self.0.request = v.into();
520            self
521        }
522
523        /// Sets all the options, replacing any prior values.
524        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
525            self.0.options = v.into();
526            self
527        }
528
529        /// Sends the request.
530        ///
531        /// # Long running operations
532        ///
533        /// This starts, but does not poll, a longrunning operation. More information
534        /// on [delete_service_project_attachment][crate::client::AppHub::delete_service_project_attachment].
535        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
536            (*self.0.stub)
537                .delete_service_project_attachment(self.0.request, self.0.options)
538                .await
539                .map(crate::Response::into_body)
540        }
541
542        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_project_attachment`.
543        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
544            type Operation =
545                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
546            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
547            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
548            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
549            if let Some(ref mut details) = poller_options.tracing {
550                details.method_name = "google_cloud_apphub_v1::client::AppHub::delete_service_project_attachment::until_done";
551            }
552
553            let stub = self.0.stub.clone();
554            let mut options = self.0.options.clone();
555            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
556            let query = move |name| {
557                let stub = stub.clone();
558                let options = options.clone();
559                async {
560                    let op = GetOperation::new(stub)
561                        .set_name(name)
562                        .with_options(options)
563                        .send()
564                        .await?;
565                    Ok(Operation::new(op))
566                }
567            };
568
569            let start = move || async {
570                let op = self.send().await?;
571                Ok(Operation::new(op))
572            };
573
574            use google_cloud_lro::internal::PollerExt;
575            {
576                google_cloud_lro::internal::new_unit_response_poller(
577                    polling_error_policy,
578                    polling_backoff_policy,
579                    start,
580                    query,
581                )
582            }
583            .with_options(poller_options)
584        }
585
586        /// Sets the value of [name][crate::model::DeleteServiceProjectAttachmentRequest::name].
587        ///
588        /// This is a **required** field for requests.
589        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
590            self.0.request.name = v.into();
591            self
592        }
593
594        /// Sets the value of [request_id][crate::model::DeleteServiceProjectAttachmentRequest::request_id].
595        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
596            self.0.request.request_id = v.into();
597            self
598        }
599    }
600
601    #[doc(hidden)]
602    impl crate::RequestBuilder for DeleteServiceProjectAttachment {
603        fn request_options(&mut self) -> &mut crate::RequestOptions {
604            &mut self.0.options
605        }
606    }
607
608    /// The request builder for [AppHub::detach_service_project_attachment][crate::client::AppHub::detach_service_project_attachment] calls.
609    ///
610    /// # Example
611    /// ```
612    /// # use google_cloud_apphub_v1::builder::app_hub::DetachServiceProjectAttachment;
613    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
614    ///
615    /// let builder = prepare_request_builder();
616    /// let response = builder.send().await?;
617    /// # Ok(()) }
618    ///
619    /// fn prepare_request_builder() -> DetachServiceProjectAttachment {
620    ///   # panic!();
621    ///   // ... details omitted ...
622    /// }
623    /// ```
624    #[derive(Clone, Debug)]
625    pub struct DetachServiceProjectAttachment(
626        RequestBuilder<crate::model::DetachServiceProjectAttachmentRequest>,
627    );
628
629    impl DetachServiceProjectAttachment {
630        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
631            Self(RequestBuilder::new(stub))
632        }
633
634        /// Sets the full request, replacing any prior values.
635        pub fn with_request<V: Into<crate::model::DetachServiceProjectAttachmentRequest>>(
636            mut self,
637            v: V,
638        ) -> Self {
639            self.0.request = v.into();
640            self
641        }
642
643        /// Sets all the options, replacing any prior values.
644        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
645            self.0.options = v.into();
646            self
647        }
648
649        /// Sends the request.
650        pub async fn send(self) -> Result<crate::model::DetachServiceProjectAttachmentResponse> {
651            (*self.0.stub)
652                .detach_service_project_attachment(self.0.request, self.0.options)
653                .await
654                .map(crate::Response::into_body)
655        }
656
657        /// Sets the value of [name][crate::model::DetachServiceProjectAttachmentRequest::name].
658        ///
659        /// This is a **required** field for requests.
660        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
661            self.0.request.name = v.into();
662            self
663        }
664    }
665
666    #[doc(hidden)]
667    impl crate::RequestBuilder for DetachServiceProjectAttachment {
668        fn request_options(&mut self) -> &mut crate::RequestOptions {
669            &mut self.0.options
670        }
671    }
672
673    /// The request builder for [AppHub::list_discovered_services][crate::client::AppHub::list_discovered_services] calls.
674    ///
675    /// # Example
676    /// ```
677    /// # use google_cloud_apphub_v1::builder::app_hub::ListDiscoveredServices;
678    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
679    /// use google_cloud_gax::paginator::ItemPaginator;
680    ///
681    /// let builder = prepare_request_builder();
682    /// let mut items = builder.by_item();
683    /// while let Some(result) = items.next().await {
684    ///   let item = result?;
685    /// }
686    /// # Ok(()) }
687    ///
688    /// fn prepare_request_builder() -> ListDiscoveredServices {
689    ///   # panic!();
690    ///   // ... details omitted ...
691    /// }
692    /// ```
693    #[derive(Clone, Debug)]
694    pub struct ListDiscoveredServices(RequestBuilder<crate::model::ListDiscoveredServicesRequest>);
695
696    impl ListDiscoveredServices {
697        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
698            Self(RequestBuilder::new(stub))
699        }
700
701        /// Sets the full request, replacing any prior values.
702        pub fn with_request<V: Into<crate::model::ListDiscoveredServicesRequest>>(
703            mut self,
704            v: V,
705        ) -> Self {
706            self.0.request = v.into();
707            self
708        }
709
710        /// Sets all the options, replacing any prior values.
711        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
712            self.0.options = v.into();
713            self
714        }
715
716        /// Sends the request.
717        pub async fn send(self) -> Result<crate::model::ListDiscoveredServicesResponse> {
718            (*self.0.stub)
719                .list_discovered_services(self.0.request, self.0.options)
720                .await
721                .map(crate::Response::into_body)
722        }
723
724        /// Streams each page in the collection.
725        pub fn by_page(
726            self,
727        ) -> impl google_cloud_gax::paginator::Paginator<
728            crate::model::ListDiscoveredServicesResponse,
729            crate::Error,
730        > {
731            use std::clone::Clone;
732            let token = self.0.request.page_token.clone();
733            let execute = move |token: String| {
734                let mut builder = self.clone();
735                builder.0.request = builder.0.request.set_page_token(token);
736                builder.send()
737            };
738            google_cloud_gax::paginator::internal::new_paginator(token, execute)
739        }
740
741        /// Streams each item in the collection.
742        pub fn by_item(
743            self,
744        ) -> impl google_cloud_gax::paginator::ItemPaginator<
745            crate::model::ListDiscoveredServicesResponse,
746            crate::Error,
747        > {
748            use google_cloud_gax::paginator::Paginator;
749            self.by_page().items()
750        }
751
752        /// Sets the value of [parent][crate::model::ListDiscoveredServicesRequest::parent].
753        ///
754        /// This is a **required** field for requests.
755        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
756            self.0.request.parent = v.into();
757            self
758        }
759
760        /// Sets the value of [page_size][crate::model::ListDiscoveredServicesRequest::page_size].
761        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
762            self.0.request.page_size = v.into();
763            self
764        }
765
766        /// Sets the value of [page_token][crate::model::ListDiscoveredServicesRequest::page_token].
767        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
768            self.0.request.page_token = v.into();
769            self
770        }
771
772        /// Sets the value of [filter][crate::model::ListDiscoveredServicesRequest::filter].
773        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
774            self.0.request.filter = v.into();
775            self
776        }
777
778        /// Sets the value of [order_by][crate::model::ListDiscoveredServicesRequest::order_by].
779        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
780            self.0.request.order_by = v.into();
781            self
782        }
783    }
784
785    #[doc(hidden)]
786    impl crate::RequestBuilder for ListDiscoveredServices {
787        fn request_options(&mut self) -> &mut crate::RequestOptions {
788            &mut self.0.options
789        }
790    }
791
792    /// The request builder for [AppHub::get_discovered_service][crate::client::AppHub::get_discovered_service] calls.
793    ///
794    /// # Example
795    /// ```
796    /// # use google_cloud_apphub_v1::builder::app_hub::GetDiscoveredService;
797    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
798    ///
799    /// let builder = prepare_request_builder();
800    /// let response = builder.send().await?;
801    /// # Ok(()) }
802    ///
803    /// fn prepare_request_builder() -> GetDiscoveredService {
804    ///   # panic!();
805    ///   // ... details omitted ...
806    /// }
807    /// ```
808    #[derive(Clone, Debug)]
809    pub struct GetDiscoveredService(RequestBuilder<crate::model::GetDiscoveredServiceRequest>);
810
811    impl GetDiscoveredService {
812        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
813            Self(RequestBuilder::new(stub))
814        }
815
816        /// Sets the full request, replacing any prior values.
817        pub fn with_request<V: Into<crate::model::GetDiscoveredServiceRequest>>(
818            mut self,
819            v: V,
820        ) -> Self {
821            self.0.request = v.into();
822            self
823        }
824
825        /// Sets all the options, replacing any prior values.
826        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
827            self.0.options = v.into();
828            self
829        }
830
831        /// Sends the request.
832        pub async fn send(self) -> Result<crate::model::DiscoveredService> {
833            (*self.0.stub)
834                .get_discovered_service(self.0.request, self.0.options)
835                .await
836                .map(crate::Response::into_body)
837        }
838
839        /// Sets the value of [name][crate::model::GetDiscoveredServiceRequest::name].
840        ///
841        /// This is a **required** field for requests.
842        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
843            self.0.request.name = v.into();
844            self
845        }
846    }
847
848    #[doc(hidden)]
849    impl crate::RequestBuilder for GetDiscoveredService {
850        fn request_options(&mut self) -> &mut crate::RequestOptions {
851            &mut self.0.options
852        }
853    }
854
855    /// The request builder for [AppHub::lookup_discovered_service][crate::client::AppHub::lookup_discovered_service] calls.
856    ///
857    /// # Example
858    /// ```
859    /// # use google_cloud_apphub_v1::builder::app_hub::LookupDiscoveredService;
860    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
861    ///
862    /// let builder = prepare_request_builder();
863    /// let response = builder.send().await?;
864    /// # Ok(()) }
865    ///
866    /// fn prepare_request_builder() -> LookupDiscoveredService {
867    ///   # panic!();
868    ///   // ... details omitted ...
869    /// }
870    /// ```
871    #[derive(Clone, Debug)]
872    pub struct LookupDiscoveredService(
873        RequestBuilder<crate::model::LookupDiscoveredServiceRequest>,
874    );
875
876    impl LookupDiscoveredService {
877        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
878            Self(RequestBuilder::new(stub))
879        }
880
881        /// Sets the full request, replacing any prior values.
882        pub fn with_request<V: Into<crate::model::LookupDiscoveredServiceRequest>>(
883            mut self,
884            v: V,
885        ) -> Self {
886            self.0.request = v.into();
887            self
888        }
889
890        /// Sets all the options, replacing any prior values.
891        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
892            self.0.options = v.into();
893            self
894        }
895
896        /// Sends the request.
897        pub async fn send(self) -> Result<crate::model::LookupDiscoveredServiceResponse> {
898            (*self.0.stub)
899                .lookup_discovered_service(self.0.request, self.0.options)
900                .await
901                .map(crate::Response::into_body)
902        }
903
904        /// Sets the value of [parent][crate::model::LookupDiscoveredServiceRequest::parent].
905        ///
906        /// This is a **required** field for requests.
907        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
908            self.0.request.parent = v.into();
909            self
910        }
911
912        /// Sets the value of [uri][crate::model::LookupDiscoveredServiceRequest::uri].
913        ///
914        /// This is a **required** field for requests.
915        pub fn set_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
916            self.0.request.uri = v.into();
917            self
918        }
919    }
920
921    #[doc(hidden)]
922    impl crate::RequestBuilder for LookupDiscoveredService {
923        fn request_options(&mut self) -> &mut crate::RequestOptions {
924            &mut self.0.options
925        }
926    }
927
928    /// The request builder for [AppHub::list_services][crate::client::AppHub::list_services] calls.
929    ///
930    /// # Example
931    /// ```
932    /// # use google_cloud_apphub_v1::builder::app_hub::ListServices;
933    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
934    /// use google_cloud_gax::paginator::ItemPaginator;
935    ///
936    /// let builder = prepare_request_builder();
937    /// let mut items = builder.by_item();
938    /// while let Some(result) = items.next().await {
939    ///   let item = result?;
940    /// }
941    /// # Ok(()) }
942    ///
943    /// fn prepare_request_builder() -> ListServices {
944    ///   # panic!();
945    ///   // ... details omitted ...
946    /// }
947    /// ```
948    #[derive(Clone, Debug)]
949    pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
950
951    impl ListServices {
952        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
953            Self(RequestBuilder::new(stub))
954        }
955
956        /// Sets the full request, replacing any prior values.
957        pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
958            self.0.request = v.into();
959            self
960        }
961
962        /// Sets all the options, replacing any prior values.
963        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
964            self.0.options = v.into();
965            self
966        }
967
968        /// Sends the request.
969        pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
970            (*self.0.stub)
971                .list_services(self.0.request, self.0.options)
972                .await
973                .map(crate::Response::into_body)
974        }
975
976        /// Streams each page in the collection.
977        pub fn by_page(
978            self,
979        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListServicesResponse, crate::Error>
980        {
981            use std::clone::Clone;
982            let token = self.0.request.page_token.clone();
983            let execute = move |token: String| {
984                let mut builder = self.clone();
985                builder.0.request = builder.0.request.set_page_token(token);
986                builder.send()
987            };
988            google_cloud_gax::paginator::internal::new_paginator(token, execute)
989        }
990
991        /// Streams each item in the collection.
992        pub fn by_item(
993            self,
994        ) -> impl google_cloud_gax::paginator::ItemPaginator<
995            crate::model::ListServicesResponse,
996            crate::Error,
997        > {
998            use google_cloud_gax::paginator::Paginator;
999            self.by_page().items()
1000        }
1001
1002        /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
1003        ///
1004        /// This is a **required** field for requests.
1005        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1006            self.0.request.parent = v.into();
1007            self
1008        }
1009
1010        /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
1011        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1012            self.0.request.page_size = v.into();
1013            self
1014        }
1015
1016        /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
1017        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1018            self.0.request.page_token = v.into();
1019            self
1020        }
1021
1022        /// Sets the value of [filter][crate::model::ListServicesRequest::filter].
1023        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1024            self.0.request.filter = v.into();
1025            self
1026        }
1027
1028        /// Sets the value of [order_by][crate::model::ListServicesRequest::order_by].
1029        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1030            self.0.request.order_by = v.into();
1031            self
1032        }
1033    }
1034
1035    #[doc(hidden)]
1036    impl crate::RequestBuilder for ListServices {
1037        fn request_options(&mut self) -> &mut crate::RequestOptions {
1038            &mut self.0.options
1039        }
1040    }
1041
1042    /// The request builder for [AppHub::create_service][crate::client::AppHub::create_service] calls.
1043    ///
1044    /// # Example
1045    /// ```
1046    /// # use google_cloud_apphub_v1::builder::app_hub::CreateService;
1047    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1048    /// use google_cloud_lro::Poller;
1049    ///
1050    /// let builder = prepare_request_builder();
1051    /// let response = builder.poller().until_done().await?;
1052    /// # Ok(()) }
1053    ///
1054    /// fn prepare_request_builder() -> CreateService {
1055    ///   # panic!();
1056    ///   // ... details omitted ...
1057    /// }
1058    /// ```
1059    #[derive(Clone, Debug)]
1060    pub struct CreateService(RequestBuilder<crate::model::CreateServiceRequest>);
1061
1062    impl CreateService {
1063        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1064            Self(RequestBuilder::new(stub))
1065        }
1066
1067        /// Sets the full request, replacing any prior values.
1068        pub fn with_request<V: Into<crate::model::CreateServiceRequest>>(mut self, v: V) -> Self {
1069            self.0.request = v.into();
1070            self
1071        }
1072
1073        /// Sets all the options, replacing any prior values.
1074        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1075            self.0.options = v.into();
1076            self
1077        }
1078
1079        /// Sends the request.
1080        ///
1081        /// # Long running operations
1082        ///
1083        /// This starts, but does not poll, a longrunning operation. More information
1084        /// on [create_service][crate::client::AppHub::create_service].
1085        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1086            (*self.0.stub)
1087                .create_service(self.0.request, self.0.options)
1088                .await
1089                .map(crate::Response::into_body)
1090        }
1091
1092        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service`.
1093        pub fn poller(
1094            self,
1095        ) -> impl google_cloud_lro::Poller<crate::model::Service, crate::model::OperationMetadata>
1096        {
1097            type Operation = google_cloud_lro::internal::Operation<
1098                crate::model::Service,
1099                crate::model::OperationMetadata,
1100            >;
1101            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1102            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1103            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1104            if let Some(ref mut details) = poller_options.tracing {
1105                details.method_name =
1106                    "google_cloud_apphub_v1::client::AppHub::create_service::until_done";
1107            }
1108
1109            let stub = self.0.stub.clone();
1110            let mut options = self.0.options.clone();
1111            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1112            let query = move |name| {
1113                let stub = stub.clone();
1114                let options = options.clone();
1115                async {
1116                    let op = GetOperation::new(stub)
1117                        .set_name(name)
1118                        .with_options(options)
1119                        .send()
1120                        .await?;
1121                    Ok(Operation::new(op))
1122                }
1123            };
1124
1125            let start = move || async {
1126                let op = self.send().await?;
1127                Ok(Operation::new(op))
1128            };
1129
1130            use google_cloud_lro::internal::PollerExt;
1131            {
1132                google_cloud_lro::internal::new_poller(
1133                    polling_error_policy,
1134                    polling_backoff_policy,
1135                    start,
1136                    query,
1137                )
1138            }
1139            .with_options(poller_options)
1140        }
1141
1142        /// Sets the value of [parent][crate::model::CreateServiceRequest::parent].
1143        ///
1144        /// This is a **required** field for requests.
1145        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1146            self.0.request.parent = v.into();
1147            self
1148        }
1149
1150        /// Sets the value of [service_id][crate::model::CreateServiceRequest::service_id].
1151        ///
1152        /// This is a **required** field for requests.
1153        pub fn set_service_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1154            self.0.request.service_id = v.into();
1155            self
1156        }
1157
1158        /// Sets the value of [service][crate::model::CreateServiceRequest::service].
1159        ///
1160        /// This is a **required** field for requests.
1161        pub fn set_service<T>(mut self, v: T) -> Self
1162        where
1163            T: std::convert::Into<crate::model::Service>,
1164        {
1165            self.0.request.service = std::option::Option::Some(v.into());
1166            self
1167        }
1168
1169        /// Sets or clears the value of [service][crate::model::CreateServiceRequest::service].
1170        ///
1171        /// This is a **required** field for requests.
1172        pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
1173        where
1174            T: std::convert::Into<crate::model::Service>,
1175        {
1176            self.0.request.service = v.map(|x| x.into());
1177            self
1178        }
1179
1180        /// Sets the value of [request_id][crate::model::CreateServiceRequest::request_id].
1181        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1182            self.0.request.request_id = v.into();
1183            self
1184        }
1185    }
1186
1187    #[doc(hidden)]
1188    impl crate::RequestBuilder for CreateService {
1189        fn request_options(&mut self) -> &mut crate::RequestOptions {
1190            &mut self.0.options
1191        }
1192    }
1193
1194    /// The request builder for [AppHub::get_service][crate::client::AppHub::get_service] calls.
1195    ///
1196    /// # Example
1197    /// ```
1198    /// # use google_cloud_apphub_v1::builder::app_hub::GetService;
1199    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1200    ///
1201    /// let builder = prepare_request_builder();
1202    /// let response = builder.send().await?;
1203    /// # Ok(()) }
1204    ///
1205    /// fn prepare_request_builder() -> GetService {
1206    ///   # panic!();
1207    ///   // ... details omitted ...
1208    /// }
1209    /// ```
1210    #[derive(Clone, Debug)]
1211    pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
1212
1213    impl GetService {
1214        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1215            Self(RequestBuilder::new(stub))
1216        }
1217
1218        /// Sets the full request, replacing any prior values.
1219        pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
1220            self.0.request = v.into();
1221            self
1222        }
1223
1224        /// Sets all the options, replacing any prior values.
1225        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1226            self.0.options = v.into();
1227            self
1228        }
1229
1230        /// Sends the request.
1231        pub async fn send(self) -> Result<crate::model::Service> {
1232            (*self.0.stub)
1233                .get_service(self.0.request, self.0.options)
1234                .await
1235                .map(crate::Response::into_body)
1236        }
1237
1238        /// Sets the value of [name][crate::model::GetServiceRequest::name].
1239        ///
1240        /// This is a **required** field for requests.
1241        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1242            self.0.request.name = v.into();
1243            self
1244        }
1245    }
1246
1247    #[doc(hidden)]
1248    impl crate::RequestBuilder for GetService {
1249        fn request_options(&mut self) -> &mut crate::RequestOptions {
1250            &mut self.0.options
1251        }
1252    }
1253
1254    /// The request builder for [AppHub::update_service][crate::client::AppHub::update_service] calls.
1255    ///
1256    /// # Example
1257    /// ```
1258    /// # use google_cloud_apphub_v1::builder::app_hub::UpdateService;
1259    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1260    /// use google_cloud_lro::Poller;
1261    ///
1262    /// let builder = prepare_request_builder();
1263    /// let response = builder.poller().until_done().await?;
1264    /// # Ok(()) }
1265    ///
1266    /// fn prepare_request_builder() -> UpdateService {
1267    ///   # panic!();
1268    ///   // ... details omitted ...
1269    /// }
1270    /// ```
1271    #[derive(Clone, Debug)]
1272    pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
1273
1274    impl UpdateService {
1275        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1276            Self(RequestBuilder::new(stub))
1277        }
1278
1279        /// Sets the full request, replacing any prior values.
1280        pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
1281            self.0.request = v.into();
1282            self
1283        }
1284
1285        /// Sets all the options, replacing any prior values.
1286        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1287            self.0.options = v.into();
1288            self
1289        }
1290
1291        /// Sends the request.
1292        ///
1293        /// # Long running operations
1294        ///
1295        /// This starts, but does not poll, a longrunning operation. More information
1296        /// on [update_service][crate::client::AppHub::update_service].
1297        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1298            (*self.0.stub)
1299                .update_service(self.0.request, self.0.options)
1300                .await
1301                .map(crate::Response::into_body)
1302        }
1303
1304        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service`.
1305        pub fn poller(
1306            self,
1307        ) -> impl google_cloud_lro::Poller<crate::model::Service, crate::model::OperationMetadata>
1308        {
1309            type Operation = google_cloud_lro::internal::Operation<
1310                crate::model::Service,
1311                crate::model::OperationMetadata,
1312            >;
1313            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1314            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1315            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1316            if let Some(ref mut details) = poller_options.tracing {
1317                details.method_name =
1318                    "google_cloud_apphub_v1::client::AppHub::update_service::until_done";
1319            }
1320
1321            let stub = self.0.stub.clone();
1322            let mut options = self.0.options.clone();
1323            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1324            let query = move |name| {
1325                let stub = stub.clone();
1326                let options = options.clone();
1327                async {
1328                    let op = GetOperation::new(stub)
1329                        .set_name(name)
1330                        .with_options(options)
1331                        .send()
1332                        .await?;
1333                    Ok(Operation::new(op))
1334                }
1335            };
1336
1337            let start = move || async {
1338                let op = self.send().await?;
1339                Ok(Operation::new(op))
1340            };
1341
1342            use google_cloud_lro::internal::PollerExt;
1343            {
1344                google_cloud_lro::internal::new_poller(
1345                    polling_error_policy,
1346                    polling_backoff_policy,
1347                    start,
1348                    query,
1349                )
1350            }
1351            .with_options(poller_options)
1352        }
1353
1354        /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
1355        ///
1356        /// This is a **required** field for requests.
1357        pub fn set_update_mask<T>(mut self, v: T) -> Self
1358        where
1359            T: std::convert::Into<wkt::FieldMask>,
1360        {
1361            self.0.request.update_mask = std::option::Option::Some(v.into());
1362            self
1363        }
1364
1365        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
1366        ///
1367        /// This is a **required** field for requests.
1368        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1369        where
1370            T: std::convert::Into<wkt::FieldMask>,
1371        {
1372            self.0.request.update_mask = v.map(|x| x.into());
1373            self
1374        }
1375
1376        /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
1377        ///
1378        /// This is a **required** field for requests.
1379        pub fn set_service<T>(mut self, v: T) -> Self
1380        where
1381            T: std::convert::Into<crate::model::Service>,
1382        {
1383            self.0.request.service = std::option::Option::Some(v.into());
1384            self
1385        }
1386
1387        /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
1388        ///
1389        /// This is a **required** field for requests.
1390        pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
1391        where
1392            T: std::convert::Into<crate::model::Service>,
1393        {
1394            self.0.request.service = v.map(|x| x.into());
1395            self
1396        }
1397
1398        /// Sets the value of [request_id][crate::model::UpdateServiceRequest::request_id].
1399        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1400            self.0.request.request_id = v.into();
1401            self
1402        }
1403    }
1404
1405    #[doc(hidden)]
1406    impl crate::RequestBuilder for UpdateService {
1407        fn request_options(&mut self) -> &mut crate::RequestOptions {
1408            &mut self.0.options
1409        }
1410    }
1411
1412    /// The request builder for [AppHub::delete_service][crate::client::AppHub::delete_service] calls.
1413    ///
1414    /// # Example
1415    /// ```
1416    /// # use google_cloud_apphub_v1::builder::app_hub::DeleteService;
1417    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1418    /// use google_cloud_lro::Poller;
1419    ///
1420    /// let builder = prepare_request_builder();
1421    /// let response = builder.poller().until_done().await?;
1422    /// # Ok(()) }
1423    ///
1424    /// fn prepare_request_builder() -> DeleteService {
1425    ///   # panic!();
1426    ///   // ... details omitted ...
1427    /// }
1428    /// ```
1429    #[derive(Clone, Debug)]
1430    pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1431
1432    impl DeleteService {
1433        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1434            Self(RequestBuilder::new(stub))
1435        }
1436
1437        /// Sets the full request, replacing any prior values.
1438        pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1439            self.0.request = v.into();
1440            self
1441        }
1442
1443        /// Sets all the options, replacing any prior values.
1444        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1445            self.0.options = v.into();
1446            self
1447        }
1448
1449        /// Sends the request.
1450        ///
1451        /// # Long running operations
1452        ///
1453        /// This starts, but does not poll, a longrunning operation. More information
1454        /// on [delete_service][crate::client::AppHub::delete_service].
1455        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1456            (*self.0.stub)
1457                .delete_service(self.0.request, self.0.options)
1458                .await
1459                .map(crate::Response::into_body)
1460        }
1461
1462        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service`.
1463        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1464            type Operation =
1465                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1466            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1467            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1468            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1469            if let Some(ref mut details) = poller_options.tracing {
1470                details.method_name =
1471                    "google_cloud_apphub_v1::client::AppHub::delete_service::until_done";
1472            }
1473
1474            let stub = self.0.stub.clone();
1475            let mut options = self.0.options.clone();
1476            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1477            let query = move |name| {
1478                let stub = stub.clone();
1479                let options = options.clone();
1480                async {
1481                    let op = GetOperation::new(stub)
1482                        .set_name(name)
1483                        .with_options(options)
1484                        .send()
1485                        .await?;
1486                    Ok(Operation::new(op))
1487                }
1488            };
1489
1490            let start = move || async {
1491                let op = self.send().await?;
1492                Ok(Operation::new(op))
1493            };
1494
1495            use google_cloud_lro::internal::PollerExt;
1496            {
1497                google_cloud_lro::internal::new_unit_response_poller(
1498                    polling_error_policy,
1499                    polling_backoff_policy,
1500                    start,
1501                    query,
1502                )
1503            }
1504            .with_options(poller_options)
1505        }
1506
1507        /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
1508        ///
1509        /// This is a **required** field for requests.
1510        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1511            self.0.request.name = v.into();
1512            self
1513        }
1514
1515        /// Sets the value of [request_id][crate::model::DeleteServiceRequest::request_id].
1516        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1517            self.0.request.request_id = v.into();
1518            self
1519        }
1520    }
1521
1522    #[doc(hidden)]
1523    impl crate::RequestBuilder for DeleteService {
1524        fn request_options(&mut self) -> &mut crate::RequestOptions {
1525            &mut self.0.options
1526        }
1527    }
1528
1529    /// The request builder for [AppHub::list_discovered_workloads][crate::client::AppHub::list_discovered_workloads] calls.
1530    ///
1531    /// # Example
1532    /// ```
1533    /// # use google_cloud_apphub_v1::builder::app_hub::ListDiscoveredWorkloads;
1534    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1535    /// use google_cloud_gax::paginator::ItemPaginator;
1536    ///
1537    /// let builder = prepare_request_builder();
1538    /// let mut items = builder.by_item();
1539    /// while let Some(result) = items.next().await {
1540    ///   let item = result?;
1541    /// }
1542    /// # Ok(()) }
1543    ///
1544    /// fn prepare_request_builder() -> ListDiscoveredWorkloads {
1545    ///   # panic!();
1546    ///   // ... details omitted ...
1547    /// }
1548    /// ```
1549    #[derive(Clone, Debug)]
1550    pub struct ListDiscoveredWorkloads(
1551        RequestBuilder<crate::model::ListDiscoveredWorkloadsRequest>,
1552    );
1553
1554    impl ListDiscoveredWorkloads {
1555        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1556            Self(RequestBuilder::new(stub))
1557        }
1558
1559        /// Sets the full request, replacing any prior values.
1560        pub fn with_request<V: Into<crate::model::ListDiscoveredWorkloadsRequest>>(
1561            mut self,
1562            v: V,
1563        ) -> Self {
1564            self.0.request = v.into();
1565            self
1566        }
1567
1568        /// Sets all the options, replacing any prior values.
1569        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1570            self.0.options = v.into();
1571            self
1572        }
1573
1574        /// Sends the request.
1575        pub async fn send(self) -> Result<crate::model::ListDiscoveredWorkloadsResponse> {
1576            (*self.0.stub)
1577                .list_discovered_workloads(self.0.request, self.0.options)
1578                .await
1579                .map(crate::Response::into_body)
1580        }
1581
1582        /// Streams each page in the collection.
1583        pub fn by_page(
1584            self,
1585        ) -> impl google_cloud_gax::paginator::Paginator<
1586            crate::model::ListDiscoveredWorkloadsResponse,
1587            crate::Error,
1588        > {
1589            use std::clone::Clone;
1590            let token = self.0.request.page_token.clone();
1591            let execute = move |token: String| {
1592                let mut builder = self.clone();
1593                builder.0.request = builder.0.request.set_page_token(token);
1594                builder.send()
1595            };
1596            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1597        }
1598
1599        /// Streams each item in the collection.
1600        pub fn by_item(
1601            self,
1602        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1603            crate::model::ListDiscoveredWorkloadsResponse,
1604            crate::Error,
1605        > {
1606            use google_cloud_gax::paginator::Paginator;
1607            self.by_page().items()
1608        }
1609
1610        /// Sets the value of [parent][crate::model::ListDiscoveredWorkloadsRequest::parent].
1611        ///
1612        /// This is a **required** field for requests.
1613        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1614            self.0.request.parent = v.into();
1615            self
1616        }
1617
1618        /// Sets the value of [page_size][crate::model::ListDiscoveredWorkloadsRequest::page_size].
1619        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1620            self.0.request.page_size = v.into();
1621            self
1622        }
1623
1624        /// Sets the value of [page_token][crate::model::ListDiscoveredWorkloadsRequest::page_token].
1625        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1626            self.0.request.page_token = v.into();
1627            self
1628        }
1629
1630        /// Sets the value of [filter][crate::model::ListDiscoveredWorkloadsRequest::filter].
1631        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1632            self.0.request.filter = v.into();
1633            self
1634        }
1635
1636        /// Sets the value of [order_by][crate::model::ListDiscoveredWorkloadsRequest::order_by].
1637        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1638            self.0.request.order_by = v.into();
1639            self
1640        }
1641    }
1642
1643    #[doc(hidden)]
1644    impl crate::RequestBuilder for ListDiscoveredWorkloads {
1645        fn request_options(&mut self) -> &mut crate::RequestOptions {
1646            &mut self.0.options
1647        }
1648    }
1649
1650    /// The request builder for [AppHub::get_discovered_workload][crate::client::AppHub::get_discovered_workload] calls.
1651    ///
1652    /// # Example
1653    /// ```
1654    /// # use google_cloud_apphub_v1::builder::app_hub::GetDiscoveredWorkload;
1655    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1656    ///
1657    /// let builder = prepare_request_builder();
1658    /// let response = builder.send().await?;
1659    /// # Ok(()) }
1660    ///
1661    /// fn prepare_request_builder() -> GetDiscoveredWorkload {
1662    ///   # panic!();
1663    ///   // ... details omitted ...
1664    /// }
1665    /// ```
1666    #[derive(Clone, Debug)]
1667    pub struct GetDiscoveredWorkload(RequestBuilder<crate::model::GetDiscoveredWorkloadRequest>);
1668
1669    impl GetDiscoveredWorkload {
1670        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1671            Self(RequestBuilder::new(stub))
1672        }
1673
1674        /// Sets the full request, replacing any prior values.
1675        pub fn with_request<V: Into<crate::model::GetDiscoveredWorkloadRequest>>(
1676            mut self,
1677            v: V,
1678        ) -> Self {
1679            self.0.request = v.into();
1680            self
1681        }
1682
1683        /// Sets all the options, replacing any prior values.
1684        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1685            self.0.options = v.into();
1686            self
1687        }
1688
1689        /// Sends the request.
1690        pub async fn send(self) -> Result<crate::model::DiscoveredWorkload> {
1691            (*self.0.stub)
1692                .get_discovered_workload(self.0.request, self.0.options)
1693                .await
1694                .map(crate::Response::into_body)
1695        }
1696
1697        /// Sets the value of [name][crate::model::GetDiscoveredWorkloadRequest::name].
1698        ///
1699        /// This is a **required** field for requests.
1700        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1701            self.0.request.name = v.into();
1702            self
1703        }
1704    }
1705
1706    #[doc(hidden)]
1707    impl crate::RequestBuilder for GetDiscoveredWorkload {
1708        fn request_options(&mut self) -> &mut crate::RequestOptions {
1709            &mut self.0.options
1710        }
1711    }
1712
1713    /// The request builder for [AppHub::lookup_discovered_workload][crate::client::AppHub::lookup_discovered_workload] calls.
1714    ///
1715    /// # Example
1716    /// ```
1717    /// # use google_cloud_apphub_v1::builder::app_hub::LookupDiscoveredWorkload;
1718    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1719    ///
1720    /// let builder = prepare_request_builder();
1721    /// let response = builder.send().await?;
1722    /// # Ok(()) }
1723    ///
1724    /// fn prepare_request_builder() -> LookupDiscoveredWorkload {
1725    ///   # panic!();
1726    ///   // ... details omitted ...
1727    /// }
1728    /// ```
1729    #[derive(Clone, Debug)]
1730    pub struct LookupDiscoveredWorkload(
1731        RequestBuilder<crate::model::LookupDiscoveredWorkloadRequest>,
1732    );
1733
1734    impl LookupDiscoveredWorkload {
1735        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1736            Self(RequestBuilder::new(stub))
1737        }
1738
1739        /// Sets the full request, replacing any prior values.
1740        pub fn with_request<V: Into<crate::model::LookupDiscoveredWorkloadRequest>>(
1741            mut self,
1742            v: V,
1743        ) -> Self {
1744            self.0.request = v.into();
1745            self
1746        }
1747
1748        /// Sets all the options, replacing any prior values.
1749        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1750            self.0.options = v.into();
1751            self
1752        }
1753
1754        /// Sends the request.
1755        pub async fn send(self) -> Result<crate::model::LookupDiscoveredWorkloadResponse> {
1756            (*self.0.stub)
1757                .lookup_discovered_workload(self.0.request, self.0.options)
1758                .await
1759                .map(crate::Response::into_body)
1760        }
1761
1762        /// Sets the value of [parent][crate::model::LookupDiscoveredWorkloadRequest::parent].
1763        ///
1764        /// This is a **required** field for requests.
1765        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1766            self.0.request.parent = v.into();
1767            self
1768        }
1769
1770        /// Sets the value of [uri][crate::model::LookupDiscoveredWorkloadRequest::uri].
1771        ///
1772        /// This is a **required** field for requests.
1773        pub fn set_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
1774            self.0.request.uri = v.into();
1775            self
1776        }
1777    }
1778
1779    #[doc(hidden)]
1780    impl crate::RequestBuilder for LookupDiscoveredWorkload {
1781        fn request_options(&mut self) -> &mut crate::RequestOptions {
1782            &mut self.0.options
1783        }
1784    }
1785
1786    /// The request builder for [AppHub::list_workloads][crate::client::AppHub::list_workloads] calls.
1787    ///
1788    /// # Example
1789    /// ```
1790    /// # use google_cloud_apphub_v1::builder::app_hub::ListWorkloads;
1791    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1792    /// use google_cloud_gax::paginator::ItemPaginator;
1793    ///
1794    /// let builder = prepare_request_builder();
1795    /// let mut items = builder.by_item();
1796    /// while let Some(result) = items.next().await {
1797    ///   let item = result?;
1798    /// }
1799    /// # Ok(()) }
1800    ///
1801    /// fn prepare_request_builder() -> ListWorkloads {
1802    ///   # panic!();
1803    ///   // ... details omitted ...
1804    /// }
1805    /// ```
1806    #[derive(Clone, Debug)]
1807    pub struct ListWorkloads(RequestBuilder<crate::model::ListWorkloadsRequest>);
1808
1809    impl ListWorkloads {
1810        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1811            Self(RequestBuilder::new(stub))
1812        }
1813
1814        /// Sets the full request, replacing any prior values.
1815        pub fn with_request<V: Into<crate::model::ListWorkloadsRequest>>(mut self, v: V) -> Self {
1816            self.0.request = v.into();
1817            self
1818        }
1819
1820        /// Sets all the options, replacing any prior values.
1821        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1822            self.0.options = v.into();
1823            self
1824        }
1825
1826        /// Sends the request.
1827        pub async fn send(self) -> Result<crate::model::ListWorkloadsResponse> {
1828            (*self.0.stub)
1829                .list_workloads(self.0.request, self.0.options)
1830                .await
1831                .map(crate::Response::into_body)
1832        }
1833
1834        /// Streams each page in the collection.
1835        pub fn by_page(
1836            self,
1837        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListWorkloadsResponse, crate::Error>
1838        {
1839            use std::clone::Clone;
1840            let token = self.0.request.page_token.clone();
1841            let execute = move |token: String| {
1842                let mut builder = self.clone();
1843                builder.0.request = builder.0.request.set_page_token(token);
1844                builder.send()
1845            };
1846            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1847        }
1848
1849        /// Streams each item in the collection.
1850        pub fn by_item(
1851            self,
1852        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1853            crate::model::ListWorkloadsResponse,
1854            crate::Error,
1855        > {
1856            use google_cloud_gax::paginator::Paginator;
1857            self.by_page().items()
1858        }
1859
1860        /// Sets the value of [parent][crate::model::ListWorkloadsRequest::parent].
1861        ///
1862        /// This is a **required** field for requests.
1863        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1864            self.0.request.parent = v.into();
1865            self
1866        }
1867
1868        /// Sets the value of [page_size][crate::model::ListWorkloadsRequest::page_size].
1869        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1870            self.0.request.page_size = v.into();
1871            self
1872        }
1873
1874        /// Sets the value of [page_token][crate::model::ListWorkloadsRequest::page_token].
1875        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1876            self.0.request.page_token = v.into();
1877            self
1878        }
1879
1880        /// Sets the value of [filter][crate::model::ListWorkloadsRequest::filter].
1881        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882            self.0.request.filter = v.into();
1883            self
1884        }
1885
1886        /// Sets the value of [order_by][crate::model::ListWorkloadsRequest::order_by].
1887        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1888            self.0.request.order_by = v.into();
1889            self
1890        }
1891    }
1892
1893    #[doc(hidden)]
1894    impl crate::RequestBuilder for ListWorkloads {
1895        fn request_options(&mut self) -> &mut crate::RequestOptions {
1896            &mut self.0.options
1897        }
1898    }
1899
1900    /// The request builder for [AppHub::create_workload][crate::client::AppHub::create_workload] calls.
1901    ///
1902    /// # Example
1903    /// ```
1904    /// # use google_cloud_apphub_v1::builder::app_hub::CreateWorkload;
1905    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
1906    /// use google_cloud_lro::Poller;
1907    ///
1908    /// let builder = prepare_request_builder();
1909    /// let response = builder.poller().until_done().await?;
1910    /// # Ok(()) }
1911    ///
1912    /// fn prepare_request_builder() -> CreateWorkload {
1913    ///   # panic!();
1914    ///   // ... details omitted ...
1915    /// }
1916    /// ```
1917    #[derive(Clone, Debug)]
1918    pub struct CreateWorkload(RequestBuilder<crate::model::CreateWorkloadRequest>);
1919
1920    impl CreateWorkload {
1921        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1922            Self(RequestBuilder::new(stub))
1923        }
1924
1925        /// Sets the full request, replacing any prior values.
1926        pub fn with_request<V: Into<crate::model::CreateWorkloadRequest>>(mut self, v: V) -> Self {
1927            self.0.request = v.into();
1928            self
1929        }
1930
1931        /// Sets all the options, replacing any prior values.
1932        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1933            self.0.options = v.into();
1934            self
1935        }
1936
1937        /// Sends the request.
1938        ///
1939        /// # Long running operations
1940        ///
1941        /// This starts, but does not poll, a longrunning operation. More information
1942        /// on [create_workload][crate::client::AppHub::create_workload].
1943        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1944            (*self.0.stub)
1945                .create_workload(self.0.request, self.0.options)
1946                .await
1947                .map(crate::Response::into_body)
1948        }
1949
1950        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_workload`.
1951        pub fn poller(
1952            self,
1953        ) -> impl google_cloud_lro::Poller<crate::model::Workload, crate::model::OperationMetadata>
1954        {
1955            type Operation = google_cloud_lro::internal::Operation<
1956                crate::model::Workload,
1957                crate::model::OperationMetadata,
1958            >;
1959            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1960            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1961            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1962            if let Some(ref mut details) = poller_options.tracing {
1963                details.method_name =
1964                    "google_cloud_apphub_v1::client::AppHub::create_workload::until_done";
1965            }
1966
1967            let stub = self.0.stub.clone();
1968            let mut options = self.0.options.clone();
1969            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1970            let query = move |name| {
1971                let stub = stub.clone();
1972                let options = options.clone();
1973                async {
1974                    let op = GetOperation::new(stub)
1975                        .set_name(name)
1976                        .with_options(options)
1977                        .send()
1978                        .await?;
1979                    Ok(Operation::new(op))
1980                }
1981            };
1982
1983            let start = move || async {
1984                let op = self.send().await?;
1985                Ok(Operation::new(op))
1986            };
1987
1988            use google_cloud_lro::internal::PollerExt;
1989            {
1990                google_cloud_lro::internal::new_poller(
1991                    polling_error_policy,
1992                    polling_backoff_policy,
1993                    start,
1994                    query,
1995                )
1996            }
1997            .with_options(poller_options)
1998        }
1999
2000        /// Sets the value of [parent][crate::model::CreateWorkloadRequest::parent].
2001        ///
2002        /// This is a **required** field for requests.
2003        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2004            self.0.request.parent = v.into();
2005            self
2006        }
2007
2008        /// Sets the value of [workload_id][crate::model::CreateWorkloadRequest::workload_id].
2009        ///
2010        /// This is a **required** field for requests.
2011        pub fn set_workload_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2012            self.0.request.workload_id = v.into();
2013            self
2014        }
2015
2016        /// Sets the value of [workload][crate::model::CreateWorkloadRequest::workload].
2017        ///
2018        /// This is a **required** field for requests.
2019        pub fn set_workload<T>(mut self, v: T) -> Self
2020        where
2021            T: std::convert::Into<crate::model::Workload>,
2022        {
2023            self.0.request.workload = std::option::Option::Some(v.into());
2024            self
2025        }
2026
2027        /// Sets or clears the value of [workload][crate::model::CreateWorkloadRequest::workload].
2028        ///
2029        /// This is a **required** field for requests.
2030        pub fn set_or_clear_workload<T>(mut self, v: std::option::Option<T>) -> Self
2031        where
2032            T: std::convert::Into<crate::model::Workload>,
2033        {
2034            self.0.request.workload = v.map(|x| x.into());
2035            self
2036        }
2037
2038        /// Sets the value of [request_id][crate::model::CreateWorkloadRequest::request_id].
2039        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2040            self.0.request.request_id = v.into();
2041            self
2042        }
2043    }
2044
2045    #[doc(hidden)]
2046    impl crate::RequestBuilder for CreateWorkload {
2047        fn request_options(&mut self) -> &mut crate::RequestOptions {
2048            &mut self.0.options
2049        }
2050    }
2051
2052    /// The request builder for [AppHub::get_workload][crate::client::AppHub::get_workload] calls.
2053    ///
2054    /// # Example
2055    /// ```
2056    /// # use google_cloud_apphub_v1::builder::app_hub::GetWorkload;
2057    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
2058    ///
2059    /// let builder = prepare_request_builder();
2060    /// let response = builder.send().await?;
2061    /// # Ok(()) }
2062    ///
2063    /// fn prepare_request_builder() -> GetWorkload {
2064    ///   # panic!();
2065    ///   // ... details omitted ...
2066    /// }
2067    /// ```
2068    #[derive(Clone, Debug)]
2069    pub struct GetWorkload(RequestBuilder<crate::model::GetWorkloadRequest>);
2070
2071    impl GetWorkload {
2072        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2073            Self(RequestBuilder::new(stub))
2074        }
2075
2076        /// Sets the full request, replacing any prior values.
2077        pub fn with_request<V: Into<crate::model::GetWorkloadRequest>>(mut self, v: V) -> Self {
2078            self.0.request = v.into();
2079            self
2080        }
2081
2082        /// Sets all the options, replacing any prior values.
2083        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2084            self.0.options = v.into();
2085            self
2086        }
2087
2088        /// Sends the request.
2089        pub async fn send(self) -> Result<crate::model::Workload> {
2090            (*self.0.stub)
2091                .get_workload(self.0.request, self.0.options)
2092                .await
2093                .map(crate::Response::into_body)
2094        }
2095
2096        /// Sets the value of [name][crate::model::GetWorkloadRequest::name].
2097        ///
2098        /// This is a **required** field for requests.
2099        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2100            self.0.request.name = v.into();
2101            self
2102        }
2103    }
2104
2105    #[doc(hidden)]
2106    impl crate::RequestBuilder for GetWorkload {
2107        fn request_options(&mut self) -> &mut crate::RequestOptions {
2108            &mut self.0.options
2109        }
2110    }
2111
2112    /// The request builder for [AppHub::update_workload][crate::client::AppHub::update_workload] calls.
2113    ///
2114    /// # Example
2115    /// ```
2116    /// # use google_cloud_apphub_v1::builder::app_hub::UpdateWorkload;
2117    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
2118    /// use google_cloud_lro::Poller;
2119    ///
2120    /// let builder = prepare_request_builder();
2121    /// let response = builder.poller().until_done().await?;
2122    /// # Ok(()) }
2123    ///
2124    /// fn prepare_request_builder() -> UpdateWorkload {
2125    ///   # panic!();
2126    ///   // ... details omitted ...
2127    /// }
2128    /// ```
2129    #[derive(Clone, Debug)]
2130    pub struct UpdateWorkload(RequestBuilder<crate::model::UpdateWorkloadRequest>);
2131
2132    impl UpdateWorkload {
2133        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2134            Self(RequestBuilder::new(stub))
2135        }
2136
2137        /// Sets the full request, replacing any prior values.
2138        pub fn with_request<V: Into<crate::model::UpdateWorkloadRequest>>(mut self, v: V) -> Self {
2139            self.0.request = v.into();
2140            self
2141        }
2142
2143        /// Sets all the options, replacing any prior values.
2144        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2145            self.0.options = v.into();
2146            self
2147        }
2148
2149        /// Sends the request.
2150        ///
2151        /// # Long running operations
2152        ///
2153        /// This starts, but does not poll, a longrunning operation. More information
2154        /// on [update_workload][crate::client::AppHub::update_workload].
2155        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2156            (*self.0.stub)
2157                .update_workload(self.0.request, self.0.options)
2158                .await
2159                .map(crate::Response::into_body)
2160        }
2161
2162        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_workload`.
2163        pub fn poller(
2164            self,
2165        ) -> impl google_cloud_lro::Poller<crate::model::Workload, crate::model::OperationMetadata>
2166        {
2167            type Operation = google_cloud_lro::internal::Operation<
2168                crate::model::Workload,
2169                crate::model::OperationMetadata,
2170            >;
2171            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2172            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2173            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2174            if let Some(ref mut details) = poller_options.tracing {
2175                details.method_name =
2176                    "google_cloud_apphub_v1::client::AppHub::update_workload::until_done";
2177            }
2178
2179            let stub = self.0.stub.clone();
2180            let mut options = self.0.options.clone();
2181            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2182            let query = move |name| {
2183                let stub = stub.clone();
2184                let options = options.clone();
2185                async {
2186                    let op = GetOperation::new(stub)
2187                        .set_name(name)
2188                        .with_options(options)
2189                        .send()
2190                        .await?;
2191                    Ok(Operation::new(op))
2192                }
2193            };
2194
2195            let start = move || async {
2196                let op = self.send().await?;
2197                Ok(Operation::new(op))
2198            };
2199
2200            use google_cloud_lro::internal::PollerExt;
2201            {
2202                google_cloud_lro::internal::new_poller(
2203                    polling_error_policy,
2204                    polling_backoff_policy,
2205                    start,
2206                    query,
2207                )
2208            }
2209            .with_options(poller_options)
2210        }
2211
2212        /// Sets the value of [update_mask][crate::model::UpdateWorkloadRequest::update_mask].
2213        ///
2214        /// This is a **required** field for requests.
2215        pub fn set_update_mask<T>(mut self, v: T) -> Self
2216        where
2217            T: std::convert::Into<wkt::FieldMask>,
2218        {
2219            self.0.request.update_mask = std::option::Option::Some(v.into());
2220            self
2221        }
2222
2223        /// Sets or clears the value of [update_mask][crate::model::UpdateWorkloadRequest::update_mask].
2224        ///
2225        /// This is a **required** field for requests.
2226        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2227        where
2228            T: std::convert::Into<wkt::FieldMask>,
2229        {
2230            self.0.request.update_mask = v.map(|x| x.into());
2231            self
2232        }
2233
2234        /// Sets the value of [workload][crate::model::UpdateWorkloadRequest::workload].
2235        ///
2236        /// This is a **required** field for requests.
2237        pub fn set_workload<T>(mut self, v: T) -> Self
2238        where
2239            T: std::convert::Into<crate::model::Workload>,
2240        {
2241            self.0.request.workload = std::option::Option::Some(v.into());
2242            self
2243        }
2244
2245        /// Sets or clears the value of [workload][crate::model::UpdateWorkloadRequest::workload].
2246        ///
2247        /// This is a **required** field for requests.
2248        pub fn set_or_clear_workload<T>(mut self, v: std::option::Option<T>) -> Self
2249        where
2250            T: std::convert::Into<crate::model::Workload>,
2251        {
2252            self.0.request.workload = v.map(|x| x.into());
2253            self
2254        }
2255
2256        /// Sets the value of [request_id][crate::model::UpdateWorkloadRequest::request_id].
2257        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2258            self.0.request.request_id = v.into();
2259            self
2260        }
2261    }
2262
2263    #[doc(hidden)]
2264    impl crate::RequestBuilder for UpdateWorkload {
2265        fn request_options(&mut self) -> &mut crate::RequestOptions {
2266            &mut self.0.options
2267        }
2268    }
2269
2270    /// The request builder for [AppHub::delete_workload][crate::client::AppHub::delete_workload] calls.
2271    ///
2272    /// # Example
2273    /// ```
2274    /// # use google_cloud_apphub_v1::builder::app_hub::DeleteWorkload;
2275    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
2276    /// use google_cloud_lro::Poller;
2277    ///
2278    /// let builder = prepare_request_builder();
2279    /// let response = builder.poller().until_done().await?;
2280    /// # Ok(()) }
2281    ///
2282    /// fn prepare_request_builder() -> DeleteWorkload {
2283    ///   # panic!();
2284    ///   // ... details omitted ...
2285    /// }
2286    /// ```
2287    #[derive(Clone, Debug)]
2288    pub struct DeleteWorkload(RequestBuilder<crate::model::DeleteWorkloadRequest>);
2289
2290    impl DeleteWorkload {
2291        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2292            Self(RequestBuilder::new(stub))
2293        }
2294
2295        /// Sets the full request, replacing any prior values.
2296        pub fn with_request<V: Into<crate::model::DeleteWorkloadRequest>>(mut self, v: V) -> Self {
2297            self.0.request = v.into();
2298            self
2299        }
2300
2301        /// Sets all the options, replacing any prior values.
2302        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2303            self.0.options = v.into();
2304            self
2305        }
2306
2307        /// Sends the request.
2308        ///
2309        /// # Long running operations
2310        ///
2311        /// This starts, but does not poll, a longrunning operation. More information
2312        /// on [delete_workload][crate::client::AppHub::delete_workload].
2313        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2314            (*self.0.stub)
2315                .delete_workload(self.0.request, self.0.options)
2316                .await
2317                .map(crate::Response::into_body)
2318        }
2319
2320        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_workload`.
2321        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2322            type Operation =
2323                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2324            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2325            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2326            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2327            if let Some(ref mut details) = poller_options.tracing {
2328                details.method_name =
2329                    "google_cloud_apphub_v1::client::AppHub::delete_workload::until_done";
2330            }
2331
2332            let stub = self.0.stub.clone();
2333            let mut options = self.0.options.clone();
2334            options.set_retry_policy(google_cloud_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            use google_cloud_lro::internal::PollerExt;
2354            {
2355                google_cloud_lro::internal::new_unit_response_poller(
2356                    polling_error_policy,
2357                    polling_backoff_policy,
2358                    start,
2359                    query,
2360                )
2361            }
2362            .with_options(poller_options)
2363        }
2364
2365        /// Sets the value of [name][crate::model::DeleteWorkloadRequest::name].
2366        ///
2367        /// This is a **required** field for requests.
2368        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2369            self.0.request.name = v.into();
2370            self
2371        }
2372
2373        /// Sets the value of [request_id][crate::model::DeleteWorkloadRequest::request_id].
2374        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2375            self.0.request.request_id = v.into();
2376            self
2377        }
2378    }
2379
2380    #[doc(hidden)]
2381    impl crate::RequestBuilder for DeleteWorkload {
2382        fn request_options(&mut self) -> &mut crate::RequestOptions {
2383            &mut self.0.options
2384        }
2385    }
2386
2387    /// The request builder for [AppHub::list_applications][crate::client::AppHub::list_applications] calls.
2388    ///
2389    /// # Example
2390    /// ```
2391    /// # use google_cloud_apphub_v1::builder::app_hub::ListApplications;
2392    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
2393    /// use google_cloud_gax::paginator::ItemPaginator;
2394    ///
2395    /// let builder = prepare_request_builder();
2396    /// let mut items = builder.by_item();
2397    /// while let Some(result) = items.next().await {
2398    ///   let item = result?;
2399    /// }
2400    /// # Ok(()) }
2401    ///
2402    /// fn prepare_request_builder() -> ListApplications {
2403    ///   # panic!();
2404    ///   // ... details omitted ...
2405    /// }
2406    /// ```
2407    #[derive(Clone, Debug)]
2408    pub struct ListApplications(RequestBuilder<crate::model::ListApplicationsRequest>);
2409
2410    impl ListApplications {
2411        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2412            Self(RequestBuilder::new(stub))
2413        }
2414
2415        /// Sets the full request, replacing any prior values.
2416        pub fn with_request<V: Into<crate::model::ListApplicationsRequest>>(
2417            mut self,
2418            v: V,
2419        ) -> Self {
2420            self.0.request = v.into();
2421            self
2422        }
2423
2424        /// Sets all the options, replacing any prior values.
2425        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2426            self.0.options = v.into();
2427            self
2428        }
2429
2430        /// Sends the request.
2431        pub async fn send(self) -> Result<crate::model::ListApplicationsResponse> {
2432            (*self.0.stub)
2433                .list_applications(self.0.request, self.0.options)
2434                .await
2435                .map(crate::Response::into_body)
2436        }
2437
2438        /// Streams each page in the collection.
2439        pub fn by_page(
2440            self,
2441        ) -> impl google_cloud_gax::paginator::Paginator<
2442            crate::model::ListApplicationsResponse,
2443            crate::Error,
2444        > {
2445            use std::clone::Clone;
2446            let token = self.0.request.page_token.clone();
2447            let execute = move |token: String| {
2448                let mut builder = self.clone();
2449                builder.0.request = builder.0.request.set_page_token(token);
2450                builder.send()
2451            };
2452            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2453        }
2454
2455        /// Streams each item in the collection.
2456        pub fn by_item(
2457            self,
2458        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2459            crate::model::ListApplicationsResponse,
2460            crate::Error,
2461        > {
2462            use google_cloud_gax::paginator::Paginator;
2463            self.by_page().items()
2464        }
2465
2466        /// Sets the value of [parent][crate::model::ListApplicationsRequest::parent].
2467        ///
2468        /// This is a **required** field for requests.
2469        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470            self.0.request.parent = v.into();
2471            self
2472        }
2473
2474        /// Sets the value of [page_size][crate::model::ListApplicationsRequest::page_size].
2475        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2476            self.0.request.page_size = v.into();
2477            self
2478        }
2479
2480        /// Sets the value of [page_token][crate::model::ListApplicationsRequest::page_token].
2481        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2482            self.0.request.page_token = v.into();
2483            self
2484        }
2485
2486        /// Sets the value of [filter][crate::model::ListApplicationsRequest::filter].
2487        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2488            self.0.request.filter = v.into();
2489            self
2490        }
2491
2492        /// Sets the value of [order_by][crate::model::ListApplicationsRequest::order_by].
2493        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2494            self.0.request.order_by = v.into();
2495            self
2496        }
2497    }
2498
2499    #[doc(hidden)]
2500    impl crate::RequestBuilder for ListApplications {
2501        fn request_options(&mut self) -> &mut crate::RequestOptions {
2502            &mut self.0.options
2503        }
2504    }
2505
2506    /// The request builder for [AppHub::create_application][crate::client::AppHub::create_application] calls.
2507    ///
2508    /// # Example
2509    /// ```
2510    /// # use google_cloud_apphub_v1::builder::app_hub::CreateApplication;
2511    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
2512    /// use google_cloud_lro::Poller;
2513    ///
2514    /// let builder = prepare_request_builder();
2515    /// let response = builder.poller().until_done().await?;
2516    /// # Ok(()) }
2517    ///
2518    /// fn prepare_request_builder() -> CreateApplication {
2519    ///   # panic!();
2520    ///   // ... details omitted ...
2521    /// }
2522    /// ```
2523    #[derive(Clone, Debug)]
2524    pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
2525
2526    impl CreateApplication {
2527        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2528            Self(RequestBuilder::new(stub))
2529        }
2530
2531        /// Sets the full request, replacing any prior values.
2532        pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
2533            mut self,
2534            v: V,
2535        ) -> Self {
2536            self.0.request = v.into();
2537            self
2538        }
2539
2540        /// Sets all the options, replacing any prior values.
2541        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2542            self.0.options = v.into();
2543            self
2544        }
2545
2546        /// Sends the request.
2547        ///
2548        /// # Long running operations
2549        ///
2550        /// This starts, but does not poll, a longrunning operation. More information
2551        /// on [create_application][crate::client::AppHub::create_application].
2552        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2553            (*self.0.stub)
2554                .create_application(self.0.request, self.0.options)
2555                .await
2556                .map(crate::Response::into_body)
2557        }
2558
2559        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_application`.
2560        pub fn poller(
2561            self,
2562        ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadata>
2563        {
2564            type Operation = google_cloud_lro::internal::Operation<
2565                crate::model::Application,
2566                crate::model::OperationMetadata,
2567            >;
2568            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2569            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2570            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2571            if let Some(ref mut details) = poller_options.tracing {
2572                details.method_name =
2573                    "google_cloud_apphub_v1::client::AppHub::create_application::until_done";
2574            }
2575
2576            let stub = self.0.stub.clone();
2577            let mut options = self.0.options.clone();
2578            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2579            let query = move |name| {
2580                let stub = stub.clone();
2581                let options = options.clone();
2582                async {
2583                    let op = GetOperation::new(stub)
2584                        .set_name(name)
2585                        .with_options(options)
2586                        .send()
2587                        .await?;
2588                    Ok(Operation::new(op))
2589                }
2590            };
2591
2592            let start = move || async {
2593                let op = self.send().await?;
2594                Ok(Operation::new(op))
2595            };
2596
2597            use google_cloud_lro::internal::PollerExt;
2598            {
2599                google_cloud_lro::internal::new_poller(
2600                    polling_error_policy,
2601                    polling_backoff_policy,
2602                    start,
2603                    query,
2604                )
2605            }
2606            .with_options(poller_options)
2607        }
2608
2609        /// Sets the value of [parent][crate::model::CreateApplicationRequest::parent].
2610        ///
2611        /// This is a **required** field for requests.
2612        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2613            self.0.request.parent = v.into();
2614            self
2615        }
2616
2617        /// Sets the value of [application_id][crate::model::CreateApplicationRequest::application_id].
2618        ///
2619        /// This is a **required** field for requests.
2620        pub fn set_application_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2621            self.0.request.application_id = v.into();
2622            self
2623        }
2624
2625        /// Sets the value of [application][crate::model::CreateApplicationRequest::application].
2626        ///
2627        /// This is a **required** field for requests.
2628        pub fn set_application<T>(mut self, v: T) -> Self
2629        where
2630            T: std::convert::Into<crate::model::Application>,
2631        {
2632            self.0.request.application = std::option::Option::Some(v.into());
2633            self
2634        }
2635
2636        /// Sets or clears the value of [application][crate::model::CreateApplicationRequest::application].
2637        ///
2638        /// This is a **required** field for requests.
2639        pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
2640        where
2641            T: std::convert::Into<crate::model::Application>,
2642        {
2643            self.0.request.application = v.map(|x| x.into());
2644            self
2645        }
2646
2647        /// Sets the value of [request_id][crate::model::CreateApplicationRequest::request_id].
2648        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2649            self.0.request.request_id = v.into();
2650            self
2651        }
2652    }
2653
2654    #[doc(hidden)]
2655    impl crate::RequestBuilder for CreateApplication {
2656        fn request_options(&mut self) -> &mut crate::RequestOptions {
2657            &mut self.0.options
2658        }
2659    }
2660
2661    /// The request builder for [AppHub::get_application][crate::client::AppHub::get_application] calls.
2662    ///
2663    /// # Example
2664    /// ```
2665    /// # use google_cloud_apphub_v1::builder::app_hub::GetApplication;
2666    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
2667    ///
2668    /// let builder = prepare_request_builder();
2669    /// let response = builder.send().await?;
2670    /// # Ok(()) }
2671    ///
2672    /// fn prepare_request_builder() -> GetApplication {
2673    ///   # panic!();
2674    ///   // ... details omitted ...
2675    /// }
2676    /// ```
2677    #[derive(Clone, Debug)]
2678    pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
2679
2680    impl GetApplication {
2681        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2682            Self(RequestBuilder::new(stub))
2683        }
2684
2685        /// Sets the full request, replacing any prior values.
2686        pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
2687            self.0.request = v.into();
2688            self
2689        }
2690
2691        /// Sets all the options, replacing any prior values.
2692        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2693            self.0.options = v.into();
2694            self
2695        }
2696
2697        /// Sends the request.
2698        pub async fn send(self) -> Result<crate::model::Application> {
2699            (*self.0.stub)
2700                .get_application(self.0.request, self.0.options)
2701                .await
2702                .map(crate::Response::into_body)
2703        }
2704
2705        /// Sets the value of [name][crate::model::GetApplicationRequest::name].
2706        ///
2707        /// This is a **required** field for requests.
2708        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2709            self.0.request.name = v.into();
2710            self
2711        }
2712    }
2713
2714    #[doc(hidden)]
2715    impl crate::RequestBuilder for GetApplication {
2716        fn request_options(&mut self) -> &mut crate::RequestOptions {
2717            &mut self.0.options
2718        }
2719    }
2720
2721    /// The request builder for [AppHub::update_application][crate::client::AppHub::update_application] calls.
2722    ///
2723    /// # Example
2724    /// ```
2725    /// # use google_cloud_apphub_v1::builder::app_hub::UpdateApplication;
2726    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
2727    /// use google_cloud_lro::Poller;
2728    ///
2729    /// let builder = prepare_request_builder();
2730    /// let response = builder.poller().until_done().await?;
2731    /// # Ok(()) }
2732    ///
2733    /// fn prepare_request_builder() -> UpdateApplication {
2734    ///   # panic!();
2735    ///   // ... details omitted ...
2736    /// }
2737    /// ```
2738    #[derive(Clone, Debug)]
2739    pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
2740
2741    impl UpdateApplication {
2742        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2743            Self(RequestBuilder::new(stub))
2744        }
2745
2746        /// Sets the full request, replacing any prior values.
2747        pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
2748            mut self,
2749            v: V,
2750        ) -> Self {
2751            self.0.request = v.into();
2752            self
2753        }
2754
2755        /// Sets all the options, replacing any prior values.
2756        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2757            self.0.options = v.into();
2758            self
2759        }
2760
2761        /// Sends the request.
2762        ///
2763        /// # Long running operations
2764        ///
2765        /// This starts, but does not poll, a longrunning operation. More information
2766        /// on [update_application][crate::client::AppHub::update_application].
2767        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2768            (*self.0.stub)
2769                .update_application(self.0.request, self.0.options)
2770                .await
2771                .map(crate::Response::into_body)
2772        }
2773
2774        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_application`.
2775        pub fn poller(
2776            self,
2777        ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadata>
2778        {
2779            type Operation = google_cloud_lro::internal::Operation<
2780                crate::model::Application,
2781                crate::model::OperationMetadata,
2782            >;
2783            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2784            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2785            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2786            if let Some(ref mut details) = poller_options.tracing {
2787                details.method_name =
2788                    "google_cloud_apphub_v1::client::AppHub::update_application::until_done";
2789            }
2790
2791            let stub = self.0.stub.clone();
2792            let mut options = self.0.options.clone();
2793            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2794            let query = move |name| {
2795                let stub = stub.clone();
2796                let options = options.clone();
2797                async {
2798                    let op = GetOperation::new(stub)
2799                        .set_name(name)
2800                        .with_options(options)
2801                        .send()
2802                        .await?;
2803                    Ok(Operation::new(op))
2804                }
2805            };
2806
2807            let start = move || async {
2808                let op = self.send().await?;
2809                Ok(Operation::new(op))
2810            };
2811
2812            use google_cloud_lro::internal::PollerExt;
2813            {
2814                google_cloud_lro::internal::new_poller(
2815                    polling_error_policy,
2816                    polling_backoff_policy,
2817                    start,
2818                    query,
2819                )
2820            }
2821            .with_options(poller_options)
2822        }
2823
2824        /// Sets the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
2825        ///
2826        /// This is a **required** field for requests.
2827        pub fn set_update_mask<T>(mut self, v: T) -> Self
2828        where
2829            T: std::convert::Into<wkt::FieldMask>,
2830        {
2831            self.0.request.update_mask = std::option::Option::Some(v.into());
2832            self
2833        }
2834
2835        /// Sets or clears the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
2836        ///
2837        /// This is a **required** field for requests.
2838        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2839        where
2840            T: std::convert::Into<wkt::FieldMask>,
2841        {
2842            self.0.request.update_mask = v.map(|x| x.into());
2843            self
2844        }
2845
2846        /// Sets the value of [application][crate::model::UpdateApplicationRequest::application].
2847        ///
2848        /// This is a **required** field for requests.
2849        pub fn set_application<T>(mut self, v: T) -> Self
2850        where
2851            T: std::convert::Into<crate::model::Application>,
2852        {
2853            self.0.request.application = std::option::Option::Some(v.into());
2854            self
2855        }
2856
2857        /// Sets or clears the value of [application][crate::model::UpdateApplicationRequest::application].
2858        ///
2859        /// This is a **required** field for requests.
2860        pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
2861        where
2862            T: std::convert::Into<crate::model::Application>,
2863        {
2864            self.0.request.application = v.map(|x| x.into());
2865            self
2866        }
2867
2868        /// Sets the value of [request_id][crate::model::UpdateApplicationRequest::request_id].
2869        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2870            self.0.request.request_id = v.into();
2871            self
2872        }
2873    }
2874
2875    #[doc(hidden)]
2876    impl crate::RequestBuilder for UpdateApplication {
2877        fn request_options(&mut self) -> &mut crate::RequestOptions {
2878            &mut self.0.options
2879        }
2880    }
2881
2882    /// The request builder for [AppHub::delete_application][crate::client::AppHub::delete_application] calls.
2883    ///
2884    /// # Example
2885    /// ```
2886    /// # use google_cloud_apphub_v1::builder::app_hub::DeleteApplication;
2887    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
2888    /// use google_cloud_lro::Poller;
2889    ///
2890    /// let builder = prepare_request_builder();
2891    /// let response = builder.poller().until_done().await?;
2892    /// # Ok(()) }
2893    ///
2894    /// fn prepare_request_builder() -> DeleteApplication {
2895    ///   # panic!();
2896    ///   // ... details omitted ...
2897    /// }
2898    /// ```
2899    #[derive(Clone, Debug)]
2900    pub struct DeleteApplication(RequestBuilder<crate::model::DeleteApplicationRequest>);
2901
2902    impl DeleteApplication {
2903        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2904            Self(RequestBuilder::new(stub))
2905        }
2906
2907        /// Sets the full request, replacing any prior values.
2908        pub fn with_request<V: Into<crate::model::DeleteApplicationRequest>>(
2909            mut self,
2910            v: V,
2911        ) -> Self {
2912            self.0.request = v.into();
2913            self
2914        }
2915
2916        /// Sets all the options, replacing any prior values.
2917        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2918            self.0.options = v.into();
2919            self
2920        }
2921
2922        /// Sends the request.
2923        ///
2924        /// # Long running operations
2925        ///
2926        /// This starts, but does not poll, a longrunning operation. More information
2927        /// on [delete_application][crate::client::AppHub::delete_application].
2928        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2929            (*self.0.stub)
2930                .delete_application(self.0.request, self.0.options)
2931                .await
2932                .map(crate::Response::into_body)
2933        }
2934
2935        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_application`.
2936        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2937            type Operation =
2938                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2939            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2940            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2941            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2942            if let Some(ref mut details) = poller_options.tracing {
2943                details.method_name =
2944                    "google_cloud_apphub_v1::client::AppHub::delete_application::until_done";
2945            }
2946
2947            let stub = self.0.stub.clone();
2948            let mut options = self.0.options.clone();
2949            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2950            let query = move |name| {
2951                let stub = stub.clone();
2952                let options = options.clone();
2953                async {
2954                    let op = GetOperation::new(stub)
2955                        .set_name(name)
2956                        .with_options(options)
2957                        .send()
2958                        .await?;
2959                    Ok(Operation::new(op))
2960                }
2961            };
2962
2963            let start = move || async {
2964                let op = self.send().await?;
2965                Ok(Operation::new(op))
2966            };
2967
2968            use google_cloud_lro::internal::PollerExt;
2969            {
2970                google_cloud_lro::internal::new_unit_response_poller(
2971                    polling_error_policy,
2972                    polling_backoff_policy,
2973                    start,
2974                    query,
2975                )
2976            }
2977            .with_options(poller_options)
2978        }
2979
2980        /// Sets the value of [name][crate::model::DeleteApplicationRequest::name].
2981        ///
2982        /// This is a **required** field for requests.
2983        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2984            self.0.request.name = v.into();
2985            self
2986        }
2987
2988        /// Sets the value of [request_id][crate::model::DeleteApplicationRequest::request_id].
2989        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2990            self.0.request.request_id = v.into();
2991            self
2992        }
2993    }
2994
2995    #[doc(hidden)]
2996    impl crate::RequestBuilder for DeleteApplication {
2997        fn request_options(&mut self) -> &mut crate::RequestOptions {
2998            &mut self.0.options
2999        }
3000    }
3001
3002    /// The request builder for [AppHub::list_locations][crate::client::AppHub::list_locations] calls.
3003    ///
3004    /// # Example
3005    /// ```
3006    /// # use google_cloud_apphub_v1::builder::app_hub::ListLocations;
3007    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3008    /// use google_cloud_gax::paginator::ItemPaginator;
3009    ///
3010    /// let builder = prepare_request_builder();
3011    /// let mut items = builder.by_item();
3012    /// while let Some(result) = items.next().await {
3013    ///   let item = result?;
3014    /// }
3015    /// # Ok(()) }
3016    ///
3017    /// fn prepare_request_builder() -> ListLocations {
3018    ///   # panic!();
3019    ///   // ... details omitted ...
3020    /// }
3021    /// ```
3022    #[derive(Clone, Debug)]
3023    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3024
3025    impl ListLocations {
3026        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3027            Self(RequestBuilder::new(stub))
3028        }
3029
3030        /// Sets the full request, replacing any prior values.
3031        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3032            mut self,
3033            v: V,
3034        ) -> Self {
3035            self.0.request = v.into();
3036            self
3037        }
3038
3039        /// Sets all the options, replacing any prior values.
3040        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3041            self.0.options = v.into();
3042            self
3043        }
3044
3045        /// Sends the request.
3046        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3047            (*self.0.stub)
3048                .list_locations(self.0.request, self.0.options)
3049                .await
3050                .map(crate::Response::into_body)
3051        }
3052
3053        /// Streams each page in the collection.
3054        pub fn by_page(
3055            self,
3056        ) -> impl google_cloud_gax::paginator::Paginator<
3057            google_cloud_location::model::ListLocationsResponse,
3058            crate::Error,
3059        > {
3060            use std::clone::Clone;
3061            let token = self.0.request.page_token.clone();
3062            let execute = move |token: String| {
3063                let mut builder = self.clone();
3064                builder.0.request = builder.0.request.set_page_token(token);
3065                builder.send()
3066            };
3067            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3068        }
3069
3070        /// Streams each item in the collection.
3071        pub fn by_item(
3072            self,
3073        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3074            google_cloud_location::model::ListLocationsResponse,
3075            crate::Error,
3076        > {
3077            use google_cloud_gax::paginator::Paginator;
3078            self.by_page().items()
3079        }
3080
3081        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::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 [filter][google_cloud_location::model::ListLocationsRequest::filter].
3088        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3089            self.0.request.filter = v.into();
3090            self
3091        }
3092
3093        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
3094        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3095            self.0.request.page_size = v.into();
3096            self
3097        }
3098
3099        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
3100        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3101            self.0.request.page_token = v.into();
3102            self
3103        }
3104    }
3105
3106    #[doc(hidden)]
3107    impl crate::RequestBuilder for ListLocations {
3108        fn request_options(&mut self) -> &mut crate::RequestOptions {
3109            &mut self.0.options
3110        }
3111    }
3112
3113    /// The request builder for [AppHub::get_location][crate::client::AppHub::get_location] calls.
3114    ///
3115    /// # Example
3116    /// ```
3117    /// # use google_cloud_apphub_v1::builder::app_hub::GetLocation;
3118    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3119    ///
3120    /// let builder = prepare_request_builder();
3121    /// let response = builder.send().await?;
3122    /// # Ok(()) }
3123    ///
3124    /// fn prepare_request_builder() -> GetLocation {
3125    ///   # panic!();
3126    ///   // ... details omitted ...
3127    /// }
3128    /// ```
3129    #[derive(Clone, Debug)]
3130    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3131
3132    impl GetLocation {
3133        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3134            Self(RequestBuilder::new(stub))
3135        }
3136
3137        /// Sets the full request, replacing any prior values.
3138        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3139            mut self,
3140            v: V,
3141        ) -> Self {
3142            self.0.request = v.into();
3143            self
3144        }
3145
3146        /// Sets all the options, replacing any prior values.
3147        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3148            self.0.options = v.into();
3149            self
3150        }
3151
3152        /// Sends the request.
3153        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3154            (*self.0.stub)
3155                .get_location(self.0.request, self.0.options)
3156                .await
3157                .map(crate::Response::into_body)
3158        }
3159
3160        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
3161        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3162            self.0.request.name = v.into();
3163            self
3164        }
3165    }
3166
3167    #[doc(hidden)]
3168    impl crate::RequestBuilder for GetLocation {
3169        fn request_options(&mut self) -> &mut crate::RequestOptions {
3170            &mut self.0.options
3171        }
3172    }
3173
3174    /// The request builder for [AppHub::set_iam_policy][crate::client::AppHub::set_iam_policy] calls.
3175    ///
3176    /// # Example
3177    /// ```
3178    /// # use google_cloud_apphub_v1::builder::app_hub::SetIamPolicy;
3179    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3180    ///
3181    /// let builder = prepare_request_builder();
3182    /// let response = builder.send().await?;
3183    /// # Ok(()) }
3184    ///
3185    /// fn prepare_request_builder() -> SetIamPolicy {
3186    ///   # panic!();
3187    ///   // ... details omitted ...
3188    /// }
3189    /// ```
3190    #[derive(Clone, Debug)]
3191    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3192
3193    impl SetIamPolicy {
3194        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3195            Self(RequestBuilder::new(stub))
3196        }
3197
3198        /// Sets the full request, replacing any prior values.
3199        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3200            mut self,
3201            v: V,
3202        ) -> Self {
3203            self.0.request = v.into();
3204            self
3205        }
3206
3207        /// Sets all the options, replacing any prior values.
3208        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3209            self.0.options = v.into();
3210            self
3211        }
3212
3213        /// Sends the request.
3214        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3215            (*self.0.stub)
3216                .set_iam_policy(self.0.request, self.0.options)
3217                .await
3218                .map(crate::Response::into_body)
3219        }
3220
3221        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
3222        ///
3223        /// This is a **required** field for requests.
3224        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3225            self.0.request.resource = v.into();
3226            self
3227        }
3228
3229        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3230        ///
3231        /// This is a **required** field for requests.
3232        pub fn set_policy<T>(mut self, v: T) -> Self
3233        where
3234            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3235        {
3236            self.0.request.policy = std::option::Option::Some(v.into());
3237            self
3238        }
3239
3240        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3241        ///
3242        /// This is a **required** field for requests.
3243        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3244        where
3245            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3246        {
3247            self.0.request.policy = v.map(|x| x.into());
3248            self
3249        }
3250
3251        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3252        pub fn set_update_mask<T>(mut self, v: T) -> Self
3253        where
3254            T: std::convert::Into<wkt::FieldMask>,
3255        {
3256            self.0.request.update_mask = std::option::Option::Some(v.into());
3257            self
3258        }
3259
3260        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3261        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3262        where
3263            T: std::convert::Into<wkt::FieldMask>,
3264        {
3265            self.0.request.update_mask = v.map(|x| x.into());
3266            self
3267        }
3268    }
3269
3270    #[doc(hidden)]
3271    impl crate::RequestBuilder for SetIamPolicy {
3272        fn request_options(&mut self) -> &mut crate::RequestOptions {
3273            &mut self.0.options
3274        }
3275    }
3276
3277    /// The request builder for [AppHub::get_iam_policy][crate::client::AppHub::get_iam_policy] calls.
3278    ///
3279    /// # Example
3280    /// ```
3281    /// # use google_cloud_apphub_v1::builder::app_hub::GetIamPolicy;
3282    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3283    ///
3284    /// let builder = prepare_request_builder();
3285    /// let response = builder.send().await?;
3286    /// # Ok(()) }
3287    ///
3288    /// fn prepare_request_builder() -> GetIamPolicy {
3289    ///   # panic!();
3290    ///   // ... details omitted ...
3291    /// }
3292    /// ```
3293    #[derive(Clone, Debug)]
3294    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3295
3296    impl GetIamPolicy {
3297        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3298            Self(RequestBuilder::new(stub))
3299        }
3300
3301        /// Sets the full request, replacing any prior values.
3302        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3303            mut self,
3304            v: V,
3305        ) -> Self {
3306            self.0.request = v.into();
3307            self
3308        }
3309
3310        /// Sets all the options, replacing any prior values.
3311        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3312            self.0.options = v.into();
3313            self
3314        }
3315
3316        /// Sends the request.
3317        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3318            (*self.0.stub)
3319                .get_iam_policy(self.0.request, self.0.options)
3320                .await
3321                .map(crate::Response::into_body)
3322        }
3323
3324        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
3325        ///
3326        /// This is a **required** field for requests.
3327        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3328            self.0.request.resource = v.into();
3329            self
3330        }
3331
3332        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3333        pub fn set_options<T>(mut self, v: T) -> Self
3334        where
3335            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3336        {
3337            self.0.request.options = std::option::Option::Some(v.into());
3338            self
3339        }
3340
3341        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3342        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3343        where
3344            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3345        {
3346            self.0.request.options = v.map(|x| x.into());
3347            self
3348        }
3349    }
3350
3351    #[doc(hidden)]
3352    impl crate::RequestBuilder for GetIamPolicy {
3353        fn request_options(&mut self) -> &mut crate::RequestOptions {
3354            &mut self.0.options
3355        }
3356    }
3357
3358    /// The request builder for [AppHub::test_iam_permissions][crate::client::AppHub::test_iam_permissions] calls.
3359    ///
3360    /// # Example
3361    /// ```
3362    /// # use google_cloud_apphub_v1::builder::app_hub::TestIamPermissions;
3363    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3364    ///
3365    /// let builder = prepare_request_builder();
3366    /// let response = builder.send().await?;
3367    /// # Ok(()) }
3368    ///
3369    /// fn prepare_request_builder() -> TestIamPermissions {
3370    ///   # panic!();
3371    ///   // ... details omitted ...
3372    /// }
3373    /// ```
3374    #[derive(Clone, Debug)]
3375    pub struct TestIamPermissions(
3376        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3377    );
3378
3379    impl TestIamPermissions {
3380        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3381            Self(RequestBuilder::new(stub))
3382        }
3383
3384        /// Sets the full request, replacing any prior values.
3385        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3386            mut self,
3387            v: V,
3388        ) -> Self {
3389            self.0.request = v.into();
3390            self
3391        }
3392
3393        /// Sets all the options, replacing any prior values.
3394        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3395            self.0.options = v.into();
3396            self
3397        }
3398
3399        /// Sends the request.
3400        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3401            (*self.0.stub)
3402                .test_iam_permissions(self.0.request, self.0.options)
3403                .await
3404                .map(crate::Response::into_body)
3405        }
3406
3407        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3408        ///
3409        /// This is a **required** field for requests.
3410        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411            self.0.request.resource = v.into();
3412            self
3413        }
3414
3415        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3416        ///
3417        /// This is a **required** field for requests.
3418        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3419        where
3420            T: std::iter::IntoIterator<Item = V>,
3421            V: std::convert::Into<std::string::String>,
3422        {
3423            use std::iter::Iterator;
3424            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3425            self
3426        }
3427    }
3428
3429    #[doc(hidden)]
3430    impl crate::RequestBuilder for TestIamPermissions {
3431        fn request_options(&mut self) -> &mut crate::RequestOptions {
3432            &mut self.0.options
3433        }
3434    }
3435
3436    /// The request builder for [AppHub::list_operations][crate::client::AppHub::list_operations] calls.
3437    ///
3438    /// # Example
3439    /// ```
3440    /// # use google_cloud_apphub_v1::builder::app_hub::ListOperations;
3441    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3442    /// use google_cloud_gax::paginator::ItemPaginator;
3443    ///
3444    /// let builder = prepare_request_builder();
3445    /// let mut items = builder.by_item();
3446    /// while let Some(result) = items.next().await {
3447    ///   let item = result?;
3448    /// }
3449    /// # Ok(()) }
3450    ///
3451    /// fn prepare_request_builder() -> ListOperations {
3452    ///   # panic!();
3453    ///   // ... details omitted ...
3454    /// }
3455    /// ```
3456    #[derive(Clone, Debug)]
3457    pub struct ListOperations(
3458        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3459    );
3460
3461    impl ListOperations {
3462        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3463            Self(RequestBuilder::new(stub))
3464        }
3465
3466        /// Sets the full request, replacing any prior values.
3467        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3468            mut self,
3469            v: V,
3470        ) -> Self {
3471            self.0.request = v.into();
3472            self
3473        }
3474
3475        /// Sets all the options, replacing any prior values.
3476        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3477            self.0.options = v.into();
3478            self
3479        }
3480
3481        /// Sends the request.
3482        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3483            (*self.0.stub)
3484                .list_operations(self.0.request, self.0.options)
3485                .await
3486                .map(crate::Response::into_body)
3487        }
3488
3489        /// Streams each page in the collection.
3490        pub fn by_page(
3491            self,
3492        ) -> impl google_cloud_gax::paginator::Paginator<
3493            google_cloud_longrunning::model::ListOperationsResponse,
3494            crate::Error,
3495        > {
3496            use std::clone::Clone;
3497            let token = self.0.request.page_token.clone();
3498            let execute = move |token: String| {
3499                let mut builder = self.clone();
3500                builder.0.request = builder.0.request.set_page_token(token);
3501                builder.send()
3502            };
3503            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3504        }
3505
3506        /// Streams each item in the collection.
3507        pub fn by_item(
3508            self,
3509        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3510            google_cloud_longrunning::model::ListOperationsResponse,
3511            crate::Error,
3512        > {
3513            use google_cloud_gax::paginator::Paginator;
3514            self.by_page().items()
3515        }
3516
3517        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3518        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3519            self.0.request.name = v.into();
3520            self
3521        }
3522
3523        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3524        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3525            self.0.request.filter = v.into();
3526            self
3527        }
3528
3529        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3530        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3531            self.0.request.page_size = v.into();
3532            self
3533        }
3534
3535        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3536        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3537            self.0.request.page_token = v.into();
3538            self
3539        }
3540
3541        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3542        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3543            self.0.request.return_partial_success = v.into();
3544            self
3545        }
3546    }
3547
3548    #[doc(hidden)]
3549    impl crate::RequestBuilder for ListOperations {
3550        fn request_options(&mut self) -> &mut crate::RequestOptions {
3551            &mut self.0.options
3552        }
3553    }
3554
3555    /// The request builder for [AppHub::get_operation][crate::client::AppHub::get_operation] calls.
3556    ///
3557    /// # Example
3558    /// ```
3559    /// # use google_cloud_apphub_v1::builder::app_hub::GetOperation;
3560    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3561    ///
3562    /// let builder = prepare_request_builder();
3563    /// let response = builder.send().await?;
3564    /// # Ok(()) }
3565    ///
3566    /// fn prepare_request_builder() -> GetOperation {
3567    ///   # panic!();
3568    ///   // ... details omitted ...
3569    /// }
3570    /// ```
3571    #[derive(Clone, Debug)]
3572    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3573
3574    impl GetOperation {
3575        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3576            Self(RequestBuilder::new(stub))
3577        }
3578
3579        /// Sets the full request, replacing any prior values.
3580        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3581            mut self,
3582            v: V,
3583        ) -> Self {
3584            self.0.request = v.into();
3585            self
3586        }
3587
3588        /// Sets all the options, replacing any prior values.
3589        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3590            self.0.options = v.into();
3591            self
3592        }
3593
3594        /// Sends the request.
3595        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3596            (*self.0.stub)
3597                .get_operation(self.0.request, self.0.options)
3598                .await
3599                .map(crate::Response::into_body)
3600        }
3601
3602        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3603        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3604            self.0.request.name = v.into();
3605            self
3606        }
3607    }
3608
3609    #[doc(hidden)]
3610    impl crate::RequestBuilder for GetOperation {
3611        fn request_options(&mut self) -> &mut crate::RequestOptions {
3612            &mut self.0.options
3613        }
3614    }
3615
3616    /// The request builder for [AppHub::delete_operation][crate::client::AppHub::delete_operation] calls.
3617    ///
3618    /// # Example
3619    /// ```
3620    /// # use google_cloud_apphub_v1::builder::app_hub::DeleteOperation;
3621    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3622    ///
3623    /// let builder = prepare_request_builder();
3624    /// let response = builder.send().await?;
3625    /// # Ok(()) }
3626    ///
3627    /// fn prepare_request_builder() -> DeleteOperation {
3628    ///   # panic!();
3629    ///   // ... details omitted ...
3630    /// }
3631    /// ```
3632    #[derive(Clone, Debug)]
3633    pub struct DeleteOperation(
3634        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3635    );
3636
3637    impl DeleteOperation {
3638        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3639            Self(RequestBuilder::new(stub))
3640        }
3641
3642        /// Sets the full request, replacing any prior values.
3643        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3644            mut self,
3645            v: V,
3646        ) -> Self {
3647            self.0.request = v.into();
3648            self
3649        }
3650
3651        /// Sets all the options, replacing any prior values.
3652        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3653            self.0.options = v.into();
3654            self
3655        }
3656
3657        /// Sends the request.
3658        pub async fn send(self) -> Result<()> {
3659            (*self.0.stub)
3660                .delete_operation(self.0.request, self.0.options)
3661                .await
3662                .map(crate::Response::into_body)
3663        }
3664
3665        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3666        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3667            self.0.request.name = v.into();
3668            self
3669        }
3670    }
3671
3672    #[doc(hidden)]
3673    impl crate::RequestBuilder for DeleteOperation {
3674        fn request_options(&mut self) -> &mut crate::RequestOptions {
3675            &mut self.0.options
3676        }
3677    }
3678
3679    /// The request builder for [AppHub::cancel_operation][crate::client::AppHub::cancel_operation] calls.
3680    ///
3681    /// # Example
3682    /// ```
3683    /// # use google_cloud_apphub_v1::builder::app_hub::CancelOperation;
3684    /// # async fn sample() -> google_cloud_apphub_v1::Result<()> {
3685    ///
3686    /// let builder = prepare_request_builder();
3687    /// let response = builder.send().await?;
3688    /// # Ok(()) }
3689    ///
3690    /// fn prepare_request_builder() -> CancelOperation {
3691    ///   # panic!();
3692    ///   // ... details omitted ...
3693    /// }
3694    /// ```
3695    #[derive(Clone, Debug)]
3696    pub struct CancelOperation(
3697        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3698    );
3699
3700    impl CancelOperation {
3701        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3702            Self(RequestBuilder::new(stub))
3703        }
3704
3705        /// Sets the full request, replacing any prior values.
3706        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3707            mut self,
3708            v: V,
3709        ) -> Self {
3710            self.0.request = v.into();
3711            self
3712        }
3713
3714        /// Sets all the options, replacing any prior values.
3715        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3716            self.0.options = v.into();
3717            self
3718        }
3719
3720        /// Sends the request.
3721        pub async fn send(self) -> Result<()> {
3722            (*self.0.stub)
3723                .cancel_operation(self.0.request, self.0.options)
3724                .await
3725                .map(crate::Response::into_body)
3726        }
3727
3728        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3729        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3730            self.0.request.name = v.into();
3731            self
3732        }
3733    }
3734
3735    #[doc(hidden)]
3736    impl crate::RequestBuilder for CancelOperation {
3737        fn request_options(&mut self) -> &mut crate::RequestOptions {
3738            &mut self.0.options
3739        }
3740    }
3741}