Skip to main content

google_cloud_connectors_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 connectors {
18    use crate::Result;
19
20    /// A builder for [Connectors][crate::client::Connectors].
21    ///
22    /// ```
23    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24    /// # use google_cloud_connectors_v1::*;
25    /// # use builder::connectors::ClientBuilder;
26    /// # use client::Connectors;
27    /// let builder : ClientBuilder = Connectors::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://connectors.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35    pub(crate) mod client {
36        use super::super::super::client::Connectors;
37        pub struct Factory;
38        impl crate::ClientFactory for Factory {
39            type Client = Connectors;
40            type Credentials = gaxi::options::Credentials;
41            async fn build(
42                self,
43                config: gaxi::options::ClientConfig,
44            ) -> crate::ClientBuilderResult<Self::Client> {
45                Self::Client::new(config).await
46            }
47        }
48    }
49
50    /// Common implementation for [crate::client::Connectors] request builders.
51    #[derive(Clone, Debug)]
52    pub(crate) struct RequestBuilder<R: std::default::Default> {
53        stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
54        request: R,
55        options: crate::RequestOptions,
56    }
57
58    impl<R> RequestBuilder<R>
59    where
60        R: std::default::Default,
61    {
62        pub(crate) fn new(
63            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
64        ) -> Self {
65            Self {
66                stub,
67                request: R::default(),
68                options: crate::RequestOptions::default(),
69            }
70        }
71    }
72
73    /// The request builder for [Connectors::list_connections][crate::client::Connectors::list_connections] calls.
74    ///
75    /// # Example
76    /// ```
77    /// # use google_cloud_connectors_v1::builder::connectors::ListConnections;
78    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
79    /// use google_cloud_gax::paginator::ItemPaginator;
80    ///
81    /// let builder = prepare_request_builder();
82    /// let mut items = builder.by_item();
83    /// while let Some(result) = items.next().await {
84    ///   let item = result?;
85    /// }
86    /// # Ok(()) }
87    ///
88    /// fn prepare_request_builder() -> ListConnections {
89    ///   # panic!();
90    ///   // ... details omitted ...
91    /// }
92    /// ```
93    #[derive(Clone, Debug)]
94    pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
95
96    impl ListConnections {
97        pub(crate) fn new(
98            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
99        ) -> Self {
100            Self(RequestBuilder::new(stub))
101        }
102
103        /// Sets the full request, replacing any prior values.
104        pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
105            self.0.request = v.into();
106            self
107        }
108
109        /// Sets all the options, replacing any prior values.
110        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111            self.0.options = v.into();
112            self
113        }
114
115        /// Sends the request.
116        pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
117            (*self.0.stub)
118                .list_connections(self.0.request, self.0.options)
119                .await
120                .map(crate::Response::into_body)
121        }
122
123        /// Streams each page in the collection.
124        pub fn by_page(
125            self,
126        ) -> impl google_cloud_gax::paginator::Paginator<
127            crate::model::ListConnectionsResponse,
128            crate::Error,
129        > {
130            use std::clone::Clone;
131            let token = self.0.request.page_token.clone();
132            let execute = move |token: String| {
133                let mut builder = self.clone();
134                builder.0.request = builder.0.request.set_page_token(token);
135                builder.send()
136            };
137            google_cloud_gax::paginator::internal::new_paginator(token, execute)
138        }
139
140        /// Streams each item in the collection.
141        pub fn by_item(
142            self,
143        ) -> impl google_cloud_gax::paginator::ItemPaginator<
144            crate::model::ListConnectionsResponse,
145            crate::Error,
146        > {
147            use google_cloud_gax::paginator::Paginator;
148            self.by_page().items()
149        }
150
151        /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
152        ///
153        /// This is a **required** field for requests.
154        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
155            self.0.request.parent = v.into();
156            self
157        }
158
159        /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
160        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
161            self.0.request.page_size = v.into();
162            self
163        }
164
165        /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
166        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
167            self.0.request.page_token = v.into();
168            self
169        }
170
171        /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
172        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
173            self.0.request.filter = v.into();
174            self
175        }
176
177        /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
178        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
179            self.0.request.order_by = v.into();
180            self
181        }
182
183        /// Sets the value of [view][crate::model::ListConnectionsRequest::view].
184        pub fn set_view<T: Into<crate::model::ConnectionView>>(mut self, v: T) -> Self {
185            self.0.request.view = v.into();
186            self
187        }
188    }
189
190    #[doc(hidden)]
191    impl crate::RequestBuilder for ListConnections {
192        fn request_options(&mut self) -> &mut crate::RequestOptions {
193            &mut self.0.options
194        }
195    }
196
197    /// The request builder for [Connectors::get_connection][crate::client::Connectors::get_connection] calls.
198    ///
199    /// # Example
200    /// ```
201    /// # use google_cloud_connectors_v1::builder::connectors::GetConnection;
202    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
203    ///
204    /// let builder = prepare_request_builder();
205    /// let response = builder.send().await?;
206    /// # Ok(()) }
207    ///
208    /// fn prepare_request_builder() -> GetConnection {
209    ///   # panic!();
210    ///   // ... details omitted ...
211    /// }
212    /// ```
213    #[derive(Clone, Debug)]
214    pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
215
216    impl GetConnection {
217        pub(crate) fn new(
218            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
219        ) -> Self {
220            Self(RequestBuilder::new(stub))
221        }
222
223        /// Sets the full request, replacing any prior values.
224        pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
225            self.0.request = v.into();
226            self
227        }
228
229        /// Sets all the options, replacing any prior values.
230        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
231            self.0.options = v.into();
232            self
233        }
234
235        /// Sends the request.
236        pub async fn send(self) -> Result<crate::model::Connection> {
237            (*self.0.stub)
238                .get_connection(self.0.request, self.0.options)
239                .await
240                .map(crate::Response::into_body)
241        }
242
243        /// Sets the value of [name][crate::model::GetConnectionRequest::name].
244        ///
245        /// This is a **required** field for requests.
246        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
247            self.0.request.name = v.into();
248            self
249        }
250
251        /// Sets the value of [view][crate::model::GetConnectionRequest::view].
252        pub fn set_view<T: Into<crate::model::ConnectionView>>(mut self, v: T) -> Self {
253            self.0.request.view = v.into();
254            self
255        }
256    }
257
258    #[doc(hidden)]
259    impl crate::RequestBuilder for GetConnection {
260        fn request_options(&mut self) -> &mut crate::RequestOptions {
261            &mut self.0.options
262        }
263    }
264
265    /// The request builder for [Connectors::create_connection][crate::client::Connectors::create_connection] calls.
266    ///
267    /// # Example
268    /// ```
269    /// # use google_cloud_connectors_v1::builder::connectors::CreateConnection;
270    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
271    /// use google_cloud_lro::Poller;
272    ///
273    /// let builder = prepare_request_builder();
274    /// let response = builder.poller().until_done().await?;
275    /// # Ok(()) }
276    ///
277    /// fn prepare_request_builder() -> CreateConnection {
278    ///   # panic!();
279    ///   // ... details omitted ...
280    /// }
281    /// ```
282    #[derive(Clone, Debug)]
283    pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
284
285    impl CreateConnection {
286        pub(crate) fn new(
287            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
288        ) -> Self {
289            Self(RequestBuilder::new(stub))
290        }
291
292        /// Sets the full request, replacing any prior values.
293        pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
294            mut self,
295            v: V,
296        ) -> Self {
297            self.0.request = v.into();
298            self
299        }
300
301        /// Sets all the options, replacing any prior values.
302        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
303            self.0.options = v.into();
304            self
305        }
306
307        /// Sends the request.
308        ///
309        /// # Long running operations
310        ///
311        /// This starts, but does not poll, a longrunning operation. More information
312        /// on [create_connection][crate::client::Connectors::create_connection].
313        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
314            (*self.0.stub)
315                .create_connection(self.0.request, self.0.options)
316                .await
317                .map(crate::Response::into_body)
318        }
319
320        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_connection`.
321        pub fn poller(
322            self,
323        ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
324        {
325            type Operation = google_cloud_lro::internal::Operation<
326                crate::model::Connection,
327                crate::model::OperationMetadata,
328            >;
329            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
330            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
331
332            let stub = self.0.stub.clone();
333            let mut options = self.0.options.clone();
334            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
335            let query = move |name| {
336                let stub = stub.clone();
337                let options = options.clone();
338                async {
339                    let op = GetOperation::new(stub)
340                        .set_name(name)
341                        .with_options(options)
342                        .send()
343                        .await?;
344                    Ok(Operation::new(op))
345                }
346            };
347
348            let start = move || async {
349                let op = self.send().await?;
350                Ok(Operation::new(op))
351            };
352
353            google_cloud_lro::internal::new_poller(
354                polling_error_policy,
355                polling_backoff_policy,
356                start,
357                query,
358            )
359        }
360
361        /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
362        ///
363        /// This is a **required** field for requests.
364        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
365            self.0.request.parent = v.into();
366            self
367        }
368
369        /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
370        ///
371        /// This is a **required** field for requests.
372        pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
373            self.0.request.connection_id = v.into();
374            self
375        }
376
377        /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
378        ///
379        /// This is a **required** field for requests.
380        pub fn set_connection<T>(mut self, v: T) -> Self
381        where
382            T: std::convert::Into<crate::model::Connection>,
383        {
384            self.0.request.connection = std::option::Option::Some(v.into());
385            self
386        }
387
388        /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
389        ///
390        /// This is a **required** field for requests.
391        pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
392        where
393            T: std::convert::Into<crate::model::Connection>,
394        {
395            self.0.request.connection = v.map(|x| x.into());
396            self
397        }
398    }
399
400    #[doc(hidden)]
401    impl crate::RequestBuilder for CreateConnection {
402        fn request_options(&mut self) -> &mut crate::RequestOptions {
403            &mut self.0.options
404        }
405    }
406
407    /// The request builder for [Connectors::update_connection][crate::client::Connectors::update_connection] calls.
408    ///
409    /// # Example
410    /// ```
411    /// # use google_cloud_connectors_v1::builder::connectors::UpdateConnection;
412    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
413    /// use google_cloud_lro::Poller;
414    ///
415    /// let builder = prepare_request_builder();
416    /// let response = builder.poller().until_done().await?;
417    /// # Ok(()) }
418    ///
419    /// fn prepare_request_builder() -> UpdateConnection {
420    ///   # panic!();
421    ///   // ... details omitted ...
422    /// }
423    /// ```
424    #[derive(Clone, Debug)]
425    pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
426
427    impl UpdateConnection {
428        pub(crate) fn new(
429            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
430        ) -> Self {
431            Self(RequestBuilder::new(stub))
432        }
433
434        /// Sets the full request, replacing any prior values.
435        pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
436            mut self,
437            v: V,
438        ) -> Self {
439            self.0.request = v.into();
440            self
441        }
442
443        /// Sets all the options, replacing any prior values.
444        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
445            self.0.options = v.into();
446            self
447        }
448
449        /// Sends the request.
450        ///
451        /// # Long running operations
452        ///
453        /// This starts, but does not poll, a longrunning operation. More information
454        /// on [update_connection][crate::client::Connectors::update_connection].
455        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
456            (*self.0.stub)
457                .update_connection(self.0.request, self.0.options)
458                .await
459                .map(crate::Response::into_body)
460        }
461
462        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_connection`.
463        pub fn poller(
464            self,
465        ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
466        {
467            type Operation = google_cloud_lro::internal::Operation<
468                crate::model::Connection,
469                crate::model::OperationMetadata,
470            >;
471            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
472            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
473
474            let stub = self.0.stub.clone();
475            let mut options = self.0.options.clone();
476            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
477            let query = move |name| {
478                let stub = stub.clone();
479                let options = options.clone();
480                async {
481                    let op = GetOperation::new(stub)
482                        .set_name(name)
483                        .with_options(options)
484                        .send()
485                        .await?;
486                    Ok(Operation::new(op))
487                }
488            };
489
490            let start = move || async {
491                let op = self.send().await?;
492                Ok(Operation::new(op))
493            };
494
495            google_cloud_lro::internal::new_poller(
496                polling_error_policy,
497                polling_backoff_policy,
498                start,
499                query,
500            )
501        }
502
503        /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
504        ///
505        /// This is a **required** field for requests.
506        pub fn set_connection<T>(mut self, v: T) -> Self
507        where
508            T: std::convert::Into<crate::model::Connection>,
509        {
510            self.0.request.connection = std::option::Option::Some(v.into());
511            self
512        }
513
514        /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
515        ///
516        /// This is a **required** field for requests.
517        pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
518        where
519            T: std::convert::Into<crate::model::Connection>,
520        {
521            self.0.request.connection = v.map(|x| x.into());
522            self
523        }
524
525        /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
526        ///
527        /// This is a **required** field for requests.
528        pub fn set_update_mask<T>(mut self, v: T) -> Self
529        where
530            T: std::convert::Into<wkt::FieldMask>,
531        {
532            self.0.request.update_mask = std::option::Option::Some(v.into());
533            self
534        }
535
536        /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
537        ///
538        /// This is a **required** field for requests.
539        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
540        where
541            T: std::convert::Into<wkt::FieldMask>,
542        {
543            self.0.request.update_mask = v.map(|x| x.into());
544            self
545        }
546    }
547
548    #[doc(hidden)]
549    impl crate::RequestBuilder for UpdateConnection {
550        fn request_options(&mut self) -> &mut crate::RequestOptions {
551            &mut self.0.options
552        }
553    }
554
555    /// The request builder for [Connectors::delete_connection][crate::client::Connectors::delete_connection] calls.
556    ///
557    /// # Example
558    /// ```
559    /// # use google_cloud_connectors_v1::builder::connectors::DeleteConnection;
560    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
561    /// use google_cloud_lro::Poller;
562    ///
563    /// let builder = prepare_request_builder();
564    /// let response = builder.poller().until_done().await?;
565    /// # Ok(()) }
566    ///
567    /// fn prepare_request_builder() -> DeleteConnection {
568    ///   # panic!();
569    ///   // ... details omitted ...
570    /// }
571    /// ```
572    #[derive(Clone, Debug)]
573    pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
574
575    impl DeleteConnection {
576        pub(crate) fn new(
577            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
578        ) -> Self {
579            Self(RequestBuilder::new(stub))
580        }
581
582        /// Sets the full request, replacing any prior values.
583        pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
584            mut self,
585            v: V,
586        ) -> Self {
587            self.0.request = v.into();
588            self
589        }
590
591        /// Sets all the options, replacing any prior values.
592        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
593            self.0.options = v.into();
594            self
595        }
596
597        /// Sends the request.
598        ///
599        /// # Long running operations
600        ///
601        /// This starts, but does not poll, a longrunning operation. More information
602        /// on [delete_connection][crate::client::Connectors::delete_connection].
603        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
604            (*self.0.stub)
605                .delete_connection(self.0.request, self.0.options)
606                .await
607                .map(crate::Response::into_body)
608        }
609
610        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_connection`.
611        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
612            type Operation =
613                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
614            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
615            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
616
617            let stub = self.0.stub.clone();
618            let mut options = self.0.options.clone();
619            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
620            let query = move |name| {
621                let stub = stub.clone();
622                let options = options.clone();
623                async {
624                    let op = GetOperation::new(stub)
625                        .set_name(name)
626                        .with_options(options)
627                        .send()
628                        .await?;
629                    Ok(Operation::new(op))
630                }
631            };
632
633            let start = move || async {
634                let op = self.send().await?;
635                Ok(Operation::new(op))
636            };
637
638            google_cloud_lro::internal::new_unit_response_poller(
639                polling_error_policy,
640                polling_backoff_policy,
641                start,
642                query,
643            )
644        }
645
646        /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
647        ///
648        /// This is a **required** field for requests.
649        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
650            self.0.request.name = v.into();
651            self
652        }
653    }
654
655    #[doc(hidden)]
656    impl crate::RequestBuilder for DeleteConnection {
657        fn request_options(&mut self) -> &mut crate::RequestOptions {
658            &mut self.0.options
659        }
660    }
661
662    /// The request builder for [Connectors::list_providers][crate::client::Connectors::list_providers] calls.
663    ///
664    /// # Example
665    /// ```
666    /// # use google_cloud_connectors_v1::builder::connectors::ListProviders;
667    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
668    /// use google_cloud_gax::paginator::ItemPaginator;
669    ///
670    /// let builder = prepare_request_builder();
671    /// let mut items = builder.by_item();
672    /// while let Some(result) = items.next().await {
673    ///   let item = result?;
674    /// }
675    /// # Ok(()) }
676    ///
677    /// fn prepare_request_builder() -> ListProviders {
678    ///   # panic!();
679    ///   // ... details omitted ...
680    /// }
681    /// ```
682    #[derive(Clone, Debug)]
683    pub struct ListProviders(RequestBuilder<crate::model::ListProvidersRequest>);
684
685    impl ListProviders {
686        pub(crate) fn new(
687            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
688        ) -> Self {
689            Self(RequestBuilder::new(stub))
690        }
691
692        /// Sets the full request, replacing any prior values.
693        pub fn with_request<V: Into<crate::model::ListProvidersRequest>>(mut self, v: V) -> Self {
694            self.0.request = v.into();
695            self
696        }
697
698        /// Sets all the options, replacing any prior values.
699        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
700            self.0.options = v.into();
701            self
702        }
703
704        /// Sends the request.
705        pub async fn send(self) -> Result<crate::model::ListProvidersResponse> {
706            (*self.0.stub)
707                .list_providers(self.0.request, self.0.options)
708                .await
709                .map(crate::Response::into_body)
710        }
711
712        /// Streams each page in the collection.
713        pub fn by_page(
714            self,
715        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListProvidersResponse, crate::Error>
716        {
717            use std::clone::Clone;
718            let token = self.0.request.page_token.clone();
719            let execute = move |token: String| {
720                let mut builder = self.clone();
721                builder.0.request = builder.0.request.set_page_token(token);
722                builder.send()
723            };
724            google_cloud_gax::paginator::internal::new_paginator(token, execute)
725        }
726
727        /// Streams each item in the collection.
728        pub fn by_item(
729            self,
730        ) -> impl google_cloud_gax::paginator::ItemPaginator<
731            crate::model::ListProvidersResponse,
732            crate::Error,
733        > {
734            use google_cloud_gax::paginator::Paginator;
735            self.by_page().items()
736        }
737
738        /// Sets the value of [parent][crate::model::ListProvidersRequest::parent].
739        ///
740        /// This is a **required** field for requests.
741        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
742            self.0.request.parent = v.into();
743            self
744        }
745
746        /// Sets the value of [page_size][crate::model::ListProvidersRequest::page_size].
747        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
748            self.0.request.page_size = v.into();
749            self
750        }
751
752        /// Sets the value of [page_token][crate::model::ListProvidersRequest::page_token].
753        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
754            self.0.request.page_token = v.into();
755            self
756        }
757    }
758
759    #[doc(hidden)]
760    impl crate::RequestBuilder for ListProviders {
761        fn request_options(&mut self) -> &mut crate::RequestOptions {
762            &mut self.0.options
763        }
764    }
765
766    /// The request builder for [Connectors::get_provider][crate::client::Connectors::get_provider] calls.
767    ///
768    /// # Example
769    /// ```
770    /// # use google_cloud_connectors_v1::builder::connectors::GetProvider;
771    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
772    ///
773    /// let builder = prepare_request_builder();
774    /// let response = builder.send().await?;
775    /// # Ok(()) }
776    ///
777    /// fn prepare_request_builder() -> GetProvider {
778    ///   # panic!();
779    ///   // ... details omitted ...
780    /// }
781    /// ```
782    #[derive(Clone, Debug)]
783    pub struct GetProvider(RequestBuilder<crate::model::GetProviderRequest>);
784
785    impl GetProvider {
786        pub(crate) fn new(
787            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
788        ) -> Self {
789            Self(RequestBuilder::new(stub))
790        }
791
792        /// Sets the full request, replacing any prior values.
793        pub fn with_request<V: Into<crate::model::GetProviderRequest>>(mut self, v: V) -> Self {
794            self.0.request = v.into();
795            self
796        }
797
798        /// Sets all the options, replacing any prior values.
799        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
800            self.0.options = v.into();
801            self
802        }
803
804        /// Sends the request.
805        pub async fn send(self) -> Result<crate::model::Provider> {
806            (*self.0.stub)
807                .get_provider(self.0.request, self.0.options)
808                .await
809                .map(crate::Response::into_body)
810        }
811
812        /// Sets the value of [name][crate::model::GetProviderRequest::name].
813        ///
814        /// This is a **required** field for requests.
815        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
816            self.0.request.name = v.into();
817            self
818        }
819    }
820
821    #[doc(hidden)]
822    impl crate::RequestBuilder for GetProvider {
823        fn request_options(&mut self) -> &mut crate::RequestOptions {
824            &mut self.0.options
825        }
826    }
827
828    /// The request builder for [Connectors::list_connectors][crate::client::Connectors::list_connectors] calls.
829    ///
830    /// # Example
831    /// ```
832    /// # use google_cloud_connectors_v1::builder::connectors::ListConnectors;
833    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
834    /// use google_cloud_gax::paginator::ItemPaginator;
835    ///
836    /// let builder = prepare_request_builder();
837    /// let mut items = builder.by_item();
838    /// while let Some(result) = items.next().await {
839    ///   let item = result?;
840    /// }
841    /// # Ok(()) }
842    ///
843    /// fn prepare_request_builder() -> ListConnectors {
844    ///   # panic!();
845    ///   // ... details omitted ...
846    /// }
847    /// ```
848    #[derive(Clone, Debug)]
849    pub struct ListConnectors(RequestBuilder<crate::model::ListConnectorsRequest>);
850
851    impl ListConnectors {
852        pub(crate) fn new(
853            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
854        ) -> Self {
855            Self(RequestBuilder::new(stub))
856        }
857
858        /// Sets the full request, replacing any prior values.
859        pub fn with_request<V: Into<crate::model::ListConnectorsRequest>>(mut self, v: V) -> Self {
860            self.0.request = v.into();
861            self
862        }
863
864        /// Sets all the options, replacing any prior values.
865        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
866            self.0.options = v.into();
867            self
868        }
869
870        /// Sends the request.
871        pub async fn send(self) -> Result<crate::model::ListConnectorsResponse> {
872            (*self.0.stub)
873                .list_connectors(self.0.request, self.0.options)
874                .await
875                .map(crate::Response::into_body)
876        }
877
878        /// Streams each page in the collection.
879        pub fn by_page(
880            self,
881        ) -> impl google_cloud_gax::paginator::Paginator<
882            crate::model::ListConnectorsResponse,
883            crate::Error,
884        > {
885            use std::clone::Clone;
886            let token = self.0.request.page_token.clone();
887            let execute = move |token: String| {
888                let mut builder = self.clone();
889                builder.0.request = builder.0.request.set_page_token(token);
890                builder.send()
891            };
892            google_cloud_gax::paginator::internal::new_paginator(token, execute)
893        }
894
895        /// Streams each item in the collection.
896        pub fn by_item(
897            self,
898        ) -> impl google_cloud_gax::paginator::ItemPaginator<
899            crate::model::ListConnectorsResponse,
900            crate::Error,
901        > {
902            use google_cloud_gax::paginator::Paginator;
903            self.by_page().items()
904        }
905
906        /// Sets the value of [parent][crate::model::ListConnectorsRequest::parent].
907        ///
908        /// This is a **required** field for requests.
909        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
910            self.0.request.parent = v.into();
911            self
912        }
913
914        /// Sets the value of [page_size][crate::model::ListConnectorsRequest::page_size].
915        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
916            self.0.request.page_size = v.into();
917            self
918        }
919
920        /// Sets the value of [page_token][crate::model::ListConnectorsRequest::page_token].
921        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
922            self.0.request.page_token = v.into();
923            self
924        }
925    }
926
927    #[doc(hidden)]
928    impl crate::RequestBuilder for ListConnectors {
929        fn request_options(&mut self) -> &mut crate::RequestOptions {
930            &mut self.0.options
931        }
932    }
933
934    /// The request builder for [Connectors::get_connector][crate::client::Connectors::get_connector] calls.
935    ///
936    /// # Example
937    /// ```
938    /// # use google_cloud_connectors_v1::builder::connectors::GetConnector;
939    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
940    ///
941    /// let builder = prepare_request_builder();
942    /// let response = builder.send().await?;
943    /// # Ok(()) }
944    ///
945    /// fn prepare_request_builder() -> GetConnector {
946    ///   # panic!();
947    ///   // ... details omitted ...
948    /// }
949    /// ```
950    #[derive(Clone, Debug)]
951    pub struct GetConnector(RequestBuilder<crate::model::GetConnectorRequest>);
952
953    impl GetConnector {
954        pub(crate) fn new(
955            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
956        ) -> Self {
957            Self(RequestBuilder::new(stub))
958        }
959
960        /// Sets the full request, replacing any prior values.
961        pub fn with_request<V: Into<crate::model::GetConnectorRequest>>(mut self, v: V) -> Self {
962            self.0.request = v.into();
963            self
964        }
965
966        /// Sets all the options, replacing any prior values.
967        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
968            self.0.options = v.into();
969            self
970        }
971
972        /// Sends the request.
973        pub async fn send(self) -> Result<crate::model::Connector> {
974            (*self.0.stub)
975                .get_connector(self.0.request, self.0.options)
976                .await
977                .map(crate::Response::into_body)
978        }
979
980        /// Sets the value of [name][crate::model::GetConnectorRequest::name].
981        ///
982        /// This is a **required** field for requests.
983        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
984            self.0.request.name = v.into();
985            self
986        }
987    }
988
989    #[doc(hidden)]
990    impl crate::RequestBuilder for GetConnector {
991        fn request_options(&mut self) -> &mut crate::RequestOptions {
992            &mut self.0.options
993        }
994    }
995
996    /// The request builder for [Connectors::list_connector_versions][crate::client::Connectors::list_connector_versions] calls.
997    ///
998    /// # Example
999    /// ```
1000    /// # use google_cloud_connectors_v1::builder::connectors::ListConnectorVersions;
1001    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1002    /// use google_cloud_gax::paginator::ItemPaginator;
1003    ///
1004    /// let builder = prepare_request_builder();
1005    /// let mut items = builder.by_item();
1006    /// while let Some(result) = items.next().await {
1007    ///   let item = result?;
1008    /// }
1009    /// # Ok(()) }
1010    ///
1011    /// fn prepare_request_builder() -> ListConnectorVersions {
1012    ///   # panic!();
1013    ///   // ... details omitted ...
1014    /// }
1015    /// ```
1016    #[derive(Clone, Debug)]
1017    pub struct ListConnectorVersions(RequestBuilder<crate::model::ListConnectorVersionsRequest>);
1018
1019    impl ListConnectorVersions {
1020        pub(crate) fn new(
1021            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1022        ) -> Self {
1023            Self(RequestBuilder::new(stub))
1024        }
1025
1026        /// Sets the full request, replacing any prior values.
1027        pub fn with_request<V: Into<crate::model::ListConnectorVersionsRequest>>(
1028            mut self,
1029            v: V,
1030        ) -> Self {
1031            self.0.request = v.into();
1032            self
1033        }
1034
1035        /// Sets all the options, replacing any prior values.
1036        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1037            self.0.options = v.into();
1038            self
1039        }
1040
1041        /// Sends the request.
1042        pub async fn send(self) -> Result<crate::model::ListConnectorVersionsResponse> {
1043            (*self.0.stub)
1044                .list_connector_versions(self.0.request, self.0.options)
1045                .await
1046                .map(crate::Response::into_body)
1047        }
1048
1049        /// Streams each page in the collection.
1050        pub fn by_page(
1051            self,
1052        ) -> impl google_cloud_gax::paginator::Paginator<
1053            crate::model::ListConnectorVersionsResponse,
1054            crate::Error,
1055        > {
1056            use std::clone::Clone;
1057            let token = self.0.request.page_token.clone();
1058            let execute = move |token: String| {
1059                let mut builder = self.clone();
1060                builder.0.request = builder.0.request.set_page_token(token);
1061                builder.send()
1062            };
1063            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1064        }
1065
1066        /// Streams each item in the collection.
1067        pub fn by_item(
1068            self,
1069        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1070            crate::model::ListConnectorVersionsResponse,
1071            crate::Error,
1072        > {
1073            use google_cloud_gax::paginator::Paginator;
1074            self.by_page().items()
1075        }
1076
1077        /// Sets the value of [parent][crate::model::ListConnectorVersionsRequest::parent].
1078        ///
1079        /// This is a **required** field for requests.
1080        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1081            self.0.request.parent = v.into();
1082            self
1083        }
1084
1085        /// Sets the value of [page_size][crate::model::ListConnectorVersionsRequest::page_size].
1086        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1087            self.0.request.page_size = v.into();
1088            self
1089        }
1090
1091        /// Sets the value of [page_token][crate::model::ListConnectorVersionsRequest::page_token].
1092        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1093            self.0.request.page_token = v.into();
1094            self
1095        }
1096
1097        /// Sets the value of [view][crate::model::ListConnectorVersionsRequest::view].
1098        pub fn set_view<T: Into<crate::model::ConnectorVersionView>>(mut self, v: T) -> Self {
1099            self.0.request.view = v.into();
1100            self
1101        }
1102    }
1103
1104    #[doc(hidden)]
1105    impl crate::RequestBuilder for ListConnectorVersions {
1106        fn request_options(&mut self) -> &mut crate::RequestOptions {
1107            &mut self.0.options
1108        }
1109    }
1110
1111    /// The request builder for [Connectors::get_connector_version][crate::client::Connectors::get_connector_version] calls.
1112    ///
1113    /// # Example
1114    /// ```
1115    /// # use google_cloud_connectors_v1::builder::connectors::GetConnectorVersion;
1116    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1117    ///
1118    /// let builder = prepare_request_builder();
1119    /// let response = builder.send().await?;
1120    /// # Ok(()) }
1121    ///
1122    /// fn prepare_request_builder() -> GetConnectorVersion {
1123    ///   # panic!();
1124    ///   // ... details omitted ...
1125    /// }
1126    /// ```
1127    #[derive(Clone, Debug)]
1128    pub struct GetConnectorVersion(RequestBuilder<crate::model::GetConnectorVersionRequest>);
1129
1130    impl GetConnectorVersion {
1131        pub(crate) fn new(
1132            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1133        ) -> Self {
1134            Self(RequestBuilder::new(stub))
1135        }
1136
1137        /// Sets the full request, replacing any prior values.
1138        pub fn with_request<V: Into<crate::model::GetConnectorVersionRequest>>(
1139            mut self,
1140            v: V,
1141        ) -> Self {
1142            self.0.request = v.into();
1143            self
1144        }
1145
1146        /// Sets all the options, replacing any prior values.
1147        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1148            self.0.options = v.into();
1149            self
1150        }
1151
1152        /// Sends the request.
1153        pub async fn send(self) -> Result<crate::model::ConnectorVersion> {
1154            (*self.0.stub)
1155                .get_connector_version(self.0.request, self.0.options)
1156                .await
1157                .map(crate::Response::into_body)
1158        }
1159
1160        /// Sets the value of [name][crate::model::GetConnectorVersionRequest::name].
1161        ///
1162        /// This is a **required** field for requests.
1163        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1164            self.0.request.name = v.into();
1165            self
1166        }
1167
1168        /// Sets the value of [view][crate::model::GetConnectorVersionRequest::view].
1169        pub fn set_view<T: Into<crate::model::ConnectorVersionView>>(mut self, v: T) -> Self {
1170            self.0.request.view = v.into();
1171            self
1172        }
1173    }
1174
1175    #[doc(hidden)]
1176    impl crate::RequestBuilder for GetConnectorVersion {
1177        fn request_options(&mut self) -> &mut crate::RequestOptions {
1178            &mut self.0.options
1179        }
1180    }
1181
1182    /// The request builder for [Connectors::get_connection_schema_metadata][crate::client::Connectors::get_connection_schema_metadata] calls.
1183    ///
1184    /// # Example
1185    /// ```
1186    /// # use google_cloud_connectors_v1::builder::connectors::GetConnectionSchemaMetadata;
1187    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1188    ///
1189    /// let builder = prepare_request_builder();
1190    /// let response = builder.send().await?;
1191    /// # Ok(()) }
1192    ///
1193    /// fn prepare_request_builder() -> GetConnectionSchemaMetadata {
1194    ///   # panic!();
1195    ///   // ... details omitted ...
1196    /// }
1197    /// ```
1198    #[derive(Clone, Debug)]
1199    pub struct GetConnectionSchemaMetadata(
1200        RequestBuilder<crate::model::GetConnectionSchemaMetadataRequest>,
1201    );
1202
1203    impl GetConnectionSchemaMetadata {
1204        pub(crate) fn new(
1205            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1206        ) -> Self {
1207            Self(RequestBuilder::new(stub))
1208        }
1209
1210        /// Sets the full request, replacing any prior values.
1211        pub fn with_request<V: Into<crate::model::GetConnectionSchemaMetadataRequest>>(
1212            mut self,
1213            v: V,
1214        ) -> Self {
1215            self.0.request = v.into();
1216            self
1217        }
1218
1219        /// Sets all the options, replacing any prior values.
1220        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1221            self.0.options = v.into();
1222            self
1223        }
1224
1225        /// Sends the request.
1226        pub async fn send(self) -> Result<crate::model::ConnectionSchemaMetadata> {
1227            (*self.0.stub)
1228                .get_connection_schema_metadata(self.0.request, self.0.options)
1229                .await
1230                .map(crate::Response::into_body)
1231        }
1232
1233        /// Sets the value of [name][crate::model::GetConnectionSchemaMetadataRequest::name].
1234        ///
1235        /// This is a **required** field for requests.
1236        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1237            self.0.request.name = v.into();
1238            self
1239        }
1240    }
1241
1242    #[doc(hidden)]
1243    impl crate::RequestBuilder for GetConnectionSchemaMetadata {
1244        fn request_options(&mut self) -> &mut crate::RequestOptions {
1245            &mut self.0.options
1246        }
1247    }
1248
1249    /// The request builder for [Connectors::refresh_connection_schema_metadata][crate::client::Connectors::refresh_connection_schema_metadata] calls.
1250    ///
1251    /// # Example
1252    /// ```
1253    /// # use google_cloud_connectors_v1::builder::connectors::RefreshConnectionSchemaMetadata;
1254    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1255    /// use google_cloud_lro::Poller;
1256    ///
1257    /// let builder = prepare_request_builder();
1258    /// let response = builder.poller().until_done().await?;
1259    /// # Ok(()) }
1260    ///
1261    /// fn prepare_request_builder() -> RefreshConnectionSchemaMetadata {
1262    ///   # panic!();
1263    ///   // ... details omitted ...
1264    /// }
1265    /// ```
1266    #[derive(Clone, Debug)]
1267    pub struct RefreshConnectionSchemaMetadata(
1268        RequestBuilder<crate::model::RefreshConnectionSchemaMetadataRequest>,
1269    );
1270
1271    impl RefreshConnectionSchemaMetadata {
1272        pub(crate) fn new(
1273            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1274        ) -> Self {
1275            Self(RequestBuilder::new(stub))
1276        }
1277
1278        /// Sets the full request, replacing any prior values.
1279        pub fn with_request<V: Into<crate::model::RefreshConnectionSchemaMetadataRequest>>(
1280            mut self,
1281            v: V,
1282        ) -> Self {
1283            self.0.request = v.into();
1284            self
1285        }
1286
1287        /// Sets all the options, replacing any prior values.
1288        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1289            self.0.options = v.into();
1290            self
1291        }
1292
1293        /// Sends the request.
1294        ///
1295        /// # Long running operations
1296        ///
1297        /// This starts, but does not poll, a longrunning operation. More information
1298        /// on [refresh_connection_schema_metadata][crate::client::Connectors::refresh_connection_schema_metadata].
1299        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1300            (*self.0.stub)
1301                .refresh_connection_schema_metadata(self.0.request, self.0.options)
1302                .await
1303                .map(crate::Response::into_body)
1304        }
1305
1306        /// Creates a [Poller][google_cloud_lro::Poller] to work with `refresh_connection_schema_metadata`.
1307        pub fn poller(
1308            self,
1309        ) -> impl google_cloud_lro::Poller<
1310            crate::model::ConnectionSchemaMetadata,
1311            crate::model::OperationMetadata,
1312        > {
1313            type Operation = google_cloud_lro::internal::Operation<
1314                crate::model::ConnectionSchemaMetadata,
1315                crate::model::OperationMetadata,
1316            >;
1317            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1318            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1319
1320            let stub = self.0.stub.clone();
1321            let mut options = self.0.options.clone();
1322            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1323            let query = move |name| {
1324                let stub = stub.clone();
1325                let options = options.clone();
1326                async {
1327                    let op = GetOperation::new(stub)
1328                        .set_name(name)
1329                        .with_options(options)
1330                        .send()
1331                        .await?;
1332                    Ok(Operation::new(op))
1333                }
1334            };
1335
1336            let start = move || async {
1337                let op = self.send().await?;
1338                Ok(Operation::new(op))
1339            };
1340
1341            google_cloud_lro::internal::new_poller(
1342                polling_error_policy,
1343                polling_backoff_policy,
1344                start,
1345                query,
1346            )
1347        }
1348
1349        /// Sets the value of [name][crate::model::RefreshConnectionSchemaMetadataRequest::name].
1350        ///
1351        /// This is a **required** field for requests.
1352        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1353            self.0.request.name = v.into();
1354            self
1355        }
1356    }
1357
1358    #[doc(hidden)]
1359    impl crate::RequestBuilder for RefreshConnectionSchemaMetadata {
1360        fn request_options(&mut self) -> &mut crate::RequestOptions {
1361            &mut self.0.options
1362        }
1363    }
1364
1365    /// The request builder for [Connectors::list_runtime_entity_schemas][crate::client::Connectors::list_runtime_entity_schemas] calls.
1366    ///
1367    /// # Example
1368    /// ```
1369    /// # use google_cloud_connectors_v1::builder::connectors::ListRuntimeEntitySchemas;
1370    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1371    /// use google_cloud_gax::paginator::ItemPaginator;
1372    ///
1373    /// let builder = prepare_request_builder();
1374    /// let mut items = builder.by_item();
1375    /// while let Some(result) = items.next().await {
1376    ///   let item = result?;
1377    /// }
1378    /// # Ok(()) }
1379    ///
1380    /// fn prepare_request_builder() -> ListRuntimeEntitySchemas {
1381    ///   # panic!();
1382    ///   // ... details omitted ...
1383    /// }
1384    /// ```
1385    #[derive(Clone, Debug)]
1386    pub struct ListRuntimeEntitySchemas(
1387        RequestBuilder<crate::model::ListRuntimeEntitySchemasRequest>,
1388    );
1389
1390    impl ListRuntimeEntitySchemas {
1391        pub(crate) fn new(
1392            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1393        ) -> Self {
1394            Self(RequestBuilder::new(stub))
1395        }
1396
1397        /// Sets the full request, replacing any prior values.
1398        pub fn with_request<V: Into<crate::model::ListRuntimeEntitySchemasRequest>>(
1399            mut self,
1400            v: V,
1401        ) -> Self {
1402            self.0.request = v.into();
1403            self
1404        }
1405
1406        /// Sets all the options, replacing any prior values.
1407        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1408            self.0.options = v.into();
1409            self
1410        }
1411
1412        /// Sends the request.
1413        pub async fn send(self) -> Result<crate::model::ListRuntimeEntitySchemasResponse> {
1414            (*self.0.stub)
1415                .list_runtime_entity_schemas(self.0.request, self.0.options)
1416                .await
1417                .map(crate::Response::into_body)
1418        }
1419
1420        /// Streams each page in the collection.
1421        pub fn by_page(
1422            self,
1423        ) -> impl google_cloud_gax::paginator::Paginator<
1424            crate::model::ListRuntimeEntitySchemasResponse,
1425            crate::Error,
1426        > {
1427            use std::clone::Clone;
1428            let token = self.0.request.page_token.clone();
1429            let execute = move |token: String| {
1430                let mut builder = self.clone();
1431                builder.0.request = builder.0.request.set_page_token(token);
1432                builder.send()
1433            };
1434            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1435        }
1436
1437        /// Streams each item in the collection.
1438        pub fn by_item(
1439            self,
1440        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1441            crate::model::ListRuntimeEntitySchemasResponse,
1442            crate::Error,
1443        > {
1444            use google_cloud_gax::paginator::Paginator;
1445            self.by_page().items()
1446        }
1447
1448        /// Sets the value of [parent][crate::model::ListRuntimeEntitySchemasRequest::parent].
1449        ///
1450        /// This is a **required** field for requests.
1451        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1452            self.0.request.parent = v.into();
1453            self
1454        }
1455
1456        /// Sets the value of [page_size][crate::model::ListRuntimeEntitySchemasRequest::page_size].
1457        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1458            self.0.request.page_size = v.into();
1459            self
1460        }
1461
1462        /// Sets the value of [page_token][crate::model::ListRuntimeEntitySchemasRequest::page_token].
1463        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1464            self.0.request.page_token = v.into();
1465            self
1466        }
1467
1468        /// Sets the value of [filter][crate::model::ListRuntimeEntitySchemasRequest::filter].
1469        ///
1470        /// This is a **required** field for requests.
1471        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1472            self.0.request.filter = v.into();
1473            self
1474        }
1475    }
1476
1477    #[doc(hidden)]
1478    impl crate::RequestBuilder for ListRuntimeEntitySchemas {
1479        fn request_options(&mut self) -> &mut crate::RequestOptions {
1480            &mut self.0.options
1481        }
1482    }
1483
1484    /// The request builder for [Connectors::list_runtime_action_schemas][crate::client::Connectors::list_runtime_action_schemas] calls.
1485    ///
1486    /// # Example
1487    /// ```
1488    /// # use google_cloud_connectors_v1::builder::connectors::ListRuntimeActionSchemas;
1489    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1490    /// use google_cloud_gax::paginator::ItemPaginator;
1491    ///
1492    /// let builder = prepare_request_builder();
1493    /// let mut items = builder.by_item();
1494    /// while let Some(result) = items.next().await {
1495    ///   let item = result?;
1496    /// }
1497    /// # Ok(()) }
1498    ///
1499    /// fn prepare_request_builder() -> ListRuntimeActionSchemas {
1500    ///   # panic!();
1501    ///   // ... details omitted ...
1502    /// }
1503    /// ```
1504    #[derive(Clone, Debug)]
1505    pub struct ListRuntimeActionSchemas(
1506        RequestBuilder<crate::model::ListRuntimeActionSchemasRequest>,
1507    );
1508
1509    impl ListRuntimeActionSchemas {
1510        pub(crate) fn new(
1511            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1512        ) -> Self {
1513            Self(RequestBuilder::new(stub))
1514        }
1515
1516        /// Sets the full request, replacing any prior values.
1517        pub fn with_request<V: Into<crate::model::ListRuntimeActionSchemasRequest>>(
1518            mut self,
1519            v: V,
1520        ) -> Self {
1521            self.0.request = v.into();
1522            self
1523        }
1524
1525        /// Sets all the options, replacing any prior values.
1526        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1527            self.0.options = v.into();
1528            self
1529        }
1530
1531        /// Sends the request.
1532        pub async fn send(self) -> Result<crate::model::ListRuntimeActionSchemasResponse> {
1533            (*self.0.stub)
1534                .list_runtime_action_schemas(self.0.request, self.0.options)
1535                .await
1536                .map(crate::Response::into_body)
1537        }
1538
1539        /// Streams each page in the collection.
1540        pub fn by_page(
1541            self,
1542        ) -> impl google_cloud_gax::paginator::Paginator<
1543            crate::model::ListRuntimeActionSchemasResponse,
1544            crate::Error,
1545        > {
1546            use std::clone::Clone;
1547            let token = self.0.request.page_token.clone();
1548            let execute = move |token: String| {
1549                let mut builder = self.clone();
1550                builder.0.request = builder.0.request.set_page_token(token);
1551                builder.send()
1552            };
1553            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1554        }
1555
1556        /// Streams each item in the collection.
1557        pub fn by_item(
1558            self,
1559        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1560            crate::model::ListRuntimeActionSchemasResponse,
1561            crate::Error,
1562        > {
1563            use google_cloud_gax::paginator::Paginator;
1564            self.by_page().items()
1565        }
1566
1567        /// Sets the value of [parent][crate::model::ListRuntimeActionSchemasRequest::parent].
1568        ///
1569        /// This is a **required** field for requests.
1570        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1571            self.0.request.parent = v.into();
1572            self
1573        }
1574
1575        /// Sets the value of [page_size][crate::model::ListRuntimeActionSchemasRequest::page_size].
1576        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1577            self.0.request.page_size = v.into();
1578            self
1579        }
1580
1581        /// Sets the value of [page_token][crate::model::ListRuntimeActionSchemasRequest::page_token].
1582        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1583            self.0.request.page_token = v.into();
1584            self
1585        }
1586
1587        /// Sets the value of [filter][crate::model::ListRuntimeActionSchemasRequest::filter].
1588        ///
1589        /// This is a **required** field for requests.
1590        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1591            self.0.request.filter = v.into();
1592            self
1593        }
1594    }
1595
1596    #[doc(hidden)]
1597    impl crate::RequestBuilder for ListRuntimeActionSchemas {
1598        fn request_options(&mut self) -> &mut crate::RequestOptions {
1599            &mut self.0.options
1600        }
1601    }
1602
1603    /// The request builder for [Connectors::get_runtime_config][crate::client::Connectors::get_runtime_config] calls.
1604    ///
1605    /// # Example
1606    /// ```
1607    /// # use google_cloud_connectors_v1::builder::connectors::GetRuntimeConfig;
1608    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1609    ///
1610    /// let builder = prepare_request_builder();
1611    /// let response = builder.send().await?;
1612    /// # Ok(()) }
1613    ///
1614    /// fn prepare_request_builder() -> GetRuntimeConfig {
1615    ///   # panic!();
1616    ///   // ... details omitted ...
1617    /// }
1618    /// ```
1619    #[derive(Clone, Debug)]
1620    pub struct GetRuntimeConfig(RequestBuilder<crate::model::GetRuntimeConfigRequest>);
1621
1622    impl GetRuntimeConfig {
1623        pub(crate) fn new(
1624            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1625        ) -> Self {
1626            Self(RequestBuilder::new(stub))
1627        }
1628
1629        /// Sets the full request, replacing any prior values.
1630        pub fn with_request<V: Into<crate::model::GetRuntimeConfigRequest>>(
1631            mut self,
1632            v: V,
1633        ) -> Self {
1634            self.0.request = v.into();
1635            self
1636        }
1637
1638        /// Sets all the options, replacing any prior values.
1639        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1640            self.0.options = v.into();
1641            self
1642        }
1643
1644        /// Sends the request.
1645        pub async fn send(self) -> Result<crate::model::RuntimeConfig> {
1646            (*self.0.stub)
1647                .get_runtime_config(self.0.request, self.0.options)
1648                .await
1649                .map(crate::Response::into_body)
1650        }
1651
1652        /// Sets the value of [name][crate::model::GetRuntimeConfigRequest::name].
1653        ///
1654        /// This is a **required** field for requests.
1655        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1656            self.0.request.name = v.into();
1657            self
1658        }
1659    }
1660
1661    #[doc(hidden)]
1662    impl crate::RequestBuilder for GetRuntimeConfig {
1663        fn request_options(&mut self) -> &mut crate::RequestOptions {
1664            &mut self.0.options
1665        }
1666    }
1667
1668    /// The request builder for [Connectors::get_global_settings][crate::client::Connectors::get_global_settings] calls.
1669    ///
1670    /// # Example
1671    /// ```
1672    /// # use google_cloud_connectors_v1::builder::connectors::GetGlobalSettings;
1673    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1674    ///
1675    /// let builder = prepare_request_builder();
1676    /// let response = builder.send().await?;
1677    /// # Ok(()) }
1678    ///
1679    /// fn prepare_request_builder() -> GetGlobalSettings {
1680    ///   # panic!();
1681    ///   // ... details omitted ...
1682    /// }
1683    /// ```
1684    #[derive(Clone, Debug)]
1685    pub struct GetGlobalSettings(RequestBuilder<crate::model::GetGlobalSettingsRequest>);
1686
1687    impl GetGlobalSettings {
1688        pub(crate) fn new(
1689            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1690        ) -> Self {
1691            Self(RequestBuilder::new(stub))
1692        }
1693
1694        /// Sets the full request, replacing any prior values.
1695        pub fn with_request<V: Into<crate::model::GetGlobalSettingsRequest>>(
1696            mut self,
1697            v: V,
1698        ) -> Self {
1699            self.0.request = v.into();
1700            self
1701        }
1702
1703        /// Sets all the options, replacing any prior values.
1704        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1705            self.0.options = v.into();
1706            self
1707        }
1708
1709        /// Sends the request.
1710        pub async fn send(self) -> Result<crate::model::Settings> {
1711            (*self.0.stub)
1712                .get_global_settings(self.0.request, self.0.options)
1713                .await
1714                .map(crate::Response::into_body)
1715        }
1716
1717        /// Sets the value of [name][crate::model::GetGlobalSettingsRequest::name].
1718        ///
1719        /// This is a **required** field for requests.
1720        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1721            self.0.request.name = v.into();
1722            self
1723        }
1724    }
1725
1726    #[doc(hidden)]
1727    impl crate::RequestBuilder for GetGlobalSettings {
1728        fn request_options(&mut self) -> &mut crate::RequestOptions {
1729            &mut self.0.options
1730        }
1731    }
1732
1733    /// The request builder for [Connectors::list_locations][crate::client::Connectors::list_locations] calls.
1734    ///
1735    /// # Example
1736    /// ```
1737    /// # use google_cloud_connectors_v1::builder::connectors::ListLocations;
1738    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1739    /// use google_cloud_gax::paginator::ItemPaginator;
1740    ///
1741    /// let builder = prepare_request_builder();
1742    /// let mut items = builder.by_item();
1743    /// while let Some(result) = items.next().await {
1744    ///   let item = result?;
1745    /// }
1746    /// # Ok(()) }
1747    ///
1748    /// fn prepare_request_builder() -> ListLocations {
1749    ///   # panic!();
1750    ///   // ... details omitted ...
1751    /// }
1752    /// ```
1753    #[derive(Clone, Debug)]
1754    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1755
1756    impl ListLocations {
1757        pub(crate) fn new(
1758            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1759        ) -> Self {
1760            Self(RequestBuilder::new(stub))
1761        }
1762
1763        /// Sets the full request, replacing any prior values.
1764        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1765            mut self,
1766            v: V,
1767        ) -> Self {
1768            self.0.request = v.into();
1769            self
1770        }
1771
1772        /// Sets all the options, replacing any prior values.
1773        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1774            self.0.options = v.into();
1775            self
1776        }
1777
1778        /// Sends the request.
1779        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1780            (*self.0.stub)
1781                .list_locations(self.0.request, self.0.options)
1782                .await
1783                .map(crate::Response::into_body)
1784        }
1785
1786        /// Streams each page in the collection.
1787        pub fn by_page(
1788            self,
1789        ) -> impl google_cloud_gax::paginator::Paginator<
1790            google_cloud_location::model::ListLocationsResponse,
1791            crate::Error,
1792        > {
1793            use std::clone::Clone;
1794            let token = self.0.request.page_token.clone();
1795            let execute = move |token: String| {
1796                let mut builder = self.clone();
1797                builder.0.request = builder.0.request.set_page_token(token);
1798                builder.send()
1799            };
1800            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1801        }
1802
1803        /// Streams each item in the collection.
1804        pub fn by_item(
1805            self,
1806        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1807            google_cloud_location::model::ListLocationsResponse,
1808            crate::Error,
1809        > {
1810            use google_cloud_gax::paginator::Paginator;
1811            self.by_page().items()
1812        }
1813
1814        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1815        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816            self.0.request.name = v.into();
1817            self
1818        }
1819
1820        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1821        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1822            self.0.request.filter = v.into();
1823            self
1824        }
1825
1826        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1827        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1828            self.0.request.page_size = v.into();
1829            self
1830        }
1831
1832        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1833        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1834            self.0.request.page_token = v.into();
1835            self
1836        }
1837    }
1838
1839    #[doc(hidden)]
1840    impl crate::RequestBuilder for ListLocations {
1841        fn request_options(&mut self) -> &mut crate::RequestOptions {
1842            &mut self.0.options
1843        }
1844    }
1845
1846    /// The request builder for [Connectors::get_location][crate::client::Connectors::get_location] calls.
1847    ///
1848    /// # Example
1849    /// ```
1850    /// # use google_cloud_connectors_v1::builder::connectors::GetLocation;
1851    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1852    ///
1853    /// let builder = prepare_request_builder();
1854    /// let response = builder.send().await?;
1855    /// # Ok(()) }
1856    ///
1857    /// fn prepare_request_builder() -> GetLocation {
1858    ///   # panic!();
1859    ///   // ... details omitted ...
1860    /// }
1861    /// ```
1862    #[derive(Clone, Debug)]
1863    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1864
1865    impl GetLocation {
1866        pub(crate) fn new(
1867            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1868        ) -> Self {
1869            Self(RequestBuilder::new(stub))
1870        }
1871
1872        /// Sets the full request, replacing any prior values.
1873        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1874            mut self,
1875            v: V,
1876        ) -> Self {
1877            self.0.request = v.into();
1878            self
1879        }
1880
1881        /// Sets all the options, replacing any prior values.
1882        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1883            self.0.options = v.into();
1884            self
1885        }
1886
1887        /// Sends the request.
1888        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1889            (*self.0.stub)
1890                .get_location(self.0.request, self.0.options)
1891                .await
1892                .map(crate::Response::into_body)
1893        }
1894
1895        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1896        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1897            self.0.request.name = v.into();
1898            self
1899        }
1900    }
1901
1902    #[doc(hidden)]
1903    impl crate::RequestBuilder for GetLocation {
1904        fn request_options(&mut self) -> &mut crate::RequestOptions {
1905            &mut self.0.options
1906        }
1907    }
1908
1909    /// The request builder for [Connectors::set_iam_policy][crate::client::Connectors::set_iam_policy] calls.
1910    ///
1911    /// # Example
1912    /// ```
1913    /// # use google_cloud_connectors_v1::builder::connectors::SetIamPolicy;
1914    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
1915    ///
1916    /// let builder = prepare_request_builder();
1917    /// let response = builder.send().await?;
1918    /// # Ok(()) }
1919    ///
1920    /// fn prepare_request_builder() -> SetIamPolicy {
1921    ///   # panic!();
1922    ///   // ... details omitted ...
1923    /// }
1924    /// ```
1925    #[derive(Clone, Debug)]
1926    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1927
1928    impl SetIamPolicy {
1929        pub(crate) fn new(
1930            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1931        ) -> Self {
1932            Self(RequestBuilder::new(stub))
1933        }
1934
1935        /// Sets the full request, replacing any prior values.
1936        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1937            mut self,
1938            v: V,
1939        ) -> Self {
1940            self.0.request = v.into();
1941            self
1942        }
1943
1944        /// Sets all the options, replacing any prior values.
1945        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1946            self.0.options = v.into();
1947            self
1948        }
1949
1950        /// Sends the request.
1951        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1952            (*self.0.stub)
1953                .set_iam_policy(self.0.request, self.0.options)
1954                .await
1955                .map(crate::Response::into_body)
1956        }
1957
1958        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1959        ///
1960        /// This is a **required** field for requests.
1961        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1962            self.0.request.resource = v.into();
1963            self
1964        }
1965
1966        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1967        ///
1968        /// This is a **required** field for requests.
1969        pub fn set_policy<T>(mut self, v: T) -> Self
1970        where
1971            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1972        {
1973            self.0.request.policy = std::option::Option::Some(v.into());
1974            self
1975        }
1976
1977        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1978        ///
1979        /// This is a **required** field for requests.
1980        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1981        where
1982            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1983        {
1984            self.0.request.policy = v.map(|x| x.into());
1985            self
1986        }
1987
1988        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1989        pub fn set_update_mask<T>(mut self, v: T) -> Self
1990        where
1991            T: std::convert::Into<wkt::FieldMask>,
1992        {
1993            self.0.request.update_mask = std::option::Option::Some(v.into());
1994            self
1995        }
1996
1997        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1998        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1999        where
2000            T: std::convert::Into<wkt::FieldMask>,
2001        {
2002            self.0.request.update_mask = v.map(|x| x.into());
2003            self
2004        }
2005    }
2006
2007    #[doc(hidden)]
2008    impl crate::RequestBuilder for SetIamPolicy {
2009        fn request_options(&mut self) -> &mut crate::RequestOptions {
2010            &mut self.0.options
2011        }
2012    }
2013
2014    /// The request builder for [Connectors::get_iam_policy][crate::client::Connectors::get_iam_policy] calls.
2015    ///
2016    /// # Example
2017    /// ```
2018    /// # use google_cloud_connectors_v1::builder::connectors::GetIamPolicy;
2019    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
2020    ///
2021    /// let builder = prepare_request_builder();
2022    /// let response = builder.send().await?;
2023    /// # Ok(()) }
2024    ///
2025    /// fn prepare_request_builder() -> GetIamPolicy {
2026    ///   # panic!();
2027    ///   // ... details omitted ...
2028    /// }
2029    /// ```
2030    #[derive(Clone, Debug)]
2031    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2032
2033    impl GetIamPolicy {
2034        pub(crate) fn new(
2035            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2036        ) -> Self {
2037            Self(RequestBuilder::new(stub))
2038        }
2039
2040        /// Sets the full request, replacing any prior values.
2041        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2042            mut self,
2043            v: V,
2044        ) -> Self {
2045            self.0.request = v.into();
2046            self
2047        }
2048
2049        /// Sets all the options, replacing any prior values.
2050        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2051            self.0.options = v.into();
2052            self
2053        }
2054
2055        /// Sends the request.
2056        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2057            (*self.0.stub)
2058                .get_iam_policy(self.0.request, self.0.options)
2059                .await
2060                .map(crate::Response::into_body)
2061        }
2062
2063        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
2064        ///
2065        /// This is a **required** field for requests.
2066        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2067            self.0.request.resource = v.into();
2068            self
2069        }
2070
2071        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2072        pub fn set_options<T>(mut self, v: T) -> Self
2073        where
2074            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2075        {
2076            self.0.request.options = std::option::Option::Some(v.into());
2077            self
2078        }
2079
2080        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2081        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2082        where
2083            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2084        {
2085            self.0.request.options = v.map(|x| x.into());
2086            self
2087        }
2088    }
2089
2090    #[doc(hidden)]
2091    impl crate::RequestBuilder for GetIamPolicy {
2092        fn request_options(&mut self) -> &mut crate::RequestOptions {
2093            &mut self.0.options
2094        }
2095    }
2096
2097    /// The request builder for [Connectors::test_iam_permissions][crate::client::Connectors::test_iam_permissions] calls.
2098    ///
2099    /// # Example
2100    /// ```
2101    /// # use google_cloud_connectors_v1::builder::connectors::TestIamPermissions;
2102    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
2103    ///
2104    /// let builder = prepare_request_builder();
2105    /// let response = builder.send().await?;
2106    /// # Ok(()) }
2107    ///
2108    /// fn prepare_request_builder() -> TestIamPermissions {
2109    ///   # panic!();
2110    ///   // ... details omitted ...
2111    /// }
2112    /// ```
2113    #[derive(Clone, Debug)]
2114    pub struct TestIamPermissions(
2115        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2116    );
2117
2118    impl TestIamPermissions {
2119        pub(crate) fn new(
2120            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2121        ) -> Self {
2122            Self(RequestBuilder::new(stub))
2123        }
2124
2125        /// Sets the full request, replacing any prior values.
2126        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2127            mut self,
2128            v: V,
2129        ) -> Self {
2130            self.0.request = v.into();
2131            self
2132        }
2133
2134        /// Sets all the options, replacing any prior values.
2135        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2136            self.0.options = v.into();
2137            self
2138        }
2139
2140        /// Sends the request.
2141        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2142            (*self.0.stub)
2143                .test_iam_permissions(self.0.request, self.0.options)
2144                .await
2145                .map(crate::Response::into_body)
2146        }
2147
2148        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2149        ///
2150        /// This is a **required** field for requests.
2151        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2152            self.0.request.resource = v.into();
2153            self
2154        }
2155
2156        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2157        ///
2158        /// This is a **required** field for requests.
2159        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2160        where
2161            T: std::iter::IntoIterator<Item = V>,
2162            V: std::convert::Into<std::string::String>,
2163        {
2164            use std::iter::Iterator;
2165            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2166            self
2167        }
2168    }
2169
2170    #[doc(hidden)]
2171    impl crate::RequestBuilder for TestIamPermissions {
2172        fn request_options(&mut self) -> &mut crate::RequestOptions {
2173            &mut self.0.options
2174        }
2175    }
2176
2177    /// The request builder for [Connectors::list_operations][crate::client::Connectors::list_operations] calls.
2178    ///
2179    /// # Example
2180    /// ```
2181    /// # use google_cloud_connectors_v1::builder::connectors::ListOperations;
2182    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
2183    /// use google_cloud_gax::paginator::ItemPaginator;
2184    ///
2185    /// let builder = prepare_request_builder();
2186    /// let mut items = builder.by_item();
2187    /// while let Some(result) = items.next().await {
2188    ///   let item = result?;
2189    /// }
2190    /// # Ok(()) }
2191    ///
2192    /// fn prepare_request_builder() -> ListOperations {
2193    ///   # panic!();
2194    ///   // ... details omitted ...
2195    /// }
2196    /// ```
2197    #[derive(Clone, Debug)]
2198    pub struct ListOperations(
2199        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2200    );
2201
2202    impl ListOperations {
2203        pub(crate) fn new(
2204            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2205        ) -> Self {
2206            Self(RequestBuilder::new(stub))
2207        }
2208
2209        /// Sets the full request, replacing any prior values.
2210        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2211            mut self,
2212            v: V,
2213        ) -> Self {
2214            self.0.request = v.into();
2215            self
2216        }
2217
2218        /// Sets all the options, replacing any prior values.
2219        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2220            self.0.options = v.into();
2221            self
2222        }
2223
2224        /// Sends the request.
2225        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2226            (*self.0.stub)
2227                .list_operations(self.0.request, self.0.options)
2228                .await
2229                .map(crate::Response::into_body)
2230        }
2231
2232        /// Streams each page in the collection.
2233        pub fn by_page(
2234            self,
2235        ) -> impl google_cloud_gax::paginator::Paginator<
2236            google_cloud_longrunning::model::ListOperationsResponse,
2237            crate::Error,
2238        > {
2239            use std::clone::Clone;
2240            let token = self.0.request.page_token.clone();
2241            let execute = move |token: String| {
2242                let mut builder = self.clone();
2243                builder.0.request = builder.0.request.set_page_token(token);
2244                builder.send()
2245            };
2246            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2247        }
2248
2249        /// Streams each item in the collection.
2250        pub fn by_item(
2251            self,
2252        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2253            google_cloud_longrunning::model::ListOperationsResponse,
2254            crate::Error,
2255        > {
2256            use google_cloud_gax::paginator::Paginator;
2257            self.by_page().items()
2258        }
2259
2260        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2261        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2262            self.0.request.name = v.into();
2263            self
2264        }
2265
2266        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2267        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2268            self.0.request.filter = v.into();
2269            self
2270        }
2271
2272        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2273        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2274            self.0.request.page_size = v.into();
2275            self
2276        }
2277
2278        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2279        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2280            self.0.request.page_token = v.into();
2281            self
2282        }
2283
2284        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2285        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2286            self.0.request.return_partial_success = v.into();
2287            self
2288        }
2289    }
2290
2291    #[doc(hidden)]
2292    impl crate::RequestBuilder for ListOperations {
2293        fn request_options(&mut self) -> &mut crate::RequestOptions {
2294            &mut self.0.options
2295        }
2296    }
2297
2298    /// The request builder for [Connectors::get_operation][crate::client::Connectors::get_operation] calls.
2299    ///
2300    /// # Example
2301    /// ```
2302    /// # use google_cloud_connectors_v1::builder::connectors::GetOperation;
2303    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
2304    ///
2305    /// let builder = prepare_request_builder();
2306    /// let response = builder.send().await?;
2307    /// # Ok(()) }
2308    ///
2309    /// fn prepare_request_builder() -> GetOperation {
2310    ///   # panic!();
2311    ///   // ... details omitted ...
2312    /// }
2313    /// ```
2314    #[derive(Clone, Debug)]
2315    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2316
2317    impl GetOperation {
2318        pub(crate) fn new(
2319            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2320        ) -> Self {
2321            Self(RequestBuilder::new(stub))
2322        }
2323
2324        /// Sets the full request, replacing any prior values.
2325        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2326            mut self,
2327            v: V,
2328        ) -> 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<crate::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<google_cloud_longrunning::model::Operation> {
2341            (*self.0.stub)
2342                .get_operation(self.0.request, self.0.options)
2343                .await
2344                .map(crate::Response::into_body)
2345        }
2346
2347        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2348        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2349            self.0.request.name = v.into();
2350            self
2351        }
2352    }
2353
2354    #[doc(hidden)]
2355    impl crate::RequestBuilder for GetOperation {
2356        fn request_options(&mut self) -> &mut crate::RequestOptions {
2357            &mut self.0.options
2358        }
2359    }
2360
2361    /// The request builder for [Connectors::delete_operation][crate::client::Connectors::delete_operation] calls.
2362    ///
2363    /// # Example
2364    /// ```
2365    /// # use google_cloud_connectors_v1::builder::connectors::DeleteOperation;
2366    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
2367    ///
2368    /// let builder = prepare_request_builder();
2369    /// let response = builder.send().await?;
2370    /// # Ok(()) }
2371    ///
2372    /// fn prepare_request_builder() -> DeleteOperation {
2373    ///   # panic!();
2374    ///   // ... details omitted ...
2375    /// }
2376    /// ```
2377    #[derive(Clone, Debug)]
2378    pub struct DeleteOperation(
2379        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2380    );
2381
2382    impl DeleteOperation {
2383        pub(crate) fn new(
2384            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2385        ) -> Self {
2386            Self(RequestBuilder::new(stub))
2387        }
2388
2389        /// Sets the full request, replacing any prior values.
2390        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2391            mut self,
2392            v: V,
2393        ) -> Self {
2394            self.0.request = v.into();
2395            self
2396        }
2397
2398        /// Sets all the options, replacing any prior values.
2399        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2400            self.0.options = v.into();
2401            self
2402        }
2403
2404        /// Sends the request.
2405        pub async fn send(self) -> Result<()> {
2406            (*self.0.stub)
2407                .delete_operation(self.0.request, self.0.options)
2408                .await
2409                .map(crate::Response::into_body)
2410        }
2411
2412        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2413        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2414            self.0.request.name = v.into();
2415            self
2416        }
2417    }
2418
2419    #[doc(hidden)]
2420    impl crate::RequestBuilder for DeleteOperation {
2421        fn request_options(&mut self) -> &mut crate::RequestOptions {
2422            &mut self.0.options
2423        }
2424    }
2425
2426    /// The request builder for [Connectors::cancel_operation][crate::client::Connectors::cancel_operation] calls.
2427    ///
2428    /// # Example
2429    /// ```
2430    /// # use google_cloud_connectors_v1::builder::connectors::CancelOperation;
2431    /// # async fn sample() -> google_cloud_connectors_v1::Result<()> {
2432    ///
2433    /// let builder = prepare_request_builder();
2434    /// let response = builder.send().await?;
2435    /// # Ok(()) }
2436    ///
2437    /// fn prepare_request_builder() -> CancelOperation {
2438    ///   # panic!();
2439    ///   // ... details omitted ...
2440    /// }
2441    /// ```
2442    #[derive(Clone, Debug)]
2443    pub struct CancelOperation(
2444        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2445    );
2446
2447    impl CancelOperation {
2448        pub(crate) fn new(
2449            stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2450        ) -> Self {
2451            Self(RequestBuilder::new(stub))
2452        }
2453
2454        /// Sets the full request, replacing any prior values.
2455        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2456            mut self,
2457            v: V,
2458        ) -> Self {
2459            self.0.request = v.into();
2460            self
2461        }
2462
2463        /// Sets all the options, replacing any prior values.
2464        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2465            self.0.options = v.into();
2466            self
2467        }
2468
2469        /// Sends the request.
2470        pub async fn send(self) -> Result<()> {
2471            (*self.0.stub)
2472                .cancel_operation(self.0.request, self.0.options)
2473                .await
2474                .map(crate::Response::into_body)
2475        }
2476
2477        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2478        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2479            self.0.request.name = v.into();
2480            self
2481        }
2482    }
2483
2484    #[doc(hidden)]
2485    impl crate::RequestBuilder for CancelOperation {
2486        fn request_options(&mut self) -> &mut crate::RequestOptions {
2487            &mut self.0.options
2488        }
2489    }
2490}