1pub mod topic_admin {
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::TopicAdmin;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = TopicAdmin;
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::TopicAdmin>,
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(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct CreateTopic(RequestBuilder<crate::model::Topic>);
92
93 impl CreateTopic {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::Topic>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::Topic> {
114 (*self.0.stub)
115 .create_topic(self.0.request, self.0.options)
116 .await
117 .map(gax::response::Response::into_body)
118 }
119
120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
124 self.0.request.name = v.into();
125 self
126 }
127
128 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
130 where
131 T: std::iter::IntoIterator<Item = (K, V)>,
132 K: std::convert::Into<std::string::String>,
133 V: std::convert::Into<std::string::String>,
134 {
135 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
136 self
137 }
138
139 pub fn set_message_storage_policy<T>(mut self, v: T) -> Self
141 where
142 T: std::convert::Into<crate::model::MessageStoragePolicy>,
143 {
144 self.0.request.message_storage_policy = std::option::Option::Some(v.into());
145 self
146 }
147
148 pub fn set_or_clear_message_storage_policy<T>(mut self, v: std::option::Option<T>) -> Self
150 where
151 T: std::convert::Into<crate::model::MessageStoragePolicy>,
152 {
153 self.0.request.message_storage_policy = v.map(|x| x.into());
154 self
155 }
156
157 pub fn set_kms_key_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
159 self.0.request.kms_key_name = v.into();
160 self
161 }
162
163 pub fn set_schema_settings<T>(mut self, v: T) -> Self
165 where
166 T: std::convert::Into<crate::model::SchemaSettings>,
167 {
168 self.0.request.schema_settings = std::option::Option::Some(v.into());
169 self
170 }
171
172 pub fn set_or_clear_schema_settings<T>(mut self, v: std::option::Option<T>) -> Self
174 where
175 T: std::convert::Into<crate::model::SchemaSettings>,
176 {
177 self.0.request.schema_settings = v.map(|x| x.into());
178 self
179 }
180
181 pub fn set_satisfies_pzs<T: Into<bool>>(mut self, v: T) -> Self {
183 self.0.request.satisfies_pzs = v.into();
184 self
185 }
186
187 pub fn set_message_retention_duration<T>(mut self, v: T) -> Self
189 where
190 T: std::convert::Into<wkt::Duration>,
191 {
192 self.0.request.message_retention_duration = std::option::Option::Some(v.into());
193 self
194 }
195
196 pub fn set_or_clear_message_retention_duration<T>(
198 mut self,
199 v: std::option::Option<T>,
200 ) -> Self
201 where
202 T: std::convert::Into<wkt::Duration>,
203 {
204 self.0.request.message_retention_duration = v.map(|x| x.into());
205 self
206 }
207
208 pub fn set_state<T: Into<crate::model::topic::State>>(mut self, v: T) -> Self {
210 self.0.request.state = v.into();
211 self
212 }
213
214 pub fn set_ingestion_data_source_settings<T>(mut self, v: T) -> Self
216 where
217 T: std::convert::Into<crate::model::IngestionDataSourceSettings>,
218 {
219 self.0.request.ingestion_data_source_settings = std::option::Option::Some(v.into());
220 self
221 }
222
223 pub fn set_or_clear_ingestion_data_source_settings<T>(
225 mut self,
226 v: std::option::Option<T>,
227 ) -> Self
228 where
229 T: std::convert::Into<crate::model::IngestionDataSourceSettings>,
230 {
231 self.0.request.ingestion_data_source_settings = v.map(|x| x.into());
232 self
233 }
234
235 pub fn set_message_transforms<T, V>(mut self, v: T) -> Self
237 where
238 T: std::iter::IntoIterator<Item = V>,
239 V: std::convert::Into<crate::model::MessageTransform>,
240 {
241 use std::iter::Iterator;
242 self.0.request.message_transforms = v.into_iter().map(|i| i.into()).collect();
243 self
244 }
245
246 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
248 where
249 T: std::iter::IntoIterator<Item = (K, V)>,
250 K: std::convert::Into<std::string::String>,
251 V: std::convert::Into<std::string::String>,
252 {
253 self.0.request.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
254 self
255 }
256 }
257
258 #[doc(hidden)]
259 impl gax::options::internal::RequestBuilder for CreateTopic {
260 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
261 &mut self.0.options
262 }
263 }
264
265 #[derive(Clone, Debug)]
282 pub struct UpdateTopic(RequestBuilder<crate::model::UpdateTopicRequest>);
283
284 impl UpdateTopic {
285 pub(crate) fn new(
286 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
287 ) -> Self {
288 Self(RequestBuilder::new(stub))
289 }
290
291 pub fn with_request<V: Into<crate::model::UpdateTopicRequest>>(mut self, v: V) -> Self {
293 self.0.request = v.into();
294 self
295 }
296
297 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
299 self.0.options = v.into();
300 self
301 }
302
303 pub async fn send(self) -> Result<crate::model::Topic> {
305 (*self.0.stub)
306 .update_topic(self.0.request, self.0.options)
307 .await
308 .map(gax::response::Response::into_body)
309 }
310
311 pub fn set_topic<T>(mut self, v: T) -> Self
315 where
316 T: std::convert::Into<crate::model::Topic>,
317 {
318 self.0.request.topic = std::option::Option::Some(v.into());
319 self
320 }
321
322 pub fn set_or_clear_topic<T>(mut self, v: std::option::Option<T>) -> Self
326 where
327 T: std::convert::Into<crate::model::Topic>,
328 {
329 self.0.request.topic = v.map(|x| x.into());
330 self
331 }
332
333 pub fn set_update_mask<T>(mut self, v: T) -> Self
337 where
338 T: std::convert::Into<wkt::FieldMask>,
339 {
340 self.0.request.update_mask = std::option::Option::Some(v.into());
341 self
342 }
343
344 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
348 where
349 T: std::convert::Into<wkt::FieldMask>,
350 {
351 self.0.request.update_mask = v.map(|x| x.into());
352 self
353 }
354 }
355
356 #[doc(hidden)]
357 impl gax::options::internal::RequestBuilder for UpdateTopic {
358 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
359 &mut self.0.options
360 }
361 }
362
363 #[derive(Clone, Debug)]
380 pub struct GetTopic(RequestBuilder<crate::model::GetTopicRequest>);
381
382 impl GetTopic {
383 pub(crate) fn new(
384 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
385 ) -> Self {
386 Self(RequestBuilder::new(stub))
387 }
388
389 pub fn with_request<V: Into<crate::model::GetTopicRequest>>(mut self, v: V) -> Self {
391 self.0.request = v.into();
392 self
393 }
394
395 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
397 self.0.options = v.into();
398 self
399 }
400
401 pub async fn send(self) -> Result<crate::model::Topic> {
403 (*self.0.stub)
404 .get_topic(self.0.request, self.0.options)
405 .await
406 .map(gax::response::Response::into_body)
407 }
408
409 pub fn set_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
413 self.0.request.topic = v.into();
414 self
415 }
416 }
417
418 #[doc(hidden)]
419 impl gax::options::internal::RequestBuilder for GetTopic {
420 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
421 &mut self.0.options
422 }
423 }
424
425 #[derive(Clone, Debug)]
446 pub struct ListTopics(RequestBuilder<crate::model::ListTopicsRequest>);
447
448 impl ListTopics {
449 pub(crate) fn new(
450 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
451 ) -> Self {
452 Self(RequestBuilder::new(stub))
453 }
454
455 pub fn with_request<V: Into<crate::model::ListTopicsRequest>>(mut self, v: V) -> Self {
457 self.0.request = v.into();
458 self
459 }
460
461 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
463 self.0.options = v.into();
464 self
465 }
466
467 pub async fn send(self) -> Result<crate::model::ListTopicsResponse> {
469 (*self.0.stub)
470 .list_topics(self.0.request, self.0.options)
471 .await
472 .map(gax::response::Response::into_body)
473 }
474
475 pub fn by_page(
477 self,
478 ) -> impl gax::paginator::Paginator<crate::model::ListTopicsResponse, gax::error::Error>
479 {
480 use std::clone::Clone;
481 let token = self.0.request.page_token.clone();
482 let execute = move |token: String| {
483 let mut builder = self.clone();
484 builder.0.request = builder.0.request.set_page_token(token);
485 builder.send()
486 };
487 gax::paginator::internal::new_paginator(token, execute)
488 }
489
490 pub fn by_item(
492 self,
493 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTopicsResponse, gax::error::Error>
494 {
495 use gax::paginator::Paginator;
496 self.by_page().items()
497 }
498
499 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
503 self.0.request.project = v.into();
504 self
505 }
506
507 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
509 self.0.request.page_size = v.into();
510 self
511 }
512
513 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
515 self.0.request.page_token = v.into();
516 self
517 }
518 }
519
520 #[doc(hidden)]
521 impl gax::options::internal::RequestBuilder for ListTopics {
522 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
523 &mut self.0.options
524 }
525 }
526
527 #[derive(Clone, Debug)]
544 pub struct ListTopicSubscriptions(RequestBuilder<crate::model::ListTopicSubscriptionsRequest>);
545
546 impl ListTopicSubscriptions {
547 pub(crate) fn new(
548 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
549 ) -> Self {
550 Self(RequestBuilder::new(stub))
551 }
552
553 pub fn with_request<V: Into<crate::model::ListTopicSubscriptionsRequest>>(
555 mut self,
556 v: V,
557 ) -> Self {
558 self.0.request = v.into();
559 self
560 }
561
562 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
564 self.0.options = v.into();
565 self
566 }
567
568 pub async fn send(self) -> Result<crate::model::ListTopicSubscriptionsResponse> {
570 (*self.0.stub)
571 .list_topic_subscriptions(self.0.request, self.0.options)
572 .await
573 .map(gax::response::Response::into_body)
574 }
575
576 pub fn set_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
580 self.0.request.topic = v.into();
581 self
582 }
583
584 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
586 self.0.request.page_size = v.into();
587 self
588 }
589
590 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
592 self.0.request.page_token = v.into();
593 self
594 }
595 }
596
597 #[doc(hidden)]
598 impl gax::options::internal::RequestBuilder for ListTopicSubscriptions {
599 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
600 &mut self.0.options
601 }
602 }
603
604 #[derive(Clone, Debug)]
621 pub struct ListTopicSnapshots(RequestBuilder<crate::model::ListTopicSnapshotsRequest>);
622
623 impl ListTopicSnapshots {
624 pub(crate) fn new(
625 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
626 ) -> Self {
627 Self(RequestBuilder::new(stub))
628 }
629
630 pub fn with_request<V: Into<crate::model::ListTopicSnapshotsRequest>>(
632 mut self,
633 v: V,
634 ) -> Self {
635 self.0.request = v.into();
636 self
637 }
638
639 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
641 self.0.options = v.into();
642 self
643 }
644
645 pub async fn send(self) -> Result<crate::model::ListTopicSnapshotsResponse> {
647 (*self.0.stub)
648 .list_topic_snapshots(self.0.request, self.0.options)
649 .await
650 .map(gax::response::Response::into_body)
651 }
652
653 pub fn set_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
657 self.0.request.topic = v.into();
658 self
659 }
660
661 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
663 self.0.request.page_size = v.into();
664 self
665 }
666
667 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
669 self.0.request.page_token = v.into();
670 self
671 }
672 }
673
674 #[doc(hidden)]
675 impl gax::options::internal::RequestBuilder for ListTopicSnapshots {
676 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
677 &mut self.0.options
678 }
679 }
680
681 #[derive(Clone, Debug)]
698 pub struct DeleteTopic(RequestBuilder<crate::model::DeleteTopicRequest>);
699
700 impl DeleteTopic {
701 pub(crate) fn new(
702 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
703 ) -> Self {
704 Self(RequestBuilder::new(stub))
705 }
706
707 pub fn with_request<V: Into<crate::model::DeleteTopicRequest>>(mut self, v: V) -> Self {
709 self.0.request = v.into();
710 self
711 }
712
713 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
715 self.0.options = v.into();
716 self
717 }
718
719 pub async fn send(self) -> Result<()> {
721 (*self.0.stub)
722 .delete_topic(self.0.request, self.0.options)
723 .await
724 .map(gax::response::Response::into_body)
725 }
726
727 pub fn set_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
731 self.0.request.topic = v.into();
732 self
733 }
734 }
735
736 #[doc(hidden)]
737 impl gax::options::internal::RequestBuilder for DeleteTopic {
738 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
739 &mut self.0.options
740 }
741 }
742
743 #[derive(Clone, Debug)]
760 pub struct DetachSubscription(RequestBuilder<crate::model::DetachSubscriptionRequest>);
761
762 impl DetachSubscription {
763 pub(crate) fn new(
764 stub: std::sync::Arc<dyn super::super::stub::dynamic::TopicAdmin>,
765 ) -> Self {
766 Self(RequestBuilder::new(stub))
767 }
768
769 pub fn with_request<V: Into<crate::model::DetachSubscriptionRequest>>(
771 mut self,
772 v: V,
773 ) -> Self {
774 self.0.request = v.into();
775 self
776 }
777
778 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
780 self.0.options = v.into();
781 self
782 }
783
784 pub async fn send(self) -> Result<crate::model::DetachSubscriptionResponse> {
786 (*self.0.stub)
787 .detach_subscription(self.0.request, self.0.options)
788 .await
789 .map(gax::response::Response::into_body)
790 }
791
792 pub fn set_subscription<T: Into<std::string::String>>(mut self, v: T) -> Self {
796 self.0.request.subscription = v.into();
797 self
798 }
799 }
800
801 #[doc(hidden)]
802 impl gax::options::internal::RequestBuilder for DetachSubscription {
803 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
804 &mut self.0.options
805 }
806 }
807}
808
809pub mod subscription_admin {
810 use crate::Result;
811
812 pub type ClientBuilder =
826 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
827
828 pub(crate) mod client {
829 use super::super::super::client::SubscriptionAdmin;
830 pub struct Factory;
831 impl gax::client_builder::internal::ClientFactory for Factory {
832 type Client = SubscriptionAdmin;
833 type Credentials = gaxi::options::Credentials;
834 async fn build(
835 self,
836 config: gaxi::options::ClientConfig,
837 ) -> gax::client_builder::Result<Self::Client> {
838 Self::Client::new(config).await
839 }
840 }
841 }
842
843 #[derive(Clone, Debug)]
845 pub(crate) struct RequestBuilder<R: std::default::Default> {
846 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
847 request: R,
848 options: gax::options::RequestOptions,
849 }
850
851 impl<R> RequestBuilder<R>
852 where
853 R: std::default::Default,
854 {
855 pub(crate) fn new(
856 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
857 ) -> Self {
858 Self {
859 stub,
860 request: R::default(),
861 options: gax::options::RequestOptions::default(),
862 }
863 }
864 }
865
866 #[derive(Clone, Debug)]
883 pub struct CreateSubscription(RequestBuilder<crate::model::Subscription>);
884
885 impl CreateSubscription {
886 pub(crate) fn new(
887 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
888 ) -> Self {
889 Self(RequestBuilder::new(stub))
890 }
891
892 pub fn with_request<V: Into<crate::model::Subscription>>(mut self, v: V) -> Self {
894 self.0.request = v.into();
895 self
896 }
897
898 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
900 self.0.options = v.into();
901 self
902 }
903
904 pub async fn send(self) -> Result<crate::model::Subscription> {
906 (*self.0.stub)
907 .create_subscription(self.0.request, self.0.options)
908 .await
909 .map(gax::response::Response::into_body)
910 }
911
912 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
916 self.0.request.name = v.into();
917 self
918 }
919
920 pub fn set_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
924 self.0.request.topic = v.into();
925 self
926 }
927
928 pub fn set_push_config<T>(mut self, v: T) -> Self
930 where
931 T: std::convert::Into<crate::model::PushConfig>,
932 {
933 self.0.request.push_config = std::option::Option::Some(v.into());
934 self
935 }
936
937 pub fn set_or_clear_push_config<T>(mut self, v: std::option::Option<T>) -> Self
939 where
940 T: std::convert::Into<crate::model::PushConfig>,
941 {
942 self.0.request.push_config = v.map(|x| x.into());
943 self
944 }
945
946 pub fn set_bigquery_config<T>(mut self, v: T) -> Self
948 where
949 T: std::convert::Into<crate::model::BigQueryConfig>,
950 {
951 self.0.request.bigquery_config = std::option::Option::Some(v.into());
952 self
953 }
954
955 pub fn set_or_clear_bigquery_config<T>(mut self, v: std::option::Option<T>) -> Self
957 where
958 T: std::convert::Into<crate::model::BigQueryConfig>,
959 {
960 self.0.request.bigquery_config = v.map(|x| x.into());
961 self
962 }
963
964 pub fn set_cloud_storage_config<T>(mut self, v: T) -> Self
966 where
967 T: std::convert::Into<crate::model::CloudStorageConfig>,
968 {
969 self.0.request.cloud_storage_config = std::option::Option::Some(v.into());
970 self
971 }
972
973 pub fn set_or_clear_cloud_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
975 where
976 T: std::convert::Into<crate::model::CloudStorageConfig>,
977 {
978 self.0.request.cloud_storage_config = v.map(|x| x.into());
979 self
980 }
981
982 pub fn set_ack_deadline_seconds<T: Into<i32>>(mut self, v: T) -> Self {
984 self.0.request.ack_deadline_seconds = v.into();
985 self
986 }
987
988 pub fn set_retain_acked_messages<T: Into<bool>>(mut self, v: T) -> Self {
990 self.0.request.retain_acked_messages = v.into();
991 self
992 }
993
994 pub fn set_message_retention_duration<T>(mut self, v: T) -> Self
996 where
997 T: std::convert::Into<wkt::Duration>,
998 {
999 self.0.request.message_retention_duration = std::option::Option::Some(v.into());
1000 self
1001 }
1002
1003 pub fn set_or_clear_message_retention_duration<T>(
1005 mut self,
1006 v: std::option::Option<T>,
1007 ) -> Self
1008 where
1009 T: std::convert::Into<wkt::Duration>,
1010 {
1011 self.0.request.message_retention_duration = v.map(|x| x.into());
1012 self
1013 }
1014
1015 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1017 where
1018 T: std::iter::IntoIterator<Item = (K, V)>,
1019 K: std::convert::Into<std::string::String>,
1020 V: std::convert::Into<std::string::String>,
1021 {
1022 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1023 self
1024 }
1025
1026 pub fn set_enable_message_ordering<T: Into<bool>>(mut self, v: T) -> Self {
1028 self.0.request.enable_message_ordering = v.into();
1029 self
1030 }
1031
1032 pub fn set_expiration_policy<T>(mut self, v: T) -> Self
1034 where
1035 T: std::convert::Into<crate::model::ExpirationPolicy>,
1036 {
1037 self.0.request.expiration_policy = std::option::Option::Some(v.into());
1038 self
1039 }
1040
1041 pub fn set_or_clear_expiration_policy<T>(mut self, v: std::option::Option<T>) -> Self
1043 where
1044 T: std::convert::Into<crate::model::ExpirationPolicy>,
1045 {
1046 self.0.request.expiration_policy = v.map(|x| x.into());
1047 self
1048 }
1049
1050 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052 self.0.request.filter = v.into();
1053 self
1054 }
1055
1056 pub fn set_dead_letter_policy<T>(mut self, v: T) -> Self
1058 where
1059 T: std::convert::Into<crate::model::DeadLetterPolicy>,
1060 {
1061 self.0.request.dead_letter_policy = std::option::Option::Some(v.into());
1062 self
1063 }
1064
1065 pub fn set_or_clear_dead_letter_policy<T>(mut self, v: std::option::Option<T>) -> Self
1067 where
1068 T: std::convert::Into<crate::model::DeadLetterPolicy>,
1069 {
1070 self.0.request.dead_letter_policy = v.map(|x| x.into());
1071 self
1072 }
1073
1074 pub fn set_retry_policy<T>(mut self, v: T) -> Self
1076 where
1077 T: std::convert::Into<crate::model::RetryPolicy>,
1078 {
1079 self.0.request.retry_policy = std::option::Option::Some(v.into());
1080 self
1081 }
1082
1083 pub fn set_or_clear_retry_policy<T>(mut self, v: std::option::Option<T>) -> Self
1085 where
1086 T: std::convert::Into<crate::model::RetryPolicy>,
1087 {
1088 self.0.request.retry_policy = v.map(|x| x.into());
1089 self
1090 }
1091
1092 pub fn set_detached<T: Into<bool>>(mut self, v: T) -> Self {
1094 self.0.request.detached = v.into();
1095 self
1096 }
1097
1098 pub fn set_enable_exactly_once_delivery<T: Into<bool>>(mut self, v: T) -> Self {
1100 self.0.request.enable_exactly_once_delivery = v.into();
1101 self
1102 }
1103
1104 pub fn set_topic_message_retention_duration<T>(mut self, v: T) -> Self
1106 where
1107 T: std::convert::Into<wkt::Duration>,
1108 {
1109 self.0.request.topic_message_retention_duration = std::option::Option::Some(v.into());
1110 self
1111 }
1112
1113 pub fn set_or_clear_topic_message_retention_duration<T>(
1115 mut self,
1116 v: std::option::Option<T>,
1117 ) -> Self
1118 where
1119 T: std::convert::Into<wkt::Duration>,
1120 {
1121 self.0.request.topic_message_retention_duration = v.map(|x| x.into());
1122 self
1123 }
1124
1125 pub fn set_state<T: Into<crate::model::subscription::State>>(mut self, v: T) -> Self {
1127 self.0.request.state = v.into();
1128 self
1129 }
1130
1131 pub fn set_analytics_hub_subscription_info<T>(mut self, v: T) -> Self
1133 where
1134 T: std::convert::Into<crate::model::subscription::AnalyticsHubSubscriptionInfo>,
1135 {
1136 self.0.request.analytics_hub_subscription_info = std::option::Option::Some(v.into());
1137 self
1138 }
1139
1140 pub fn set_or_clear_analytics_hub_subscription_info<T>(
1142 mut self,
1143 v: std::option::Option<T>,
1144 ) -> Self
1145 where
1146 T: std::convert::Into<crate::model::subscription::AnalyticsHubSubscriptionInfo>,
1147 {
1148 self.0.request.analytics_hub_subscription_info = v.map(|x| x.into());
1149 self
1150 }
1151
1152 pub fn set_message_transforms<T, V>(mut self, v: T) -> Self
1154 where
1155 T: std::iter::IntoIterator<Item = V>,
1156 V: std::convert::Into<crate::model::MessageTransform>,
1157 {
1158 use std::iter::Iterator;
1159 self.0.request.message_transforms = v.into_iter().map(|i| i.into()).collect();
1160 self
1161 }
1162
1163 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
1165 where
1166 T: std::iter::IntoIterator<Item = (K, V)>,
1167 K: std::convert::Into<std::string::String>,
1168 V: std::convert::Into<std::string::String>,
1169 {
1170 self.0.request.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1171 self
1172 }
1173 }
1174
1175 #[doc(hidden)]
1176 impl gax::options::internal::RequestBuilder for CreateSubscription {
1177 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1178 &mut self.0.options
1179 }
1180 }
1181
1182 #[derive(Clone, Debug)]
1199 pub struct GetSubscription(RequestBuilder<crate::model::GetSubscriptionRequest>);
1200
1201 impl GetSubscription {
1202 pub(crate) fn new(
1203 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1204 ) -> Self {
1205 Self(RequestBuilder::new(stub))
1206 }
1207
1208 pub fn with_request<V: Into<crate::model::GetSubscriptionRequest>>(mut self, v: V) -> Self {
1210 self.0.request = v.into();
1211 self
1212 }
1213
1214 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1216 self.0.options = v.into();
1217 self
1218 }
1219
1220 pub async fn send(self) -> Result<crate::model::Subscription> {
1222 (*self.0.stub)
1223 .get_subscription(self.0.request, self.0.options)
1224 .await
1225 .map(gax::response::Response::into_body)
1226 }
1227
1228 pub fn set_subscription<T: Into<std::string::String>>(mut self, v: T) -> Self {
1232 self.0.request.subscription = v.into();
1233 self
1234 }
1235 }
1236
1237 #[doc(hidden)]
1238 impl gax::options::internal::RequestBuilder for GetSubscription {
1239 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1240 &mut self.0.options
1241 }
1242 }
1243
1244 #[derive(Clone, Debug)]
1261 pub struct UpdateSubscription(RequestBuilder<crate::model::UpdateSubscriptionRequest>);
1262
1263 impl UpdateSubscription {
1264 pub(crate) fn new(
1265 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1266 ) -> Self {
1267 Self(RequestBuilder::new(stub))
1268 }
1269
1270 pub fn with_request<V: Into<crate::model::UpdateSubscriptionRequest>>(
1272 mut self,
1273 v: V,
1274 ) -> Self {
1275 self.0.request = v.into();
1276 self
1277 }
1278
1279 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1281 self.0.options = v.into();
1282 self
1283 }
1284
1285 pub async fn send(self) -> Result<crate::model::Subscription> {
1287 (*self.0.stub)
1288 .update_subscription(self.0.request, self.0.options)
1289 .await
1290 .map(gax::response::Response::into_body)
1291 }
1292
1293 pub fn set_subscription<T>(mut self, v: T) -> Self
1297 where
1298 T: std::convert::Into<crate::model::Subscription>,
1299 {
1300 self.0.request.subscription = std::option::Option::Some(v.into());
1301 self
1302 }
1303
1304 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
1308 where
1309 T: std::convert::Into<crate::model::Subscription>,
1310 {
1311 self.0.request.subscription = v.map(|x| x.into());
1312 self
1313 }
1314
1315 pub fn set_update_mask<T>(mut self, v: T) -> Self
1319 where
1320 T: std::convert::Into<wkt::FieldMask>,
1321 {
1322 self.0.request.update_mask = std::option::Option::Some(v.into());
1323 self
1324 }
1325
1326 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1330 where
1331 T: std::convert::Into<wkt::FieldMask>,
1332 {
1333 self.0.request.update_mask = v.map(|x| x.into());
1334 self
1335 }
1336 }
1337
1338 #[doc(hidden)]
1339 impl gax::options::internal::RequestBuilder for UpdateSubscription {
1340 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1341 &mut self.0.options
1342 }
1343 }
1344
1345 #[derive(Clone, Debug)]
1366 pub struct ListSubscriptions(RequestBuilder<crate::model::ListSubscriptionsRequest>);
1367
1368 impl ListSubscriptions {
1369 pub(crate) fn new(
1370 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1371 ) -> Self {
1372 Self(RequestBuilder::new(stub))
1373 }
1374
1375 pub fn with_request<V: Into<crate::model::ListSubscriptionsRequest>>(
1377 mut self,
1378 v: V,
1379 ) -> Self {
1380 self.0.request = v.into();
1381 self
1382 }
1383
1384 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1386 self.0.options = v.into();
1387 self
1388 }
1389
1390 pub async fn send(self) -> Result<crate::model::ListSubscriptionsResponse> {
1392 (*self.0.stub)
1393 .list_subscriptions(self.0.request, self.0.options)
1394 .await
1395 .map(gax::response::Response::into_body)
1396 }
1397
1398 pub fn by_page(
1400 self,
1401 ) -> impl gax::paginator::Paginator<crate::model::ListSubscriptionsResponse, gax::error::Error>
1402 {
1403 use std::clone::Clone;
1404 let token = self.0.request.page_token.clone();
1405 let execute = move |token: String| {
1406 let mut builder = self.clone();
1407 builder.0.request = builder.0.request.set_page_token(token);
1408 builder.send()
1409 };
1410 gax::paginator::internal::new_paginator(token, execute)
1411 }
1412
1413 pub fn by_item(
1415 self,
1416 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSubscriptionsResponse, gax::error::Error>
1417 {
1418 use gax::paginator::Paginator;
1419 self.by_page().items()
1420 }
1421
1422 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1426 self.0.request.project = v.into();
1427 self
1428 }
1429
1430 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1432 self.0.request.page_size = v.into();
1433 self
1434 }
1435
1436 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1438 self.0.request.page_token = v.into();
1439 self
1440 }
1441 }
1442
1443 #[doc(hidden)]
1444 impl gax::options::internal::RequestBuilder for ListSubscriptions {
1445 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1446 &mut self.0.options
1447 }
1448 }
1449
1450 #[derive(Clone, Debug)]
1467 pub struct DeleteSubscription(RequestBuilder<crate::model::DeleteSubscriptionRequest>);
1468
1469 impl DeleteSubscription {
1470 pub(crate) fn new(
1471 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1472 ) -> Self {
1473 Self(RequestBuilder::new(stub))
1474 }
1475
1476 pub fn with_request<V: Into<crate::model::DeleteSubscriptionRequest>>(
1478 mut self,
1479 v: V,
1480 ) -> Self {
1481 self.0.request = v.into();
1482 self
1483 }
1484
1485 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1487 self.0.options = v.into();
1488 self
1489 }
1490
1491 pub async fn send(self) -> Result<()> {
1493 (*self.0.stub)
1494 .delete_subscription(self.0.request, self.0.options)
1495 .await
1496 .map(gax::response::Response::into_body)
1497 }
1498
1499 pub fn set_subscription<T: Into<std::string::String>>(mut self, v: T) -> Self {
1503 self.0.request.subscription = v.into();
1504 self
1505 }
1506 }
1507
1508 #[doc(hidden)]
1509 impl gax::options::internal::RequestBuilder for DeleteSubscription {
1510 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1511 &mut self.0.options
1512 }
1513 }
1514
1515 #[derive(Clone, Debug)]
1532 pub struct ModifyPushConfig(RequestBuilder<crate::model::ModifyPushConfigRequest>);
1533
1534 impl ModifyPushConfig {
1535 pub(crate) fn new(
1536 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1537 ) -> Self {
1538 Self(RequestBuilder::new(stub))
1539 }
1540
1541 pub fn with_request<V: Into<crate::model::ModifyPushConfigRequest>>(
1543 mut self,
1544 v: V,
1545 ) -> Self {
1546 self.0.request = v.into();
1547 self
1548 }
1549
1550 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1552 self.0.options = v.into();
1553 self
1554 }
1555
1556 pub async fn send(self) -> Result<()> {
1558 (*self.0.stub)
1559 .modify_push_config(self.0.request, self.0.options)
1560 .await
1561 .map(gax::response::Response::into_body)
1562 }
1563
1564 pub fn set_subscription<T: Into<std::string::String>>(mut self, v: T) -> Self {
1568 self.0.request.subscription = v.into();
1569 self
1570 }
1571
1572 pub fn set_push_config<T>(mut self, v: T) -> Self
1576 where
1577 T: std::convert::Into<crate::model::PushConfig>,
1578 {
1579 self.0.request.push_config = std::option::Option::Some(v.into());
1580 self
1581 }
1582
1583 pub fn set_or_clear_push_config<T>(mut self, v: std::option::Option<T>) -> Self
1587 where
1588 T: std::convert::Into<crate::model::PushConfig>,
1589 {
1590 self.0.request.push_config = v.map(|x| x.into());
1591 self
1592 }
1593 }
1594
1595 #[doc(hidden)]
1596 impl gax::options::internal::RequestBuilder for ModifyPushConfig {
1597 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1598 &mut self.0.options
1599 }
1600 }
1601
1602 #[derive(Clone, Debug)]
1619 pub struct GetSnapshot(RequestBuilder<crate::model::GetSnapshotRequest>);
1620
1621 impl GetSnapshot {
1622 pub(crate) fn new(
1623 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1624 ) -> Self {
1625 Self(RequestBuilder::new(stub))
1626 }
1627
1628 pub fn with_request<V: Into<crate::model::GetSnapshotRequest>>(mut self, v: V) -> Self {
1630 self.0.request = v.into();
1631 self
1632 }
1633
1634 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1636 self.0.options = v.into();
1637 self
1638 }
1639
1640 pub async fn send(self) -> Result<crate::model::Snapshot> {
1642 (*self.0.stub)
1643 .get_snapshot(self.0.request, self.0.options)
1644 .await
1645 .map(gax::response::Response::into_body)
1646 }
1647
1648 pub fn set_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
1652 self.0.request.snapshot = v.into();
1653 self
1654 }
1655 }
1656
1657 #[doc(hidden)]
1658 impl gax::options::internal::RequestBuilder for GetSnapshot {
1659 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1660 &mut self.0.options
1661 }
1662 }
1663
1664 #[derive(Clone, Debug)]
1685 pub struct ListSnapshots(RequestBuilder<crate::model::ListSnapshotsRequest>);
1686
1687 impl ListSnapshots {
1688 pub(crate) fn new(
1689 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1690 ) -> Self {
1691 Self(RequestBuilder::new(stub))
1692 }
1693
1694 pub fn with_request<V: Into<crate::model::ListSnapshotsRequest>>(mut self, v: V) -> Self {
1696 self.0.request = v.into();
1697 self
1698 }
1699
1700 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1702 self.0.options = v.into();
1703 self
1704 }
1705
1706 pub async fn send(self) -> Result<crate::model::ListSnapshotsResponse> {
1708 (*self.0.stub)
1709 .list_snapshots(self.0.request, self.0.options)
1710 .await
1711 .map(gax::response::Response::into_body)
1712 }
1713
1714 pub fn by_page(
1716 self,
1717 ) -> impl gax::paginator::Paginator<crate::model::ListSnapshotsResponse, gax::error::Error>
1718 {
1719 use std::clone::Clone;
1720 let token = self.0.request.page_token.clone();
1721 let execute = move |token: String| {
1722 let mut builder = self.clone();
1723 builder.0.request = builder.0.request.set_page_token(token);
1724 builder.send()
1725 };
1726 gax::paginator::internal::new_paginator(token, execute)
1727 }
1728
1729 pub fn by_item(
1731 self,
1732 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSnapshotsResponse, gax::error::Error>
1733 {
1734 use gax::paginator::Paginator;
1735 self.by_page().items()
1736 }
1737
1738 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1742 self.0.request.project = v.into();
1743 self
1744 }
1745
1746 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1748 self.0.request.page_size = v.into();
1749 self
1750 }
1751
1752 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1754 self.0.request.page_token = v.into();
1755 self
1756 }
1757 }
1758
1759 #[doc(hidden)]
1760 impl gax::options::internal::RequestBuilder for ListSnapshots {
1761 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1762 &mut self.0.options
1763 }
1764 }
1765
1766 #[derive(Clone, Debug)]
1783 pub struct CreateSnapshot(RequestBuilder<crate::model::CreateSnapshotRequest>);
1784
1785 impl CreateSnapshot {
1786 pub(crate) fn new(
1787 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1788 ) -> Self {
1789 Self(RequestBuilder::new(stub))
1790 }
1791
1792 pub fn with_request<V: Into<crate::model::CreateSnapshotRequest>>(mut self, v: V) -> Self {
1794 self.0.request = v.into();
1795 self
1796 }
1797
1798 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1800 self.0.options = v.into();
1801 self
1802 }
1803
1804 pub async fn send(self) -> Result<crate::model::Snapshot> {
1806 (*self.0.stub)
1807 .create_snapshot(self.0.request, self.0.options)
1808 .await
1809 .map(gax::response::Response::into_body)
1810 }
1811
1812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816 self.0.request.name = v.into();
1817 self
1818 }
1819
1820 pub fn set_subscription<T: Into<std::string::String>>(mut self, v: T) -> Self {
1824 self.0.request.subscription = v.into();
1825 self
1826 }
1827
1828 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1830 where
1831 T: std::iter::IntoIterator<Item = (K, V)>,
1832 K: std::convert::Into<std::string::String>,
1833 V: std::convert::Into<std::string::String>,
1834 {
1835 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1836 self
1837 }
1838
1839 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
1841 where
1842 T: std::iter::IntoIterator<Item = (K, V)>,
1843 K: std::convert::Into<std::string::String>,
1844 V: std::convert::Into<std::string::String>,
1845 {
1846 self.0.request.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1847 self
1848 }
1849 }
1850
1851 #[doc(hidden)]
1852 impl gax::options::internal::RequestBuilder for CreateSnapshot {
1853 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1854 &mut self.0.options
1855 }
1856 }
1857
1858 #[derive(Clone, Debug)]
1875 pub struct UpdateSnapshot(RequestBuilder<crate::model::UpdateSnapshotRequest>);
1876
1877 impl UpdateSnapshot {
1878 pub(crate) fn new(
1879 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1880 ) -> Self {
1881 Self(RequestBuilder::new(stub))
1882 }
1883
1884 pub fn with_request<V: Into<crate::model::UpdateSnapshotRequest>>(mut self, v: V) -> Self {
1886 self.0.request = v.into();
1887 self
1888 }
1889
1890 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1892 self.0.options = v.into();
1893 self
1894 }
1895
1896 pub async fn send(self) -> Result<crate::model::Snapshot> {
1898 (*self.0.stub)
1899 .update_snapshot(self.0.request, self.0.options)
1900 .await
1901 .map(gax::response::Response::into_body)
1902 }
1903
1904 pub fn set_snapshot<T>(mut self, v: T) -> Self
1908 where
1909 T: std::convert::Into<crate::model::Snapshot>,
1910 {
1911 self.0.request.snapshot = std::option::Option::Some(v.into());
1912 self
1913 }
1914
1915 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1919 where
1920 T: std::convert::Into<crate::model::Snapshot>,
1921 {
1922 self.0.request.snapshot = v.map(|x| x.into());
1923 self
1924 }
1925
1926 pub fn set_update_mask<T>(mut self, v: T) -> Self
1930 where
1931 T: std::convert::Into<wkt::FieldMask>,
1932 {
1933 self.0.request.update_mask = std::option::Option::Some(v.into());
1934 self
1935 }
1936
1937 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1941 where
1942 T: std::convert::Into<wkt::FieldMask>,
1943 {
1944 self.0.request.update_mask = v.map(|x| x.into());
1945 self
1946 }
1947 }
1948
1949 #[doc(hidden)]
1950 impl gax::options::internal::RequestBuilder for UpdateSnapshot {
1951 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1952 &mut self.0.options
1953 }
1954 }
1955
1956 #[derive(Clone, Debug)]
1973 pub struct DeleteSnapshot(RequestBuilder<crate::model::DeleteSnapshotRequest>);
1974
1975 impl DeleteSnapshot {
1976 pub(crate) fn new(
1977 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
1978 ) -> Self {
1979 Self(RequestBuilder::new(stub))
1980 }
1981
1982 pub fn with_request<V: Into<crate::model::DeleteSnapshotRequest>>(mut self, v: V) -> Self {
1984 self.0.request = v.into();
1985 self
1986 }
1987
1988 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1990 self.0.options = v.into();
1991 self
1992 }
1993
1994 pub async fn send(self) -> Result<()> {
1996 (*self.0.stub)
1997 .delete_snapshot(self.0.request, self.0.options)
1998 .await
1999 .map(gax::response::Response::into_body)
2000 }
2001
2002 pub fn set_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
2006 self.0.request.snapshot = v.into();
2007 self
2008 }
2009 }
2010
2011 #[doc(hidden)]
2012 impl gax::options::internal::RequestBuilder for DeleteSnapshot {
2013 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2014 &mut self.0.options
2015 }
2016 }
2017
2018 #[derive(Clone, Debug)]
2035 pub struct Seek(RequestBuilder<crate::model::SeekRequest>);
2036
2037 impl Seek {
2038 pub(crate) fn new(
2039 stub: std::sync::Arc<dyn super::super::stub::dynamic::SubscriptionAdmin>,
2040 ) -> Self {
2041 Self(RequestBuilder::new(stub))
2042 }
2043
2044 pub fn with_request<V: Into<crate::model::SeekRequest>>(mut self, v: V) -> Self {
2046 self.0.request = v.into();
2047 self
2048 }
2049
2050 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2052 self.0.options = v.into();
2053 self
2054 }
2055
2056 pub async fn send(self) -> Result<crate::model::SeekResponse> {
2058 (*self.0.stub)
2059 .seek(self.0.request, self.0.options)
2060 .await
2061 .map(gax::response::Response::into_body)
2062 }
2063
2064 pub fn set_subscription<T: Into<std::string::String>>(mut self, v: T) -> Self {
2068 self.0.request.subscription = v.into();
2069 self
2070 }
2071
2072 pub fn set_target<T: Into<Option<crate::model::seek_request::Target>>>(
2077 mut self,
2078 v: T,
2079 ) -> Self {
2080 self.0.request.target = v.into();
2081 self
2082 }
2083
2084 pub fn set_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
2090 mut self,
2091 v: T,
2092 ) -> Self {
2093 self.0.request = self.0.request.set_time(v);
2094 self
2095 }
2096
2097 pub fn set_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2103 self.0.request = self.0.request.set_snapshot(v);
2104 self
2105 }
2106 }
2107
2108 #[doc(hidden)]
2109 impl gax::options::internal::RequestBuilder for Seek {
2110 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2111 &mut self.0.options
2112 }
2113 }
2114}
2115
2116pub mod schema_service {
2117 use crate::Result;
2118
2119 pub type ClientBuilder =
2133 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2134
2135 pub(crate) mod client {
2136 use super::super::super::client::SchemaService;
2137 pub struct Factory;
2138 impl gax::client_builder::internal::ClientFactory for Factory {
2139 type Client = SchemaService;
2140 type Credentials = gaxi::options::Credentials;
2141 async fn build(
2142 self,
2143 config: gaxi::options::ClientConfig,
2144 ) -> gax::client_builder::Result<Self::Client> {
2145 Self::Client::new(config).await
2146 }
2147 }
2148 }
2149
2150 #[derive(Clone, Debug)]
2152 pub(crate) struct RequestBuilder<R: std::default::Default> {
2153 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2154 request: R,
2155 options: gax::options::RequestOptions,
2156 }
2157
2158 impl<R> RequestBuilder<R>
2159 where
2160 R: std::default::Default,
2161 {
2162 pub(crate) fn new(
2163 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2164 ) -> Self {
2165 Self {
2166 stub,
2167 request: R::default(),
2168 options: gax::options::RequestOptions::default(),
2169 }
2170 }
2171 }
2172
2173 #[derive(Clone, Debug)]
2190 pub struct CreateSchema(RequestBuilder<crate::model::CreateSchemaRequest>);
2191
2192 impl CreateSchema {
2193 pub(crate) fn new(
2194 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2195 ) -> Self {
2196 Self(RequestBuilder::new(stub))
2197 }
2198
2199 pub fn with_request<V: Into<crate::model::CreateSchemaRequest>>(mut self, v: V) -> Self {
2201 self.0.request = v.into();
2202 self
2203 }
2204
2205 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2207 self.0.options = v.into();
2208 self
2209 }
2210
2211 pub async fn send(self) -> Result<crate::model::Schema> {
2213 (*self.0.stub)
2214 .create_schema(self.0.request, self.0.options)
2215 .await
2216 .map(gax::response::Response::into_body)
2217 }
2218
2219 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2223 self.0.request.parent = v.into();
2224 self
2225 }
2226
2227 pub fn set_schema<T>(mut self, v: T) -> Self
2231 where
2232 T: std::convert::Into<crate::model::Schema>,
2233 {
2234 self.0.request.schema = std::option::Option::Some(v.into());
2235 self
2236 }
2237
2238 pub fn set_or_clear_schema<T>(mut self, v: std::option::Option<T>) -> Self
2242 where
2243 T: std::convert::Into<crate::model::Schema>,
2244 {
2245 self.0.request.schema = v.map(|x| x.into());
2246 self
2247 }
2248
2249 pub fn set_schema_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2251 self.0.request.schema_id = v.into();
2252 self
2253 }
2254 }
2255
2256 #[doc(hidden)]
2257 impl gax::options::internal::RequestBuilder for CreateSchema {
2258 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2259 &mut self.0.options
2260 }
2261 }
2262
2263 #[derive(Clone, Debug)]
2280 pub struct GetSchema(RequestBuilder<crate::model::GetSchemaRequest>);
2281
2282 impl GetSchema {
2283 pub(crate) fn new(
2284 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2285 ) -> Self {
2286 Self(RequestBuilder::new(stub))
2287 }
2288
2289 pub fn with_request<V: Into<crate::model::GetSchemaRequest>>(mut self, v: V) -> Self {
2291 self.0.request = v.into();
2292 self
2293 }
2294
2295 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2297 self.0.options = v.into();
2298 self
2299 }
2300
2301 pub async fn send(self) -> Result<crate::model::Schema> {
2303 (*self.0.stub)
2304 .get_schema(self.0.request, self.0.options)
2305 .await
2306 .map(gax::response::Response::into_body)
2307 }
2308
2309 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2313 self.0.request.name = v.into();
2314 self
2315 }
2316
2317 pub fn set_view<T: Into<crate::model::SchemaView>>(mut self, v: T) -> Self {
2319 self.0.request.view = v.into();
2320 self
2321 }
2322 }
2323
2324 #[doc(hidden)]
2325 impl gax::options::internal::RequestBuilder for GetSchema {
2326 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2327 &mut self.0.options
2328 }
2329 }
2330
2331 #[derive(Clone, Debug)]
2352 pub struct ListSchemas(RequestBuilder<crate::model::ListSchemasRequest>);
2353
2354 impl ListSchemas {
2355 pub(crate) fn new(
2356 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2357 ) -> Self {
2358 Self(RequestBuilder::new(stub))
2359 }
2360
2361 pub fn with_request<V: Into<crate::model::ListSchemasRequest>>(mut self, v: V) -> 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<crate::model::ListSchemasResponse> {
2375 (*self.0.stub)
2376 .list_schemas(self.0.request, self.0.options)
2377 .await
2378 .map(gax::response::Response::into_body)
2379 }
2380
2381 pub fn by_page(
2383 self,
2384 ) -> impl gax::paginator::Paginator<crate::model::ListSchemasResponse, gax::error::Error>
2385 {
2386 use std::clone::Clone;
2387 let token = self.0.request.page_token.clone();
2388 let execute = move |token: String| {
2389 let mut builder = self.clone();
2390 builder.0.request = builder.0.request.set_page_token(token);
2391 builder.send()
2392 };
2393 gax::paginator::internal::new_paginator(token, execute)
2394 }
2395
2396 pub fn by_item(
2398 self,
2399 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSchemasResponse, gax::error::Error>
2400 {
2401 use gax::paginator::Paginator;
2402 self.by_page().items()
2403 }
2404
2405 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2409 self.0.request.parent = v.into();
2410 self
2411 }
2412
2413 pub fn set_view<T: Into<crate::model::SchemaView>>(mut self, v: T) -> Self {
2415 self.0.request.view = v.into();
2416 self
2417 }
2418
2419 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2421 self.0.request.page_size = v.into();
2422 self
2423 }
2424
2425 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.0.request.page_token = v.into();
2428 self
2429 }
2430 }
2431
2432 #[doc(hidden)]
2433 impl gax::options::internal::RequestBuilder for ListSchemas {
2434 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2435 &mut self.0.options
2436 }
2437 }
2438
2439 #[derive(Clone, Debug)]
2460 pub struct ListSchemaRevisions(RequestBuilder<crate::model::ListSchemaRevisionsRequest>);
2461
2462 impl ListSchemaRevisions {
2463 pub(crate) fn new(
2464 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2465 ) -> Self {
2466 Self(RequestBuilder::new(stub))
2467 }
2468
2469 pub fn with_request<V: Into<crate::model::ListSchemaRevisionsRequest>>(
2471 mut self,
2472 v: V,
2473 ) -> Self {
2474 self.0.request = v.into();
2475 self
2476 }
2477
2478 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2480 self.0.options = v.into();
2481 self
2482 }
2483
2484 pub async fn send(self) -> Result<crate::model::ListSchemaRevisionsResponse> {
2486 (*self.0.stub)
2487 .list_schema_revisions(self.0.request, self.0.options)
2488 .await
2489 .map(gax::response::Response::into_body)
2490 }
2491
2492 pub fn by_page(
2494 self,
2495 ) -> impl gax::paginator::Paginator<crate::model::ListSchemaRevisionsResponse, gax::error::Error>
2496 {
2497 use std::clone::Clone;
2498 let token = self.0.request.page_token.clone();
2499 let execute = move |token: String| {
2500 let mut builder = self.clone();
2501 builder.0.request = builder.0.request.set_page_token(token);
2502 builder.send()
2503 };
2504 gax::paginator::internal::new_paginator(token, execute)
2505 }
2506
2507 pub fn by_item(
2509 self,
2510 ) -> impl gax::paginator::ItemPaginator<
2511 crate::model::ListSchemaRevisionsResponse,
2512 gax::error::Error,
2513 > {
2514 use gax::paginator::Paginator;
2515 self.by_page().items()
2516 }
2517
2518 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2522 self.0.request.name = v.into();
2523 self
2524 }
2525
2526 pub fn set_view<T: Into<crate::model::SchemaView>>(mut self, v: T) -> Self {
2528 self.0.request.view = v.into();
2529 self
2530 }
2531
2532 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2534 self.0.request.page_size = v.into();
2535 self
2536 }
2537
2538 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2540 self.0.request.page_token = v.into();
2541 self
2542 }
2543 }
2544
2545 #[doc(hidden)]
2546 impl gax::options::internal::RequestBuilder for ListSchemaRevisions {
2547 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2548 &mut self.0.options
2549 }
2550 }
2551
2552 #[derive(Clone, Debug)]
2569 pub struct CommitSchema(RequestBuilder<crate::model::CommitSchemaRequest>);
2570
2571 impl CommitSchema {
2572 pub(crate) fn new(
2573 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2574 ) -> Self {
2575 Self(RequestBuilder::new(stub))
2576 }
2577
2578 pub fn with_request<V: Into<crate::model::CommitSchemaRequest>>(mut self, v: V) -> Self {
2580 self.0.request = v.into();
2581 self
2582 }
2583
2584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2586 self.0.options = v.into();
2587 self
2588 }
2589
2590 pub async fn send(self) -> Result<crate::model::Schema> {
2592 (*self.0.stub)
2593 .commit_schema(self.0.request, self.0.options)
2594 .await
2595 .map(gax::response::Response::into_body)
2596 }
2597
2598 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2602 self.0.request.name = v.into();
2603 self
2604 }
2605
2606 pub fn set_schema<T>(mut self, v: T) -> Self
2610 where
2611 T: std::convert::Into<crate::model::Schema>,
2612 {
2613 self.0.request.schema = std::option::Option::Some(v.into());
2614 self
2615 }
2616
2617 pub fn set_or_clear_schema<T>(mut self, v: std::option::Option<T>) -> Self
2621 where
2622 T: std::convert::Into<crate::model::Schema>,
2623 {
2624 self.0.request.schema = v.map(|x| x.into());
2625 self
2626 }
2627 }
2628
2629 #[doc(hidden)]
2630 impl gax::options::internal::RequestBuilder for CommitSchema {
2631 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2632 &mut self.0.options
2633 }
2634 }
2635
2636 #[derive(Clone, Debug)]
2653 pub struct RollbackSchema(RequestBuilder<crate::model::RollbackSchemaRequest>);
2654
2655 impl RollbackSchema {
2656 pub(crate) fn new(
2657 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2658 ) -> Self {
2659 Self(RequestBuilder::new(stub))
2660 }
2661
2662 pub fn with_request<V: Into<crate::model::RollbackSchemaRequest>>(mut self, v: V) -> Self {
2664 self.0.request = v.into();
2665 self
2666 }
2667
2668 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2670 self.0.options = v.into();
2671 self
2672 }
2673
2674 pub async fn send(self) -> Result<crate::model::Schema> {
2676 (*self.0.stub)
2677 .rollback_schema(self.0.request, self.0.options)
2678 .await
2679 .map(gax::response::Response::into_body)
2680 }
2681
2682 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2686 self.0.request.name = v.into();
2687 self
2688 }
2689
2690 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2694 self.0.request.revision_id = v.into();
2695 self
2696 }
2697 }
2698
2699 #[doc(hidden)]
2700 impl gax::options::internal::RequestBuilder for RollbackSchema {
2701 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2702 &mut self.0.options
2703 }
2704 }
2705
2706 #[derive(Clone, Debug)]
2723 pub struct DeleteSchemaRevision(RequestBuilder<crate::model::DeleteSchemaRevisionRequest>);
2724
2725 impl DeleteSchemaRevision {
2726 pub(crate) fn new(
2727 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2728 ) -> Self {
2729 Self(RequestBuilder::new(stub))
2730 }
2731
2732 pub fn with_request<V: Into<crate::model::DeleteSchemaRevisionRequest>>(
2734 mut self,
2735 v: V,
2736 ) -> Self {
2737 self.0.request = v.into();
2738 self
2739 }
2740
2741 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2743 self.0.options = v.into();
2744 self
2745 }
2746
2747 pub async fn send(self) -> Result<crate::model::Schema> {
2749 (*self.0.stub)
2750 .delete_schema_revision(self.0.request, self.0.options)
2751 .await
2752 .map(gax::response::Response::into_body)
2753 }
2754
2755 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2759 self.0.request.name = v.into();
2760 self
2761 }
2762
2763 #[deprecated]
2765 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2766 self.0.request.revision_id = v.into();
2767 self
2768 }
2769 }
2770
2771 #[doc(hidden)]
2772 impl gax::options::internal::RequestBuilder for DeleteSchemaRevision {
2773 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2774 &mut self.0.options
2775 }
2776 }
2777
2778 #[derive(Clone, Debug)]
2795 pub struct DeleteSchema(RequestBuilder<crate::model::DeleteSchemaRequest>);
2796
2797 impl DeleteSchema {
2798 pub(crate) fn new(
2799 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2800 ) -> Self {
2801 Self(RequestBuilder::new(stub))
2802 }
2803
2804 pub fn with_request<V: Into<crate::model::DeleteSchemaRequest>>(mut self, v: V) -> Self {
2806 self.0.request = v.into();
2807 self
2808 }
2809
2810 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2812 self.0.options = v.into();
2813 self
2814 }
2815
2816 pub async fn send(self) -> Result<()> {
2818 (*self.0.stub)
2819 .delete_schema(self.0.request, self.0.options)
2820 .await
2821 .map(gax::response::Response::into_body)
2822 }
2823
2824 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2828 self.0.request.name = v.into();
2829 self
2830 }
2831 }
2832
2833 #[doc(hidden)]
2834 impl gax::options::internal::RequestBuilder for DeleteSchema {
2835 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2836 &mut self.0.options
2837 }
2838 }
2839
2840 #[derive(Clone, Debug)]
2857 pub struct ValidateSchema(RequestBuilder<crate::model::ValidateSchemaRequest>);
2858
2859 impl ValidateSchema {
2860 pub(crate) fn new(
2861 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2862 ) -> Self {
2863 Self(RequestBuilder::new(stub))
2864 }
2865
2866 pub fn with_request<V: Into<crate::model::ValidateSchemaRequest>>(mut self, v: V) -> Self {
2868 self.0.request = v.into();
2869 self
2870 }
2871
2872 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2874 self.0.options = v.into();
2875 self
2876 }
2877
2878 pub async fn send(self) -> Result<crate::model::ValidateSchemaResponse> {
2880 (*self.0.stub)
2881 .validate_schema(self.0.request, self.0.options)
2882 .await
2883 .map(gax::response::Response::into_body)
2884 }
2885
2886 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2890 self.0.request.parent = v.into();
2891 self
2892 }
2893
2894 pub fn set_schema<T>(mut self, v: T) -> Self
2898 where
2899 T: std::convert::Into<crate::model::Schema>,
2900 {
2901 self.0.request.schema = std::option::Option::Some(v.into());
2902 self
2903 }
2904
2905 pub fn set_or_clear_schema<T>(mut self, v: std::option::Option<T>) -> Self
2909 where
2910 T: std::convert::Into<crate::model::Schema>,
2911 {
2912 self.0.request.schema = v.map(|x| x.into());
2913 self
2914 }
2915 }
2916
2917 #[doc(hidden)]
2918 impl gax::options::internal::RequestBuilder for ValidateSchema {
2919 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2920 &mut self.0.options
2921 }
2922 }
2923
2924 #[derive(Clone, Debug)]
2941 pub struct ValidateMessage(RequestBuilder<crate::model::ValidateMessageRequest>);
2942
2943 impl ValidateMessage {
2944 pub(crate) fn new(
2945 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
2946 ) -> Self {
2947 Self(RequestBuilder::new(stub))
2948 }
2949
2950 pub fn with_request<V: Into<crate::model::ValidateMessageRequest>>(mut self, v: V) -> Self {
2952 self.0.request = v.into();
2953 self
2954 }
2955
2956 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2958 self.0.options = v.into();
2959 self
2960 }
2961
2962 pub async fn send(self) -> Result<crate::model::ValidateMessageResponse> {
2964 (*self.0.stub)
2965 .validate_message(self.0.request, self.0.options)
2966 .await
2967 .map(gax::response::Response::into_body)
2968 }
2969
2970 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.0.request.parent = v.into();
2975 self
2976 }
2977
2978 pub fn set_message<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2980 self.0.request.message = v.into();
2981 self
2982 }
2983
2984 pub fn set_encoding<T: Into<crate::model::Encoding>>(mut self, v: T) -> Self {
2986 self.0.request.encoding = v.into();
2987 self
2988 }
2989
2990 pub fn set_schema_spec<
2995 T: Into<Option<crate::model::validate_message_request::SchemaSpec>>,
2996 >(
2997 mut self,
2998 v: T,
2999 ) -> Self {
3000 self.0.request.schema_spec = v.into();
3001 self
3002 }
3003
3004 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3010 self.0.request = self.0.request.set_name(v);
3011 self
3012 }
3013
3014 pub fn set_schema<T: std::convert::Into<std::boxed::Box<crate::model::Schema>>>(
3020 mut self,
3021 v: T,
3022 ) -> Self {
3023 self.0.request = self.0.request.set_schema(v);
3024 self
3025 }
3026 }
3027
3028 #[doc(hidden)]
3029 impl gax::options::internal::RequestBuilder for ValidateMessage {
3030 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3031 &mut self.0.options
3032 }
3033 }
3034
3035 #[derive(Clone, Debug)]
3052 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3053
3054 impl SetIamPolicy {
3055 pub(crate) fn new(
3056 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
3057 ) -> Self {
3058 Self(RequestBuilder::new(stub))
3059 }
3060
3061 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3063 self.0.request = v.into();
3064 self
3065 }
3066
3067 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3069 self.0.options = v.into();
3070 self
3071 }
3072
3073 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3075 (*self.0.stub)
3076 .set_iam_policy(self.0.request, self.0.options)
3077 .await
3078 .map(gax::response::Response::into_body)
3079 }
3080
3081 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3085 self.0.request.resource = v.into();
3086 self
3087 }
3088
3089 pub fn set_policy<T>(mut self, v: T) -> Self
3093 where
3094 T: std::convert::Into<iam_v1::model::Policy>,
3095 {
3096 self.0.request.policy = std::option::Option::Some(v.into());
3097 self
3098 }
3099
3100 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3104 where
3105 T: std::convert::Into<iam_v1::model::Policy>,
3106 {
3107 self.0.request.policy = v.map(|x| x.into());
3108 self
3109 }
3110
3111 pub fn set_update_mask<T>(mut self, v: T) -> Self
3113 where
3114 T: std::convert::Into<wkt::FieldMask>,
3115 {
3116 self.0.request.update_mask = std::option::Option::Some(v.into());
3117 self
3118 }
3119
3120 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3122 where
3123 T: std::convert::Into<wkt::FieldMask>,
3124 {
3125 self.0.request.update_mask = v.map(|x| x.into());
3126 self
3127 }
3128 }
3129
3130 #[doc(hidden)]
3131 impl gax::options::internal::RequestBuilder for SetIamPolicy {
3132 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3133 &mut self.0.options
3134 }
3135 }
3136
3137 #[derive(Clone, Debug)]
3154 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3155
3156 impl GetIamPolicy {
3157 pub(crate) fn new(
3158 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
3159 ) -> Self {
3160 Self(RequestBuilder::new(stub))
3161 }
3162
3163 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3165 self.0.request = v.into();
3166 self
3167 }
3168
3169 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3171 self.0.options = v.into();
3172 self
3173 }
3174
3175 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3177 (*self.0.stub)
3178 .get_iam_policy(self.0.request, self.0.options)
3179 .await
3180 .map(gax::response::Response::into_body)
3181 }
3182
3183 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3187 self.0.request.resource = v.into();
3188 self
3189 }
3190
3191 pub fn set_options<T>(mut self, v: T) -> Self
3193 where
3194 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3195 {
3196 self.0.request.options = std::option::Option::Some(v.into());
3197 self
3198 }
3199
3200 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3202 where
3203 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3204 {
3205 self.0.request.options = v.map(|x| x.into());
3206 self
3207 }
3208 }
3209
3210 #[doc(hidden)]
3211 impl gax::options::internal::RequestBuilder for GetIamPolicy {
3212 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3213 &mut self.0.options
3214 }
3215 }
3216
3217 #[derive(Clone, Debug)]
3234 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
3235
3236 impl TestIamPermissions {
3237 pub(crate) fn new(
3238 stub: std::sync::Arc<dyn super::super::stub::dynamic::SchemaService>,
3239 ) -> Self {
3240 Self(RequestBuilder::new(stub))
3241 }
3242
3243 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
3245 mut self,
3246 v: V,
3247 ) -> Self {
3248 self.0.request = v.into();
3249 self
3250 }
3251
3252 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3254 self.0.options = v.into();
3255 self
3256 }
3257
3258 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
3260 (*self.0.stub)
3261 .test_iam_permissions(self.0.request, self.0.options)
3262 .await
3263 .map(gax::response::Response::into_body)
3264 }
3265
3266 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3270 self.0.request.resource = v.into();
3271 self
3272 }
3273
3274 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3278 where
3279 T: std::iter::IntoIterator<Item = V>,
3280 V: std::convert::Into<std::string::String>,
3281 {
3282 use std::iter::Iterator;
3283 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3284 self
3285 }
3286 }
3287
3288 #[doc(hidden)]
3289 impl gax::options::internal::RequestBuilder for TestIamPermissions {
3290 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3291 &mut self.0.options
3292 }
3293 }
3294}