1pub mod eventarc {
18 use crate::Result;
19
20 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 #[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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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}