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