1pub mod data_access_control_service {
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::DataAccessControlService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = DataAccessControlService;
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::DataAccessControlService>,
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::DataAccessControlService>,
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 CreateDataAccessLabel(RequestBuilder<crate::model::CreateDataAccessLabelRequest>);
92
93 impl CreateDataAccessLabel {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::CreateDataAccessLabelRequest>>(
102 mut self,
103 v: V,
104 ) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
117 (*self.0.stub)
118 .create_data_access_label(self.0.request, self.0.options)
119 .await
120 .map(gax::response::Response::into_body)
121 }
122
123 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
127 self.0.request.parent = v.into();
128 self
129 }
130
131 pub fn set_data_access_label<T>(mut self, v: T) -> Self
135 where
136 T: std::convert::Into<crate::model::DataAccessLabel>,
137 {
138 self.0.request.data_access_label = std::option::Option::Some(v.into());
139 self
140 }
141
142 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
146 where
147 T: std::convert::Into<crate::model::DataAccessLabel>,
148 {
149 self.0.request.data_access_label = v.map(|x| x.into());
150 self
151 }
152
153 pub fn set_data_access_label_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
157 self.0.request.data_access_label_id = v.into();
158 self
159 }
160 }
161
162 #[doc(hidden)]
163 impl gax::options::internal::RequestBuilder for CreateDataAccessLabel {
164 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
165 &mut self.0.options
166 }
167 }
168
169 #[derive(Clone, Debug)]
186 pub struct GetDataAccessLabel(RequestBuilder<crate::model::GetDataAccessLabelRequest>);
187
188 impl GetDataAccessLabel {
189 pub(crate) fn new(
190 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
191 ) -> Self {
192 Self(RequestBuilder::new(stub))
193 }
194
195 pub fn with_request<V: Into<crate::model::GetDataAccessLabelRequest>>(
197 mut self,
198 v: V,
199 ) -> Self {
200 self.0.request = v.into();
201 self
202 }
203
204 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
206 self.0.options = v.into();
207 self
208 }
209
210 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
212 (*self.0.stub)
213 .get_data_access_label(self.0.request, self.0.options)
214 .await
215 .map(gax::response::Response::into_body)
216 }
217
218 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
222 self.0.request.name = v.into();
223 self
224 }
225 }
226
227 #[doc(hidden)]
228 impl gax::options::internal::RequestBuilder for GetDataAccessLabel {
229 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
230 &mut self.0.options
231 }
232 }
233
234 #[derive(Clone, Debug)]
255 pub struct ListDataAccessLabels(RequestBuilder<crate::model::ListDataAccessLabelsRequest>);
256
257 impl ListDataAccessLabels {
258 pub(crate) fn new(
259 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
260 ) -> Self {
261 Self(RequestBuilder::new(stub))
262 }
263
264 pub fn with_request<V: Into<crate::model::ListDataAccessLabelsRequest>>(
266 mut self,
267 v: V,
268 ) -> Self {
269 self.0.request = v.into();
270 self
271 }
272
273 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
275 self.0.options = v.into();
276 self
277 }
278
279 pub async fn send(self) -> Result<crate::model::ListDataAccessLabelsResponse> {
281 (*self.0.stub)
282 .list_data_access_labels(self.0.request, self.0.options)
283 .await
284 .map(gax::response::Response::into_body)
285 }
286
287 pub fn by_page(
289 self,
290 ) -> impl gax::paginator::Paginator<crate::model::ListDataAccessLabelsResponse, gax::error::Error>
291 {
292 use std::clone::Clone;
293 let token = self.0.request.page_token.clone();
294 let execute = move |token: String| {
295 let mut builder = self.clone();
296 builder.0.request = builder.0.request.set_page_token(token);
297 builder.send()
298 };
299 gax::paginator::internal::new_paginator(token, execute)
300 }
301
302 pub fn by_item(
304 self,
305 ) -> impl gax::paginator::ItemPaginator<
306 crate::model::ListDataAccessLabelsResponse,
307 gax::error::Error,
308 > {
309 use gax::paginator::Paginator;
310 self.by_page().items()
311 }
312
313 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
317 self.0.request.parent = v.into();
318 self
319 }
320
321 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
323 self.0.request.page_size = v.into();
324 self
325 }
326
327 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
329 self.0.request.page_token = v.into();
330 self
331 }
332
333 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
335 self.0.request.filter = v.into();
336 self
337 }
338 }
339
340 #[doc(hidden)]
341 impl gax::options::internal::RequestBuilder for ListDataAccessLabels {
342 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
343 &mut self.0.options
344 }
345 }
346
347 #[derive(Clone, Debug)]
364 pub struct UpdateDataAccessLabel(RequestBuilder<crate::model::UpdateDataAccessLabelRequest>);
365
366 impl UpdateDataAccessLabel {
367 pub(crate) fn new(
368 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
369 ) -> Self {
370 Self(RequestBuilder::new(stub))
371 }
372
373 pub fn with_request<V: Into<crate::model::UpdateDataAccessLabelRequest>>(
375 mut self,
376 v: V,
377 ) -> Self {
378 self.0.request = v.into();
379 self
380 }
381
382 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
384 self.0.options = v.into();
385 self
386 }
387
388 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
390 (*self.0.stub)
391 .update_data_access_label(self.0.request, self.0.options)
392 .await
393 .map(gax::response::Response::into_body)
394 }
395
396 pub fn set_data_access_label<T>(mut self, v: T) -> Self
400 where
401 T: std::convert::Into<crate::model::DataAccessLabel>,
402 {
403 self.0.request.data_access_label = std::option::Option::Some(v.into());
404 self
405 }
406
407 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
411 where
412 T: std::convert::Into<crate::model::DataAccessLabel>,
413 {
414 self.0.request.data_access_label = v.map(|x| x.into());
415 self
416 }
417
418 pub fn set_update_mask<T>(mut self, v: T) -> Self
420 where
421 T: std::convert::Into<wkt::FieldMask>,
422 {
423 self.0.request.update_mask = std::option::Option::Some(v.into());
424 self
425 }
426
427 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
429 where
430 T: std::convert::Into<wkt::FieldMask>,
431 {
432 self.0.request.update_mask = v.map(|x| x.into());
433 self
434 }
435 }
436
437 #[doc(hidden)]
438 impl gax::options::internal::RequestBuilder for UpdateDataAccessLabel {
439 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
440 &mut self.0.options
441 }
442 }
443
444 #[derive(Clone, Debug)]
461 pub struct DeleteDataAccessLabel(RequestBuilder<crate::model::DeleteDataAccessLabelRequest>);
462
463 impl DeleteDataAccessLabel {
464 pub(crate) fn new(
465 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
466 ) -> Self {
467 Self(RequestBuilder::new(stub))
468 }
469
470 pub fn with_request<V: Into<crate::model::DeleteDataAccessLabelRequest>>(
472 mut self,
473 v: V,
474 ) -> Self {
475 self.0.request = v.into();
476 self
477 }
478
479 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
481 self.0.options = v.into();
482 self
483 }
484
485 pub async fn send(self) -> Result<()> {
487 (*self.0.stub)
488 .delete_data_access_label(self.0.request, self.0.options)
489 .await
490 .map(gax::response::Response::into_body)
491 }
492
493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
497 self.0.request.name = v.into();
498 self
499 }
500 }
501
502 #[doc(hidden)]
503 impl gax::options::internal::RequestBuilder for DeleteDataAccessLabel {
504 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
505 &mut self.0.options
506 }
507 }
508
509 #[derive(Clone, Debug)]
526 pub struct CreateDataAccessScope(RequestBuilder<crate::model::CreateDataAccessScopeRequest>);
527
528 impl CreateDataAccessScope {
529 pub(crate) fn new(
530 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
531 ) -> Self {
532 Self(RequestBuilder::new(stub))
533 }
534
535 pub fn with_request<V: Into<crate::model::CreateDataAccessScopeRequest>>(
537 mut self,
538 v: V,
539 ) -> Self {
540 self.0.request = v.into();
541 self
542 }
543
544 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
546 self.0.options = v.into();
547 self
548 }
549
550 pub async fn send(self) -> Result<crate::model::DataAccessScope> {
552 (*self.0.stub)
553 .create_data_access_scope(self.0.request, self.0.options)
554 .await
555 .map(gax::response::Response::into_body)
556 }
557
558 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
562 self.0.request.parent = v.into();
563 self
564 }
565
566 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
570 where
571 T: std::convert::Into<crate::model::DataAccessScope>,
572 {
573 self.0.request.data_access_scope = std::option::Option::Some(v.into());
574 self
575 }
576
577 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
581 where
582 T: std::convert::Into<crate::model::DataAccessScope>,
583 {
584 self.0.request.data_access_scope = v.map(|x| x.into());
585 self
586 }
587
588 pub fn set_data_access_scope_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
592 self.0.request.data_access_scope_id = v.into();
593 self
594 }
595 }
596
597 #[doc(hidden)]
598 impl gax::options::internal::RequestBuilder for CreateDataAccessScope {
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 GetDataAccessScope(RequestBuilder<crate::model::GetDataAccessScopeRequest>);
622
623 impl GetDataAccessScope {
624 pub(crate) fn new(
625 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
626 ) -> Self {
627 Self(RequestBuilder::new(stub))
628 }
629
630 pub fn with_request<V: Into<crate::model::GetDataAccessScopeRequest>>(
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::DataAccessScope> {
647 (*self.0.stub)
648 .get_data_access_scope(self.0.request, self.0.options)
649 .await
650 .map(gax::response::Response::into_body)
651 }
652
653 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
657 self.0.request.name = v.into();
658 self
659 }
660 }
661
662 #[doc(hidden)]
663 impl gax::options::internal::RequestBuilder for GetDataAccessScope {
664 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
665 &mut self.0.options
666 }
667 }
668
669 #[derive(Clone, Debug)]
690 pub struct ListDataAccessScopes(RequestBuilder<crate::model::ListDataAccessScopesRequest>);
691
692 impl ListDataAccessScopes {
693 pub(crate) fn new(
694 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
695 ) -> Self {
696 Self(RequestBuilder::new(stub))
697 }
698
699 pub fn with_request<V: Into<crate::model::ListDataAccessScopesRequest>>(
701 mut self,
702 v: V,
703 ) -> Self {
704 self.0.request = v.into();
705 self
706 }
707
708 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
710 self.0.options = v.into();
711 self
712 }
713
714 pub async fn send(self) -> Result<crate::model::ListDataAccessScopesResponse> {
716 (*self.0.stub)
717 .list_data_access_scopes(self.0.request, self.0.options)
718 .await
719 .map(gax::response::Response::into_body)
720 }
721
722 pub fn by_page(
724 self,
725 ) -> impl gax::paginator::Paginator<crate::model::ListDataAccessScopesResponse, gax::error::Error>
726 {
727 use std::clone::Clone;
728 let token = self.0.request.page_token.clone();
729 let execute = move |token: String| {
730 let mut builder = self.clone();
731 builder.0.request = builder.0.request.set_page_token(token);
732 builder.send()
733 };
734 gax::paginator::internal::new_paginator(token, execute)
735 }
736
737 pub fn by_item(
739 self,
740 ) -> impl gax::paginator::ItemPaginator<
741 crate::model::ListDataAccessScopesResponse,
742 gax::error::Error,
743 > {
744 use gax::paginator::Paginator;
745 self.by_page().items()
746 }
747
748 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
752 self.0.request.parent = v.into();
753 self
754 }
755
756 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
758 self.0.request.page_size = v.into();
759 self
760 }
761
762 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
764 self.0.request.page_token = v.into();
765 self
766 }
767
768 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
770 self.0.request.filter = v.into();
771 self
772 }
773 }
774
775 #[doc(hidden)]
776 impl gax::options::internal::RequestBuilder for ListDataAccessScopes {
777 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
778 &mut self.0.options
779 }
780 }
781
782 #[derive(Clone, Debug)]
799 pub struct UpdateDataAccessScope(RequestBuilder<crate::model::UpdateDataAccessScopeRequest>);
800
801 impl UpdateDataAccessScope {
802 pub(crate) fn new(
803 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
804 ) -> Self {
805 Self(RequestBuilder::new(stub))
806 }
807
808 pub fn with_request<V: Into<crate::model::UpdateDataAccessScopeRequest>>(
810 mut self,
811 v: V,
812 ) -> Self {
813 self.0.request = v.into();
814 self
815 }
816
817 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
819 self.0.options = v.into();
820 self
821 }
822
823 pub async fn send(self) -> Result<crate::model::DataAccessScope> {
825 (*self.0.stub)
826 .update_data_access_scope(self.0.request, self.0.options)
827 .await
828 .map(gax::response::Response::into_body)
829 }
830
831 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
835 where
836 T: std::convert::Into<crate::model::DataAccessScope>,
837 {
838 self.0.request.data_access_scope = std::option::Option::Some(v.into());
839 self
840 }
841
842 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
846 where
847 T: std::convert::Into<crate::model::DataAccessScope>,
848 {
849 self.0.request.data_access_scope = v.map(|x| x.into());
850 self
851 }
852
853 pub fn set_update_mask<T>(mut self, v: T) -> Self
855 where
856 T: std::convert::Into<wkt::FieldMask>,
857 {
858 self.0.request.update_mask = std::option::Option::Some(v.into());
859 self
860 }
861
862 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
864 where
865 T: std::convert::Into<wkt::FieldMask>,
866 {
867 self.0.request.update_mask = v.map(|x| x.into());
868 self
869 }
870 }
871
872 #[doc(hidden)]
873 impl gax::options::internal::RequestBuilder for UpdateDataAccessScope {
874 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
875 &mut self.0.options
876 }
877 }
878
879 #[derive(Clone, Debug)]
896 pub struct DeleteDataAccessScope(RequestBuilder<crate::model::DeleteDataAccessScopeRequest>);
897
898 impl DeleteDataAccessScope {
899 pub(crate) fn new(
900 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
901 ) -> Self {
902 Self(RequestBuilder::new(stub))
903 }
904
905 pub fn with_request<V: Into<crate::model::DeleteDataAccessScopeRequest>>(
907 mut self,
908 v: V,
909 ) -> Self {
910 self.0.request = v.into();
911 self
912 }
913
914 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
916 self.0.options = v.into();
917 self
918 }
919
920 pub async fn send(self) -> Result<()> {
922 (*self.0.stub)
923 .delete_data_access_scope(self.0.request, self.0.options)
924 .await
925 .map(gax::response::Response::into_body)
926 }
927
928 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
932 self.0.request.name = v.into();
933 self
934 }
935 }
936
937 #[doc(hidden)]
938 impl gax::options::internal::RequestBuilder for DeleteDataAccessScope {
939 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
940 &mut self.0.options
941 }
942 }
943
944 #[derive(Clone, Debug)]
965 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
966
967 impl ListOperations {
968 pub(crate) fn new(
969 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
970 ) -> Self {
971 Self(RequestBuilder::new(stub))
972 }
973
974 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
976 mut self,
977 v: V,
978 ) -> Self {
979 self.0.request = v.into();
980 self
981 }
982
983 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
985 self.0.options = v.into();
986 self
987 }
988
989 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
991 (*self.0.stub)
992 .list_operations(self.0.request, self.0.options)
993 .await
994 .map(gax::response::Response::into_body)
995 }
996
997 pub fn by_page(
999 self,
1000 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1001 {
1002 use std::clone::Clone;
1003 let token = self.0.request.page_token.clone();
1004 let execute = move |token: String| {
1005 let mut builder = self.clone();
1006 builder.0.request = builder.0.request.set_page_token(token);
1007 builder.send()
1008 };
1009 gax::paginator::internal::new_paginator(token, execute)
1010 }
1011
1012 pub fn by_item(
1014 self,
1015 ) -> impl gax::paginator::ItemPaginator<
1016 longrunning::model::ListOperationsResponse,
1017 gax::error::Error,
1018 > {
1019 use gax::paginator::Paginator;
1020 self.by_page().items()
1021 }
1022
1023 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1025 self.0.request.name = v.into();
1026 self
1027 }
1028
1029 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1031 self.0.request.filter = v.into();
1032 self
1033 }
1034
1035 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1037 self.0.request.page_size = v.into();
1038 self
1039 }
1040
1041 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1043 self.0.request.page_token = v.into();
1044 self
1045 }
1046
1047 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1049 self.0.request.return_partial_success = v.into();
1050 self
1051 }
1052 }
1053
1054 #[doc(hidden)]
1055 impl gax::options::internal::RequestBuilder for ListOperations {
1056 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1057 &mut self.0.options
1058 }
1059 }
1060
1061 #[derive(Clone, Debug)]
1078 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1079
1080 impl GetOperation {
1081 pub(crate) fn new(
1082 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
1083 ) -> Self {
1084 Self(RequestBuilder::new(stub))
1085 }
1086
1087 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1089 mut self,
1090 v: V,
1091 ) -> Self {
1092 self.0.request = v.into();
1093 self
1094 }
1095
1096 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1098 self.0.options = v.into();
1099 self
1100 }
1101
1102 pub async fn send(self) -> Result<longrunning::model::Operation> {
1104 (*self.0.stub)
1105 .get_operation(self.0.request, self.0.options)
1106 .await
1107 .map(gax::response::Response::into_body)
1108 }
1109
1110 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1112 self.0.request.name = v.into();
1113 self
1114 }
1115 }
1116
1117 #[doc(hidden)]
1118 impl gax::options::internal::RequestBuilder for GetOperation {
1119 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1120 &mut self.0.options
1121 }
1122 }
1123
1124 #[derive(Clone, Debug)]
1141 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1142
1143 impl DeleteOperation {
1144 pub(crate) fn new(
1145 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
1146 ) -> Self {
1147 Self(RequestBuilder::new(stub))
1148 }
1149
1150 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1152 mut self,
1153 v: V,
1154 ) -> Self {
1155 self.0.request = v.into();
1156 self
1157 }
1158
1159 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1161 self.0.options = v.into();
1162 self
1163 }
1164
1165 pub async fn send(self) -> Result<()> {
1167 (*self.0.stub)
1168 .delete_operation(self.0.request, self.0.options)
1169 .await
1170 .map(gax::response::Response::into_body)
1171 }
1172
1173 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1175 self.0.request.name = v.into();
1176 self
1177 }
1178 }
1179
1180 #[doc(hidden)]
1181 impl gax::options::internal::RequestBuilder for DeleteOperation {
1182 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1183 &mut self.0.options
1184 }
1185 }
1186
1187 #[derive(Clone, Debug)]
1204 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1205
1206 impl CancelOperation {
1207 pub(crate) fn new(
1208 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
1209 ) -> Self {
1210 Self(RequestBuilder::new(stub))
1211 }
1212
1213 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1215 mut self,
1216 v: V,
1217 ) -> Self {
1218 self.0.request = v.into();
1219 self
1220 }
1221
1222 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1224 self.0.options = v.into();
1225 self
1226 }
1227
1228 pub async fn send(self) -> Result<()> {
1230 (*self.0.stub)
1231 .cancel_operation(self.0.request, self.0.options)
1232 .await
1233 .map(gax::response::Response::into_body)
1234 }
1235
1236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1238 self.0.request.name = v.into();
1239 self
1240 }
1241 }
1242
1243 #[doc(hidden)]
1244 impl gax::options::internal::RequestBuilder for CancelOperation {
1245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1246 &mut self.0.options
1247 }
1248 }
1249}
1250
1251pub mod entity_service {
1252 use crate::Result;
1253
1254 pub type ClientBuilder =
1268 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1269
1270 pub(crate) mod client {
1271 use super::super::super::client::EntityService;
1272 pub struct Factory;
1273 impl gax::client_builder::internal::ClientFactory for Factory {
1274 type Client = EntityService;
1275 type Credentials = gaxi::options::Credentials;
1276 async fn build(
1277 self,
1278 config: gaxi::options::ClientConfig,
1279 ) -> gax::client_builder::Result<Self::Client> {
1280 Self::Client::new(config).await
1281 }
1282 }
1283 }
1284
1285 #[derive(Clone, Debug)]
1287 pub(crate) struct RequestBuilder<R: std::default::Default> {
1288 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1289 request: R,
1290 options: gax::options::RequestOptions,
1291 }
1292
1293 impl<R> RequestBuilder<R>
1294 where
1295 R: std::default::Default,
1296 {
1297 pub(crate) fn new(
1298 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1299 ) -> Self {
1300 Self {
1301 stub,
1302 request: R::default(),
1303 options: gax::options::RequestOptions::default(),
1304 }
1305 }
1306 }
1307
1308 #[derive(Clone, Debug)]
1325 pub struct GetWatchlist(RequestBuilder<crate::model::GetWatchlistRequest>);
1326
1327 impl GetWatchlist {
1328 pub(crate) fn new(
1329 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1330 ) -> Self {
1331 Self(RequestBuilder::new(stub))
1332 }
1333
1334 pub fn with_request<V: Into<crate::model::GetWatchlistRequest>>(mut self, v: V) -> Self {
1336 self.0.request = v.into();
1337 self
1338 }
1339
1340 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1342 self.0.options = v.into();
1343 self
1344 }
1345
1346 pub async fn send(self) -> Result<crate::model::Watchlist> {
1348 (*self.0.stub)
1349 .get_watchlist(self.0.request, self.0.options)
1350 .await
1351 .map(gax::response::Response::into_body)
1352 }
1353
1354 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1358 self.0.request.name = v.into();
1359 self
1360 }
1361 }
1362
1363 #[doc(hidden)]
1364 impl gax::options::internal::RequestBuilder for GetWatchlist {
1365 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1366 &mut self.0.options
1367 }
1368 }
1369
1370 #[derive(Clone, Debug)]
1391 pub struct ListWatchlists(RequestBuilder<crate::model::ListWatchlistsRequest>);
1392
1393 impl ListWatchlists {
1394 pub(crate) fn new(
1395 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1396 ) -> Self {
1397 Self(RequestBuilder::new(stub))
1398 }
1399
1400 pub fn with_request<V: Into<crate::model::ListWatchlistsRequest>>(mut self, v: V) -> Self {
1402 self.0.request = v.into();
1403 self
1404 }
1405
1406 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1408 self.0.options = v.into();
1409 self
1410 }
1411
1412 pub async fn send(self) -> Result<crate::model::ListWatchlistsResponse> {
1414 (*self.0.stub)
1415 .list_watchlists(self.0.request, self.0.options)
1416 .await
1417 .map(gax::response::Response::into_body)
1418 }
1419
1420 pub fn by_page(
1422 self,
1423 ) -> impl gax::paginator::Paginator<crate::model::ListWatchlistsResponse, gax::error::Error>
1424 {
1425 use std::clone::Clone;
1426 let token = self.0.request.page_token.clone();
1427 let execute = move |token: String| {
1428 let mut builder = self.clone();
1429 builder.0.request = builder.0.request.set_page_token(token);
1430 builder.send()
1431 };
1432 gax::paginator::internal::new_paginator(token, execute)
1433 }
1434
1435 pub fn by_item(
1437 self,
1438 ) -> impl gax::paginator::ItemPaginator<crate::model::ListWatchlistsResponse, gax::error::Error>
1439 {
1440 use gax::paginator::Paginator;
1441 self.by_page().items()
1442 }
1443
1444 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1448 self.0.request.parent = v.into();
1449 self
1450 }
1451
1452 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1454 self.0.request.page_size = v.into();
1455 self
1456 }
1457
1458 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1460 self.0.request.page_token = v.into();
1461 self
1462 }
1463
1464 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1466 self.0.request.filter = v.into();
1467 self
1468 }
1469 }
1470
1471 #[doc(hidden)]
1472 impl gax::options::internal::RequestBuilder for ListWatchlists {
1473 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1474 &mut self.0.options
1475 }
1476 }
1477
1478 #[derive(Clone, Debug)]
1495 pub struct CreateWatchlist(RequestBuilder<crate::model::CreateWatchlistRequest>);
1496
1497 impl CreateWatchlist {
1498 pub(crate) fn new(
1499 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1500 ) -> Self {
1501 Self(RequestBuilder::new(stub))
1502 }
1503
1504 pub fn with_request<V: Into<crate::model::CreateWatchlistRequest>>(mut self, v: V) -> Self {
1506 self.0.request = v.into();
1507 self
1508 }
1509
1510 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1512 self.0.options = v.into();
1513 self
1514 }
1515
1516 pub async fn send(self) -> Result<crate::model::Watchlist> {
1518 (*self.0.stub)
1519 .create_watchlist(self.0.request, self.0.options)
1520 .await
1521 .map(gax::response::Response::into_body)
1522 }
1523
1524 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1528 self.0.request.parent = v.into();
1529 self
1530 }
1531
1532 pub fn set_watchlist_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1534 self.0.request.watchlist_id = v.into();
1535 self
1536 }
1537
1538 pub fn set_watchlist<T>(mut self, v: T) -> Self
1542 where
1543 T: std::convert::Into<crate::model::Watchlist>,
1544 {
1545 self.0.request.watchlist = std::option::Option::Some(v.into());
1546 self
1547 }
1548
1549 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
1553 where
1554 T: std::convert::Into<crate::model::Watchlist>,
1555 {
1556 self.0.request.watchlist = v.map(|x| x.into());
1557 self
1558 }
1559 }
1560
1561 #[doc(hidden)]
1562 impl gax::options::internal::RequestBuilder for CreateWatchlist {
1563 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1564 &mut self.0.options
1565 }
1566 }
1567
1568 #[derive(Clone, Debug)]
1585 pub struct UpdateWatchlist(RequestBuilder<crate::model::UpdateWatchlistRequest>);
1586
1587 impl UpdateWatchlist {
1588 pub(crate) fn new(
1589 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1590 ) -> Self {
1591 Self(RequestBuilder::new(stub))
1592 }
1593
1594 pub fn with_request<V: Into<crate::model::UpdateWatchlistRequest>>(mut self, v: V) -> Self {
1596 self.0.request = v.into();
1597 self
1598 }
1599
1600 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1602 self.0.options = v.into();
1603 self
1604 }
1605
1606 pub async fn send(self) -> Result<crate::model::Watchlist> {
1608 (*self.0.stub)
1609 .update_watchlist(self.0.request, self.0.options)
1610 .await
1611 .map(gax::response::Response::into_body)
1612 }
1613
1614 pub fn set_watchlist<T>(mut self, v: T) -> Self
1618 where
1619 T: std::convert::Into<crate::model::Watchlist>,
1620 {
1621 self.0.request.watchlist = std::option::Option::Some(v.into());
1622 self
1623 }
1624
1625 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
1629 where
1630 T: std::convert::Into<crate::model::Watchlist>,
1631 {
1632 self.0.request.watchlist = v.map(|x| x.into());
1633 self
1634 }
1635
1636 pub fn set_update_mask<T>(mut self, v: T) -> Self
1638 where
1639 T: std::convert::Into<wkt::FieldMask>,
1640 {
1641 self.0.request.update_mask = std::option::Option::Some(v.into());
1642 self
1643 }
1644
1645 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1647 where
1648 T: std::convert::Into<wkt::FieldMask>,
1649 {
1650 self.0.request.update_mask = v.map(|x| x.into());
1651 self
1652 }
1653 }
1654
1655 #[doc(hidden)]
1656 impl gax::options::internal::RequestBuilder for UpdateWatchlist {
1657 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1658 &mut self.0.options
1659 }
1660 }
1661
1662 #[derive(Clone, Debug)]
1679 pub struct DeleteWatchlist(RequestBuilder<crate::model::DeleteWatchlistRequest>);
1680
1681 impl DeleteWatchlist {
1682 pub(crate) fn new(
1683 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1684 ) -> Self {
1685 Self(RequestBuilder::new(stub))
1686 }
1687
1688 pub fn with_request<V: Into<crate::model::DeleteWatchlistRequest>>(mut self, v: V) -> Self {
1690 self.0.request = v.into();
1691 self
1692 }
1693
1694 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1696 self.0.options = v.into();
1697 self
1698 }
1699
1700 pub async fn send(self) -> Result<()> {
1702 (*self.0.stub)
1703 .delete_watchlist(self.0.request, self.0.options)
1704 .await
1705 .map(gax::response::Response::into_body)
1706 }
1707
1708 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1712 self.0.request.name = v.into();
1713 self
1714 }
1715
1716 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1718 self.0.request.force = v.into();
1719 self
1720 }
1721 }
1722
1723 #[doc(hidden)]
1724 impl gax::options::internal::RequestBuilder for DeleteWatchlist {
1725 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1726 &mut self.0.options
1727 }
1728 }
1729
1730 #[derive(Clone, Debug)]
1751 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1752
1753 impl ListOperations {
1754 pub(crate) fn new(
1755 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1756 ) -> Self {
1757 Self(RequestBuilder::new(stub))
1758 }
1759
1760 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1762 mut self,
1763 v: V,
1764 ) -> Self {
1765 self.0.request = v.into();
1766 self
1767 }
1768
1769 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1771 self.0.options = v.into();
1772 self
1773 }
1774
1775 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1777 (*self.0.stub)
1778 .list_operations(self.0.request, self.0.options)
1779 .await
1780 .map(gax::response::Response::into_body)
1781 }
1782
1783 pub fn by_page(
1785 self,
1786 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1787 {
1788 use std::clone::Clone;
1789 let token = self.0.request.page_token.clone();
1790 let execute = move |token: String| {
1791 let mut builder = self.clone();
1792 builder.0.request = builder.0.request.set_page_token(token);
1793 builder.send()
1794 };
1795 gax::paginator::internal::new_paginator(token, execute)
1796 }
1797
1798 pub fn by_item(
1800 self,
1801 ) -> impl gax::paginator::ItemPaginator<
1802 longrunning::model::ListOperationsResponse,
1803 gax::error::Error,
1804 > {
1805 use gax::paginator::Paginator;
1806 self.by_page().items()
1807 }
1808
1809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1811 self.0.request.name = v.into();
1812 self
1813 }
1814
1815 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1817 self.0.request.filter = v.into();
1818 self
1819 }
1820
1821 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1823 self.0.request.page_size = v.into();
1824 self
1825 }
1826
1827 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829 self.0.request.page_token = v.into();
1830 self
1831 }
1832
1833 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1835 self.0.request.return_partial_success = v.into();
1836 self
1837 }
1838 }
1839
1840 #[doc(hidden)]
1841 impl gax::options::internal::RequestBuilder for ListOperations {
1842 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1843 &mut self.0.options
1844 }
1845 }
1846
1847 #[derive(Clone, Debug)]
1864 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1865
1866 impl GetOperation {
1867 pub(crate) fn new(
1868 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1869 ) -> Self {
1870 Self(RequestBuilder::new(stub))
1871 }
1872
1873 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1875 mut self,
1876 v: V,
1877 ) -> Self {
1878 self.0.request = v.into();
1879 self
1880 }
1881
1882 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1884 self.0.options = v.into();
1885 self
1886 }
1887
1888 pub async fn send(self) -> Result<longrunning::model::Operation> {
1890 (*self.0.stub)
1891 .get_operation(self.0.request, self.0.options)
1892 .await
1893 .map(gax::response::Response::into_body)
1894 }
1895
1896 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1898 self.0.request.name = v.into();
1899 self
1900 }
1901 }
1902
1903 #[doc(hidden)]
1904 impl gax::options::internal::RequestBuilder for GetOperation {
1905 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1906 &mut self.0.options
1907 }
1908 }
1909
1910 #[derive(Clone, Debug)]
1927 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1928
1929 impl DeleteOperation {
1930 pub(crate) fn new(
1931 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1932 ) -> Self {
1933 Self(RequestBuilder::new(stub))
1934 }
1935
1936 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1938 mut self,
1939 v: V,
1940 ) -> Self {
1941 self.0.request = v.into();
1942 self
1943 }
1944
1945 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1947 self.0.options = v.into();
1948 self
1949 }
1950
1951 pub async fn send(self) -> Result<()> {
1953 (*self.0.stub)
1954 .delete_operation(self.0.request, self.0.options)
1955 .await
1956 .map(gax::response::Response::into_body)
1957 }
1958
1959 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1961 self.0.request.name = v.into();
1962 self
1963 }
1964 }
1965
1966 #[doc(hidden)]
1967 impl gax::options::internal::RequestBuilder for DeleteOperation {
1968 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1969 &mut self.0.options
1970 }
1971 }
1972
1973 #[derive(Clone, Debug)]
1990 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1991
1992 impl CancelOperation {
1993 pub(crate) fn new(
1994 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1995 ) -> Self {
1996 Self(RequestBuilder::new(stub))
1997 }
1998
1999 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2001 mut self,
2002 v: V,
2003 ) -> Self {
2004 self.0.request = v.into();
2005 self
2006 }
2007
2008 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2010 self.0.options = v.into();
2011 self
2012 }
2013
2014 pub async fn send(self) -> Result<()> {
2016 (*self.0.stub)
2017 .cancel_operation(self.0.request, self.0.options)
2018 .await
2019 .map(gax::response::Response::into_body)
2020 }
2021
2022 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2024 self.0.request.name = v.into();
2025 self
2026 }
2027 }
2028
2029 #[doc(hidden)]
2030 impl gax::options::internal::RequestBuilder for CancelOperation {
2031 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2032 &mut self.0.options
2033 }
2034 }
2035}
2036
2037pub mod instance_service {
2038 use crate::Result;
2039
2040 pub type ClientBuilder =
2054 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2055
2056 pub(crate) mod client {
2057 use super::super::super::client::InstanceService;
2058 pub struct Factory;
2059 impl gax::client_builder::internal::ClientFactory for Factory {
2060 type Client = InstanceService;
2061 type Credentials = gaxi::options::Credentials;
2062 async fn build(
2063 self,
2064 config: gaxi::options::ClientConfig,
2065 ) -> gax::client_builder::Result<Self::Client> {
2066 Self::Client::new(config).await
2067 }
2068 }
2069 }
2070
2071 #[derive(Clone, Debug)]
2073 pub(crate) struct RequestBuilder<R: std::default::Default> {
2074 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2075 request: R,
2076 options: gax::options::RequestOptions,
2077 }
2078
2079 impl<R> RequestBuilder<R>
2080 where
2081 R: std::default::Default,
2082 {
2083 pub(crate) fn new(
2084 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2085 ) -> Self {
2086 Self {
2087 stub,
2088 request: R::default(),
2089 options: gax::options::RequestOptions::default(),
2090 }
2091 }
2092 }
2093
2094 #[derive(Clone, Debug)]
2111 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2112
2113 impl GetInstance {
2114 pub(crate) fn new(
2115 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2116 ) -> Self {
2117 Self(RequestBuilder::new(stub))
2118 }
2119
2120 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2122 self.0.request = v.into();
2123 self
2124 }
2125
2126 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2128 self.0.options = v.into();
2129 self
2130 }
2131
2132 pub async fn send(self) -> Result<crate::model::Instance> {
2134 (*self.0.stub)
2135 .get_instance(self.0.request, self.0.options)
2136 .await
2137 .map(gax::response::Response::into_body)
2138 }
2139
2140 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2144 self.0.request.name = v.into();
2145 self
2146 }
2147 }
2148
2149 #[doc(hidden)]
2150 impl gax::options::internal::RequestBuilder for GetInstance {
2151 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2152 &mut self.0.options
2153 }
2154 }
2155
2156 #[derive(Clone, Debug)]
2177 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2178
2179 impl ListOperations {
2180 pub(crate) fn new(
2181 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2182 ) -> Self {
2183 Self(RequestBuilder::new(stub))
2184 }
2185
2186 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2188 mut self,
2189 v: V,
2190 ) -> Self {
2191 self.0.request = v.into();
2192 self
2193 }
2194
2195 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2197 self.0.options = v.into();
2198 self
2199 }
2200
2201 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2203 (*self.0.stub)
2204 .list_operations(self.0.request, self.0.options)
2205 .await
2206 .map(gax::response::Response::into_body)
2207 }
2208
2209 pub fn by_page(
2211 self,
2212 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2213 {
2214 use std::clone::Clone;
2215 let token = self.0.request.page_token.clone();
2216 let execute = move |token: String| {
2217 let mut builder = self.clone();
2218 builder.0.request = builder.0.request.set_page_token(token);
2219 builder.send()
2220 };
2221 gax::paginator::internal::new_paginator(token, execute)
2222 }
2223
2224 pub fn by_item(
2226 self,
2227 ) -> impl gax::paginator::ItemPaginator<
2228 longrunning::model::ListOperationsResponse,
2229 gax::error::Error,
2230 > {
2231 use gax::paginator::Paginator;
2232 self.by_page().items()
2233 }
2234
2235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2237 self.0.request.name = v.into();
2238 self
2239 }
2240
2241 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2243 self.0.request.filter = v.into();
2244 self
2245 }
2246
2247 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2249 self.0.request.page_size = v.into();
2250 self
2251 }
2252
2253 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2255 self.0.request.page_token = v.into();
2256 self
2257 }
2258
2259 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2261 self.0.request.return_partial_success = v.into();
2262 self
2263 }
2264 }
2265
2266 #[doc(hidden)]
2267 impl gax::options::internal::RequestBuilder for ListOperations {
2268 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2269 &mut self.0.options
2270 }
2271 }
2272
2273 #[derive(Clone, Debug)]
2290 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2291
2292 impl GetOperation {
2293 pub(crate) fn new(
2294 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2295 ) -> Self {
2296 Self(RequestBuilder::new(stub))
2297 }
2298
2299 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2301 mut self,
2302 v: V,
2303 ) -> Self {
2304 self.0.request = v.into();
2305 self
2306 }
2307
2308 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2310 self.0.options = v.into();
2311 self
2312 }
2313
2314 pub async fn send(self) -> Result<longrunning::model::Operation> {
2316 (*self.0.stub)
2317 .get_operation(self.0.request, self.0.options)
2318 .await
2319 .map(gax::response::Response::into_body)
2320 }
2321
2322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2324 self.0.request.name = v.into();
2325 self
2326 }
2327 }
2328
2329 #[doc(hidden)]
2330 impl gax::options::internal::RequestBuilder for GetOperation {
2331 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2332 &mut self.0.options
2333 }
2334 }
2335
2336 #[derive(Clone, Debug)]
2353 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2354
2355 impl DeleteOperation {
2356 pub(crate) fn new(
2357 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2358 ) -> Self {
2359 Self(RequestBuilder::new(stub))
2360 }
2361
2362 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2364 mut self,
2365 v: V,
2366 ) -> Self {
2367 self.0.request = v.into();
2368 self
2369 }
2370
2371 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2373 self.0.options = v.into();
2374 self
2375 }
2376
2377 pub async fn send(self) -> Result<()> {
2379 (*self.0.stub)
2380 .delete_operation(self.0.request, self.0.options)
2381 .await
2382 .map(gax::response::Response::into_body)
2383 }
2384
2385 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2387 self.0.request.name = v.into();
2388 self
2389 }
2390 }
2391
2392 #[doc(hidden)]
2393 impl gax::options::internal::RequestBuilder for DeleteOperation {
2394 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2395 &mut self.0.options
2396 }
2397 }
2398
2399 #[derive(Clone, Debug)]
2416 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2417
2418 impl CancelOperation {
2419 pub(crate) fn new(
2420 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2421 ) -> Self {
2422 Self(RequestBuilder::new(stub))
2423 }
2424
2425 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2427 mut self,
2428 v: V,
2429 ) -> Self {
2430 self.0.request = v.into();
2431 self
2432 }
2433
2434 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2436 self.0.options = v.into();
2437 self
2438 }
2439
2440 pub async fn send(self) -> Result<()> {
2442 (*self.0.stub)
2443 .cancel_operation(self.0.request, self.0.options)
2444 .await
2445 .map(gax::response::Response::into_body)
2446 }
2447
2448 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2450 self.0.request.name = v.into();
2451 self
2452 }
2453 }
2454
2455 #[doc(hidden)]
2456 impl gax::options::internal::RequestBuilder for CancelOperation {
2457 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2458 &mut self.0.options
2459 }
2460 }
2461}
2462
2463pub mod reference_list_service {
2464 use crate::Result;
2465
2466 pub type ClientBuilder =
2480 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2481
2482 pub(crate) mod client {
2483 use super::super::super::client::ReferenceListService;
2484 pub struct Factory;
2485 impl gax::client_builder::internal::ClientFactory for Factory {
2486 type Client = ReferenceListService;
2487 type Credentials = gaxi::options::Credentials;
2488 async fn build(
2489 self,
2490 config: gaxi::options::ClientConfig,
2491 ) -> gax::client_builder::Result<Self::Client> {
2492 Self::Client::new(config).await
2493 }
2494 }
2495 }
2496
2497 #[derive(Clone, Debug)]
2499 pub(crate) struct RequestBuilder<R: std::default::Default> {
2500 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2501 request: R,
2502 options: gax::options::RequestOptions,
2503 }
2504
2505 impl<R> RequestBuilder<R>
2506 where
2507 R: std::default::Default,
2508 {
2509 pub(crate) fn new(
2510 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2511 ) -> Self {
2512 Self {
2513 stub,
2514 request: R::default(),
2515 options: gax::options::RequestOptions::default(),
2516 }
2517 }
2518 }
2519
2520 #[derive(Clone, Debug)]
2537 pub struct GetReferenceList(RequestBuilder<crate::model::GetReferenceListRequest>);
2538
2539 impl GetReferenceList {
2540 pub(crate) fn new(
2541 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2542 ) -> Self {
2543 Self(RequestBuilder::new(stub))
2544 }
2545
2546 pub fn with_request<V: Into<crate::model::GetReferenceListRequest>>(
2548 mut self,
2549 v: V,
2550 ) -> Self {
2551 self.0.request = v.into();
2552 self
2553 }
2554
2555 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2557 self.0.options = v.into();
2558 self
2559 }
2560
2561 pub async fn send(self) -> Result<crate::model::ReferenceList> {
2563 (*self.0.stub)
2564 .get_reference_list(self.0.request, self.0.options)
2565 .await
2566 .map(gax::response::Response::into_body)
2567 }
2568
2569 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573 self.0.request.name = v.into();
2574 self
2575 }
2576
2577 pub fn set_view<T: Into<crate::model::ReferenceListView>>(mut self, v: T) -> Self {
2579 self.0.request.view = v.into();
2580 self
2581 }
2582 }
2583
2584 #[doc(hidden)]
2585 impl gax::options::internal::RequestBuilder for GetReferenceList {
2586 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2587 &mut self.0.options
2588 }
2589 }
2590
2591 #[derive(Clone, Debug)]
2612 pub struct ListReferenceLists(RequestBuilder<crate::model::ListReferenceListsRequest>);
2613
2614 impl ListReferenceLists {
2615 pub(crate) fn new(
2616 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2617 ) -> Self {
2618 Self(RequestBuilder::new(stub))
2619 }
2620
2621 pub fn with_request<V: Into<crate::model::ListReferenceListsRequest>>(
2623 mut self,
2624 v: V,
2625 ) -> Self {
2626 self.0.request = v.into();
2627 self
2628 }
2629
2630 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2632 self.0.options = v.into();
2633 self
2634 }
2635
2636 pub async fn send(self) -> Result<crate::model::ListReferenceListsResponse> {
2638 (*self.0.stub)
2639 .list_reference_lists(self.0.request, self.0.options)
2640 .await
2641 .map(gax::response::Response::into_body)
2642 }
2643
2644 pub fn by_page(
2646 self,
2647 ) -> impl gax::paginator::Paginator<crate::model::ListReferenceListsResponse, gax::error::Error>
2648 {
2649 use std::clone::Clone;
2650 let token = self.0.request.page_token.clone();
2651 let execute = move |token: String| {
2652 let mut builder = self.clone();
2653 builder.0.request = builder.0.request.set_page_token(token);
2654 builder.send()
2655 };
2656 gax::paginator::internal::new_paginator(token, execute)
2657 }
2658
2659 pub fn by_item(
2661 self,
2662 ) -> impl gax::paginator::ItemPaginator<
2663 crate::model::ListReferenceListsResponse,
2664 gax::error::Error,
2665 > {
2666 use gax::paginator::Paginator;
2667 self.by_page().items()
2668 }
2669
2670 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2674 self.0.request.parent = v.into();
2675 self
2676 }
2677
2678 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2680 self.0.request.page_size = v.into();
2681 self
2682 }
2683
2684 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2686 self.0.request.page_token = v.into();
2687 self
2688 }
2689
2690 pub fn set_view<T: Into<crate::model::ReferenceListView>>(mut self, v: T) -> Self {
2692 self.0.request.view = v.into();
2693 self
2694 }
2695 }
2696
2697 #[doc(hidden)]
2698 impl gax::options::internal::RequestBuilder for ListReferenceLists {
2699 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2700 &mut self.0.options
2701 }
2702 }
2703
2704 #[derive(Clone, Debug)]
2721 pub struct CreateReferenceList(RequestBuilder<crate::model::CreateReferenceListRequest>);
2722
2723 impl CreateReferenceList {
2724 pub(crate) fn new(
2725 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2726 ) -> Self {
2727 Self(RequestBuilder::new(stub))
2728 }
2729
2730 pub fn with_request<V: Into<crate::model::CreateReferenceListRequest>>(
2732 mut self,
2733 v: V,
2734 ) -> Self {
2735 self.0.request = v.into();
2736 self
2737 }
2738
2739 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2741 self.0.options = v.into();
2742 self
2743 }
2744
2745 pub async fn send(self) -> Result<crate::model::ReferenceList> {
2747 (*self.0.stub)
2748 .create_reference_list(self.0.request, self.0.options)
2749 .await
2750 .map(gax::response::Response::into_body)
2751 }
2752
2753 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2757 self.0.request.parent = v.into();
2758 self
2759 }
2760
2761 pub fn set_reference_list<T>(mut self, v: T) -> Self
2765 where
2766 T: std::convert::Into<crate::model::ReferenceList>,
2767 {
2768 self.0.request.reference_list = std::option::Option::Some(v.into());
2769 self
2770 }
2771
2772 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
2776 where
2777 T: std::convert::Into<crate::model::ReferenceList>,
2778 {
2779 self.0.request.reference_list = v.map(|x| x.into());
2780 self
2781 }
2782
2783 pub fn set_reference_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2787 self.0.request.reference_list_id = v.into();
2788 self
2789 }
2790 }
2791
2792 #[doc(hidden)]
2793 impl gax::options::internal::RequestBuilder for CreateReferenceList {
2794 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2795 &mut self.0.options
2796 }
2797 }
2798
2799 #[derive(Clone, Debug)]
2816 pub struct UpdateReferenceList(RequestBuilder<crate::model::UpdateReferenceListRequest>);
2817
2818 impl UpdateReferenceList {
2819 pub(crate) fn new(
2820 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2821 ) -> Self {
2822 Self(RequestBuilder::new(stub))
2823 }
2824
2825 pub fn with_request<V: Into<crate::model::UpdateReferenceListRequest>>(
2827 mut self,
2828 v: V,
2829 ) -> Self {
2830 self.0.request = v.into();
2831 self
2832 }
2833
2834 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2836 self.0.options = v.into();
2837 self
2838 }
2839
2840 pub async fn send(self) -> Result<crate::model::ReferenceList> {
2842 (*self.0.stub)
2843 .update_reference_list(self.0.request, self.0.options)
2844 .await
2845 .map(gax::response::Response::into_body)
2846 }
2847
2848 pub fn set_reference_list<T>(mut self, v: T) -> Self
2852 where
2853 T: std::convert::Into<crate::model::ReferenceList>,
2854 {
2855 self.0.request.reference_list = std::option::Option::Some(v.into());
2856 self
2857 }
2858
2859 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
2863 where
2864 T: std::convert::Into<crate::model::ReferenceList>,
2865 {
2866 self.0.request.reference_list = v.map(|x| x.into());
2867 self
2868 }
2869
2870 pub fn set_update_mask<T>(mut self, v: T) -> Self
2872 where
2873 T: std::convert::Into<wkt::FieldMask>,
2874 {
2875 self.0.request.update_mask = std::option::Option::Some(v.into());
2876 self
2877 }
2878
2879 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2881 where
2882 T: std::convert::Into<wkt::FieldMask>,
2883 {
2884 self.0.request.update_mask = v.map(|x| x.into());
2885 self
2886 }
2887 }
2888
2889 #[doc(hidden)]
2890 impl gax::options::internal::RequestBuilder for UpdateReferenceList {
2891 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2892 &mut self.0.options
2893 }
2894 }
2895
2896 #[derive(Clone, Debug)]
2917 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2918
2919 impl ListOperations {
2920 pub(crate) fn new(
2921 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2922 ) -> Self {
2923 Self(RequestBuilder::new(stub))
2924 }
2925
2926 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2928 mut self,
2929 v: V,
2930 ) -> Self {
2931 self.0.request = v.into();
2932 self
2933 }
2934
2935 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2937 self.0.options = v.into();
2938 self
2939 }
2940
2941 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2943 (*self.0.stub)
2944 .list_operations(self.0.request, self.0.options)
2945 .await
2946 .map(gax::response::Response::into_body)
2947 }
2948
2949 pub fn by_page(
2951 self,
2952 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2953 {
2954 use std::clone::Clone;
2955 let token = self.0.request.page_token.clone();
2956 let execute = move |token: String| {
2957 let mut builder = self.clone();
2958 builder.0.request = builder.0.request.set_page_token(token);
2959 builder.send()
2960 };
2961 gax::paginator::internal::new_paginator(token, execute)
2962 }
2963
2964 pub fn by_item(
2966 self,
2967 ) -> impl gax::paginator::ItemPaginator<
2968 longrunning::model::ListOperationsResponse,
2969 gax::error::Error,
2970 > {
2971 use gax::paginator::Paginator;
2972 self.by_page().items()
2973 }
2974
2975 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2977 self.0.request.name = v.into();
2978 self
2979 }
2980
2981 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2983 self.0.request.filter = v.into();
2984 self
2985 }
2986
2987 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2989 self.0.request.page_size = v.into();
2990 self
2991 }
2992
2993 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2995 self.0.request.page_token = v.into();
2996 self
2997 }
2998
2999 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3001 self.0.request.return_partial_success = v.into();
3002 self
3003 }
3004 }
3005
3006 #[doc(hidden)]
3007 impl gax::options::internal::RequestBuilder for ListOperations {
3008 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3009 &mut self.0.options
3010 }
3011 }
3012
3013 #[derive(Clone, Debug)]
3030 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3031
3032 impl GetOperation {
3033 pub(crate) fn new(
3034 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
3035 ) -> Self {
3036 Self(RequestBuilder::new(stub))
3037 }
3038
3039 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3041 mut self,
3042 v: V,
3043 ) -> Self {
3044 self.0.request = v.into();
3045 self
3046 }
3047
3048 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3050 self.0.options = v.into();
3051 self
3052 }
3053
3054 pub async fn send(self) -> Result<longrunning::model::Operation> {
3056 (*self.0.stub)
3057 .get_operation(self.0.request, self.0.options)
3058 .await
3059 .map(gax::response::Response::into_body)
3060 }
3061
3062 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3064 self.0.request.name = v.into();
3065 self
3066 }
3067 }
3068
3069 #[doc(hidden)]
3070 impl gax::options::internal::RequestBuilder for GetOperation {
3071 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3072 &mut self.0.options
3073 }
3074 }
3075
3076 #[derive(Clone, Debug)]
3093 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3094
3095 impl DeleteOperation {
3096 pub(crate) fn new(
3097 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
3098 ) -> Self {
3099 Self(RequestBuilder::new(stub))
3100 }
3101
3102 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3104 mut self,
3105 v: V,
3106 ) -> Self {
3107 self.0.request = v.into();
3108 self
3109 }
3110
3111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3113 self.0.options = v.into();
3114 self
3115 }
3116
3117 pub async fn send(self) -> Result<()> {
3119 (*self.0.stub)
3120 .delete_operation(self.0.request, self.0.options)
3121 .await
3122 .map(gax::response::Response::into_body)
3123 }
3124
3125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3127 self.0.request.name = v.into();
3128 self
3129 }
3130 }
3131
3132 #[doc(hidden)]
3133 impl gax::options::internal::RequestBuilder for DeleteOperation {
3134 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3135 &mut self.0.options
3136 }
3137 }
3138
3139 #[derive(Clone, Debug)]
3156 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3157
3158 impl CancelOperation {
3159 pub(crate) fn new(
3160 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
3161 ) -> Self {
3162 Self(RequestBuilder::new(stub))
3163 }
3164
3165 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3167 mut self,
3168 v: V,
3169 ) -> Self {
3170 self.0.request = v.into();
3171 self
3172 }
3173
3174 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3176 self.0.options = v.into();
3177 self
3178 }
3179
3180 pub async fn send(self) -> Result<()> {
3182 (*self.0.stub)
3183 .cancel_operation(self.0.request, self.0.options)
3184 .await
3185 .map(gax::response::Response::into_body)
3186 }
3187
3188 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3190 self.0.request.name = v.into();
3191 self
3192 }
3193 }
3194
3195 #[doc(hidden)]
3196 impl gax::options::internal::RequestBuilder for CancelOperation {
3197 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3198 &mut self.0.options
3199 }
3200 }
3201}
3202
3203pub mod rule_service {
3204 use crate::Result;
3205
3206 pub type ClientBuilder =
3220 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3221
3222 pub(crate) mod client {
3223 use super::super::super::client::RuleService;
3224 pub struct Factory;
3225 impl gax::client_builder::internal::ClientFactory for Factory {
3226 type Client = RuleService;
3227 type Credentials = gaxi::options::Credentials;
3228 async fn build(
3229 self,
3230 config: gaxi::options::ClientConfig,
3231 ) -> gax::client_builder::Result<Self::Client> {
3232 Self::Client::new(config).await
3233 }
3234 }
3235 }
3236
3237 #[derive(Clone, Debug)]
3239 pub(crate) struct RequestBuilder<R: std::default::Default> {
3240 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3241 request: R,
3242 options: gax::options::RequestOptions,
3243 }
3244
3245 impl<R> RequestBuilder<R>
3246 where
3247 R: std::default::Default,
3248 {
3249 pub(crate) fn new(
3250 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3251 ) -> Self {
3252 Self {
3253 stub,
3254 request: R::default(),
3255 options: gax::options::RequestOptions::default(),
3256 }
3257 }
3258 }
3259
3260 #[derive(Clone, Debug)]
3277 pub struct CreateRule(RequestBuilder<crate::model::CreateRuleRequest>);
3278
3279 impl CreateRule {
3280 pub(crate) fn new(
3281 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3282 ) -> Self {
3283 Self(RequestBuilder::new(stub))
3284 }
3285
3286 pub fn with_request<V: Into<crate::model::CreateRuleRequest>>(mut self, v: V) -> Self {
3288 self.0.request = v.into();
3289 self
3290 }
3291
3292 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3294 self.0.options = v.into();
3295 self
3296 }
3297
3298 pub async fn send(self) -> Result<crate::model::Rule> {
3300 (*self.0.stub)
3301 .create_rule(self.0.request, self.0.options)
3302 .await
3303 .map(gax::response::Response::into_body)
3304 }
3305
3306 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3310 self.0.request.parent = v.into();
3311 self
3312 }
3313
3314 pub fn set_rule<T>(mut self, v: T) -> Self
3318 where
3319 T: std::convert::Into<crate::model::Rule>,
3320 {
3321 self.0.request.rule = std::option::Option::Some(v.into());
3322 self
3323 }
3324
3325 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3329 where
3330 T: std::convert::Into<crate::model::Rule>,
3331 {
3332 self.0.request.rule = v.map(|x| x.into());
3333 self
3334 }
3335 }
3336
3337 #[doc(hidden)]
3338 impl gax::options::internal::RequestBuilder for CreateRule {
3339 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3340 &mut self.0.options
3341 }
3342 }
3343
3344 #[derive(Clone, Debug)]
3361 pub struct GetRule(RequestBuilder<crate::model::GetRuleRequest>);
3362
3363 impl GetRule {
3364 pub(crate) fn new(
3365 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3366 ) -> Self {
3367 Self(RequestBuilder::new(stub))
3368 }
3369
3370 pub fn with_request<V: Into<crate::model::GetRuleRequest>>(mut self, v: V) -> Self {
3372 self.0.request = v.into();
3373 self
3374 }
3375
3376 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3378 self.0.options = v.into();
3379 self
3380 }
3381
3382 pub async fn send(self) -> Result<crate::model::Rule> {
3384 (*self.0.stub)
3385 .get_rule(self.0.request, self.0.options)
3386 .await
3387 .map(gax::response::Response::into_body)
3388 }
3389
3390 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3394 self.0.request.name = v.into();
3395 self
3396 }
3397
3398 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
3400 self.0.request.view = v.into();
3401 self
3402 }
3403 }
3404
3405 #[doc(hidden)]
3406 impl gax::options::internal::RequestBuilder for GetRule {
3407 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3408 &mut self.0.options
3409 }
3410 }
3411
3412 #[derive(Clone, Debug)]
3433 pub struct ListRules(RequestBuilder<crate::model::ListRulesRequest>);
3434
3435 impl ListRules {
3436 pub(crate) fn new(
3437 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3438 ) -> Self {
3439 Self(RequestBuilder::new(stub))
3440 }
3441
3442 pub fn with_request<V: Into<crate::model::ListRulesRequest>>(mut self, v: V) -> Self {
3444 self.0.request = v.into();
3445 self
3446 }
3447
3448 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3450 self.0.options = v.into();
3451 self
3452 }
3453
3454 pub async fn send(self) -> Result<crate::model::ListRulesResponse> {
3456 (*self.0.stub)
3457 .list_rules(self.0.request, self.0.options)
3458 .await
3459 .map(gax::response::Response::into_body)
3460 }
3461
3462 pub fn by_page(
3464 self,
3465 ) -> impl gax::paginator::Paginator<crate::model::ListRulesResponse, gax::error::Error>
3466 {
3467 use std::clone::Clone;
3468 let token = self.0.request.page_token.clone();
3469 let execute = move |token: String| {
3470 let mut builder = self.clone();
3471 builder.0.request = builder.0.request.set_page_token(token);
3472 builder.send()
3473 };
3474 gax::paginator::internal::new_paginator(token, execute)
3475 }
3476
3477 pub fn by_item(
3479 self,
3480 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRulesResponse, gax::error::Error>
3481 {
3482 use gax::paginator::Paginator;
3483 self.by_page().items()
3484 }
3485
3486 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3490 self.0.request.parent = v.into();
3491 self
3492 }
3493
3494 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3496 self.0.request.page_size = v.into();
3497 self
3498 }
3499
3500 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3502 self.0.request.page_token = v.into();
3503 self
3504 }
3505
3506 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
3508 self.0.request.view = v.into();
3509 self
3510 }
3511
3512 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3514 self.0.request.filter = v.into();
3515 self
3516 }
3517 }
3518
3519 #[doc(hidden)]
3520 impl gax::options::internal::RequestBuilder for ListRules {
3521 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3522 &mut self.0.options
3523 }
3524 }
3525
3526 #[derive(Clone, Debug)]
3543 pub struct UpdateRule(RequestBuilder<crate::model::UpdateRuleRequest>);
3544
3545 impl UpdateRule {
3546 pub(crate) fn new(
3547 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3548 ) -> Self {
3549 Self(RequestBuilder::new(stub))
3550 }
3551
3552 pub fn with_request<V: Into<crate::model::UpdateRuleRequest>>(mut self, v: V) -> Self {
3554 self.0.request = v.into();
3555 self
3556 }
3557
3558 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3560 self.0.options = v.into();
3561 self
3562 }
3563
3564 pub async fn send(self) -> Result<crate::model::Rule> {
3566 (*self.0.stub)
3567 .update_rule(self.0.request, self.0.options)
3568 .await
3569 .map(gax::response::Response::into_body)
3570 }
3571
3572 pub fn set_rule<T>(mut self, v: T) -> Self
3576 where
3577 T: std::convert::Into<crate::model::Rule>,
3578 {
3579 self.0.request.rule = std::option::Option::Some(v.into());
3580 self
3581 }
3582
3583 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3587 where
3588 T: std::convert::Into<crate::model::Rule>,
3589 {
3590 self.0.request.rule = v.map(|x| x.into());
3591 self
3592 }
3593
3594 pub fn set_update_mask<T>(mut self, v: T) -> Self
3596 where
3597 T: std::convert::Into<wkt::FieldMask>,
3598 {
3599 self.0.request.update_mask = std::option::Option::Some(v.into());
3600 self
3601 }
3602
3603 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3605 where
3606 T: std::convert::Into<wkt::FieldMask>,
3607 {
3608 self.0.request.update_mask = v.map(|x| x.into());
3609 self
3610 }
3611 }
3612
3613 #[doc(hidden)]
3614 impl gax::options::internal::RequestBuilder for UpdateRule {
3615 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3616 &mut self.0.options
3617 }
3618 }
3619
3620 #[derive(Clone, Debug)]
3637 pub struct DeleteRule(RequestBuilder<crate::model::DeleteRuleRequest>);
3638
3639 impl DeleteRule {
3640 pub(crate) fn new(
3641 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3642 ) -> Self {
3643 Self(RequestBuilder::new(stub))
3644 }
3645
3646 pub fn with_request<V: Into<crate::model::DeleteRuleRequest>>(mut self, v: V) -> Self {
3648 self.0.request = v.into();
3649 self
3650 }
3651
3652 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3654 self.0.options = v.into();
3655 self
3656 }
3657
3658 pub async fn send(self) -> Result<()> {
3660 (*self.0.stub)
3661 .delete_rule(self.0.request, self.0.options)
3662 .await
3663 .map(gax::response::Response::into_body)
3664 }
3665
3666 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3670 self.0.request.name = v.into();
3671 self
3672 }
3673
3674 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3676 self.0.request.force = v.into();
3677 self
3678 }
3679 }
3680
3681 #[doc(hidden)]
3682 impl gax::options::internal::RequestBuilder for DeleteRule {
3683 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3684 &mut self.0.options
3685 }
3686 }
3687
3688 #[derive(Clone, Debug)]
3709 pub struct ListRuleRevisions(RequestBuilder<crate::model::ListRuleRevisionsRequest>);
3710
3711 impl ListRuleRevisions {
3712 pub(crate) fn new(
3713 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3714 ) -> Self {
3715 Self(RequestBuilder::new(stub))
3716 }
3717
3718 pub fn with_request<V: Into<crate::model::ListRuleRevisionsRequest>>(
3720 mut self,
3721 v: V,
3722 ) -> Self {
3723 self.0.request = v.into();
3724 self
3725 }
3726
3727 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3729 self.0.options = v.into();
3730 self
3731 }
3732
3733 pub async fn send(self) -> Result<crate::model::ListRuleRevisionsResponse> {
3735 (*self.0.stub)
3736 .list_rule_revisions(self.0.request, self.0.options)
3737 .await
3738 .map(gax::response::Response::into_body)
3739 }
3740
3741 pub fn by_page(
3743 self,
3744 ) -> impl gax::paginator::Paginator<crate::model::ListRuleRevisionsResponse, gax::error::Error>
3745 {
3746 use std::clone::Clone;
3747 let token = self.0.request.page_token.clone();
3748 let execute = move |token: String| {
3749 let mut builder = self.clone();
3750 builder.0.request = builder.0.request.set_page_token(token);
3751 builder.send()
3752 };
3753 gax::paginator::internal::new_paginator(token, execute)
3754 }
3755
3756 pub fn by_item(
3758 self,
3759 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRuleRevisionsResponse, gax::error::Error>
3760 {
3761 use gax::paginator::Paginator;
3762 self.by_page().items()
3763 }
3764
3765 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3769 self.0.request.name = v.into();
3770 self
3771 }
3772
3773 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3775 self.0.request.page_size = v.into();
3776 self
3777 }
3778
3779 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3781 self.0.request.page_token = v.into();
3782 self
3783 }
3784
3785 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
3787 self.0.request.view = v.into();
3788 self
3789 }
3790 }
3791
3792 #[doc(hidden)]
3793 impl gax::options::internal::RequestBuilder for ListRuleRevisions {
3794 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3795 &mut self.0.options
3796 }
3797 }
3798
3799 #[derive(Clone, Debug)]
3817 pub struct CreateRetrohunt(RequestBuilder<crate::model::CreateRetrohuntRequest>);
3818
3819 impl CreateRetrohunt {
3820 pub(crate) fn new(
3821 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3822 ) -> Self {
3823 Self(RequestBuilder::new(stub))
3824 }
3825
3826 pub fn with_request<V: Into<crate::model::CreateRetrohuntRequest>>(mut self, v: V) -> Self {
3828 self.0.request = v.into();
3829 self
3830 }
3831
3832 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3834 self.0.options = v.into();
3835 self
3836 }
3837
3838 pub async fn send(self) -> Result<longrunning::model::Operation> {
3845 (*self.0.stub)
3846 .create_retrohunt(self.0.request, self.0.options)
3847 .await
3848 .map(gax::response::Response::into_body)
3849 }
3850
3851 pub fn poller(
3853 self,
3854 ) -> impl lro::Poller<crate::model::Retrohunt, crate::model::RetrohuntMetadata> {
3855 type Operation =
3856 lro::internal::Operation<crate::model::Retrohunt, crate::model::RetrohuntMetadata>;
3857 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3858 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3859
3860 let stub = self.0.stub.clone();
3861 let mut options = self.0.options.clone();
3862 options.set_retry_policy(gax::retry_policy::NeverRetry);
3863 let query = move |name| {
3864 let stub = stub.clone();
3865 let options = options.clone();
3866 async {
3867 let op = GetOperation::new(stub)
3868 .set_name(name)
3869 .with_options(options)
3870 .send()
3871 .await?;
3872 Ok(Operation::new(op))
3873 }
3874 };
3875
3876 let start = move || async {
3877 let op = self.send().await?;
3878 Ok(Operation::new(op))
3879 };
3880
3881 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3882 }
3883
3884 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3888 self.0.request.parent = v.into();
3889 self
3890 }
3891
3892 pub fn set_retrohunt<T>(mut self, v: T) -> Self
3896 where
3897 T: std::convert::Into<crate::model::Retrohunt>,
3898 {
3899 self.0.request.retrohunt = std::option::Option::Some(v.into());
3900 self
3901 }
3902
3903 pub fn set_or_clear_retrohunt<T>(mut self, v: std::option::Option<T>) -> Self
3907 where
3908 T: std::convert::Into<crate::model::Retrohunt>,
3909 {
3910 self.0.request.retrohunt = v.map(|x| x.into());
3911 self
3912 }
3913 }
3914
3915 #[doc(hidden)]
3916 impl gax::options::internal::RequestBuilder for CreateRetrohunt {
3917 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3918 &mut self.0.options
3919 }
3920 }
3921
3922 #[derive(Clone, Debug)]
3939 pub struct GetRetrohunt(RequestBuilder<crate::model::GetRetrohuntRequest>);
3940
3941 impl GetRetrohunt {
3942 pub(crate) fn new(
3943 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3944 ) -> Self {
3945 Self(RequestBuilder::new(stub))
3946 }
3947
3948 pub fn with_request<V: Into<crate::model::GetRetrohuntRequest>>(mut self, v: V) -> Self {
3950 self.0.request = v.into();
3951 self
3952 }
3953
3954 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3956 self.0.options = v.into();
3957 self
3958 }
3959
3960 pub async fn send(self) -> Result<crate::model::Retrohunt> {
3962 (*self.0.stub)
3963 .get_retrohunt(self.0.request, self.0.options)
3964 .await
3965 .map(gax::response::Response::into_body)
3966 }
3967
3968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3972 self.0.request.name = v.into();
3973 self
3974 }
3975 }
3976
3977 #[doc(hidden)]
3978 impl gax::options::internal::RequestBuilder for GetRetrohunt {
3979 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3980 &mut self.0.options
3981 }
3982 }
3983
3984 #[derive(Clone, Debug)]
4005 pub struct ListRetrohunts(RequestBuilder<crate::model::ListRetrohuntsRequest>);
4006
4007 impl ListRetrohunts {
4008 pub(crate) fn new(
4009 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4010 ) -> Self {
4011 Self(RequestBuilder::new(stub))
4012 }
4013
4014 pub fn with_request<V: Into<crate::model::ListRetrohuntsRequest>>(mut self, v: V) -> Self {
4016 self.0.request = v.into();
4017 self
4018 }
4019
4020 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4022 self.0.options = v.into();
4023 self
4024 }
4025
4026 pub async fn send(self) -> Result<crate::model::ListRetrohuntsResponse> {
4028 (*self.0.stub)
4029 .list_retrohunts(self.0.request, self.0.options)
4030 .await
4031 .map(gax::response::Response::into_body)
4032 }
4033
4034 pub fn by_page(
4036 self,
4037 ) -> impl gax::paginator::Paginator<crate::model::ListRetrohuntsResponse, gax::error::Error>
4038 {
4039 use std::clone::Clone;
4040 let token = self.0.request.page_token.clone();
4041 let execute = move |token: String| {
4042 let mut builder = self.clone();
4043 builder.0.request = builder.0.request.set_page_token(token);
4044 builder.send()
4045 };
4046 gax::paginator::internal::new_paginator(token, execute)
4047 }
4048
4049 pub fn by_item(
4051 self,
4052 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRetrohuntsResponse, gax::error::Error>
4053 {
4054 use gax::paginator::Paginator;
4055 self.by_page().items()
4056 }
4057
4058 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4062 self.0.request.parent = v.into();
4063 self
4064 }
4065
4066 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4068 self.0.request.page_size = v.into();
4069 self
4070 }
4071
4072 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4074 self.0.request.page_token = v.into();
4075 self
4076 }
4077
4078 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4080 self.0.request.filter = v.into();
4081 self
4082 }
4083 }
4084
4085 #[doc(hidden)]
4086 impl gax::options::internal::RequestBuilder for ListRetrohunts {
4087 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4088 &mut self.0.options
4089 }
4090 }
4091
4092 #[derive(Clone, Debug)]
4109 pub struct GetRuleDeployment(RequestBuilder<crate::model::GetRuleDeploymentRequest>);
4110
4111 impl GetRuleDeployment {
4112 pub(crate) fn new(
4113 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4114 ) -> Self {
4115 Self(RequestBuilder::new(stub))
4116 }
4117
4118 pub fn with_request<V: Into<crate::model::GetRuleDeploymentRequest>>(
4120 mut self,
4121 v: V,
4122 ) -> Self {
4123 self.0.request = v.into();
4124 self
4125 }
4126
4127 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4129 self.0.options = v.into();
4130 self
4131 }
4132
4133 pub async fn send(self) -> Result<crate::model::RuleDeployment> {
4135 (*self.0.stub)
4136 .get_rule_deployment(self.0.request, self.0.options)
4137 .await
4138 .map(gax::response::Response::into_body)
4139 }
4140
4141 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4145 self.0.request.name = v.into();
4146 self
4147 }
4148 }
4149
4150 #[doc(hidden)]
4151 impl gax::options::internal::RequestBuilder for GetRuleDeployment {
4152 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4153 &mut self.0.options
4154 }
4155 }
4156
4157 #[derive(Clone, Debug)]
4178 pub struct ListRuleDeployments(RequestBuilder<crate::model::ListRuleDeploymentsRequest>);
4179
4180 impl ListRuleDeployments {
4181 pub(crate) fn new(
4182 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4183 ) -> Self {
4184 Self(RequestBuilder::new(stub))
4185 }
4186
4187 pub fn with_request<V: Into<crate::model::ListRuleDeploymentsRequest>>(
4189 mut self,
4190 v: V,
4191 ) -> Self {
4192 self.0.request = v.into();
4193 self
4194 }
4195
4196 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4198 self.0.options = v.into();
4199 self
4200 }
4201
4202 pub async fn send(self) -> Result<crate::model::ListRuleDeploymentsResponse> {
4204 (*self.0.stub)
4205 .list_rule_deployments(self.0.request, self.0.options)
4206 .await
4207 .map(gax::response::Response::into_body)
4208 }
4209
4210 pub fn by_page(
4212 self,
4213 ) -> impl gax::paginator::Paginator<crate::model::ListRuleDeploymentsResponse, gax::error::Error>
4214 {
4215 use std::clone::Clone;
4216 let token = self.0.request.page_token.clone();
4217 let execute = move |token: String| {
4218 let mut builder = self.clone();
4219 builder.0.request = builder.0.request.set_page_token(token);
4220 builder.send()
4221 };
4222 gax::paginator::internal::new_paginator(token, execute)
4223 }
4224
4225 pub fn by_item(
4227 self,
4228 ) -> impl gax::paginator::ItemPaginator<
4229 crate::model::ListRuleDeploymentsResponse,
4230 gax::error::Error,
4231 > {
4232 use gax::paginator::Paginator;
4233 self.by_page().items()
4234 }
4235
4236 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4240 self.0.request.parent = v.into();
4241 self
4242 }
4243
4244 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4246 self.0.request.page_size = v.into();
4247 self
4248 }
4249
4250 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4252 self.0.request.page_token = v.into();
4253 self
4254 }
4255
4256 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4258 self.0.request.filter = v.into();
4259 self
4260 }
4261 }
4262
4263 #[doc(hidden)]
4264 impl gax::options::internal::RequestBuilder for ListRuleDeployments {
4265 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4266 &mut self.0.options
4267 }
4268 }
4269
4270 #[derive(Clone, Debug)]
4287 pub struct UpdateRuleDeployment(RequestBuilder<crate::model::UpdateRuleDeploymentRequest>);
4288
4289 impl UpdateRuleDeployment {
4290 pub(crate) fn new(
4291 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4292 ) -> Self {
4293 Self(RequestBuilder::new(stub))
4294 }
4295
4296 pub fn with_request<V: Into<crate::model::UpdateRuleDeploymentRequest>>(
4298 mut self,
4299 v: V,
4300 ) -> Self {
4301 self.0.request = v.into();
4302 self
4303 }
4304
4305 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4307 self.0.options = v.into();
4308 self
4309 }
4310
4311 pub async fn send(self) -> Result<crate::model::RuleDeployment> {
4313 (*self.0.stub)
4314 .update_rule_deployment(self.0.request, self.0.options)
4315 .await
4316 .map(gax::response::Response::into_body)
4317 }
4318
4319 pub fn set_rule_deployment<T>(mut self, v: T) -> Self
4323 where
4324 T: std::convert::Into<crate::model::RuleDeployment>,
4325 {
4326 self.0.request.rule_deployment = std::option::Option::Some(v.into());
4327 self
4328 }
4329
4330 pub fn set_or_clear_rule_deployment<T>(mut self, v: std::option::Option<T>) -> Self
4334 where
4335 T: std::convert::Into<crate::model::RuleDeployment>,
4336 {
4337 self.0.request.rule_deployment = v.map(|x| x.into());
4338 self
4339 }
4340
4341 pub fn set_update_mask<T>(mut self, v: T) -> Self
4345 where
4346 T: std::convert::Into<wkt::FieldMask>,
4347 {
4348 self.0.request.update_mask = std::option::Option::Some(v.into());
4349 self
4350 }
4351
4352 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4356 where
4357 T: std::convert::Into<wkt::FieldMask>,
4358 {
4359 self.0.request.update_mask = v.map(|x| x.into());
4360 self
4361 }
4362 }
4363
4364 #[doc(hidden)]
4365 impl gax::options::internal::RequestBuilder for UpdateRuleDeployment {
4366 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4367 &mut self.0.options
4368 }
4369 }
4370
4371 #[derive(Clone, Debug)]
4392 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4393
4394 impl ListOperations {
4395 pub(crate) fn new(
4396 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4397 ) -> Self {
4398 Self(RequestBuilder::new(stub))
4399 }
4400
4401 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4403 mut self,
4404 v: V,
4405 ) -> Self {
4406 self.0.request = v.into();
4407 self
4408 }
4409
4410 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4412 self.0.options = v.into();
4413 self
4414 }
4415
4416 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4418 (*self.0.stub)
4419 .list_operations(self.0.request, self.0.options)
4420 .await
4421 .map(gax::response::Response::into_body)
4422 }
4423
4424 pub fn by_page(
4426 self,
4427 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4428 {
4429 use std::clone::Clone;
4430 let token = self.0.request.page_token.clone();
4431 let execute = move |token: String| {
4432 let mut builder = self.clone();
4433 builder.0.request = builder.0.request.set_page_token(token);
4434 builder.send()
4435 };
4436 gax::paginator::internal::new_paginator(token, execute)
4437 }
4438
4439 pub fn by_item(
4441 self,
4442 ) -> impl gax::paginator::ItemPaginator<
4443 longrunning::model::ListOperationsResponse,
4444 gax::error::Error,
4445 > {
4446 use gax::paginator::Paginator;
4447 self.by_page().items()
4448 }
4449
4450 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4452 self.0.request.name = v.into();
4453 self
4454 }
4455
4456 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4458 self.0.request.filter = v.into();
4459 self
4460 }
4461
4462 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4464 self.0.request.page_size = v.into();
4465 self
4466 }
4467
4468 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4470 self.0.request.page_token = v.into();
4471 self
4472 }
4473
4474 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4476 self.0.request.return_partial_success = v.into();
4477 self
4478 }
4479 }
4480
4481 #[doc(hidden)]
4482 impl gax::options::internal::RequestBuilder for ListOperations {
4483 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4484 &mut self.0.options
4485 }
4486 }
4487
4488 #[derive(Clone, Debug)]
4505 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4506
4507 impl GetOperation {
4508 pub(crate) fn new(
4509 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4510 ) -> Self {
4511 Self(RequestBuilder::new(stub))
4512 }
4513
4514 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4516 mut self,
4517 v: V,
4518 ) -> Self {
4519 self.0.request = v.into();
4520 self
4521 }
4522
4523 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4525 self.0.options = v.into();
4526 self
4527 }
4528
4529 pub async fn send(self) -> Result<longrunning::model::Operation> {
4531 (*self.0.stub)
4532 .get_operation(self.0.request, self.0.options)
4533 .await
4534 .map(gax::response::Response::into_body)
4535 }
4536
4537 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4539 self.0.request.name = v.into();
4540 self
4541 }
4542 }
4543
4544 #[doc(hidden)]
4545 impl gax::options::internal::RequestBuilder for GetOperation {
4546 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4547 &mut self.0.options
4548 }
4549 }
4550
4551 #[derive(Clone, Debug)]
4568 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4569
4570 impl DeleteOperation {
4571 pub(crate) fn new(
4572 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4573 ) -> Self {
4574 Self(RequestBuilder::new(stub))
4575 }
4576
4577 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4579 mut self,
4580 v: V,
4581 ) -> Self {
4582 self.0.request = v.into();
4583 self
4584 }
4585
4586 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4588 self.0.options = v.into();
4589 self
4590 }
4591
4592 pub async fn send(self) -> Result<()> {
4594 (*self.0.stub)
4595 .delete_operation(self.0.request, self.0.options)
4596 .await
4597 .map(gax::response::Response::into_body)
4598 }
4599
4600 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4602 self.0.request.name = v.into();
4603 self
4604 }
4605 }
4606
4607 #[doc(hidden)]
4608 impl gax::options::internal::RequestBuilder for DeleteOperation {
4609 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4610 &mut self.0.options
4611 }
4612 }
4613
4614 #[derive(Clone, Debug)]
4631 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4632
4633 impl CancelOperation {
4634 pub(crate) fn new(
4635 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4636 ) -> Self {
4637 Self(RequestBuilder::new(stub))
4638 }
4639
4640 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4642 mut self,
4643 v: V,
4644 ) -> Self {
4645 self.0.request = v.into();
4646 self
4647 }
4648
4649 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4651 self.0.options = v.into();
4652 self
4653 }
4654
4655 pub async fn send(self) -> Result<()> {
4657 (*self.0.stub)
4658 .cancel_operation(self.0.request, self.0.options)
4659 .await
4660 .map(gax::response::Response::into_body)
4661 }
4662
4663 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4665 self.0.request.name = v.into();
4666 self
4667 }
4668 }
4669
4670 #[doc(hidden)]
4671 impl gax::options::internal::RequestBuilder for CancelOperation {
4672 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4673 &mut self.0.options
4674 }
4675 }
4676}