google_cloud_apihub_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod api_hub {
18    use crate::Result;
19
20    /// A builder for [ApiHub][crate::client::ApiHub].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_apihub_v1::*;
25    /// # use builder::api_hub::ClientBuilder;
26    /// # use client::ApiHub;
27    /// let builder : ClientBuilder = ApiHub::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://apihub.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::ApiHub;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = ApiHub;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::ApiHub] 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::ApiHub>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
64            Self {
65                stub,
66                request: R::default(),
67                options: gax::options::RequestOptions::default(),
68            }
69        }
70    }
71
72    /// The request builder for [ApiHub::create_api][crate::client::ApiHub::create_api] calls.
73    ///
74    /// # Example
75    /// ```no_run
76    /// # use google_cloud_apihub_v1::builder;
77    /// use builder::api_hub::CreateApi;
78    /// # tokio_test::block_on(async {
79    ///
80    /// let builder = prepare_request_builder();
81    /// let response = builder.send().await?;
82    /// # gax::Result::<()>::Ok(()) });
83    ///
84    /// fn prepare_request_builder() -> CreateApi {
85    ///   # panic!();
86    ///   // ... details omitted ...
87    /// }
88    /// ```
89    #[derive(Clone, Debug)]
90    pub struct CreateApi(RequestBuilder<crate::model::CreateApiRequest>);
91
92    impl CreateApi {
93        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
94            Self(RequestBuilder::new(stub))
95        }
96
97        /// Sets the full request, replacing any prior values.
98        pub fn with_request<V: Into<crate::model::CreateApiRequest>>(mut self, v: V) -> Self {
99            self.0.request = v.into();
100            self
101        }
102
103        /// Sets all the options, replacing any prior values.
104        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
105            self.0.options = v.into();
106            self
107        }
108
109        /// Sends the request.
110        pub async fn send(self) -> Result<crate::model::Api> {
111            (*self.0.stub)
112                .create_api(self.0.request, self.0.options)
113                .await
114                .map(gax::response::Response::into_body)
115        }
116
117        /// Sets the value of [parent][crate::model::CreateApiRequest::parent].
118        ///
119        /// This is a **required** field for requests.
120        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
121            self.0.request.parent = v.into();
122            self
123        }
124
125        /// Sets the value of [api_id][crate::model::CreateApiRequest::api_id].
126        pub fn set_api_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
127            self.0.request.api_id = v.into();
128            self
129        }
130
131        /// Sets the value of [api][crate::model::CreateApiRequest::api].
132        ///
133        /// This is a **required** field for requests.
134        pub fn set_api<T>(mut self, v: T) -> Self
135        where
136            T: std::convert::Into<crate::model::Api>,
137        {
138            self.0.request.api = std::option::Option::Some(v.into());
139            self
140        }
141
142        /// Sets or clears the value of [api][crate::model::CreateApiRequest::api].
143        ///
144        /// This is a **required** field for requests.
145        pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
146        where
147            T: std::convert::Into<crate::model::Api>,
148        {
149            self.0.request.api = v.map(|x| x.into());
150            self
151        }
152    }
153
154    #[doc(hidden)]
155    impl gax::options::internal::RequestBuilder for CreateApi {
156        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
157            &mut self.0.options
158        }
159    }
160
161    /// The request builder for [ApiHub::get_api][crate::client::ApiHub::get_api] calls.
162    ///
163    /// # Example
164    /// ```no_run
165    /// # use google_cloud_apihub_v1::builder;
166    /// use builder::api_hub::GetApi;
167    /// # tokio_test::block_on(async {
168    ///
169    /// let builder = prepare_request_builder();
170    /// let response = builder.send().await?;
171    /// # gax::Result::<()>::Ok(()) });
172    ///
173    /// fn prepare_request_builder() -> GetApi {
174    ///   # panic!();
175    ///   // ... details omitted ...
176    /// }
177    /// ```
178    #[derive(Clone, Debug)]
179    pub struct GetApi(RequestBuilder<crate::model::GetApiRequest>);
180
181    impl GetApi {
182        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
183            Self(RequestBuilder::new(stub))
184        }
185
186        /// Sets the full request, replacing any prior values.
187        pub fn with_request<V: Into<crate::model::GetApiRequest>>(mut self, v: V) -> Self {
188            self.0.request = v.into();
189            self
190        }
191
192        /// Sets all the options, replacing any prior values.
193        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
194            self.0.options = v.into();
195            self
196        }
197
198        /// Sends the request.
199        pub async fn send(self) -> Result<crate::model::Api> {
200            (*self.0.stub)
201                .get_api(self.0.request, self.0.options)
202                .await
203                .map(gax::response::Response::into_body)
204        }
205
206        /// Sets the value of [name][crate::model::GetApiRequest::name].
207        ///
208        /// This is a **required** field for requests.
209        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
210            self.0.request.name = v.into();
211            self
212        }
213    }
214
215    #[doc(hidden)]
216    impl gax::options::internal::RequestBuilder for GetApi {
217        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
218            &mut self.0.options
219        }
220    }
221
222    /// The request builder for [ApiHub::list_apis][crate::client::ApiHub::list_apis] calls.
223    ///
224    /// # Example
225    /// ```no_run
226    /// # use google_cloud_apihub_v1::builder;
227    /// use builder::api_hub::ListApis;
228    /// # tokio_test::block_on(async {
229    /// use gax::paginator::ItemPaginator;
230    ///
231    /// let builder = prepare_request_builder();
232    /// let mut items = builder.by_item();
233    /// while let Some(result) = items.next().await {
234    ///   let item = result?;
235    /// }
236    /// # gax::Result::<()>::Ok(()) });
237    ///
238    /// fn prepare_request_builder() -> ListApis {
239    ///   # panic!();
240    ///   // ... details omitted ...
241    /// }
242    /// ```
243    #[derive(Clone, Debug)]
244    pub struct ListApis(RequestBuilder<crate::model::ListApisRequest>);
245
246    impl ListApis {
247        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
248            Self(RequestBuilder::new(stub))
249        }
250
251        /// Sets the full request, replacing any prior values.
252        pub fn with_request<V: Into<crate::model::ListApisRequest>>(mut self, v: V) -> Self {
253            self.0.request = v.into();
254            self
255        }
256
257        /// Sets all the options, replacing any prior values.
258        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
259            self.0.options = v.into();
260            self
261        }
262
263        /// Sends the request.
264        pub async fn send(self) -> Result<crate::model::ListApisResponse> {
265            (*self.0.stub)
266                .list_apis(self.0.request, self.0.options)
267                .await
268                .map(gax::response::Response::into_body)
269        }
270
271        /// Streams each page in the collection.
272        pub fn by_page(
273            self,
274        ) -> impl gax::paginator::Paginator<crate::model::ListApisResponse, gax::error::Error>
275        {
276            use std::clone::Clone;
277            let token = self.0.request.page_token.clone();
278            let execute = move |token: String| {
279                let mut builder = self.clone();
280                builder.0.request = builder.0.request.set_page_token(token);
281                builder.send()
282            };
283            gax::paginator::internal::new_paginator(token, execute)
284        }
285
286        /// Streams each item in the collection.
287        pub fn by_item(
288            self,
289        ) -> impl gax::paginator::ItemPaginator<crate::model::ListApisResponse, gax::error::Error>
290        {
291            use gax::paginator::Paginator;
292            self.by_page().items()
293        }
294
295        /// Sets the value of [parent][crate::model::ListApisRequest::parent].
296        ///
297        /// This is a **required** field for requests.
298        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
299            self.0.request.parent = v.into();
300            self
301        }
302
303        /// Sets the value of [filter][crate::model::ListApisRequest::filter].
304        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
305            self.0.request.filter = v.into();
306            self
307        }
308
309        /// Sets the value of [page_size][crate::model::ListApisRequest::page_size].
310        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
311            self.0.request.page_size = v.into();
312            self
313        }
314
315        /// Sets the value of [page_token][crate::model::ListApisRequest::page_token].
316        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
317            self.0.request.page_token = v.into();
318            self
319        }
320    }
321
322    #[doc(hidden)]
323    impl gax::options::internal::RequestBuilder for ListApis {
324        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
325            &mut self.0.options
326        }
327    }
328
329    /// The request builder for [ApiHub::update_api][crate::client::ApiHub::update_api] calls.
330    ///
331    /// # Example
332    /// ```no_run
333    /// # use google_cloud_apihub_v1::builder;
334    /// use builder::api_hub::UpdateApi;
335    /// # tokio_test::block_on(async {
336    ///
337    /// let builder = prepare_request_builder();
338    /// let response = builder.send().await?;
339    /// # gax::Result::<()>::Ok(()) });
340    ///
341    /// fn prepare_request_builder() -> UpdateApi {
342    ///   # panic!();
343    ///   // ... details omitted ...
344    /// }
345    /// ```
346    #[derive(Clone, Debug)]
347    pub struct UpdateApi(RequestBuilder<crate::model::UpdateApiRequest>);
348
349    impl UpdateApi {
350        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
351            Self(RequestBuilder::new(stub))
352        }
353
354        /// Sets the full request, replacing any prior values.
355        pub fn with_request<V: Into<crate::model::UpdateApiRequest>>(mut self, v: V) -> Self {
356            self.0.request = v.into();
357            self
358        }
359
360        /// Sets all the options, replacing any prior values.
361        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
362            self.0.options = v.into();
363            self
364        }
365
366        /// Sends the request.
367        pub async fn send(self) -> Result<crate::model::Api> {
368            (*self.0.stub)
369                .update_api(self.0.request, self.0.options)
370                .await
371                .map(gax::response::Response::into_body)
372        }
373
374        /// Sets the value of [api][crate::model::UpdateApiRequest::api].
375        ///
376        /// This is a **required** field for requests.
377        pub fn set_api<T>(mut self, v: T) -> Self
378        where
379            T: std::convert::Into<crate::model::Api>,
380        {
381            self.0.request.api = std::option::Option::Some(v.into());
382            self
383        }
384
385        /// Sets or clears the value of [api][crate::model::UpdateApiRequest::api].
386        ///
387        /// This is a **required** field for requests.
388        pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
389        where
390            T: std::convert::Into<crate::model::Api>,
391        {
392            self.0.request.api = v.map(|x| x.into());
393            self
394        }
395
396        /// Sets the value of [update_mask][crate::model::UpdateApiRequest::update_mask].
397        ///
398        /// This is a **required** field for requests.
399        pub fn set_update_mask<T>(mut self, v: T) -> Self
400        where
401            T: std::convert::Into<wkt::FieldMask>,
402        {
403            self.0.request.update_mask = std::option::Option::Some(v.into());
404            self
405        }
406
407        /// Sets or clears the value of [update_mask][crate::model::UpdateApiRequest::update_mask].
408        ///
409        /// This is a **required** field for requests.
410        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
411        where
412            T: std::convert::Into<wkt::FieldMask>,
413        {
414            self.0.request.update_mask = v.map(|x| x.into());
415            self
416        }
417    }
418
419    #[doc(hidden)]
420    impl gax::options::internal::RequestBuilder for UpdateApi {
421        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
422            &mut self.0.options
423        }
424    }
425
426    /// The request builder for [ApiHub::delete_api][crate::client::ApiHub::delete_api] calls.
427    ///
428    /// # Example
429    /// ```no_run
430    /// # use google_cloud_apihub_v1::builder;
431    /// use builder::api_hub::DeleteApi;
432    /// # tokio_test::block_on(async {
433    ///
434    /// let builder = prepare_request_builder();
435    /// let response = builder.send().await?;
436    /// # gax::Result::<()>::Ok(()) });
437    ///
438    /// fn prepare_request_builder() -> DeleteApi {
439    ///   # panic!();
440    ///   // ... details omitted ...
441    /// }
442    /// ```
443    #[derive(Clone, Debug)]
444    pub struct DeleteApi(RequestBuilder<crate::model::DeleteApiRequest>);
445
446    impl DeleteApi {
447        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
448            Self(RequestBuilder::new(stub))
449        }
450
451        /// Sets the full request, replacing any prior values.
452        pub fn with_request<V: Into<crate::model::DeleteApiRequest>>(mut self, v: V) -> 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<gax::options::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<()> {
465            (*self.0.stub)
466                .delete_api(self.0.request, self.0.options)
467                .await
468                .map(gax::response::Response::into_body)
469        }
470
471        /// Sets the value of [name][crate::model::DeleteApiRequest::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        /// Sets the value of [force][crate::model::DeleteApiRequest::force].
480        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
481            self.0.request.force = v.into();
482            self
483        }
484    }
485
486    #[doc(hidden)]
487    impl gax::options::internal::RequestBuilder for DeleteApi {
488        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
489            &mut self.0.options
490        }
491    }
492
493    /// The request builder for [ApiHub::create_version][crate::client::ApiHub::create_version] calls.
494    ///
495    /// # Example
496    /// ```no_run
497    /// # use google_cloud_apihub_v1::builder;
498    /// use builder::api_hub::CreateVersion;
499    /// # tokio_test::block_on(async {
500    ///
501    /// let builder = prepare_request_builder();
502    /// let response = builder.send().await?;
503    /// # gax::Result::<()>::Ok(()) });
504    ///
505    /// fn prepare_request_builder() -> CreateVersion {
506    ///   # panic!();
507    ///   // ... details omitted ...
508    /// }
509    /// ```
510    #[derive(Clone, Debug)]
511    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
512
513    impl CreateVersion {
514        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
515            Self(RequestBuilder::new(stub))
516        }
517
518        /// Sets the full request, replacing any prior values.
519        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
520            self.0.request = v.into();
521            self
522        }
523
524        /// Sets all the options, replacing any prior values.
525        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
526            self.0.options = v.into();
527            self
528        }
529
530        /// Sends the request.
531        pub async fn send(self) -> Result<crate::model::Version> {
532            (*self.0.stub)
533                .create_version(self.0.request, self.0.options)
534                .await
535                .map(gax::response::Response::into_body)
536        }
537
538        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
539        ///
540        /// This is a **required** field for requests.
541        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
542            self.0.request.parent = v.into();
543            self
544        }
545
546        /// Sets the value of [version_id][crate::model::CreateVersionRequest::version_id].
547        pub fn set_version_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
548            self.0.request.version_id = v.into();
549            self
550        }
551
552        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
553        ///
554        /// This is a **required** field for requests.
555        pub fn set_version<T>(mut self, v: T) -> Self
556        where
557            T: std::convert::Into<crate::model::Version>,
558        {
559            self.0.request.version = std::option::Option::Some(v.into());
560            self
561        }
562
563        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
564        ///
565        /// This is a **required** field for requests.
566        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
567        where
568            T: std::convert::Into<crate::model::Version>,
569        {
570            self.0.request.version = v.map(|x| x.into());
571            self
572        }
573    }
574
575    #[doc(hidden)]
576    impl gax::options::internal::RequestBuilder for CreateVersion {
577        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
578            &mut self.0.options
579        }
580    }
581
582    /// The request builder for [ApiHub::get_version][crate::client::ApiHub::get_version] calls.
583    ///
584    /// # Example
585    /// ```no_run
586    /// # use google_cloud_apihub_v1::builder;
587    /// use builder::api_hub::GetVersion;
588    /// # tokio_test::block_on(async {
589    ///
590    /// let builder = prepare_request_builder();
591    /// let response = builder.send().await?;
592    /// # gax::Result::<()>::Ok(()) });
593    ///
594    /// fn prepare_request_builder() -> GetVersion {
595    ///   # panic!();
596    ///   // ... details omitted ...
597    /// }
598    /// ```
599    #[derive(Clone, Debug)]
600    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
601
602    impl GetVersion {
603        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
604            Self(RequestBuilder::new(stub))
605        }
606
607        /// Sets the full request, replacing any prior values.
608        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
609            self.0.request = v.into();
610            self
611        }
612
613        /// Sets all the options, replacing any prior values.
614        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
615            self.0.options = v.into();
616            self
617        }
618
619        /// Sends the request.
620        pub async fn send(self) -> Result<crate::model::Version> {
621            (*self.0.stub)
622                .get_version(self.0.request, self.0.options)
623                .await
624                .map(gax::response::Response::into_body)
625        }
626
627        /// Sets the value of [name][crate::model::GetVersionRequest::name].
628        ///
629        /// This is a **required** field for requests.
630        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
631            self.0.request.name = v.into();
632            self
633        }
634    }
635
636    #[doc(hidden)]
637    impl gax::options::internal::RequestBuilder for GetVersion {
638        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
639            &mut self.0.options
640        }
641    }
642
643    /// The request builder for [ApiHub::list_versions][crate::client::ApiHub::list_versions] calls.
644    ///
645    /// # Example
646    /// ```no_run
647    /// # use google_cloud_apihub_v1::builder;
648    /// use builder::api_hub::ListVersions;
649    /// # tokio_test::block_on(async {
650    /// use gax::paginator::ItemPaginator;
651    ///
652    /// let builder = prepare_request_builder();
653    /// let mut items = builder.by_item();
654    /// while let Some(result) = items.next().await {
655    ///   let item = result?;
656    /// }
657    /// # gax::Result::<()>::Ok(()) });
658    ///
659    /// fn prepare_request_builder() -> ListVersions {
660    ///   # panic!();
661    ///   // ... details omitted ...
662    /// }
663    /// ```
664    #[derive(Clone, Debug)]
665    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
666
667    impl ListVersions {
668        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
669            Self(RequestBuilder::new(stub))
670        }
671
672        /// Sets the full request, replacing any prior values.
673        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
674            self.0.request = v.into();
675            self
676        }
677
678        /// Sets all the options, replacing any prior values.
679        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
680            self.0.options = v.into();
681            self
682        }
683
684        /// Sends the request.
685        pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
686            (*self.0.stub)
687                .list_versions(self.0.request, self.0.options)
688                .await
689                .map(gax::response::Response::into_body)
690        }
691
692        /// Streams each page in the collection.
693        pub fn by_page(
694            self,
695        ) -> impl gax::paginator::Paginator<crate::model::ListVersionsResponse, gax::error::Error>
696        {
697            use std::clone::Clone;
698            let token = self.0.request.page_token.clone();
699            let execute = move |token: String| {
700                let mut builder = self.clone();
701                builder.0.request = builder.0.request.set_page_token(token);
702                builder.send()
703            };
704            gax::paginator::internal::new_paginator(token, execute)
705        }
706
707        /// Streams each item in the collection.
708        pub fn by_item(
709            self,
710        ) -> impl gax::paginator::ItemPaginator<crate::model::ListVersionsResponse, gax::error::Error>
711        {
712            use gax::paginator::Paginator;
713            self.by_page().items()
714        }
715
716        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
717        ///
718        /// This is a **required** field for requests.
719        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
720            self.0.request.parent = v.into();
721            self
722        }
723
724        /// Sets the value of [filter][crate::model::ListVersionsRequest::filter].
725        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
726            self.0.request.filter = v.into();
727            self
728        }
729
730        /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
731        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
732            self.0.request.page_size = v.into();
733            self
734        }
735
736        /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
737        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
738            self.0.request.page_token = v.into();
739            self
740        }
741    }
742
743    #[doc(hidden)]
744    impl gax::options::internal::RequestBuilder for ListVersions {
745        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
746            &mut self.0.options
747        }
748    }
749
750    /// The request builder for [ApiHub::update_version][crate::client::ApiHub::update_version] calls.
751    ///
752    /// # Example
753    /// ```no_run
754    /// # use google_cloud_apihub_v1::builder;
755    /// use builder::api_hub::UpdateVersion;
756    /// # tokio_test::block_on(async {
757    ///
758    /// let builder = prepare_request_builder();
759    /// let response = builder.send().await?;
760    /// # gax::Result::<()>::Ok(()) });
761    ///
762    /// fn prepare_request_builder() -> UpdateVersion {
763    ///   # panic!();
764    ///   // ... details omitted ...
765    /// }
766    /// ```
767    #[derive(Clone, Debug)]
768    pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
769
770    impl UpdateVersion {
771        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
772            Self(RequestBuilder::new(stub))
773        }
774
775        /// Sets the full request, replacing any prior values.
776        pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
777            self.0.request = v.into();
778            self
779        }
780
781        /// Sets all the options, replacing any prior values.
782        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
783            self.0.options = v.into();
784            self
785        }
786
787        /// Sends the request.
788        pub async fn send(self) -> Result<crate::model::Version> {
789            (*self.0.stub)
790                .update_version(self.0.request, self.0.options)
791                .await
792                .map(gax::response::Response::into_body)
793        }
794
795        /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
796        ///
797        /// This is a **required** field for requests.
798        pub fn set_version<T>(mut self, v: T) -> Self
799        where
800            T: std::convert::Into<crate::model::Version>,
801        {
802            self.0.request.version = std::option::Option::Some(v.into());
803            self
804        }
805
806        /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
807        ///
808        /// This is a **required** field for requests.
809        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
810        where
811            T: std::convert::Into<crate::model::Version>,
812        {
813            self.0.request.version = v.map(|x| x.into());
814            self
815        }
816
817        /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
818        ///
819        /// This is a **required** field for requests.
820        pub fn set_update_mask<T>(mut self, v: T) -> Self
821        where
822            T: std::convert::Into<wkt::FieldMask>,
823        {
824            self.0.request.update_mask = std::option::Option::Some(v.into());
825            self
826        }
827
828        /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
829        ///
830        /// This is a **required** field for requests.
831        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
832        where
833            T: std::convert::Into<wkt::FieldMask>,
834        {
835            self.0.request.update_mask = v.map(|x| x.into());
836            self
837        }
838    }
839
840    #[doc(hidden)]
841    impl gax::options::internal::RequestBuilder for UpdateVersion {
842        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
843            &mut self.0.options
844        }
845    }
846
847    /// The request builder for [ApiHub::delete_version][crate::client::ApiHub::delete_version] calls.
848    ///
849    /// # Example
850    /// ```no_run
851    /// # use google_cloud_apihub_v1::builder;
852    /// use builder::api_hub::DeleteVersion;
853    /// # tokio_test::block_on(async {
854    ///
855    /// let builder = prepare_request_builder();
856    /// let response = builder.send().await?;
857    /// # gax::Result::<()>::Ok(()) });
858    ///
859    /// fn prepare_request_builder() -> DeleteVersion {
860    ///   # panic!();
861    ///   // ... details omitted ...
862    /// }
863    /// ```
864    #[derive(Clone, Debug)]
865    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
866
867    impl DeleteVersion {
868        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
869            Self(RequestBuilder::new(stub))
870        }
871
872        /// Sets the full request, replacing any prior values.
873        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
874            self.0.request = v.into();
875            self
876        }
877
878        /// Sets all the options, replacing any prior values.
879        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
880            self.0.options = v.into();
881            self
882        }
883
884        /// Sends the request.
885        pub async fn send(self) -> Result<()> {
886            (*self.0.stub)
887                .delete_version(self.0.request, self.0.options)
888                .await
889                .map(gax::response::Response::into_body)
890        }
891
892        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
893        ///
894        /// This is a **required** field for requests.
895        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
896            self.0.request.name = v.into();
897            self
898        }
899
900        /// Sets the value of [force][crate::model::DeleteVersionRequest::force].
901        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
902            self.0.request.force = v.into();
903            self
904        }
905    }
906
907    #[doc(hidden)]
908    impl gax::options::internal::RequestBuilder for DeleteVersion {
909        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
910            &mut self.0.options
911        }
912    }
913
914    /// The request builder for [ApiHub::create_spec][crate::client::ApiHub::create_spec] calls.
915    ///
916    /// # Example
917    /// ```no_run
918    /// # use google_cloud_apihub_v1::builder;
919    /// use builder::api_hub::CreateSpec;
920    /// # tokio_test::block_on(async {
921    ///
922    /// let builder = prepare_request_builder();
923    /// let response = builder.send().await?;
924    /// # gax::Result::<()>::Ok(()) });
925    ///
926    /// fn prepare_request_builder() -> CreateSpec {
927    ///   # panic!();
928    ///   // ... details omitted ...
929    /// }
930    /// ```
931    #[derive(Clone, Debug)]
932    pub struct CreateSpec(RequestBuilder<crate::model::CreateSpecRequest>);
933
934    impl CreateSpec {
935        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
936            Self(RequestBuilder::new(stub))
937        }
938
939        /// Sets the full request, replacing any prior values.
940        pub fn with_request<V: Into<crate::model::CreateSpecRequest>>(mut self, v: V) -> Self {
941            self.0.request = v.into();
942            self
943        }
944
945        /// Sets all the options, replacing any prior values.
946        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
947            self.0.options = v.into();
948            self
949        }
950
951        /// Sends the request.
952        pub async fn send(self) -> Result<crate::model::Spec> {
953            (*self.0.stub)
954                .create_spec(self.0.request, self.0.options)
955                .await
956                .map(gax::response::Response::into_body)
957        }
958
959        /// Sets the value of [parent][crate::model::CreateSpecRequest::parent].
960        ///
961        /// This is a **required** field for requests.
962        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
963            self.0.request.parent = v.into();
964            self
965        }
966
967        /// Sets the value of [spec_id][crate::model::CreateSpecRequest::spec_id].
968        pub fn set_spec_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
969            self.0.request.spec_id = v.into();
970            self
971        }
972
973        /// Sets the value of [spec][crate::model::CreateSpecRequest::spec].
974        ///
975        /// This is a **required** field for requests.
976        pub fn set_spec<T>(mut self, v: T) -> Self
977        where
978            T: std::convert::Into<crate::model::Spec>,
979        {
980            self.0.request.spec = std::option::Option::Some(v.into());
981            self
982        }
983
984        /// Sets or clears the value of [spec][crate::model::CreateSpecRequest::spec].
985        ///
986        /// This is a **required** field for requests.
987        pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
988        where
989            T: std::convert::Into<crate::model::Spec>,
990        {
991            self.0.request.spec = v.map(|x| x.into());
992            self
993        }
994    }
995
996    #[doc(hidden)]
997    impl gax::options::internal::RequestBuilder for CreateSpec {
998        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
999            &mut self.0.options
1000        }
1001    }
1002
1003    /// The request builder for [ApiHub::get_spec][crate::client::ApiHub::get_spec] calls.
1004    ///
1005    /// # Example
1006    /// ```no_run
1007    /// # use google_cloud_apihub_v1::builder;
1008    /// use builder::api_hub::GetSpec;
1009    /// # tokio_test::block_on(async {
1010    ///
1011    /// let builder = prepare_request_builder();
1012    /// let response = builder.send().await?;
1013    /// # gax::Result::<()>::Ok(()) });
1014    ///
1015    /// fn prepare_request_builder() -> GetSpec {
1016    ///   # panic!();
1017    ///   // ... details omitted ...
1018    /// }
1019    /// ```
1020    #[derive(Clone, Debug)]
1021    pub struct GetSpec(RequestBuilder<crate::model::GetSpecRequest>);
1022
1023    impl GetSpec {
1024        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1025            Self(RequestBuilder::new(stub))
1026        }
1027
1028        /// Sets the full request, replacing any prior values.
1029        pub fn with_request<V: Into<crate::model::GetSpecRequest>>(mut self, v: V) -> Self {
1030            self.0.request = v.into();
1031            self
1032        }
1033
1034        /// Sets all the options, replacing any prior values.
1035        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1036            self.0.options = v.into();
1037            self
1038        }
1039
1040        /// Sends the request.
1041        pub async fn send(self) -> Result<crate::model::Spec> {
1042            (*self.0.stub)
1043                .get_spec(self.0.request, self.0.options)
1044                .await
1045                .map(gax::response::Response::into_body)
1046        }
1047
1048        /// Sets the value of [name][crate::model::GetSpecRequest::name].
1049        ///
1050        /// This is a **required** field for requests.
1051        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052            self.0.request.name = v.into();
1053            self
1054        }
1055    }
1056
1057    #[doc(hidden)]
1058    impl gax::options::internal::RequestBuilder for GetSpec {
1059        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1060            &mut self.0.options
1061        }
1062    }
1063
1064    /// The request builder for [ApiHub::get_spec_contents][crate::client::ApiHub::get_spec_contents] calls.
1065    ///
1066    /// # Example
1067    /// ```no_run
1068    /// # use google_cloud_apihub_v1::builder;
1069    /// use builder::api_hub::GetSpecContents;
1070    /// # tokio_test::block_on(async {
1071    ///
1072    /// let builder = prepare_request_builder();
1073    /// let response = builder.send().await?;
1074    /// # gax::Result::<()>::Ok(()) });
1075    ///
1076    /// fn prepare_request_builder() -> GetSpecContents {
1077    ///   # panic!();
1078    ///   // ... details omitted ...
1079    /// }
1080    /// ```
1081    #[derive(Clone, Debug)]
1082    pub struct GetSpecContents(RequestBuilder<crate::model::GetSpecContentsRequest>);
1083
1084    impl GetSpecContents {
1085        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1086            Self(RequestBuilder::new(stub))
1087        }
1088
1089        /// Sets the full request, replacing any prior values.
1090        pub fn with_request<V: Into<crate::model::GetSpecContentsRequest>>(mut self, v: V) -> Self {
1091            self.0.request = v.into();
1092            self
1093        }
1094
1095        /// Sets all the options, replacing any prior values.
1096        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1097            self.0.options = v.into();
1098            self
1099        }
1100
1101        /// Sends the request.
1102        pub async fn send(self) -> Result<crate::model::SpecContents> {
1103            (*self.0.stub)
1104                .get_spec_contents(self.0.request, self.0.options)
1105                .await
1106                .map(gax::response::Response::into_body)
1107        }
1108
1109        /// Sets the value of [name][crate::model::GetSpecContentsRequest::name].
1110        ///
1111        /// This is a **required** field for requests.
1112        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1113            self.0.request.name = v.into();
1114            self
1115        }
1116    }
1117
1118    #[doc(hidden)]
1119    impl gax::options::internal::RequestBuilder for GetSpecContents {
1120        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1121            &mut self.0.options
1122        }
1123    }
1124
1125    /// The request builder for [ApiHub::list_specs][crate::client::ApiHub::list_specs] calls.
1126    ///
1127    /// # Example
1128    /// ```no_run
1129    /// # use google_cloud_apihub_v1::builder;
1130    /// use builder::api_hub::ListSpecs;
1131    /// # tokio_test::block_on(async {
1132    /// use gax::paginator::ItemPaginator;
1133    ///
1134    /// let builder = prepare_request_builder();
1135    /// let mut items = builder.by_item();
1136    /// while let Some(result) = items.next().await {
1137    ///   let item = result?;
1138    /// }
1139    /// # gax::Result::<()>::Ok(()) });
1140    ///
1141    /// fn prepare_request_builder() -> ListSpecs {
1142    ///   # panic!();
1143    ///   // ... details omitted ...
1144    /// }
1145    /// ```
1146    #[derive(Clone, Debug)]
1147    pub struct ListSpecs(RequestBuilder<crate::model::ListSpecsRequest>);
1148
1149    impl ListSpecs {
1150        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1151            Self(RequestBuilder::new(stub))
1152        }
1153
1154        /// Sets the full request, replacing any prior values.
1155        pub fn with_request<V: Into<crate::model::ListSpecsRequest>>(mut self, v: V) -> Self {
1156            self.0.request = v.into();
1157            self
1158        }
1159
1160        /// Sets all the options, replacing any prior values.
1161        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1162            self.0.options = v.into();
1163            self
1164        }
1165
1166        /// Sends the request.
1167        pub async fn send(self) -> Result<crate::model::ListSpecsResponse> {
1168            (*self.0.stub)
1169                .list_specs(self.0.request, self.0.options)
1170                .await
1171                .map(gax::response::Response::into_body)
1172        }
1173
1174        /// Streams each page in the collection.
1175        pub fn by_page(
1176            self,
1177        ) -> impl gax::paginator::Paginator<crate::model::ListSpecsResponse, gax::error::Error>
1178        {
1179            use std::clone::Clone;
1180            let token = self.0.request.page_token.clone();
1181            let execute = move |token: String| {
1182                let mut builder = self.clone();
1183                builder.0.request = builder.0.request.set_page_token(token);
1184                builder.send()
1185            };
1186            gax::paginator::internal::new_paginator(token, execute)
1187        }
1188
1189        /// Streams each item in the collection.
1190        pub fn by_item(
1191            self,
1192        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpecsResponse, gax::error::Error>
1193        {
1194            use gax::paginator::Paginator;
1195            self.by_page().items()
1196        }
1197
1198        /// Sets the value of [parent][crate::model::ListSpecsRequest::parent].
1199        ///
1200        /// This is a **required** field for requests.
1201        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1202            self.0.request.parent = v.into();
1203            self
1204        }
1205
1206        /// Sets the value of [filter][crate::model::ListSpecsRequest::filter].
1207        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1208            self.0.request.filter = v.into();
1209            self
1210        }
1211
1212        /// Sets the value of [page_size][crate::model::ListSpecsRequest::page_size].
1213        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1214            self.0.request.page_size = v.into();
1215            self
1216        }
1217
1218        /// Sets the value of [page_token][crate::model::ListSpecsRequest::page_token].
1219        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1220            self.0.request.page_token = v.into();
1221            self
1222        }
1223    }
1224
1225    #[doc(hidden)]
1226    impl gax::options::internal::RequestBuilder for ListSpecs {
1227        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1228            &mut self.0.options
1229        }
1230    }
1231
1232    /// The request builder for [ApiHub::update_spec][crate::client::ApiHub::update_spec] calls.
1233    ///
1234    /// # Example
1235    /// ```no_run
1236    /// # use google_cloud_apihub_v1::builder;
1237    /// use builder::api_hub::UpdateSpec;
1238    /// # tokio_test::block_on(async {
1239    ///
1240    /// let builder = prepare_request_builder();
1241    /// let response = builder.send().await?;
1242    /// # gax::Result::<()>::Ok(()) });
1243    ///
1244    /// fn prepare_request_builder() -> UpdateSpec {
1245    ///   # panic!();
1246    ///   // ... details omitted ...
1247    /// }
1248    /// ```
1249    #[derive(Clone, Debug)]
1250    pub struct UpdateSpec(RequestBuilder<crate::model::UpdateSpecRequest>);
1251
1252    impl UpdateSpec {
1253        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1254            Self(RequestBuilder::new(stub))
1255        }
1256
1257        /// Sets the full request, replacing any prior values.
1258        pub fn with_request<V: Into<crate::model::UpdateSpecRequest>>(mut self, v: V) -> Self {
1259            self.0.request = v.into();
1260            self
1261        }
1262
1263        /// Sets all the options, replacing any prior values.
1264        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1265            self.0.options = v.into();
1266            self
1267        }
1268
1269        /// Sends the request.
1270        pub async fn send(self) -> Result<crate::model::Spec> {
1271            (*self.0.stub)
1272                .update_spec(self.0.request, self.0.options)
1273                .await
1274                .map(gax::response::Response::into_body)
1275        }
1276
1277        /// Sets the value of [spec][crate::model::UpdateSpecRequest::spec].
1278        ///
1279        /// This is a **required** field for requests.
1280        pub fn set_spec<T>(mut self, v: T) -> Self
1281        where
1282            T: std::convert::Into<crate::model::Spec>,
1283        {
1284            self.0.request.spec = std::option::Option::Some(v.into());
1285            self
1286        }
1287
1288        /// Sets or clears the value of [spec][crate::model::UpdateSpecRequest::spec].
1289        ///
1290        /// This is a **required** field for requests.
1291        pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
1292        where
1293            T: std::convert::Into<crate::model::Spec>,
1294        {
1295            self.0.request.spec = v.map(|x| x.into());
1296            self
1297        }
1298
1299        /// Sets the value of [update_mask][crate::model::UpdateSpecRequest::update_mask].
1300        ///
1301        /// This is a **required** field for requests.
1302        pub fn set_update_mask<T>(mut self, v: T) -> Self
1303        where
1304            T: std::convert::Into<wkt::FieldMask>,
1305        {
1306            self.0.request.update_mask = std::option::Option::Some(v.into());
1307            self
1308        }
1309
1310        /// Sets or clears the value of [update_mask][crate::model::UpdateSpecRequest::update_mask].
1311        ///
1312        /// This is a **required** field for requests.
1313        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1314        where
1315            T: std::convert::Into<wkt::FieldMask>,
1316        {
1317            self.0.request.update_mask = v.map(|x| x.into());
1318            self
1319        }
1320    }
1321
1322    #[doc(hidden)]
1323    impl gax::options::internal::RequestBuilder for UpdateSpec {
1324        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1325            &mut self.0.options
1326        }
1327    }
1328
1329    /// The request builder for [ApiHub::delete_spec][crate::client::ApiHub::delete_spec] calls.
1330    ///
1331    /// # Example
1332    /// ```no_run
1333    /// # use google_cloud_apihub_v1::builder;
1334    /// use builder::api_hub::DeleteSpec;
1335    /// # tokio_test::block_on(async {
1336    ///
1337    /// let builder = prepare_request_builder();
1338    /// let response = builder.send().await?;
1339    /// # gax::Result::<()>::Ok(()) });
1340    ///
1341    /// fn prepare_request_builder() -> DeleteSpec {
1342    ///   # panic!();
1343    ///   // ... details omitted ...
1344    /// }
1345    /// ```
1346    #[derive(Clone, Debug)]
1347    pub struct DeleteSpec(RequestBuilder<crate::model::DeleteSpecRequest>);
1348
1349    impl DeleteSpec {
1350        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1351            Self(RequestBuilder::new(stub))
1352        }
1353
1354        /// Sets the full request, replacing any prior values.
1355        pub fn with_request<V: Into<crate::model::DeleteSpecRequest>>(mut self, v: V) -> Self {
1356            self.0.request = v.into();
1357            self
1358        }
1359
1360        /// Sets all the options, replacing any prior values.
1361        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1362            self.0.options = v.into();
1363            self
1364        }
1365
1366        /// Sends the request.
1367        pub async fn send(self) -> Result<()> {
1368            (*self.0.stub)
1369                .delete_spec(self.0.request, self.0.options)
1370                .await
1371                .map(gax::response::Response::into_body)
1372        }
1373
1374        /// Sets the value of [name][crate::model::DeleteSpecRequest::name].
1375        ///
1376        /// This is a **required** field for requests.
1377        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1378            self.0.request.name = v.into();
1379            self
1380        }
1381    }
1382
1383    #[doc(hidden)]
1384    impl gax::options::internal::RequestBuilder for DeleteSpec {
1385        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1386            &mut self.0.options
1387        }
1388    }
1389
1390    /// The request builder for [ApiHub::create_api_operation][crate::client::ApiHub::create_api_operation] calls.
1391    ///
1392    /// # Example
1393    /// ```no_run
1394    /// # use google_cloud_apihub_v1::builder;
1395    /// use builder::api_hub::CreateApiOperation;
1396    /// # tokio_test::block_on(async {
1397    ///
1398    /// let builder = prepare_request_builder();
1399    /// let response = builder.send().await?;
1400    /// # gax::Result::<()>::Ok(()) });
1401    ///
1402    /// fn prepare_request_builder() -> CreateApiOperation {
1403    ///   # panic!();
1404    ///   // ... details omitted ...
1405    /// }
1406    /// ```
1407    #[derive(Clone, Debug)]
1408    pub struct CreateApiOperation(RequestBuilder<crate::model::CreateApiOperationRequest>);
1409
1410    impl CreateApiOperation {
1411        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1412            Self(RequestBuilder::new(stub))
1413        }
1414
1415        /// Sets the full request, replacing any prior values.
1416        pub fn with_request<V: Into<crate::model::CreateApiOperationRequest>>(
1417            mut self,
1418            v: V,
1419        ) -> Self {
1420            self.0.request = v.into();
1421            self
1422        }
1423
1424        /// Sets all the options, replacing any prior values.
1425        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1426            self.0.options = v.into();
1427            self
1428        }
1429
1430        /// Sends the request.
1431        pub async fn send(self) -> Result<crate::model::ApiOperation> {
1432            (*self.0.stub)
1433                .create_api_operation(self.0.request, self.0.options)
1434                .await
1435                .map(gax::response::Response::into_body)
1436        }
1437
1438        /// Sets the value of [parent][crate::model::CreateApiOperationRequest::parent].
1439        ///
1440        /// This is a **required** field for requests.
1441        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1442            self.0.request.parent = v.into();
1443            self
1444        }
1445
1446        /// Sets the value of [api_operation_id][crate::model::CreateApiOperationRequest::api_operation_id].
1447        pub fn set_api_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1448            self.0.request.api_operation_id = v.into();
1449            self
1450        }
1451
1452        /// Sets the value of [api_operation][crate::model::CreateApiOperationRequest::api_operation].
1453        ///
1454        /// This is a **required** field for requests.
1455        pub fn set_api_operation<T>(mut self, v: T) -> Self
1456        where
1457            T: std::convert::Into<crate::model::ApiOperation>,
1458        {
1459            self.0.request.api_operation = std::option::Option::Some(v.into());
1460            self
1461        }
1462
1463        /// Sets or clears the value of [api_operation][crate::model::CreateApiOperationRequest::api_operation].
1464        ///
1465        /// This is a **required** field for requests.
1466        pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
1467        where
1468            T: std::convert::Into<crate::model::ApiOperation>,
1469        {
1470            self.0.request.api_operation = v.map(|x| x.into());
1471            self
1472        }
1473    }
1474
1475    #[doc(hidden)]
1476    impl gax::options::internal::RequestBuilder for CreateApiOperation {
1477        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1478            &mut self.0.options
1479        }
1480    }
1481
1482    /// The request builder for [ApiHub::get_api_operation][crate::client::ApiHub::get_api_operation] calls.
1483    ///
1484    /// # Example
1485    /// ```no_run
1486    /// # use google_cloud_apihub_v1::builder;
1487    /// use builder::api_hub::GetApiOperation;
1488    /// # tokio_test::block_on(async {
1489    ///
1490    /// let builder = prepare_request_builder();
1491    /// let response = builder.send().await?;
1492    /// # gax::Result::<()>::Ok(()) });
1493    ///
1494    /// fn prepare_request_builder() -> GetApiOperation {
1495    ///   # panic!();
1496    ///   // ... details omitted ...
1497    /// }
1498    /// ```
1499    #[derive(Clone, Debug)]
1500    pub struct GetApiOperation(RequestBuilder<crate::model::GetApiOperationRequest>);
1501
1502    impl GetApiOperation {
1503        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1504            Self(RequestBuilder::new(stub))
1505        }
1506
1507        /// Sets the full request, replacing any prior values.
1508        pub fn with_request<V: Into<crate::model::GetApiOperationRequest>>(mut self, v: V) -> Self {
1509            self.0.request = v.into();
1510            self
1511        }
1512
1513        /// Sets all the options, replacing any prior values.
1514        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1515            self.0.options = v.into();
1516            self
1517        }
1518
1519        /// Sends the request.
1520        pub async fn send(self) -> Result<crate::model::ApiOperation> {
1521            (*self.0.stub)
1522                .get_api_operation(self.0.request, self.0.options)
1523                .await
1524                .map(gax::response::Response::into_body)
1525        }
1526
1527        /// Sets the value of [name][crate::model::GetApiOperationRequest::name].
1528        ///
1529        /// This is a **required** field for requests.
1530        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1531            self.0.request.name = v.into();
1532            self
1533        }
1534    }
1535
1536    #[doc(hidden)]
1537    impl gax::options::internal::RequestBuilder for GetApiOperation {
1538        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1539            &mut self.0.options
1540        }
1541    }
1542
1543    /// The request builder for [ApiHub::list_api_operations][crate::client::ApiHub::list_api_operations] calls.
1544    ///
1545    /// # Example
1546    /// ```no_run
1547    /// # use google_cloud_apihub_v1::builder;
1548    /// use builder::api_hub::ListApiOperations;
1549    /// # tokio_test::block_on(async {
1550    /// use gax::paginator::ItemPaginator;
1551    ///
1552    /// let builder = prepare_request_builder();
1553    /// let mut items = builder.by_item();
1554    /// while let Some(result) = items.next().await {
1555    ///   let item = result?;
1556    /// }
1557    /// # gax::Result::<()>::Ok(()) });
1558    ///
1559    /// fn prepare_request_builder() -> ListApiOperations {
1560    ///   # panic!();
1561    ///   // ... details omitted ...
1562    /// }
1563    /// ```
1564    #[derive(Clone, Debug)]
1565    pub struct ListApiOperations(RequestBuilder<crate::model::ListApiOperationsRequest>);
1566
1567    impl ListApiOperations {
1568        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1569            Self(RequestBuilder::new(stub))
1570        }
1571
1572        /// Sets the full request, replacing any prior values.
1573        pub fn with_request<V: Into<crate::model::ListApiOperationsRequest>>(
1574            mut self,
1575            v: V,
1576        ) -> Self {
1577            self.0.request = v.into();
1578            self
1579        }
1580
1581        /// Sets all the options, replacing any prior values.
1582        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1583            self.0.options = v.into();
1584            self
1585        }
1586
1587        /// Sends the request.
1588        pub async fn send(self) -> Result<crate::model::ListApiOperationsResponse> {
1589            (*self.0.stub)
1590                .list_api_operations(self.0.request, self.0.options)
1591                .await
1592                .map(gax::response::Response::into_body)
1593        }
1594
1595        /// Streams each page in the collection.
1596        pub fn by_page(
1597            self,
1598        ) -> impl gax::paginator::Paginator<crate::model::ListApiOperationsResponse, gax::error::Error>
1599        {
1600            use std::clone::Clone;
1601            let token = self.0.request.page_token.clone();
1602            let execute = move |token: String| {
1603                let mut builder = self.clone();
1604                builder.0.request = builder.0.request.set_page_token(token);
1605                builder.send()
1606            };
1607            gax::paginator::internal::new_paginator(token, execute)
1608        }
1609
1610        /// Streams each item in the collection.
1611        pub fn by_item(
1612            self,
1613        ) -> impl gax::paginator::ItemPaginator<crate::model::ListApiOperationsResponse, gax::error::Error>
1614        {
1615            use gax::paginator::Paginator;
1616            self.by_page().items()
1617        }
1618
1619        /// Sets the value of [parent][crate::model::ListApiOperationsRequest::parent].
1620        ///
1621        /// This is a **required** field for requests.
1622        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1623            self.0.request.parent = v.into();
1624            self
1625        }
1626
1627        /// Sets the value of [filter][crate::model::ListApiOperationsRequest::filter].
1628        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1629            self.0.request.filter = v.into();
1630            self
1631        }
1632
1633        /// Sets the value of [page_size][crate::model::ListApiOperationsRequest::page_size].
1634        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1635            self.0.request.page_size = v.into();
1636            self
1637        }
1638
1639        /// Sets the value of [page_token][crate::model::ListApiOperationsRequest::page_token].
1640        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641            self.0.request.page_token = v.into();
1642            self
1643        }
1644    }
1645
1646    #[doc(hidden)]
1647    impl gax::options::internal::RequestBuilder for ListApiOperations {
1648        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1649            &mut self.0.options
1650        }
1651    }
1652
1653    /// The request builder for [ApiHub::update_api_operation][crate::client::ApiHub::update_api_operation] calls.
1654    ///
1655    /// # Example
1656    /// ```no_run
1657    /// # use google_cloud_apihub_v1::builder;
1658    /// use builder::api_hub::UpdateApiOperation;
1659    /// # tokio_test::block_on(async {
1660    ///
1661    /// let builder = prepare_request_builder();
1662    /// let response = builder.send().await?;
1663    /// # gax::Result::<()>::Ok(()) });
1664    ///
1665    /// fn prepare_request_builder() -> UpdateApiOperation {
1666    ///   # panic!();
1667    ///   // ... details omitted ...
1668    /// }
1669    /// ```
1670    #[derive(Clone, Debug)]
1671    pub struct UpdateApiOperation(RequestBuilder<crate::model::UpdateApiOperationRequest>);
1672
1673    impl UpdateApiOperation {
1674        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1675            Self(RequestBuilder::new(stub))
1676        }
1677
1678        /// Sets the full request, replacing any prior values.
1679        pub fn with_request<V: Into<crate::model::UpdateApiOperationRequest>>(
1680            mut self,
1681            v: V,
1682        ) -> Self {
1683            self.0.request = v.into();
1684            self
1685        }
1686
1687        /// Sets all the options, replacing any prior values.
1688        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1689            self.0.options = v.into();
1690            self
1691        }
1692
1693        /// Sends the request.
1694        pub async fn send(self) -> Result<crate::model::ApiOperation> {
1695            (*self.0.stub)
1696                .update_api_operation(self.0.request, self.0.options)
1697                .await
1698                .map(gax::response::Response::into_body)
1699        }
1700
1701        /// Sets the value of [api_operation][crate::model::UpdateApiOperationRequest::api_operation].
1702        ///
1703        /// This is a **required** field for requests.
1704        pub fn set_api_operation<T>(mut self, v: T) -> Self
1705        where
1706            T: std::convert::Into<crate::model::ApiOperation>,
1707        {
1708            self.0.request.api_operation = std::option::Option::Some(v.into());
1709            self
1710        }
1711
1712        /// Sets or clears the value of [api_operation][crate::model::UpdateApiOperationRequest::api_operation].
1713        ///
1714        /// This is a **required** field for requests.
1715        pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
1716        where
1717            T: std::convert::Into<crate::model::ApiOperation>,
1718        {
1719            self.0.request.api_operation = v.map(|x| x.into());
1720            self
1721        }
1722
1723        /// Sets the value of [update_mask][crate::model::UpdateApiOperationRequest::update_mask].
1724        ///
1725        /// This is a **required** field for requests.
1726        pub fn set_update_mask<T>(mut self, v: T) -> Self
1727        where
1728            T: std::convert::Into<wkt::FieldMask>,
1729        {
1730            self.0.request.update_mask = std::option::Option::Some(v.into());
1731            self
1732        }
1733
1734        /// Sets or clears the value of [update_mask][crate::model::UpdateApiOperationRequest::update_mask].
1735        ///
1736        /// This is a **required** field for requests.
1737        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1738        where
1739            T: std::convert::Into<wkt::FieldMask>,
1740        {
1741            self.0.request.update_mask = v.map(|x| x.into());
1742            self
1743        }
1744    }
1745
1746    #[doc(hidden)]
1747    impl gax::options::internal::RequestBuilder for UpdateApiOperation {
1748        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1749            &mut self.0.options
1750        }
1751    }
1752
1753    /// The request builder for [ApiHub::delete_api_operation][crate::client::ApiHub::delete_api_operation] calls.
1754    ///
1755    /// # Example
1756    /// ```no_run
1757    /// # use google_cloud_apihub_v1::builder;
1758    /// use builder::api_hub::DeleteApiOperation;
1759    /// # tokio_test::block_on(async {
1760    ///
1761    /// let builder = prepare_request_builder();
1762    /// let response = builder.send().await?;
1763    /// # gax::Result::<()>::Ok(()) });
1764    ///
1765    /// fn prepare_request_builder() -> DeleteApiOperation {
1766    ///   # panic!();
1767    ///   // ... details omitted ...
1768    /// }
1769    /// ```
1770    #[derive(Clone, Debug)]
1771    pub struct DeleteApiOperation(RequestBuilder<crate::model::DeleteApiOperationRequest>);
1772
1773    impl DeleteApiOperation {
1774        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1775            Self(RequestBuilder::new(stub))
1776        }
1777
1778        /// Sets the full request, replacing any prior values.
1779        pub fn with_request<V: Into<crate::model::DeleteApiOperationRequest>>(
1780            mut self,
1781            v: V,
1782        ) -> Self {
1783            self.0.request = v.into();
1784            self
1785        }
1786
1787        /// Sets all the options, replacing any prior values.
1788        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1789            self.0.options = v.into();
1790            self
1791        }
1792
1793        /// Sends the request.
1794        pub async fn send(self) -> Result<()> {
1795            (*self.0.stub)
1796                .delete_api_operation(self.0.request, self.0.options)
1797                .await
1798                .map(gax::response::Response::into_body)
1799        }
1800
1801        /// Sets the value of [name][crate::model::DeleteApiOperationRequest::name].
1802        ///
1803        /// This is a **required** field for requests.
1804        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805            self.0.request.name = v.into();
1806            self
1807        }
1808    }
1809
1810    #[doc(hidden)]
1811    impl gax::options::internal::RequestBuilder for DeleteApiOperation {
1812        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1813            &mut self.0.options
1814        }
1815    }
1816
1817    /// The request builder for [ApiHub::get_definition][crate::client::ApiHub::get_definition] calls.
1818    ///
1819    /// # Example
1820    /// ```no_run
1821    /// # use google_cloud_apihub_v1::builder;
1822    /// use builder::api_hub::GetDefinition;
1823    /// # tokio_test::block_on(async {
1824    ///
1825    /// let builder = prepare_request_builder();
1826    /// let response = builder.send().await?;
1827    /// # gax::Result::<()>::Ok(()) });
1828    ///
1829    /// fn prepare_request_builder() -> GetDefinition {
1830    ///   # panic!();
1831    ///   // ... details omitted ...
1832    /// }
1833    /// ```
1834    #[derive(Clone, Debug)]
1835    pub struct GetDefinition(RequestBuilder<crate::model::GetDefinitionRequest>);
1836
1837    impl GetDefinition {
1838        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1839            Self(RequestBuilder::new(stub))
1840        }
1841
1842        /// Sets the full request, replacing any prior values.
1843        pub fn with_request<V: Into<crate::model::GetDefinitionRequest>>(mut self, v: V) -> Self {
1844            self.0.request = v.into();
1845            self
1846        }
1847
1848        /// Sets all the options, replacing any prior values.
1849        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1850            self.0.options = v.into();
1851            self
1852        }
1853
1854        /// Sends the request.
1855        pub async fn send(self) -> Result<crate::model::Definition> {
1856            (*self.0.stub)
1857                .get_definition(self.0.request, self.0.options)
1858                .await
1859                .map(gax::response::Response::into_body)
1860        }
1861
1862        /// Sets the value of [name][crate::model::GetDefinitionRequest::name].
1863        ///
1864        /// This is a **required** field for requests.
1865        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1866            self.0.request.name = v.into();
1867            self
1868        }
1869    }
1870
1871    #[doc(hidden)]
1872    impl gax::options::internal::RequestBuilder for GetDefinition {
1873        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1874            &mut self.0.options
1875        }
1876    }
1877
1878    /// The request builder for [ApiHub::create_deployment][crate::client::ApiHub::create_deployment] calls.
1879    ///
1880    /// # Example
1881    /// ```no_run
1882    /// # use google_cloud_apihub_v1::builder;
1883    /// use builder::api_hub::CreateDeployment;
1884    /// # tokio_test::block_on(async {
1885    ///
1886    /// let builder = prepare_request_builder();
1887    /// let response = builder.send().await?;
1888    /// # gax::Result::<()>::Ok(()) });
1889    ///
1890    /// fn prepare_request_builder() -> CreateDeployment {
1891    ///   # panic!();
1892    ///   // ... details omitted ...
1893    /// }
1894    /// ```
1895    #[derive(Clone, Debug)]
1896    pub struct CreateDeployment(RequestBuilder<crate::model::CreateDeploymentRequest>);
1897
1898    impl CreateDeployment {
1899        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1900            Self(RequestBuilder::new(stub))
1901        }
1902
1903        /// Sets the full request, replacing any prior values.
1904        pub fn with_request<V: Into<crate::model::CreateDeploymentRequest>>(
1905            mut self,
1906            v: V,
1907        ) -> Self {
1908            self.0.request = v.into();
1909            self
1910        }
1911
1912        /// Sets all the options, replacing any prior values.
1913        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1914            self.0.options = v.into();
1915            self
1916        }
1917
1918        /// Sends the request.
1919        pub async fn send(self) -> Result<crate::model::Deployment> {
1920            (*self.0.stub)
1921                .create_deployment(self.0.request, self.0.options)
1922                .await
1923                .map(gax::response::Response::into_body)
1924        }
1925
1926        /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
1927        ///
1928        /// This is a **required** field for requests.
1929        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1930            self.0.request.parent = v.into();
1931            self
1932        }
1933
1934        /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
1935        pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1936            self.0.request.deployment_id = v.into();
1937            self
1938        }
1939
1940        /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
1941        ///
1942        /// This is a **required** field for requests.
1943        pub fn set_deployment<T>(mut self, v: T) -> Self
1944        where
1945            T: std::convert::Into<crate::model::Deployment>,
1946        {
1947            self.0.request.deployment = std::option::Option::Some(v.into());
1948            self
1949        }
1950
1951        /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
1952        ///
1953        /// This is a **required** field for requests.
1954        pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1955        where
1956            T: std::convert::Into<crate::model::Deployment>,
1957        {
1958            self.0.request.deployment = v.map(|x| x.into());
1959            self
1960        }
1961    }
1962
1963    #[doc(hidden)]
1964    impl gax::options::internal::RequestBuilder for CreateDeployment {
1965        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1966            &mut self.0.options
1967        }
1968    }
1969
1970    /// The request builder for [ApiHub::get_deployment][crate::client::ApiHub::get_deployment] calls.
1971    ///
1972    /// # Example
1973    /// ```no_run
1974    /// # use google_cloud_apihub_v1::builder;
1975    /// use builder::api_hub::GetDeployment;
1976    /// # tokio_test::block_on(async {
1977    ///
1978    /// let builder = prepare_request_builder();
1979    /// let response = builder.send().await?;
1980    /// # gax::Result::<()>::Ok(()) });
1981    ///
1982    /// fn prepare_request_builder() -> GetDeployment {
1983    ///   # panic!();
1984    ///   // ... details omitted ...
1985    /// }
1986    /// ```
1987    #[derive(Clone, Debug)]
1988    pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
1989
1990    impl GetDeployment {
1991        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1992            Self(RequestBuilder::new(stub))
1993        }
1994
1995        /// Sets the full request, replacing any prior values.
1996        pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
1997            self.0.request = v.into();
1998            self
1999        }
2000
2001        /// Sets all the options, replacing any prior values.
2002        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2003            self.0.options = v.into();
2004            self
2005        }
2006
2007        /// Sends the request.
2008        pub async fn send(self) -> Result<crate::model::Deployment> {
2009            (*self.0.stub)
2010                .get_deployment(self.0.request, self.0.options)
2011                .await
2012                .map(gax::response::Response::into_body)
2013        }
2014
2015        /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
2016        ///
2017        /// This is a **required** field for requests.
2018        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2019            self.0.request.name = v.into();
2020            self
2021        }
2022    }
2023
2024    #[doc(hidden)]
2025    impl gax::options::internal::RequestBuilder for GetDeployment {
2026        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2027            &mut self.0.options
2028        }
2029    }
2030
2031    /// The request builder for [ApiHub::list_deployments][crate::client::ApiHub::list_deployments] calls.
2032    ///
2033    /// # Example
2034    /// ```no_run
2035    /// # use google_cloud_apihub_v1::builder;
2036    /// use builder::api_hub::ListDeployments;
2037    /// # tokio_test::block_on(async {
2038    /// use gax::paginator::ItemPaginator;
2039    ///
2040    /// let builder = prepare_request_builder();
2041    /// let mut items = builder.by_item();
2042    /// while let Some(result) = items.next().await {
2043    ///   let item = result?;
2044    /// }
2045    /// # gax::Result::<()>::Ok(()) });
2046    ///
2047    /// fn prepare_request_builder() -> ListDeployments {
2048    ///   # panic!();
2049    ///   // ... details omitted ...
2050    /// }
2051    /// ```
2052    #[derive(Clone, Debug)]
2053    pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
2054
2055    impl ListDeployments {
2056        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2057            Self(RequestBuilder::new(stub))
2058        }
2059
2060        /// Sets the full request, replacing any prior values.
2061        pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
2062            self.0.request = v.into();
2063            self
2064        }
2065
2066        /// Sets all the options, replacing any prior values.
2067        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2068            self.0.options = v.into();
2069            self
2070        }
2071
2072        /// Sends the request.
2073        pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
2074            (*self.0.stub)
2075                .list_deployments(self.0.request, self.0.options)
2076                .await
2077                .map(gax::response::Response::into_body)
2078        }
2079
2080        /// Streams each page in the collection.
2081        pub fn by_page(
2082            self,
2083        ) -> impl gax::paginator::Paginator<crate::model::ListDeploymentsResponse, gax::error::Error>
2084        {
2085            use std::clone::Clone;
2086            let token = self.0.request.page_token.clone();
2087            let execute = move |token: String| {
2088                let mut builder = self.clone();
2089                builder.0.request = builder.0.request.set_page_token(token);
2090                builder.send()
2091            };
2092            gax::paginator::internal::new_paginator(token, execute)
2093        }
2094
2095        /// Streams each item in the collection.
2096        pub fn by_item(
2097            self,
2098        ) -> impl gax::paginator::ItemPaginator<crate::model::ListDeploymentsResponse, gax::error::Error>
2099        {
2100            use gax::paginator::Paginator;
2101            self.by_page().items()
2102        }
2103
2104        /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
2105        ///
2106        /// This is a **required** field for requests.
2107        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2108            self.0.request.parent = v.into();
2109            self
2110        }
2111
2112        /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
2113        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2114            self.0.request.filter = v.into();
2115            self
2116        }
2117
2118        /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
2119        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2120            self.0.request.page_size = v.into();
2121            self
2122        }
2123
2124        /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
2125        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2126            self.0.request.page_token = v.into();
2127            self
2128        }
2129    }
2130
2131    #[doc(hidden)]
2132    impl gax::options::internal::RequestBuilder for ListDeployments {
2133        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2134            &mut self.0.options
2135        }
2136    }
2137
2138    /// The request builder for [ApiHub::update_deployment][crate::client::ApiHub::update_deployment] calls.
2139    ///
2140    /// # Example
2141    /// ```no_run
2142    /// # use google_cloud_apihub_v1::builder;
2143    /// use builder::api_hub::UpdateDeployment;
2144    /// # tokio_test::block_on(async {
2145    ///
2146    /// let builder = prepare_request_builder();
2147    /// let response = builder.send().await?;
2148    /// # gax::Result::<()>::Ok(()) });
2149    ///
2150    /// fn prepare_request_builder() -> UpdateDeployment {
2151    ///   # panic!();
2152    ///   // ... details omitted ...
2153    /// }
2154    /// ```
2155    #[derive(Clone, Debug)]
2156    pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
2157
2158    impl UpdateDeployment {
2159        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2160            Self(RequestBuilder::new(stub))
2161        }
2162
2163        /// Sets the full request, replacing any prior values.
2164        pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
2165            mut self,
2166            v: V,
2167        ) -> Self {
2168            self.0.request = v.into();
2169            self
2170        }
2171
2172        /// Sets all the options, replacing any prior values.
2173        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2174            self.0.options = v.into();
2175            self
2176        }
2177
2178        /// Sends the request.
2179        pub async fn send(self) -> Result<crate::model::Deployment> {
2180            (*self.0.stub)
2181                .update_deployment(self.0.request, self.0.options)
2182                .await
2183                .map(gax::response::Response::into_body)
2184        }
2185
2186        /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2187        ///
2188        /// This is a **required** field for requests.
2189        pub fn set_deployment<T>(mut self, v: T) -> Self
2190        where
2191            T: std::convert::Into<crate::model::Deployment>,
2192        {
2193            self.0.request.deployment = std::option::Option::Some(v.into());
2194            self
2195        }
2196
2197        /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2198        ///
2199        /// This is a **required** field for requests.
2200        pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2201        where
2202            T: std::convert::Into<crate::model::Deployment>,
2203        {
2204            self.0.request.deployment = v.map(|x| x.into());
2205            self
2206        }
2207
2208        /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2209        ///
2210        /// This is a **required** field for requests.
2211        pub fn set_update_mask<T>(mut self, v: T) -> Self
2212        where
2213            T: std::convert::Into<wkt::FieldMask>,
2214        {
2215            self.0.request.update_mask = std::option::Option::Some(v.into());
2216            self
2217        }
2218
2219        /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2220        ///
2221        /// This is a **required** field for requests.
2222        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2223        where
2224            T: std::convert::Into<wkt::FieldMask>,
2225        {
2226            self.0.request.update_mask = v.map(|x| x.into());
2227            self
2228        }
2229    }
2230
2231    #[doc(hidden)]
2232    impl gax::options::internal::RequestBuilder for UpdateDeployment {
2233        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2234            &mut self.0.options
2235        }
2236    }
2237
2238    /// The request builder for [ApiHub::delete_deployment][crate::client::ApiHub::delete_deployment] calls.
2239    ///
2240    /// # Example
2241    /// ```no_run
2242    /// # use google_cloud_apihub_v1::builder;
2243    /// use builder::api_hub::DeleteDeployment;
2244    /// # tokio_test::block_on(async {
2245    ///
2246    /// let builder = prepare_request_builder();
2247    /// let response = builder.send().await?;
2248    /// # gax::Result::<()>::Ok(()) });
2249    ///
2250    /// fn prepare_request_builder() -> DeleteDeployment {
2251    ///   # panic!();
2252    ///   // ... details omitted ...
2253    /// }
2254    /// ```
2255    #[derive(Clone, Debug)]
2256    pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
2257
2258    impl DeleteDeployment {
2259        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2260            Self(RequestBuilder::new(stub))
2261        }
2262
2263        /// Sets the full request, replacing any prior values.
2264        pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
2265            mut self,
2266            v: V,
2267        ) -> Self {
2268            self.0.request = v.into();
2269            self
2270        }
2271
2272        /// Sets all the options, replacing any prior values.
2273        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2274            self.0.options = v.into();
2275            self
2276        }
2277
2278        /// Sends the request.
2279        pub async fn send(self) -> Result<()> {
2280            (*self.0.stub)
2281                .delete_deployment(self.0.request, self.0.options)
2282                .await
2283                .map(gax::response::Response::into_body)
2284        }
2285
2286        /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
2287        ///
2288        /// This is a **required** field for requests.
2289        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2290            self.0.request.name = v.into();
2291            self
2292        }
2293    }
2294
2295    #[doc(hidden)]
2296    impl gax::options::internal::RequestBuilder for DeleteDeployment {
2297        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2298            &mut self.0.options
2299        }
2300    }
2301
2302    /// The request builder for [ApiHub::create_attribute][crate::client::ApiHub::create_attribute] calls.
2303    ///
2304    /// # Example
2305    /// ```no_run
2306    /// # use google_cloud_apihub_v1::builder;
2307    /// use builder::api_hub::CreateAttribute;
2308    /// # tokio_test::block_on(async {
2309    ///
2310    /// let builder = prepare_request_builder();
2311    /// let response = builder.send().await?;
2312    /// # gax::Result::<()>::Ok(()) });
2313    ///
2314    /// fn prepare_request_builder() -> CreateAttribute {
2315    ///   # panic!();
2316    ///   // ... details omitted ...
2317    /// }
2318    /// ```
2319    #[derive(Clone, Debug)]
2320    pub struct CreateAttribute(RequestBuilder<crate::model::CreateAttributeRequest>);
2321
2322    impl CreateAttribute {
2323        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2324            Self(RequestBuilder::new(stub))
2325        }
2326
2327        /// Sets the full request, replacing any prior values.
2328        pub fn with_request<V: Into<crate::model::CreateAttributeRequest>>(mut self, v: V) -> Self {
2329            self.0.request = v.into();
2330            self
2331        }
2332
2333        /// Sets all the options, replacing any prior values.
2334        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2335            self.0.options = v.into();
2336            self
2337        }
2338
2339        /// Sends the request.
2340        pub async fn send(self) -> Result<crate::model::Attribute> {
2341            (*self.0.stub)
2342                .create_attribute(self.0.request, self.0.options)
2343                .await
2344                .map(gax::response::Response::into_body)
2345        }
2346
2347        /// Sets the value of [parent][crate::model::CreateAttributeRequest::parent].
2348        ///
2349        /// This is a **required** field for requests.
2350        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2351            self.0.request.parent = v.into();
2352            self
2353        }
2354
2355        /// Sets the value of [attribute_id][crate::model::CreateAttributeRequest::attribute_id].
2356        pub fn set_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2357            self.0.request.attribute_id = v.into();
2358            self
2359        }
2360
2361        /// Sets the value of [attribute][crate::model::CreateAttributeRequest::attribute].
2362        ///
2363        /// This is a **required** field for requests.
2364        pub fn set_attribute<T>(mut self, v: T) -> Self
2365        where
2366            T: std::convert::Into<crate::model::Attribute>,
2367        {
2368            self.0.request.attribute = std::option::Option::Some(v.into());
2369            self
2370        }
2371
2372        /// Sets or clears the value of [attribute][crate::model::CreateAttributeRequest::attribute].
2373        ///
2374        /// This is a **required** field for requests.
2375        pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
2376        where
2377            T: std::convert::Into<crate::model::Attribute>,
2378        {
2379            self.0.request.attribute = v.map(|x| x.into());
2380            self
2381        }
2382    }
2383
2384    #[doc(hidden)]
2385    impl gax::options::internal::RequestBuilder for CreateAttribute {
2386        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2387            &mut self.0.options
2388        }
2389    }
2390
2391    /// The request builder for [ApiHub::get_attribute][crate::client::ApiHub::get_attribute] calls.
2392    ///
2393    /// # Example
2394    /// ```no_run
2395    /// # use google_cloud_apihub_v1::builder;
2396    /// use builder::api_hub::GetAttribute;
2397    /// # tokio_test::block_on(async {
2398    ///
2399    /// let builder = prepare_request_builder();
2400    /// let response = builder.send().await?;
2401    /// # gax::Result::<()>::Ok(()) });
2402    ///
2403    /// fn prepare_request_builder() -> GetAttribute {
2404    ///   # panic!();
2405    ///   // ... details omitted ...
2406    /// }
2407    /// ```
2408    #[derive(Clone, Debug)]
2409    pub struct GetAttribute(RequestBuilder<crate::model::GetAttributeRequest>);
2410
2411    impl GetAttribute {
2412        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2413            Self(RequestBuilder::new(stub))
2414        }
2415
2416        /// Sets the full request, replacing any prior values.
2417        pub fn with_request<V: Into<crate::model::GetAttributeRequest>>(mut self, v: V) -> Self {
2418            self.0.request = v.into();
2419            self
2420        }
2421
2422        /// Sets all the options, replacing any prior values.
2423        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2424            self.0.options = v.into();
2425            self
2426        }
2427
2428        /// Sends the request.
2429        pub async fn send(self) -> Result<crate::model::Attribute> {
2430            (*self.0.stub)
2431                .get_attribute(self.0.request, self.0.options)
2432                .await
2433                .map(gax::response::Response::into_body)
2434        }
2435
2436        /// Sets the value of [name][crate::model::GetAttributeRequest::name].
2437        ///
2438        /// This is a **required** field for requests.
2439        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2440            self.0.request.name = v.into();
2441            self
2442        }
2443    }
2444
2445    #[doc(hidden)]
2446    impl gax::options::internal::RequestBuilder for GetAttribute {
2447        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2448            &mut self.0.options
2449        }
2450    }
2451
2452    /// The request builder for [ApiHub::update_attribute][crate::client::ApiHub::update_attribute] calls.
2453    ///
2454    /// # Example
2455    /// ```no_run
2456    /// # use google_cloud_apihub_v1::builder;
2457    /// use builder::api_hub::UpdateAttribute;
2458    /// # tokio_test::block_on(async {
2459    ///
2460    /// let builder = prepare_request_builder();
2461    /// let response = builder.send().await?;
2462    /// # gax::Result::<()>::Ok(()) });
2463    ///
2464    /// fn prepare_request_builder() -> UpdateAttribute {
2465    ///   # panic!();
2466    ///   // ... details omitted ...
2467    /// }
2468    /// ```
2469    #[derive(Clone, Debug)]
2470    pub struct UpdateAttribute(RequestBuilder<crate::model::UpdateAttributeRequest>);
2471
2472    impl UpdateAttribute {
2473        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2474            Self(RequestBuilder::new(stub))
2475        }
2476
2477        /// Sets the full request, replacing any prior values.
2478        pub fn with_request<V: Into<crate::model::UpdateAttributeRequest>>(mut self, v: V) -> Self {
2479            self.0.request = v.into();
2480            self
2481        }
2482
2483        /// Sets all the options, replacing any prior values.
2484        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2485            self.0.options = v.into();
2486            self
2487        }
2488
2489        /// Sends the request.
2490        pub async fn send(self) -> Result<crate::model::Attribute> {
2491            (*self.0.stub)
2492                .update_attribute(self.0.request, self.0.options)
2493                .await
2494                .map(gax::response::Response::into_body)
2495        }
2496
2497        /// Sets the value of [attribute][crate::model::UpdateAttributeRequest::attribute].
2498        ///
2499        /// This is a **required** field for requests.
2500        pub fn set_attribute<T>(mut self, v: T) -> Self
2501        where
2502            T: std::convert::Into<crate::model::Attribute>,
2503        {
2504            self.0.request.attribute = std::option::Option::Some(v.into());
2505            self
2506        }
2507
2508        /// Sets or clears the value of [attribute][crate::model::UpdateAttributeRequest::attribute].
2509        ///
2510        /// This is a **required** field for requests.
2511        pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
2512        where
2513            T: std::convert::Into<crate::model::Attribute>,
2514        {
2515            self.0.request.attribute = v.map(|x| x.into());
2516            self
2517        }
2518
2519        /// Sets the value of [update_mask][crate::model::UpdateAttributeRequest::update_mask].
2520        ///
2521        /// This is a **required** field for requests.
2522        pub fn set_update_mask<T>(mut self, v: T) -> Self
2523        where
2524            T: std::convert::Into<wkt::FieldMask>,
2525        {
2526            self.0.request.update_mask = std::option::Option::Some(v.into());
2527            self
2528        }
2529
2530        /// Sets or clears the value of [update_mask][crate::model::UpdateAttributeRequest::update_mask].
2531        ///
2532        /// This is a **required** field for requests.
2533        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2534        where
2535            T: std::convert::Into<wkt::FieldMask>,
2536        {
2537            self.0.request.update_mask = v.map(|x| x.into());
2538            self
2539        }
2540    }
2541
2542    #[doc(hidden)]
2543    impl gax::options::internal::RequestBuilder for UpdateAttribute {
2544        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2545            &mut self.0.options
2546        }
2547    }
2548
2549    /// The request builder for [ApiHub::delete_attribute][crate::client::ApiHub::delete_attribute] calls.
2550    ///
2551    /// # Example
2552    /// ```no_run
2553    /// # use google_cloud_apihub_v1::builder;
2554    /// use builder::api_hub::DeleteAttribute;
2555    /// # tokio_test::block_on(async {
2556    ///
2557    /// let builder = prepare_request_builder();
2558    /// let response = builder.send().await?;
2559    /// # gax::Result::<()>::Ok(()) });
2560    ///
2561    /// fn prepare_request_builder() -> DeleteAttribute {
2562    ///   # panic!();
2563    ///   // ... details omitted ...
2564    /// }
2565    /// ```
2566    #[derive(Clone, Debug)]
2567    pub struct DeleteAttribute(RequestBuilder<crate::model::DeleteAttributeRequest>);
2568
2569    impl DeleteAttribute {
2570        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2571            Self(RequestBuilder::new(stub))
2572        }
2573
2574        /// Sets the full request, replacing any prior values.
2575        pub fn with_request<V: Into<crate::model::DeleteAttributeRequest>>(mut self, v: V) -> Self {
2576            self.0.request = v.into();
2577            self
2578        }
2579
2580        /// Sets all the options, replacing any prior values.
2581        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2582            self.0.options = v.into();
2583            self
2584        }
2585
2586        /// Sends the request.
2587        pub async fn send(self) -> Result<()> {
2588            (*self.0.stub)
2589                .delete_attribute(self.0.request, self.0.options)
2590                .await
2591                .map(gax::response::Response::into_body)
2592        }
2593
2594        /// Sets the value of [name][crate::model::DeleteAttributeRequest::name].
2595        ///
2596        /// This is a **required** field for requests.
2597        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2598            self.0.request.name = v.into();
2599            self
2600        }
2601    }
2602
2603    #[doc(hidden)]
2604    impl gax::options::internal::RequestBuilder for DeleteAttribute {
2605        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2606            &mut self.0.options
2607        }
2608    }
2609
2610    /// The request builder for [ApiHub::list_attributes][crate::client::ApiHub::list_attributes] calls.
2611    ///
2612    /// # Example
2613    /// ```no_run
2614    /// # use google_cloud_apihub_v1::builder;
2615    /// use builder::api_hub::ListAttributes;
2616    /// # tokio_test::block_on(async {
2617    /// use gax::paginator::ItemPaginator;
2618    ///
2619    /// let builder = prepare_request_builder();
2620    /// let mut items = builder.by_item();
2621    /// while let Some(result) = items.next().await {
2622    ///   let item = result?;
2623    /// }
2624    /// # gax::Result::<()>::Ok(()) });
2625    ///
2626    /// fn prepare_request_builder() -> ListAttributes {
2627    ///   # panic!();
2628    ///   // ... details omitted ...
2629    /// }
2630    /// ```
2631    #[derive(Clone, Debug)]
2632    pub struct ListAttributes(RequestBuilder<crate::model::ListAttributesRequest>);
2633
2634    impl ListAttributes {
2635        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2636            Self(RequestBuilder::new(stub))
2637        }
2638
2639        /// Sets the full request, replacing any prior values.
2640        pub fn with_request<V: Into<crate::model::ListAttributesRequest>>(mut self, v: V) -> Self {
2641            self.0.request = v.into();
2642            self
2643        }
2644
2645        /// Sets all the options, replacing any prior values.
2646        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2647            self.0.options = v.into();
2648            self
2649        }
2650
2651        /// Sends the request.
2652        pub async fn send(self) -> Result<crate::model::ListAttributesResponse> {
2653            (*self.0.stub)
2654                .list_attributes(self.0.request, self.0.options)
2655                .await
2656                .map(gax::response::Response::into_body)
2657        }
2658
2659        /// Streams each page in the collection.
2660        pub fn by_page(
2661            self,
2662        ) -> impl gax::paginator::Paginator<crate::model::ListAttributesResponse, gax::error::Error>
2663        {
2664            use std::clone::Clone;
2665            let token = self.0.request.page_token.clone();
2666            let execute = move |token: String| {
2667                let mut builder = self.clone();
2668                builder.0.request = builder.0.request.set_page_token(token);
2669                builder.send()
2670            };
2671            gax::paginator::internal::new_paginator(token, execute)
2672        }
2673
2674        /// Streams each item in the collection.
2675        pub fn by_item(
2676            self,
2677        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAttributesResponse, gax::error::Error>
2678        {
2679            use gax::paginator::Paginator;
2680            self.by_page().items()
2681        }
2682
2683        /// Sets the value of [parent][crate::model::ListAttributesRequest::parent].
2684        ///
2685        /// This is a **required** field for requests.
2686        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2687            self.0.request.parent = v.into();
2688            self
2689        }
2690
2691        /// Sets the value of [filter][crate::model::ListAttributesRequest::filter].
2692        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2693            self.0.request.filter = v.into();
2694            self
2695        }
2696
2697        /// Sets the value of [page_size][crate::model::ListAttributesRequest::page_size].
2698        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2699            self.0.request.page_size = v.into();
2700            self
2701        }
2702
2703        /// Sets the value of [page_token][crate::model::ListAttributesRequest::page_token].
2704        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2705            self.0.request.page_token = v.into();
2706            self
2707        }
2708    }
2709
2710    #[doc(hidden)]
2711    impl gax::options::internal::RequestBuilder for ListAttributes {
2712        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2713            &mut self.0.options
2714        }
2715    }
2716
2717    /// The request builder for [ApiHub::search_resources][crate::client::ApiHub::search_resources] calls.
2718    ///
2719    /// # Example
2720    /// ```no_run
2721    /// # use google_cloud_apihub_v1::builder;
2722    /// use builder::api_hub::SearchResources;
2723    /// # tokio_test::block_on(async {
2724    /// use gax::paginator::ItemPaginator;
2725    ///
2726    /// let builder = prepare_request_builder();
2727    /// let mut items = builder.by_item();
2728    /// while let Some(result) = items.next().await {
2729    ///   let item = result?;
2730    /// }
2731    /// # gax::Result::<()>::Ok(()) });
2732    ///
2733    /// fn prepare_request_builder() -> SearchResources {
2734    ///   # panic!();
2735    ///   // ... details omitted ...
2736    /// }
2737    /// ```
2738    #[derive(Clone, Debug)]
2739    pub struct SearchResources(RequestBuilder<crate::model::SearchResourcesRequest>);
2740
2741    impl SearchResources {
2742        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> 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::SearchResourcesRequest>>(mut self, v: V) -> Self {
2748            self.0.request = v.into();
2749            self
2750        }
2751
2752        /// Sets all the options, replacing any prior values.
2753        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2754            self.0.options = v.into();
2755            self
2756        }
2757
2758        /// Sends the request.
2759        pub async fn send(self) -> Result<crate::model::SearchResourcesResponse> {
2760            (*self.0.stub)
2761                .search_resources(self.0.request, self.0.options)
2762                .await
2763                .map(gax::response::Response::into_body)
2764        }
2765
2766        /// Streams each page in the collection.
2767        pub fn by_page(
2768            self,
2769        ) -> impl gax::paginator::Paginator<crate::model::SearchResourcesResponse, gax::error::Error>
2770        {
2771            use std::clone::Clone;
2772            let token = self.0.request.page_token.clone();
2773            let execute = move |token: String| {
2774                let mut builder = self.clone();
2775                builder.0.request = builder.0.request.set_page_token(token);
2776                builder.send()
2777            };
2778            gax::paginator::internal::new_paginator(token, execute)
2779        }
2780
2781        /// Streams each item in the collection.
2782        pub fn by_item(
2783            self,
2784        ) -> impl gax::paginator::ItemPaginator<crate::model::SearchResourcesResponse, gax::error::Error>
2785        {
2786            use gax::paginator::Paginator;
2787            self.by_page().items()
2788        }
2789
2790        /// Sets the value of [location][crate::model::SearchResourcesRequest::location].
2791        ///
2792        /// This is a **required** field for requests.
2793        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2794            self.0.request.location = v.into();
2795            self
2796        }
2797
2798        /// Sets the value of [query][crate::model::SearchResourcesRequest::query].
2799        ///
2800        /// This is a **required** field for requests.
2801        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
2802            self.0.request.query = v.into();
2803            self
2804        }
2805
2806        /// Sets the value of [filter][crate::model::SearchResourcesRequest::filter].
2807        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2808            self.0.request.filter = v.into();
2809            self
2810        }
2811
2812        /// Sets the value of [page_size][crate::model::SearchResourcesRequest::page_size].
2813        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2814            self.0.request.page_size = v.into();
2815            self
2816        }
2817
2818        /// Sets the value of [page_token][crate::model::SearchResourcesRequest::page_token].
2819        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2820            self.0.request.page_token = v.into();
2821            self
2822        }
2823    }
2824
2825    #[doc(hidden)]
2826    impl gax::options::internal::RequestBuilder for SearchResources {
2827        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2828            &mut self.0.options
2829        }
2830    }
2831
2832    /// The request builder for [ApiHub::create_external_api][crate::client::ApiHub::create_external_api] calls.
2833    ///
2834    /// # Example
2835    /// ```no_run
2836    /// # use google_cloud_apihub_v1::builder;
2837    /// use builder::api_hub::CreateExternalApi;
2838    /// # tokio_test::block_on(async {
2839    ///
2840    /// let builder = prepare_request_builder();
2841    /// let response = builder.send().await?;
2842    /// # gax::Result::<()>::Ok(()) });
2843    ///
2844    /// fn prepare_request_builder() -> CreateExternalApi {
2845    ///   # panic!();
2846    ///   // ... details omitted ...
2847    /// }
2848    /// ```
2849    #[derive(Clone, Debug)]
2850    pub struct CreateExternalApi(RequestBuilder<crate::model::CreateExternalApiRequest>);
2851
2852    impl CreateExternalApi {
2853        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2854            Self(RequestBuilder::new(stub))
2855        }
2856
2857        /// Sets the full request, replacing any prior values.
2858        pub fn with_request<V: Into<crate::model::CreateExternalApiRequest>>(
2859            mut self,
2860            v: V,
2861        ) -> Self {
2862            self.0.request = v.into();
2863            self
2864        }
2865
2866        /// Sets all the options, replacing any prior values.
2867        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2868            self.0.options = v.into();
2869            self
2870        }
2871
2872        /// Sends the request.
2873        pub async fn send(self) -> Result<crate::model::ExternalApi> {
2874            (*self.0.stub)
2875                .create_external_api(self.0.request, self.0.options)
2876                .await
2877                .map(gax::response::Response::into_body)
2878        }
2879
2880        /// Sets the value of [parent][crate::model::CreateExternalApiRequest::parent].
2881        ///
2882        /// This is a **required** field for requests.
2883        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2884            self.0.request.parent = v.into();
2885            self
2886        }
2887
2888        /// Sets the value of [external_api_id][crate::model::CreateExternalApiRequest::external_api_id].
2889        pub fn set_external_api_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2890            self.0.request.external_api_id = v.into();
2891            self
2892        }
2893
2894        /// Sets the value of [external_api][crate::model::CreateExternalApiRequest::external_api].
2895        ///
2896        /// This is a **required** field for requests.
2897        pub fn set_external_api<T>(mut self, v: T) -> Self
2898        where
2899            T: std::convert::Into<crate::model::ExternalApi>,
2900        {
2901            self.0.request.external_api = std::option::Option::Some(v.into());
2902            self
2903        }
2904
2905        /// Sets or clears the value of [external_api][crate::model::CreateExternalApiRequest::external_api].
2906        ///
2907        /// This is a **required** field for requests.
2908        pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
2909        where
2910            T: std::convert::Into<crate::model::ExternalApi>,
2911        {
2912            self.0.request.external_api = v.map(|x| x.into());
2913            self
2914        }
2915    }
2916
2917    #[doc(hidden)]
2918    impl gax::options::internal::RequestBuilder for CreateExternalApi {
2919        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2920            &mut self.0.options
2921        }
2922    }
2923
2924    /// The request builder for [ApiHub::get_external_api][crate::client::ApiHub::get_external_api] calls.
2925    ///
2926    /// # Example
2927    /// ```no_run
2928    /// # use google_cloud_apihub_v1::builder;
2929    /// use builder::api_hub::GetExternalApi;
2930    /// # tokio_test::block_on(async {
2931    ///
2932    /// let builder = prepare_request_builder();
2933    /// let response = builder.send().await?;
2934    /// # gax::Result::<()>::Ok(()) });
2935    ///
2936    /// fn prepare_request_builder() -> GetExternalApi {
2937    ///   # panic!();
2938    ///   // ... details omitted ...
2939    /// }
2940    /// ```
2941    #[derive(Clone, Debug)]
2942    pub struct GetExternalApi(RequestBuilder<crate::model::GetExternalApiRequest>);
2943
2944    impl GetExternalApi {
2945        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2946            Self(RequestBuilder::new(stub))
2947        }
2948
2949        /// Sets the full request, replacing any prior values.
2950        pub fn with_request<V: Into<crate::model::GetExternalApiRequest>>(mut self, v: V) -> Self {
2951            self.0.request = v.into();
2952            self
2953        }
2954
2955        /// Sets all the options, replacing any prior values.
2956        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2957            self.0.options = v.into();
2958            self
2959        }
2960
2961        /// Sends the request.
2962        pub async fn send(self) -> Result<crate::model::ExternalApi> {
2963            (*self.0.stub)
2964                .get_external_api(self.0.request, self.0.options)
2965                .await
2966                .map(gax::response::Response::into_body)
2967        }
2968
2969        /// Sets the value of [name][crate::model::GetExternalApiRequest::name].
2970        ///
2971        /// This is a **required** field for requests.
2972        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2973            self.0.request.name = v.into();
2974            self
2975        }
2976    }
2977
2978    #[doc(hidden)]
2979    impl gax::options::internal::RequestBuilder for GetExternalApi {
2980        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2981            &mut self.0.options
2982        }
2983    }
2984
2985    /// The request builder for [ApiHub::update_external_api][crate::client::ApiHub::update_external_api] calls.
2986    ///
2987    /// # Example
2988    /// ```no_run
2989    /// # use google_cloud_apihub_v1::builder;
2990    /// use builder::api_hub::UpdateExternalApi;
2991    /// # tokio_test::block_on(async {
2992    ///
2993    /// let builder = prepare_request_builder();
2994    /// let response = builder.send().await?;
2995    /// # gax::Result::<()>::Ok(()) });
2996    ///
2997    /// fn prepare_request_builder() -> UpdateExternalApi {
2998    ///   # panic!();
2999    ///   // ... details omitted ...
3000    /// }
3001    /// ```
3002    #[derive(Clone, Debug)]
3003    pub struct UpdateExternalApi(RequestBuilder<crate::model::UpdateExternalApiRequest>);
3004
3005    impl UpdateExternalApi {
3006        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3007            Self(RequestBuilder::new(stub))
3008        }
3009
3010        /// Sets the full request, replacing any prior values.
3011        pub fn with_request<V: Into<crate::model::UpdateExternalApiRequest>>(
3012            mut self,
3013            v: V,
3014        ) -> Self {
3015            self.0.request = v.into();
3016            self
3017        }
3018
3019        /// Sets all the options, replacing any prior values.
3020        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3021            self.0.options = v.into();
3022            self
3023        }
3024
3025        /// Sends the request.
3026        pub async fn send(self) -> Result<crate::model::ExternalApi> {
3027            (*self.0.stub)
3028                .update_external_api(self.0.request, self.0.options)
3029                .await
3030                .map(gax::response::Response::into_body)
3031        }
3032
3033        /// Sets the value of [external_api][crate::model::UpdateExternalApiRequest::external_api].
3034        ///
3035        /// This is a **required** field for requests.
3036        pub fn set_external_api<T>(mut self, v: T) -> Self
3037        where
3038            T: std::convert::Into<crate::model::ExternalApi>,
3039        {
3040            self.0.request.external_api = std::option::Option::Some(v.into());
3041            self
3042        }
3043
3044        /// Sets or clears the value of [external_api][crate::model::UpdateExternalApiRequest::external_api].
3045        ///
3046        /// This is a **required** field for requests.
3047        pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
3048        where
3049            T: std::convert::Into<crate::model::ExternalApi>,
3050        {
3051            self.0.request.external_api = v.map(|x| x.into());
3052            self
3053        }
3054
3055        /// Sets the value of [update_mask][crate::model::UpdateExternalApiRequest::update_mask].
3056        ///
3057        /// This is a **required** field for requests.
3058        pub fn set_update_mask<T>(mut self, v: T) -> Self
3059        where
3060            T: std::convert::Into<wkt::FieldMask>,
3061        {
3062            self.0.request.update_mask = std::option::Option::Some(v.into());
3063            self
3064        }
3065
3066        /// Sets or clears the value of [update_mask][crate::model::UpdateExternalApiRequest::update_mask].
3067        ///
3068        /// This is a **required** field for requests.
3069        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3070        where
3071            T: std::convert::Into<wkt::FieldMask>,
3072        {
3073            self.0.request.update_mask = v.map(|x| x.into());
3074            self
3075        }
3076    }
3077
3078    #[doc(hidden)]
3079    impl gax::options::internal::RequestBuilder for UpdateExternalApi {
3080        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3081            &mut self.0.options
3082        }
3083    }
3084
3085    /// The request builder for [ApiHub::delete_external_api][crate::client::ApiHub::delete_external_api] calls.
3086    ///
3087    /// # Example
3088    /// ```no_run
3089    /// # use google_cloud_apihub_v1::builder;
3090    /// use builder::api_hub::DeleteExternalApi;
3091    /// # tokio_test::block_on(async {
3092    ///
3093    /// let builder = prepare_request_builder();
3094    /// let response = builder.send().await?;
3095    /// # gax::Result::<()>::Ok(()) });
3096    ///
3097    /// fn prepare_request_builder() -> DeleteExternalApi {
3098    ///   # panic!();
3099    ///   // ... details omitted ...
3100    /// }
3101    /// ```
3102    #[derive(Clone, Debug)]
3103    pub struct DeleteExternalApi(RequestBuilder<crate::model::DeleteExternalApiRequest>);
3104
3105    impl DeleteExternalApi {
3106        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3107            Self(RequestBuilder::new(stub))
3108        }
3109
3110        /// Sets the full request, replacing any prior values.
3111        pub fn with_request<V: Into<crate::model::DeleteExternalApiRequest>>(
3112            mut self,
3113            v: V,
3114        ) -> Self {
3115            self.0.request = v.into();
3116            self
3117        }
3118
3119        /// Sets all the options, replacing any prior values.
3120        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3121            self.0.options = v.into();
3122            self
3123        }
3124
3125        /// Sends the request.
3126        pub async fn send(self) -> Result<()> {
3127            (*self.0.stub)
3128                .delete_external_api(self.0.request, self.0.options)
3129                .await
3130                .map(gax::response::Response::into_body)
3131        }
3132
3133        /// Sets the value of [name][crate::model::DeleteExternalApiRequest::name].
3134        ///
3135        /// This is a **required** field for requests.
3136        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3137            self.0.request.name = v.into();
3138            self
3139        }
3140    }
3141
3142    #[doc(hidden)]
3143    impl gax::options::internal::RequestBuilder for DeleteExternalApi {
3144        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3145            &mut self.0.options
3146        }
3147    }
3148
3149    /// The request builder for [ApiHub::list_external_apis][crate::client::ApiHub::list_external_apis] calls.
3150    ///
3151    /// # Example
3152    /// ```no_run
3153    /// # use google_cloud_apihub_v1::builder;
3154    /// use builder::api_hub::ListExternalApis;
3155    /// # tokio_test::block_on(async {
3156    /// use gax::paginator::ItemPaginator;
3157    ///
3158    /// let builder = prepare_request_builder();
3159    /// let mut items = builder.by_item();
3160    /// while let Some(result) = items.next().await {
3161    ///   let item = result?;
3162    /// }
3163    /// # gax::Result::<()>::Ok(()) });
3164    ///
3165    /// fn prepare_request_builder() -> ListExternalApis {
3166    ///   # panic!();
3167    ///   // ... details omitted ...
3168    /// }
3169    /// ```
3170    #[derive(Clone, Debug)]
3171    pub struct ListExternalApis(RequestBuilder<crate::model::ListExternalApisRequest>);
3172
3173    impl ListExternalApis {
3174        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3175            Self(RequestBuilder::new(stub))
3176        }
3177
3178        /// Sets the full request, replacing any prior values.
3179        pub fn with_request<V: Into<crate::model::ListExternalApisRequest>>(
3180            mut self,
3181            v: V,
3182        ) -> Self {
3183            self.0.request = v.into();
3184            self
3185        }
3186
3187        /// Sets all the options, replacing any prior values.
3188        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3189            self.0.options = v.into();
3190            self
3191        }
3192
3193        /// Sends the request.
3194        pub async fn send(self) -> Result<crate::model::ListExternalApisResponse> {
3195            (*self.0.stub)
3196                .list_external_apis(self.0.request, self.0.options)
3197                .await
3198                .map(gax::response::Response::into_body)
3199        }
3200
3201        /// Streams each page in the collection.
3202        pub fn by_page(
3203            self,
3204        ) -> impl gax::paginator::Paginator<crate::model::ListExternalApisResponse, gax::error::Error>
3205        {
3206            use std::clone::Clone;
3207            let token = self.0.request.page_token.clone();
3208            let execute = move |token: String| {
3209                let mut builder = self.clone();
3210                builder.0.request = builder.0.request.set_page_token(token);
3211                builder.send()
3212            };
3213            gax::paginator::internal::new_paginator(token, execute)
3214        }
3215
3216        /// Streams each item in the collection.
3217        pub fn by_item(
3218            self,
3219        ) -> impl gax::paginator::ItemPaginator<crate::model::ListExternalApisResponse, gax::error::Error>
3220        {
3221            use gax::paginator::Paginator;
3222            self.by_page().items()
3223        }
3224
3225        /// Sets the value of [parent][crate::model::ListExternalApisRequest::parent].
3226        ///
3227        /// This is a **required** field for requests.
3228        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3229            self.0.request.parent = v.into();
3230            self
3231        }
3232
3233        /// Sets the value of [page_size][crate::model::ListExternalApisRequest::page_size].
3234        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3235            self.0.request.page_size = v.into();
3236            self
3237        }
3238
3239        /// Sets the value of [page_token][crate::model::ListExternalApisRequest::page_token].
3240        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3241            self.0.request.page_token = v.into();
3242            self
3243        }
3244    }
3245
3246    #[doc(hidden)]
3247    impl gax::options::internal::RequestBuilder for ListExternalApis {
3248        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3249            &mut self.0.options
3250        }
3251    }
3252
3253    /// The request builder for [ApiHub::list_locations][crate::client::ApiHub::list_locations] calls.
3254    ///
3255    /// # Example
3256    /// ```no_run
3257    /// # use google_cloud_apihub_v1::builder;
3258    /// use builder::api_hub::ListLocations;
3259    /// # tokio_test::block_on(async {
3260    /// use gax::paginator::ItemPaginator;
3261    ///
3262    /// let builder = prepare_request_builder();
3263    /// let mut items = builder.by_item();
3264    /// while let Some(result) = items.next().await {
3265    ///   let item = result?;
3266    /// }
3267    /// # gax::Result::<()>::Ok(()) });
3268    ///
3269    /// fn prepare_request_builder() -> ListLocations {
3270    ///   # panic!();
3271    ///   // ... details omitted ...
3272    /// }
3273    /// ```
3274    #[derive(Clone, Debug)]
3275    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3276
3277    impl ListLocations {
3278        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3279            Self(RequestBuilder::new(stub))
3280        }
3281
3282        /// Sets the full request, replacing any prior values.
3283        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3284            mut self,
3285            v: V,
3286        ) -> Self {
3287            self.0.request = v.into();
3288            self
3289        }
3290
3291        /// Sets all the options, replacing any prior values.
3292        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3293            self.0.options = v.into();
3294            self
3295        }
3296
3297        /// Sends the request.
3298        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3299            (*self.0.stub)
3300                .list_locations(self.0.request, self.0.options)
3301                .await
3302                .map(gax::response::Response::into_body)
3303        }
3304
3305        /// Streams each page in the collection.
3306        pub fn by_page(
3307            self,
3308        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3309        {
3310            use std::clone::Clone;
3311            let token = self.0.request.page_token.clone();
3312            let execute = move |token: String| {
3313                let mut builder = self.clone();
3314                builder.0.request = builder.0.request.set_page_token(token);
3315                builder.send()
3316            };
3317            gax::paginator::internal::new_paginator(token, execute)
3318        }
3319
3320        /// Streams each item in the collection.
3321        pub fn by_item(
3322            self,
3323        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3324        {
3325            use gax::paginator::Paginator;
3326            self.by_page().items()
3327        }
3328
3329        /// Sets the value of [name][location::model::ListLocationsRequest::name].
3330        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3331            self.0.request.name = v.into();
3332            self
3333        }
3334
3335        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
3336        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3337            self.0.request.filter = v.into();
3338            self
3339        }
3340
3341        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
3342        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3343            self.0.request.page_size = v.into();
3344            self
3345        }
3346
3347        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
3348        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3349            self.0.request.page_token = v.into();
3350            self
3351        }
3352    }
3353
3354    #[doc(hidden)]
3355    impl gax::options::internal::RequestBuilder for ListLocations {
3356        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3357            &mut self.0.options
3358        }
3359    }
3360
3361    /// The request builder for [ApiHub::get_location][crate::client::ApiHub::get_location] calls.
3362    ///
3363    /// # Example
3364    /// ```no_run
3365    /// # use google_cloud_apihub_v1::builder;
3366    /// use builder::api_hub::GetLocation;
3367    /// # tokio_test::block_on(async {
3368    ///
3369    /// let builder = prepare_request_builder();
3370    /// let response = builder.send().await?;
3371    /// # gax::Result::<()>::Ok(()) });
3372    ///
3373    /// fn prepare_request_builder() -> GetLocation {
3374    ///   # panic!();
3375    ///   // ... details omitted ...
3376    /// }
3377    /// ```
3378    #[derive(Clone, Debug)]
3379    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3380
3381    impl GetLocation {
3382        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3383            Self(RequestBuilder::new(stub))
3384        }
3385
3386        /// Sets the full request, replacing any prior values.
3387        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3388            self.0.request = v.into();
3389            self
3390        }
3391
3392        /// Sets all the options, replacing any prior values.
3393        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3394            self.0.options = v.into();
3395            self
3396        }
3397
3398        /// Sends the request.
3399        pub async fn send(self) -> Result<location::model::Location> {
3400            (*self.0.stub)
3401                .get_location(self.0.request, self.0.options)
3402                .await
3403                .map(gax::response::Response::into_body)
3404        }
3405
3406        /// Sets the value of [name][location::model::GetLocationRequest::name].
3407        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3408            self.0.request.name = v.into();
3409            self
3410        }
3411    }
3412
3413    #[doc(hidden)]
3414    impl gax::options::internal::RequestBuilder for GetLocation {
3415        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3416            &mut self.0.options
3417        }
3418    }
3419
3420    /// The request builder for [ApiHub::list_operations][crate::client::ApiHub::list_operations] calls.
3421    ///
3422    /// # Example
3423    /// ```no_run
3424    /// # use google_cloud_apihub_v1::builder;
3425    /// use builder::api_hub::ListOperations;
3426    /// # tokio_test::block_on(async {
3427    /// use gax::paginator::ItemPaginator;
3428    ///
3429    /// let builder = prepare_request_builder();
3430    /// let mut items = builder.by_item();
3431    /// while let Some(result) = items.next().await {
3432    ///   let item = result?;
3433    /// }
3434    /// # gax::Result::<()>::Ok(()) });
3435    ///
3436    /// fn prepare_request_builder() -> ListOperations {
3437    ///   # panic!();
3438    ///   // ... details omitted ...
3439    /// }
3440    /// ```
3441    #[derive(Clone, Debug)]
3442    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3443
3444    impl ListOperations {
3445        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3446            Self(RequestBuilder::new(stub))
3447        }
3448
3449        /// Sets the full request, replacing any prior values.
3450        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3451            mut self,
3452            v: V,
3453        ) -> Self {
3454            self.0.request = v.into();
3455            self
3456        }
3457
3458        /// Sets all the options, replacing any prior values.
3459        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3460            self.0.options = v.into();
3461            self
3462        }
3463
3464        /// Sends the request.
3465        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3466            (*self.0.stub)
3467                .list_operations(self.0.request, self.0.options)
3468                .await
3469                .map(gax::response::Response::into_body)
3470        }
3471
3472        /// Streams each page in the collection.
3473        pub fn by_page(
3474            self,
3475        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3476        {
3477            use std::clone::Clone;
3478            let token = self.0.request.page_token.clone();
3479            let execute = move |token: String| {
3480                let mut builder = self.clone();
3481                builder.0.request = builder.0.request.set_page_token(token);
3482                builder.send()
3483            };
3484            gax::paginator::internal::new_paginator(token, execute)
3485        }
3486
3487        /// Streams each item in the collection.
3488        pub fn by_item(
3489            self,
3490        ) -> impl gax::paginator::ItemPaginator<
3491            longrunning::model::ListOperationsResponse,
3492            gax::error::Error,
3493        > {
3494            use gax::paginator::Paginator;
3495            self.by_page().items()
3496        }
3497
3498        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
3499        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3500            self.0.request.name = v.into();
3501            self
3502        }
3503
3504        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
3505        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3506            self.0.request.filter = v.into();
3507            self
3508        }
3509
3510        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
3511        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3512            self.0.request.page_size = v.into();
3513            self
3514        }
3515
3516        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
3517        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3518            self.0.request.page_token = v.into();
3519            self
3520        }
3521
3522        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
3523        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3524            self.0.request.return_partial_success = v.into();
3525            self
3526        }
3527    }
3528
3529    #[doc(hidden)]
3530    impl gax::options::internal::RequestBuilder for ListOperations {
3531        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3532            &mut self.0.options
3533        }
3534    }
3535
3536    /// The request builder for [ApiHub::get_operation][crate::client::ApiHub::get_operation] calls.
3537    ///
3538    /// # Example
3539    /// ```no_run
3540    /// # use google_cloud_apihub_v1::builder;
3541    /// use builder::api_hub::GetOperation;
3542    /// # tokio_test::block_on(async {
3543    ///
3544    /// let builder = prepare_request_builder();
3545    /// let response = builder.send().await?;
3546    /// # gax::Result::<()>::Ok(()) });
3547    ///
3548    /// fn prepare_request_builder() -> GetOperation {
3549    ///   # panic!();
3550    ///   // ... details omitted ...
3551    /// }
3552    /// ```
3553    #[derive(Clone, Debug)]
3554    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3555
3556    impl GetOperation {
3557        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3558            Self(RequestBuilder::new(stub))
3559        }
3560
3561        /// Sets the full request, replacing any prior values.
3562        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3563            mut self,
3564            v: V,
3565        ) -> Self {
3566            self.0.request = v.into();
3567            self
3568        }
3569
3570        /// Sets all the options, replacing any prior values.
3571        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3572            self.0.options = v.into();
3573            self
3574        }
3575
3576        /// Sends the request.
3577        pub async fn send(self) -> Result<longrunning::model::Operation> {
3578            (*self.0.stub)
3579                .get_operation(self.0.request, self.0.options)
3580                .await
3581                .map(gax::response::Response::into_body)
3582        }
3583
3584        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
3585        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3586            self.0.request.name = v.into();
3587            self
3588        }
3589    }
3590
3591    #[doc(hidden)]
3592    impl gax::options::internal::RequestBuilder for GetOperation {
3593        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3594            &mut self.0.options
3595        }
3596    }
3597
3598    /// The request builder for [ApiHub::delete_operation][crate::client::ApiHub::delete_operation] calls.
3599    ///
3600    /// # Example
3601    /// ```no_run
3602    /// # use google_cloud_apihub_v1::builder;
3603    /// use builder::api_hub::DeleteOperation;
3604    /// # tokio_test::block_on(async {
3605    ///
3606    /// let builder = prepare_request_builder();
3607    /// let response = builder.send().await?;
3608    /// # gax::Result::<()>::Ok(()) });
3609    ///
3610    /// fn prepare_request_builder() -> DeleteOperation {
3611    ///   # panic!();
3612    ///   // ... details omitted ...
3613    /// }
3614    /// ```
3615    #[derive(Clone, Debug)]
3616    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3617
3618    impl DeleteOperation {
3619        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3620            Self(RequestBuilder::new(stub))
3621        }
3622
3623        /// Sets the full request, replacing any prior values.
3624        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3625            mut self,
3626            v: V,
3627        ) -> Self {
3628            self.0.request = v.into();
3629            self
3630        }
3631
3632        /// Sets all the options, replacing any prior values.
3633        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3634            self.0.options = v.into();
3635            self
3636        }
3637
3638        /// Sends the request.
3639        pub async fn send(self) -> Result<()> {
3640            (*self.0.stub)
3641                .delete_operation(self.0.request, self.0.options)
3642                .await
3643                .map(gax::response::Response::into_body)
3644        }
3645
3646        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
3647        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3648            self.0.request.name = v.into();
3649            self
3650        }
3651    }
3652
3653    #[doc(hidden)]
3654    impl gax::options::internal::RequestBuilder for DeleteOperation {
3655        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3656            &mut self.0.options
3657        }
3658    }
3659
3660    /// The request builder for [ApiHub::cancel_operation][crate::client::ApiHub::cancel_operation] calls.
3661    ///
3662    /// # Example
3663    /// ```no_run
3664    /// # use google_cloud_apihub_v1::builder;
3665    /// use builder::api_hub::CancelOperation;
3666    /// # tokio_test::block_on(async {
3667    ///
3668    /// let builder = prepare_request_builder();
3669    /// let response = builder.send().await?;
3670    /// # gax::Result::<()>::Ok(()) });
3671    ///
3672    /// fn prepare_request_builder() -> CancelOperation {
3673    ///   # panic!();
3674    ///   // ... details omitted ...
3675    /// }
3676    /// ```
3677    #[derive(Clone, Debug)]
3678    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3679
3680    impl CancelOperation {
3681        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3682            Self(RequestBuilder::new(stub))
3683        }
3684
3685        /// Sets the full request, replacing any prior values.
3686        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3687            mut self,
3688            v: V,
3689        ) -> Self {
3690            self.0.request = v.into();
3691            self
3692        }
3693
3694        /// Sets all the options, replacing any prior values.
3695        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3696            self.0.options = v.into();
3697            self
3698        }
3699
3700        /// Sends the request.
3701        pub async fn send(self) -> Result<()> {
3702            (*self.0.stub)
3703                .cancel_operation(self.0.request, self.0.options)
3704                .await
3705                .map(gax::response::Response::into_body)
3706        }
3707
3708        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
3709        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3710            self.0.request.name = v.into();
3711            self
3712        }
3713    }
3714
3715    #[doc(hidden)]
3716    impl gax::options::internal::RequestBuilder for CancelOperation {
3717        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3718            &mut self.0.options
3719        }
3720    }
3721}
3722
3723pub mod api_hub_dependencies {
3724    use crate::Result;
3725
3726    /// A builder for [ApiHubDependencies][crate::client::ApiHubDependencies].
3727    ///
3728    /// ```
3729    /// # tokio_test::block_on(async {
3730    /// # use google_cloud_apihub_v1::*;
3731    /// # use builder::api_hub_dependencies::ClientBuilder;
3732    /// # use client::ApiHubDependencies;
3733    /// let builder : ClientBuilder = ApiHubDependencies::builder();
3734    /// let client = builder
3735    ///     .with_endpoint("https://apihub.googleapis.com")
3736    ///     .build().await?;
3737    /// # gax::client_builder::Result::<()>::Ok(()) });
3738    /// ```
3739    pub type ClientBuilder =
3740        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3741
3742    pub(crate) mod client {
3743        use super::super::super::client::ApiHubDependencies;
3744        pub struct Factory;
3745        impl gax::client_builder::internal::ClientFactory for Factory {
3746            type Client = ApiHubDependencies;
3747            type Credentials = gaxi::options::Credentials;
3748            async fn build(
3749                self,
3750                config: gaxi::options::ClientConfig,
3751            ) -> gax::client_builder::Result<Self::Client> {
3752                Self::Client::new(config).await
3753            }
3754        }
3755    }
3756
3757    /// Common implementation for [crate::client::ApiHubDependencies] request builders.
3758    #[derive(Clone, Debug)]
3759    pub(crate) struct RequestBuilder<R: std::default::Default> {
3760        stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3761        request: R,
3762        options: gax::options::RequestOptions,
3763    }
3764
3765    impl<R> RequestBuilder<R>
3766    where
3767        R: std::default::Default,
3768    {
3769        pub(crate) fn new(
3770            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3771        ) -> Self {
3772            Self {
3773                stub,
3774                request: R::default(),
3775                options: gax::options::RequestOptions::default(),
3776            }
3777        }
3778    }
3779
3780    /// The request builder for [ApiHubDependencies::create_dependency][crate::client::ApiHubDependencies::create_dependency] calls.
3781    ///
3782    /// # Example
3783    /// ```no_run
3784    /// # use google_cloud_apihub_v1::builder;
3785    /// use builder::api_hub_dependencies::CreateDependency;
3786    /// # tokio_test::block_on(async {
3787    ///
3788    /// let builder = prepare_request_builder();
3789    /// let response = builder.send().await?;
3790    /// # gax::Result::<()>::Ok(()) });
3791    ///
3792    /// fn prepare_request_builder() -> CreateDependency {
3793    ///   # panic!();
3794    ///   // ... details omitted ...
3795    /// }
3796    /// ```
3797    #[derive(Clone, Debug)]
3798    pub struct CreateDependency(RequestBuilder<crate::model::CreateDependencyRequest>);
3799
3800    impl CreateDependency {
3801        pub(crate) fn new(
3802            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3803        ) -> Self {
3804            Self(RequestBuilder::new(stub))
3805        }
3806
3807        /// Sets the full request, replacing any prior values.
3808        pub fn with_request<V: Into<crate::model::CreateDependencyRequest>>(
3809            mut self,
3810            v: V,
3811        ) -> Self {
3812            self.0.request = v.into();
3813            self
3814        }
3815
3816        /// Sets all the options, replacing any prior values.
3817        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3818            self.0.options = v.into();
3819            self
3820        }
3821
3822        /// Sends the request.
3823        pub async fn send(self) -> Result<crate::model::Dependency> {
3824            (*self.0.stub)
3825                .create_dependency(self.0.request, self.0.options)
3826                .await
3827                .map(gax::response::Response::into_body)
3828        }
3829
3830        /// Sets the value of [parent][crate::model::CreateDependencyRequest::parent].
3831        ///
3832        /// This is a **required** field for requests.
3833        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3834            self.0.request.parent = v.into();
3835            self
3836        }
3837
3838        /// Sets the value of [dependency_id][crate::model::CreateDependencyRequest::dependency_id].
3839        pub fn set_dependency_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3840            self.0.request.dependency_id = v.into();
3841            self
3842        }
3843
3844        /// Sets the value of [dependency][crate::model::CreateDependencyRequest::dependency].
3845        ///
3846        /// This is a **required** field for requests.
3847        pub fn set_dependency<T>(mut self, v: T) -> Self
3848        where
3849            T: std::convert::Into<crate::model::Dependency>,
3850        {
3851            self.0.request.dependency = std::option::Option::Some(v.into());
3852            self
3853        }
3854
3855        /// Sets or clears the value of [dependency][crate::model::CreateDependencyRequest::dependency].
3856        ///
3857        /// This is a **required** field for requests.
3858        pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
3859        where
3860            T: std::convert::Into<crate::model::Dependency>,
3861        {
3862            self.0.request.dependency = v.map(|x| x.into());
3863            self
3864        }
3865    }
3866
3867    #[doc(hidden)]
3868    impl gax::options::internal::RequestBuilder for CreateDependency {
3869        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3870            &mut self.0.options
3871        }
3872    }
3873
3874    /// The request builder for [ApiHubDependencies::get_dependency][crate::client::ApiHubDependencies::get_dependency] calls.
3875    ///
3876    /// # Example
3877    /// ```no_run
3878    /// # use google_cloud_apihub_v1::builder;
3879    /// use builder::api_hub_dependencies::GetDependency;
3880    /// # tokio_test::block_on(async {
3881    ///
3882    /// let builder = prepare_request_builder();
3883    /// let response = builder.send().await?;
3884    /// # gax::Result::<()>::Ok(()) });
3885    ///
3886    /// fn prepare_request_builder() -> GetDependency {
3887    ///   # panic!();
3888    ///   // ... details omitted ...
3889    /// }
3890    /// ```
3891    #[derive(Clone, Debug)]
3892    pub struct GetDependency(RequestBuilder<crate::model::GetDependencyRequest>);
3893
3894    impl GetDependency {
3895        pub(crate) fn new(
3896            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3897        ) -> Self {
3898            Self(RequestBuilder::new(stub))
3899        }
3900
3901        /// Sets the full request, replacing any prior values.
3902        pub fn with_request<V: Into<crate::model::GetDependencyRequest>>(mut self, v: V) -> Self {
3903            self.0.request = v.into();
3904            self
3905        }
3906
3907        /// Sets all the options, replacing any prior values.
3908        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3909            self.0.options = v.into();
3910            self
3911        }
3912
3913        /// Sends the request.
3914        pub async fn send(self) -> Result<crate::model::Dependency> {
3915            (*self.0.stub)
3916                .get_dependency(self.0.request, self.0.options)
3917                .await
3918                .map(gax::response::Response::into_body)
3919        }
3920
3921        /// Sets the value of [name][crate::model::GetDependencyRequest::name].
3922        ///
3923        /// This is a **required** field for requests.
3924        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3925            self.0.request.name = v.into();
3926            self
3927        }
3928    }
3929
3930    #[doc(hidden)]
3931    impl gax::options::internal::RequestBuilder for GetDependency {
3932        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3933            &mut self.0.options
3934        }
3935    }
3936
3937    /// The request builder for [ApiHubDependencies::update_dependency][crate::client::ApiHubDependencies::update_dependency] calls.
3938    ///
3939    /// # Example
3940    /// ```no_run
3941    /// # use google_cloud_apihub_v1::builder;
3942    /// use builder::api_hub_dependencies::UpdateDependency;
3943    /// # tokio_test::block_on(async {
3944    ///
3945    /// let builder = prepare_request_builder();
3946    /// let response = builder.send().await?;
3947    /// # gax::Result::<()>::Ok(()) });
3948    ///
3949    /// fn prepare_request_builder() -> UpdateDependency {
3950    ///   # panic!();
3951    ///   // ... details omitted ...
3952    /// }
3953    /// ```
3954    #[derive(Clone, Debug)]
3955    pub struct UpdateDependency(RequestBuilder<crate::model::UpdateDependencyRequest>);
3956
3957    impl UpdateDependency {
3958        pub(crate) fn new(
3959            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3960        ) -> Self {
3961            Self(RequestBuilder::new(stub))
3962        }
3963
3964        /// Sets the full request, replacing any prior values.
3965        pub fn with_request<V: Into<crate::model::UpdateDependencyRequest>>(
3966            mut self,
3967            v: V,
3968        ) -> Self {
3969            self.0.request = v.into();
3970            self
3971        }
3972
3973        /// Sets all the options, replacing any prior values.
3974        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3975            self.0.options = v.into();
3976            self
3977        }
3978
3979        /// Sends the request.
3980        pub async fn send(self) -> Result<crate::model::Dependency> {
3981            (*self.0.stub)
3982                .update_dependency(self.0.request, self.0.options)
3983                .await
3984                .map(gax::response::Response::into_body)
3985        }
3986
3987        /// Sets the value of [dependency][crate::model::UpdateDependencyRequest::dependency].
3988        ///
3989        /// This is a **required** field for requests.
3990        pub fn set_dependency<T>(mut self, v: T) -> Self
3991        where
3992            T: std::convert::Into<crate::model::Dependency>,
3993        {
3994            self.0.request.dependency = std::option::Option::Some(v.into());
3995            self
3996        }
3997
3998        /// Sets or clears the value of [dependency][crate::model::UpdateDependencyRequest::dependency].
3999        ///
4000        /// This is a **required** field for requests.
4001        pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
4002        where
4003            T: std::convert::Into<crate::model::Dependency>,
4004        {
4005            self.0.request.dependency = v.map(|x| x.into());
4006            self
4007        }
4008
4009        /// Sets the value of [update_mask][crate::model::UpdateDependencyRequest::update_mask].
4010        ///
4011        /// This is a **required** field for requests.
4012        pub fn set_update_mask<T>(mut self, v: T) -> Self
4013        where
4014            T: std::convert::Into<wkt::FieldMask>,
4015        {
4016            self.0.request.update_mask = std::option::Option::Some(v.into());
4017            self
4018        }
4019
4020        /// Sets or clears the value of [update_mask][crate::model::UpdateDependencyRequest::update_mask].
4021        ///
4022        /// This is a **required** field for requests.
4023        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4024        where
4025            T: std::convert::Into<wkt::FieldMask>,
4026        {
4027            self.0.request.update_mask = v.map(|x| x.into());
4028            self
4029        }
4030    }
4031
4032    #[doc(hidden)]
4033    impl gax::options::internal::RequestBuilder for UpdateDependency {
4034        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4035            &mut self.0.options
4036        }
4037    }
4038
4039    /// The request builder for [ApiHubDependencies::delete_dependency][crate::client::ApiHubDependencies::delete_dependency] calls.
4040    ///
4041    /// # Example
4042    /// ```no_run
4043    /// # use google_cloud_apihub_v1::builder;
4044    /// use builder::api_hub_dependencies::DeleteDependency;
4045    /// # tokio_test::block_on(async {
4046    ///
4047    /// let builder = prepare_request_builder();
4048    /// let response = builder.send().await?;
4049    /// # gax::Result::<()>::Ok(()) });
4050    ///
4051    /// fn prepare_request_builder() -> DeleteDependency {
4052    ///   # panic!();
4053    ///   // ... details omitted ...
4054    /// }
4055    /// ```
4056    #[derive(Clone, Debug)]
4057    pub struct DeleteDependency(RequestBuilder<crate::model::DeleteDependencyRequest>);
4058
4059    impl DeleteDependency {
4060        pub(crate) fn new(
4061            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4062        ) -> Self {
4063            Self(RequestBuilder::new(stub))
4064        }
4065
4066        /// Sets the full request, replacing any prior values.
4067        pub fn with_request<V: Into<crate::model::DeleteDependencyRequest>>(
4068            mut self,
4069            v: V,
4070        ) -> Self {
4071            self.0.request = v.into();
4072            self
4073        }
4074
4075        /// Sets all the options, replacing any prior values.
4076        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4077            self.0.options = v.into();
4078            self
4079        }
4080
4081        /// Sends the request.
4082        pub async fn send(self) -> Result<()> {
4083            (*self.0.stub)
4084                .delete_dependency(self.0.request, self.0.options)
4085                .await
4086                .map(gax::response::Response::into_body)
4087        }
4088
4089        /// Sets the value of [name][crate::model::DeleteDependencyRequest::name].
4090        ///
4091        /// This is a **required** field for requests.
4092        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4093            self.0.request.name = v.into();
4094            self
4095        }
4096    }
4097
4098    #[doc(hidden)]
4099    impl gax::options::internal::RequestBuilder for DeleteDependency {
4100        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4101            &mut self.0.options
4102        }
4103    }
4104
4105    /// The request builder for [ApiHubDependencies::list_dependencies][crate::client::ApiHubDependencies::list_dependencies] calls.
4106    ///
4107    /// # Example
4108    /// ```no_run
4109    /// # use google_cloud_apihub_v1::builder;
4110    /// use builder::api_hub_dependencies::ListDependencies;
4111    /// # tokio_test::block_on(async {
4112    /// use gax::paginator::ItemPaginator;
4113    ///
4114    /// let builder = prepare_request_builder();
4115    /// let mut items = builder.by_item();
4116    /// while let Some(result) = items.next().await {
4117    ///   let item = result?;
4118    /// }
4119    /// # gax::Result::<()>::Ok(()) });
4120    ///
4121    /// fn prepare_request_builder() -> ListDependencies {
4122    ///   # panic!();
4123    ///   // ... details omitted ...
4124    /// }
4125    /// ```
4126    #[derive(Clone, Debug)]
4127    pub struct ListDependencies(RequestBuilder<crate::model::ListDependenciesRequest>);
4128
4129    impl ListDependencies {
4130        pub(crate) fn new(
4131            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4132        ) -> Self {
4133            Self(RequestBuilder::new(stub))
4134        }
4135
4136        /// Sets the full request, replacing any prior values.
4137        pub fn with_request<V: Into<crate::model::ListDependenciesRequest>>(
4138            mut self,
4139            v: V,
4140        ) -> Self {
4141            self.0.request = v.into();
4142            self
4143        }
4144
4145        /// Sets all the options, replacing any prior values.
4146        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4147            self.0.options = v.into();
4148            self
4149        }
4150
4151        /// Sends the request.
4152        pub async fn send(self) -> Result<crate::model::ListDependenciesResponse> {
4153            (*self.0.stub)
4154                .list_dependencies(self.0.request, self.0.options)
4155                .await
4156                .map(gax::response::Response::into_body)
4157        }
4158
4159        /// Streams each page in the collection.
4160        pub fn by_page(
4161            self,
4162        ) -> impl gax::paginator::Paginator<crate::model::ListDependenciesResponse, gax::error::Error>
4163        {
4164            use std::clone::Clone;
4165            let token = self.0.request.page_token.clone();
4166            let execute = move |token: String| {
4167                let mut builder = self.clone();
4168                builder.0.request = builder.0.request.set_page_token(token);
4169                builder.send()
4170            };
4171            gax::paginator::internal::new_paginator(token, execute)
4172        }
4173
4174        /// Streams each item in the collection.
4175        pub fn by_item(
4176            self,
4177        ) -> impl gax::paginator::ItemPaginator<crate::model::ListDependenciesResponse, gax::error::Error>
4178        {
4179            use gax::paginator::Paginator;
4180            self.by_page().items()
4181        }
4182
4183        /// Sets the value of [parent][crate::model::ListDependenciesRequest::parent].
4184        ///
4185        /// This is a **required** field for requests.
4186        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4187            self.0.request.parent = v.into();
4188            self
4189        }
4190
4191        /// Sets the value of [filter][crate::model::ListDependenciesRequest::filter].
4192        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4193            self.0.request.filter = v.into();
4194            self
4195        }
4196
4197        /// Sets the value of [page_size][crate::model::ListDependenciesRequest::page_size].
4198        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4199            self.0.request.page_size = v.into();
4200            self
4201        }
4202
4203        /// Sets the value of [page_token][crate::model::ListDependenciesRequest::page_token].
4204        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4205            self.0.request.page_token = v.into();
4206            self
4207        }
4208    }
4209
4210    #[doc(hidden)]
4211    impl gax::options::internal::RequestBuilder for ListDependencies {
4212        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4213            &mut self.0.options
4214        }
4215    }
4216
4217    /// The request builder for [ApiHubDependencies::list_locations][crate::client::ApiHubDependencies::list_locations] calls.
4218    ///
4219    /// # Example
4220    /// ```no_run
4221    /// # use google_cloud_apihub_v1::builder;
4222    /// use builder::api_hub_dependencies::ListLocations;
4223    /// # tokio_test::block_on(async {
4224    /// use gax::paginator::ItemPaginator;
4225    ///
4226    /// let builder = prepare_request_builder();
4227    /// let mut items = builder.by_item();
4228    /// while let Some(result) = items.next().await {
4229    ///   let item = result?;
4230    /// }
4231    /// # gax::Result::<()>::Ok(()) });
4232    ///
4233    /// fn prepare_request_builder() -> ListLocations {
4234    ///   # panic!();
4235    ///   // ... details omitted ...
4236    /// }
4237    /// ```
4238    #[derive(Clone, Debug)]
4239    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4240
4241    impl ListLocations {
4242        pub(crate) fn new(
4243            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4244        ) -> Self {
4245            Self(RequestBuilder::new(stub))
4246        }
4247
4248        /// Sets the full request, replacing any prior values.
4249        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4250            mut self,
4251            v: V,
4252        ) -> Self {
4253            self.0.request = v.into();
4254            self
4255        }
4256
4257        /// Sets all the options, replacing any prior values.
4258        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4259            self.0.options = v.into();
4260            self
4261        }
4262
4263        /// Sends the request.
4264        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4265            (*self.0.stub)
4266                .list_locations(self.0.request, self.0.options)
4267                .await
4268                .map(gax::response::Response::into_body)
4269        }
4270
4271        /// Streams each page in the collection.
4272        pub fn by_page(
4273            self,
4274        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4275        {
4276            use std::clone::Clone;
4277            let token = self.0.request.page_token.clone();
4278            let execute = move |token: String| {
4279                let mut builder = self.clone();
4280                builder.0.request = builder.0.request.set_page_token(token);
4281                builder.send()
4282            };
4283            gax::paginator::internal::new_paginator(token, execute)
4284        }
4285
4286        /// Streams each item in the collection.
4287        pub fn by_item(
4288            self,
4289        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4290        {
4291            use gax::paginator::Paginator;
4292            self.by_page().items()
4293        }
4294
4295        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4296        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4297            self.0.request.name = v.into();
4298            self
4299        }
4300
4301        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4302        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4303            self.0.request.filter = v.into();
4304            self
4305        }
4306
4307        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4308        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4309            self.0.request.page_size = v.into();
4310            self
4311        }
4312
4313        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
4314        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4315            self.0.request.page_token = v.into();
4316            self
4317        }
4318    }
4319
4320    #[doc(hidden)]
4321    impl gax::options::internal::RequestBuilder for ListLocations {
4322        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4323            &mut self.0.options
4324        }
4325    }
4326
4327    /// The request builder for [ApiHubDependencies::get_location][crate::client::ApiHubDependencies::get_location] calls.
4328    ///
4329    /// # Example
4330    /// ```no_run
4331    /// # use google_cloud_apihub_v1::builder;
4332    /// use builder::api_hub_dependencies::GetLocation;
4333    /// # tokio_test::block_on(async {
4334    ///
4335    /// let builder = prepare_request_builder();
4336    /// let response = builder.send().await?;
4337    /// # gax::Result::<()>::Ok(()) });
4338    ///
4339    /// fn prepare_request_builder() -> GetLocation {
4340    ///   # panic!();
4341    ///   // ... details omitted ...
4342    /// }
4343    /// ```
4344    #[derive(Clone, Debug)]
4345    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4346
4347    impl GetLocation {
4348        pub(crate) fn new(
4349            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4350        ) -> Self {
4351            Self(RequestBuilder::new(stub))
4352        }
4353
4354        /// Sets the full request, replacing any prior values.
4355        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4356            self.0.request = v.into();
4357            self
4358        }
4359
4360        /// Sets all the options, replacing any prior values.
4361        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4362            self.0.options = v.into();
4363            self
4364        }
4365
4366        /// Sends the request.
4367        pub async fn send(self) -> Result<location::model::Location> {
4368            (*self.0.stub)
4369                .get_location(self.0.request, self.0.options)
4370                .await
4371                .map(gax::response::Response::into_body)
4372        }
4373
4374        /// Sets the value of [name][location::model::GetLocationRequest::name].
4375        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4376            self.0.request.name = v.into();
4377            self
4378        }
4379    }
4380
4381    #[doc(hidden)]
4382    impl gax::options::internal::RequestBuilder for GetLocation {
4383        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4384            &mut self.0.options
4385        }
4386    }
4387
4388    /// The request builder for [ApiHubDependencies::list_operations][crate::client::ApiHubDependencies::list_operations] calls.
4389    ///
4390    /// # Example
4391    /// ```no_run
4392    /// # use google_cloud_apihub_v1::builder;
4393    /// use builder::api_hub_dependencies::ListOperations;
4394    /// # tokio_test::block_on(async {
4395    /// use gax::paginator::ItemPaginator;
4396    ///
4397    /// let builder = prepare_request_builder();
4398    /// let mut items = builder.by_item();
4399    /// while let Some(result) = items.next().await {
4400    ///   let item = result?;
4401    /// }
4402    /// # gax::Result::<()>::Ok(()) });
4403    ///
4404    /// fn prepare_request_builder() -> ListOperations {
4405    ///   # panic!();
4406    ///   // ... details omitted ...
4407    /// }
4408    /// ```
4409    #[derive(Clone, Debug)]
4410    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4411
4412    impl ListOperations {
4413        pub(crate) fn new(
4414            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4415        ) -> Self {
4416            Self(RequestBuilder::new(stub))
4417        }
4418
4419        /// Sets the full request, replacing any prior values.
4420        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4421            mut self,
4422            v: V,
4423        ) -> Self {
4424            self.0.request = v.into();
4425            self
4426        }
4427
4428        /// Sets all the options, replacing any prior values.
4429        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4430            self.0.options = v.into();
4431            self
4432        }
4433
4434        /// Sends the request.
4435        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4436            (*self.0.stub)
4437                .list_operations(self.0.request, self.0.options)
4438                .await
4439                .map(gax::response::Response::into_body)
4440        }
4441
4442        /// Streams each page in the collection.
4443        pub fn by_page(
4444            self,
4445        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4446        {
4447            use std::clone::Clone;
4448            let token = self.0.request.page_token.clone();
4449            let execute = move |token: String| {
4450                let mut builder = self.clone();
4451                builder.0.request = builder.0.request.set_page_token(token);
4452                builder.send()
4453            };
4454            gax::paginator::internal::new_paginator(token, execute)
4455        }
4456
4457        /// Streams each item in the collection.
4458        pub fn by_item(
4459            self,
4460        ) -> impl gax::paginator::ItemPaginator<
4461            longrunning::model::ListOperationsResponse,
4462            gax::error::Error,
4463        > {
4464            use gax::paginator::Paginator;
4465            self.by_page().items()
4466        }
4467
4468        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4469        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4470            self.0.request.name = v.into();
4471            self
4472        }
4473
4474        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4475        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4476            self.0.request.filter = v.into();
4477            self
4478        }
4479
4480        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4481        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4482            self.0.request.page_size = v.into();
4483            self
4484        }
4485
4486        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4487        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4488            self.0.request.page_token = v.into();
4489            self
4490        }
4491
4492        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
4493        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4494            self.0.request.return_partial_success = v.into();
4495            self
4496        }
4497    }
4498
4499    #[doc(hidden)]
4500    impl gax::options::internal::RequestBuilder for ListOperations {
4501        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4502            &mut self.0.options
4503        }
4504    }
4505
4506    /// The request builder for [ApiHubDependencies::get_operation][crate::client::ApiHubDependencies::get_operation] calls.
4507    ///
4508    /// # Example
4509    /// ```no_run
4510    /// # use google_cloud_apihub_v1::builder;
4511    /// use builder::api_hub_dependencies::GetOperation;
4512    /// # tokio_test::block_on(async {
4513    ///
4514    /// let builder = prepare_request_builder();
4515    /// let response = builder.send().await?;
4516    /// # gax::Result::<()>::Ok(()) });
4517    ///
4518    /// fn prepare_request_builder() -> GetOperation {
4519    ///   # panic!();
4520    ///   // ... details omitted ...
4521    /// }
4522    /// ```
4523    #[derive(Clone, Debug)]
4524    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4525
4526    impl GetOperation {
4527        pub(crate) fn new(
4528            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4529        ) -> Self {
4530            Self(RequestBuilder::new(stub))
4531        }
4532
4533        /// Sets the full request, replacing any prior values.
4534        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4535            mut self,
4536            v: V,
4537        ) -> Self {
4538            self.0.request = v.into();
4539            self
4540        }
4541
4542        /// Sets all the options, replacing any prior values.
4543        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4544            self.0.options = v.into();
4545            self
4546        }
4547
4548        /// Sends the request.
4549        pub async fn send(self) -> Result<longrunning::model::Operation> {
4550            (*self.0.stub)
4551                .get_operation(self.0.request, self.0.options)
4552                .await
4553                .map(gax::response::Response::into_body)
4554        }
4555
4556        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
4557        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4558            self.0.request.name = v.into();
4559            self
4560        }
4561    }
4562
4563    #[doc(hidden)]
4564    impl gax::options::internal::RequestBuilder for GetOperation {
4565        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4566            &mut self.0.options
4567        }
4568    }
4569
4570    /// The request builder for [ApiHubDependencies::delete_operation][crate::client::ApiHubDependencies::delete_operation] calls.
4571    ///
4572    /// # Example
4573    /// ```no_run
4574    /// # use google_cloud_apihub_v1::builder;
4575    /// use builder::api_hub_dependencies::DeleteOperation;
4576    /// # tokio_test::block_on(async {
4577    ///
4578    /// let builder = prepare_request_builder();
4579    /// let response = builder.send().await?;
4580    /// # gax::Result::<()>::Ok(()) });
4581    ///
4582    /// fn prepare_request_builder() -> DeleteOperation {
4583    ///   # panic!();
4584    ///   // ... details omitted ...
4585    /// }
4586    /// ```
4587    #[derive(Clone, Debug)]
4588    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4589
4590    impl DeleteOperation {
4591        pub(crate) fn new(
4592            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4593        ) -> Self {
4594            Self(RequestBuilder::new(stub))
4595        }
4596
4597        /// Sets the full request, replacing any prior values.
4598        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4599            mut self,
4600            v: V,
4601        ) -> Self {
4602            self.0.request = v.into();
4603            self
4604        }
4605
4606        /// Sets all the options, replacing any prior values.
4607        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4608            self.0.options = v.into();
4609            self
4610        }
4611
4612        /// Sends the request.
4613        pub async fn send(self) -> Result<()> {
4614            (*self.0.stub)
4615                .delete_operation(self.0.request, self.0.options)
4616                .await
4617                .map(gax::response::Response::into_body)
4618        }
4619
4620        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
4621        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4622            self.0.request.name = v.into();
4623            self
4624        }
4625    }
4626
4627    #[doc(hidden)]
4628    impl gax::options::internal::RequestBuilder for DeleteOperation {
4629        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4630            &mut self.0.options
4631        }
4632    }
4633
4634    /// The request builder for [ApiHubDependencies::cancel_operation][crate::client::ApiHubDependencies::cancel_operation] calls.
4635    ///
4636    /// # Example
4637    /// ```no_run
4638    /// # use google_cloud_apihub_v1::builder;
4639    /// use builder::api_hub_dependencies::CancelOperation;
4640    /// # tokio_test::block_on(async {
4641    ///
4642    /// let builder = prepare_request_builder();
4643    /// let response = builder.send().await?;
4644    /// # gax::Result::<()>::Ok(()) });
4645    ///
4646    /// fn prepare_request_builder() -> CancelOperation {
4647    ///   # panic!();
4648    ///   // ... details omitted ...
4649    /// }
4650    /// ```
4651    #[derive(Clone, Debug)]
4652    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4653
4654    impl CancelOperation {
4655        pub(crate) fn new(
4656            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4657        ) -> Self {
4658            Self(RequestBuilder::new(stub))
4659        }
4660
4661        /// Sets the full request, replacing any prior values.
4662        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4663            mut self,
4664            v: V,
4665        ) -> Self {
4666            self.0.request = v.into();
4667            self
4668        }
4669
4670        /// Sets all the options, replacing any prior values.
4671        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4672            self.0.options = v.into();
4673            self
4674        }
4675
4676        /// Sends the request.
4677        pub async fn send(self) -> Result<()> {
4678            (*self.0.stub)
4679                .cancel_operation(self.0.request, self.0.options)
4680                .await
4681                .map(gax::response::Response::into_body)
4682        }
4683
4684        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
4685        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4686            self.0.request.name = v.into();
4687            self
4688        }
4689    }
4690
4691    #[doc(hidden)]
4692    impl gax::options::internal::RequestBuilder for CancelOperation {
4693        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4694            &mut self.0.options
4695        }
4696    }
4697}
4698
4699pub mod api_hub_collect {
4700    use crate::Result;
4701
4702    /// A builder for [ApiHubCollect][crate::client::ApiHubCollect].
4703    ///
4704    /// ```
4705    /// # tokio_test::block_on(async {
4706    /// # use google_cloud_apihub_v1::*;
4707    /// # use builder::api_hub_collect::ClientBuilder;
4708    /// # use client::ApiHubCollect;
4709    /// let builder : ClientBuilder = ApiHubCollect::builder();
4710    /// let client = builder
4711    ///     .with_endpoint("https://apihub.googleapis.com")
4712    ///     .build().await?;
4713    /// # gax::client_builder::Result::<()>::Ok(()) });
4714    /// ```
4715    pub type ClientBuilder =
4716        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4717
4718    pub(crate) mod client {
4719        use super::super::super::client::ApiHubCollect;
4720        pub struct Factory;
4721        impl gax::client_builder::internal::ClientFactory for Factory {
4722            type Client = ApiHubCollect;
4723            type Credentials = gaxi::options::Credentials;
4724            async fn build(
4725                self,
4726                config: gaxi::options::ClientConfig,
4727            ) -> gax::client_builder::Result<Self::Client> {
4728                Self::Client::new(config).await
4729            }
4730        }
4731    }
4732
4733    /// Common implementation for [crate::client::ApiHubCollect] request builders.
4734    #[derive(Clone, Debug)]
4735    pub(crate) struct RequestBuilder<R: std::default::Default> {
4736        stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
4737        request: R,
4738        options: gax::options::RequestOptions,
4739    }
4740
4741    impl<R> RequestBuilder<R>
4742    where
4743        R: std::default::Default,
4744    {
4745        pub(crate) fn new(
4746            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
4747        ) -> Self {
4748            Self {
4749                stub,
4750                request: R::default(),
4751                options: gax::options::RequestOptions::default(),
4752            }
4753        }
4754    }
4755
4756    /// The request builder for [ApiHubCollect::collect_api_data][crate::client::ApiHubCollect::collect_api_data] calls.
4757    ///
4758    /// # Example
4759    /// ```no_run
4760    /// # use google_cloud_apihub_v1::builder;
4761    /// use builder::api_hub_collect::CollectApiData;
4762    /// # tokio_test::block_on(async {
4763    /// use lro::Poller;
4764    ///
4765    /// let builder = prepare_request_builder();
4766    /// let response = builder.poller().until_done().await?;
4767    /// # gax::Result::<()>::Ok(()) });
4768    ///
4769    /// fn prepare_request_builder() -> CollectApiData {
4770    ///   # panic!();
4771    ///   // ... details omitted ...
4772    /// }
4773    /// ```
4774    #[derive(Clone, Debug)]
4775    pub struct CollectApiData(RequestBuilder<crate::model::CollectApiDataRequest>);
4776
4777    impl CollectApiData {
4778        pub(crate) fn new(
4779            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
4780        ) -> Self {
4781            Self(RequestBuilder::new(stub))
4782        }
4783
4784        /// Sets the full request, replacing any prior values.
4785        pub fn with_request<V: Into<crate::model::CollectApiDataRequest>>(mut self, v: V) -> Self {
4786            self.0.request = v.into();
4787            self
4788        }
4789
4790        /// Sets all the options, replacing any prior values.
4791        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4792            self.0.options = v.into();
4793            self
4794        }
4795
4796        /// Sends the request.
4797        ///
4798        /// # Long running operations
4799        ///
4800        /// This starts, but does not poll, a longrunning operation. More information
4801        /// on [collect_api_data][crate::client::ApiHubCollect::collect_api_data].
4802        pub async fn send(self) -> Result<longrunning::model::Operation> {
4803            (*self.0.stub)
4804                .collect_api_data(self.0.request, self.0.options)
4805                .await
4806                .map(gax::response::Response::into_body)
4807        }
4808
4809        /// Creates a [Poller][lro::Poller] to work with `collect_api_data`.
4810        pub fn poller(
4811            self,
4812        ) -> impl lro::Poller<crate::model::CollectApiDataResponse, crate::model::OperationMetadata>
4813        {
4814            type Operation = lro::internal::Operation<
4815                crate::model::CollectApiDataResponse,
4816                crate::model::OperationMetadata,
4817            >;
4818            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4819            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4820
4821            let stub = self.0.stub.clone();
4822            let mut options = self.0.options.clone();
4823            options.set_retry_policy(gax::retry_policy::NeverRetry);
4824            let query = move |name| {
4825                let stub = stub.clone();
4826                let options = options.clone();
4827                async {
4828                    let op = GetOperation::new(stub)
4829                        .set_name(name)
4830                        .with_options(options)
4831                        .send()
4832                        .await?;
4833                    Ok(Operation::new(op))
4834                }
4835            };
4836
4837            let start = move || async {
4838                let op = self.send().await?;
4839                Ok(Operation::new(op))
4840            };
4841
4842            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4843        }
4844
4845        /// Sets the value of [location][crate::model::CollectApiDataRequest::location].
4846        ///
4847        /// This is a **required** field for requests.
4848        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4849            self.0.request.location = v.into();
4850            self
4851        }
4852
4853        /// Sets the value of [collection_type][crate::model::CollectApiDataRequest::collection_type].
4854        ///
4855        /// This is a **required** field for requests.
4856        pub fn set_collection_type<T: Into<crate::model::CollectionType>>(mut self, v: T) -> Self {
4857            self.0.request.collection_type = v.into();
4858            self
4859        }
4860
4861        /// Sets the value of [plugin_instance][crate::model::CollectApiDataRequest::plugin_instance].
4862        ///
4863        /// This is a **required** field for requests.
4864        pub fn set_plugin_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4865            self.0.request.plugin_instance = v.into();
4866            self
4867        }
4868
4869        /// Sets the value of [action_id][crate::model::CollectApiDataRequest::action_id].
4870        ///
4871        /// This is a **required** field for requests.
4872        pub fn set_action_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4873            self.0.request.action_id = v.into();
4874            self
4875        }
4876
4877        /// Sets the value of [api_data][crate::model::CollectApiDataRequest::api_data].
4878        ///
4879        /// This is a **required** field for requests.
4880        pub fn set_api_data<T>(mut self, v: T) -> Self
4881        where
4882            T: std::convert::Into<crate::model::ApiData>,
4883        {
4884            self.0.request.api_data = std::option::Option::Some(v.into());
4885            self
4886        }
4887
4888        /// Sets or clears the value of [api_data][crate::model::CollectApiDataRequest::api_data].
4889        ///
4890        /// This is a **required** field for requests.
4891        pub fn set_or_clear_api_data<T>(mut self, v: std::option::Option<T>) -> Self
4892        where
4893            T: std::convert::Into<crate::model::ApiData>,
4894        {
4895            self.0.request.api_data = v.map(|x| x.into());
4896            self
4897        }
4898    }
4899
4900    #[doc(hidden)]
4901    impl gax::options::internal::RequestBuilder for CollectApiData {
4902        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4903            &mut self.0.options
4904        }
4905    }
4906
4907    /// The request builder for [ApiHubCollect::list_locations][crate::client::ApiHubCollect::list_locations] calls.
4908    ///
4909    /// # Example
4910    /// ```no_run
4911    /// # use google_cloud_apihub_v1::builder;
4912    /// use builder::api_hub_collect::ListLocations;
4913    /// # tokio_test::block_on(async {
4914    /// use gax::paginator::ItemPaginator;
4915    ///
4916    /// let builder = prepare_request_builder();
4917    /// let mut items = builder.by_item();
4918    /// while let Some(result) = items.next().await {
4919    ///   let item = result?;
4920    /// }
4921    /// # gax::Result::<()>::Ok(()) });
4922    ///
4923    /// fn prepare_request_builder() -> ListLocations {
4924    ///   # panic!();
4925    ///   // ... details omitted ...
4926    /// }
4927    /// ```
4928    #[derive(Clone, Debug)]
4929    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4930
4931    impl ListLocations {
4932        pub(crate) fn new(
4933            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
4934        ) -> Self {
4935            Self(RequestBuilder::new(stub))
4936        }
4937
4938        /// Sets the full request, replacing any prior values.
4939        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4940            mut self,
4941            v: V,
4942        ) -> Self {
4943            self.0.request = v.into();
4944            self
4945        }
4946
4947        /// Sets all the options, replacing any prior values.
4948        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4949            self.0.options = v.into();
4950            self
4951        }
4952
4953        /// Sends the request.
4954        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4955            (*self.0.stub)
4956                .list_locations(self.0.request, self.0.options)
4957                .await
4958                .map(gax::response::Response::into_body)
4959        }
4960
4961        /// Streams each page in the collection.
4962        pub fn by_page(
4963            self,
4964        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4965        {
4966            use std::clone::Clone;
4967            let token = self.0.request.page_token.clone();
4968            let execute = move |token: String| {
4969                let mut builder = self.clone();
4970                builder.0.request = builder.0.request.set_page_token(token);
4971                builder.send()
4972            };
4973            gax::paginator::internal::new_paginator(token, execute)
4974        }
4975
4976        /// Streams each item in the collection.
4977        pub fn by_item(
4978            self,
4979        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4980        {
4981            use gax::paginator::Paginator;
4982            self.by_page().items()
4983        }
4984
4985        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4986        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4987            self.0.request.name = v.into();
4988            self
4989        }
4990
4991        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4992        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4993            self.0.request.filter = v.into();
4994            self
4995        }
4996
4997        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4998        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4999            self.0.request.page_size = v.into();
5000            self
5001        }
5002
5003        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
5004        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5005            self.0.request.page_token = v.into();
5006            self
5007        }
5008    }
5009
5010    #[doc(hidden)]
5011    impl gax::options::internal::RequestBuilder for ListLocations {
5012        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5013            &mut self.0.options
5014        }
5015    }
5016
5017    /// The request builder for [ApiHubCollect::get_location][crate::client::ApiHubCollect::get_location] calls.
5018    ///
5019    /// # Example
5020    /// ```no_run
5021    /// # use google_cloud_apihub_v1::builder;
5022    /// use builder::api_hub_collect::GetLocation;
5023    /// # tokio_test::block_on(async {
5024    ///
5025    /// let builder = prepare_request_builder();
5026    /// let response = builder.send().await?;
5027    /// # gax::Result::<()>::Ok(()) });
5028    ///
5029    /// fn prepare_request_builder() -> GetLocation {
5030    ///   # panic!();
5031    ///   // ... details omitted ...
5032    /// }
5033    /// ```
5034    #[derive(Clone, Debug)]
5035    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5036
5037    impl GetLocation {
5038        pub(crate) fn new(
5039            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5040        ) -> Self {
5041            Self(RequestBuilder::new(stub))
5042        }
5043
5044        /// Sets the full request, replacing any prior values.
5045        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5046            self.0.request = v.into();
5047            self
5048        }
5049
5050        /// Sets all the options, replacing any prior values.
5051        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5052            self.0.options = v.into();
5053            self
5054        }
5055
5056        /// Sends the request.
5057        pub async fn send(self) -> Result<location::model::Location> {
5058            (*self.0.stub)
5059                .get_location(self.0.request, self.0.options)
5060                .await
5061                .map(gax::response::Response::into_body)
5062        }
5063
5064        /// Sets the value of [name][location::model::GetLocationRequest::name].
5065        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5066            self.0.request.name = v.into();
5067            self
5068        }
5069    }
5070
5071    #[doc(hidden)]
5072    impl gax::options::internal::RequestBuilder for GetLocation {
5073        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5074            &mut self.0.options
5075        }
5076    }
5077
5078    /// The request builder for [ApiHubCollect::list_operations][crate::client::ApiHubCollect::list_operations] calls.
5079    ///
5080    /// # Example
5081    /// ```no_run
5082    /// # use google_cloud_apihub_v1::builder;
5083    /// use builder::api_hub_collect::ListOperations;
5084    /// # tokio_test::block_on(async {
5085    /// use gax::paginator::ItemPaginator;
5086    ///
5087    /// let builder = prepare_request_builder();
5088    /// let mut items = builder.by_item();
5089    /// while let Some(result) = items.next().await {
5090    ///   let item = result?;
5091    /// }
5092    /// # gax::Result::<()>::Ok(()) });
5093    ///
5094    /// fn prepare_request_builder() -> ListOperations {
5095    ///   # panic!();
5096    ///   // ... details omitted ...
5097    /// }
5098    /// ```
5099    #[derive(Clone, Debug)]
5100    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5101
5102    impl ListOperations {
5103        pub(crate) fn new(
5104            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5105        ) -> Self {
5106            Self(RequestBuilder::new(stub))
5107        }
5108
5109        /// Sets the full request, replacing any prior values.
5110        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5111            mut self,
5112            v: V,
5113        ) -> Self {
5114            self.0.request = v.into();
5115            self
5116        }
5117
5118        /// Sets all the options, replacing any prior values.
5119        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5120            self.0.options = v.into();
5121            self
5122        }
5123
5124        /// Sends the request.
5125        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5126            (*self.0.stub)
5127                .list_operations(self.0.request, self.0.options)
5128                .await
5129                .map(gax::response::Response::into_body)
5130        }
5131
5132        /// Streams each page in the collection.
5133        pub fn by_page(
5134            self,
5135        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5136        {
5137            use std::clone::Clone;
5138            let token = self.0.request.page_token.clone();
5139            let execute = move |token: String| {
5140                let mut builder = self.clone();
5141                builder.0.request = builder.0.request.set_page_token(token);
5142                builder.send()
5143            };
5144            gax::paginator::internal::new_paginator(token, execute)
5145        }
5146
5147        /// Streams each item in the collection.
5148        pub fn by_item(
5149            self,
5150        ) -> impl gax::paginator::ItemPaginator<
5151            longrunning::model::ListOperationsResponse,
5152            gax::error::Error,
5153        > {
5154            use gax::paginator::Paginator;
5155            self.by_page().items()
5156        }
5157
5158        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
5159        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5160            self.0.request.name = v.into();
5161            self
5162        }
5163
5164        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
5165        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5166            self.0.request.filter = v.into();
5167            self
5168        }
5169
5170        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
5171        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5172            self.0.request.page_size = v.into();
5173            self
5174        }
5175
5176        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
5177        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5178            self.0.request.page_token = v.into();
5179            self
5180        }
5181
5182        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
5183        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5184            self.0.request.return_partial_success = v.into();
5185            self
5186        }
5187    }
5188
5189    #[doc(hidden)]
5190    impl gax::options::internal::RequestBuilder for ListOperations {
5191        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5192            &mut self.0.options
5193        }
5194    }
5195
5196    /// The request builder for [ApiHubCollect::get_operation][crate::client::ApiHubCollect::get_operation] calls.
5197    ///
5198    /// # Example
5199    /// ```no_run
5200    /// # use google_cloud_apihub_v1::builder;
5201    /// use builder::api_hub_collect::GetOperation;
5202    /// # tokio_test::block_on(async {
5203    ///
5204    /// let builder = prepare_request_builder();
5205    /// let response = builder.send().await?;
5206    /// # gax::Result::<()>::Ok(()) });
5207    ///
5208    /// fn prepare_request_builder() -> GetOperation {
5209    ///   # panic!();
5210    ///   // ... details omitted ...
5211    /// }
5212    /// ```
5213    #[derive(Clone, Debug)]
5214    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5215
5216    impl GetOperation {
5217        pub(crate) fn new(
5218            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5219        ) -> Self {
5220            Self(RequestBuilder::new(stub))
5221        }
5222
5223        /// Sets the full request, replacing any prior values.
5224        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5225            mut self,
5226            v: V,
5227        ) -> Self {
5228            self.0.request = v.into();
5229            self
5230        }
5231
5232        /// Sets all the options, replacing any prior values.
5233        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5234            self.0.options = v.into();
5235            self
5236        }
5237
5238        /// Sends the request.
5239        pub async fn send(self) -> Result<longrunning::model::Operation> {
5240            (*self.0.stub)
5241                .get_operation(self.0.request, self.0.options)
5242                .await
5243                .map(gax::response::Response::into_body)
5244        }
5245
5246        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
5247        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5248            self.0.request.name = v.into();
5249            self
5250        }
5251    }
5252
5253    #[doc(hidden)]
5254    impl gax::options::internal::RequestBuilder for GetOperation {
5255        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5256            &mut self.0.options
5257        }
5258    }
5259
5260    /// The request builder for [ApiHubCollect::delete_operation][crate::client::ApiHubCollect::delete_operation] calls.
5261    ///
5262    /// # Example
5263    /// ```no_run
5264    /// # use google_cloud_apihub_v1::builder;
5265    /// use builder::api_hub_collect::DeleteOperation;
5266    /// # tokio_test::block_on(async {
5267    ///
5268    /// let builder = prepare_request_builder();
5269    /// let response = builder.send().await?;
5270    /// # gax::Result::<()>::Ok(()) });
5271    ///
5272    /// fn prepare_request_builder() -> DeleteOperation {
5273    ///   # panic!();
5274    ///   // ... details omitted ...
5275    /// }
5276    /// ```
5277    #[derive(Clone, Debug)]
5278    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5279
5280    impl DeleteOperation {
5281        pub(crate) fn new(
5282            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5283        ) -> Self {
5284            Self(RequestBuilder::new(stub))
5285        }
5286
5287        /// Sets the full request, replacing any prior values.
5288        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5289            mut self,
5290            v: V,
5291        ) -> Self {
5292            self.0.request = v.into();
5293            self
5294        }
5295
5296        /// Sets all the options, replacing any prior values.
5297        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5298            self.0.options = v.into();
5299            self
5300        }
5301
5302        /// Sends the request.
5303        pub async fn send(self) -> Result<()> {
5304            (*self.0.stub)
5305                .delete_operation(self.0.request, self.0.options)
5306                .await
5307                .map(gax::response::Response::into_body)
5308        }
5309
5310        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
5311        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5312            self.0.request.name = v.into();
5313            self
5314        }
5315    }
5316
5317    #[doc(hidden)]
5318    impl gax::options::internal::RequestBuilder for DeleteOperation {
5319        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5320            &mut self.0.options
5321        }
5322    }
5323
5324    /// The request builder for [ApiHubCollect::cancel_operation][crate::client::ApiHubCollect::cancel_operation] calls.
5325    ///
5326    /// # Example
5327    /// ```no_run
5328    /// # use google_cloud_apihub_v1::builder;
5329    /// use builder::api_hub_collect::CancelOperation;
5330    /// # tokio_test::block_on(async {
5331    ///
5332    /// let builder = prepare_request_builder();
5333    /// let response = builder.send().await?;
5334    /// # gax::Result::<()>::Ok(()) });
5335    ///
5336    /// fn prepare_request_builder() -> CancelOperation {
5337    ///   # panic!();
5338    ///   // ... details omitted ...
5339    /// }
5340    /// ```
5341    #[derive(Clone, Debug)]
5342    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5343
5344    impl CancelOperation {
5345        pub(crate) fn new(
5346            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5347        ) -> Self {
5348            Self(RequestBuilder::new(stub))
5349        }
5350
5351        /// Sets the full request, replacing any prior values.
5352        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5353            mut self,
5354            v: V,
5355        ) -> Self {
5356            self.0.request = v.into();
5357            self
5358        }
5359
5360        /// Sets all the options, replacing any prior values.
5361        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5362            self.0.options = v.into();
5363            self
5364        }
5365
5366        /// Sends the request.
5367        pub async fn send(self) -> Result<()> {
5368            (*self.0.stub)
5369                .cancel_operation(self.0.request, self.0.options)
5370                .await
5371                .map(gax::response::Response::into_body)
5372        }
5373
5374        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
5375        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5376            self.0.request.name = v.into();
5377            self
5378        }
5379    }
5380
5381    #[doc(hidden)]
5382    impl gax::options::internal::RequestBuilder for CancelOperation {
5383        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5384            &mut self.0.options
5385        }
5386    }
5387}
5388
5389pub mod api_hub_curate {
5390    use crate::Result;
5391
5392    /// A builder for [ApiHubCurate][crate::client::ApiHubCurate].
5393    ///
5394    /// ```
5395    /// # tokio_test::block_on(async {
5396    /// # use google_cloud_apihub_v1::*;
5397    /// # use builder::api_hub_curate::ClientBuilder;
5398    /// # use client::ApiHubCurate;
5399    /// let builder : ClientBuilder = ApiHubCurate::builder();
5400    /// let client = builder
5401    ///     .with_endpoint("https://apihub.googleapis.com")
5402    ///     .build().await?;
5403    /// # gax::client_builder::Result::<()>::Ok(()) });
5404    /// ```
5405    pub type ClientBuilder =
5406        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5407
5408    pub(crate) mod client {
5409        use super::super::super::client::ApiHubCurate;
5410        pub struct Factory;
5411        impl gax::client_builder::internal::ClientFactory for Factory {
5412            type Client = ApiHubCurate;
5413            type Credentials = gaxi::options::Credentials;
5414            async fn build(
5415                self,
5416                config: gaxi::options::ClientConfig,
5417            ) -> gax::client_builder::Result<Self::Client> {
5418                Self::Client::new(config).await
5419            }
5420        }
5421    }
5422
5423    /// Common implementation for [crate::client::ApiHubCurate] request builders.
5424    #[derive(Clone, Debug)]
5425    pub(crate) struct RequestBuilder<R: std::default::Default> {
5426        stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5427        request: R,
5428        options: gax::options::RequestOptions,
5429    }
5430
5431    impl<R> RequestBuilder<R>
5432    where
5433        R: std::default::Default,
5434    {
5435        pub(crate) fn new(
5436            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5437        ) -> Self {
5438            Self {
5439                stub,
5440                request: R::default(),
5441                options: gax::options::RequestOptions::default(),
5442            }
5443        }
5444    }
5445
5446    /// The request builder for [ApiHubCurate::create_curation][crate::client::ApiHubCurate::create_curation] calls.
5447    ///
5448    /// # Example
5449    /// ```no_run
5450    /// # use google_cloud_apihub_v1::builder;
5451    /// use builder::api_hub_curate::CreateCuration;
5452    /// # tokio_test::block_on(async {
5453    ///
5454    /// let builder = prepare_request_builder();
5455    /// let response = builder.send().await?;
5456    /// # gax::Result::<()>::Ok(()) });
5457    ///
5458    /// fn prepare_request_builder() -> CreateCuration {
5459    ///   # panic!();
5460    ///   // ... details omitted ...
5461    /// }
5462    /// ```
5463    #[derive(Clone, Debug)]
5464    pub struct CreateCuration(RequestBuilder<crate::model::CreateCurationRequest>);
5465
5466    impl CreateCuration {
5467        pub(crate) fn new(
5468            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5469        ) -> Self {
5470            Self(RequestBuilder::new(stub))
5471        }
5472
5473        /// Sets the full request, replacing any prior values.
5474        pub fn with_request<V: Into<crate::model::CreateCurationRequest>>(mut self, v: V) -> Self {
5475            self.0.request = v.into();
5476            self
5477        }
5478
5479        /// Sets all the options, replacing any prior values.
5480        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5481            self.0.options = v.into();
5482            self
5483        }
5484
5485        /// Sends the request.
5486        pub async fn send(self) -> Result<crate::model::Curation> {
5487            (*self.0.stub)
5488                .create_curation(self.0.request, self.0.options)
5489                .await
5490                .map(gax::response::Response::into_body)
5491        }
5492
5493        /// Sets the value of [parent][crate::model::CreateCurationRequest::parent].
5494        ///
5495        /// This is a **required** field for requests.
5496        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5497            self.0.request.parent = v.into();
5498            self
5499        }
5500
5501        /// Sets the value of [curation_id][crate::model::CreateCurationRequest::curation_id].
5502        pub fn set_curation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5503            self.0.request.curation_id = v.into();
5504            self
5505        }
5506
5507        /// Sets the value of [curation][crate::model::CreateCurationRequest::curation].
5508        ///
5509        /// This is a **required** field for requests.
5510        pub fn set_curation<T>(mut self, v: T) -> Self
5511        where
5512            T: std::convert::Into<crate::model::Curation>,
5513        {
5514            self.0.request.curation = std::option::Option::Some(v.into());
5515            self
5516        }
5517
5518        /// Sets or clears the value of [curation][crate::model::CreateCurationRequest::curation].
5519        ///
5520        /// This is a **required** field for requests.
5521        pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
5522        where
5523            T: std::convert::Into<crate::model::Curation>,
5524        {
5525            self.0.request.curation = v.map(|x| x.into());
5526            self
5527        }
5528    }
5529
5530    #[doc(hidden)]
5531    impl gax::options::internal::RequestBuilder for CreateCuration {
5532        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5533            &mut self.0.options
5534        }
5535    }
5536
5537    /// The request builder for [ApiHubCurate::get_curation][crate::client::ApiHubCurate::get_curation] calls.
5538    ///
5539    /// # Example
5540    /// ```no_run
5541    /// # use google_cloud_apihub_v1::builder;
5542    /// use builder::api_hub_curate::GetCuration;
5543    /// # tokio_test::block_on(async {
5544    ///
5545    /// let builder = prepare_request_builder();
5546    /// let response = builder.send().await?;
5547    /// # gax::Result::<()>::Ok(()) });
5548    ///
5549    /// fn prepare_request_builder() -> GetCuration {
5550    ///   # panic!();
5551    ///   // ... details omitted ...
5552    /// }
5553    /// ```
5554    #[derive(Clone, Debug)]
5555    pub struct GetCuration(RequestBuilder<crate::model::GetCurationRequest>);
5556
5557    impl GetCuration {
5558        pub(crate) fn new(
5559            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5560        ) -> Self {
5561            Self(RequestBuilder::new(stub))
5562        }
5563
5564        /// Sets the full request, replacing any prior values.
5565        pub fn with_request<V: Into<crate::model::GetCurationRequest>>(mut self, v: V) -> Self {
5566            self.0.request = v.into();
5567            self
5568        }
5569
5570        /// Sets all the options, replacing any prior values.
5571        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5572            self.0.options = v.into();
5573            self
5574        }
5575
5576        /// Sends the request.
5577        pub async fn send(self) -> Result<crate::model::Curation> {
5578            (*self.0.stub)
5579                .get_curation(self.0.request, self.0.options)
5580                .await
5581                .map(gax::response::Response::into_body)
5582        }
5583
5584        /// Sets the value of [name][crate::model::GetCurationRequest::name].
5585        ///
5586        /// This is a **required** field for requests.
5587        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5588            self.0.request.name = v.into();
5589            self
5590        }
5591    }
5592
5593    #[doc(hidden)]
5594    impl gax::options::internal::RequestBuilder for GetCuration {
5595        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5596            &mut self.0.options
5597        }
5598    }
5599
5600    /// The request builder for [ApiHubCurate::list_curations][crate::client::ApiHubCurate::list_curations] calls.
5601    ///
5602    /// # Example
5603    /// ```no_run
5604    /// # use google_cloud_apihub_v1::builder;
5605    /// use builder::api_hub_curate::ListCurations;
5606    /// # tokio_test::block_on(async {
5607    /// use gax::paginator::ItemPaginator;
5608    ///
5609    /// let builder = prepare_request_builder();
5610    /// let mut items = builder.by_item();
5611    /// while let Some(result) = items.next().await {
5612    ///   let item = result?;
5613    /// }
5614    /// # gax::Result::<()>::Ok(()) });
5615    ///
5616    /// fn prepare_request_builder() -> ListCurations {
5617    ///   # panic!();
5618    ///   // ... details omitted ...
5619    /// }
5620    /// ```
5621    #[derive(Clone, Debug)]
5622    pub struct ListCurations(RequestBuilder<crate::model::ListCurationsRequest>);
5623
5624    impl ListCurations {
5625        pub(crate) fn new(
5626            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5627        ) -> Self {
5628            Self(RequestBuilder::new(stub))
5629        }
5630
5631        /// Sets the full request, replacing any prior values.
5632        pub fn with_request<V: Into<crate::model::ListCurationsRequest>>(mut self, v: V) -> Self {
5633            self.0.request = v.into();
5634            self
5635        }
5636
5637        /// Sets all the options, replacing any prior values.
5638        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5639            self.0.options = v.into();
5640            self
5641        }
5642
5643        /// Sends the request.
5644        pub async fn send(self) -> Result<crate::model::ListCurationsResponse> {
5645            (*self.0.stub)
5646                .list_curations(self.0.request, self.0.options)
5647                .await
5648                .map(gax::response::Response::into_body)
5649        }
5650
5651        /// Streams each page in the collection.
5652        pub fn by_page(
5653            self,
5654        ) -> impl gax::paginator::Paginator<crate::model::ListCurationsResponse, gax::error::Error>
5655        {
5656            use std::clone::Clone;
5657            let token = self.0.request.page_token.clone();
5658            let execute = move |token: String| {
5659                let mut builder = self.clone();
5660                builder.0.request = builder.0.request.set_page_token(token);
5661                builder.send()
5662            };
5663            gax::paginator::internal::new_paginator(token, execute)
5664        }
5665
5666        /// Streams each item in the collection.
5667        pub fn by_item(
5668            self,
5669        ) -> impl gax::paginator::ItemPaginator<crate::model::ListCurationsResponse, gax::error::Error>
5670        {
5671            use gax::paginator::Paginator;
5672            self.by_page().items()
5673        }
5674
5675        /// Sets the value of [parent][crate::model::ListCurationsRequest::parent].
5676        ///
5677        /// This is a **required** field for requests.
5678        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5679            self.0.request.parent = v.into();
5680            self
5681        }
5682
5683        /// Sets the value of [filter][crate::model::ListCurationsRequest::filter].
5684        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5685            self.0.request.filter = v.into();
5686            self
5687        }
5688
5689        /// Sets the value of [page_size][crate::model::ListCurationsRequest::page_size].
5690        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5691            self.0.request.page_size = v.into();
5692            self
5693        }
5694
5695        /// Sets the value of [page_token][crate::model::ListCurationsRequest::page_token].
5696        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5697            self.0.request.page_token = v.into();
5698            self
5699        }
5700    }
5701
5702    #[doc(hidden)]
5703    impl gax::options::internal::RequestBuilder for ListCurations {
5704        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5705            &mut self.0.options
5706        }
5707    }
5708
5709    /// The request builder for [ApiHubCurate::update_curation][crate::client::ApiHubCurate::update_curation] calls.
5710    ///
5711    /// # Example
5712    /// ```no_run
5713    /// # use google_cloud_apihub_v1::builder;
5714    /// use builder::api_hub_curate::UpdateCuration;
5715    /// # tokio_test::block_on(async {
5716    ///
5717    /// let builder = prepare_request_builder();
5718    /// let response = builder.send().await?;
5719    /// # gax::Result::<()>::Ok(()) });
5720    ///
5721    /// fn prepare_request_builder() -> UpdateCuration {
5722    ///   # panic!();
5723    ///   // ... details omitted ...
5724    /// }
5725    /// ```
5726    #[derive(Clone, Debug)]
5727    pub struct UpdateCuration(RequestBuilder<crate::model::UpdateCurationRequest>);
5728
5729    impl UpdateCuration {
5730        pub(crate) fn new(
5731            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5732        ) -> Self {
5733            Self(RequestBuilder::new(stub))
5734        }
5735
5736        /// Sets the full request, replacing any prior values.
5737        pub fn with_request<V: Into<crate::model::UpdateCurationRequest>>(mut self, v: V) -> Self {
5738            self.0.request = v.into();
5739            self
5740        }
5741
5742        /// Sets all the options, replacing any prior values.
5743        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5744            self.0.options = v.into();
5745            self
5746        }
5747
5748        /// Sends the request.
5749        pub async fn send(self) -> Result<crate::model::Curation> {
5750            (*self.0.stub)
5751                .update_curation(self.0.request, self.0.options)
5752                .await
5753                .map(gax::response::Response::into_body)
5754        }
5755
5756        /// Sets the value of [curation][crate::model::UpdateCurationRequest::curation].
5757        ///
5758        /// This is a **required** field for requests.
5759        pub fn set_curation<T>(mut self, v: T) -> Self
5760        where
5761            T: std::convert::Into<crate::model::Curation>,
5762        {
5763            self.0.request.curation = std::option::Option::Some(v.into());
5764            self
5765        }
5766
5767        /// Sets or clears the value of [curation][crate::model::UpdateCurationRequest::curation].
5768        ///
5769        /// This is a **required** field for requests.
5770        pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
5771        where
5772            T: std::convert::Into<crate::model::Curation>,
5773        {
5774            self.0.request.curation = v.map(|x| x.into());
5775            self
5776        }
5777
5778        /// Sets the value of [update_mask][crate::model::UpdateCurationRequest::update_mask].
5779        pub fn set_update_mask<T>(mut self, v: T) -> Self
5780        where
5781            T: std::convert::Into<wkt::FieldMask>,
5782        {
5783            self.0.request.update_mask = std::option::Option::Some(v.into());
5784            self
5785        }
5786
5787        /// Sets or clears the value of [update_mask][crate::model::UpdateCurationRequest::update_mask].
5788        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5789        where
5790            T: std::convert::Into<wkt::FieldMask>,
5791        {
5792            self.0.request.update_mask = v.map(|x| x.into());
5793            self
5794        }
5795    }
5796
5797    #[doc(hidden)]
5798    impl gax::options::internal::RequestBuilder for UpdateCuration {
5799        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5800            &mut self.0.options
5801        }
5802    }
5803
5804    /// The request builder for [ApiHubCurate::delete_curation][crate::client::ApiHubCurate::delete_curation] calls.
5805    ///
5806    /// # Example
5807    /// ```no_run
5808    /// # use google_cloud_apihub_v1::builder;
5809    /// use builder::api_hub_curate::DeleteCuration;
5810    /// # tokio_test::block_on(async {
5811    ///
5812    /// let builder = prepare_request_builder();
5813    /// let response = builder.send().await?;
5814    /// # gax::Result::<()>::Ok(()) });
5815    ///
5816    /// fn prepare_request_builder() -> DeleteCuration {
5817    ///   # panic!();
5818    ///   // ... details omitted ...
5819    /// }
5820    /// ```
5821    #[derive(Clone, Debug)]
5822    pub struct DeleteCuration(RequestBuilder<crate::model::DeleteCurationRequest>);
5823
5824    impl DeleteCuration {
5825        pub(crate) fn new(
5826            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5827        ) -> Self {
5828            Self(RequestBuilder::new(stub))
5829        }
5830
5831        /// Sets the full request, replacing any prior values.
5832        pub fn with_request<V: Into<crate::model::DeleteCurationRequest>>(mut self, v: V) -> Self {
5833            self.0.request = v.into();
5834            self
5835        }
5836
5837        /// Sets all the options, replacing any prior values.
5838        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5839            self.0.options = v.into();
5840            self
5841        }
5842
5843        /// Sends the request.
5844        pub async fn send(self) -> Result<()> {
5845            (*self.0.stub)
5846                .delete_curation(self.0.request, self.0.options)
5847                .await
5848                .map(gax::response::Response::into_body)
5849        }
5850
5851        /// Sets the value of [name][crate::model::DeleteCurationRequest::name].
5852        ///
5853        /// This is a **required** field for requests.
5854        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5855            self.0.request.name = v.into();
5856            self
5857        }
5858    }
5859
5860    #[doc(hidden)]
5861    impl gax::options::internal::RequestBuilder for DeleteCuration {
5862        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5863            &mut self.0.options
5864        }
5865    }
5866
5867    /// The request builder for [ApiHubCurate::list_locations][crate::client::ApiHubCurate::list_locations] calls.
5868    ///
5869    /// # Example
5870    /// ```no_run
5871    /// # use google_cloud_apihub_v1::builder;
5872    /// use builder::api_hub_curate::ListLocations;
5873    /// # tokio_test::block_on(async {
5874    /// use gax::paginator::ItemPaginator;
5875    ///
5876    /// let builder = prepare_request_builder();
5877    /// let mut items = builder.by_item();
5878    /// while let Some(result) = items.next().await {
5879    ///   let item = result?;
5880    /// }
5881    /// # gax::Result::<()>::Ok(()) });
5882    ///
5883    /// fn prepare_request_builder() -> ListLocations {
5884    ///   # panic!();
5885    ///   // ... details omitted ...
5886    /// }
5887    /// ```
5888    #[derive(Clone, Debug)]
5889    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5890
5891    impl ListLocations {
5892        pub(crate) fn new(
5893            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5894        ) -> Self {
5895            Self(RequestBuilder::new(stub))
5896        }
5897
5898        /// Sets the full request, replacing any prior values.
5899        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5900            mut self,
5901            v: V,
5902        ) -> Self {
5903            self.0.request = v.into();
5904            self
5905        }
5906
5907        /// Sets all the options, replacing any prior values.
5908        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5909            self.0.options = v.into();
5910            self
5911        }
5912
5913        /// Sends the request.
5914        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5915            (*self.0.stub)
5916                .list_locations(self.0.request, self.0.options)
5917                .await
5918                .map(gax::response::Response::into_body)
5919        }
5920
5921        /// Streams each page in the collection.
5922        pub fn by_page(
5923            self,
5924        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5925        {
5926            use std::clone::Clone;
5927            let token = self.0.request.page_token.clone();
5928            let execute = move |token: String| {
5929                let mut builder = self.clone();
5930                builder.0.request = builder.0.request.set_page_token(token);
5931                builder.send()
5932            };
5933            gax::paginator::internal::new_paginator(token, execute)
5934        }
5935
5936        /// Streams each item in the collection.
5937        pub fn by_item(
5938            self,
5939        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5940        {
5941            use gax::paginator::Paginator;
5942            self.by_page().items()
5943        }
5944
5945        /// Sets the value of [name][location::model::ListLocationsRequest::name].
5946        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5947            self.0.request.name = v.into();
5948            self
5949        }
5950
5951        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
5952        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5953            self.0.request.filter = v.into();
5954            self
5955        }
5956
5957        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
5958        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5959            self.0.request.page_size = v.into();
5960            self
5961        }
5962
5963        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
5964        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5965            self.0.request.page_token = v.into();
5966            self
5967        }
5968    }
5969
5970    #[doc(hidden)]
5971    impl gax::options::internal::RequestBuilder for ListLocations {
5972        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5973            &mut self.0.options
5974        }
5975    }
5976
5977    /// The request builder for [ApiHubCurate::get_location][crate::client::ApiHubCurate::get_location] calls.
5978    ///
5979    /// # Example
5980    /// ```no_run
5981    /// # use google_cloud_apihub_v1::builder;
5982    /// use builder::api_hub_curate::GetLocation;
5983    /// # tokio_test::block_on(async {
5984    ///
5985    /// let builder = prepare_request_builder();
5986    /// let response = builder.send().await?;
5987    /// # gax::Result::<()>::Ok(()) });
5988    ///
5989    /// fn prepare_request_builder() -> GetLocation {
5990    ///   # panic!();
5991    ///   // ... details omitted ...
5992    /// }
5993    /// ```
5994    #[derive(Clone, Debug)]
5995    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5996
5997    impl GetLocation {
5998        pub(crate) fn new(
5999            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6000        ) -> Self {
6001            Self(RequestBuilder::new(stub))
6002        }
6003
6004        /// Sets the full request, replacing any prior values.
6005        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6006            self.0.request = v.into();
6007            self
6008        }
6009
6010        /// Sets all the options, replacing any prior values.
6011        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6012            self.0.options = v.into();
6013            self
6014        }
6015
6016        /// Sends the request.
6017        pub async fn send(self) -> Result<location::model::Location> {
6018            (*self.0.stub)
6019                .get_location(self.0.request, self.0.options)
6020                .await
6021                .map(gax::response::Response::into_body)
6022        }
6023
6024        /// Sets the value of [name][location::model::GetLocationRequest::name].
6025        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6026            self.0.request.name = v.into();
6027            self
6028        }
6029    }
6030
6031    #[doc(hidden)]
6032    impl gax::options::internal::RequestBuilder for GetLocation {
6033        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6034            &mut self.0.options
6035        }
6036    }
6037
6038    /// The request builder for [ApiHubCurate::list_operations][crate::client::ApiHubCurate::list_operations] calls.
6039    ///
6040    /// # Example
6041    /// ```no_run
6042    /// # use google_cloud_apihub_v1::builder;
6043    /// use builder::api_hub_curate::ListOperations;
6044    /// # tokio_test::block_on(async {
6045    /// use gax::paginator::ItemPaginator;
6046    ///
6047    /// let builder = prepare_request_builder();
6048    /// let mut items = builder.by_item();
6049    /// while let Some(result) = items.next().await {
6050    ///   let item = result?;
6051    /// }
6052    /// # gax::Result::<()>::Ok(()) });
6053    ///
6054    /// fn prepare_request_builder() -> ListOperations {
6055    ///   # panic!();
6056    ///   // ... details omitted ...
6057    /// }
6058    /// ```
6059    #[derive(Clone, Debug)]
6060    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6061
6062    impl ListOperations {
6063        pub(crate) fn new(
6064            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6065        ) -> Self {
6066            Self(RequestBuilder::new(stub))
6067        }
6068
6069        /// Sets the full request, replacing any prior values.
6070        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6071            mut self,
6072            v: V,
6073        ) -> Self {
6074            self.0.request = v.into();
6075            self
6076        }
6077
6078        /// Sets all the options, replacing any prior values.
6079        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6080            self.0.options = v.into();
6081            self
6082        }
6083
6084        /// Sends the request.
6085        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6086            (*self.0.stub)
6087                .list_operations(self.0.request, self.0.options)
6088                .await
6089                .map(gax::response::Response::into_body)
6090        }
6091
6092        /// Streams each page in the collection.
6093        pub fn by_page(
6094            self,
6095        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6096        {
6097            use std::clone::Clone;
6098            let token = self.0.request.page_token.clone();
6099            let execute = move |token: String| {
6100                let mut builder = self.clone();
6101                builder.0.request = builder.0.request.set_page_token(token);
6102                builder.send()
6103            };
6104            gax::paginator::internal::new_paginator(token, execute)
6105        }
6106
6107        /// Streams each item in the collection.
6108        pub fn by_item(
6109            self,
6110        ) -> impl gax::paginator::ItemPaginator<
6111            longrunning::model::ListOperationsResponse,
6112            gax::error::Error,
6113        > {
6114            use gax::paginator::Paginator;
6115            self.by_page().items()
6116        }
6117
6118        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
6119        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6120            self.0.request.name = v.into();
6121            self
6122        }
6123
6124        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
6125        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6126            self.0.request.filter = v.into();
6127            self
6128        }
6129
6130        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
6131        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6132            self.0.request.page_size = v.into();
6133            self
6134        }
6135
6136        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
6137        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6138            self.0.request.page_token = v.into();
6139            self
6140        }
6141
6142        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
6143        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6144            self.0.request.return_partial_success = v.into();
6145            self
6146        }
6147    }
6148
6149    #[doc(hidden)]
6150    impl gax::options::internal::RequestBuilder for ListOperations {
6151        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6152            &mut self.0.options
6153        }
6154    }
6155
6156    /// The request builder for [ApiHubCurate::get_operation][crate::client::ApiHubCurate::get_operation] calls.
6157    ///
6158    /// # Example
6159    /// ```no_run
6160    /// # use google_cloud_apihub_v1::builder;
6161    /// use builder::api_hub_curate::GetOperation;
6162    /// # tokio_test::block_on(async {
6163    ///
6164    /// let builder = prepare_request_builder();
6165    /// let response = builder.send().await?;
6166    /// # gax::Result::<()>::Ok(()) });
6167    ///
6168    /// fn prepare_request_builder() -> GetOperation {
6169    ///   # panic!();
6170    ///   // ... details omitted ...
6171    /// }
6172    /// ```
6173    #[derive(Clone, Debug)]
6174    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6175
6176    impl GetOperation {
6177        pub(crate) fn new(
6178            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6179        ) -> Self {
6180            Self(RequestBuilder::new(stub))
6181        }
6182
6183        /// Sets the full request, replacing any prior values.
6184        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6185            mut self,
6186            v: V,
6187        ) -> Self {
6188            self.0.request = v.into();
6189            self
6190        }
6191
6192        /// Sets all the options, replacing any prior values.
6193        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6194            self.0.options = v.into();
6195            self
6196        }
6197
6198        /// Sends the request.
6199        pub async fn send(self) -> Result<longrunning::model::Operation> {
6200            (*self.0.stub)
6201                .get_operation(self.0.request, self.0.options)
6202                .await
6203                .map(gax::response::Response::into_body)
6204        }
6205
6206        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
6207        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6208            self.0.request.name = v.into();
6209            self
6210        }
6211    }
6212
6213    #[doc(hidden)]
6214    impl gax::options::internal::RequestBuilder for GetOperation {
6215        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6216            &mut self.0.options
6217        }
6218    }
6219
6220    /// The request builder for [ApiHubCurate::delete_operation][crate::client::ApiHubCurate::delete_operation] calls.
6221    ///
6222    /// # Example
6223    /// ```no_run
6224    /// # use google_cloud_apihub_v1::builder;
6225    /// use builder::api_hub_curate::DeleteOperation;
6226    /// # tokio_test::block_on(async {
6227    ///
6228    /// let builder = prepare_request_builder();
6229    /// let response = builder.send().await?;
6230    /// # gax::Result::<()>::Ok(()) });
6231    ///
6232    /// fn prepare_request_builder() -> DeleteOperation {
6233    ///   # panic!();
6234    ///   // ... details omitted ...
6235    /// }
6236    /// ```
6237    #[derive(Clone, Debug)]
6238    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6239
6240    impl DeleteOperation {
6241        pub(crate) fn new(
6242            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6243        ) -> Self {
6244            Self(RequestBuilder::new(stub))
6245        }
6246
6247        /// Sets the full request, replacing any prior values.
6248        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6249            mut self,
6250            v: V,
6251        ) -> Self {
6252            self.0.request = v.into();
6253            self
6254        }
6255
6256        /// Sets all the options, replacing any prior values.
6257        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6258            self.0.options = v.into();
6259            self
6260        }
6261
6262        /// Sends the request.
6263        pub async fn send(self) -> Result<()> {
6264            (*self.0.stub)
6265                .delete_operation(self.0.request, self.0.options)
6266                .await
6267                .map(gax::response::Response::into_body)
6268        }
6269
6270        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
6271        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6272            self.0.request.name = v.into();
6273            self
6274        }
6275    }
6276
6277    #[doc(hidden)]
6278    impl gax::options::internal::RequestBuilder for DeleteOperation {
6279        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6280            &mut self.0.options
6281        }
6282    }
6283
6284    /// The request builder for [ApiHubCurate::cancel_operation][crate::client::ApiHubCurate::cancel_operation] calls.
6285    ///
6286    /// # Example
6287    /// ```no_run
6288    /// # use google_cloud_apihub_v1::builder;
6289    /// use builder::api_hub_curate::CancelOperation;
6290    /// # tokio_test::block_on(async {
6291    ///
6292    /// let builder = prepare_request_builder();
6293    /// let response = builder.send().await?;
6294    /// # gax::Result::<()>::Ok(()) });
6295    ///
6296    /// fn prepare_request_builder() -> CancelOperation {
6297    ///   # panic!();
6298    ///   // ... details omitted ...
6299    /// }
6300    /// ```
6301    #[derive(Clone, Debug)]
6302    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6303
6304    impl CancelOperation {
6305        pub(crate) fn new(
6306            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6307        ) -> Self {
6308            Self(RequestBuilder::new(stub))
6309        }
6310
6311        /// Sets the full request, replacing any prior values.
6312        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6313            mut self,
6314            v: V,
6315        ) -> Self {
6316            self.0.request = v.into();
6317            self
6318        }
6319
6320        /// Sets all the options, replacing any prior values.
6321        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6322            self.0.options = v.into();
6323            self
6324        }
6325
6326        /// Sends the request.
6327        pub async fn send(self) -> Result<()> {
6328            (*self.0.stub)
6329                .cancel_operation(self.0.request, self.0.options)
6330                .await
6331                .map(gax::response::Response::into_body)
6332        }
6333
6334        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
6335        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6336            self.0.request.name = v.into();
6337            self
6338        }
6339    }
6340
6341    #[doc(hidden)]
6342    impl gax::options::internal::RequestBuilder for CancelOperation {
6343        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6344            &mut self.0.options
6345        }
6346    }
6347}
6348
6349pub mod api_hub_discovery {
6350    use crate::Result;
6351
6352    /// A builder for [ApiHubDiscovery][crate::client::ApiHubDiscovery].
6353    ///
6354    /// ```
6355    /// # tokio_test::block_on(async {
6356    /// # use google_cloud_apihub_v1::*;
6357    /// # use builder::api_hub_discovery::ClientBuilder;
6358    /// # use client::ApiHubDiscovery;
6359    /// let builder : ClientBuilder = ApiHubDiscovery::builder();
6360    /// let client = builder
6361    ///     .with_endpoint("https://apihub.googleapis.com")
6362    ///     .build().await?;
6363    /// # gax::client_builder::Result::<()>::Ok(()) });
6364    /// ```
6365    pub type ClientBuilder =
6366        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6367
6368    pub(crate) mod client {
6369        use super::super::super::client::ApiHubDiscovery;
6370        pub struct Factory;
6371        impl gax::client_builder::internal::ClientFactory for Factory {
6372            type Client = ApiHubDiscovery;
6373            type Credentials = gaxi::options::Credentials;
6374            async fn build(
6375                self,
6376                config: gaxi::options::ClientConfig,
6377            ) -> gax::client_builder::Result<Self::Client> {
6378                Self::Client::new(config).await
6379            }
6380        }
6381    }
6382
6383    /// Common implementation for [crate::client::ApiHubDiscovery] request builders.
6384    #[derive(Clone, Debug)]
6385    pub(crate) struct RequestBuilder<R: std::default::Default> {
6386        stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6387        request: R,
6388        options: gax::options::RequestOptions,
6389    }
6390
6391    impl<R> RequestBuilder<R>
6392    where
6393        R: std::default::Default,
6394    {
6395        pub(crate) fn new(
6396            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6397        ) -> Self {
6398            Self {
6399                stub,
6400                request: R::default(),
6401                options: gax::options::RequestOptions::default(),
6402            }
6403        }
6404    }
6405
6406    /// The request builder for [ApiHubDiscovery::list_discovered_api_observations][crate::client::ApiHubDiscovery::list_discovered_api_observations] calls.
6407    ///
6408    /// # Example
6409    /// ```no_run
6410    /// # use google_cloud_apihub_v1::builder;
6411    /// use builder::api_hub_discovery::ListDiscoveredApiObservations;
6412    /// # tokio_test::block_on(async {
6413    /// use gax::paginator::ItemPaginator;
6414    ///
6415    /// let builder = prepare_request_builder();
6416    /// let mut items = builder.by_item();
6417    /// while let Some(result) = items.next().await {
6418    ///   let item = result?;
6419    /// }
6420    /// # gax::Result::<()>::Ok(()) });
6421    ///
6422    /// fn prepare_request_builder() -> ListDiscoveredApiObservations {
6423    ///   # panic!();
6424    ///   // ... details omitted ...
6425    /// }
6426    /// ```
6427    #[derive(Clone, Debug)]
6428    pub struct ListDiscoveredApiObservations(
6429        RequestBuilder<crate::model::ListDiscoveredApiObservationsRequest>,
6430    );
6431
6432    impl ListDiscoveredApiObservations {
6433        pub(crate) fn new(
6434            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6435        ) -> Self {
6436            Self(RequestBuilder::new(stub))
6437        }
6438
6439        /// Sets the full request, replacing any prior values.
6440        pub fn with_request<V: Into<crate::model::ListDiscoveredApiObservationsRequest>>(
6441            mut self,
6442            v: V,
6443        ) -> Self {
6444            self.0.request = v.into();
6445            self
6446        }
6447
6448        /// Sets all the options, replacing any prior values.
6449        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6450            self.0.options = v.into();
6451            self
6452        }
6453
6454        /// Sends the request.
6455        pub async fn send(self) -> Result<crate::model::ListDiscoveredApiObservationsResponse> {
6456            (*self.0.stub)
6457                .list_discovered_api_observations(self.0.request, self.0.options)
6458                .await
6459                .map(gax::response::Response::into_body)
6460        }
6461
6462        /// Streams each page in the collection.
6463        pub fn by_page(
6464            self,
6465        ) -> impl gax::paginator::Paginator<
6466            crate::model::ListDiscoveredApiObservationsResponse,
6467            gax::error::Error,
6468        > {
6469            use std::clone::Clone;
6470            let token = self.0.request.page_token.clone();
6471            let execute = move |token: String| {
6472                let mut builder = self.clone();
6473                builder.0.request = builder.0.request.set_page_token(token);
6474                builder.send()
6475            };
6476            gax::paginator::internal::new_paginator(token, execute)
6477        }
6478
6479        /// Streams each item in the collection.
6480        pub fn by_item(
6481            self,
6482        ) -> impl gax::paginator::ItemPaginator<
6483            crate::model::ListDiscoveredApiObservationsResponse,
6484            gax::error::Error,
6485        > {
6486            use gax::paginator::Paginator;
6487            self.by_page().items()
6488        }
6489
6490        /// Sets the value of [parent][crate::model::ListDiscoveredApiObservationsRequest::parent].
6491        ///
6492        /// This is a **required** field for requests.
6493        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6494            self.0.request.parent = v.into();
6495            self
6496        }
6497
6498        /// Sets the value of [page_size][crate::model::ListDiscoveredApiObservationsRequest::page_size].
6499        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6500            self.0.request.page_size = v.into();
6501            self
6502        }
6503
6504        /// Sets the value of [page_token][crate::model::ListDiscoveredApiObservationsRequest::page_token].
6505        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6506            self.0.request.page_token = v.into();
6507            self
6508        }
6509    }
6510
6511    #[doc(hidden)]
6512    impl gax::options::internal::RequestBuilder for ListDiscoveredApiObservations {
6513        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6514            &mut self.0.options
6515        }
6516    }
6517
6518    /// The request builder for [ApiHubDiscovery::get_discovered_api_observation][crate::client::ApiHubDiscovery::get_discovered_api_observation] calls.
6519    ///
6520    /// # Example
6521    /// ```no_run
6522    /// # use google_cloud_apihub_v1::builder;
6523    /// use builder::api_hub_discovery::GetDiscoveredApiObservation;
6524    /// # tokio_test::block_on(async {
6525    ///
6526    /// let builder = prepare_request_builder();
6527    /// let response = builder.send().await?;
6528    /// # gax::Result::<()>::Ok(()) });
6529    ///
6530    /// fn prepare_request_builder() -> GetDiscoveredApiObservation {
6531    ///   # panic!();
6532    ///   // ... details omitted ...
6533    /// }
6534    /// ```
6535    #[derive(Clone, Debug)]
6536    pub struct GetDiscoveredApiObservation(
6537        RequestBuilder<crate::model::GetDiscoveredApiObservationRequest>,
6538    );
6539
6540    impl GetDiscoveredApiObservation {
6541        pub(crate) fn new(
6542            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6543        ) -> Self {
6544            Self(RequestBuilder::new(stub))
6545        }
6546
6547        /// Sets the full request, replacing any prior values.
6548        pub fn with_request<V: Into<crate::model::GetDiscoveredApiObservationRequest>>(
6549            mut self,
6550            v: V,
6551        ) -> Self {
6552            self.0.request = v.into();
6553            self
6554        }
6555
6556        /// Sets all the options, replacing any prior values.
6557        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6558            self.0.options = v.into();
6559            self
6560        }
6561
6562        /// Sends the request.
6563        pub async fn send(self) -> Result<crate::model::DiscoveredApiObservation> {
6564            (*self.0.stub)
6565                .get_discovered_api_observation(self.0.request, self.0.options)
6566                .await
6567                .map(gax::response::Response::into_body)
6568        }
6569
6570        /// Sets the value of [name][crate::model::GetDiscoveredApiObservationRequest::name].
6571        ///
6572        /// This is a **required** field for requests.
6573        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6574            self.0.request.name = v.into();
6575            self
6576        }
6577    }
6578
6579    #[doc(hidden)]
6580    impl gax::options::internal::RequestBuilder for GetDiscoveredApiObservation {
6581        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6582            &mut self.0.options
6583        }
6584    }
6585
6586    /// The request builder for [ApiHubDiscovery::list_discovered_api_operations][crate::client::ApiHubDiscovery::list_discovered_api_operations] calls.
6587    ///
6588    /// # Example
6589    /// ```no_run
6590    /// # use google_cloud_apihub_v1::builder;
6591    /// use builder::api_hub_discovery::ListDiscoveredApiOperations;
6592    /// # tokio_test::block_on(async {
6593    /// use gax::paginator::ItemPaginator;
6594    ///
6595    /// let builder = prepare_request_builder();
6596    /// let mut items = builder.by_item();
6597    /// while let Some(result) = items.next().await {
6598    ///   let item = result?;
6599    /// }
6600    /// # gax::Result::<()>::Ok(()) });
6601    ///
6602    /// fn prepare_request_builder() -> ListDiscoveredApiOperations {
6603    ///   # panic!();
6604    ///   // ... details omitted ...
6605    /// }
6606    /// ```
6607    #[derive(Clone, Debug)]
6608    pub struct ListDiscoveredApiOperations(
6609        RequestBuilder<crate::model::ListDiscoveredApiOperationsRequest>,
6610    );
6611
6612    impl ListDiscoveredApiOperations {
6613        pub(crate) fn new(
6614            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6615        ) -> Self {
6616            Self(RequestBuilder::new(stub))
6617        }
6618
6619        /// Sets the full request, replacing any prior values.
6620        pub fn with_request<V: Into<crate::model::ListDiscoveredApiOperationsRequest>>(
6621            mut self,
6622            v: V,
6623        ) -> Self {
6624            self.0.request = v.into();
6625            self
6626        }
6627
6628        /// Sets all the options, replacing any prior values.
6629        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6630            self.0.options = v.into();
6631            self
6632        }
6633
6634        /// Sends the request.
6635        pub async fn send(self) -> Result<crate::model::ListDiscoveredApiOperationsResponse> {
6636            (*self.0.stub)
6637                .list_discovered_api_operations(self.0.request, self.0.options)
6638                .await
6639                .map(gax::response::Response::into_body)
6640        }
6641
6642        /// Streams each page in the collection.
6643        pub fn by_page(
6644            self,
6645        ) -> impl gax::paginator::Paginator<
6646            crate::model::ListDiscoveredApiOperationsResponse,
6647            gax::error::Error,
6648        > {
6649            use std::clone::Clone;
6650            let token = self.0.request.page_token.clone();
6651            let execute = move |token: String| {
6652                let mut builder = self.clone();
6653                builder.0.request = builder.0.request.set_page_token(token);
6654                builder.send()
6655            };
6656            gax::paginator::internal::new_paginator(token, execute)
6657        }
6658
6659        /// Streams each item in the collection.
6660        pub fn by_item(
6661            self,
6662        ) -> impl gax::paginator::ItemPaginator<
6663            crate::model::ListDiscoveredApiOperationsResponse,
6664            gax::error::Error,
6665        > {
6666            use gax::paginator::Paginator;
6667            self.by_page().items()
6668        }
6669
6670        /// Sets the value of [parent][crate::model::ListDiscoveredApiOperationsRequest::parent].
6671        ///
6672        /// This is a **required** field for requests.
6673        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6674            self.0.request.parent = v.into();
6675            self
6676        }
6677
6678        /// Sets the value of [page_size][crate::model::ListDiscoveredApiOperationsRequest::page_size].
6679        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6680            self.0.request.page_size = v.into();
6681            self
6682        }
6683
6684        /// Sets the value of [page_token][crate::model::ListDiscoveredApiOperationsRequest::page_token].
6685        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6686            self.0.request.page_token = v.into();
6687            self
6688        }
6689    }
6690
6691    #[doc(hidden)]
6692    impl gax::options::internal::RequestBuilder for ListDiscoveredApiOperations {
6693        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6694            &mut self.0.options
6695        }
6696    }
6697
6698    /// The request builder for [ApiHubDiscovery::get_discovered_api_operation][crate::client::ApiHubDiscovery::get_discovered_api_operation] calls.
6699    ///
6700    /// # Example
6701    /// ```no_run
6702    /// # use google_cloud_apihub_v1::builder;
6703    /// use builder::api_hub_discovery::GetDiscoveredApiOperation;
6704    /// # tokio_test::block_on(async {
6705    ///
6706    /// let builder = prepare_request_builder();
6707    /// let response = builder.send().await?;
6708    /// # gax::Result::<()>::Ok(()) });
6709    ///
6710    /// fn prepare_request_builder() -> GetDiscoveredApiOperation {
6711    ///   # panic!();
6712    ///   // ... details omitted ...
6713    /// }
6714    /// ```
6715    #[derive(Clone, Debug)]
6716    pub struct GetDiscoveredApiOperation(
6717        RequestBuilder<crate::model::GetDiscoveredApiOperationRequest>,
6718    );
6719
6720    impl GetDiscoveredApiOperation {
6721        pub(crate) fn new(
6722            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6723        ) -> Self {
6724            Self(RequestBuilder::new(stub))
6725        }
6726
6727        /// Sets the full request, replacing any prior values.
6728        pub fn with_request<V: Into<crate::model::GetDiscoveredApiOperationRequest>>(
6729            mut self,
6730            v: V,
6731        ) -> Self {
6732            self.0.request = v.into();
6733            self
6734        }
6735
6736        /// Sets all the options, replacing any prior values.
6737        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6738            self.0.options = v.into();
6739            self
6740        }
6741
6742        /// Sends the request.
6743        pub async fn send(self) -> Result<crate::model::DiscoveredApiOperation> {
6744            (*self.0.stub)
6745                .get_discovered_api_operation(self.0.request, self.0.options)
6746                .await
6747                .map(gax::response::Response::into_body)
6748        }
6749
6750        /// Sets the value of [name][crate::model::GetDiscoveredApiOperationRequest::name].
6751        ///
6752        /// This is a **required** field for requests.
6753        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6754            self.0.request.name = v.into();
6755            self
6756        }
6757    }
6758
6759    #[doc(hidden)]
6760    impl gax::options::internal::RequestBuilder for GetDiscoveredApiOperation {
6761        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6762            &mut self.0.options
6763        }
6764    }
6765
6766    /// The request builder for [ApiHubDiscovery::list_locations][crate::client::ApiHubDiscovery::list_locations] calls.
6767    ///
6768    /// # Example
6769    /// ```no_run
6770    /// # use google_cloud_apihub_v1::builder;
6771    /// use builder::api_hub_discovery::ListLocations;
6772    /// # tokio_test::block_on(async {
6773    /// use gax::paginator::ItemPaginator;
6774    ///
6775    /// let builder = prepare_request_builder();
6776    /// let mut items = builder.by_item();
6777    /// while let Some(result) = items.next().await {
6778    ///   let item = result?;
6779    /// }
6780    /// # gax::Result::<()>::Ok(()) });
6781    ///
6782    /// fn prepare_request_builder() -> ListLocations {
6783    ///   # panic!();
6784    ///   // ... details omitted ...
6785    /// }
6786    /// ```
6787    #[derive(Clone, Debug)]
6788    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
6789
6790    impl ListLocations {
6791        pub(crate) fn new(
6792            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6793        ) -> Self {
6794            Self(RequestBuilder::new(stub))
6795        }
6796
6797        /// Sets the full request, replacing any prior values.
6798        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
6799            mut self,
6800            v: V,
6801        ) -> Self {
6802            self.0.request = v.into();
6803            self
6804        }
6805
6806        /// Sets all the options, replacing any prior values.
6807        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6808            self.0.options = v.into();
6809            self
6810        }
6811
6812        /// Sends the request.
6813        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
6814            (*self.0.stub)
6815                .list_locations(self.0.request, self.0.options)
6816                .await
6817                .map(gax::response::Response::into_body)
6818        }
6819
6820        /// Streams each page in the collection.
6821        pub fn by_page(
6822            self,
6823        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
6824        {
6825            use std::clone::Clone;
6826            let token = self.0.request.page_token.clone();
6827            let execute = move |token: String| {
6828                let mut builder = self.clone();
6829                builder.0.request = builder.0.request.set_page_token(token);
6830                builder.send()
6831            };
6832            gax::paginator::internal::new_paginator(token, execute)
6833        }
6834
6835        /// Streams each item in the collection.
6836        pub fn by_item(
6837            self,
6838        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
6839        {
6840            use gax::paginator::Paginator;
6841            self.by_page().items()
6842        }
6843
6844        /// Sets the value of [name][location::model::ListLocationsRequest::name].
6845        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6846            self.0.request.name = v.into();
6847            self
6848        }
6849
6850        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
6851        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6852            self.0.request.filter = v.into();
6853            self
6854        }
6855
6856        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
6857        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6858            self.0.request.page_size = v.into();
6859            self
6860        }
6861
6862        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
6863        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6864            self.0.request.page_token = v.into();
6865            self
6866        }
6867    }
6868
6869    #[doc(hidden)]
6870    impl gax::options::internal::RequestBuilder for ListLocations {
6871        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6872            &mut self.0.options
6873        }
6874    }
6875
6876    /// The request builder for [ApiHubDiscovery::get_location][crate::client::ApiHubDiscovery::get_location] calls.
6877    ///
6878    /// # Example
6879    /// ```no_run
6880    /// # use google_cloud_apihub_v1::builder;
6881    /// use builder::api_hub_discovery::GetLocation;
6882    /// # tokio_test::block_on(async {
6883    ///
6884    /// let builder = prepare_request_builder();
6885    /// let response = builder.send().await?;
6886    /// # gax::Result::<()>::Ok(()) });
6887    ///
6888    /// fn prepare_request_builder() -> GetLocation {
6889    ///   # panic!();
6890    ///   // ... details omitted ...
6891    /// }
6892    /// ```
6893    #[derive(Clone, Debug)]
6894    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
6895
6896    impl GetLocation {
6897        pub(crate) fn new(
6898            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6899        ) -> Self {
6900            Self(RequestBuilder::new(stub))
6901        }
6902
6903        /// Sets the full request, replacing any prior values.
6904        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6905            self.0.request = v.into();
6906            self
6907        }
6908
6909        /// Sets all the options, replacing any prior values.
6910        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6911            self.0.options = v.into();
6912            self
6913        }
6914
6915        /// Sends the request.
6916        pub async fn send(self) -> Result<location::model::Location> {
6917            (*self.0.stub)
6918                .get_location(self.0.request, self.0.options)
6919                .await
6920                .map(gax::response::Response::into_body)
6921        }
6922
6923        /// Sets the value of [name][location::model::GetLocationRequest::name].
6924        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6925            self.0.request.name = v.into();
6926            self
6927        }
6928    }
6929
6930    #[doc(hidden)]
6931    impl gax::options::internal::RequestBuilder for GetLocation {
6932        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6933            &mut self.0.options
6934        }
6935    }
6936
6937    /// The request builder for [ApiHubDiscovery::list_operations][crate::client::ApiHubDiscovery::list_operations] calls.
6938    ///
6939    /// # Example
6940    /// ```no_run
6941    /// # use google_cloud_apihub_v1::builder;
6942    /// use builder::api_hub_discovery::ListOperations;
6943    /// # tokio_test::block_on(async {
6944    /// use gax::paginator::ItemPaginator;
6945    ///
6946    /// let builder = prepare_request_builder();
6947    /// let mut items = builder.by_item();
6948    /// while let Some(result) = items.next().await {
6949    ///   let item = result?;
6950    /// }
6951    /// # gax::Result::<()>::Ok(()) });
6952    ///
6953    /// fn prepare_request_builder() -> ListOperations {
6954    ///   # panic!();
6955    ///   // ... details omitted ...
6956    /// }
6957    /// ```
6958    #[derive(Clone, Debug)]
6959    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6960
6961    impl ListOperations {
6962        pub(crate) fn new(
6963            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6964        ) -> Self {
6965            Self(RequestBuilder::new(stub))
6966        }
6967
6968        /// Sets the full request, replacing any prior values.
6969        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6970            mut self,
6971            v: V,
6972        ) -> Self {
6973            self.0.request = v.into();
6974            self
6975        }
6976
6977        /// Sets all the options, replacing any prior values.
6978        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6979            self.0.options = v.into();
6980            self
6981        }
6982
6983        /// Sends the request.
6984        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6985            (*self.0.stub)
6986                .list_operations(self.0.request, self.0.options)
6987                .await
6988                .map(gax::response::Response::into_body)
6989        }
6990
6991        /// Streams each page in the collection.
6992        pub fn by_page(
6993            self,
6994        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6995        {
6996            use std::clone::Clone;
6997            let token = self.0.request.page_token.clone();
6998            let execute = move |token: String| {
6999                let mut builder = self.clone();
7000                builder.0.request = builder.0.request.set_page_token(token);
7001                builder.send()
7002            };
7003            gax::paginator::internal::new_paginator(token, execute)
7004        }
7005
7006        /// Streams each item in the collection.
7007        pub fn by_item(
7008            self,
7009        ) -> impl gax::paginator::ItemPaginator<
7010            longrunning::model::ListOperationsResponse,
7011            gax::error::Error,
7012        > {
7013            use gax::paginator::Paginator;
7014            self.by_page().items()
7015        }
7016
7017        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
7018        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7019            self.0.request.name = v.into();
7020            self
7021        }
7022
7023        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
7024        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7025            self.0.request.filter = v.into();
7026            self
7027        }
7028
7029        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
7030        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7031            self.0.request.page_size = v.into();
7032            self
7033        }
7034
7035        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
7036        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7037            self.0.request.page_token = v.into();
7038            self
7039        }
7040
7041        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
7042        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7043            self.0.request.return_partial_success = v.into();
7044            self
7045        }
7046    }
7047
7048    #[doc(hidden)]
7049    impl gax::options::internal::RequestBuilder for ListOperations {
7050        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7051            &mut self.0.options
7052        }
7053    }
7054
7055    /// The request builder for [ApiHubDiscovery::get_operation][crate::client::ApiHubDiscovery::get_operation] calls.
7056    ///
7057    /// # Example
7058    /// ```no_run
7059    /// # use google_cloud_apihub_v1::builder;
7060    /// use builder::api_hub_discovery::GetOperation;
7061    /// # tokio_test::block_on(async {
7062    ///
7063    /// let builder = prepare_request_builder();
7064    /// let response = builder.send().await?;
7065    /// # gax::Result::<()>::Ok(()) });
7066    ///
7067    /// fn prepare_request_builder() -> GetOperation {
7068    ///   # panic!();
7069    ///   // ... details omitted ...
7070    /// }
7071    /// ```
7072    #[derive(Clone, Debug)]
7073    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7074
7075    impl GetOperation {
7076        pub(crate) fn new(
7077            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
7078        ) -> Self {
7079            Self(RequestBuilder::new(stub))
7080        }
7081
7082        /// Sets the full request, replacing any prior values.
7083        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7084            mut self,
7085            v: V,
7086        ) -> Self {
7087            self.0.request = v.into();
7088            self
7089        }
7090
7091        /// Sets all the options, replacing any prior values.
7092        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7093            self.0.options = v.into();
7094            self
7095        }
7096
7097        /// Sends the request.
7098        pub async fn send(self) -> Result<longrunning::model::Operation> {
7099            (*self.0.stub)
7100                .get_operation(self.0.request, self.0.options)
7101                .await
7102                .map(gax::response::Response::into_body)
7103        }
7104
7105        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
7106        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7107            self.0.request.name = v.into();
7108            self
7109        }
7110    }
7111
7112    #[doc(hidden)]
7113    impl gax::options::internal::RequestBuilder for GetOperation {
7114        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7115            &mut self.0.options
7116        }
7117    }
7118
7119    /// The request builder for [ApiHubDiscovery::delete_operation][crate::client::ApiHubDiscovery::delete_operation] calls.
7120    ///
7121    /// # Example
7122    /// ```no_run
7123    /// # use google_cloud_apihub_v1::builder;
7124    /// use builder::api_hub_discovery::DeleteOperation;
7125    /// # tokio_test::block_on(async {
7126    ///
7127    /// let builder = prepare_request_builder();
7128    /// let response = builder.send().await?;
7129    /// # gax::Result::<()>::Ok(()) });
7130    ///
7131    /// fn prepare_request_builder() -> DeleteOperation {
7132    ///   # panic!();
7133    ///   // ... details omitted ...
7134    /// }
7135    /// ```
7136    #[derive(Clone, Debug)]
7137    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7138
7139    impl DeleteOperation {
7140        pub(crate) fn new(
7141            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
7142        ) -> Self {
7143            Self(RequestBuilder::new(stub))
7144        }
7145
7146        /// Sets the full request, replacing any prior values.
7147        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7148            mut self,
7149            v: V,
7150        ) -> Self {
7151            self.0.request = v.into();
7152            self
7153        }
7154
7155        /// Sets all the options, replacing any prior values.
7156        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7157            self.0.options = v.into();
7158            self
7159        }
7160
7161        /// Sends the request.
7162        pub async fn send(self) -> Result<()> {
7163            (*self.0.stub)
7164                .delete_operation(self.0.request, self.0.options)
7165                .await
7166                .map(gax::response::Response::into_body)
7167        }
7168
7169        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
7170        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7171            self.0.request.name = v.into();
7172            self
7173        }
7174    }
7175
7176    #[doc(hidden)]
7177    impl gax::options::internal::RequestBuilder for DeleteOperation {
7178        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7179            &mut self.0.options
7180        }
7181    }
7182
7183    /// The request builder for [ApiHubDiscovery::cancel_operation][crate::client::ApiHubDiscovery::cancel_operation] calls.
7184    ///
7185    /// # Example
7186    /// ```no_run
7187    /// # use google_cloud_apihub_v1::builder;
7188    /// use builder::api_hub_discovery::CancelOperation;
7189    /// # tokio_test::block_on(async {
7190    ///
7191    /// let builder = prepare_request_builder();
7192    /// let response = builder.send().await?;
7193    /// # gax::Result::<()>::Ok(()) });
7194    ///
7195    /// fn prepare_request_builder() -> CancelOperation {
7196    ///   # panic!();
7197    ///   // ... details omitted ...
7198    /// }
7199    /// ```
7200    #[derive(Clone, Debug)]
7201    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
7202
7203    impl CancelOperation {
7204        pub(crate) fn new(
7205            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
7206        ) -> Self {
7207            Self(RequestBuilder::new(stub))
7208        }
7209
7210        /// Sets the full request, replacing any prior values.
7211        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
7212            mut self,
7213            v: V,
7214        ) -> Self {
7215            self.0.request = v.into();
7216            self
7217        }
7218
7219        /// Sets all the options, replacing any prior values.
7220        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7221            self.0.options = v.into();
7222            self
7223        }
7224
7225        /// Sends the request.
7226        pub async fn send(self) -> Result<()> {
7227            (*self.0.stub)
7228                .cancel_operation(self.0.request, self.0.options)
7229                .await
7230                .map(gax::response::Response::into_body)
7231        }
7232
7233        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
7234        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7235            self.0.request.name = v.into();
7236            self
7237        }
7238    }
7239
7240    #[doc(hidden)]
7241    impl gax::options::internal::RequestBuilder for CancelOperation {
7242        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7243            &mut self.0.options
7244        }
7245    }
7246}
7247
7248pub mod host_project_registration_service {
7249    use crate::Result;
7250
7251    /// A builder for [HostProjectRegistrationService][crate::client::HostProjectRegistrationService].
7252    ///
7253    /// ```
7254    /// # tokio_test::block_on(async {
7255    /// # use google_cloud_apihub_v1::*;
7256    /// # use builder::host_project_registration_service::ClientBuilder;
7257    /// # use client::HostProjectRegistrationService;
7258    /// let builder : ClientBuilder = HostProjectRegistrationService::builder();
7259    /// let client = builder
7260    ///     .with_endpoint("https://apihub.googleapis.com")
7261    ///     .build().await?;
7262    /// # gax::client_builder::Result::<()>::Ok(()) });
7263    /// ```
7264    pub type ClientBuilder =
7265        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7266
7267    pub(crate) mod client {
7268        use super::super::super::client::HostProjectRegistrationService;
7269        pub struct Factory;
7270        impl gax::client_builder::internal::ClientFactory for Factory {
7271            type Client = HostProjectRegistrationService;
7272            type Credentials = gaxi::options::Credentials;
7273            async fn build(
7274                self,
7275                config: gaxi::options::ClientConfig,
7276            ) -> gax::client_builder::Result<Self::Client> {
7277                Self::Client::new(config).await
7278            }
7279        }
7280    }
7281
7282    /// Common implementation for [crate::client::HostProjectRegistrationService] request builders.
7283    #[derive(Clone, Debug)]
7284    pub(crate) struct RequestBuilder<R: std::default::Default> {
7285        stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7286        request: R,
7287        options: gax::options::RequestOptions,
7288    }
7289
7290    impl<R> RequestBuilder<R>
7291    where
7292        R: std::default::Default,
7293    {
7294        pub(crate) fn new(
7295            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7296        ) -> Self {
7297            Self {
7298                stub,
7299                request: R::default(),
7300                options: gax::options::RequestOptions::default(),
7301            }
7302        }
7303    }
7304
7305    /// The request builder for [HostProjectRegistrationService::create_host_project_registration][crate::client::HostProjectRegistrationService::create_host_project_registration] calls.
7306    ///
7307    /// # Example
7308    /// ```no_run
7309    /// # use google_cloud_apihub_v1::builder;
7310    /// use builder::host_project_registration_service::CreateHostProjectRegistration;
7311    /// # tokio_test::block_on(async {
7312    ///
7313    /// let builder = prepare_request_builder();
7314    /// let response = builder.send().await?;
7315    /// # gax::Result::<()>::Ok(()) });
7316    ///
7317    /// fn prepare_request_builder() -> CreateHostProjectRegistration {
7318    ///   # panic!();
7319    ///   // ... details omitted ...
7320    /// }
7321    /// ```
7322    #[derive(Clone, Debug)]
7323    pub struct CreateHostProjectRegistration(
7324        RequestBuilder<crate::model::CreateHostProjectRegistrationRequest>,
7325    );
7326
7327    impl CreateHostProjectRegistration {
7328        pub(crate) fn new(
7329            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7330        ) -> Self {
7331            Self(RequestBuilder::new(stub))
7332        }
7333
7334        /// Sets the full request, replacing any prior values.
7335        pub fn with_request<V: Into<crate::model::CreateHostProjectRegistrationRequest>>(
7336            mut self,
7337            v: V,
7338        ) -> Self {
7339            self.0.request = v.into();
7340            self
7341        }
7342
7343        /// Sets all the options, replacing any prior values.
7344        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7345            self.0.options = v.into();
7346            self
7347        }
7348
7349        /// Sends the request.
7350        pub async fn send(self) -> Result<crate::model::HostProjectRegistration> {
7351            (*self.0.stub)
7352                .create_host_project_registration(self.0.request, self.0.options)
7353                .await
7354                .map(gax::response::Response::into_body)
7355        }
7356
7357        /// Sets the value of [parent][crate::model::CreateHostProjectRegistrationRequest::parent].
7358        ///
7359        /// This is a **required** field for requests.
7360        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7361            self.0.request.parent = v.into();
7362            self
7363        }
7364
7365        /// Sets the value of [host_project_registration_id][crate::model::CreateHostProjectRegistrationRequest::host_project_registration_id].
7366        ///
7367        /// This is a **required** field for requests.
7368        pub fn set_host_project_registration_id<T: Into<std::string::String>>(
7369            mut self,
7370            v: T,
7371        ) -> Self {
7372            self.0.request.host_project_registration_id = v.into();
7373            self
7374        }
7375
7376        /// Sets the value of [host_project_registration][crate::model::CreateHostProjectRegistrationRequest::host_project_registration].
7377        ///
7378        /// This is a **required** field for requests.
7379        pub fn set_host_project_registration<T>(mut self, v: T) -> Self
7380        where
7381            T: std::convert::Into<crate::model::HostProjectRegistration>,
7382        {
7383            self.0.request.host_project_registration = std::option::Option::Some(v.into());
7384            self
7385        }
7386
7387        /// Sets or clears the value of [host_project_registration][crate::model::CreateHostProjectRegistrationRequest::host_project_registration].
7388        ///
7389        /// This is a **required** field for requests.
7390        pub fn set_or_clear_host_project_registration<T>(
7391            mut self,
7392            v: std::option::Option<T>,
7393        ) -> Self
7394        where
7395            T: std::convert::Into<crate::model::HostProjectRegistration>,
7396        {
7397            self.0.request.host_project_registration = v.map(|x| x.into());
7398            self
7399        }
7400    }
7401
7402    #[doc(hidden)]
7403    impl gax::options::internal::RequestBuilder for CreateHostProjectRegistration {
7404        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7405            &mut self.0.options
7406        }
7407    }
7408
7409    /// The request builder for [HostProjectRegistrationService::get_host_project_registration][crate::client::HostProjectRegistrationService::get_host_project_registration] calls.
7410    ///
7411    /// # Example
7412    /// ```no_run
7413    /// # use google_cloud_apihub_v1::builder;
7414    /// use builder::host_project_registration_service::GetHostProjectRegistration;
7415    /// # tokio_test::block_on(async {
7416    ///
7417    /// let builder = prepare_request_builder();
7418    /// let response = builder.send().await?;
7419    /// # gax::Result::<()>::Ok(()) });
7420    ///
7421    /// fn prepare_request_builder() -> GetHostProjectRegistration {
7422    ///   # panic!();
7423    ///   // ... details omitted ...
7424    /// }
7425    /// ```
7426    #[derive(Clone, Debug)]
7427    pub struct GetHostProjectRegistration(
7428        RequestBuilder<crate::model::GetHostProjectRegistrationRequest>,
7429    );
7430
7431    impl GetHostProjectRegistration {
7432        pub(crate) fn new(
7433            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7434        ) -> Self {
7435            Self(RequestBuilder::new(stub))
7436        }
7437
7438        /// Sets the full request, replacing any prior values.
7439        pub fn with_request<V: Into<crate::model::GetHostProjectRegistrationRequest>>(
7440            mut self,
7441            v: V,
7442        ) -> Self {
7443            self.0.request = v.into();
7444            self
7445        }
7446
7447        /// Sets all the options, replacing any prior values.
7448        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7449            self.0.options = v.into();
7450            self
7451        }
7452
7453        /// Sends the request.
7454        pub async fn send(self) -> Result<crate::model::HostProjectRegistration> {
7455            (*self.0.stub)
7456                .get_host_project_registration(self.0.request, self.0.options)
7457                .await
7458                .map(gax::response::Response::into_body)
7459        }
7460
7461        /// Sets the value of [name][crate::model::GetHostProjectRegistrationRequest::name].
7462        ///
7463        /// This is a **required** field for requests.
7464        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7465            self.0.request.name = v.into();
7466            self
7467        }
7468    }
7469
7470    #[doc(hidden)]
7471    impl gax::options::internal::RequestBuilder for GetHostProjectRegistration {
7472        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7473            &mut self.0.options
7474        }
7475    }
7476
7477    /// The request builder for [HostProjectRegistrationService::list_host_project_registrations][crate::client::HostProjectRegistrationService::list_host_project_registrations] calls.
7478    ///
7479    /// # Example
7480    /// ```no_run
7481    /// # use google_cloud_apihub_v1::builder;
7482    /// use builder::host_project_registration_service::ListHostProjectRegistrations;
7483    /// # tokio_test::block_on(async {
7484    /// use gax::paginator::ItemPaginator;
7485    ///
7486    /// let builder = prepare_request_builder();
7487    /// let mut items = builder.by_item();
7488    /// while let Some(result) = items.next().await {
7489    ///   let item = result?;
7490    /// }
7491    /// # gax::Result::<()>::Ok(()) });
7492    ///
7493    /// fn prepare_request_builder() -> ListHostProjectRegistrations {
7494    ///   # panic!();
7495    ///   // ... details omitted ...
7496    /// }
7497    /// ```
7498    #[derive(Clone, Debug)]
7499    pub struct ListHostProjectRegistrations(
7500        RequestBuilder<crate::model::ListHostProjectRegistrationsRequest>,
7501    );
7502
7503    impl ListHostProjectRegistrations {
7504        pub(crate) fn new(
7505            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7506        ) -> Self {
7507            Self(RequestBuilder::new(stub))
7508        }
7509
7510        /// Sets the full request, replacing any prior values.
7511        pub fn with_request<V: Into<crate::model::ListHostProjectRegistrationsRequest>>(
7512            mut self,
7513            v: V,
7514        ) -> Self {
7515            self.0.request = v.into();
7516            self
7517        }
7518
7519        /// Sets all the options, replacing any prior values.
7520        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7521            self.0.options = v.into();
7522            self
7523        }
7524
7525        /// Sends the request.
7526        pub async fn send(self) -> Result<crate::model::ListHostProjectRegistrationsResponse> {
7527            (*self.0.stub)
7528                .list_host_project_registrations(self.0.request, self.0.options)
7529                .await
7530                .map(gax::response::Response::into_body)
7531        }
7532
7533        /// Streams each page in the collection.
7534        pub fn by_page(
7535            self,
7536        ) -> impl gax::paginator::Paginator<
7537            crate::model::ListHostProjectRegistrationsResponse,
7538            gax::error::Error,
7539        > {
7540            use std::clone::Clone;
7541            let token = self.0.request.page_token.clone();
7542            let execute = move |token: String| {
7543                let mut builder = self.clone();
7544                builder.0.request = builder.0.request.set_page_token(token);
7545                builder.send()
7546            };
7547            gax::paginator::internal::new_paginator(token, execute)
7548        }
7549
7550        /// Streams each item in the collection.
7551        pub fn by_item(
7552            self,
7553        ) -> impl gax::paginator::ItemPaginator<
7554            crate::model::ListHostProjectRegistrationsResponse,
7555            gax::error::Error,
7556        > {
7557            use gax::paginator::Paginator;
7558            self.by_page().items()
7559        }
7560
7561        /// Sets the value of [parent][crate::model::ListHostProjectRegistrationsRequest::parent].
7562        ///
7563        /// This is a **required** field for requests.
7564        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7565            self.0.request.parent = v.into();
7566            self
7567        }
7568
7569        /// Sets the value of [page_size][crate::model::ListHostProjectRegistrationsRequest::page_size].
7570        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7571            self.0.request.page_size = v.into();
7572            self
7573        }
7574
7575        /// Sets the value of [page_token][crate::model::ListHostProjectRegistrationsRequest::page_token].
7576        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7577            self.0.request.page_token = v.into();
7578            self
7579        }
7580
7581        /// Sets the value of [filter][crate::model::ListHostProjectRegistrationsRequest::filter].
7582        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7583            self.0.request.filter = v.into();
7584            self
7585        }
7586
7587        /// Sets the value of [order_by][crate::model::ListHostProjectRegistrationsRequest::order_by].
7588        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7589            self.0.request.order_by = v.into();
7590            self
7591        }
7592    }
7593
7594    #[doc(hidden)]
7595    impl gax::options::internal::RequestBuilder for ListHostProjectRegistrations {
7596        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7597            &mut self.0.options
7598        }
7599    }
7600
7601    /// The request builder for [HostProjectRegistrationService::list_locations][crate::client::HostProjectRegistrationService::list_locations] calls.
7602    ///
7603    /// # Example
7604    /// ```no_run
7605    /// # use google_cloud_apihub_v1::builder;
7606    /// use builder::host_project_registration_service::ListLocations;
7607    /// # tokio_test::block_on(async {
7608    /// use gax::paginator::ItemPaginator;
7609    ///
7610    /// let builder = prepare_request_builder();
7611    /// let mut items = builder.by_item();
7612    /// while let Some(result) = items.next().await {
7613    ///   let item = result?;
7614    /// }
7615    /// # gax::Result::<()>::Ok(()) });
7616    ///
7617    /// fn prepare_request_builder() -> ListLocations {
7618    ///   # panic!();
7619    ///   // ... details omitted ...
7620    /// }
7621    /// ```
7622    #[derive(Clone, Debug)]
7623    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7624
7625    impl ListLocations {
7626        pub(crate) fn new(
7627            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7628        ) -> Self {
7629            Self(RequestBuilder::new(stub))
7630        }
7631
7632        /// Sets the full request, replacing any prior values.
7633        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7634            mut self,
7635            v: V,
7636        ) -> Self {
7637            self.0.request = v.into();
7638            self
7639        }
7640
7641        /// Sets all the options, replacing any prior values.
7642        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7643            self.0.options = v.into();
7644            self
7645        }
7646
7647        /// Sends the request.
7648        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7649            (*self.0.stub)
7650                .list_locations(self.0.request, self.0.options)
7651                .await
7652                .map(gax::response::Response::into_body)
7653        }
7654
7655        /// Streams each page in the collection.
7656        pub fn by_page(
7657            self,
7658        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7659        {
7660            use std::clone::Clone;
7661            let token = self.0.request.page_token.clone();
7662            let execute = move |token: String| {
7663                let mut builder = self.clone();
7664                builder.0.request = builder.0.request.set_page_token(token);
7665                builder.send()
7666            };
7667            gax::paginator::internal::new_paginator(token, execute)
7668        }
7669
7670        /// Streams each item in the collection.
7671        pub fn by_item(
7672            self,
7673        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7674        {
7675            use gax::paginator::Paginator;
7676            self.by_page().items()
7677        }
7678
7679        /// Sets the value of [name][location::model::ListLocationsRequest::name].
7680        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7681            self.0.request.name = v.into();
7682            self
7683        }
7684
7685        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
7686        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7687            self.0.request.filter = v.into();
7688            self
7689        }
7690
7691        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
7692        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7693            self.0.request.page_size = v.into();
7694            self
7695        }
7696
7697        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
7698        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7699            self.0.request.page_token = v.into();
7700            self
7701        }
7702    }
7703
7704    #[doc(hidden)]
7705    impl gax::options::internal::RequestBuilder for ListLocations {
7706        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7707            &mut self.0.options
7708        }
7709    }
7710
7711    /// The request builder for [HostProjectRegistrationService::get_location][crate::client::HostProjectRegistrationService::get_location] calls.
7712    ///
7713    /// # Example
7714    /// ```no_run
7715    /// # use google_cloud_apihub_v1::builder;
7716    /// use builder::host_project_registration_service::GetLocation;
7717    /// # tokio_test::block_on(async {
7718    ///
7719    /// let builder = prepare_request_builder();
7720    /// let response = builder.send().await?;
7721    /// # gax::Result::<()>::Ok(()) });
7722    ///
7723    /// fn prepare_request_builder() -> GetLocation {
7724    ///   # panic!();
7725    ///   // ... details omitted ...
7726    /// }
7727    /// ```
7728    #[derive(Clone, Debug)]
7729    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7730
7731    impl GetLocation {
7732        pub(crate) fn new(
7733            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7734        ) -> Self {
7735            Self(RequestBuilder::new(stub))
7736        }
7737
7738        /// Sets the full request, replacing any prior values.
7739        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7740            self.0.request = v.into();
7741            self
7742        }
7743
7744        /// Sets all the options, replacing any prior values.
7745        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7746            self.0.options = v.into();
7747            self
7748        }
7749
7750        /// Sends the request.
7751        pub async fn send(self) -> Result<location::model::Location> {
7752            (*self.0.stub)
7753                .get_location(self.0.request, self.0.options)
7754                .await
7755                .map(gax::response::Response::into_body)
7756        }
7757
7758        /// Sets the value of [name][location::model::GetLocationRequest::name].
7759        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7760            self.0.request.name = v.into();
7761            self
7762        }
7763    }
7764
7765    #[doc(hidden)]
7766    impl gax::options::internal::RequestBuilder for GetLocation {
7767        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7768            &mut self.0.options
7769        }
7770    }
7771
7772    /// The request builder for [HostProjectRegistrationService::list_operations][crate::client::HostProjectRegistrationService::list_operations] calls.
7773    ///
7774    /// # Example
7775    /// ```no_run
7776    /// # use google_cloud_apihub_v1::builder;
7777    /// use builder::host_project_registration_service::ListOperations;
7778    /// # tokio_test::block_on(async {
7779    /// use gax::paginator::ItemPaginator;
7780    ///
7781    /// let builder = prepare_request_builder();
7782    /// let mut items = builder.by_item();
7783    /// while let Some(result) = items.next().await {
7784    ///   let item = result?;
7785    /// }
7786    /// # gax::Result::<()>::Ok(()) });
7787    ///
7788    /// fn prepare_request_builder() -> ListOperations {
7789    ///   # panic!();
7790    ///   // ... details omitted ...
7791    /// }
7792    /// ```
7793    #[derive(Clone, Debug)]
7794    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7795
7796    impl ListOperations {
7797        pub(crate) fn new(
7798            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7799        ) -> Self {
7800            Self(RequestBuilder::new(stub))
7801        }
7802
7803        /// Sets the full request, replacing any prior values.
7804        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7805            mut self,
7806            v: V,
7807        ) -> Self {
7808            self.0.request = v.into();
7809            self
7810        }
7811
7812        /// Sets all the options, replacing any prior values.
7813        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7814            self.0.options = v.into();
7815            self
7816        }
7817
7818        /// Sends the request.
7819        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7820            (*self.0.stub)
7821                .list_operations(self.0.request, self.0.options)
7822                .await
7823                .map(gax::response::Response::into_body)
7824        }
7825
7826        /// Streams each page in the collection.
7827        pub fn by_page(
7828            self,
7829        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7830        {
7831            use std::clone::Clone;
7832            let token = self.0.request.page_token.clone();
7833            let execute = move |token: String| {
7834                let mut builder = self.clone();
7835                builder.0.request = builder.0.request.set_page_token(token);
7836                builder.send()
7837            };
7838            gax::paginator::internal::new_paginator(token, execute)
7839        }
7840
7841        /// Streams each item in the collection.
7842        pub fn by_item(
7843            self,
7844        ) -> impl gax::paginator::ItemPaginator<
7845            longrunning::model::ListOperationsResponse,
7846            gax::error::Error,
7847        > {
7848            use gax::paginator::Paginator;
7849            self.by_page().items()
7850        }
7851
7852        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
7853        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7854            self.0.request.name = v.into();
7855            self
7856        }
7857
7858        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
7859        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7860            self.0.request.filter = v.into();
7861            self
7862        }
7863
7864        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
7865        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7866            self.0.request.page_size = v.into();
7867            self
7868        }
7869
7870        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
7871        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7872            self.0.request.page_token = v.into();
7873            self
7874        }
7875
7876        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
7877        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7878            self.0.request.return_partial_success = v.into();
7879            self
7880        }
7881    }
7882
7883    #[doc(hidden)]
7884    impl gax::options::internal::RequestBuilder for ListOperations {
7885        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7886            &mut self.0.options
7887        }
7888    }
7889
7890    /// The request builder for [HostProjectRegistrationService::get_operation][crate::client::HostProjectRegistrationService::get_operation] calls.
7891    ///
7892    /// # Example
7893    /// ```no_run
7894    /// # use google_cloud_apihub_v1::builder;
7895    /// use builder::host_project_registration_service::GetOperation;
7896    /// # tokio_test::block_on(async {
7897    ///
7898    /// let builder = prepare_request_builder();
7899    /// let response = builder.send().await?;
7900    /// # gax::Result::<()>::Ok(()) });
7901    ///
7902    /// fn prepare_request_builder() -> GetOperation {
7903    ///   # panic!();
7904    ///   // ... details omitted ...
7905    /// }
7906    /// ```
7907    #[derive(Clone, Debug)]
7908    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7909
7910    impl GetOperation {
7911        pub(crate) fn new(
7912            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7913        ) -> Self {
7914            Self(RequestBuilder::new(stub))
7915        }
7916
7917        /// Sets the full request, replacing any prior values.
7918        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7919            mut self,
7920            v: V,
7921        ) -> Self {
7922            self.0.request = v.into();
7923            self
7924        }
7925
7926        /// Sets all the options, replacing any prior values.
7927        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7928            self.0.options = v.into();
7929            self
7930        }
7931
7932        /// Sends the request.
7933        pub async fn send(self) -> Result<longrunning::model::Operation> {
7934            (*self.0.stub)
7935                .get_operation(self.0.request, self.0.options)
7936                .await
7937                .map(gax::response::Response::into_body)
7938        }
7939
7940        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
7941        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7942            self.0.request.name = v.into();
7943            self
7944        }
7945    }
7946
7947    #[doc(hidden)]
7948    impl gax::options::internal::RequestBuilder for GetOperation {
7949        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7950            &mut self.0.options
7951        }
7952    }
7953
7954    /// The request builder for [HostProjectRegistrationService::delete_operation][crate::client::HostProjectRegistrationService::delete_operation] calls.
7955    ///
7956    /// # Example
7957    /// ```no_run
7958    /// # use google_cloud_apihub_v1::builder;
7959    /// use builder::host_project_registration_service::DeleteOperation;
7960    /// # tokio_test::block_on(async {
7961    ///
7962    /// let builder = prepare_request_builder();
7963    /// let response = builder.send().await?;
7964    /// # gax::Result::<()>::Ok(()) });
7965    ///
7966    /// fn prepare_request_builder() -> DeleteOperation {
7967    ///   # panic!();
7968    ///   // ... details omitted ...
7969    /// }
7970    /// ```
7971    #[derive(Clone, Debug)]
7972    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7973
7974    impl DeleteOperation {
7975        pub(crate) fn new(
7976            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7977        ) -> Self {
7978            Self(RequestBuilder::new(stub))
7979        }
7980
7981        /// Sets the full request, replacing any prior values.
7982        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7983            mut self,
7984            v: V,
7985        ) -> Self {
7986            self.0.request = v.into();
7987            self
7988        }
7989
7990        /// Sets all the options, replacing any prior values.
7991        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7992            self.0.options = v.into();
7993            self
7994        }
7995
7996        /// Sends the request.
7997        pub async fn send(self) -> Result<()> {
7998            (*self.0.stub)
7999                .delete_operation(self.0.request, self.0.options)
8000                .await
8001                .map(gax::response::Response::into_body)
8002        }
8003
8004        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
8005        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8006            self.0.request.name = v.into();
8007            self
8008        }
8009    }
8010
8011    #[doc(hidden)]
8012    impl gax::options::internal::RequestBuilder for DeleteOperation {
8013        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8014            &mut self.0.options
8015        }
8016    }
8017
8018    /// The request builder for [HostProjectRegistrationService::cancel_operation][crate::client::HostProjectRegistrationService::cancel_operation] calls.
8019    ///
8020    /// # Example
8021    /// ```no_run
8022    /// # use google_cloud_apihub_v1::builder;
8023    /// use builder::host_project_registration_service::CancelOperation;
8024    /// # tokio_test::block_on(async {
8025    ///
8026    /// let builder = prepare_request_builder();
8027    /// let response = builder.send().await?;
8028    /// # gax::Result::<()>::Ok(()) });
8029    ///
8030    /// fn prepare_request_builder() -> CancelOperation {
8031    ///   # panic!();
8032    ///   // ... details omitted ...
8033    /// }
8034    /// ```
8035    #[derive(Clone, Debug)]
8036    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8037
8038    impl CancelOperation {
8039        pub(crate) fn new(
8040            stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
8041        ) -> Self {
8042            Self(RequestBuilder::new(stub))
8043        }
8044
8045        /// Sets the full request, replacing any prior values.
8046        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8047            mut self,
8048            v: V,
8049        ) -> Self {
8050            self.0.request = v.into();
8051            self
8052        }
8053
8054        /// Sets all the options, replacing any prior values.
8055        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8056            self.0.options = v.into();
8057            self
8058        }
8059
8060        /// Sends the request.
8061        pub async fn send(self) -> Result<()> {
8062            (*self.0.stub)
8063                .cancel_operation(self.0.request, self.0.options)
8064                .await
8065                .map(gax::response::Response::into_body)
8066        }
8067
8068        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
8069        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8070            self.0.request.name = v.into();
8071            self
8072        }
8073    }
8074
8075    #[doc(hidden)]
8076    impl gax::options::internal::RequestBuilder for CancelOperation {
8077        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8078            &mut self.0.options
8079        }
8080    }
8081}
8082
8083pub mod linting_service {
8084    use crate::Result;
8085
8086    /// A builder for [LintingService][crate::client::LintingService].
8087    ///
8088    /// ```
8089    /// # tokio_test::block_on(async {
8090    /// # use google_cloud_apihub_v1::*;
8091    /// # use builder::linting_service::ClientBuilder;
8092    /// # use client::LintingService;
8093    /// let builder : ClientBuilder = LintingService::builder();
8094    /// let client = builder
8095    ///     .with_endpoint("https://apihub.googleapis.com")
8096    ///     .build().await?;
8097    /// # gax::client_builder::Result::<()>::Ok(()) });
8098    /// ```
8099    pub type ClientBuilder =
8100        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8101
8102    pub(crate) mod client {
8103        use super::super::super::client::LintingService;
8104        pub struct Factory;
8105        impl gax::client_builder::internal::ClientFactory for Factory {
8106            type Client = LintingService;
8107            type Credentials = gaxi::options::Credentials;
8108            async fn build(
8109                self,
8110                config: gaxi::options::ClientConfig,
8111            ) -> gax::client_builder::Result<Self::Client> {
8112                Self::Client::new(config).await
8113            }
8114        }
8115    }
8116
8117    /// Common implementation for [crate::client::LintingService] request builders.
8118    #[derive(Clone, Debug)]
8119    pub(crate) struct RequestBuilder<R: std::default::Default> {
8120        stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8121        request: R,
8122        options: gax::options::RequestOptions,
8123    }
8124
8125    impl<R> RequestBuilder<R>
8126    where
8127        R: std::default::Default,
8128    {
8129        pub(crate) fn new(
8130            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8131        ) -> Self {
8132            Self {
8133                stub,
8134                request: R::default(),
8135                options: gax::options::RequestOptions::default(),
8136            }
8137        }
8138    }
8139
8140    /// The request builder for [LintingService::get_style_guide][crate::client::LintingService::get_style_guide] calls.
8141    ///
8142    /// # Example
8143    /// ```no_run
8144    /// # use google_cloud_apihub_v1::builder;
8145    /// use builder::linting_service::GetStyleGuide;
8146    /// # tokio_test::block_on(async {
8147    ///
8148    /// let builder = prepare_request_builder();
8149    /// let response = builder.send().await?;
8150    /// # gax::Result::<()>::Ok(()) });
8151    ///
8152    /// fn prepare_request_builder() -> GetStyleGuide {
8153    ///   # panic!();
8154    ///   // ... details omitted ...
8155    /// }
8156    /// ```
8157    #[derive(Clone, Debug)]
8158    pub struct GetStyleGuide(RequestBuilder<crate::model::GetStyleGuideRequest>);
8159
8160    impl GetStyleGuide {
8161        pub(crate) fn new(
8162            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8163        ) -> Self {
8164            Self(RequestBuilder::new(stub))
8165        }
8166
8167        /// Sets the full request, replacing any prior values.
8168        pub fn with_request<V: Into<crate::model::GetStyleGuideRequest>>(mut self, v: V) -> Self {
8169            self.0.request = v.into();
8170            self
8171        }
8172
8173        /// Sets all the options, replacing any prior values.
8174        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8175            self.0.options = v.into();
8176            self
8177        }
8178
8179        /// Sends the request.
8180        pub async fn send(self) -> Result<crate::model::StyleGuide> {
8181            (*self.0.stub)
8182                .get_style_guide(self.0.request, self.0.options)
8183                .await
8184                .map(gax::response::Response::into_body)
8185        }
8186
8187        /// Sets the value of [name][crate::model::GetStyleGuideRequest::name].
8188        ///
8189        /// This is a **required** field for requests.
8190        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8191            self.0.request.name = v.into();
8192            self
8193        }
8194    }
8195
8196    #[doc(hidden)]
8197    impl gax::options::internal::RequestBuilder for GetStyleGuide {
8198        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8199            &mut self.0.options
8200        }
8201    }
8202
8203    /// The request builder for [LintingService::update_style_guide][crate::client::LintingService::update_style_guide] calls.
8204    ///
8205    /// # Example
8206    /// ```no_run
8207    /// # use google_cloud_apihub_v1::builder;
8208    /// use builder::linting_service::UpdateStyleGuide;
8209    /// # tokio_test::block_on(async {
8210    ///
8211    /// let builder = prepare_request_builder();
8212    /// let response = builder.send().await?;
8213    /// # gax::Result::<()>::Ok(()) });
8214    ///
8215    /// fn prepare_request_builder() -> UpdateStyleGuide {
8216    ///   # panic!();
8217    ///   // ... details omitted ...
8218    /// }
8219    /// ```
8220    #[derive(Clone, Debug)]
8221    pub struct UpdateStyleGuide(RequestBuilder<crate::model::UpdateStyleGuideRequest>);
8222
8223    impl UpdateStyleGuide {
8224        pub(crate) fn new(
8225            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8226        ) -> Self {
8227            Self(RequestBuilder::new(stub))
8228        }
8229
8230        /// Sets the full request, replacing any prior values.
8231        pub fn with_request<V: Into<crate::model::UpdateStyleGuideRequest>>(
8232            mut self,
8233            v: V,
8234        ) -> Self {
8235            self.0.request = v.into();
8236            self
8237        }
8238
8239        /// Sets all the options, replacing any prior values.
8240        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8241            self.0.options = v.into();
8242            self
8243        }
8244
8245        /// Sends the request.
8246        pub async fn send(self) -> Result<crate::model::StyleGuide> {
8247            (*self.0.stub)
8248                .update_style_guide(self.0.request, self.0.options)
8249                .await
8250                .map(gax::response::Response::into_body)
8251        }
8252
8253        /// Sets the value of [style_guide][crate::model::UpdateStyleGuideRequest::style_guide].
8254        ///
8255        /// This is a **required** field for requests.
8256        pub fn set_style_guide<T>(mut self, v: T) -> Self
8257        where
8258            T: std::convert::Into<crate::model::StyleGuide>,
8259        {
8260            self.0.request.style_guide = std::option::Option::Some(v.into());
8261            self
8262        }
8263
8264        /// Sets or clears the value of [style_guide][crate::model::UpdateStyleGuideRequest::style_guide].
8265        ///
8266        /// This is a **required** field for requests.
8267        pub fn set_or_clear_style_guide<T>(mut self, v: std::option::Option<T>) -> Self
8268        where
8269            T: std::convert::Into<crate::model::StyleGuide>,
8270        {
8271            self.0.request.style_guide = v.map(|x| x.into());
8272            self
8273        }
8274
8275        /// Sets the value of [update_mask][crate::model::UpdateStyleGuideRequest::update_mask].
8276        pub fn set_update_mask<T>(mut self, v: T) -> Self
8277        where
8278            T: std::convert::Into<wkt::FieldMask>,
8279        {
8280            self.0.request.update_mask = std::option::Option::Some(v.into());
8281            self
8282        }
8283
8284        /// Sets or clears the value of [update_mask][crate::model::UpdateStyleGuideRequest::update_mask].
8285        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8286        where
8287            T: std::convert::Into<wkt::FieldMask>,
8288        {
8289            self.0.request.update_mask = v.map(|x| x.into());
8290            self
8291        }
8292    }
8293
8294    #[doc(hidden)]
8295    impl gax::options::internal::RequestBuilder for UpdateStyleGuide {
8296        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8297            &mut self.0.options
8298        }
8299    }
8300
8301    /// The request builder for [LintingService::get_style_guide_contents][crate::client::LintingService::get_style_guide_contents] calls.
8302    ///
8303    /// # Example
8304    /// ```no_run
8305    /// # use google_cloud_apihub_v1::builder;
8306    /// use builder::linting_service::GetStyleGuideContents;
8307    /// # tokio_test::block_on(async {
8308    ///
8309    /// let builder = prepare_request_builder();
8310    /// let response = builder.send().await?;
8311    /// # gax::Result::<()>::Ok(()) });
8312    ///
8313    /// fn prepare_request_builder() -> GetStyleGuideContents {
8314    ///   # panic!();
8315    ///   // ... details omitted ...
8316    /// }
8317    /// ```
8318    #[derive(Clone, Debug)]
8319    pub struct GetStyleGuideContents(RequestBuilder<crate::model::GetStyleGuideContentsRequest>);
8320
8321    impl GetStyleGuideContents {
8322        pub(crate) fn new(
8323            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8324        ) -> Self {
8325            Self(RequestBuilder::new(stub))
8326        }
8327
8328        /// Sets the full request, replacing any prior values.
8329        pub fn with_request<V: Into<crate::model::GetStyleGuideContentsRequest>>(
8330            mut self,
8331            v: V,
8332        ) -> Self {
8333            self.0.request = v.into();
8334            self
8335        }
8336
8337        /// Sets all the options, replacing any prior values.
8338        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8339            self.0.options = v.into();
8340            self
8341        }
8342
8343        /// Sends the request.
8344        pub async fn send(self) -> Result<crate::model::StyleGuideContents> {
8345            (*self.0.stub)
8346                .get_style_guide_contents(self.0.request, self.0.options)
8347                .await
8348                .map(gax::response::Response::into_body)
8349        }
8350
8351        /// Sets the value of [name][crate::model::GetStyleGuideContentsRequest::name].
8352        ///
8353        /// This is a **required** field for requests.
8354        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8355            self.0.request.name = v.into();
8356            self
8357        }
8358    }
8359
8360    #[doc(hidden)]
8361    impl gax::options::internal::RequestBuilder for GetStyleGuideContents {
8362        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8363            &mut self.0.options
8364        }
8365    }
8366
8367    /// The request builder for [LintingService::lint_spec][crate::client::LintingService::lint_spec] calls.
8368    ///
8369    /// # Example
8370    /// ```no_run
8371    /// # use google_cloud_apihub_v1::builder;
8372    /// use builder::linting_service::LintSpec;
8373    /// # tokio_test::block_on(async {
8374    ///
8375    /// let builder = prepare_request_builder();
8376    /// let response = builder.send().await?;
8377    /// # gax::Result::<()>::Ok(()) });
8378    ///
8379    /// fn prepare_request_builder() -> LintSpec {
8380    ///   # panic!();
8381    ///   // ... details omitted ...
8382    /// }
8383    /// ```
8384    #[derive(Clone, Debug)]
8385    pub struct LintSpec(RequestBuilder<crate::model::LintSpecRequest>);
8386
8387    impl LintSpec {
8388        pub(crate) fn new(
8389            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8390        ) -> Self {
8391            Self(RequestBuilder::new(stub))
8392        }
8393
8394        /// Sets the full request, replacing any prior values.
8395        pub fn with_request<V: Into<crate::model::LintSpecRequest>>(mut self, v: V) -> Self {
8396            self.0.request = v.into();
8397            self
8398        }
8399
8400        /// Sets all the options, replacing any prior values.
8401        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8402            self.0.options = v.into();
8403            self
8404        }
8405
8406        /// Sends the request.
8407        pub async fn send(self) -> Result<()> {
8408            (*self.0.stub)
8409                .lint_spec(self.0.request, self.0.options)
8410                .await
8411                .map(gax::response::Response::into_body)
8412        }
8413
8414        /// Sets the value of [name][crate::model::LintSpecRequest::name].
8415        ///
8416        /// This is a **required** field for requests.
8417        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8418            self.0.request.name = v.into();
8419            self
8420        }
8421    }
8422
8423    #[doc(hidden)]
8424    impl gax::options::internal::RequestBuilder for LintSpec {
8425        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8426            &mut self.0.options
8427        }
8428    }
8429
8430    /// The request builder for [LintingService::list_locations][crate::client::LintingService::list_locations] calls.
8431    ///
8432    /// # Example
8433    /// ```no_run
8434    /// # use google_cloud_apihub_v1::builder;
8435    /// use builder::linting_service::ListLocations;
8436    /// # tokio_test::block_on(async {
8437    /// use gax::paginator::ItemPaginator;
8438    ///
8439    /// let builder = prepare_request_builder();
8440    /// let mut items = builder.by_item();
8441    /// while let Some(result) = items.next().await {
8442    ///   let item = result?;
8443    /// }
8444    /// # gax::Result::<()>::Ok(()) });
8445    ///
8446    /// fn prepare_request_builder() -> ListLocations {
8447    ///   # panic!();
8448    ///   // ... details omitted ...
8449    /// }
8450    /// ```
8451    #[derive(Clone, Debug)]
8452    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
8453
8454    impl ListLocations {
8455        pub(crate) fn new(
8456            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8457        ) -> Self {
8458            Self(RequestBuilder::new(stub))
8459        }
8460
8461        /// Sets the full request, replacing any prior values.
8462        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
8463            mut self,
8464            v: V,
8465        ) -> Self {
8466            self.0.request = v.into();
8467            self
8468        }
8469
8470        /// Sets all the options, replacing any prior values.
8471        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8472            self.0.options = v.into();
8473            self
8474        }
8475
8476        /// Sends the request.
8477        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
8478            (*self.0.stub)
8479                .list_locations(self.0.request, self.0.options)
8480                .await
8481                .map(gax::response::Response::into_body)
8482        }
8483
8484        /// Streams each page in the collection.
8485        pub fn by_page(
8486            self,
8487        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
8488        {
8489            use std::clone::Clone;
8490            let token = self.0.request.page_token.clone();
8491            let execute = move |token: String| {
8492                let mut builder = self.clone();
8493                builder.0.request = builder.0.request.set_page_token(token);
8494                builder.send()
8495            };
8496            gax::paginator::internal::new_paginator(token, execute)
8497        }
8498
8499        /// Streams each item in the collection.
8500        pub fn by_item(
8501            self,
8502        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
8503        {
8504            use gax::paginator::Paginator;
8505            self.by_page().items()
8506        }
8507
8508        /// Sets the value of [name][location::model::ListLocationsRequest::name].
8509        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8510            self.0.request.name = v.into();
8511            self
8512        }
8513
8514        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
8515        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8516            self.0.request.filter = v.into();
8517            self
8518        }
8519
8520        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
8521        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8522            self.0.request.page_size = v.into();
8523            self
8524        }
8525
8526        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
8527        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8528            self.0.request.page_token = v.into();
8529            self
8530        }
8531    }
8532
8533    #[doc(hidden)]
8534    impl gax::options::internal::RequestBuilder for ListLocations {
8535        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8536            &mut self.0.options
8537        }
8538    }
8539
8540    /// The request builder for [LintingService::get_location][crate::client::LintingService::get_location] calls.
8541    ///
8542    /// # Example
8543    /// ```no_run
8544    /// # use google_cloud_apihub_v1::builder;
8545    /// use builder::linting_service::GetLocation;
8546    /// # tokio_test::block_on(async {
8547    ///
8548    /// let builder = prepare_request_builder();
8549    /// let response = builder.send().await?;
8550    /// # gax::Result::<()>::Ok(()) });
8551    ///
8552    /// fn prepare_request_builder() -> GetLocation {
8553    ///   # panic!();
8554    ///   // ... details omitted ...
8555    /// }
8556    /// ```
8557    #[derive(Clone, Debug)]
8558    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
8559
8560    impl GetLocation {
8561        pub(crate) fn new(
8562            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8563        ) -> Self {
8564            Self(RequestBuilder::new(stub))
8565        }
8566
8567        /// Sets the full request, replacing any prior values.
8568        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
8569            self.0.request = v.into();
8570            self
8571        }
8572
8573        /// Sets all the options, replacing any prior values.
8574        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8575            self.0.options = v.into();
8576            self
8577        }
8578
8579        /// Sends the request.
8580        pub async fn send(self) -> Result<location::model::Location> {
8581            (*self.0.stub)
8582                .get_location(self.0.request, self.0.options)
8583                .await
8584                .map(gax::response::Response::into_body)
8585        }
8586
8587        /// Sets the value of [name][location::model::GetLocationRequest::name].
8588        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8589            self.0.request.name = v.into();
8590            self
8591        }
8592    }
8593
8594    #[doc(hidden)]
8595    impl gax::options::internal::RequestBuilder for GetLocation {
8596        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8597            &mut self.0.options
8598        }
8599    }
8600
8601    /// The request builder for [LintingService::list_operations][crate::client::LintingService::list_operations] calls.
8602    ///
8603    /// # Example
8604    /// ```no_run
8605    /// # use google_cloud_apihub_v1::builder;
8606    /// use builder::linting_service::ListOperations;
8607    /// # tokio_test::block_on(async {
8608    /// use gax::paginator::ItemPaginator;
8609    ///
8610    /// let builder = prepare_request_builder();
8611    /// let mut items = builder.by_item();
8612    /// while let Some(result) = items.next().await {
8613    ///   let item = result?;
8614    /// }
8615    /// # gax::Result::<()>::Ok(()) });
8616    ///
8617    /// fn prepare_request_builder() -> ListOperations {
8618    ///   # panic!();
8619    ///   // ... details omitted ...
8620    /// }
8621    /// ```
8622    #[derive(Clone, Debug)]
8623    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8624
8625    impl ListOperations {
8626        pub(crate) fn new(
8627            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8628        ) -> Self {
8629            Self(RequestBuilder::new(stub))
8630        }
8631
8632        /// Sets the full request, replacing any prior values.
8633        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8634            mut self,
8635            v: V,
8636        ) -> Self {
8637            self.0.request = v.into();
8638            self
8639        }
8640
8641        /// Sets all the options, replacing any prior values.
8642        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8643            self.0.options = v.into();
8644            self
8645        }
8646
8647        /// Sends the request.
8648        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8649            (*self.0.stub)
8650                .list_operations(self.0.request, self.0.options)
8651                .await
8652                .map(gax::response::Response::into_body)
8653        }
8654
8655        /// Streams each page in the collection.
8656        pub fn by_page(
8657            self,
8658        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8659        {
8660            use std::clone::Clone;
8661            let token = self.0.request.page_token.clone();
8662            let execute = move |token: String| {
8663                let mut builder = self.clone();
8664                builder.0.request = builder.0.request.set_page_token(token);
8665                builder.send()
8666            };
8667            gax::paginator::internal::new_paginator(token, execute)
8668        }
8669
8670        /// Streams each item in the collection.
8671        pub fn by_item(
8672            self,
8673        ) -> impl gax::paginator::ItemPaginator<
8674            longrunning::model::ListOperationsResponse,
8675            gax::error::Error,
8676        > {
8677            use gax::paginator::Paginator;
8678            self.by_page().items()
8679        }
8680
8681        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
8682        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8683            self.0.request.name = v.into();
8684            self
8685        }
8686
8687        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
8688        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8689            self.0.request.filter = v.into();
8690            self
8691        }
8692
8693        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
8694        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8695            self.0.request.page_size = v.into();
8696            self
8697        }
8698
8699        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
8700        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8701            self.0.request.page_token = v.into();
8702            self
8703        }
8704
8705        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
8706        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8707            self.0.request.return_partial_success = v.into();
8708            self
8709        }
8710    }
8711
8712    #[doc(hidden)]
8713    impl gax::options::internal::RequestBuilder for ListOperations {
8714        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8715            &mut self.0.options
8716        }
8717    }
8718
8719    /// The request builder for [LintingService::get_operation][crate::client::LintingService::get_operation] calls.
8720    ///
8721    /// # Example
8722    /// ```no_run
8723    /// # use google_cloud_apihub_v1::builder;
8724    /// use builder::linting_service::GetOperation;
8725    /// # tokio_test::block_on(async {
8726    ///
8727    /// let builder = prepare_request_builder();
8728    /// let response = builder.send().await?;
8729    /// # gax::Result::<()>::Ok(()) });
8730    ///
8731    /// fn prepare_request_builder() -> GetOperation {
8732    ///   # panic!();
8733    ///   // ... details omitted ...
8734    /// }
8735    /// ```
8736    #[derive(Clone, Debug)]
8737    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8738
8739    impl GetOperation {
8740        pub(crate) fn new(
8741            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8742        ) -> Self {
8743            Self(RequestBuilder::new(stub))
8744        }
8745
8746        /// Sets the full request, replacing any prior values.
8747        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8748            mut self,
8749            v: V,
8750        ) -> Self {
8751            self.0.request = v.into();
8752            self
8753        }
8754
8755        /// Sets all the options, replacing any prior values.
8756        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8757            self.0.options = v.into();
8758            self
8759        }
8760
8761        /// Sends the request.
8762        pub async fn send(self) -> Result<longrunning::model::Operation> {
8763            (*self.0.stub)
8764                .get_operation(self.0.request, self.0.options)
8765                .await
8766                .map(gax::response::Response::into_body)
8767        }
8768
8769        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
8770        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8771            self.0.request.name = v.into();
8772            self
8773        }
8774    }
8775
8776    #[doc(hidden)]
8777    impl gax::options::internal::RequestBuilder for GetOperation {
8778        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8779            &mut self.0.options
8780        }
8781    }
8782
8783    /// The request builder for [LintingService::delete_operation][crate::client::LintingService::delete_operation] calls.
8784    ///
8785    /// # Example
8786    /// ```no_run
8787    /// # use google_cloud_apihub_v1::builder;
8788    /// use builder::linting_service::DeleteOperation;
8789    /// # tokio_test::block_on(async {
8790    ///
8791    /// let builder = prepare_request_builder();
8792    /// let response = builder.send().await?;
8793    /// # gax::Result::<()>::Ok(()) });
8794    ///
8795    /// fn prepare_request_builder() -> DeleteOperation {
8796    ///   # panic!();
8797    ///   // ... details omitted ...
8798    /// }
8799    /// ```
8800    #[derive(Clone, Debug)]
8801    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8802
8803    impl DeleteOperation {
8804        pub(crate) fn new(
8805            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8806        ) -> Self {
8807            Self(RequestBuilder::new(stub))
8808        }
8809
8810        /// Sets the full request, replacing any prior values.
8811        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8812            mut self,
8813            v: V,
8814        ) -> Self {
8815            self.0.request = v.into();
8816            self
8817        }
8818
8819        /// Sets all the options, replacing any prior values.
8820        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8821            self.0.options = v.into();
8822            self
8823        }
8824
8825        /// Sends the request.
8826        pub async fn send(self) -> Result<()> {
8827            (*self.0.stub)
8828                .delete_operation(self.0.request, self.0.options)
8829                .await
8830                .map(gax::response::Response::into_body)
8831        }
8832
8833        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
8834        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8835            self.0.request.name = v.into();
8836            self
8837        }
8838    }
8839
8840    #[doc(hidden)]
8841    impl gax::options::internal::RequestBuilder for DeleteOperation {
8842        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8843            &mut self.0.options
8844        }
8845    }
8846
8847    /// The request builder for [LintingService::cancel_operation][crate::client::LintingService::cancel_operation] calls.
8848    ///
8849    /// # Example
8850    /// ```no_run
8851    /// # use google_cloud_apihub_v1::builder;
8852    /// use builder::linting_service::CancelOperation;
8853    /// # tokio_test::block_on(async {
8854    ///
8855    /// let builder = prepare_request_builder();
8856    /// let response = builder.send().await?;
8857    /// # gax::Result::<()>::Ok(()) });
8858    ///
8859    /// fn prepare_request_builder() -> CancelOperation {
8860    ///   # panic!();
8861    ///   // ... details omitted ...
8862    /// }
8863    /// ```
8864    #[derive(Clone, Debug)]
8865    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8866
8867    impl CancelOperation {
8868        pub(crate) fn new(
8869            stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8870        ) -> Self {
8871            Self(RequestBuilder::new(stub))
8872        }
8873
8874        /// Sets the full request, replacing any prior values.
8875        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8876            mut self,
8877            v: V,
8878        ) -> Self {
8879            self.0.request = v.into();
8880            self
8881        }
8882
8883        /// Sets all the options, replacing any prior values.
8884        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8885            self.0.options = v.into();
8886            self
8887        }
8888
8889        /// Sends the request.
8890        pub async fn send(self) -> Result<()> {
8891            (*self.0.stub)
8892                .cancel_operation(self.0.request, self.0.options)
8893                .await
8894                .map(gax::response::Response::into_body)
8895        }
8896
8897        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
8898        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8899            self.0.request.name = v.into();
8900            self
8901        }
8902    }
8903
8904    #[doc(hidden)]
8905    impl gax::options::internal::RequestBuilder for CancelOperation {
8906        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8907            &mut self.0.options
8908        }
8909    }
8910}
8911
8912pub mod api_hub_plugin {
8913    use crate::Result;
8914
8915    /// A builder for [ApiHubPlugin][crate::client::ApiHubPlugin].
8916    ///
8917    /// ```
8918    /// # tokio_test::block_on(async {
8919    /// # use google_cloud_apihub_v1::*;
8920    /// # use builder::api_hub_plugin::ClientBuilder;
8921    /// # use client::ApiHubPlugin;
8922    /// let builder : ClientBuilder = ApiHubPlugin::builder();
8923    /// let client = builder
8924    ///     .with_endpoint("https://apihub.googleapis.com")
8925    ///     .build().await?;
8926    /// # gax::client_builder::Result::<()>::Ok(()) });
8927    /// ```
8928    pub type ClientBuilder =
8929        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8930
8931    pub(crate) mod client {
8932        use super::super::super::client::ApiHubPlugin;
8933        pub struct Factory;
8934        impl gax::client_builder::internal::ClientFactory for Factory {
8935            type Client = ApiHubPlugin;
8936            type Credentials = gaxi::options::Credentials;
8937            async fn build(
8938                self,
8939                config: gaxi::options::ClientConfig,
8940            ) -> gax::client_builder::Result<Self::Client> {
8941                Self::Client::new(config).await
8942            }
8943        }
8944    }
8945
8946    /// Common implementation for [crate::client::ApiHubPlugin] request builders.
8947    #[derive(Clone, Debug)]
8948    pub(crate) struct RequestBuilder<R: std::default::Default> {
8949        stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
8950        request: R,
8951        options: gax::options::RequestOptions,
8952    }
8953
8954    impl<R> RequestBuilder<R>
8955    where
8956        R: std::default::Default,
8957    {
8958        pub(crate) fn new(
8959            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
8960        ) -> Self {
8961            Self {
8962                stub,
8963                request: R::default(),
8964                options: gax::options::RequestOptions::default(),
8965            }
8966        }
8967    }
8968
8969    /// The request builder for [ApiHubPlugin::get_plugin][crate::client::ApiHubPlugin::get_plugin] calls.
8970    ///
8971    /// # Example
8972    /// ```no_run
8973    /// # use google_cloud_apihub_v1::builder;
8974    /// use builder::api_hub_plugin::GetPlugin;
8975    /// # tokio_test::block_on(async {
8976    ///
8977    /// let builder = prepare_request_builder();
8978    /// let response = builder.send().await?;
8979    /// # gax::Result::<()>::Ok(()) });
8980    ///
8981    /// fn prepare_request_builder() -> GetPlugin {
8982    ///   # panic!();
8983    ///   // ... details omitted ...
8984    /// }
8985    /// ```
8986    #[derive(Clone, Debug)]
8987    pub struct GetPlugin(RequestBuilder<crate::model::GetPluginRequest>);
8988
8989    impl GetPlugin {
8990        pub(crate) fn new(
8991            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
8992        ) -> Self {
8993            Self(RequestBuilder::new(stub))
8994        }
8995
8996        /// Sets the full request, replacing any prior values.
8997        pub fn with_request<V: Into<crate::model::GetPluginRequest>>(mut self, v: V) -> Self {
8998            self.0.request = v.into();
8999            self
9000        }
9001
9002        /// Sets all the options, replacing any prior values.
9003        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9004            self.0.options = v.into();
9005            self
9006        }
9007
9008        /// Sends the request.
9009        pub async fn send(self) -> Result<crate::model::Plugin> {
9010            (*self.0.stub)
9011                .get_plugin(self.0.request, self.0.options)
9012                .await
9013                .map(gax::response::Response::into_body)
9014        }
9015
9016        /// Sets the value of [name][crate::model::GetPluginRequest::name].
9017        ///
9018        /// This is a **required** field for requests.
9019        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9020            self.0.request.name = v.into();
9021            self
9022        }
9023    }
9024
9025    #[doc(hidden)]
9026    impl gax::options::internal::RequestBuilder for GetPlugin {
9027        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9028            &mut self.0.options
9029        }
9030    }
9031
9032    /// The request builder for [ApiHubPlugin::enable_plugin][crate::client::ApiHubPlugin::enable_plugin] calls.
9033    ///
9034    /// # Example
9035    /// ```no_run
9036    /// # use google_cloud_apihub_v1::builder;
9037    /// use builder::api_hub_plugin::EnablePlugin;
9038    /// # tokio_test::block_on(async {
9039    ///
9040    /// let builder = prepare_request_builder();
9041    /// let response = builder.send().await?;
9042    /// # gax::Result::<()>::Ok(()) });
9043    ///
9044    /// fn prepare_request_builder() -> EnablePlugin {
9045    ///   # panic!();
9046    ///   // ... details omitted ...
9047    /// }
9048    /// ```
9049    #[derive(Clone, Debug)]
9050    pub struct EnablePlugin(RequestBuilder<crate::model::EnablePluginRequest>);
9051
9052    impl EnablePlugin {
9053        pub(crate) fn new(
9054            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9055        ) -> Self {
9056            Self(RequestBuilder::new(stub))
9057        }
9058
9059        /// Sets the full request, replacing any prior values.
9060        pub fn with_request<V: Into<crate::model::EnablePluginRequest>>(mut self, v: V) -> Self {
9061            self.0.request = v.into();
9062            self
9063        }
9064
9065        /// Sets all the options, replacing any prior values.
9066        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9067            self.0.options = v.into();
9068            self
9069        }
9070
9071        /// Sends the request.
9072        pub async fn send(self) -> Result<crate::model::Plugin> {
9073            (*self.0.stub)
9074                .enable_plugin(self.0.request, self.0.options)
9075                .await
9076                .map(gax::response::Response::into_body)
9077        }
9078
9079        /// Sets the value of [name][crate::model::EnablePluginRequest::name].
9080        ///
9081        /// This is a **required** field for requests.
9082        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9083            self.0.request.name = v.into();
9084            self
9085        }
9086    }
9087
9088    #[doc(hidden)]
9089    impl gax::options::internal::RequestBuilder for EnablePlugin {
9090        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9091            &mut self.0.options
9092        }
9093    }
9094
9095    /// The request builder for [ApiHubPlugin::disable_plugin][crate::client::ApiHubPlugin::disable_plugin] calls.
9096    ///
9097    /// # Example
9098    /// ```no_run
9099    /// # use google_cloud_apihub_v1::builder;
9100    /// use builder::api_hub_plugin::DisablePlugin;
9101    /// # tokio_test::block_on(async {
9102    ///
9103    /// let builder = prepare_request_builder();
9104    /// let response = builder.send().await?;
9105    /// # gax::Result::<()>::Ok(()) });
9106    ///
9107    /// fn prepare_request_builder() -> DisablePlugin {
9108    ///   # panic!();
9109    ///   // ... details omitted ...
9110    /// }
9111    /// ```
9112    #[derive(Clone, Debug)]
9113    pub struct DisablePlugin(RequestBuilder<crate::model::DisablePluginRequest>);
9114
9115    impl DisablePlugin {
9116        pub(crate) fn new(
9117            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9118        ) -> Self {
9119            Self(RequestBuilder::new(stub))
9120        }
9121
9122        /// Sets the full request, replacing any prior values.
9123        pub fn with_request<V: Into<crate::model::DisablePluginRequest>>(mut self, v: V) -> Self {
9124            self.0.request = v.into();
9125            self
9126        }
9127
9128        /// Sets all the options, replacing any prior values.
9129        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9130            self.0.options = v.into();
9131            self
9132        }
9133
9134        /// Sends the request.
9135        pub async fn send(self) -> Result<crate::model::Plugin> {
9136            (*self.0.stub)
9137                .disable_plugin(self.0.request, self.0.options)
9138                .await
9139                .map(gax::response::Response::into_body)
9140        }
9141
9142        /// Sets the value of [name][crate::model::DisablePluginRequest::name].
9143        ///
9144        /// This is a **required** field for requests.
9145        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9146            self.0.request.name = v.into();
9147            self
9148        }
9149    }
9150
9151    #[doc(hidden)]
9152    impl gax::options::internal::RequestBuilder for DisablePlugin {
9153        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9154            &mut self.0.options
9155        }
9156    }
9157
9158    /// The request builder for [ApiHubPlugin::create_plugin][crate::client::ApiHubPlugin::create_plugin] calls.
9159    ///
9160    /// # Example
9161    /// ```no_run
9162    /// # use google_cloud_apihub_v1::builder;
9163    /// use builder::api_hub_plugin::CreatePlugin;
9164    /// # tokio_test::block_on(async {
9165    ///
9166    /// let builder = prepare_request_builder();
9167    /// let response = builder.send().await?;
9168    /// # gax::Result::<()>::Ok(()) });
9169    ///
9170    /// fn prepare_request_builder() -> CreatePlugin {
9171    ///   # panic!();
9172    ///   // ... details omitted ...
9173    /// }
9174    /// ```
9175    #[derive(Clone, Debug)]
9176    pub struct CreatePlugin(RequestBuilder<crate::model::CreatePluginRequest>);
9177
9178    impl CreatePlugin {
9179        pub(crate) fn new(
9180            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9181        ) -> Self {
9182            Self(RequestBuilder::new(stub))
9183        }
9184
9185        /// Sets the full request, replacing any prior values.
9186        pub fn with_request<V: Into<crate::model::CreatePluginRequest>>(mut self, v: V) -> Self {
9187            self.0.request = v.into();
9188            self
9189        }
9190
9191        /// Sets all the options, replacing any prior values.
9192        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9193            self.0.options = v.into();
9194            self
9195        }
9196
9197        /// Sends the request.
9198        pub async fn send(self) -> Result<crate::model::Plugin> {
9199            (*self.0.stub)
9200                .create_plugin(self.0.request, self.0.options)
9201                .await
9202                .map(gax::response::Response::into_body)
9203        }
9204
9205        /// Sets the value of [parent][crate::model::CreatePluginRequest::parent].
9206        ///
9207        /// This is a **required** field for requests.
9208        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9209            self.0.request.parent = v.into();
9210            self
9211        }
9212
9213        /// Sets the value of [plugin_id][crate::model::CreatePluginRequest::plugin_id].
9214        pub fn set_plugin_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9215            self.0.request.plugin_id = v.into();
9216            self
9217        }
9218
9219        /// Sets the value of [plugin][crate::model::CreatePluginRequest::plugin].
9220        ///
9221        /// This is a **required** field for requests.
9222        pub fn set_plugin<T>(mut self, v: T) -> Self
9223        where
9224            T: std::convert::Into<crate::model::Plugin>,
9225        {
9226            self.0.request.plugin = std::option::Option::Some(v.into());
9227            self
9228        }
9229
9230        /// Sets or clears the value of [plugin][crate::model::CreatePluginRequest::plugin].
9231        ///
9232        /// This is a **required** field for requests.
9233        pub fn set_or_clear_plugin<T>(mut self, v: std::option::Option<T>) -> Self
9234        where
9235            T: std::convert::Into<crate::model::Plugin>,
9236        {
9237            self.0.request.plugin = v.map(|x| x.into());
9238            self
9239        }
9240    }
9241
9242    #[doc(hidden)]
9243    impl gax::options::internal::RequestBuilder for CreatePlugin {
9244        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9245            &mut self.0.options
9246        }
9247    }
9248
9249    /// The request builder for [ApiHubPlugin::list_plugins][crate::client::ApiHubPlugin::list_plugins] calls.
9250    ///
9251    /// # Example
9252    /// ```no_run
9253    /// # use google_cloud_apihub_v1::builder;
9254    /// use builder::api_hub_plugin::ListPlugins;
9255    /// # tokio_test::block_on(async {
9256    /// use gax::paginator::ItemPaginator;
9257    ///
9258    /// let builder = prepare_request_builder();
9259    /// let mut items = builder.by_item();
9260    /// while let Some(result) = items.next().await {
9261    ///   let item = result?;
9262    /// }
9263    /// # gax::Result::<()>::Ok(()) });
9264    ///
9265    /// fn prepare_request_builder() -> ListPlugins {
9266    ///   # panic!();
9267    ///   // ... details omitted ...
9268    /// }
9269    /// ```
9270    #[derive(Clone, Debug)]
9271    pub struct ListPlugins(RequestBuilder<crate::model::ListPluginsRequest>);
9272
9273    impl ListPlugins {
9274        pub(crate) fn new(
9275            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9276        ) -> Self {
9277            Self(RequestBuilder::new(stub))
9278        }
9279
9280        /// Sets the full request, replacing any prior values.
9281        pub fn with_request<V: Into<crate::model::ListPluginsRequest>>(mut self, v: V) -> Self {
9282            self.0.request = v.into();
9283            self
9284        }
9285
9286        /// Sets all the options, replacing any prior values.
9287        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9288            self.0.options = v.into();
9289            self
9290        }
9291
9292        /// Sends the request.
9293        pub async fn send(self) -> Result<crate::model::ListPluginsResponse> {
9294            (*self.0.stub)
9295                .list_plugins(self.0.request, self.0.options)
9296                .await
9297                .map(gax::response::Response::into_body)
9298        }
9299
9300        /// Streams each page in the collection.
9301        pub fn by_page(
9302            self,
9303        ) -> impl gax::paginator::Paginator<crate::model::ListPluginsResponse, gax::error::Error>
9304        {
9305            use std::clone::Clone;
9306            let token = self.0.request.page_token.clone();
9307            let execute = move |token: String| {
9308                let mut builder = self.clone();
9309                builder.0.request = builder.0.request.set_page_token(token);
9310                builder.send()
9311            };
9312            gax::paginator::internal::new_paginator(token, execute)
9313        }
9314
9315        /// Streams each item in the collection.
9316        pub fn by_item(
9317            self,
9318        ) -> impl gax::paginator::ItemPaginator<crate::model::ListPluginsResponse, gax::error::Error>
9319        {
9320            use gax::paginator::Paginator;
9321            self.by_page().items()
9322        }
9323
9324        /// Sets the value of [parent][crate::model::ListPluginsRequest::parent].
9325        ///
9326        /// This is a **required** field for requests.
9327        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9328            self.0.request.parent = v.into();
9329            self
9330        }
9331
9332        /// Sets the value of [filter][crate::model::ListPluginsRequest::filter].
9333        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9334            self.0.request.filter = v.into();
9335            self
9336        }
9337
9338        /// Sets the value of [page_size][crate::model::ListPluginsRequest::page_size].
9339        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9340            self.0.request.page_size = v.into();
9341            self
9342        }
9343
9344        /// Sets the value of [page_token][crate::model::ListPluginsRequest::page_token].
9345        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9346            self.0.request.page_token = v.into();
9347            self
9348        }
9349    }
9350
9351    #[doc(hidden)]
9352    impl gax::options::internal::RequestBuilder for ListPlugins {
9353        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9354            &mut self.0.options
9355        }
9356    }
9357
9358    /// The request builder for [ApiHubPlugin::delete_plugin][crate::client::ApiHubPlugin::delete_plugin] calls.
9359    ///
9360    /// # Example
9361    /// ```no_run
9362    /// # use google_cloud_apihub_v1::builder;
9363    /// use builder::api_hub_plugin::DeletePlugin;
9364    /// # tokio_test::block_on(async {
9365    /// use lro::Poller;
9366    ///
9367    /// let builder = prepare_request_builder();
9368    /// let response = builder.poller().until_done().await?;
9369    /// # gax::Result::<()>::Ok(()) });
9370    ///
9371    /// fn prepare_request_builder() -> DeletePlugin {
9372    ///   # panic!();
9373    ///   // ... details omitted ...
9374    /// }
9375    /// ```
9376    #[derive(Clone, Debug)]
9377    pub struct DeletePlugin(RequestBuilder<crate::model::DeletePluginRequest>);
9378
9379    impl DeletePlugin {
9380        pub(crate) fn new(
9381            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9382        ) -> Self {
9383            Self(RequestBuilder::new(stub))
9384        }
9385
9386        /// Sets the full request, replacing any prior values.
9387        pub fn with_request<V: Into<crate::model::DeletePluginRequest>>(mut self, v: V) -> Self {
9388            self.0.request = v.into();
9389            self
9390        }
9391
9392        /// Sets all the options, replacing any prior values.
9393        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9394            self.0.options = v.into();
9395            self
9396        }
9397
9398        /// Sends the request.
9399        ///
9400        /// # Long running operations
9401        ///
9402        /// This starts, but does not poll, a longrunning operation. More information
9403        /// on [delete_plugin][crate::client::ApiHubPlugin::delete_plugin].
9404        pub async fn send(self) -> Result<longrunning::model::Operation> {
9405            (*self.0.stub)
9406                .delete_plugin(self.0.request, self.0.options)
9407                .await
9408                .map(gax::response::Response::into_body)
9409        }
9410
9411        /// Creates a [Poller][lro::Poller] to work with `delete_plugin`.
9412        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9413            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9414            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9415            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9416
9417            let stub = self.0.stub.clone();
9418            let mut options = self.0.options.clone();
9419            options.set_retry_policy(gax::retry_policy::NeverRetry);
9420            let query = move |name| {
9421                let stub = stub.clone();
9422                let options = options.clone();
9423                async {
9424                    let op = GetOperation::new(stub)
9425                        .set_name(name)
9426                        .with_options(options)
9427                        .send()
9428                        .await?;
9429                    Ok(Operation::new(op))
9430                }
9431            };
9432
9433            let start = move || async {
9434                let op = self.send().await?;
9435                Ok(Operation::new(op))
9436            };
9437
9438            lro::internal::new_unit_response_poller(
9439                polling_error_policy,
9440                polling_backoff_policy,
9441                start,
9442                query,
9443            )
9444        }
9445
9446        /// Sets the value of [name][crate::model::DeletePluginRequest::name].
9447        ///
9448        /// This is a **required** field for requests.
9449        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9450            self.0.request.name = v.into();
9451            self
9452        }
9453    }
9454
9455    #[doc(hidden)]
9456    impl gax::options::internal::RequestBuilder for DeletePlugin {
9457        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9458            &mut self.0.options
9459        }
9460    }
9461
9462    /// The request builder for [ApiHubPlugin::create_plugin_instance][crate::client::ApiHubPlugin::create_plugin_instance] calls.
9463    ///
9464    /// # Example
9465    /// ```no_run
9466    /// # use google_cloud_apihub_v1::builder;
9467    /// use builder::api_hub_plugin::CreatePluginInstance;
9468    /// # tokio_test::block_on(async {
9469    /// use lro::Poller;
9470    ///
9471    /// let builder = prepare_request_builder();
9472    /// let response = builder.poller().until_done().await?;
9473    /// # gax::Result::<()>::Ok(()) });
9474    ///
9475    /// fn prepare_request_builder() -> CreatePluginInstance {
9476    ///   # panic!();
9477    ///   // ... details omitted ...
9478    /// }
9479    /// ```
9480    #[derive(Clone, Debug)]
9481    pub struct CreatePluginInstance(RequestBuilder<crate::model::CreatePluginInstanceRequest>);
9482
9483    impl CreatePluginInstance {
9484        pub(crate) fn new(
9485            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9486        ) -> Self {
9487            Self(RequestBuilder::new(stub))
9488        }
9489
9490        /// Sets the full request, replacing any prior values.
9491        pub fn with_request<V: Into<crate::model::CreatePluginInstanceRequest>>(
9492            mut self,
9493            v: V,
9494        ) -> Self {
9495            self.0.request = v.into();
9496            self
9497        }
9498
9499        /// Sets all the options, replacing any prior values.
9500        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9501            self.0.options = v.into();
9502            self
9503        }
9504
9505        /// Sends the request.
9506        ///
9507        /// # Long running operations
9508        ///
9509        /// This starts, but does not poll, a longrunning operation. More information
9510        /// on [create_plugin_instance][crate::client::ApiHubPlugin::create_plugin_instance].
9511        pub async fn send(self) -> Result<longrunning::model::Operation> {
9512            (*self.0.stub)
9513                .create_plugin_instance(self.0.request, self.0.options)
9514                .await
9515                .map(gax::response::Response::into_body)
9516        }
9517
9518        /// Creates a [Poller][lro::Poller] to work with `create_plugin_instance`.
9519        pub fn poller(
9520            self,
9521        ) -> impl lro::Poller<crate::model::PluginInstance, crate::model::OperationMetadata>
9522        {
9523            type Operation = lro::internal::Operation<
9524                crate::model::PluginInstance,
9525                crate::model::OperationMetadata,
9526            >;
9527            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9528            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9529
9530            let stub = self.0.stub.clone();
9531            let mut options = self.0.options.clone();
9532            options.set_retry_policy(gax::retry_policy::NeverRetry);
9533            let query = move |name| {
9534                let stub = stub.clone();
9535                let options = options.clone();
9536                async {
9537                    let op = GetOperation::new(stub)
9538                        .set_name(name)
9539                        .with_options(options)
9540                        .send()
9541                        .await?;
9542                    Ok(Operation::new(op))
9543                }
9544            };
9545
9546            let start = move || async {
9547                let op = self.send().await?;
9548                Ok(Operation::new(op))
9549            };
9550
9551            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9552        }
9553
9554        /// Sets the value of [parent][crate::model::CreatePluginInstanceRequest::parent].
9555        ///
9556        /// This is a **required** field for requests.
9557        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9558            self.0.request.parent = v.into();
9559            self
9560        }
9561
9562        /// Sets the value of [plugin_instance_id][crate::model::CreatePluginInstanceRequest::plugin_instance_id].
9563        pub fn set_plugin_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9564            self.0.request.plugin_instance_id = v.into();
9565            self
9566        }
9567
9568        /// Sets the value of [plugin_instance][crate::model::CreatePluginInstanceRequest::plugin_instance].
9569        ///
9570        /// This is a **required** field for requests.
9571        pub fn set_plugin_instance<T>(mut self, v: T) -> Self
9572        where
9573            T: std::convert::Into<crate::model::PluginInstance>,
9574        {
9575            self.0.request.plugin_instance = std::option::Option::Some(v.into());
9576            self
9577        }
9578
9579        /// Sets or clears the value of [plugin_instance][crate::model::CreatePluginInstanceRequest::plugin_instance].
9580        ///
9581        /// This is a **required** field for requests.
9582        pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
9583        where
9584            T: std::convert::Into<crate::model::PluginInstance>,
9585        {
9586            self.0.request.plugin_instance = v.map(|x| x.into());
9587            self
9588        }
9589    }
9590
9591    #[doc(hidden)]
9592    impl gax::options::internal::RequestBuilder for CreatePluginInstance {
9593        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9594            &mut self.0.options
9595        }
9596    }
9597
9598    /// The request builder for [ApiHubPlugin::execute_plugin_instance_action][crate::client::ApiHubPlugin::execute_plugin_instance_action] calls.
9599    ///
9600    /// # Example
9601    /// ```no_run
9602    /// # use google_cloud_apihub_v1::builder;
9603    /// use builder::api_hub_plugin::ExecutePluginInstanceAction;
9604    /// # tokio_test::block_on(async {
9605    /// use lro::Poller;
9606    ///
9607    /// let builder = prepare_request_builder();
9608    /// let response = builder.poller().until_done().await?;
9609    /// # gax::Result::<()>::Ok(()) });
9610    ///
9611    /// fn prepare_request_builder() -> ExecutePluginInstanceAction {
9612    ///   # panic!();
9613    ///   // ... details omitted ...
9614    /// }
9615    /// ```
9616    #[derive(Clone, Debug)]
9617    pub struct ExecutePluginInstanceAction(
9618        RequestBuilder<crate::model::ExecutePluginInstanceActionRequest>,
9619    );
9620
9621    impl ExecutePluginInstanceAction {
9622        pub(crate) fn new(
9623            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9624        ) -> Self {
9625            Self(RequestBuilder::new(stub))
9626        }
9627
9628        /// Sets the full request, replacing any prior values.
9629        pub fn with_request<V: Into<crate::model::ExecutePluginInstanceActionRequest>>(
9630            mut self,
9631            v: V,
9632        ) -> Self {
9633            self.0.request = v.into();
9634            self
9635        }
9636
9637        /// Sets all the options, replacing any prior values.
9638        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9639            self.0.options = v.into();
9640            self
9641        }
9642
9643        /// Sends the request.
9644        ///
9645        /// # Long running operations
9646        ///
9647        /// This starts, but does not poll, a longrunning operation. More information
9648        /// on [execute_plugin_instance_action][crate::client::ApiHubPlugin::execute_plugin_instance_action].
9649        pub async fn send(self) -> Result<longrunning::model::Operation> {
9650            (*self.0.stub)
9651                .execute_plugin_instance_action(self.0.request, self.0.options)
9652                .await
9653                .map(gax::response::Response::into_body)
9654        }
9655
9656        /// Creates a [Poller][lro::Poller] to work with `execute_plugin_instance_action`.
9657        pub fn poller(
9658            self,
9659        ) -> impl lro::Poller<
9660            crate::model::ExecutePluginInstanceActionResponse,
9661            crate::model::OperationMetadata,
9662        > {
9663            type Operation = lro::internal::Operation<
9664                crate::model::ExecutePluginInstanceActionResponse,
9665                crate::model::OperationMetadata,
9666            >;
9667            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9668            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9669
9670            let stub = self.0.stub.clone();
9671            let mut options = self.0.options.clone();
9672            options.set_retry_policy(gax::retry_policy::NeverRetry);
9673            let query = move |name| {
9674                let stub = stub.clone();
9675                let options = options.clone();
9676                async {
9677                    let op = GetOperation::new(stub)
9678                        .set_name(name)
9679                        .with_options(options)
9680                        .send()
9681                        .await?;
9682                    Ok(Operation::new(op))
9683                }
9684            };
9685
9686            let start = move || async {
9687                let op = self.send().await?;
9688                Ok(Operation::new(op))
9689            };
9690
9691            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9692        }
9693
9694        /// Sets the value of [name][crate::model::ExecutePluginInstanceActionRequest::name].
9695        ///
9696        /// This is a **required** field for requests.
9697        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9698            self.0.request.name = v.into();
9699            self
9700        }
9701
9702        /// Sets the value of [action_execution_detail][crate::model::ExecutePluginInstanceActionRequest::action_execution_detail].
9703        ///
9704        /// This is a **required** field for requests.
9705        pub fn set_action_execution_detail<T>(mut self, v: T) -> Self
9706        where
9707            T: std::convert::Into<crate::model::ActionExecutionDetail>,
9708        {
9709            self.0.request.action_execution_detail = std::option::Option::Some(v.into());
9710            self
9711        }
9712
9713        /// Sets or clears the value of [action_execution_detail][crate::model::ExecutePluginInstanceActionRequest::action_execution_detail].
9714        ///
9715        /// This is a **required** field for requests.
9716        pub fn set_or_clear_action_execution_detail<T>(mut self, v: std::option::Option<T>) -> Self
9717        where
9718            T: std::convert::Into<crate::model::ActionExecutionDetail>,
9719        {
9720            self.0.request.action_execution_detail = v.map(|x| x.into());
9721            self
9722        }
9723    }
9724
9725    #[doc(hidden)]
9726    impl gax::options::internal::RequestBuilder for ExecutePluginInstanceAction {
9727        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9728            &mut self.0.options
9729        }
9730    }
9731
9732    /// The request builder for [ApiHubPlugin::get_plugin_instance][crate::client::ApiHubPlugin::get_plugin_instance] calls.
9733    ///
9734    /// # Example
9735    /// ```no_run
9736    /// # use google_cloud_apihub_v1::builder;
9737    /// use builder::api_hub_plugin::GetPluginInstance;
9738    /// # tokio_test::block_on(async {
9739    ///
9740    /// let builder = prepare_request_builder();
9741    /// let response = builder.send().await?;
9742    /// # gax::Result::<()>::Ok(()) });
9743    ///
9744    /// fn prepare_request_builder() -> GetPluginInstance {
9745    ///   # panic!();
9746    ///   // ... details omitted ...
9747    /// }
9748    /// ```
9749    #[derive(Clone, Debug)]
9750    pub struct GetPluginInstance(RequestBuilder<crate::model::GetPluginInstanceRequest>);
9751
9752    impl GetPluginInstance {
9753        pub(crate) fn new(
9754            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9755        ) -> Self {
9756            Self(RequestBuilder::new(stub))
9757        }
9758
9759        /// Sets the full request, replacing any prior values.
9760        pub fn with_request<V: Into<crate::model::GetPluginInstanceRequest>>(
9761            mut self,
9762            v: V,
9763        ) -> Self {
9764            self.0.request = v.into();
9765            self
9766        }
9767
9768        /// Sets all the options, replacing any prior values.
9769        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9770            self.0.options = v.into();
9771            self
9772        }
9773
9774        /// Sends the request.
9775        pub async fn send(self) -> Result<crate::model::PluginInstance> {
9776            (*self.0.stub)
9777                .get_plugin_instance(self.0.request, self.0.options)
9778                .await
9779                .map(gax::response::Response::into_body)
9780        }
9781
9782        /// Sets the value of [name][crate::model::GetPluginInstanceRequest::name].
9783        ///
9784        /// This is a **required** field for requests.
9785        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9786            self.0.request.name = v.into();
9787            self
9788        }
9789    }
9790
9791    #[doc(hidden)]
9792    impl gax::options::internal::RequestBuilder for GetPluginInstance {
9793        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9794            &mut self.0.options
9795        }
9796    }
9797
9798    /// The request builder for [ApiHubPlugin::list_plugin_instances][crate::client::ApiHubPlugin::list_plugin_instances] calls.
9799    ///
9800    /// # Example
9801    /// ```no_run
9802    /// # use google_cloud_apihub_v1::builder;
9803    /// use builder::api_hub_plugin::ListPluginInstances;
9804    /// # tokio_test::block_on(async {
9805    /// use gax::paginator::ItemPaginator;
9806    ///
9807    /// let builder = prepare_request_builder();
9808    /// let mut items = builder.by_item();
9809    /// while let Some(result) = items.next().await {
9810    ///   let item = result?;
9811    /// }
9812    /// # gax::Result::<()>::Ok(()) });
9813    ///
9814    /// fn prepare_request_builder() -> ListPluginInstances {
9815    ///   # panic!();
9816    ///   // ... details omitted ...
9817    /// }
9818    /// ```
9819    #[derive(Clone, Debug)]
9820    pub struct ListPluginInstances(RequestBuilder<crate::model::ListPluginInstancesRequest>);
9821
9822    impl ListPluginInstances {
9823        pub(crate) fn new(
9824            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9825        ) -> Self {
9826            Self(RequestBuilder::new(stub))
9827        }
9828
9829        /// Sets the full request, replacing any prior values.
9830        pub fn with_request<V: Into<crate::model::ListPluginInstancesRequest>>(
9831            mut self,
9832            v: V,
9833        ) -> Self {
9834            self.0.request = v.into();
9835            self
9836        }
9837
9838        /// Sets all the options, replacing any prior values.
9839        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9840            self.0.options = v.into();
9841            self
9842        }
9843
9844        /// Sends the request.
9845        pub async fn send(self) -> Result<crate::model::ListPluginInstancesResponse> {
9846            (*self.0.stub)
9847                .list_plugin_instances(self.0.request, self.0.options)
9848                .await
9849                .map(gax::response::Response::into_body)
9850        }
9851
9852        /// Streams each page in the collection.
9853        pub fn by_page(
9854            self,
9855        ) -> impl gax::paginator::Paginator<crate::model::ListPluginInstancesResponse, gax::error::Error>
9856        {
9857            use std::clone::Clone;
9858            let token = self.0.request.page_token.clone();
9859            let execute = move |token: String| {
9860                let mut builder = self.clone();
9861                builder.0.request = builder.0.request.set_page_token(token);
9862                builder.send()
9863            };
9864            gax::paginator::internal::new_paginator(token, execute)
9865        }
9866
9867        /// Streams each item in the collection.
9868        pub fn by_item(
9869            self,
9870        ) -> impl gax::paginator::ItemPaginator<
9871            crate::model::ListPluginInstancesResponse,
9872            gax::error::Error,
9873        > {
9874            use gax::paginator::Paginator;
9875            self.by_page().items()
9876        }
9877
9878        /// Sets the value of [parent][crate::model::ListPluginInstancesRequest::parent].
9879        ///
9880        /// This is a **required** field for requests.
9881        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9882            self.0.request.parent = v.into();
9883            self
9884        }
9885
9886        /// Sets the value of [filter][crate::model::ListPluginInstancesRequest::filter].
9887        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9888            self.0.request.filter = v.into();
9889            self
9890        }
9891
9892        /// Sets the value of [page_size][crate::model::ListPluginInstancesRequest::page_size].
9893        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9894            self.0.request.page_size = v.into();
9895            self
9896        }
9897
9898        /// Sets the value of [page_token][crate::model::ListPluginInstancesRequest::page_token].
9899        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9900            self.0.request.page_token = v.into();
9901            self
9902        }
9903    }
9904
9905    #[doc(hidden)]
9906    impl gax::options::internal::RequestBuilder for ListPluginInstances {
9907        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9908            &mut self.0.options
9909        }
9910    }
9911
9912    /// The request builder for [ApiHubPlugin::enable_plugin_instance_action][crate::client::ApiHubPlugin::enable_plugin_instance_action] calls.
9913    ///
9914    /// # Example
9915    /// ```no_run
9916    /// # use google_cloud_apihub_v1::builder;
9917    /// use builder::api_hub_plugin::EnablePluginInstanceAction;
9918    /// # tokio_test::block_on(async {
9919    /// use lro::Poller;
9920    ///
9921    /// let builder = prepare_request_builder();
9922    /// let response = builder.poller().until_done().await?;
9923    /// # gax::Result::<()>::Ok(()) });
9924    ///
9925    /// fn prepare_request_builder() -> EnablePluginInstanceAction {
9926    ///   # panic!();
9927    ///   // ... details omitted ...
9928    /// }
9929    /// ```
9930    #[derive(Clone, Debug)]
9931    pub struct EnablePluginInstanceAction(
9932        RequestBuilder<crate::model::EnablePluginInstanceActionRequest>,
9933    );
9934
9935    impl EnablePluginInstanceAction {
9936        pub(crate) fn new(
9937            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9938        ) -> Self {
9939            Self(RequestBuilder::new(stub))
9940        }
9941
9942        /// Sets the full request, replacing any prior values.
9943        pub fn with_request<V: Into<crate::model::EnablePluginInstanceActionRequest>>(
9944            mut self,
9945            v: V,
9946        ) -> Self {
9947            self.0.request = v.into();
9948            self
9949        }
9950
9951        /// Sets all the options, replacing any prior values.
9952        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9953            self.0.options = v.into();
9954            self
9955        }
9956
9957        /// Sends the request.
9958        ///
9959        /// # Long running operations
9960        ///
9961        /// This starts, but does not poll, a longrunning operation. More information
9962        /// on [enable_plugin_instance_action][crate::client::ApiHubPlugin::enable_plugin_instance_action].
9963        pub async fn send(self) -> Result<longrunning::model::Operation> {
9964            (*self.0.stub)
9965                .enable_plugin_instance_action(self.0.request, self.0.options)
9966                .await
9967                .map(gax::response::Response::into_body)
9968        }
9969
9970        /// Creates a [Poller][lro::Poller] to work with `enable_plugin_instance_action`.
9971        pub fn poller(
9972            self,
9973        ) -> impl lro::Poller<
9974            crate::model::EnablePluginInstanceActionResponse,
9975            crate::model::OperationMetadata,
9976        > {
9977            type Operation = lro::internal::Operation<
9978                crate::model::EnablePluginInstanceActionResponse,
9979                crate::model::OperationMetadata,
9980            >;
9981            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9982            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9983
9984            let stub = self.0.stub.clone();
9985            let mut options = self.0.options.clone();
9986            options.set_retry_policy(gax::retry_policy::NeverRetry);
9987            let query = move |name| {
9988                let stub = stub.clone();
9989                let options = options.clone();
9990                async {
9991                    let op = GetOperation::new(stub)
9992                        .set_name(name)
9993                        .with_options(options)
9994                        .send()
9995                        .await?;
9996                    Ok(Operation::new(op))
9997                }
9998            };
9999
10000            let start = move || async {
10001                let op = self.send().await?;
10002                Ok(Operation::new(op))
10003            };
10004
10005            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10006        }
10007
10008        /// Sets the value of [name][crate::model::EnablePluginInstanceActionRequest::name].
10009        ///
10010        /// This is a **required** field for requests.
10011        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10012            self.0.request.name = v.into();
10013            self
10014        }
10015
10016        /// Sets the value of [action_id][crate::model::EnablePluginInstanceActionRequest::action_id].
10017        ///
10018        /// This is a **required** field for requests.
10019        pub fn set_action_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10020            self.0.request.action_id = v.into();
10021            self
10022        }
10023    }
10024
10025    #[doc(hidden)]
10026    impl gax::options::internal::RequestBuilder for EnablePluginInstanceAction {
10027        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10028            &mut self.0.options
10029        }
10030    }
10031
10032    /// The request builder for [ApiHubPlugin::disable_plugin_instance_action][crate::client::ApiHubPlugin::disable_plugin_instance_action] calls.
10033    ///
10034    /// # Example
10035    /// ```no_run
10036    /// # use google_cloud_apihub_v1::builder;
10037    /// use builder::api_hub_plugin::DisablePluginInstanceAction;
10038    /// # tokio_test::block_on(async {
10039    /// use lro::Poller;
10040    ///
10041    /// let builder = prepare_request_builder();
10042    /// let response = builder.poller().until_done().await?;
10043    /// # gax::Result::<()>::Ok(()) });
10044    ///
10045    /// fn prepare_request_builder() -> DisablePluginInstanceAction {
10046    ///   # panic!();
10047    ///   // ... details omitted ...
10048    /// }
10049    /// ```
10050    #[derive(Clone, Debug)]
10051    pub struct DisablePluginInstanceAction(
10052        RequestBuilder<crate::model::DisablePluginInstanceActionRequest>,
10053    );
10054
10055    impl DisablePluginInstanceAction {
10056        pub(crate) fn new(
10057            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10058        ) -> Self {
10059            Self(RequestBuilder::new(stub))
10060        }
10061
10062        /// Sets the full request, replacing any prior values.
10063        pub fn with_request<V: Into<crate::model::DisablePluginInstanceActionRequest>>(
10064            mut self,
10065            v: V,
10066        ) -> Self {
10067            self.0.request = v.into();
10068            self
10069        }
10070
10071        /// Sets all the options, replacing any prior values.
10072        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10073            self.0.options = v.into();
10074            self
10075        }
10076
10077        /// Sends the request.
10078        ///
10079        /// # Long running operations
10080        ///
10081        /// This starts, but does not poll, a longrunning operation. More information
10082        /// on [disable_plugin_instance_action][crate::client::ApiHubPlugin::disable_plugin_instance_action].
10083        pub async fn send(self) -> Result<longrunning::model::Operation> {
10084            (*self.0.stub)
10085                .disable_plugin_instance_action(self.0.request, self.0.options)
10086                .await
10087                .map(gax::response::Response::into_body)
10088        }
10089
10090        /// Creates a [Poller][lro::Poller] to work with `disable_plugin_instance_action`.
10091        pub fn poller(
10092            self,
10093        ) -> impl lro::Poller<
10094            crate::model::DisablePluginInstanceActionResponse,
10095            crate::model::OperationMetadata,
10096        > {
10097            type Operation = lro::internal::Operation<
10098                crate::model::DisablePluginInstanceActionResponse,
10099                crate::model::OperationMetadata,
10100            >;
10101            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10102            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10103
10104            let stub = self.0.stub.clone();
10105            let mut options = self.0.options.clone();
10106            options.set_retry_policy(gax::retry_policy::NeverRetry);
10107            let query = move |name| {
10108                let stub = stub.clone();
10109                let options = options.clone();
10110                async {
10111                    let op = GetOperation::new(stub)
10112                        .set_name(name)
10113                        .with_options(options)
10114                        .send()
10115                        .await?;
10116                    Ok(Operation::new(op))
10117                }
10118            };
10119
10120            let start = move || async {
10121                let op = self.send().await?;
10122                Ok(Operation::new(op))
10123            };
10124
10125            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10126        }
10127
10128        /// Sets the value of [name][crate::model::DisablePluginInstanceActionRequest::name].
10129        ///
10130        /// This is a **required** field for requests.
10131        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10132            self.0.request.name = v.into();
10133            self
10134        }
10135
10136        /// Sets the value of [action_id][crate::model::DisablePluginInstanceActionRequest::action_id].
10137        ///
10138        /// This is a **required** field for requests.
10139        pub fn set_action_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10140            self.0.request.action_id = v.into();
10141            self
10142        }
10143    }
10144
10145    #[doc(hidden)]
10146    impl gax::options::internal::RequestBuilder for DisablePluginInstanceAction {
10147        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10148            &mut self.0.options
10149        }
10150    }
10151
10152    /// The request builder for [ApiHubPlugin::update_plugin_instance][crate::client::ApiHubPlugin::update_plugin_instance] calls.
10153    ///
10154    /// # Example
10155    /// ```no_run
10156    /// # use google_cloud_apihub_v1::builder;
10157    /// use builder::api_hub_plugin::UpdatePluginInstance;
10158    /// # tokio_test::block_on(async {
10159    ///
10160    /// let builder = prepare_request_builder();
10161    /// let response = builder.send().await?;
10162    /// # gax::Result::<()>::Ok(()) });
10163    ///
10164    /// fn prepare_request_builder() -> UpdatePluginInstance {
10165    ///   # panic!();
10166    ///   // ... details omitted ...
10167    /// }
10168    /// ```
10169    #[derive(Clone, Debug)]
10170    pub struct UpdatePluginInstance(RequestBuilder<crate::model::UpdatePluginInstanceRequest>);
10171
10172    impl UpdatePluginInstance {
10173        pub(crate) fn new(
10174            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10175        ) -> Self {
10176            Self(RequestBuilder::new(stub))
10177        }
10178
10179        /// Sets the full request, replacing any prior values.
10180        pub fn with_request<V: Into<crate::model::UpdatePluginInstanceRequest>>(
10181            mut self,
10182            v: V,
10183        ) -> Self {
10184            self.0.request = v.into();
10185            self
10186        }
10187
10188        /// Sets all the options, replacing any prior values.
10189        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10190            self.0.options = v.into();
10191            self
10192        }
10193
10194        /// Sends the request.
10195        pub async fn send(self) -> Result<crate::model::PluginInstance> {
10196            (*self.0.stub)
10197                .update_plugin_instance(self.0.request, self.0.options)
10198                .await
10199                .map(gax::response::Response::into_body)
10200        }
10201
10202        /// Sets the value of [plugin_instance][crate::model::UpdatePluginInstanceRequest::plugin_instance].
10203        ///
10204        /// This is a **required** field for requests.
10205        pub fn set_plugin_instance<T>(mut self, v: T) -> Self
10206        where
10207            T: std::convert::Into<crate::model::PluginInstance>,
10208        {
10209            self.0.request.plugin_instance = std::option::Option::Some(v.into());
10210            self
10211        }
10212
10213        /// Sets or clears the value of [plugin_instance][crate::model::UpdatePluginInstanceRequest::plugin_instance].
10214        ///
10215        /// This is a **required** field for requests.
10216        pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
10217        where
10218            T: std::convert::Into<crate::model::PluginInstance>,
10219        {
10220            self.0.request.plugin_instance = v.map(|x| x.into());
10221            self
10222        }
10223
10224        /// Sets the value of [update_mask][crate::model::UpdatePluginInstanceRequest::update_mask].
10225        pub fn set_update_mask<T>(mut self, v: T) -> Self
10226        where
10227            T: std::convert::Into<wkt::FieldMask>,
10228        {
10229            self.0.request.update_mask = std::option::Option::Some(v.into());
10230            self
10231        }
10232
10233        /// Sets or clears the value of [update_mask][crate::model::UpdatePluginInstanceRequest::update_mask].
10234        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10235        where
10236            T: std::convert::Into<wkt::FieldMask>,
10237        {
10238            self.0.request.update_mask = v.map(|x| x.into());
10239            self
10240        }
10241    }
10242
10243    #[doc(hidden)]
10244    impl gax::options::internal::RequestBuilder for UpdatePluginInstance {
10245        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10246            &mut self.0.options
10247        }
10248    }
10249
10250    /// The request builder for [ApiHubPlugin::delete_plugin_instance][crate::client::ApiHubPlugin::delete_plugin_instance] calls.
10251    ///
10252    /// # Example
10253    /// ```no_run
10254    /// # use google_cloud_apihub_v1::builder;
10255    /// use builder::api_hub_plugin::DeletePluginInstance;
10256    /// # tokio_test::block_on(async {
10257    /// use lro::Poller;
10258    ///
10259    /// let builder = prepare_request_builder();
10260    /// let response = builder.poller().until_done().await?;
10261    /// # gax::Result::<()>::Ok(()) });
10262    ///
10263    /// fn prepare_request_builder() -> DeletePluginInstance {
10264    ///   # panic!();
10265    ///   // ... details omitted ...
10266    /// }
10267    /// ```
10268    #[derive(Clone, Debug)]
10269    pub struct DeletePluginInstance(RequestBuilder<crate::model::DeletePluginInstanceRequest>);
10270
10271    impl DeletePluginInstance {
10272        pub(crate) fn new(
10273            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10274        ) -> Self {
10275            Self(RequestBuilder::new(stub))
10276        }
10277
10278        /// Sets the full request, replacing any prior values.
10279        pub fn with_request<V: Into<crate::model::DeletePluginInstanceRequest>>(
10280            mut self,
10281            v: V,
10282        ) -> Self {
10283            self.0.request = v.into();
10284            self
10285        }
10286
10287        /// Sets all the options, replacing any prior values.
10288        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10289            self.0.options = v.into();
10290            self
10291        }
10292
10293        /// Sends the request.
10294        ///
10295        /// # Long running operations
10296        ///
10297        /// This starts, but does not poll, a longrunning operation. More information
10298        /// on [delete_plugin_instance][crate::client::ApiHubPlugin::delete_plugin_instance].
10299        pub async fn send(self) -> Result<longrunning::model::Operation> {
10300            (*self.0.stub)
10301                .delete_plugin_instance(self.0.request, self.0.options)
10302                .await
10303                .map(gax::response::Response::into_body)
10304        }
10305
10306        /// Creates a [Poller][lro::Poller] to work with `delete_plugin_instance`.
10307        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10308            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10309            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10310            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10311
10312            let stub = self.0.stub.clone();
10313            let mut options = self.0.options.clone();
10314            options.set_retry_policy(gax::retry_policy::NeverRetry);
10315            let query = move |name| {
10316                let stub = stub.clone();
10317                let options = options.clone();
10318                async {
10319                    let op = GetOperation::new(stub)
10320                        .set_name(name)
10321                        .with_options(options)
10322                        .send()
10323                        .await?;
10324                    Ok(Operation::new(op))
10325                }
10326            };
10327
10328            let start = move || async {
10329                let op = self.send().await?;
10330                Ok(Operation::new(op))
10331            };
10332
10333            lro::internal::new_unit_response_poller(
10334                polling_error_policy,
10335                polling_backoff_policy,
10336                start,
10337                query,
10338            )
10339        }
10340
10341        /// Sets the value of [name][crate::model::DeletePluginInstanceRequest::name].
10342        ///
10343        /// This is a **required** field for requests.
10344        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10345            self.0.request.name = v.into();
10346            self
10347        }
10348    }
10349
10350    #[doc(hidden)]
10351    impl gax::options::internal::RequestBuilder for DeletePluginInstance {
10352        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10353            &mut self.0.options
10354        }
10355    }
10356
10357    /// The request builder for [ApiHubPlugin::list_locations][crate::client::ApiHubPlugin::list_locations] calls.
10358    ///
10359    /// # Example
10360    /// ```no_run
10361    /// # use google_cloud_apihub_v1::builder;
10362    /// use builder::api_hub_plugin::ListLocations;
10363    /// # tokio_test::block_on(async {
10364    /// use gax::paginator::ItemPaginator;
10365    ///
10366    /// let builder = prepare_request_builder();
10367    /// let mut items = builder.by_item();
10368    /// while let Some(result) = items.next().await {
10369    ///   let item = result?;
10370    /// }
10371    /// # gax::Result::<()>::Ok(()) });
10372    ///
10373    /// fn prepare_request_builder() -> ListLocations {
10374    ///   # panic!();
10375    ///   // ... details omitted ...
10376    /// }
10377    /// ```
10378    #[derive(Clone, Debug)]
10379    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10380
10381    impl ListLocations {
10382        pub(crate) fn new(
10383            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10384        ) -> Self {
10385            Self(RequestBuilder::new(stub))
10386        }
10387
10388        /// Sets the full request, replacing any prior values.
10389        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10390            mut self,
10391            v: V,
10392        ) -> Self {
10393            self.0.request = v.into();
10394            self
10395        }
10396
10397        /// Sets all the options, replacing any prior values.
10398        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10399            self.0.options = v.into();
10400            self
10401        }
10402
10403        /// Sends the request.
10404        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10405            (*self.0.stub)
10406                .list_locations(self.0.request, self.0.options)
10407                .await
10408                .map(gax::response::Response::into_body)
10409        }
10410
10411        /// Streams each page in the collection.
10412        pub fn by_page(
10413            self,
10414        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10415        {
10416            use std::clone::Clone;
10417            let token = self.0.request.page_token.clone();
10418            let execute = move |token: String| {
10419                let mut builder = self.clone();
10420                builder.0.request = builder.0.request.set_page_token(token);
10421                builder.send()
10422            };
10423            gax::paginator::internal::new_paginator(token, execute)
10424        }
10425
10426        /// Streams each item in the collection.
10427        pub fn by_item(
10428            self,
10429        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10430        {
10431            use gax::paginator::Paginator;
10432            self.by_page().items()
10433        }
10434
10435        /// Sets the value of [name][location::model::ListLocationsRequest::name].
10436        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10437            self.0.request.name = v.into();
10438            self
10439        }
10440
10441        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
10442        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10443            self.0.request.filter = v.into();
10444            self
10445        }
10446
10447        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
10448        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10449            self.0.request.page_size = v.into();
10450            self
10451        }
10452
10453        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
10454        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10455            self.0.request.page_token = v.into();
10456            self
10457        }
10458    }
10459
10460    #[doc(hidden)]
10461    impl gax::options::internal::RequestBuilder for ListLocations {
10462        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10463            &mut self.0.options
10464        }
10465    }
10466
10467    /// The request builder for [ApiHubPlugin::get_location][crate::client::ApiHubPlugin::get_location] calls.
10468    ///
10469    /// # Example
10470    /// ```no_run
10471    /// # use google_cloud_apihub_v1::builder;
10472    /// use builder::api_hub_plugin::GetLocation;
10473    /// # tokio_test::block_on(async {
10474    ///
10475    /// let builder = prepare_request_builder();
10476    /// let response = builder.send().await?;
10477    /// # gax::Result::<()>::Ok(()) });
10478    ///
10479    /// fn prepare_request_builder() -> GetLocation {
10480    ///   # panic!();
10481    ///   // ... details omitted ...
10482    /// }
10483    /// ```
10484    #[derive(Clone, Debug)]
10485    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10486
10487    impl GetLocation {
10488        pub(crate) fn new(
10489            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10490        ) -> Self {
10491            Self(RequestBuilder::new(stub))
10492        }
10493
10494        /// Sets the full request, replacing any prior values.
10495        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10496            self.0.request = v.into();
10497            self
10498        }
10499
10500        /// Sets all the options, replacing any prior values.
10501        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10502            self.0.options = v.into();
10503            self
10504        }
10505
10506        /// Sends the request.
10507        pub async fn send(self) -> Result<location::model::Location> {
10508            (*self.0.stub)
10509                .get_location(self.0.request, self.0.options)
10510                .await
10511                .map(gax::response::Response::into_body)
10512        }
10513
10514        /// Sets the value of [name][location::model::GetLocationRequest::name].
10515        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10516            self.0.request.name = v.into();
10517            self
10518        }
10519    }
10520
10521    #[doc(hidden)]
10522    impl gax::options::internal::RequestBuilder for GetLocation {
10523        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10524            &mut self.0.options
10525        }
10526    }
10527
10528    /// The request builder for [ApiHubPlugin::list_operations][crate::client::ApiHubPlugin::list_operations] calls.
10529    ///
10530    /// # Example
10531    /// ```no_run
10532    /// # use google_cloud_apihub_v1::builder;
10533    /// use builder::api_hub_plugin::ListOperations;
10534    /// # tokio_test::block_on(async {
10535    /// use gax::paginator::ItemPaginator;
10536    ///
10537    /// let builder = prepare_request_builder();
10538    /// let mut items = builder.by_item();
10539    /// while let Some(result) = items.next().await {
10540    ///   let item = result?;
10541    /// }
10542    /// # gax::Result::<()>::Ok(()) });
10543    ///
10544    /// fn prepare_request_builder() -> ListOperations {
10545    ///   # panic!();
10546    ///   // ... details omitted ...
10547    /// }
10548    /// ```
10549    #[derive(Clone, Debug)]
10550    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10551
10552    impl ListOperations {
10553        pub(crate) fn new(
10554            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10555        ) -> Self {
10556            Self(RequestBuilder::new(stub))
10557        }
10558
10559        /// Sets the full request, replacing any prior values.
10560        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10561            mut self,
10562            v: V,
10563        ) -> Self {
10564            self.0.request = v.into();
10565            self
10566        }
10567
10568        /// Sets all the options, replacing any prior values.
10569        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10570            self.0.options = v.into();
10571            self
10572        }
10573
10574        /// Sends the request.
10575        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10576            (*self.0.stub)
10577                .list_operations(self.0.request, self.0.options)
10578                .await
10579                .map(gax::response::Response::into_body)
10580        }
10581
10582        /// Streams each page in the collection.
10583        pub fn by_page(
10584            self,
10585        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10586        {
10587            use std::clone::Clone;
10588            let token = self.0.request.page_token.clone();
10589            let execute = move |token: String| {
10590                let mut builder = self.clone();
10591                builder.0.request = builder.0.request.set_page_token(token);
10592                builder.send()
10593            };
10594            gax::paginator::internal::new_paginator(token, execute)
10595        }
10596
10597        /// Streams each item in the collection.
10598        pub fn by_item(
10599            self,
10600        ) -> impl gax::paginator::ItemPaginator<
10601            longrunning::model::ListOperationsResponse,
10602            gax::error::Error,
10603        > {
10604            use gax::paginator::Paginator;
10605            self.by_page().items()
10606        }
10607
10608        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
10609        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10610            self.0.request.name = v.into();
10611            self
10612        }
10613
10614        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
10615        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10616            self.0.request.filter = v.into();
10617            self
10618        }
10619
10620        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
10621        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10622            self.0.request.page_size = v.into();
10623            self
10624        }
10625
10626        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
10627        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10628            self.0.request.page_token = v.into();
10629            self
10630        }
10631
10632        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
10633        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10634            self.0.request.return_partial_success = v.into();
10635            self
10636        }
10637    }
10638
10639    #[doc(hidden)]
10640    impl gax::options::internal::RequestBuilder for ListOperations {
10641        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10642            &mut self.0.options
10643        }
10644    }
10645
10646    /// The request builder for [ApiHubPlugin::get_operation][crate::client::ApiHubPlugin::get_operation] calls.
10647    ///
10648    /// # Example
10649    /// ```no_run
10650    /// # use google_cloud_apihub_v1::builder;
10651    /// use builder::api_hub_plugin::GetOperation;
10652    /// # tokio_test::block_on(async {
10653    ///
10654    /// let builder = prepare_request_builder();
10655    /// let response = builder.send().await?;
10656    /// # gax::Result::<()>::Ok(()) });
10657    ///
10658    /// fn prepare_request_builder() -> GetOperation {
10659    ///   # panic!();
10660    ///   // ... details omitted ...
10661    /// }
10662    /// ```
10663    #[derive(Clone, Debug)]
10664    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
10665
10666    impl GetOperation {
10667        pub(crate) fn new(
10668            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10669        ) -> Self {
10670            Self(RequestBuilder::new(stub))
10671        }
10672
10673        /// Sets the full request, replacing any prior values.
10674        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
10675            mut self,
10676            v: V,
10677        ) -> Self {
10678            self.0.request = v.into();
10679            self
10680        }
10681
10682        /// Sets all the options, replacing any prior values.
10683        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10684            self.0.options = v.into();
10685            self
10686        }
10687
10688        /// Sends the request.
10689        pub async fn send(self) -> Result<longrunning::model::Operation> {
10690            (*self.0.stub)
10691                .get_operation(self.0.request, self.0.options)
10692                .await
10693                .map(gax::response::Response::into_body)
10694        }
10695
10696        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
10697        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10698            self.0.request.name = v.into();
10699            self
10700        }
10701    }
10702
10703    #[doc(hidden)]
10704    impl gax::options::internal::RequestBuilder for GetOperation {
10705        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10706            &mut self.0.options
10707        }
10708    }
10709
10710    /// The request builder for [ApiHubPlugin::delete_operation][crate::client::ApiHubPlugin::delete_operation] calls.
10711    ///
10712    /// # Example
10713    /// ```no_run
10714    /// # use google_cloud_apihub_v1::builder;
10715    /// use builder::api_hub_plugin::DeleteOperation;
10716    /// # tokio_test::block_on(async {
10717    ///
10718    /// let builder = prepare_request_builder();
10719    /// let response = builder.send().await?;
10720    /// # gax::Result::<()>::Ok(()) });
10721    ///
10722    /// fn prepare_request_builder() -> DeleteOperation {
10723    ///   # panic!();
10724    ///   // ... details omitted ...
10725    /// }
10726    /// ```
10727    #[derive(Clone, Debug)]
10728    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
10729
10730    impl DeleteOperation {
10731        pub(crate) fn new(
10732            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10733        ) -> Self {
10734            Self(RequestBuilder::new(stub))
10735        }
10736
10737        /// Sets the full request, replacing any prior values.
10738        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
10739            mut self,
10740            v: V,
10741        ) -> Self {
10742            self.0.request = v.into();
10743            self
10744        }
10745
10746        /// Sets all the options, replacing any prior values.
10747        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10748            self.0.options = v.into();
10749            self
10750        }
10751
10752        /// Sends the request.
10753        pub async fn send(self) -> Result<()> {
10754            (*self.0.stub)
10755                .delete_operation(self.0.request, self.0.options)
10756                .await
10757                .map(gax::response::Response::into_body)
10758        }
10759
10760        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
10761        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10762            self.0.request.name = v.into();
10763            self
10764        }
10765    }
10766
10767    #[doc(hidden)]
10768    impl gax::options::internal::RequestBuilder for DeleteOperation {
10769        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10770            &mut self.0.options
10771        }
10772    }
10773
10774    /// The request builder for [ApiHubPlugin::cancel_operation][crate::client::ApiHubPlugin::cancel_operation] calls.
10775    ///
10776    /// # Example
10777    /// ```no_run
10778    /// # use google_cloud_apihub_v1::builder;
10779    /// use builder::api_hub_plugin::CancelOperation;
10780    /// # tokio_test::block_on(async {
10781    ///
10782    /// let builder = prepare_request_builder();
10783    /// let response = builder.send().await?;
10784    /// # gax::Result::<()>::Ok(()) });
10785    ///
10786    /// fn prepare_request_builder() -> CancelOperation {
10787    ///   # panic!();
10788    ///   // ... details omitted ...
10789    /// }
10790    /// ```
10791    #[derive(Clone, Debug)]
10792    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
10793
10794    impl CancelOperation {
10795        pub(crate) fn new(
10796            stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10797        ) -> Self {
10798            Self(RequestBuilder::new(stub))
10799        }
10800
10801        /// Sets the full request, replacing any prior values.
10802        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
10803            mut self,
10804            v: V,
10805        ) -> Self {
10806            self.0.request = v.into();
10807            self
10808        }
10809
10810        /// Sets all the options, replacing any prior values.
10811        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10812            self.0.options = v.into();
10813            self
10814        }
10815
10816        /// Sends the request.
10817        pub async fn send(self) -> Result<()> {
10818            (*self.0.stub)
10819                .cancel_operation(self.0.request, self.0.options)
10820                .await
10821                .map(gax::response::Response::into_body)
10822        }
10823
10824        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
10825        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10826            self.0.request.name = v.into();
10827            self
10828        }
10829    }
10830
10831    #[doc(hidden)]
10832    impl gax::options::internal::RequestBuilder for CancelOperation {
10833        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10834            &mut self.0.options
10835        }
10836    }
10837}
10838
10839pub mod provisioning {
10840    use crate::Result;
10841
10842    /// A builder for [Provisioning][crate::client::Provisioning].
10843    ///
10844    /// ```
10845    /// # tokio_test::block_on(async {
10846    /// # use google_cloud_apihub_v1::*;
10847    /// # use builder::provisioning::ClientBuilder;
10848    /// # use client::Provisioning;
10849    /// let builder : ClientBuilder = Provisioning::builder();
10850    /// let client = builder
10851    ///     .with_endpoint("https://apihub.googleapis.com")
10852    ///     .build().await?;
10853    /// # gax::client_builder::Result::<()>::Ok(()) });
10854    /// ```
10855    pub type ClientBuilder =
10856        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10857
10858    pub(crate) mod client {
10859        use super::super::super::client::Provisioning;
10860        pub struct Factory;
10861        impl gax::client_builder::internal::ClientFactory for Factory {
10862            type Client = Provisioning;
10863            type Credentials = gaxi::options::Credentials;
10864            async fn build(
10865                self,
10866                config: gaxi::options::ClientConfig,
10867            ) -> gax::client_builder::Result<Self::Client> {
10868                Self::Client::new(config).await
10869            }
10870        }
10871    }
10872
10873    /// Common implementation for [crate::client::Provisioning] request builders.
10874    #[derive(Clone, Debug)]
10875    pub(crate) struct RequestBuilder<R: std::default::Default> {
10876        stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
10877        request: R,
10878        options: gax::options::RequestOptions,
10879    }
10880
10881    impl<R> RequestBuilder<R>
10882    where
10883        R: std::default::Default,
10884    {
10885        pub(crate) fn new(
10886            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
10887        ) -> Self {
10888            Self {
10889                stub,
10890                request: R::default(),
10891                options: gax::options::RequestOptions::default(),
10892            }
10893        }
10894    }
10895
10896    /// The request builder for [Provisioning::create_api_hub_instance][crate::client::Provisioning::create_api_hub_instance] calls.
10897    ///
10898    /// # Example
10899    /// ```no_run
10900    /// # use google_cloud_apihub_v1::builder;
10901    /// use builder::provisioning::CreateApiHubInstance;
10902    /// # tokio_test::block_on(async {
10903    /// use lro::Poller;
10904    ///
10905    /// let builder = prepare_request_builder();
10906    /// let response = builder.poller().until_done().await?;
10907    /// # gax::Result::<()>::Ok(()) });
10908    ///
10909    /// fn prepare_request_builder() -> CreateApiHubInstance {
10910    ///   # panic!();
10911    ///   // ... details omitted ...
10912    /// }
10913    /// ```
10914    #[derive(Clone, Debug)]
10915    pub struct CreateApiHubInstance(RequestBuilder<crate::model::CreateApiHubInstanceRequest>);
10916
10917    impl CreateApiHubInstance {
10918        pub(crate) fn new(
10919            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
10920        ) -> Self {
10921            Self(RequestBuilder::new(stub))
10922        }
10923
10924        /// Sets the full request, replacing any prior values.
10925        pub fn with_request<V: Into<crate::model::CreateApiHubInstanceRequest>>(
10926            mut self,
10927            v: V,
10928        ) -> Self {
10929            self.0.request = v.into();
10930            self
10931        }
10932
10933        /// Sets all the options, replacing any prior values.
10934        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10935            self.0.options = v.into();
10936            self
10937        }
10938
10939        /// Sends the request.
10940        ///
10941        /// # Long running operations
10942        ///
10943        /// This starts, but does not poll, a longrunning operation. More information
10944        /// on [create_api_hub_instance][crate::client::Provisioning::create_api_hub_instance].
10945        pub async fn send(self) -> Result<longrunning::model::Operation> {
10946            (*self.0.stub)
10947                .create_api_hub_instance(self.0.request, self.0.options)
10948                .await
10949                .map(gax::response::Response::into_body)
10950        }
10951
10952        /// Creates a [Poller][lro::Poller] to work with `create_api_hub_instance`.
10953        pub fn poller(
10954            self,
10955        ) -> impl lro::Poller<crate::model::ApiHubInstance, crate::model::OperationMetadata>
10956        {
10957            type Operation = lro::internal::Operation<
10958                crate::model::ApiHubInstance,
10959                crate::model::OperationMetadata,
10960            >;
10961            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10962            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10963
10964            let stub = self.0.stub.clone();
10965            let mut options = self.0.options.clone();
10966            options.set_retry_policy(gax::retry_policy::NeverRetry);
10967            let query = move |name| {
10968                let stub = stub.clone();
10969                let options = options.clone();
10970                async {
10971                    let op = GetOperation::new(stub)
10972                        .set_name(name)
10973                        .with_options(options)
10974                        .send()
10975                        .await?;
10976                    Ok(Operation::new(op))
10977                }
10978            };
10979
10980            let start = move || async {
10981                let op = self.send().await?;
10982                Ok(Operation::new(op))
10983            };
10984
10985            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10986        }
10987
10988        /// Sets the value of [parent][crate::model::CreateApiHubInstanceRequest::parent].
10989        ///
10990        /// This is a **required** field for requests.
10991        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10992            self.0.request.parent = v.into();
10993            self
10994        }
10995
10996        /// Sets the value of [api_hub_instance_id][crate::model::CreateApiHubInstanceRequest::api_hub_instance_id].
10997        pub fn set_api_hub_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10998            self.0.request.api_hub_instance_id = v.into();
10999            self
11000        }
11001
11002        /// Sets the value of [api_hub_instance][crate::model::CreateApiHubInstanceRequest::api_hub_instance].
11003        ///
11004        /// This is a **required** field for requests.
11005        pub fn set_api_hub_instance<T>(mut self, v: T) -> Self
11006        where
11007            T: std::convert::Into<crate::model::ApiHubInstance>,
11008        {
11009            self.0.request.api_hub_instance = std::option::Option::Some(v.into());
11010            self
11011        }
11012
11013        /// Sets or clears the value of [api_hub_instance][crate::model::CreateApiHubInstanceRequest::api_hub_instance].
11014        ///
11015        /// This is a **required** field for requests.
11016        pub fn set_or_clear_api_hub_instance<T>(mut self, v: std::option::Option<T>) -> Self
11017        where
11018            T: std::convert::Into<crate::model::ApiHubInstance>,
11019        {
11020            self.0.request.api_hub_instance = v.map(|x| x.into());
11021            self
11022        }
11023    }
11024
11025    #[doc(hidden)]
11026    impl gax::options::internal::RequestBuilder for CreateApiHubInstance {
11027        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11028            &mut self.0.options
11029        }
11030    }
11031
11032    /// The request builder for [Provisioning::delete_api_hub_instance][crate::client::Provisioning::delete_api_hub_instance] calls.
11033    ///
11034    /// # Example
11035    /// ```no_run
11036    /// # use google_cloud_apihub_v1::builder;
11037    /// use builder::provisioning::DeleteApiHubInstance;
11038    /// # tokio_test::block_on(async {
11039    /// use lro::Poller;
11040    ///
11041    /// let builder = prepare_request_builder();
11042    /// let response = builder.poller().until_done().await?;
11043    /// # gax::Result::<()>::Ok(()) });
11044    ///
11045    /// fn prepare_request_builder() -> DeleteApiHubInstance {
11046    ///   # panic!();
11047    ///   // ... details omitted ...
11048    /// }
11049    /// ```
11050    #[derive(Clone, Debug)]
11051    pub struct DeleteApiHubInstance(RequestBuilder<crate::model::DeleteApiHubInstanceRequest>);
11052
11053    impl DeleteApiHubInstance {
11054        pub(crate) fn new(
11055            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11056        ) -> Self {
11057            Self(RequestBuilder::new(stub))
11058        }
11059
11060        /// Sets the full request, replacing any prior values.
11061        pub fn with_request<V: Into<crate::model::DeleteApiHubInstanceRequest>>(
11062            mut self,
11063            v: V,
11064        ) -> Self {
11065            self.0.request = v.into();
11066            self
11067        }
11068
11069        /// Sets all the options, replacing any prior values.
11070        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11071            self.0.options = v.into();
11072            self
11073        }
11074
11075        /// Sends the request.
11076        ///
11077        /// # Long running operations
11078        ///
11079        /// This starts, but does not poll, a longrunning operation. More information
11080        /// on [delete_api_hub_instance][crate::client::Provisioning::delete_api_hub_instance].
11081        pub async fn send(self) -> Result<longrunning::model::Operation> {
11082            (*self.0.stub)
11083                .delete_api_hub_instance(self.0.request, self.0.options)
11084                .await
11085                .map(gax::response::Response::into_body)
11086        }
11087
11088        /// Creates a [Poller][lro::Poller] to work with `delete_api_hub_instance`.
11089        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
11090            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11091            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11092            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11093
11094            let stub = self.0.stub.clone();
11095            let mut options = self.0.options.clone();
11096            options.set_retry_policy(gax::retry_policy::NeverRetry);
11097            let query = move |name| {
11098                let stub = stub.clone();
11099                let options = options.clone();
11100                async {
11101                    let op = GetOperation::new(stub)
11102                        .set_name(name)
11103                        .with_options(options)
11104                        .send()
11105                        .await?;
11106                    Ok(Operation::new(op))
11107                }
11108            };
11109
11110            let start = move || async {
11111                let op = self.send().await?;
11112                Ok(Operation::new(op))
11113            };
11114
11115            lro::internal::new_unit_response_poller(
11116                polling_error_policy,
11117                polling_backoff_policy,
11118                start,
11119                query,
11120            )
11121        }
11122
11123        /// Sets the value of [name][crate::model::DeleteApiHubInstanceRequest::name].
11124        ///
11125        /// This is a **required** field for requests.
11126        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11127            self.0.request.name = v.into();
11128            self
11129        }
11130    }
11131
11132    #[doc(hidden)]
11133    impl gax::options::internal::RequestBuilder for DeleteApiHubInstance {
11134        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11135            &mut self.0.options
11136        }
11137    }
11138
11139    /// The request builder for [Provisioning::get_api_hub_instance][crate::client::Provisioning::get_api_hub_instance] calls.
11140    ///
11141    /// # Example
11142    /// ```no_run
11143    /// # use google_cloud_apihub_v1::builder;
11144    /// use builder::provisioning::GetApiHubInstance;
11145    /// # tokio_test::block_on(async {
11146    ///
11147    /// let builder = prepare_request_builder();
11148    /// let response = builder.send().await?;
11149    /// # gax::Result::<()>::Ok(()) });
11150    ///
11151    /// fn prepare_request_builder() -> GetApiHubInstance {
11152    ///   # panic!();
11153    ///   // ... details omitted ...
11154    /// }
11155    /// ```
11156    #[derive(Clone, Debug)]
11157    pub struct GetApiHubInstance(RequestBuilder<crate::model::GetApiHubInstanceRequest>);
11158
11159    impl GetApiHubInstance {
11160        pub(crate) fn new(
11161            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11162        ) -> Self {
11163            Self(RequestBuilder::new(stub))
11164        }
11165
11166        /// Sets the full request, replacing any prior values.
11167        pub fn with_request<V: Into<crate::model::GetApiHubInstanceRequest>>(
11168            mut self,
11169            v: V,
11170        ) -> Self {
11171            self.0.request = v.into();
11172            self
11173        }
11174
11175        /// Sets all the options, replacing any prior values.
11176        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11177            self.0.options = v.into();
11178            self
11179        }
11180
11181        /// Sends the request.
11182        pub async fn send(self) -> Result<crate::model::ApiHubInstance> {
11183            (*self.0.stub)
11184                .get_api_hub_instance(self.0.request, self.0.options)
11185                .await
11186                .map(gax::response::Response::into_body)
11187        }
11188
11189        /// Sets the value of [name][crate::model::GetApiHubInstanceRequest::name].
11190        ///
11191        /// This is a **required** field for requests.
11192        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11193            self.0.request.name = v.into();
11194            self
11195        }
11196    }
11197
11198    #[doc(hidden)]
11199    impl gax::options::internal::RequestBuilder for GetApiHubInstance {
11200        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11201            &mut self.0.options
11202        }
11203    }
11204
11205    /// The request builder for [Provisioning::lookup_api_hub_instance][crate::client::Provisioning::lookup_api_hub_instance] calls.
11206    ///
11207    /// # Example
11208    /// ```no_run
11209    /// # use google_cloud_apihub_v1::builder;
11210    /// use builder::provisioning::LookupApiHubInstance;
11211    /// # tokio_test::block_on(async {
11212    ///
11213    /// let builder = prepare_request_builder();
11214    /// let response = builder.send().await?;
11215    /// # gax::Result::<()>::Ok(()) });
11216    ///
11217    /// fn prepare_request_builder() -> LookupApiHubInstance {
11218    ///   # panic!();
11219    ///   // ... details omitted ...
11220    /// }
11221    /// ```
11222    #[derive(Clone, Debug)]
11223    pub struct LookupApiHubInstance(RequestBuilder<crate::model::LookupApiHubInstanceRequest>);
11224
11225    impl LookupApiHubInstance {
11226        pub(crate) fn new(
11227            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11228        ) -> Self {
11229            Self(RequestBuilder::new(stub))
11230        }
11231
11232        /// Sets the full request, replacing any prior values.
11233        pub fn with_request<V: Into<crate::model::LookupApiHubInstanceRequest>>(
11234            mut self,
11235            v: V,
11236        ) -> Self {
11237            self.0.request = v.into();
11238            self
11239        }
11240
11241        /// Sets all the options, replacing any prior values.
11242        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11243            self.0.options = v.into();
11244            self
11245        }
11246
11247        /// Sends the request.
11248        pub async fn send(self) -> Result<crate::model::LookupApiHubInstanceResponse> {
11249            (*self.0.stub)
11250                .lookup_api_hub_instance(self.0.request, self.0.options)
11251                .await
11252                .map(gax::response::Response::into_body)
11253        }
11254
11255        /// Sets the value of [parent][crate::model::LookupApiHubInstanceRequest::parent].
11256        ///
11257        /// This is a **required** field for requests.
11258        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11259            self.0.request.parent = v.into();
11260            self
11261        }
11262    }
11263
11264    #[doc(hidden)]
11265    impl gax::options::internal::RequestBuilder for LookupApiHubInstance {
11266        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11267            &mut self.0.options
11268        }
11269    }
11270
11271    /// The request builder for [Provisioning::list_locations][crate::client::Provisioning::list_locations] calls.
11272    ///
11273    /// # Example
11274    /// ```no_run
11275    /// # use google_cloud_apihub_v1::builder;
11276    /// use builder::provisioning::ListLocations;
11277    /// # tokio_test::block_on(async {
11278    /// use gax::paginator::ItemPaginator;
11279    ///
11280    /// let builder = prepare_request_builder();
11281    /// let mut items = builder.by_item();
11282    /// while let Some(result) = items.next().await {
11283    ///   let item = result?;
11284    /// }
11285    /// # gax::Result::<()>::Ok(()) });
11286    ///
11287    /// fn prepare_request_builder() -> ListLocations {
11288    ///   # panic!();
11289    ///   // ... details omitted ...
11290    /// }
11291    /// ```
11292    #[derive(Clone, Debug)]
11293    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
11294
11295    impl ListLocations {
11296        pub(crate) fn new(
11297            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11298        ) -> Self {
11299            Self(RequestBuilder::new(stub))
11300        }
11301
11302        /// Sets the full request, replacing any prior values.
11303        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
11304            mut self,
11305            v: V,
11306        ) -> Self {
11307            self.0.request = v.into();
11308            self
11309        }
11310
11311        /// Sets all the options, replacing any prior values.
11312        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11313            self.0.options = v.into();
11314            self
11315        }
11316
11317        /// Sends the request.
11318        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
11319            (*self.0.stub)
11320                .list_locations(self.0.request, self.0.options)
11321                .await
11322                .map(gax::response::Response::into_body)
11323        }
11324
11325        /// Streams each page in the collection.
11326        pub fn by_page(
11327            self,
11328        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
11329        {
11330            use std::clone::Clone;
11331            let token = self.0.request.page_token.clone();
11332            let execute = move |token: String| {
11333                let mut builder = self.clone();
11334                builder.0.request = builder.0.request.set_page_token(token);
11335                builder.send()
11336            };
11337            gax::paginator::internal::new_paginator(token, execute)
11338        }
11339
11340        /// Streams each item in the collection.
11341        pub fn by_item(
11342            self,
11343        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
11344        {
11345            use gax::paginator::Paginator;
11346            self.by_page().items()
11347        }
11348
11349        /// Sets the value of [name][location::model::ListLocationsRequest::name].
11350        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11351            self.0.request.name = v.into();
11352            self
11353        }
11354
11355        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
11356        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11357            self.0.request.filter = v.into();
11358            self
11359        }
11360
11361        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
11362        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11363            self.0.request.page_size = v.into();
11364            self
11365        }
11366
11367        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
11368        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11369            self.0.request.page_token = v.into();
11370            self
11371        }
11372    }
11373
11374    #[doc(hidden)]
11375    impl gax::options::internal::RequestBuilder for ListLocations {
11376        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11377            &mut self.0.options
11378        }
11379    }
11380
11381    /// The request builder for [Provisioning::get_location][crate::client::Provisioning::get_location] calls.
11382    ///
11383    /// # Example
11384    /// ```no_run
11385    /// # use google_cloud_apihub_v1::builder;
11386    /// use builder::provisioning::GetLocation;
11387    /// # tokio_test::block_on(async {
11388    ///
11389    /// let builder = prepare_request_builder();
11390    /// let response = builder.send().await?;
11391    /// # gax::Result::<()>::Ok(()) });
11392    ///
11393    /// fn prepare_request_builder() -> GetLocation {
11394    ///   # panic!();
11395    ///   // ... details omitted ...
11396    /// }
11397    /// ```
11398    #[derive(Clone, Debug)]
11399    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
11400
11401    impl GetLocation {
11402        pub(crate) fn new(
11403            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11404        ) -> Self {
11405            Self(RequestBuilder::new(stub))
11406        }
11407
11408        /// Sets the full request, replacing any prior values.
11409        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
11410            self.0.request = v.into();
11411            self
11412        }
11413
11414        /// Sets all the options, replacing any prior values.
11415        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11416            self.0.options = v.into();
11417            self
11418        }
11419
11420        /// Sends the request.
11421        pub async fn send(self) -> Result<location::model::Location> {
11422            (*self.0.stub)
11423                .get_location(self.0.request, self.0.options)
11424                .await
11425                .map(gax::response::Response::into_body)
11426        }
11427
11428        /// Sets the value of [name][location::model::GetLocationRequest::name].
11429        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11430            self.0.request.name = v.into();
11431            self
11432        }
11433    }
11434
11435    #[doc(hidden)]
11436    impl gax::options::internal::RequestBuilder for GetLocation {
11437        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11438            &mut self.0.options
11439        }
11440    }
11441
11442    /// The request builder for [Provisioning::list_operations][crate::client::Provisioning::list_operations] calls.
11443    ///
11444    /// # Example
11445    /// ```no_run
11446    /// # use google_cloud_apihub_v1::builder;
11447    /// use builder::provisioning::ListOperations;
11448    /// # tokio_test::block_on(async {
11449    /// use gax::paginator::ItemPaginator;
11450    ///
11451    /// let builder = prepare_request_builder();
11452    /// let mut items = builder.by_item();
11453    /// while let Some(result) = items.next().await {
11454    ///   let item = result?;
11455    /// }
11456    /// # gax::Result::<()>::Ok(()) });
11457    ///
11458    /// fn prepare_request_builder() -> ListOperations {
11459    ///   # panic!();
11460    ///   // ... details omitted ...
11461    /// }
11462    /// ```
11463    #[derive(Clone, Debug)]
11464    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
11465
11466    impl ListOperations {
11467        pub(crate) fn new(
11468            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11469        ) -> Self {
11470            Self(RequestBuilder::new(stub))
11471        }
11472
11473        /// Sets the full request, replacing any prior values.
11474        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
11475            mut self,
11476            v: V,
11477        ) -> Self {
11478            self.0.request = v.into();
11479            self
11480        }
11481
11482        /// Sets all the options, replacing any prior values.
11483        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11484            self.0.options = v.into();
11485            self
11486        }
11487
11488        /// Sends the request.
11489        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
11490            (*self.0.stub)
11491                .list_operations(self.0.request, self.0.options)
11492                .await
11493                .map(gax::response::Response::into_body)
11494        }
11495
11496        /// Streams each page in the collection.
11497        pub fn by_page(
11498            self,
11499        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
11500        {
11501            use std::clone::Clone;
11502            let token = self.0.request.page_token.clone();
11503            let execute = move |token: String| {
11504                let mut builder = self.clone();
11505                builder.0.request = builder.0.request.set_page_token(token);
11506                builder.send()
11507            };
11508            gax::paginator::internal::new_paginator(token, execute)
11509        }
11510
11511        /// Streams each item in the collection.
11512        pub fn by_item(
11513            self,
11514        ) -> impl gax::paginator::ItemPaginator<
11515            longrunning::model::ListOperationsResponse,
11516            gax::error::Error,
11517        > {
11518            use gax::paginator::Paginator;
11519            self.by_page().items()
11520        }
11521
11522        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
11523        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11524            self.0.request.name = v.into();
11525            self
11526        }
11527
11528        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
11529        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11530            self.0.request.filter = v.into();
11531            self
11532        }
11533
11534        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
11535        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11536            self.0.request.page_size = v.into();
11537            self
11538        }
11539
11540        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
11541        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11542            self.0.request.page_token = v.into();
11543            self
11544        }
11545
11546        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
11547        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11548            self.0.request.return_partial_success = v.into();
11549            self
11550        }
11551    }
11552
11553    #[doc(hidden)]
11554    impl gax::options::internal::RequestBuilder for ListOperations {
11555        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11556            &mut self.0.options
11557        }
11558    }
11559
11560    /// The request builder for [Provisioning::get_operation][crate::client::Provisioning::get_operation] calls.
11561    ///
11562    /// # Example
11563    /// ```no_run
11564    /// # use google_cloud_apihub_v1::builder;
11565    /// use builder::provisioning::GetOperation;
11566    /// # tokio_test::block_on(async {
11567    ///
11568    /// let builder = prepare_request_builder();
11569    /// let response = builder.send().await?;
11570    /// # gax::Result::<()>::Ok(()) });
11571    ///
11572    /// fn prepare_request_builder() -> GetOperation {
11573    ///   # panic!();
11574    ///   // ... details omitted ...
11575    /// }
11576    /// ```
11577    #[derive(Clone, Debug)]
11578    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11579
11580    impl GetOperation {
11581        pub(crate) fn new(
11582            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11583        ) -> Self {
11584            Self(RequestBuilder::new(stub))
11585        }
11586
11587        /// Sets the full request, replacing any prior values.
11588        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11589            mut self,
11590            v: V,
11591        ) -> Self {
11592            self.0.request = v.into();
11593            self
11594        }
11595
11596        /// Sets all the options, replacing any prior values.
11597        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11598            self.0.options = v.into();
11599            self
11600        }
11601
11602        /// Sends the request.
11603        pub async fn send(self) -> Result<longrunning::model::Operation> {
11604            (*self.0.stub)
11605                .get_operation(self.0.request, self.0.options)
11606                .await
11607                .map(gax::response::Response::into_body)
11608        }
11609
11610        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
11611        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11612            self.0.request.name = v.into();
11613            self
11614        }
11615    }
11616
11617    #[doc(hidden)]
11618    impl gax::options::internal::RequestBuilder for GetOperation {
11619        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11620            &mut self.0.options
11621        }
11622    }
11623
11624    /// The request builder for [Provisioning::delete_operation][crate::client::Provisioning::delete_operation] calls.
11625    ///
11626    /// # Example
11627    /// ```no_run
11628    /// # use google_cloud_apihub_v1::builder;
11629    /// use builder::provisioning::DeleteOperation;
11630    /// # tokio_test::block_on(async {
11631    ///
11632    /// let builder = prepare_request_builder();
11633    /// let response = builder.send().await?;
11634    /// # gax::Result::<()>::Ok(()) });
11635    ///
11636    /// fn prepare_request_builder() -> DeleteOperation {
11637    ///   # panic!();
11638    ///   // ... details omitted ...
11639    /// }
11640    /// ```
11641    #[derive(Clone, Debug)]
11642    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
11643
11644    impl DeleteOperation {
11645        pub(crate) fn new(
11646            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11647        ) -> Self {
11648            Self(RequestBuilder::new(stub))
11649        }
11650
11651        /// Sets the full request, replacing any prior values.
11652        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
11653            mut self,
11654            v: V,
11655        ) -> Self {
11656            self.0.request = v.into();
11657            self
11658        }
11659
11660        /// Sets all the options, replacing any prior values.
11661        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11662            self.0.options = v.into();
11663            self
11664        }
11665
11666        /// Sends the request.
11667        pub async fn send(self) -> Result<()> {
11668            (*self.0.stub)
11669                .delete_operation(self.0.request, self.0.options)
11670                .await
11671                .map(gax::response::Response::into_body)
11672        }
11673
11674        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
11675        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11676            self.0.request.name = v.into();
11677            self
11678        }
11679    }
11680
11681    #[doc(hidden)]
11682    impl gax::options::internal::RequestBuilder for DeleteOperation {
11683        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11684            &mut self.0.options
11685        }
11686    }
11687
11688    /// The request builder for [Provisioning::cancel_operation][crate::client::Provisioning::cancel_operation] calls.
11689    ///
11690    /// # Example
11691    /// ```no_run
11692    /// # use google_cloud_apihub_v1::builder;
11693    /// use builder::provisioning::CancelOperation;
11694    /// # tokio_test::block_on(async {
11695    ///
11696    /// let builder = prepare_request_builder();
11697    /// let response = builder.send().await?;
11698    /// # gax::Result::<()>::Ok(()) });
11699    ///
11700    /// fn prepare_request_builder() -> CancelOperation {
11701    ///   # panic!();
11702    ///   // ... details omitted ...
11703    /// }
11704    /// ```
11705    #[derive(Clone, Debug)]
11706    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11707
11708    impl CancelOperation {
11709        pub(crate) fn new(
11710            stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11711        ) -> Self {
11712            Self(RequestBuilder::new(stub))
11713        }
11714
11715        /// Sets the full request, replacing any prior values.
11716        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11717            mut self,
11718            v: V,
11719        ) -> Self {
11720            self.0.request = v.into();
11721            self
11722        }
11723
11724        /// Sets all the options, replacing any prior values.
11725        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11726            self.0.options = v.into();
11727            self
11728        }
11729
11730        /// Sends the request.
11731        pub async fn send(self) -> Result<()> {
11732            (*self.0.stub)
11733                .cancel_operation(self.0.request, self.0.options)
11734                .await
11735                .map(gax::response::Response::into_body)
11736        }
11737
11738        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
11739        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11740            self.0.request.name = v.into();
11741            self
11742        }
11743    }
11744
11745    #[doc(hidden)]
11746    impl gax::options::internal::RequestBuilder for CancelOperation {
11747        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11748            &mut self.0.options
11749        }
11750    }
11751}
11752
11753pub mod runtime_project_attachment_service {
11754    use crate::Result;
11755
11756    /// A builder for [RuntimeProjectAttachmentService][crate::client::RuntimeProjectAttachmentService].
11757    ///
11758    /// ```
11759    /// # tokio_test::block_on(async {
11760    /// # use google_cloud_apihub_v1::*;
11761    /// # use builder::runtime_project_attachment_service::ClientBuilder;
11762    /// # use client::RuntimeProjectAttachmentService;
11763    /// let builder : ClientBuilder = RuntimeProjectAttachmentService::builder();
11764    /// let client = builder
11765    ///     .with_endpoint("https://apihub.googleapis.com")
11766    ///     .build().await?;
11767    /// # gax::client_builder::Result::<()>::Ok(()) });
11768    /// ```
11769    pub type ClientBuilder =
11770        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11771
11772    pub(crate) mod client {
11773        use super::super::super::client::RuntimeProjectAttachmentService;
11774        pub struct Factory;
11775        impl gax::client_builder::internal::ClientFactory for Factory {
11776            type Client = RuntimeProjectAttachmentService;
11777            type Credentials = gaxi::options::Credentials;
11778            async fn build(
11779                self,
11780                config: gaxi::options::ClientConfig,
11781            ) -> gax::client_builder::Result<Self::Client> {
11782                Self::Client::new(config).await
11783            }
11784        }
11785    }
11786
11787    /// Common implementation for [crate::client::RuntimeProjectAttachmentService] request builders.
11788    #[derive(Clone, Debug)]
11789    pub(crate) struct RequestBuilder<R: std::default::Default> {
11790        stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
11791        request: R,
11792        options: gax::options::RequestOptions,
11793    }
11794
11795    impl<R> RequestBuilder<R>
11796    where
11797        R: std::default::Default,
11798    {
11799        pub(crate) fn new(
11800            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
11801        ) -> Self {
11802            Self {
11803                stub,
11804                request: R::default(),
11805                options: gax::options::RequestOptions::default(),
11806            }
11807        }
11808    }
11809
11810    /// The request builder for [RuntimeProjectAttachmentService::create_runtime_project_attachment][crate::client::RuntimeProjectAttachmentService::create_runtime_project_attachment] calls.
11811    ///
11812    /// # Example
11813    /// ```no_run
11814    /// # use google_cloud_apihub_v1::builder;
11815    /// use builder::runtime_project_attachment_service::CreateRuntimeProjectAttachment;
11816    /// # tokio_test::block_on(async {
11817    ///
11818    /// let builder = prepare_request_builder();
11819    /// let response = builder.send().await?;
11820    /// # gax::Result::<()>::Ok(()) });
11821    ///
11822    /// fn prepare_request_builder() -> CreateRuntimeProjectAttachment {
11823    ///   # panic!();
11824    ///   // ... details omitted ...
11825    /// }
11826    /// ```
11827    #[derive(Clone, Debug)]
11828    pub struct CreateRuntimeProjectAttachment(
11829        RequestBuilder<crate::model::CreateRuntimeProjectAttachmentRequest>,
11830    );
11831
11832    impl CreateRuntimeProjectAttachment {
11833        pub(crate) fn new(
11834            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
11835        ) -> Self {
11836            Self(RequestBuilder::new(stub))
11837        }
11838
11839        /// Sets the full request, replacing any prior values.
11840        pub fn with_request<V: Into<crate::model::CreateRuntimeProjectAttachmentRequest>>(
11841            mut self,
11842            v: V,
11843        ) -> Self {
11844            self.0.request = v.into();
11845            self
11846        }
11847
11848        /// Sets all the options, replacing any prior values.
11849        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11850            self.0.options = v.into();
11851            self
11852        }
11853
11854        /// Sends the request.
11855        pub async fn send(self) -> Result<crate::model::RuntimeProjectAttachment> {
11856            (*self.0.stub)
11857                .create_runtime_project_attachment(self.0.request, self.0.options)
11858                .await
11859                .map(gax::response::Response::into_body)
11860        }
11861
11862        /// Sets the value of [parent][crate::model::CreateRuntimeProjectAttachmentRequest::parent].
11863        ///
11864        /// This is a **required** field for requests.
11865        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11866            self.0.request.parent = v.into();
11867            self
11868        }
11869
11870        /// Sets the value of [runtime_project_attachment_id][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment_id].
11871        ///
11872        /// This is a **required** field for requests.
11873        pub fn set_runtime_project_attachment_id<T: Into<std::string::String>>(
11874            mut self,
11875            v: T,
11876        ) -> Self {
11877            self.0.request.runtime_project_attachment_id = v.into();
11878            self
11879        }
11880
11881        /// Sets the value of [runtime_project_attachment][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment].
11882        ///
11883        /// This is a **required** field for requests.
11884        pub fn set_runtime_project_attachment<T>(mut self, v: T) -> Self
11885        where
11886            T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
11887        {
11888            self.0.request.runtime_project_attachment = std::option::Option::Some(v.into());
11889            self
11890        }
11891
11892        /// Sets or clears the value of [runtime_project_attachment][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment].
11893        ///
11894        /// This is a **required** field for requests.
11895        pub fn set_or_clear_runtime_project_attachment<T>(
11896            mut self,
11897            v: std::option::Option<T>,
11898        ) -> Self
11899        where
11900            T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
11901        {
11902            self.0.request.runtime_project_attachment = v.map(|x| x.into());
11903            self
11904        }
11905    }
11906
11907    #[doc(hidden)]
11908    impl gax::options::internal::RequestBuilder for CreateRuntimeProjectAttachment {
11909        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11910            &mut self.0.options
11911        }
11912    }
11913
11914    /// The request builder for [RuntimeProjectAttachmentService::get_runtime_project_attachment][crate::client::RuntimeProjectAttachmentService::get_runtime_project_attachment] calls.
11915    ///
11916    /// # Example
11917    /// ```no_run
11918    /// # use google_cloud_apihub_v1::builder;
11919    /// use builder::runtime_project_attachment_service::GetRuntimeProjectAttachment;
11920    /// # tokio_test::block_on(async {
11921    ///
11922    /// let builder = prepare_request_builder();
11923    /// let response = builder.send().await?;
11924    /// # gax::Result::<()>::Ok(()) });
11925    ///
11926    /// fn prepare_request_builder() -> GetRuntimeProjectAttachment {
11927    ///   # panic!();
11928    ///   // ... details omitted ...
11929    /// }
11930    /// ```
11931    #[derive(Clone, Debug)]
11932    pub struct GetRuntimeProjectAttachment(
11933        RequestBuilder<crate::model::GetRuntimeProjectAttachmentRequest>,
11934    );
11935
11936    impl GetRuntimeProjectAttachment {
11937        pub(crate) fn new(
11938            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
11939        ) -> Self {
11940            Self(RequestBuilder::new(stub))
11941        }
11942
11943        /// Sets the full request, replacing any prior values.
11944        pub fn with_request<V: Into<crate::model::GetRuntimeProjectAttachmentRequest>>(
11945            mut self,
11946            v: V,
11947        ) -> Self {
11948            self.0.request = v.into();
11949            self
11950        }
11951
11952        /// Sets all the options, replacing any prior values.
11953        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11954            self.0.options = v.into();
11955            self
11956        }
11957
11958        /// Sends the request.
11959        pub async fn send(self) -> Result<crate::model::RuntimeProjectAttachment> {
11960            (*self.0.stub)
11961                .get_runtime_project_attachment(self.0.request, self.0.options)
11962                .await
11963                .map(gax::response::Response::into_body)
11964        }
11965
11966        /// Sets the value of [name][crate::model::GetRuntimeProjectAttachmentRequest::name].
11967        ///
11968        /// This is a **required** field for requests.
11969        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11970            self.0.request.name = v.into();
11971            self
11972        }
11973    }
11974
11975    #[doc(hidden)]
11976    impl gax::options::internal::RequestBuilder for GetRuntimeProjectAttachment {
11977        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11978            &mut self.0.options
11979        }
11980    }
11981
11982    /// The request builder for [RuntimeProjectAttachmentService::list_runtime_project_attachments][crate::client::RuntimeProjectAttachmentService::list_runtime_project_attachments] calls.
11983    ///
11984    /// # Example
11985    /// ```no_run
11986    /// # use google_cloud_apihub_v1::builder;
11987    /// use builder::runtime_project_attachment_service::ListRuntimeProjectAttachments;
11988    /// # tokio_test::block_on(async {
11989    /// use gax::paginator::ItemPaginator;
11990    ///
11991    /// let builder = prepare_request_builder();
11992    /// let mut items = builder.by_item();
11993    /// while let Some(result) = items.next().await {
11994    ///   let item = result?;
11995    /// }
11996    /// # gax::Result::<()>::Ok(()) });
11997    ///
11998    /// fn prepare_request_builder() -> ListRuntimeProjectAttachments {
11999    ///   # panic!();
12000    ///   // ... details omitted ...
12001    /// }
12002    /// ```
12003    #[derive(Clone, Debug)]
12004    pub struct ListRuntimeProjectAttachments(
12005        RequestBuilder<crate::model::ListRuntimeProjectAttachmentsRequest>,
12006    );
12007
12008    impl ListRuntimeProjectAttachments {
12009        pub(crate) fn new(
12010            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12011        ) -> Self {
12012            Self(RequestBuilder::new(stub))
12013        }
12014
12015        /// Sets the full request, replacing any prior values.
12016        pub fn with_request<V: Into<crate::model::ListRuntimeProjectAttachmentsRequest>>(
12017            mut self,
12018            v: V,
12019        ) -> Self {
12020            self.0.request = v.into();
12021            self
12022        }
12023
12024        /// Sets all the options, replacing any prior values.
12025        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12026            self.0.options = v.into();
12027            self
12028        }
12029
12030        /// Sends the request.
12031        pub async fn send(self) -> Result<crate::model::ListRuntimeProjectAttachmentsResponse> {
12032            (*self.0.stub)
12033                .list_runtime_project_attachments(self.0.request, self.0.options)
12034                .await
12035                .map(gax::response::Response::into_body)
12036        }
12037
12038        /// Streams each page in the collection.
12039        pub fn by_page(
12040            self,
12041        ) -> impl gax::paginator::Paginator<
12042            crate::model::ListRuntimeProjectAttachmentsResponse,
12043            gax::error::Error,
12044        > {
12045            use std::clone::Clone;
12046            let token = self.0.request.page_token.clone();
12047            let execute = move |token: String| {
12048                let mut builder = self.clone();
12049                builder.0.request = builder.0.request.set_page_token(token);
12050                builder.send()
12051            };
12052            gax::paginator::internal::new_paginator(token, execute)
12053        }
12054
12055        /// Streams each item in the collection.
12056        pub fn by_item(
12057            self,
12058        ) -> impl gax::paginator::ItemPaginator<
12059            crate::model::ListRuntimeProjectAttachmentsResponse,
12060            gax::error::Error,
12061        > {
12062            use gax::paginator::Paginator;
12063            self.by_page().items()
12064        }
12065
12066        /// Sets the value of [parent][crate::model::ListRuntimeProjectAttachmentsRequest::parent].
12067        ///
12068        /// This is a **required** field for requests.
12069        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12070            self.0.request.parent = v.into();
12071            self
12072        }
12073
12074        /// Sets the value of [page_size][crate::model::ListRuntimeProjectAttachmentsRequest::page_size].
12075        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12076            self.0.request.page_size = v.into();
12077            self
12078        }
12079
12080        /// Sets the value of [page_token][crate::model::ListRuntimeProjectAttachmentsRequest::page_token].
12081        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12082            self.0.request.page_token = v.into();
12083            self
12084        }
12085
12086        /// Sets the value of [filter][crate::model::ListRuntimeProjectAttachmentsRequest::filter].
12087        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12088            self.0.request.filter = v.into();
12089            self
12090        }
12091
12092        /// Sets the value of [order_by][crate::model::ListRuntimeProjectAttachmentsRequest::order_by].
12093        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12094            self.0.request.order_by = v.into();
12095            self
12096        }
12097    }
12098
12099    #[doc(hidden)]
12100    impl gax::options::internal::RequestBuilder for ListRuntimeProjectAttachments {
12101        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12102            &mut self.0.options
12103        }
12104    }
12105
12106    /// The request builder for [RuntimeProjectAttachmentService::delete_runtime_project_attachment][crate::client::RuntimeProjectAttachmentService::delete_runtime_project_attachment] calls.
12107    ///
12108    /// # Example
12109    /// ```no_run
12110    /// # use google_cloud_apihub_v1::builder;
12111    /// use builder::runtime_project_attachment_service::DeleteRuntimeProjectAttachment;
12112    /// # tokio_test::block_on(async {
12113    ///
12114    /// let builder = prepare_request_builder();
12115    /// let response = builder.send().await?;
12116    /// # gax::Result::<()>::Ok(()) });
12117    ///
12118    /// fn prepare_request_builder() -> DeleteRuntimeProjectAttachment {
12119    ///   # panic!();
12120    ///   // ... details omitted ...
12121    /// }
12122    /// ```
12123    #[derive(Clone, Debug)]
12124    pub struct DeleteRuntimeProjectAttachment(
12125        RequestBuilder<crate::model::DeleteRuntimeProjectAttachmentRequest>,
12126    );
12127
12128    impl DeleteRuntimeProjectAttachment {
12129        pub(crate) fn new(
12130            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12131        ) -> Self {
12132            Self(RequestBuilder::new(stub))
12133        }
12134
12135        /// Sets the full request, replacing any prior values.
12136        pub fn with_request<V: Into<crate::model::DeleteRuntimeProjectAttachmentRequest>>(
12137            mut self,
12138            v: V,
12139        ) -> Self {
12140            self.0.request = v.into();
12141            self
12142        }
12143
12144        /// Sets all the options, replacing any prior values.
12145        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12146            self.0.options = v.into();
12147            self
12148        }
12149
12150        /// Sends the request.
12151        pub async fn send(self) -> Result<()> {
12152            (*self.0.stub)
12153                .delete_runtime_project_attachment(self.0.request, self.0.options)
12154                .await
12155                .map(gax::response::Response::into_body)
12156        }
12157
12158        /// Sets the value of [name][crate::model::DeleteRuntimeProjectAttachmentRequest::name].
12159        ///
12160        /// This is a **required** field for requests.
12161        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12162            self.0.request.name = v.into();
12163            self
12164        }
12165    }
12166
12167    #[doc(hidden)]
12168    impl gax::options::internal::RequestBuilder for DeleteRuntimeProjectAttachment {
12169        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12170            &mut self.0.options
12171        }
12172    }
12173
12174    /// The request builder for [RuntimeProjectAttachmentService::lookup_runtime_project_attachment][crate::client::RuntimeProjectAttachmentService::lookup_runtime_project_attachment] calls.
12175    ///
12176    /// # Example
12177    /// ```no_run
12178    /// # use google_cloud_apihub_v1::builder;
12179    /// use builder::runtime_project_attachment_service::LookupRuntimeProjectAttachment;
12180    /// # tokio_test::block_on(async {
12181    ///
12182    /// let builder = prepare_request_builder();
12183    /// let response = builder.send().await?;
12184    /// # gax::Result::<()>::Ok(()) });
12185    ///
12186    /// fn prepare_request_builder() -> LookupRuntimeProjectAttachment {
12187    ///   # panic!();
12188    ///   // ... details omitted ...
12189    /// }
12190    /// ```
12191    #[derive(Clone, Debug)]
12192    pub struct LookupRuntimeProjectAttachment(
12193        RequestBuilder<crate::model::LookupRuntimeProjectAttachmentRequest>,
12194    );
12195
12196    impl LookupRuntimeProjectAttachment {
12197        pub(crate) fn new(
12198            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12199        ) -> Self {
12200            Self(RequestBuilder::new(stub))
12201        }
12202
12203        /// Sets the full request, replacing any prior values.
12204        pub fn with_request<V: Into<crate::model::LookupRuntimeProjectAttachmentRequest>>(
12205            mut self,
12206            v: V,
12207        ) -> Self {
12208            self.0.request = v.into();
12209            self
12210        }
12211
12212        /// Sets all the options, replacing any prior values.
12213        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12214            self.0.options = v.into();
12215            self
12216        }
12217
12218        /// Sends the request.
12219        pub async fn send(self) -> Result<crate::model::LookupRuntimeProjectAttachmentResponse> {
12220            (*self.0.stub)
12221                .lookup_runtime_project_attachment(self.0.request, self.0.options)
12222                .await
12223                .map(gax::response::Response::into_body)
12224        }
12225
12226        /// Sets the value of [name][crate::model::LookupRuntimeProjectAttachmentRequest::name].
12227        ///
12228        /// This is a **required** field for requests.
12229        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12230            self.0.request.name = v.into();
12231            self
12232        }
12233    }
12234
12235    #[doc(hidden)]
12236    impl gax::options::internal::RequestBuilder for LookupRuntimeProjectAttachment {
12237        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12238            &mut self.0.options
12239        }
12240    }
12241
12242    /// The request builder for [RuntimeProjectAttachmentService::list_locations][crate::client::RuntimeProjectAttachmentService::list_locations] calls.
12243    ///
12244    /// # Example
12245    /// ```no_run
12246    /// # use google_cloud_apihub_v1::builder;
12247    /// use builder::runtime_project_attachment_service::ListLocations;
12248    /// # tokio_test::block_on(async {
12249    /// use gax::paginator::ItemPaginator;
12250    ///
12251    /// let builder = prepare_request_builder();
12252    /// let mut items = builder.by_item();
12253    /// while let Some(result) = items.next().await {
12254    ///   let item = result?;
12255    /// }
12256    /// # gax::Result::<()>::Ok(()) });
12257    ///
12258    /// fn prepare_request_builder() -> ListLocations {
12259    ///   # panic!();
12260    ///   // ... details omitted ...
12261    /// }
12262    /// ```
12263    #[derive(Clone, Debug)]
12264    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
12265
12266    impl ListLocations {
12267        pub(crate) fn new(
12268            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12269        ) -> Self {
12270            Self(RequestBuilder::new(stub))
12271        }
12272
12273        /// Sets the full request, replacing any prior values.
12274        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
12275            mut self,
12276            v: V,
12277        ) -> Self {
12278            self.0.request = v.into();
12279            self
12280        }
12281
12282        /// Sets all the options, replacing any prior values.
12283        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12284            self.0.options = v.into();
12285            self
12286        }
12287
12288        /// Sends the request.
12289        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
12290            (*self.0.stub)
12291                .list_locations(self.0.request, self.0.options)
12292                .await
12293                .map(gax::response::Response::into_body)
12294        }
12295
12296        /// Streams each page in the collection.
12297        pub fn by_page(
12298            self,
12299        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
12300        {
12301            use std::clone::Clone;
12302            let token = self.0.request.page_token.clone();
12303            let execute = move |token: String| {
12304                let mut builder = self.clone();
12305                builder.0.request = builder.0.request.set_page_token(token);
12306                builder.send()
12307            };
12308            gax::paginator::internal::new_paginator(token, execute)
12309        }
12310
12311        /// Streams each item in the collection.
12312        pub fn by_item(
12313            self,
12314        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
12315        {
12316            use gax::paginator::Paginator;
12317            self.by_page().items()
12318        }
12319
12320        /// Sets the value of [name][location::model::ListLocationsRequest::name].
12321        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12322            self.0.request.name = v.into();
12323            self
12324        }
12325
12326        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
12327        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12328            self.0.request.filter = v.into();
12329            self
12330        }
12331
12332        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
12333        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12334            self.0.request.page_size = v.into();
12335            self
12336        }
12337
12338        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
12339        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12340            self.0.request.page_token = v.into();
12341            self
12342        }
12343    }
12344
12345    #[doc(hidden)]
12346    impl gax::options::internal::RequestBuilder for ListLocations {
12347        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12348            &mut self.0.options
12349        }
12350    }
12351
12352    /// The request builder for [RuntimeProjectAttachmentService::get_location][crate::client::RuntimeProjectAttachmentService::get_location] calls.
12353    ///
12354    /// # Example
12355    /// ```no_run
12356    /// # use google_cloud_apihub_v1::builder;
12357    /// use builder::runtime_project_attachment_service::GetLocation;
12358    /// # tokio_test::block_on(async {
12359    ///
12360    /// let builder = prepare_request_builder();
12361    /// let response = builder.send().await?;
12362    /// # gax::Result::<()>::Ok(()) });
12363    ///
12364    /// fn prepare_request_builder() -> GetLocation {
12365    ///   # panic!();
12366    ///   // ... details omitted ...
12367    /// }
12368    /// ```
12369    #[derive(Clone, Debug)]
12370    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
12371
12372    impl GetLocation {
12373        pub(crate) fn new(
12374            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12375        ) -> Self {
12376            Self(RequestBuilder::new(stub))
12377        }
12378
12379        /// Sets the full request, replacing any prior values.
12380        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
12381            self.0.request = v.into();
12382            self
12383        }
12384
12385        /// Sets all the options, replacing any prior values.
12386        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12387            self.0.options = v.into();
12388            self
12389        }
12390
12391        /// Sends the request.
12392        pub async fn send(self) -> Result<location::model::Location> {
12393            (*self.0.stub)
12394                .get_location(self.0.request, self.0.options)
12395                .await
12396                .map(gax::response::Response::into_body)
12397        }
12398
12399        /// Sets the value of [name][location::model::GetLocationRequest::name].
12400        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12401            self.0.request.name = v.into();
12402            self
12403        }
12404    }
12405
12406    #[doc(hidden)]
12407    impl gax::options::internal::RequestBuilder for GetLocation {
12408        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12409            &mut self.0.options
12410        }
12411    }
12412
12413    /// The request builder for [RuntimeProjectAttachmentService::list_operations][crate::client::RuntimeProjectAttachmentService::list_operations] calls.
12414    ///
12415    /// # Example
12416    /// ```no_run
12417    /// # use google_cloud_apihub_v1::builder;
12418    /// use builder::runtime_project_attachment_service::ListOperations;
12419    /// # tokio_test::block_on(async {
12420    /// use gax::paginator::ItemPaginator;
12421    ///
12422    /// let builder = prepare_request_builder();
12423    /// let mut items = builder.by_item();
12424    /// while let Some(result) = items.next().await {
12425    ///   let item = result?;
12426    /// }
12427    /// # gax::Result::<()>::Ok(()) });
12428    ///
12429    /// fn prepare_request_builder() -> ListOperations {
12430    ///   # panic!();
12431    ///   // ... details omitted ...
12432    /// }
12433    /// ```
12434    #[derive(Clone, Debug)]
12435    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
12436
12437    impl ListOperations {
12438        pub(crate) fn new(
12439            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12440        ) -> Self {
12441            Self(RequestBuilder::new(stub))
12442        }
12443
12444        /// Sets the full request, replacing any prior values.
12445        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
12446            mut self,
12447            v: V,
12448        ) -> Self {
12449            self.0.request = v.into();
12450            self
12451        }
12452
12453        /// Sets all the options, replacing any prior values.
12454        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12455            self.0.options = v.into();
12456            self
12457        }
12458
12459        /// Sends the request.
12460        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
12461            (*self.0.stub)
12462                .list_operations(self.0.request, self.0.options)
12463                .await
12464                .map(gax::response::Response::into_body)
12465        }
12466
12467        /// Streams each page in the collection.
12468        pub fn by_page(
12469            self,
12470        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
12471        {
12472            use std::clone::Clone;
12473            let token = self.0.request.page_token.clone();
12474            let execute = move |token: String| {
12475                let mut builder = self.clone();
12476                builder.0.request = builder.0.request.set_page_token(token);
12477                builder.send()
12478            };
12479            gax::paginator::internal::new_paginator(token, execute)
12480        }
12481
12482        /// Streams each item in the collection.
12483        pub fn by_item(
12484            self,
12485        ) -> impl gax::paginator::ItemPaginator<
12486            longrunning::model::ListOperationsResponse,
12487            gax::error::Error,
12488        > {
12489            use gax::paginator::Paginator;
12490            self.by_page().items()
12491        }
12492
12493        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
12494        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12495            self.0.request.name = v.into();
12496            self
12497        }
12498
12499        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
12500        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12501            self.0.request.filter = v.into();
12502            self
12503        }
12504
12505        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
12506        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12507            self.0.request.page_size = v.into();
12508            self
12509        }
12510
12511        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
12512        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12513            self.0.request.page_token = v.into();
12514            self
12515        }
12516
12517        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
12518        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
12519            self.0.request.return_partial_success = v.into();
12520            self
12521        }
12522    }
12523
12524    #[doc(hidden)]
12525    impl gax::options::internal::RequestBuilder for ListOperations {
12526        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12527            &mut self.0.options
12528        }
12529    }
12530
12531    /// The request builder for [RuntimeProjectAttachmentService::get_operation][crate::client::RuntimeProjectAttachmentService::get_operation] calls.
12532    ///
12533    /// # Example
12534    /// ```no_run
12535    /// # use google_cloud_apihub_v1::builder;
12536    /// use builder::runtime_project_attachment_service::GetOperation;
12537    /// # tokio_test::block_on(async {
12538    ///
12539    /// let builder = prepare_request_builder();
12540    /// let response = builder.send().await?;
12541    /// # gax::Result::<()>::Ok(()) });
12542    ///
12543    /// fn prepare_request_builder() -> GetOperation {
12544    ///   # panic!();
12545    ///   // ... details omitted ...
12546    /// }
12547    /// ```
12548    #[derive(Clone, Debug)]
12549    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
12550
12551    impl GetOperation {
12552        pub(crate) fn new(
12553            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12554        ) -> Self {
12555            Self(RequestBuilder::new(stub))
12556        }
12557
12558        /// Sets the full request, replacing any prior values.
12559        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
12560            mut self,
12561            v: V,
12562        ) -> Self {
12563            self.0.request = v.into();
12564            self
12565        }
12566
12567        /// Sets all the options, replacing any prior values.
12568        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12569            self.0.options = v.into();
12570            self
12571        }
12572
12573        /// Sends the request.
12574        pub async fn send(self) -> Result<longrunning::model::Operation> {
12575            (*self.0.stub)
12576                .get_operation(self.0.request, self.0.options)
12577                .await
12578                .map(gax::response::Response::into_body)
12579        }
12580
12581        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
12582        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12583            self.0.request.name = v.into();
12584            self
12585        }
12586    }
12587
12588    #[doc(hidden)]
12589    impl gax::options::internal::RequestBuilder for GetOperation {
12590        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12591            &mut self.0.options
12592        }
12593    }
12594
12595    /// The request builder for [RuntimeProjectAttachmentService::delete_operation][crate::client::RuntimeProjectAttachmentService::delete_operation] calls.
12596    ///
12597    /// # Example
12598    /// ```no_run
12599    /// # use google_cloud_apihub_v1::builder;
12600    /// use builder::runtime_project_attachment_service::DeleteOperation;
12601    /// # tokio_test::block_on(async {
12602    ///
12603    /// let builder = prepare_request_builder();
12604    /// let response = builder.send().await?;
12605    /// # gax::Result::<()>::Ok(()) });
12606    ///
12607    /// fn prepare_request_builder() -> DeleteOperation {
12608    ///   # panic!();
12609    ///   // ... details omitted ...
12610    /// }
12611    /// ```
12612    #[derive(Clone, Debug)]
12613    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
12614
12615    impl DeleteOperation {
12616        pub(crate) fn new(
12617            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12618        ) -> Self {
12619            Self(RequestBuilder::new(stub))
12620        }
12621
12622        /// Sets the full request, replacing any prior values.
12623        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
12624            mut self,
12625            v: V,
12626        ) -> Self {
12627            self.0.request = v.into();
12628            self
12629        }
12630
12631        /// Sets all the options, replacing any prior values.
12632        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12633            self.0.options = v.into();
12634            self
12635        }
12636
12637        /// Sends the request.
12638        pub async fn send(self) -> Result<()> {
12639            (*self.0.stub)
12640                .delete_operation(self.0.request, self.0.options)
12641                .await
12642                .map(gax::response::Response::into_body)
12643        }
12644
12645        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
12646        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12647            self.0.request.name = v.into();
12648            self
12649        }
12650    }
12651
12652    #[doc(hidden)]
12653    impl gax::options::internal::RequestBuilder for DeleteOperation {
12654        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12655            &mut self.0.options
12656        }
12657    }
12658
12659    /// The request builder for [RuntimeProjectAttachmentService::cancel_operation][crate::client::RuntimeProjectAttachmentService::cancel_operation] calls.
12660    ///
12661    /// # Example
12662    /// ```no_run
12663    /// # use google_cloud_apihub_v1::builder;
12664    /// use builder::runtime_project_attachment_service::CancelOperation;
12665    /// # tokio_test::block_on(async {
12666    ///
12667    /// let builder = prepare_request_builder();
12668    /// let response = builder.send().await?;
12669    /// # gax::Result::<()>::Ok(()) });
12670    ///
12671    /// fn prepare_request_builder() -> CancelOperation {
12672    ///   # panic!();
12673    ///   // ... details omitted ...
12674    /// }
12675    /// ```
12676    #[derive(Clone, Debug)]
12677    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
12678
12679    impl CancelOperation {
12680        pub(crate) fn new(
12681            stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12682        ) -> Self {
12683            Self(RequestBuilder::new(stub))
12684        }
12685
12686        /// Sets the full request, replacing any prior values.
12687        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
12688            mut self,
12689            v: V,
12690        ) -> Self {
12691            self.0.request = v.into();
12692            self
12693        }
12694
12695        /// Sets all the options, replacing any prior values.
12696        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12697            self.0.options = v.into();
12698            self
12699        }
12700
12701        /// Sends the request.
12702        pub async fn send(self) -> Result<()> {
12703            (*self.0.stub)
12704                .cancel_operation(self.0.request, self.0.options)
12705                .await
12706                .map(gax::response::Response::into_body)
12707        }
12708
12709        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
12710        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12711            self.0.request.name = v.into();
12712            self
12713        }
12714    }
12715
12716    #[doc(hidden)]
12717    impl gax::options::internal::RequestBuilder for CancelOperation {
12718        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12719            &mut self.0.options
12720        }
12721    }
12722}