1pub mod api_hub {
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::ApiHub;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = ApiHub;
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::ApiHub>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: gax::options::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
90 pub struct CreateApi(RequestBuilder<crate::model::CreateApiRequest>);
91
92 impl CreateApi {
93 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
94 Self(RequestBuilder::new(stub))
95 }
96
97 pub fn with_request<V: Into<crate::model::CreateApiRequest>>(mut self, v: V) -> Self {
99 self.0.request = v.into();
100 self
101 }
102
103 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
105 self.0.options = v.into();
106 self
107 }
108
109 pub async fn send(self) -> Result<crate::model::Api> {
111 (*self.0.stub)
112 .create_api(self.0.request, self.0.options)
113 .await
114 .map(gax::response::Response::into_body)
115 }
116
117 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
121 self.0.request.parent = v.into();
122 self
123 }
124
125 pub fn set_api_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
127 self.0.request.api_id = v.into();
128 self
129 }
130
131 pub fn set_api<T>(mut self, v: T) -> Self
135 where
136 T: std::convert::Into<crate::model::Api>,
137 {
138 self.0.request.api = std::option::Option::Some(v.into());
139 self
140 }
141
142 pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
146 where
147 T: std::convert::Into<crate::model::Api>,
148 {
149 self.0.request.api = v.map(|x| x.into());
150 self
151 }
152 }
153
154 #[doc(hidden)]
155 impl gax::options::internal::RequestBuilder for CreateApi {
156 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
157 &mut self.0.options
158 }
159 }
160
161 #[derive(Clone, Debug)]
179 pub struct GetApi(RequestBuilder<crate::model::GetApiRequest>);
180
181 impl GetApi {
182 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
183 Self(RequestBuilder::new(stub))
184 }
185
186 pub fn with_request<V: Into<crate::model::GetApiRequest>>(mut self, v: V) -> Self {
188 self.0.request = v.into();
189 self
190 }
191
192 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
194 self.0.options = v.into();
195 self
196 }
197
198 pub async fn send(self) -> Result<crate::model::Api> {
200 (*self.0.stub)
201 .get_api(self.0.request, self.0.options)
202 .await
203 .map(gax::response::Response::into_body)
204 }
205
206 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
210 self.0.request.name = v.into();
211 self
212 }
213 }
214
215 #[doc(hidden)]
216 impl gax::options::internal::RequestBuilder for GetApi {
217 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
218 &mut self.0.options
219 }
220 }
221
222 #[derive(Clone, Debug)]
244 pub struct ListApis(RequestBuilder<crate::model::ListApisRequest>);
245
246 impl ListApis {
247 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
248 Self(RequestBuilder::new(stub))
249 }
250
251 pub fn with_request<V: Into<crate::model::ListApisRequest>>(mut self, v: V) -> Self {
253 self.0.request = v.into();
254 self
255 }
256
257 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
259 self.0.options = v.into();
260 self
261 }
262
263 pub async fn send(self) -> Result<crate::model::ListApisResponse> {
265 (*self.0.stub)
266 .list_apis(self.0.request, self.0.options)
267 .await
268 .map(gax::response::Response::into_body)
269 }
270
271 pub fn by_page(
273 self,
274 ) -> impl gax::paginator::Paginator<crate::model::ListApisResponse, gax::error::Error>
275 {
276 use std::clone::Clone;
277 let token = self.0.request.page_token.clone();
278 let execute = move |token: String| {
279 let mut builder = self.clone();
280 builder.0.request = builder.0.request.set_page_token(token);
281 builder.send()
282 };
283 gax::paginator::internal::new_paginator(token, execute)
284 }
285
286 pub fn by_item(
288 self,
289 ) -> impl gax::paginator::ItemPaginator<crate::model::ListApisResponse, gax::error::Error>
290 {
291 use gax::paginator::Paginator;
292 self.by_page().items()
293 }
294
295 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
299 self.0.request.parent = v.into();
300 self
301 }
302
303 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
305 self.0.request.filter = v.into();
306 self
307 }
308
309 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
311 self.0.request.page_size = v.into();
312 self
313 }
314
315 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
317 self.0.request.page_token = v.into();
318 self
319 }
320 }
321
322 #[doc(hidden)]
323 impl gax::options::internal::RequestBuilder for ListApis {
324 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
325 &mut self.0.options
326 }
327 }
328
329 #[derive(Clone, Debug)]
347 pub struct UpdateApi(RequestBuilder<crate::model::UpdateApiRequest>);
348
349 impl UpdateApi {
350 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
351 Self(RequestBuilder::new(stub))
352 }
353
354 pub fn with_request<V: Into<crate::model::UpdateApiRequest>>(mut self, v: V) -> Self {
356 self.0.request = v.into();
357 self
358 }
359
360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
362 self.0.options = v.into();
363 self
364 }
365
366 pub async fn send(self) -> Result<crate::model::Api> {
368 (*self.0.stub)
369 .update_api(self.0.request, self.0.options)
370 .await
371 .map(gax::response::Response::into_body)
372 }
373
374 pub fn set_api<T>(mut self, v: T) -> Self
378 where
379 T: std::convert::Into<crate::model::Api>,
380 {
381 self.0.request.api = std::option::Option::Some(v.into());
382 self
383 }
384
385 pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
389 where
390 T: std::convert::Into<crate::model::Api>,
391 {
392 self.0.request.api = v.map(|x| x.into());
393 self
394 }
395
396 pub fn set_update_mask<T>(mut self, v: T) -> Self
400 where
401 T: std::convert::Into<wkt::FieldMask>,
402 {
403 self.0.request.update_mask = std::option::Option::Some(v.into());
404 self
405 }
406
407 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
411 where
412 T: std::convert::Into<wkt::FieldMask>,
413 {
414 self.0.request.update_mask = v.map(|x| x.into());
415 self
416 }
417 }
418
419 #[doc(hidden)]
420 impl gax::options::internal::RequestBuilder for UpdateApi {
421 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
422 &mut self.0.options
423 }
424 }
425
426 #[derive(Clone, Debug)]
444 pub struct DeleteApi(RequestBuilder<crate::model::DeleteApiRequest>);
445
446 impl DeleteApi {
447 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
448 Self(RequestBuilder::new(stub))
449 }
450
451 pub fn with_request<V: Into<crate::model::DeleteApiRequest>>(mut self, v: V) -> Self {
453 self.0.request = v.into();
454 self
455 }
456
457 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
459 self.0.options = v.into();
460 self
461 }
462
463 pub async fn send(self) -> Result<()> {
465 (*self.0.stub)
466 .delete_api(self.0.request, self.0.options)
467 .await
468 .map(gax::response::Response::into_body)
469 }
470
471 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
475 self.0.request.name = v.into();
476 self
477 }
478
479 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
481 self.0.request.force = v.into();
482 self
483 }
484 }
485
486 #[doc(hidden)]
487 impl gax::options::internal::RequestBuilder for DeleteApi {
488 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
489 &mut self.0.options
490 }
491 }
492
493 #[derive(Clone, Debug)]
511 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
512
513 impl CreateVersion {
514 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
515 Self(RequestBuilder::new(stub))
516 }
517
518 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
520 self.0.request = v.into();
521 self
522 }
523
524 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
526 self.0.options = v.into();
527 self
528 }
529
530 pub async fn send(self) -> Result<crate::model::Version> {
532 (*self.0.stub)
533 .create_version(self.0.request, self.0.options)
534 .await
535 .map(gax::response::Response::into_body)
536 }
537
538 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
542 self.0.request.parent = v.into();
543 self
544 }
545
546 pub fn set_version_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
548 self.0.request.version_id = v.into();
549 self
550 }
551
552 pub fn set_version<T>(mut self, v: T) -> Self
556 where
557 T: std::convert::Into<crate::model::Version>,
558 {
559 self.0.request.version = std::option::Option::Some(v.into());
560 self
561 }
562
563 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
567 where
568 T: std::convert::Into<crate::model::Version>,
569 {
570 self.0.request.version = v.map(|x| x.into());
571 self
572 }
573 }
574
575 #[doc(hidden)]
576 impl gax::options::internal::RequestBuilder for CreateVersion {
577 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
578 &mut self.0.options
579 }
580 }
581
582 #[derive(Clone, Debug)]
600 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
601
602 impl GetVersion {
603 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
604 Self(RequestBuilder::new(stub))
605 }
606
607 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
609 self.0.request = v.into();
610 self
611 }
612
613 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
615 self.0.options = v.into();
616 self
617 }
618
619 pub async fn send(self) -> Result<crate::model::Version> {
621 (*self.0.stub)
622 .get_version(self.0.request, self.0.options)
623 .await
624 .map(gax::response::Response::into_body)
625 }
626
627 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
631 self.0.request.name = v.into();
632 self
633 }
634 }
635
636 #[doc(hidden)]
637 impl gax::options::internal::RequestBuilder for GetVersion {
638 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
639 &mut self.0.options
640 }
641 }
642
643 #[derive(Clone, Debug)]
665 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
666
667 impl ListVersions {
668 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
669 Self(RequestBuilder::new(stub))
670 }
671
672 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
674 self.0.request = v.into();
675 self
676 }
677
678 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
680 self.0.options = v.into();
681 self
682 }
683
684 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
686 (*self.0.stub)
687 .list_versions(self.0.request, self.0.options)
688 .await
689 .map(gax::response::Response::into_body)
690 }
691
692 pub fn by_page(
694 self,
695 ) -> impl gax::paginator::Paginator<crate::model::ListVersionsResponse, gax::error::Error>
696 {
697 use std::clone::Clone;
698 let token = self.0.request.page_token.clone();
699 let execute = move |token: String| {
700 let mut builder = self.clone();
701 builder.0.request = builder.0.request.set_page_token(token);
702 builder.send()
703 };
704 gax::paginator::internal::new_paginator(token, execute)
705 }
706
707 pub fn by_item(
709 self,
710 ) -> impl gax::paginator::ItemPaginator<crate::model::ListVersionsResponse, gax::error::Error>
711 {
712 use gax::paginator::Paginator;
713 self.by_page().items()
714 }
715
716 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.parent = v.into();
721 self
722 }
723
724 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
726 self.0.request.filter = v.into();
727 self
728 }
729
730 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
732 self.0.request.page_size = v.into();
733 self
734 }
735
736 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
738 self.0.request.page_token = v.into();
739 self
740 }
741 }
742
743 #[doc(hidden)]
744 impl gax::options::internal::RequestBuilder for ListVersions {
745 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
746 &mut self.0.options
747 }
748 }
749
750 #[derive(Clone, Debug)]
768 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
769
770 impl UpdateVersion {
771 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
772 Self(RequestBuilder::new(stub))
773 }
774
775 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
777 self.0.request = v.into();
778 self
779 }
780
781 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
783 self.0.options = v.into();
784 self
785 }
786
787 pub async fn send(self) -> Result<crate::model::Version> {
789 (*self.0.stub)
790 .update_version(self.0.request, self.0.options)
791 .await
792 .map(gax::response::Response::into_body)
793 }
794
795 pub fn set_version<T>(mut self, v: T) -> Self
799 where
800 T: std::convert::Into<crate::model::Version>,
801 {
802 self.0.request.version = std::option::Option::Some(v.into());
803 self
804 }
805
806 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
810 where
811 T: std::convert::Into<crate::model::Version>,
812 {
813 self.0.request.version = v.map(|x| x.into());
814 self
815 }
816
817 pub fn set_update_mask<T>(mut self, v: T) -> Self
821 where
822 T: std::convert::Into<wkt::FieldMask>,
823 {
824 self.0.request.update_mask = std::option::Option::Some(v.into());
825 self
826 }
827
828 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
832 where
833 T: std::convert::Into<wkt::FieldMask>,
834 {
835 self.0.request.update_mask = v.map(|x| x.into());
836 self
837 }
838 }
839
840 #[doc(hidden)]
841 impl gax::options::internal::RequestBuilder for UpdateVersion {
842 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
843 &mut self.0.options
844 }
845 }
846
847 #[derive(Clone, Debug)]
865 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
866
867 impl DeleteVersion {
868 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
869 Self(RequestBuilder::new(stub))
870 }
871
872 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
874 self.0.request = v.into();
875 self
876 }
877
878 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
880 self.0.options = v.into();
881 self
882 }
883
884 pub async fn send(self) -> Result<()> {
886 (*self.0.stub)
887 .delete_version(self.0.request, self.0.options)
888 .await
889 .map(gax::response::Response::into_body)
890 }
891
892 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
896 self.0.request.name = v.into();
897 self
898 }
899
900 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
902 self.0.request.force = v.into();
903 self
904 }
905 }
906
907 #[doc(hidden)]
908 impl gax::options::internal::RequestBuilder for DeleteVersion {
909 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
910 &mut self.0.options
911 }
912 }
913
914 #[derive(Clone, Debug)]
932 pub struct CreateSpec(RequestBuilder<crate::model::CreateSpecRequest>);
933
934 impl CreateSpec {
935 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
936 Self(RequestBuilder::new(stub))
937 }
938
939 pub fn with_request<V: Into<crate::model::CreateSpecRequest>>(mut self, v: V) -> Self {
941 self.0.request = v.into();
942 self
943 }
944
945 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
947 self.0.options = v.into();
948 self
949 }
950
951 pub async fn send(self) -> Result<crate::model::Spec> {
953 (*self.0.stub)
954 .create_spec(self.0.request, self.0.options)
955 .await
956 .map(gax::response::Response::into_body)
957 }
958
959 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
963 self.0.request.parent = v.into();
964 self
965 }
966
967 pub fn set_spec_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
969 self.0.request.spec_id = v.into();
970 self
971 }
972
973 pub fn set_spec<T>(mut self, v: T) -> Self
977 where
978 T: std::convert::Into<crate::model::Spec>,
979 {
980 self.0.request.spec = std::option::Option::Some(v.into());
981 self
982 }
983
984 pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
988 where
989 T: std::convert::Into<crate::model::Spec>,
990 {
991 self.0.request.spec = v.map(|x| x.into());
992 self
993 }
994 }
995
996 #[doc(hidden)]
997 impl gax::options::internal::RequestBuilder for CreateSpec {
998 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
999 &mut self.0.options
1000 }
1001 }
1002
1003 #[derive(Clone, Debug)]
1021 pub struct GetSpec(RequestBuilder<crate::model::GetSpecRequest>);
1022
1023 impl GetSpec {
1024 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1025 Self(RequestBuilder::new(stub))
1026 }
1027
1028 pub fn with_request<V: Into<crate::model::GetSpecRequest>>(mut self, v: V) -> Self {
1030 self.0.request = v.into();
1031 self
1032 }
1033
1034 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1036 self.0.options = v.into();
1037 self
1038 }
1039
1040 pub async fn send(self) -> Result<crate::model::Spec> {
1042 (*self.0.stub)
1043 .get_spec(self.0.request, self.0.options)
1044 .await
1045 .map(gax::response::Response::into_body)
1046 }
1047
1048 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052 self.0.request.name = v.into();
1053 self
1054 }
1055 }
1056
1057 #[doc(hidden)]
1058 impl gax::options::internal::RequestBuilder for GetSpec {
1059 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1060 &mut self.0.options
1061 }
1062 }
1063
1064 #[derive(Clone, Debug)]
1082 pub struct GetSpecContents(RequestBuilder<crate::model::GetSpecContentsRequest>);
1083
1084 impl GetSpecContents {
1085 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1086 Self(RequestBuilder::new(stub))
1087 }
1088
1089 pub fn with_request<V: Into<crate::model::GetSpecContentsRequest>>(mut self, v: V) -> Self {
1091 self.0.request = v.into();
1092 self
1093 }
1094
1095 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1097 self.0.options = v.into();
1098 self
1099 }
1100
1101 pub async fn send(self) -> Result<crate::model::SpecContents> {
1103 (*self.0.stub)
1104 .get_spec_contents(self.0.request, self.0.options)
1105 .await
1106 .map(gax::response::Response::into_body)
1107 }
1108
1109 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1113 self.0.request.name = v.into();
1114 self
1115 }
1116 }
1117
1118 #[doc(hidden)]
1119 impl gax::options::internal::RequestBuilder for GetSpecContents {
1120 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1121 &mut self.0.options
1122 }
1123 }
1124
1125 #[derive(Clone, Debug)]
1147 pub struct ListSpecs(RequestBuilder<crate::model::ListSpecsRequest>);
1148
1149 impl ListSpecs {
1150 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1151 Self(RequestBuilder::new(stub))
1152 }
1153
1154 pub fn with_request<V: Into<crate::model::ListSpecsRequest>>(mut self, v: V) -> Self {
1156 self.0.request = v.into();
1157 self
1158 }
1159
1160 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1162 self.0.options = v.into();
1163 self
1164 }
1165
1166 pub async fn send(self) -> Result<crate::model::ListSpecsResponse> {
1168 (*self.0.stub)
1169 .list_specs(self.0.request, self.0.options)
1170 .await
1171 .map(gax::response::Response::into_body)
1172 }
1173
1174 pub fn by_page(
1176 self,
1177 ) -> impl gax::paginator::Paginator<crate::model::ListSpecsResponse, gax::error::Error>
1178 {
1179 use std::clone::Clone;
1180 let token = self.0.request.page_token.clone();
1181 let execute = move |token: String| {
1182 let mut builder = self.clone();
1183 builder.0.request = builder.0.request.set_page_token(token);
1184 builder.send()
1185 };
1186 gax::paginator::internal::new_paginator(token, execute)
1187 }
1188
1189 pub fn by_item(
1191 self,
1192 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpecsResponse, gax::error::Error>
1193 {
1194 use gax::paginator::Paginator;
1195 self.by_page().items()
1196 }
1197
1198 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1202 self.0.request.parent = v.into();
1203 self
1204 }
1205
1206 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1208 self.0.request.filter = v.into();
1209 self
1210 }
1211
1212 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1214 self.0.request.page_size = v.into();
1215 self
1216 }
1217
1218 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1220 self.0.request.page_token = v.into();
1221 self
1222 }
1223 }
1224
1225 #[doc(hidden)]
1226 impl gax::options::internal::RequestBuilder for ListSpecs {
1227 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1228 &mut self.0.options
1229 }
1230 }
1231
1232 #[derive(Clone, Debug)]
1250 pub struct UpdateSpec(RequestBuilder<crate::model::UpdateSpecRequest>);
1251
1252 impl UpdateSpec {
1253 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1254 Self(RequestBuilder::new(stub))
1255 }
1256
1257 pub fn with_request<V: Into<crate::model::UpdateSpecRequest>>(mut self, v: V) -> Self {
1259 self.0.request = v.into();
1260 self
1261 }
1262
1263 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1265 self.0.options = v.into();
1266 self
1267 }
1268
1269 pub async fn send(self) -> Result<crate::model::Spec> {
1271 (*self.0.stub)
1272 .update_spec(self.0.request, self.0.options)
1273 .await
1274 .map(gax::response::Response::into_body)
1275 }
1276
1277 pub fn set_spec<T>(mut self, v: T) -> Self
1281 where
1282 T: std::convert::Into<crate::model::Spec>,
1283 {
1284 self.0.request.spec = std::option::Option::Some(v.into());
1285 self
1286 }
1287
1288 pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
1292 where
1293 T: std::convert::Into<crate::model::Spec>,
1294 {
1295 self.0.request.spec = v.map(|x| x.into());
1296 self
1297 }
1298
1299 pub fn set_update_mask<T>(mut self, v: T) -> Self
1303 where
1304 T: std::convert::Into<wkt::FieldMask>,
1305 {
1306 self.0.request.update_mask = std::option::Option::Some(v.into());
1307 self
1308 }
1309
1310 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1314 where
1315 T: std::convert::Into<wkt::FieldMask>,
1316 {
1317 self.0.request.update_mask = v.map(|x| x.into());
1318 self
1319 }
1320 }
1321
1322 #[doc(hidden)]
1323 impl gax::options::internal::RequestBuilder for UpdateSpec {
1324 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1325 &mut self.0.options
1326 }
1327 }
1328
1329 #[derive(Clone, Debug)]
1347 pub struct DeleteSpec(RequestBuilder<crate::model::DeleteSpecRequest>);
1348
1349 impl DeleteSpec {
1350 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1351 Self(RequestBuilder::new(stub))
1352 }
1353
1354 pub fn with_request<V: Into<crate::model::DeleteSpecRequest>>(mut self, v: V) -> Self {
1356 self.0.request = v.into();
1357 self
1358 }
1359
1360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1362 self.0.options = v.into();
1363 self
1364 }
1365
1366 pub async fn send(self) -> Result<()> {
1368 (*self.0.stub)
1369 .delete_spec(self.0.request, self.0.options)
1370 .await
1371 .map(gax::response::Response::into_body)
1372 }
1373
1374 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1378 self.0.request.name = v.into();
1379 self
1380 }
1381 }
1382
1383 #[doc(hidden)]
1384 impl gax::options::internal::RequestBuilder for DeleteSpec {
1385 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1386 &mut self.0.options
1387 }
1388 }
1389
1390 #[derive(Clone, Debug)]
1408 pub struct CreateApiOperation(RequestBuilder<crate::model::CreateApiOperationRequest>);
1409
1410 impl CreateApiOperation {
1411 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1412 Self(RequestBuilder::new(stub))
1413 }
1414
1415 pub fn with_request<V: Into<crate::model::CreateApiOperationRequest>>(
1417 mut self,
1418 v: V,
1419 ) -> Self {
1420 self.0.request = v.into();
1421 self
1422 }
1423
1424 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1426 self.0.options = v.into();
1427 self
1428 }
1429
1430 pub async fn send(self) -> Result<crate::model::ApiOperation> {
1432 (*self.0.stub)
1433 .create_api_operation(self.0.request, self.0.options)
1434 .await
1435 .map(gax::response::Response::into_body)
1436 }
1437
1438 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1442 self.0.request.parent = v.into();
1443 self
1444 }
1445
1446 pub fn set_api_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1448 self.0.request.api_operation_id = v.into();
1449 self
1450 }
1451
1452 pub fn set_api_operation<T>(mut self, v: T) -> Self
1456 where
1457 T: std::convert::Into<crate::model::ApiOperation>,
1458 {
1459 self.0.request.api_operation = std::option::Option::Some(v.into());
1460 self
1461 }
1462
1463 pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
1467 where
1468 T: std::convert::Into<crate::model::ApiOperation>,
1469 {
1470 self.0.request.api_operation = v.map(|x| x.into());
1471 self
1472 }
1473 }
1474
1475 #[doc(hidden)]
1476 impl gax::options::internal::RequestBuilder for CreateApiOperation {
1477 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1478 &mut self.0.options
1479 }
1480 }
1481
1482 #[derive(Clone, Debug)]
1500 pub struct GetApiOperation(RequestBuilder<crate::model::GetApiOperationRequest>);
1501
1502 impl GetApiOperation {
1503 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1504 Self(RequestBuilder::new(stub))
1505 }
1506
1507 pub fn with_request<V: Into<crate::model::GetApiOperationRequest>>(mut self, v: V) -> Self {
1509 self.0.request = v.into();
1510 self
1511 }
1512
1513 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1515 self.0.options = v.into();
1516 self
1517 }
1518
1519 pub async fn send(self) -> Result<crate::model::ApiOperation> {
1521 (*self.0.stub)
1522 .get_api_operation(self.0.request, self.0.options)
1523 .await
1524 .map(gax::response::Response::into_body)
1525 }
1526
1527 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1531 self.0.request.name = v.into();
1532 self
1533 }
1534 }
1535
1536 #[doc(hidden)]
1537 impl gax::options::internal::RequestBuilder for GetApiOperation {
1538 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1539 &mut self.0.options
1540 }
1541 }
1542
1543 #[derive(Clone, Debug)]
1565 pub struct ListApiOperations(RequestBuilder<crate::model::ListApiOperationsRequest>);
1566
1567 impl ListApiOperations {
1568 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1569 Self(RequestBuilder::new(stub))
1570 }
1571
1572 pub fn with_request<V: Into<crate::model::ListApiOperationsRequest>>(
1574 mut self,
1575 v: V,
1576 ) -> Self {
1577 self.0.request = v.into();
1578 self
1579 }
1580
1581 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1583 self.0.options = v.into();
1584 self
1585 }
1586
1587 pub async fn send(self) -> Result<crate::model::ListApiOperationsResponse> {
1589 (*self.0.stub)
1590 .list_api_operations(self.0.request, self.0.options)
1591 .await
1592 .map(gax::response::Response::into_body)
1593 }
1594
1595 pub fn by_page(
1597 self,
1598 ) -> impl gax::paginator::Paginator<crate::model::ListApiOperationsResponse, gax::error::Error>
1599 {
1600 use std::clone::Clone;
1601 let token = self.0.request.page_token.clone();
1602 let execute = move |token: String| {
1603 let mut builder = self.clone();
1604 builder.0.request = builder.0.request.set_page_token(token);
1605 builder.send()
1606 };
1607 gax::paginator::internal::new_paginator(token, execute)
1608 }
1609
1610 pub fn by_item(
1612 self,
1613 ) -> impl gax::paginator::ItemPaginator<crate::model::ListApiOperationsResponse, gax::error::Error>
1614 {
1615 use gax::paginator::Paginator;
1616 self.by_page().items()
1617 }
1618
1619 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1623 self.0.request.parent = v.into();
1624 self
1625 }
1626
1627 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1629 self.0.request.filter = v.into();
1630 self
1631 }
1632
1633 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1635 self.0.request.page_size = v.into();
1636 self
1637 }
1638
1639 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641 self.0.request.page_token = v.into();
1642 self
1643 }
1644 }
1645
1646 #[doc(hidden)]
1647 impl gax::options::internal::RequestBuilder for ListApiOperations {
1648 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1649 &mut self.0.options
1650 }
1651 }
1652
1653 #[derive(Clone, Debug)]
1671 pub struct UpdateApiOperation(RequestBuilder<crate::model::UpdateApiOperationRequest>);
1672
1673 impl UpdateApiOperation {
1674 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1675 Self(RequestBuilder::new(stub))
1676 }
1677
1678 pub fn with_request<V: Into<crate::model::UpdateApiOperationRequest>>(
1680 mut self,
1681 v: V,
1682 ) -> Self {
1683 self.0.request = v.into();
1684 self
1685 }
1686
1687 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1689 self.0.options = v.into();
1690 self
1691 }
1692
1693 pub async fn send(self) -> Result<crate::model::ApiOperation> {
1695 (*self.0.stub)
1696 .update_api_operation(self.0.request, self.0.options)
1697 .await
1698 .map(gax::response::Response::into_body)
1699 }
1700
1701 pub fn set_api_operation<T>(mut self, v: T) -> Self
1705 where
1706 T: std::convert::Into<crate::model::ApiOperation>,
1707 {
1708 self.0.request.api_operation = std::option::Option::Some(v.into());
1709 self
1710 }
1711
1712 pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
1716 where
1717 T: std::convert::Into<crate::model::ApiOperation>,
1718 {
1719 self.0.request.api_operation = v.map(|x| x.into());
1720 self
1721 }
1722
1723 pub fn set_update_mask<T>(mut self, v: T) -> Self
1727 where
1728 T: std::convert::Into<wkt::FieldMask>,
1729 {
1730 self.0.request.update_mask = std::option::Option::Some(v.into());
1731 self
1732 }
1733
1734 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1738 where
1739 T: std::convert::Into<wkt::FieldMask>,
1740 {
1741 self.0.request.update_mask = v.map(|x| x.into());
1742 self
1743 }
1744 }
1745
1746 #[doc(hidden)]
1747 impl gax::options::internal::RequestBuilder for UpdateApiOperation {
1748 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1749 &mut self.0.options
1750 }
1751 }
1752
1753 #[derive(Clone, Debug)]
1771 pub struct DeleteApiOperation(RequestBuilder<crate::model::DeleteApiOperationRequest>);
1772
1773 impl DeleteApiOperation {
1774 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1775 Self(RequestBuilder::new(stub))
1776 }
1777
1778 pub fn with_request<V: Into<crate::model::DeleteApiOperationRequest>>(
1780 mut self,
1781 v: V,
1782 ) -> Self {
1783 self.0.request = v.into();
1784 self
1785 }
1786
1787 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1789 self.0.options = v.into();
1790 self
1791 }
1792
1793 pub async fn send(self) -> Result<()> {
1795 (*self.0.stub)
1796 .delete_api_operation(self.0.request, self.0.options)
1797 .await
1798 .map(gax::response::Response::into_body)
1799 }
1800
1801 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805 self.0.request.name = v.into();
1806 self
1807 }
1808 }
1809
1810 #[doc(hidden)]
1811 impl gax::options::internal::RequestBuilder for DeleteApiOperation {
1812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1813 &mut self.0.options
1814 }
1815 }
1816
1817 #[derive(Clone, Debug)]
1835 pub struct GetDefinition(RequestBuilder<crate::model::GetDefinitionRequest>);
1836
1837 impl GetDefinition {
1838 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1839 Self(RequestBuilder::new(stub))
1840 }
1841
1842 pub fn with_request<V: Into<crate::model::GetDefinitionRequest>>(mut self, v: V) -> Self {
1844 self.0.request = v.into();
1845 self
1846 }
1847
1848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1850 self.0.options = v.into();
1851 self
1852 }
1853
1854 pub async fn send(self) -> Result<crate::model::Definition> {
1856 (*self.0.stub)
1857 .get_definition(self.0.request, self.0.options)
1858 .await
1859 .map(gax::response::Response::into_body)
1860 }
1861
1862 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1866 self.0.request.name = v.into();
1867 self
1868 }
1869 }
1870
1871 #[doc(hidden)]
1872 impl gax::options::internal::RequestBuilder for GetDefinition {
1873 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1874 &mut self.0.options
1875 }
1876 }
1877
1878 #[derive(Clone, Debug)]
1896 pub struct CreateDeployment(RequestBuilder<crate::model::CreateDeploymentRequest>);
1897
1898 impl CreateDeployment {
1899 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1900 Self(RequestBuilder::new(stub))
1901 }
1902
1903 pub fn with_request<V: Into<crate::model::CreateDeploymentRequest>>(
1905 mut self,
1906 v: V,
1907 ) -> Self {
1908 self.0.request = v.into();
1909 self
1910 }
1911
1912 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1914 self.0.options = v.into();
1915 self
1916 }
1917
1918 pub async fn send(self) -> Result<crate::model::Deployment> {
1920 (*self.0.stub)
1921 .create_deployment(self.0.request, self.0.options)
1922 .await
1923 .map(gax::response::Response::into_body)
1924 }
1925
1926 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1930 self.0.request.parent = v.into();
1931 self
1932 }
1933
1934 pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1936 self.0.request.deployment_id = v.into();
1937 self
1938 }
1939
1940 pub fn set_deployment<T>(mut self, v: T) -> Self
1944 where
1945 T: std::convert::Into<crate::model::Deployment>,
1946 {
1947 self.0.request.deployment = std::option::Option::Some(v.into());
1948 self
1949 }
1950
1951 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1955 where
1956 T: std::convert::Into<crate::model::Deployment>,
1957 {
1958 self.0.request.deployment = v.map(|x| x.into());
1959 self
1960 }
1961 }
1962
1963 #[doc(hidden)]
1964 impl gax::options::internal::RequestBuilder for CreateDeployment {
1965 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1966 &mut self.0.options
1967 }
1968 }
1969
1970 #[derive(Clone, Debug)]
1988 pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
1989
1990 impl GetDeployment {
1991 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
1992 Self(RequestBuilder::new(stub))
1993 }
1994
1995 pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
1997 self.0.request = v.into();
1998 self
1999 }
2000
2001 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2003 self.0.options = v.into();
2004 self
2005 }
2006
2007 pub async fn send(self) -> Result<crate::model::Deployment> {
2009 (*self.0.stub)
2010 .get_deployment(self.0.request, self.0.options)
2011 .await
2012 .map(gax::response::Response::into_body)
2013 }
2014
2015 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2019 self.0.request.name = v.into();
2020 self
2021 }
2022 }
2023
2024 #[doc(hidden)]
2025 impl gax::options::internal::RequestBuilder for GetDeployment {
2026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2027 &mut self.0.options
2028 }
2029 }
2030
2031 #[derive(Clone, Debug)]
2053 pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
2054
2055 impl ListDeployments {
2056 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2057 Self(RequestBuilder::new(stub))
2058 }
2059
2060 pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
2062 self.0.request = v.into();
2063 self
2064 }
2065
2066 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2068 self.0.options = v.into();
2069 self
2070 }
2071
2072 pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
2074 (*self.0.stub)
2075 .list_deployments(self.0.request, self.0.options)
2076 .await
2077 .map(gax::response::Response::into_body)
2078 }
2079
2080 pub fn by_page(
2082 self,
2083 ) -> impl gax::paginator::Paginator<crate::model::ListDeploymentsResponse, gax::error::Error>
2084 {
2085 use std::clone::Clone;
2086 let token = self.0.request.page_token.clone();
2087 let execute = move |token: String| {
2088 let mut builder = self.clone();
2089 builder.0.request = builder.0.request.set_page_token(token);
2090 builder.send()
2091 };
2092 gax::paginator::internal::new_paginator(token, execute)
2093 }
2094
2095 pub fn by_item(
2097 self,
2098 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDeploymentsResponse, gax::error::Error>
2099 {
2100 use gax::paginator::Paginator;
2101 self.by_page().items()
2102 }
2103
2104 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2108 self.0.request.parent = v.into();
2109 self
2110 }
2111
2112 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2114 self.0.request.filter = v.into();
2115 self
2116 }
2117
2118 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2120 self.0.request.page_size = v.into();
2121 self
2122 }
2123
2124 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2126 self.0.request.page_token = v.into();
2127 self
2128 }
2129 }
2130
2131 #[doc(hidden)]
2132 impl gax::options::internal::RequestBuilder for ListDeployments {
2133 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2134 &mut self.0.options
2135 }
2136 }
2137
2138 #[derive(Clone, Debug)]
2156 pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
2157
2158 impl UpdateDeployment {
2159 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2160 Self(RequestBuilder::new(stub))
2161 }
2162
2163 pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
2165 mut self,
2166 v: V,
2167 ) -> Self {
2168 self.0.request = v.into();
2169 self
2170 }
2171
2172 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2174 self.0.options = v.into();
2175 self
2176 }
2177
2178 pub async fn send(self) -> Result<crate::model::Deployment> {
2180 (*self.0.stub)
2181 .update_deployment(self.0.request, self.0.options)
2182 .await
2183 .map(gax::response::Response::into_body)
2184 }
2185
2186 pub fn set_deployment<T>(mut self, v: T) -> Self
2190 where
2191 T: std::convert::Into<crate::model::Deployment>,
2192 {
2193 self.0.request.deployment = std::option::Option::Some(v.into());
2194 self
2195 }
2196
2197 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2201 where
2202 T: std::convert::Into<crate::model::Deployment>,
2203 {
2204 self.0.request.deployment = v.map(|x| x.into());
2205 self
2206 }
2207
2208 pub fn set_update_mask<T>(mut self, v: T) -> Self
2212 where
2213 T: std::convert::Into<wkt::FieldMask>,
2214 {
2215 self.0.request.update_mask = std::option::Option::Some(v.into());
2216 self
2217 }
2218
2219 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2223 where
2224 T: std::convert::Into<wkt::FieldMask>,
2225 {
2226 self.0.request.update_mask = v.map(|x| x.into());
2227 self
2228 }
2229 }
2230
2231 #[doc(hidden)]
2232 impl gax::options::internal::RequestBuilder for UpdateDeployment {
2233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2234 &mut self.0.options
2235 }
2236 }
2237
2238 #[derive(Clone, Debug)]
2256 pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
2257
2258 impl DeleteDeployment {
2259 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2260 Self(RequestBuilder::new(stub))
2261 }
2262
2263 pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
2265 mut self,
2266 v: V,
2267 ) -> Self {
2268 self.0.request = v.into();
2269 self
2270 }
2271
2272 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2274 self.0.options = v.into();
2275 self
2276 }
2277
2278 pub async fn send(self) -> Result<()> {
2280 (*self.0.stub)
2281 .delete_deployment(self.0.request, self.0.options)
2282 .await
2283 .map(gax::response::Response::into_body)
2284 }
2285
2286 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2290 self.0.request.name = v.into();
2291 self
2292 }
2293 }
2294
2295 #[doc(hidden)]
2296 impl gax::options::internal::RequestBuilder for DeleteDeployment {
2297 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2298 &mut self.0.options
2299 }
2300 }
2301
2302 #[derive(Clone, Debug)]
2320 pub struct CreateAttribute(RequestBuilder<crate::model::CreateAttributeRequest>);
2321
2322 impl CreateAttribute {
2323 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2324 Self(RequestBuilder::new(stub))
2325 }
2326
2327 pub fn with_request<V: Into<crate::model::CreateAttributeRequest>>(mut self, v: V) -> Self {
2329 self.0.request = v.into();
2330 self
2331 }
2332
2333 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2335 self.0.options = v.into();
2336 self
2337 }
2338
2339 pub async fn send(self) -> Result<crate::model::Attribute> {
2341 (*self.0.stub)
2342 .create_attribute(self.0.request, self.0.options)
2343 .await
2344 .map(gax::response::Response::into_body)
2345 }
2346
2347 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2351 self.0.request.parent = v.into();
2352 self
2353 }
2354
2355 pub fn set_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2357 self.0.request.attribute_id = v.into();
2358 self
2359 }
2360
2361 pub fn set_attribute<T>(mut self, v: T) -> Self
2365 where
2366 T: std::convert::Into<crate::model::Attribute>,
2367 {
2368 self.0.request.attribute = std::option::Option::Some(v.into());
2369 self
2370 }
2371
2372 pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
2376 where
2377 T: std::convert::Into<crate::model::Attribute>,
2378 {
2379 self.0.request.attribute = v.map(|x| x.into());
2380 self
2381 }
2382 }
2383
2384 #[doc(hidden)]
2385 impl gax::options::internal::RequestBuilder for CreateAttribute {
2386 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2387 &mut self.0.options
2388 }
2389 }
2390
2391 #[derive(Clone, Debug)]
2409 pub struct GetAttribute(RequestBuilder<crate::model::GetAttributeRequest>);
2410
2411 impl GetAttribute {
2412 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2413 Self(RequestBuilder::new(stub))
2414 }
2415
2416 pub fn with_request<V: Into<crate::model::GetAttributeRequest>>(mut self, v: V) -> Self {
2418 self.0.request = v.into();
2419 self
2420 }
2421
2422 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2424 self.0.options = v.into();
2425 self
2426 }
2427
2428 pub async fn send(self) -> Result<crate::model::Attribute> {
2430 (*self.0.stub)
2431 .get_attribute(self.0.request, self.0.options)
2432 .await
2433 .map(gax::response::Response::into_body)
2434 }
2435
2436 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2440 self.0.request.name = v.into();
2441 self
2442 }
2443 }
2444
2445 #[doc(hidden)]
2446 impl gax::options::internal::RequestBuilder for GetAttribute {
2447 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2448 &mut self.0.options
2449 }
2450 }
2451
2452 #[derive(Clone, Debug)]
2470 pub struct UpdateAttribute(RequestBuilder<crate::model::UpdateAttributeRequest>);
2471
2472 impl UpdateAttribute {
2473 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2474 Self(RequestBuilder::new(stub))
2475 }
2476
2477 pub fn with_request<V: Into<crate::model::UpdateAttributeRequest>>(mut self, v: V) -> Self {
2479 self.0.request = v.into();
2480 self
2481 }
2482
2483 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2485 self.0.options = v.into();
2486 self
2487 }
2488
2489 pub async fn send(self) -> Result<crate::model::Attribute> {
2491 (*self.0.stub)
2492 .update_attribute(self.0.request, self.0.options)
2493 .await
2494 .map(gax::response::Response::into_body)
2495 }
2496
2497 pub fn set_attribute<T>(mut self, v: T) -> Self
2501 where
2502 T: std::convert::Into<crate::model::Attribute>,
2503 {
2504 self.0.request.attribute = std::option::Option::Some(v.into());
2505 self
2506 }
2507
2508 pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
2512 where
2513 T: std::convert::Into<crate::model::Attribute>,
2514 {
2515 self.0.request.attribute = v.map(|x| x.into());
2516 self
2517 }
2518
2519 pub fn set_update_mask<T>(mut self, v: T) -> Self
2523 where
2524 T: std::convert::Into<wkt::FieldMask>,
2525 {
2526 self.0.request.update_mask = std::option::Option::Some(v.into());
2527 self
2528 }
2529
2530 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2534 where
2535 T: std::convert::Into<wkt::FieldMask>,
2536 {
2537 self.0.request.update_mask = v.map(|x| x.into());
2538 self
2539 }
2540 }
2541
2542 #[doc(hidden)]
2543 impl gax::options::internal::RequestBuilder for UpdateAttribute {
2544 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2545 &mut self.0.options
2546 }
2547 }
2548
2549 #[derive(Clone, Debug)]
2567 pub struct DeleteAttribute(RequestBuilder<crate::model::DeleteAttributeRequest>);
2568
2569 impl DeleteAttribute {
2570 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2571 Self(RequestBuilder::new(stub))
2572 }
2573
2574 pub fn with_request<V: Into<crate::model::DeleteAttributeRequest>>(mut self, v: V) -> Self {
2576 self.0.request = v.into();
2577 self
2578 }
2579
2580 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2582 self.0.options = v.into();
2583 self
2584 }
2585
2586 pub async fn send(self) -> Result<()> {
2588 (*self.0.stub)
2589 .delete_attribute(self.0.request, self.0.options)
2590 .await
2591 .map(gax::response::Response::into_body)
2592 }
2593
2594 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2598 self.0.request.name = v.into();
2599 self
2600 }
2601 }
2602
2603 #[doc(hidden)]
2604 impl gax::options::internal::RequestBuilder for DeleteAttribute {
2605 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2606 &mut self.0.options
2607 }
2608 }
2609
2610 #[derive(Clone, Debug)]
2632 pub struct ListAttributes(RequestBuilder<crate::model::ListAttributesRequest>);
2633
2634 impl ListAttributes {
2635 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2636 Self(RequestBuilder::new(stub))
2637 }
2638
2639 pub fn with_request<V: Into<crate::model::ListAttributesRequest>>(mut self, v: V) -> Self {
2641 self.0.request = v.into();
2642 self
2643 }
2644
2645 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2647 self.0.options = v.into();
2648 self
2649 }
2650
2651 pub async fn send(self) -> Result<crate::model::ListAttributesResponse> {
2653 (*self.0.stub)
2654 .list_attributes(self.0.request, self.0.options)
2655 .await
2656 .map(gax::response::Response::into_body)
2657 }
2658
2659 pub fn by_page(
2661 self,
2662 ) -> impl gax::paginator::Paginator<crate::model::ListAttributesResponse, gax::error::Error>
2663 {
2664 use std::clone::Clone;
2665 let token = self.0.request.page_token.clone();
2666 let execute = move |token: String| {
2667 let mut builder = self.clone();
2668 builder.0.request = builder.0.request.set_page_token(token);
2669 builder.send()
2670 };
2671 gax::paginator::internal::new_paginator(token, execute)
2672 }
2673
2674 pub fn by_item(
2676 self,
2677 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAttributesResponse, gax::error::Error>
2678 {
2679 use gax::paginator::Paginator;
2680 self.by_page().items()
2681 }
2682
2683 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2687 self.0.request.parent = v.into();
2688 self
2689 }
2690
2691 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2693 self.0.request.filter = v.into();
2694 self
2695 }
2696
2697 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2699 self.0.request.page_size = v.into();
2700 self
2701 }
2702
2703 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2705 self.0.request.page_token = v.into();
2706 self
2707 }
2708 }
2709
2710 #[doc(hidden)]
2711 impl gax::options::internal::RequestBuilder for ListAttributes {
2712 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2713 &mut self.0.options
2714 }
2715 }
2716
2717 #[derive(Clone, Debug)]
2739 pub struct SearchResources(RequestBuilder<crate::model::SearchResourcesRequest>);
2740
2741 impl SearchResources {
2742 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2743 Self(RequestBuilder::new(stub))
2744 }
2745
2746 pub fn with_request<V: Into<crate::model::SearchResourcesRequest>>(mut self, v: V) -> Self {
2748 self.0.request = v.into();
2749 self
2750 }
2751
2752 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2754 self.0.options = v.into();
2755 self
2756 }
2757
2758 pub async fn send(self) -> Result<crate::model::SearchResourcesResponse> {
2760 (*self.0.stub)
2761 .search_resources(self.0.request, self.0.options)
2762 .await
2763 .map(gax::response::Response::into_body)
2764 }
2765
2766 pub fn by_page(
2768 self,
2769 ) -> impl gax::paginator::Paginator<crate::model::SearchResourcesResponse, gax::error::Error>
2770 {
2771 use std::clone::Clone;
2772 let token = self.0.request.page_token.clone();
2773 let execute = move |token: String| {
2774 let mut builder = self.clone();
2775 builder.0.request = builder.0.request.set_page_token(token);
2776 builder.send()
2777 };
2778 gax::paginator::internal::new_paginator(token, execute)
2779 }
2780
2781 pub fn by_item(
2783 self,
2784 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchResourcesResponse, gax::error::Error>
2785 {
2786 use gax::paginator::Paginator;
2787 self.by_page().items()
2788 }
2789
2790 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2794 self.0.request.location = v.into();
2795 self
2796 }
2797
2798 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
2802 self.0.request.query = v.into();
2803 self
2804 }
2805
2806 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2808 self.0.request.filter = v.into();
2809 self
2810 }
2811
2812 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2814 self.0.request.page_size = v.into();
2815 self
2816 }
2817
2818 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2820 self.0.request.page_token = v.into();
2821 self
2822 }
2823 }
2824
2825 #[doc(hidden)]
2826 impl gax::options::internal::RequestBuilder for SearchResources {
2827 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2828 &mut self.0.options
2829 }
2830 }
2831
2832 #[derive(Clone, Debug)]
2850 pub struct CreateExternalApi(RequestBuilder<crate::model::CreateExternalApiRequest>);
2851
2852 impl CreateExternalApi {
2853 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2854 Self(RequestBuilder::new(stub))
2855 }
2856
2857 pub fn with_request<V: Into<crate::model::CreateExternalApiRequest>>(
2859 mut self,
2860 v: V,
2861 ) -> Self {
2862 self.0.request = v.into();
2863 self
2864 }
2865
2866 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2868 self.0.options = v.into();
2869 self
2870 }
2871
2872 pub async fn send(self) -> Result<crate::model::ExternalApi> {
2874 (*self.0.stub)
2875 .create_external_api(self.0.request, self.0.options)
2876 .await
2877 .map(gax::response::Response::into_body)
2878 }
2879
2880 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2884 self.0.request.parent = v.into();
2885 self
2886 }
2887
2888 pub fn set_external_api_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2890 self.0.request.external_api_id = v.into();
2891 self
2892 }
2893
2894 pub fn set_external_api<T>(mut self, v: T) -> Self
2898 where
2899 T: std::convert::Into<crate::model::ExternalApi>,
2900 {
2901 self.0.request.external_api = std::option::Option::Some(v.into());
2902 self
2903 }
2904
2905 pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
2909 where
2910 T: std::convert::Into<crate::model::ExternalApi>,
2911 {
2912 self.0.request.external_api = v.map(|x| x.into());
2913 self
2914 }
2915 }
2916
2917 #[doc(hidden)]
2918 impl gax::options::internal::RequestBuilder for CreateExternalApi {
2919 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2920 &mut self.0.options
2921 }
2922 }
2923
2924 #[derive(Clone, Debug)]
2942 pub struct GetExternalApi(RequestBuilder<crate::model::GetExternalApiRequest>);
2943
2944 impl GetExternalApi {
2945 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
2946 Self(RequestBuilder::new(stub))
2947 }
2948
2949 pub fn with_request<V: Into<crate::model::GetExternalApiRequest>>(mut self, v: V) -> Self {
2951 self.0.request = v.into();
2952 self
2953 }
2954
2955 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2957 self.0.options = v.into();
2958 self
2959 }
2960
2961 pub async fn send(self) -> Result<crate::model::ExternalApi> {
2963 (*self.0.stub)
2964 .get_external_api(self.0.request, self.0.options)
2965 .await
2966 .map(gax::response::Response::into_body)
2967 }
2968
2969 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2973 self.0.request.name = v.into();
2974 self
2975 }
2976 }
2977
2978 #[doc(hidden)]
2979 impl gax::options::internal::RequestBuilder for GetExternalApi {
2980 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2981 &mut self.0.options
2982 }
2983 }
2984
2985 #[derive(Clone, Debug)]
3003 pub struct UpdateExternalApi(RequestBuilder<crate::model::UpdateExternalApiRequest>);
3004
3005 impl UpdateExternalApi {
3006 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3007 Self(RequestBuilder::new(stub))
3008 }
3009
3010 pub fn with_request<V: Into<crate::model::UpdateExternalApiRequest>>(
3012 mut self,
3013 v: V,
3014 ) -> Self {
3015 self.0.request = v.into();
3016 self
3017 }
3018
3019 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3021 self.0.options = v.into();
3022 self
3023 }
3024
3025 pub async fn send(self) -> Result<crate::model::ExternalApi> {
3027 (*self.0.stub)
3028 .update_external_api(self.0.request, self.0.options)
3029 .await
3030 .map(gax::response::Response::into_body)
3031 }
3032
3033 pub fn set_external_api<T>(mut self, v: T) -> Self
3037 where
3038 T: std::convert::Into<crate::model::ExternalApi>,
3039 {
3040 self.0.request.external_api = std::option::Option::Some(v.into());
3041 self
3042 }
3043
3044 pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
3048 where
3049 T: std::convert::Into<crate::model::ExternalApi>,
3050 {
3051 self.0.request.external_api = v.map(|x| x.into());
3052 self
3053 }
3054
3055 pub fn set_update_mask<T>(mut self, v: T) -> Self
3059 where
3060 T: std::convert::Into<wkt::FieldMask>,
3061 {
3062 self.0.request.update_mask = std::option::Option::Some(v.into());
3063 self
3064 }
3065
3066 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3070 where
3071 T: std::convert::Into<wkt::FieldMask>,
3072 {
3073 self.0.request.update_mask = v.map(|x| x.into());
3074 self
3075 }
3076 }
3077
3078 #[doc(hidden)]
3079 impl gax::options::internal::RequestBuilder for UpdateExternalApi {
3080 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3081 &mut self.0.options
3082 }
3083 }
3084
3085 #[derive(Clone, Debug)]
3103 pub struct DeleteExternalApi(RequestBuilder<crate::model::DeleteExternalApiRequest>);
3104
3105 impl DeleteExternalApi {
3106 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3107 Self(RequestBuilder::new(stub))
3108 }
3109
3110 pub fn with_request<V: Into<crate::model::DeleteExternalApiRequest>>(
3112 mut self,
3113 v: V,
3114 ) -> Self {
3115 self.0.request = v.into();
3116 self
3117 }
3118
3119 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3121 self.0.options = v.into();
3122 self
3123 }
3124
3125 pub async fn send(self) -> Result<()> {
3127 (*self.0.stub)
3128 .delete_external_api(self.0.request, self.0.options)
3129 .await
3130 .map(gax::response::Response::into_body)
3131 }
3132
3133 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3137 self.0.request.name = v.into();
3138 self
3139 }
3140 }
3141
3142 #[doc(hidden)]
3143 impl gax::options::internal::RequestBuilder for DeleteExternalApi {
3144 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3145 &mut self.0.options
3146 }
3147 }
3148
3149 #[derive(Clone, Debug)]
3171 pub struct ListExternalApis(RequestBuilder<crate::model::ListExternalApisRequest>);
3172
3173 impl ListExternalApis {
3174 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3175 Self(RequestBuilder::new(stub))
3176 }
3177
3178 pub fn with_request<V: Into<crate::model::ListExternalApisRequest>>(
3180 mut self,
3181 v: V,
3182 ) -> Self {
3183 self.0.request = v.into();
3184 self
3185 }
3186
3187 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3189 self.0.options = v.into();
3190 self
3191 }
3192
3193 pub async fn send(self) -> Result<crate::model::ListExternalApisResponse> {
3195 (*self.0.stub)
3196 .list_external_apis(self.0.request, self.0.options)
3197 .await
3198 .map(gax::response::Response::into_body)
3199 }
3200
3201 pub fn by_page(
3203 self,
3204 ) -> impl gax::paginator::Paginator<crate::model::ListExternalApisResponse, gax::error::Error>
3205 {
3206 use std::clone::Clone;
3207 let token = self.0.request.page_token.clone();
3208 let execute = move |token: String| {
3209 let mut builder = self.clone();
3210 builder.0.request = builder.0.request.set_page_token(token);
3211 builder.send()
3212 };
3213 gax::paginator::internal::new_paginator(token, execute)
3214 }
3215
3216 pub fn by_item(
3218 self,
3219 ) -> impl gax::paginator::ItemPaginator<crate::model::ListExternalApisResponse, gax::error::Error>
3220 {
3221 use gax::paginator::Paginator;
3222 self.by_page().items()
3223 }
3224
3225 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3229 self.0.request.parent = v.into();
3230 self
3231 }
3232
3233 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3235 self.0.request.page_size = v.into();
3236 self
3237 }
3238
3239 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3241 self.0.request.page_token = v.into();
3242 self
3243 }
3244 }
3245
3246 #[doc(hidden)]
3247 impl gax::options::internal::RequestBuilder for ListExternalApis {
3248 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3249 &mut self.0.options
3250 }
3251 }
3252
3253 #[derive(Clone, Debug)]
3275 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3276
3277 impl ListLocations {
3278 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3279 Self(RequestBuilder::new(stub))
3280 }
3281
3282 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3284 mut self,
3285 v: V,
3286 ) -> Self {
3287 self.0.request = v.into();
3288 self
3289 }
3290
3291 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3293 self.0.options = v.into();
3294 self
3295 }
3296
3297 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3299 (*self.0.stub)
3300 .list_locations(self.0.request, self.0.options)
3301 .await
3302 .map(gax::response::Response::into_body)
3303 }
3304
3305 pub fn by_page(
3307 self,
3308 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3309 {
3310 use std::clone::Clone;
3311 let token = self.0.request.page_token.clone();
3312 let execute = move |token: String| {
3313 let mut builder = self.clone();
3314 builder.0.request = builder.0.request.set_page_token(token);
3315 builder.send()
3316 };
3317 gax::paginator::internal::new_paginator(token, execute)
3318 }
3319
3320 pub fn by_item(
3322 self,
3323 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3324 {
3325 use gax::paginator::Paginator;
3326 self.by_page().items()
3327 }
3328
3329 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3331 self.0.request.name = v.into();
3332 self
3333 }
3334
3335 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3337 self.0.request.filter = v.into();
3338 self
3339 }
3340
3341 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3343 self.0.request.page_size = v.into();
3344 self
3345 }
3346
3347 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3349 self.0.request.page_token = v.into();
3350 self
3351 }
3352 }
3353
3354 #[doc(hidden)]
3355 impl gax::options::internal::RequestBuilder for ListLocations {
3356 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3357 &mut self.0.options
3358 }
3359 }
3360
3361 #[derive(Clone, Debug)]
3379 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3380
3381 impl GetLocation {
3382 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3383 Self(RequestBuilder::new(stub))
3384 }
3385
3386 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3388 self.0.request = v.into();
3389 self
3390 }
3391
3392 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3394 self.0.options = v.into();
3395 self
3396 }
3397
3398 pub async fn send(self) -> Result<location::model::Location> {
3400 (*self.0.stub)
3401 .get_location(self.0.request, self.0.options)
3402 .await
3403 .map(gax::response::Response::into_body)
3404 }
3405
3406 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3408 self.0.request.name = v.into();
3409 self
3410 }
3411 }
3412
3413 #[doc(hidden)]
3414 impl gax::options::internal::RequestBuilder for GetLocation {
3415 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3416 &mut self.0.options
3417 }
3418 }
3419
3420 #[derive(Clone, Debug)]
3442 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3443
3444 impl ListOperations {
3445 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3446 Self(RequestBuilder::new(stub))
3447 }
3448
3449 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3451 mut self,
3452 v: V,
3453 ) -> Self {
3454 self.0.request = v.into();
3455 self
3456 }
3457
3458 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3460 self.0.options = v.into();
3461 self
3462 }
3463
3464 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3466 (*self.0.stub)
3467 .list_operations(self.0.request, self.0.options)
3468 .await
3469 .map(gax::response::Response::into_body)
3470 }
3471
3472 pub fn by_page(
3474 self,
3475 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3476 {
3477 use std::clone::Clone;
3478 let token = self.0.request.page_token.clone();
3479 let execute = move |token: String| {
3480 let mut builder = self.clone();
3481 builder.0.request = builder.0.request.set_page_token(token);
3482 builder.send()
3483 };
3484 gax::paginator::internal::new_paginator(token, execute)
3485 }
3486
3487 pub fn by_item(
3489 self,
3490 ) -> impl gax::paginator::ItemPaginator<
3491 longrunning::model::ListOperationsResponse,
3492 gax::error::Error,
3493 > {
3494 use gax::paginator::Paginator;
3495 self.by_page().items()
3496 }
3497
3498 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3500 self.0.request.name = v.into();
3501 self
3502 }
3503
3504 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3506 self.0.request.filter = v.into();
3507 self
3508 }
3509
3510 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3512 self.0.request.page_size = v.into();
3513 self
3514 }
3515
3516 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3518 self.0.request.page_token = v.into();
3519 self
3520 }
3521
3522 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3524 self.0.request.return_partial_success = v.into();
3525 self
3526 }
3527 }
3528
3529 #[doc(hidden)]
3530 impl gax::options::internal::RequestBuilder for ListOperations {
3531 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3532 &mut self.0.options
3533 }
3534 }
3535
3536 #[derive(Clone, Debug)]
3554 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3555
3556 impl GetOperation {
3557 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3558 Self(RequestBuilder::new(stub))
3559 }
3560
3561 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3563 mut self,
3564 v: V,
3565 ) -> Self {
3566 self.0.request = v.into();
3567 self
3568 }
3569
3570 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3572 self.0.options = v.into();
3573 self
3574 }
3575
3576 pub async fn send(self) -> Result<longrunning::model::Operation> {
3578 (*self.0.stub)
3579 .get_operation(self.0.request, self.0.options)
3580 .await
3581 .map(gax::response::Response::into_body)
3582 }
3583
3584 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3586 self.0.request.name = v.into();
3587 self
3588 }
3589 }
3590
3591 #[doc(hidden)]
3592 impl gax::options::internal::RequestBuilder for GetOperation {
3593 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3594 &mut self.0.options
3595 }
3596 }
3597
3598 #[derive(Clone, Debug)]
3616 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3617
3618 impl DeleteOperation {
3619 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3620 Self(RequestBuilder::new(stub))
3621 }
3622
3623 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3625 mut self,
3626 v: V,
3627 ) -> Self {
3628 self.0.request = v.into();
3629 self
3630 }
3631
3632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3634 self.0.options = v.into();
3635 self
3636 }
3637
3638 pub async fn send(self) -> Result<()> {
3640 (*self.0.stub)
3641 .delete_operation(self.0.request, self.0.options)
3642 .await
3643 .map(gax::response::Response::into_body)
3644 }
3645
3646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.0.request.name = v.into();
3649 self
3650 }
3651 }
3652
3653 #[doc(hidden)]
3654 impl gax::options::internal::RequestBuilder for DeleteOperation {
3655 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3656 &mut self.0.options
3657 }
3658 }
3659
3660 #[derive(Clone, Debug)]
3678 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3679
3680 impl CancelOperation {
3681 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHub>) -> Self {
3682 Self(RequestBuilder::new(stub))
3683 }
3684
3685 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3687 mut self,
3688 v: V,
3689 ) -> Self {
3690 self.0.request = v.into();
3691 self
3692 }
3693
3694 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3696 self.0.options = v.into();
3697 self
3698 }
3699
3700 pub async fn send(self) -> Result<()> {
3702 (*self.0.stub)
3703 .cancel_operation(self.0.request, self.0.options)
3704 .await
3705 .map(gax::response::Response::into_body)
3706 }
3707
3708 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3710 self.0.request.name = v.into();
3711 self
3712 }
3713 }
3714
3715 #[doc(hidden)]
3716 impl gax::options::internal::RequestBuilder for CancelOperation {
3717 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3718 &mut self.0.options
3719 }
3720 }
3721}
3722
3723pub mod api_hub_dependencies {
3724 use crate::Result;
3725
3726 pub type ClientBuilder =
3740 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3741
3742 pub(crate) mod client {
3743 use super::super::super::client::ApiHubDependencies;
3744 pub struct Factory;
3745 impl gax::client_builder::internal::ClientFactory for Factory {
3746 type Client = ApiHubDependencies;
3747 type Credentials = gaxi::options::Credentials;
3748 async fn build(
3749 self,
3750 config: gaxi::options::ClientConfig,
3751 ) -> gax::client_builder::Result<Self::Client> {
3752 Self::Client::new(config).await
3753 }
3754 }
3755 }
3756
3757 #[derive(Clone, Debug)]
3759 pub(crate) struct RequestBuilder<R: std::default::Default> {
3760 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3761 request: R,
3762 options: gax::options::RequestOptions,
3763 }
3764
3765 impl<R> RequestBuilder<R>
3766 where
3767 R: std::default::Default,
3768 {
3769 pub(crate) fn new(
3770 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3771 ) -> Self {
3772 Self {
3773 stub,
3774 request: R::default(),
3775 options: gax::options::RequestOptions::default(),
3776 }
3777 }
3778 }
3779
3780 #[derive(Clone, Debug)]
3798 pub struct CreateDependency(RequestBuilder<crate::model::CreateDependencyRequest>);
3799
3800 impl CreateDependency {
3801 pub(crate) fn new(
3802 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3803 ) -> Self {
3804 Self(RequestBuilder::new(stub))
3805 }
3806
3807 pub fn with_request<V: Into<crate::model::CreateDependencyRequest>>(
3809 mut self,
3810 v: V,
3811 ) -> Self {
3812 self.0.request = v.into();
3813 self
3814 }
3815
3816 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3818 self.0.options = v.into();
3819 self
3820 }
3821
3822 pub async fn send(self) -> Result<crate::model::Dependency> {
3824 (*self.0.stub)
3825 .create_dependency(self.0.request, self.0.options)
3826 .await
3827 .map(gax::response::Response::into_body)
3828 }
3829
3830 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3834 self.0.request.parent = v.into();
3835 self
3836 }
3837
3838 pub fn set_dependency_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3840 self.0.request.dependency_id = v.into();
3841 self
3842 }
3843
3844 pub fn set_dependency<T>(mut self, v: T) -> Self
3848 where
3849 T: std::convert::Into<crate::model::Dependency>,
3850 {
3851 self.0.request.dependency = std::option::Option::Some(v.into());
3852 self
3853 }
3854
3855 pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
3859 where
3860 T: std::convert::Into<crate::model::Dependency>,
3861 {
3862 self.0.request.dependency = v.map(|x| x.into());
3863 self
3864 }
3865 }
3866
3867 #[doc(hidden)]
3868 impl gax::options::internal::RequestBuilder for CreateDependency {
3869 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3870 &mut self.0.options
3871 }
3872 }
3873
3874 #[derive(Clone, Debug)]
3892 pub struct GetDependency(RequestBuilder<crate::model::GetDependencyRequest>);
3893
3894 impl GetDependency {
3895 pub(crate) fn new(
3896 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3897 ) -> Self {
3898 Self(RequestBuilder::new(stub))
3899 }
3900
3901 pub fn with_request<V: Into<crate::model::GetDependencyRequest>>(mut self, v: V) -> Self {
3903 self.0.request = v.into();
3904 self
3905 }
3906
3907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3909 self.0.options = v.into();
3910 self
3911 }
3912
3913 pub async fn send(self) -> Result<crate::model::Dependency> {
3915 (*self.0.stub)
3916 .get_dependency(self.0.request, self.0.options)
3917 .await
3918 .map(gax::response::Response::into_body)
3919 }
3920
3921 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3925 self.0.request.name = v.into();
3926 self
3927 }
3928 }
3929
3930 #[doc(hidden)]
3931 impl gax::options::internal::RequestBuilder for GetDependency {
3932 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3933 &mut self.0.options
3934 }
3935 }
3936
3937 #[derive(Clone, Debug)]
3955 pub struct UpdateDependency(RequestBuilder<crate::model::UpdateDependencyRequest>);
3956
3957 impl UpdateDependency {
3958 pub(crate) fn new(
3959 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
3960 ) -> Self {
3961 Self(RequestBuilder::new(stub))
3962 }
3963
3964 pub fn with_request<V: Into<crate::model::UpdateDependencyRequest>>(
3966 mut self,
3967 v: V,
3968 ) -> Self {
3969 self.0.request = v.into();
3970 self
3971 }
3972
3973 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3975 self.0.options = v.into();
3976 self
3977 }
3978
3979 pub async fn send(self) -> Result<crate::model::Dependency> {
3981 (*self.0.stub)
3982 .update_dependency(self.0.request, self.0.options)
3983 .await
3984 .map(gax::response::Response::into_body)
3985 }
3986
3987 pub fn set_dependency<T>(mut self, v: T) -> Self
3991 where
3992 T: std::convert::Into<crate::model::Dependency>,
3993 {
3994 self.0.request.dependency = std::option::Option::Some(v.into());
3995 self
3996 }
3997
3998 pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
4002 where
4003 T: std::convert::Into<crate::model::Dependency>,
4004 {
4005 self.0.request.dependency = v.map(|x| x.into());
4006 self
4007 }
4008
4009 pub fn set_update_mask<T>(mut self, v: T) -> Self
4013 where
4014 T: std::convert::Into<wkt::FieldMask>,
4015 {
4016 self.0.request.update_mask = std::option::Option::Some(v.into());
4017 self
4018 }
4019
4020 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4024 where
4025 T: std::convert::Into<wkt::FieldMask>,
4026 {
4027 self.0.request.update_mask = v.map(|x| x.into());
4028 self
4029 }
4030 }
4031
4032 #[doc(hidden)]
4033 impl gax::options::internal::RequestBuilder for UpdateDependency {
4034 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4035 &mut self.0.options
4036 }
4037 }
4038
4039 #[derive(Clone, Debug)]
4057 pub struct DeleteDependency(RequestBuilder<crate::model::DeleteDependencyRequest>);
4058
4059 impl DeleteDependency {
4060 pub(crate) fn new(
4061 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4062 ) -> Self {
4063 Self(RequestBuilder::new(stub))
4064 }
4065
4066 pub fn with_request<V: Into<crate::model::DeleteDependencyRequest>>(
4068 mut self,
4069 v: V,
4070 ) -> Self {
4071 self.0.request = v.into();
4072 self
4073 }
4074
4075 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4077 self.0.options = v.into();
4078 self
4079 }
4080
4081 pub async fn send(self) -> Result<()> {
4083 (*self.0.stub)
4084 .delete_dependency(self.0.request, self.0.options)
4085 .await
4086 .map(gax::response::Response::into_body)
4087 }
4088
4089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4093 self.0.request.name = v.into();
4094 self
4095 }
4096 }
4097
4098 #[doc(hidden)]
4099 impl gax::options::internal::RequestBuilder for DeleteDependency {
4100 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4101 &mut self.0.options
4102 }
4103 }
4104
4105 #[derive(Clone, Debug)]
4127 pub struct ListDependencies(RequestBuilder<crate::model::ListDependenciesRequest>);
4128
4129 impl ListDependencies {
4130 pub(crate) fn new(
4131 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4132 ) -> Self {
4133 Self(RequestBuilder::new(stub))
4134 }
4135
4136 pub fn with_request<V: Into<crate::model::ListDependenciesRequest>>(
4138 mut self,
4139 v: V,
4140 ) -> Self {
4141 self.0.request = v.into();
4142 self
4143 }
4144
4145 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4147 self.0.options = v.into();
4148 self
4149 }
4150
4151 pub async fn send(self) -> Result<crate::model::ListDependenciesResponse> {
4153 (*self.0.stub)
4154 .list_dependencies(self.0.request, self.0.options)
4155 .await
4156 .map(gax::response::Response::into_body)
4157 }
4158
4159 pub fn by_page(
4161 self,
4162 ) -> impl gax::paginator::Paginator<crate::model::ListDependenciesResponse, gax::error::Error>
4163 {
4164 use std::clone::Clone;
4165 let token = self.0.request.page_token.clone();
4166 let execute = move |token: String| {
4167 let mut builder = self.clone();
4168 builder.0.request = builder.0.request.set_page_token(token);
4169 builder.send()
4170 };
4171 gax::paginator::internal::new_paginator(token, execute)
4172 }
4173
4174 pub fn by_item(
4176 self,
4177 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDependenciesResponse, gax::error::Error>
4178 {
4179 use gax::paginator::Paginator;
4180 self.by_page().items()
4181 }
4182
4183 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4187 self.0.request.parent = v.into();
4188 self
4189 }
4190
4191 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4193 self.0.request.filter = v.into();
4194 self
4195 }
4196
4197 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4199 self.0.request.page_size = v.into();
4200 self
4201 }
4202
4203 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4205 self.0.request.page_token = v.into();
4206 self
4207 }
4208 }
4209
4210 #[doc(hidden)]
4211 impl gax::options::internal::RequestBuilder for ListDependencies {
4212 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4213 &mut self.0.options
4214 }
4215 }
4216
4217 #[derive(Clone, Debug)]
4239 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4240
4241 impl ListLocations {
4242 pub(crate) fn new(
4243 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4244 ) -> Self {
4245 Self(RequestBuilder::new(stub))
4246 }
4247
4248 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4250 mut self,
4251 v: V,
4252 ) -> Self {
4253 self.0.request = v.into();
4254 self
4255 }
4256
4257 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4259 self.0.options = v.into();
4260 self
4261 }
4262
4263 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4265 (*self.0.stub)
4266 .list_locations(self.0.request, self.0.options)
4267 .await
4268 .map(gax::response::Response::into_body)
4269 }
4270
4271 pub fn by_page(
4273 self,
4274 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4275 {
4276 use std::clone::Clone;
4277 let token = self.0.request.page_token.clone();
4278 let execute = move |token: String| {
4279 let mut builder = self.clone();
4280 builder.0.request = builder.0.request.set_page_token(token);
4281 builder.send()
4282 };
4283 gax::paginator::internal::new_paginator(token, execute)
4284 }
4285
4286 pub fn by_item(
4288 self,
4289 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4290 {
4291 use gax::paginator::Paginator;
4292 self.by_page().items()
4293 }
4294
4295 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4297 self.0.request.name = v.into();
4298 self
4299 }
4300
4301 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4303 self.0.request.filter = v.into();
4304 self
4305 }
4306
4307 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4309 self.0.request.page_size = v.into();
4310 self
4311 }
4312
4313 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4315 self.0.request.page_token = v.into();
4316 self
4317 }
4318 }
4319
4320 #[doc(hidden)]
4321 impl gax::options::internal::RequestBuilder for ListLocations {
4322 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4323 &mut self.0.options
4324 }
4325 }
4326
4327 #[derive(Clone, Debug)]
4345 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4346
4347 impl GetLocation {
4348 pub(crate) fn new(
4349 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4350 ) -> Self {
4351 Self(RequestBuilder::new(stub))
4352 }
4353
4354 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4356 self.0.request = v.into();
4357 self
4358 }
4359
4360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4362 self.0.options = v.into();
4363 self
4364 }
4365
4366 pub async fn send(self) -> Result<location::model::Location> {
4368 (*self.0.stub)
4369 .get_location(self.0.request, self.0.options)
4370 .await
4371 .map(gax::response::Response::into_body)
4372 }
4373
4374 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4376 self.0.request.name = v.into();
4377 self
4378 }
4379 }
4380
4381 #[doc(hidden)]
4382 impl gax::options::internal::RequestBuilder for GetLocation {
4383 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4384 &mut self.0.options
4385 }
4386 }
4387
4388 #[derive(Clone, Debug)]
4410 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4411
4412 impl ListOperations {
4413 pub(crate) fn new(
4414 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4415 ) -> Self {
4416 Self(RequestBuilder::new(stub))
4417 }
4418
4419 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4421 mut self,
4422 v: V,
4423 ) -> Self {
4424 self.0.request = v.into();
4425 self
4426 }
4427
4428 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4430 self.0.options = v.into();
4431 self
4432 }
4433
4434 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4436 (*self.0.stub)
4437 .list_operations(self.0.request, self.0.options)
4438 .await
4439 .map(gax::response::Response::into_body)
4440 }
4441
4442 pub fn by_page(
4444 self,
4445 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4446 {
4447 use std::clone::Clone;
4448 let token = self.0.request.page_token.clone();
4449 let execute = move |token: String| {
4450 let mut builder = self.clone();
4451 builder.0.request = builder.0.request.set_page_token(token);
4452 builder.send()
4453 };
4454 gax::paginator::internal::new_paginator(token, execute)
4455 }
4456
4457 pub fn by_item(
4459 self,
4460 ) -> impl gax::paginator::ItemPaginator<
4461 longrunning::model::ListOperationsResponse,
4462 gax::error::Error,
4463 > {
4464 use gax::paginator::Paginator;
4465 self.by_page().items()
4466 }
4467
4468 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4470 self.0.request.name = v.into();
4471 self
4472 }
4473
4474 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4476 self.0.request.filter = v.into();
4477 self
4478 }
4479
4480 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4482 self.0.request.page_size = v.into();
4483 self
4484 }
4485
4486 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4488 self.0.request.page_token = v.into();
4489 self
4490 }
4491
4492 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4494 self.0.request.return_partial_success = v.into();
4495 self
4496 }
4497 }
4498
4499 #[doc(hidden)]
4500 impl gax::options::internal::RequestBuilder for ListOperations {
4501 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4502 &mut self.0.options
4503 }
4504 }
4505
4506 #[derive(Clone, Debug)]
4524 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4525
4526 impl GetOperation {
4527 pub(crate) fn new(
4528 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4529 ) -> Self {
4530 Self(RequestBuilder::new(stub))
4531 }
4532
4533 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4535 mut self,
4536 v: V,
4537 ) -> Self {
4538 self.0.request = v.into();
4539 self
4540 }
4541
4542 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4544 self.0.options = v.into();
4545 self
4546 }
4547
4548 pub async fn send(self) -> Result<longrunning::model::Operation> {
4550 (*self.0.stub)
4551 .get_operation(self.0.request, self.0.options)
4552 .await
4553 .map(gax::response::Response::into_body)
4554 }
4555
4556 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4558 self.0.request.name = v.into();
4559 self
4560 }
4561 }
4562
4563 #[doc(hidden)]
4564 impl gax::options::internal::RequestBuilder for GetOperation {
4565 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4566 &mut self.0.options
4567 }
4568 }
4569
4570 #[derive(Clone, Debug)]
4588 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4589
4590 impl DeleteOperation {
4591 pub(crate) fn new(
4592 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4593 ) -> Self {
4594 Self(RequestBuilder::new(stub))
4595 }
4596
4597 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4599 mut self,
4600 v: V,
4601 ) -> Self {
4602 self.0.request = v.into();
4603 self
4604 }
4605
4606 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4608 self.0.options = v.into();
4609 self
4610 }
4611
4612 pub async fn send(self) -> Result<()> {
4614 (*self.0.stub)
4615 .delete_operation(self.0.request, self.0.options)
4616 .await
4617 .map(gax::response::Response::into_body)
4618 }
4619
4620 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4622 self.0.request.name = v.into();
4623 self
4624 }
4625 }
4626
4627 #[doc(hidden)]
4628 impl gax::options::internal::RequestBuilder for DeleteOperation {
4629 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4630 &mut self.0.options
4631 }
4632 }
4633
4634 #[derive(Clone, Debug)]
4652 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4653
4654 impl CancelOperation {
4655 pub(crate) fn new(
4656 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDependencies>,
4657 ) -> Self {
4658 Self(RequestBuilder::new(stub))
4659 }
4660
4661 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4663 mut self,
4664 v: V,
4665 ) -> Self {
4666 self.0.request = v.into();
4667 self
4668 }
4669
4670 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4672 self.0.options = v.into();
4673 self
4674 }
4675
4676 pub async fn send(self) -> Result<()> {
4678 (*self.0.stub)
4679 .cancel_operation(self.0.request, self.0.options)
4680 .await
4681 .map(gax::response::Response::into_body)
4682 }
4683
4684 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4686 self.0.request.name = v.into();
4687 self
4688 }
4689 }
4690
4691 #[doc(hidden)]
4692 impl gax::options::internal::RequestBuilder for CancelOperation {
4693 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4694 &mut self.0.options
4695 }
4696 }
4697}
4698
4699pub mod api_hub_collect {
4700 use crate::Result;
4701
4702 pub type ClientBuilder =
4716 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4717
4718 pub(crate) mod client {
4719 use super::super::super::client::ApiHubCollect;
4720 pub struct Factory;
4721 impl gax::client_builder::internal::ClientFactory for Factory {
4722 type Client = ApiHubCollect;
4723 type Credentials = gaxi::options::Credentials;
4724 async fn build(
4725 self,
4726 config: gaxi::options::ClientConfig,
4727 ) -> gax::client_builder::Result<Self::Client> {
4728 Self::Client::new(config).await
4729 }
4730 }
4731 }
4732
4733 #[derive(Clone, Debug)]
4735 pub(crate) struct RequestBuilder<R: std::default::Default> {
4736 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
4737 request: R,
4738 options: gax::options::RequestOptions,
4739 }
4740
4741 impl<R> RequestBuilder<R>
4742 where
4743 R: std::default::Default,
4744 {
4745 pub(crate) fn new(
4746 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
4747 ) -> Self {
4748 Self {
4749 stub,
4750 request: R::default(),
4751 options: gax::options::RequestOptions::default(),
4752 }
4753 }
4754 }
4755
4756 #[derive(Clone, Debug)]
4775 pub struct CollectApiData(RequestBuilder<crate::model::CollectApiDataRequest>);
4776
4777 impl CollectApiData {
4778 pub(crate) fn new(
4779 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
4780 ) -> Self {
4781 Self(RequestBuilder::new(stub))
4782 }
4783
4784 pub fn with_request<V: Into<crate::model::CollectApiDataRequest>>(mut self, v: V) -> Self {
4786 self.0.request = v.into();
4787 self
4788 }
4789
4790 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4792 self.0.options = v.into();
4793 self
4794 }
4795
4796 pub async fn send(self) -> Result<longrunning::model::Operation> {
4803 (*self.0.stub)
4804 .collect_api_data(self.0.request, self.0.options)
4805 .await
4806 .map(gax::response::Response::into_body)
4807 }
4808
4809 pub fn poller(
4811 self,
4812 ) -> impl lro::Poller<crate::model::CollectApiDataResponse, crate::model::OperationMetadata>
4813 {
4814 type Operation = lro::internal::Operation<
4815 crate::model::CollectApiDataResponse,
4816 crate::model::OperationMetadata,
4817 >;
4818 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4819 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4820
4821 let stub = self.0.stub.clone();
4822 let mut options = self.0.options.clone();
4823 options.set_retry_policy(gax::retry_policy::NeverRetry);
4824 let query = move |name| {
4825 let stub = stub.clone();
4826 let options = options.clone();
4827 async {
4828 let op = GetOperation::new(stub)
4829 .set_name(name)
4830 .with_options(options)
4831 .send()
4832 .await?;
4833 Ok(Operation::new(op))
4834 }
4835 };
4836
4837 let start = move || async {
4838 let op = self.send().await?;
4839 Ok(Operation::new(op))
4840 };
4841
4842 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4843 }
4844
4845 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4849 self.0.request.location = v.into();
4850 self
4851 }
4852
4853 pub fn set_collection_type<T: Into<crate::model::CollectionType>>(mut self, v: T) -> Self {
4857 self.0.request.collection_type = v.into();
4858 self
4859 }
4860
4861 pub fn set_plugin_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4865 self.0.request.plugin_instance = v.into();
4866 self
4867 }
4868
4869 pub fn set_action_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4873 self.0.request.action_id = v.into();
4874 self
4875 }
4876
4877 pub fn set_api_data<T>(mut self, v: T) -> Self
4881 where
4882 T: std::convert::Into<crate::model::ApiData>,
4883 {
4884 self.0.request.api_data = std::option::Option::Some(v.into());
4885 self
4886 }
4887
4888 pub fn set_or_clear_api_data<T>(mut self, v: std::option::Option<T>) -> Self
4892 where
4893 T: std::convert::Into<crate::model::ApiData>,
4894 {
4895 self.0.request.api_data = v.map(|x| x.into());
4896 self
4897 }
4898 }
4899
4900 #[doc(hidden)]
4901 impl gax::options::internal::RequestBuilder for CollectApiData {
4902 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4903 &mut self.0.options
4904 }
4905 }
4906
4907 #[derive(Clone, Debug)]
4929 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4930
4931 impl ListLocations {
4932 pub(crate) fn new(
4933 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
4934 ) -> Self {
4935 Self(RequestBuilder::new(stub))
4936 }
4937
4938 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4940 mut self,
4941 v: V,
4942 ) -> Self {
4943 self.0.request = v.into();
4944 self
4945 }
4946
4947 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4949 self.0.options = v.into();
4950 self
4951 }
4952
4953 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4955 (*self.0.stub)
4956 .list_locations(self.0.request, self.0.options)
4957 .await
4958 .map(gax::response::Response::into_body)
4959 }
4960
4961 pub fn by_page(
4963 self,
4964 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4965 {
4966 use std::clone::Clone;
4967 let token = self.0.request.page_token.clone();
4968 let execute = move |token: String| {
4969 let mut builder = self.clone();
4970 builder.0.request = builder.0.request.set_page_token(token);
4971 builder.send()
4972 };
4973 gax::paginator::internal::new_paginator(token, execute)
4974 }
4975
4976 pub fn by_item(
4978 self,
4979 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4980 {
4981 use gax::paginator::Paginator;
4982 self.by_page().items()
4983 }
4984
4985 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4987 self.0.request.name = v.into();
4988 self
4989 }
4990
4991 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4993 self.0.request.filter = v.into();
4994 self
4995 }
4996
4997 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4999 self.0.request.page_size = v.into();
5000 self
5001 }
5002
5003 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5005 self.0.request.page_token = v.into();
5006 self
5007 }
5008 }
5009
5010 #[doc(hidden)]
5011 impl gax::options::internal::RequestBuilder for ListLocations {
5012 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5013 &mut self.0.options
5014 }
5015 }
5016
5017 #[derive(Clone, Debug)]
5035 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5036
5037 impl GetLocation {
5038 pub(crate) fn new(
5039 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5040 ) -> Self {
5041 Self(RequestBuilder::new(stub))
5042 }
5043
5044 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5046 self.0.request = v.into();
5047 self
5048 }
5049
5050 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5052 self.0.options = v.into();
5053 self
5054 }
5055
5056 pub async fn send(self) -> Result<location::model::Location> {
5058 (*self.0.stub)
5059 .get_location(self.0.request, self.0.options)
5060 .await
5061 .map(gax::response::Response::into_body)
5062 }
5063
5064 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5066 self.0.request.name = v.into();
5067 self
5068 }
5069 }
5070
5071 #[doc(hidden)]
5072 impl gax::options::internal::RequestBuilder for GetLocation {
5073 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5074 &mut self.0.options
5075 }
5076 }
5077
5078 #[derive(Clone, Debug)]
5100 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5101
5102 impl ListOperations {
5103 pub(crate) fn new(
5104 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5105 ) -> Self {
5106 Self(RequestBuilder::new(stub))
5107 }
5108
5109 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5111 mut self,
5112 v: V,
5113 ) -> Self {
5114 self.0.request = v.into();
5115 self
5116 }
5117
5118 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5120 self.0.options = v.into();
5121 self
5122 }
5123
5124 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5126 (*self.0.stub)
5127 .list_operations(self.0.request, self.0.options)
5128 .await
5129 .map(gax::response::Response::into_body)
5130 }
5131
5132 pub fn by_page(
5134 self,
5135 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5136 {
5137 use std::clone::Clone;
5138 let token = self.0.request.page_token.clone();
5139 let execute = move |token: String| {
5140 let mut builder = self.clone();
5141 builder.0.request = builder.0.request.set_page_token(token);
5142 builder.send()
5143 };
5144 gax::paginator::internal::new_paginator(token, execute)
5145 }
5146
5147 pub fn by_item(
5149 self,
5150 ) -> impl gax::paginator::ItemPaginator<
5151 longrunning::model::ListOperationsResponse,
5152 gax::error::Error,
5153 > {
5154 use gax::paginator::Paginator;
5155 self.by_page().items()
5156 }
5157
5158 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5160 self.0.request.name = v.into();
5161 self
5162 }
5163
5164 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5166 self.0.request.filter = v.into();
5167 self
5168 }
5169
5170 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5172 self.0.request.page_size = v.into();
5173 self
5174 }
5175
5176 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5178 self.0.request.page_token = v.into();
5179 self
5180 }
5181
5182 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5184 self.0.request.return_partial_success = v.into();
5185 self
5186 }
5187 }
5188
5189 #[doc(hidden)]
5190 impl gax::options::internal::RequestBuilder for ListOperations {
5191 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5192 &mut self.0.options
5193 }
5194 }
5195
5196 #[derive(Clone, Debug)]
5214 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5215
5216 impl GetOperation {
5217 pub(crate) fn new(
5218 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5219 ) -> Self {
5220 Self(RequestBuilder::new(stub))
5221 }
5222
5223 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5225 mut self,
5226 v: V,
5227 ) -> Self {
5228 self.0.request = v.into();
5229 self
5230 }
5231
5232 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5234 self.0.options = v.into();
5235 self
5236 }
5237
5238 pub async fn send(self) -> Result<longrunning::model::Operation> {
5240 (*self.0.stub)
5241 .get_operation(self.0.request, self.0.options)
5242 .await
5243 .map(gax::response::Response::into_body)
5244 }
5245
5246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5248 self.0.request.name = v.into();
5249 self
5250 }
5251 }
5252
5253 #[doc(hidden)]
5254 impl gax::options::internal::RequestBuilder for GetOperation {
5255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5256 &mut self.0.options
5257 }
5258 }
5259
5260 #[derive(Clone, Debug)]
5278 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5279
5280 impl DeleteOperation {
5281 pub(crate) fn new(
5282 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5283 ) -> Self {
5284 Self(RequestBuilder::new(stub))
5285 }
5286
5287 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5289 mut self,
5290 v: V,
5291 ) -> Self {
5292 self.0.request = v.into();
5293 self
5294 }
5295
5296 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5298 self.0.options = v.into();
5299 self
5300 }
5301
5302 pub async fn send(self) -> Result<()> {
5304 (*self.0.stub)
5305 .delete_operation(self.0.request, self.0.options)
5306 .await
5307 .map(gax::response::Response::into_body)
5308 }
5309
5310 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5312 self.0.request.name = v.into();
5313 self
5314 }
5315 }
5316
5317 #[doc(hidden)]
5318 impl gax::options::internal::RequestBuilder for DeleteOperation {
5319 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5320 &mut self.0.options
5321 }
5322 }
5323
5324 #[derive(Clone, Debug)]
5342 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5343
5344 impl CancelOperation {
5345 pub(crate) fn new(
5346 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCollect>,
5347 ) -> Self {
5348 Self(RequestBuilder::new(stub))
5349 }
5350
5351 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5353 mut self,
5354 v: V,
5355 ) -> Self {
5356 self.0.request = v.into();
5357 self
5358 }
5359
5360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5362 self.0.options = v.into();
5363 self
5364 }
5365
5366 pub async fn send(self) -> Result<()> {
5368 (*self.0.stub)
5369 .cancel_operation(self.0.request, self.0.options)
5370 .await
5371 .map(gax::response::Response::into_body)
5372 }
5373
5374 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5376 self.0.request.name = v.into();
5377 self
5378 }
5379 }
5380
5381 #[doc(hidden)]
5382 impl gax::options::internal::RequestBuilder for CancelOperation {
5383 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5384 &mut self.0.options
5385 }
5386 }
5387}
5388
5389pub mod api_hub_curate {
5390 use crate::Result;
5391
5392 pub type ClientBuilder =
5406 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5407
5408 pub(crate) mod client {
5409 use super::super::super::client::ApiHubCurate;
5410 pub struct Factory;
5411 impl gax::client_builder::internal::ClientFactory for Factory {
5412 type Client = ApiHubCurate;
5413 type Credentials = gaxi::options::Credentials;
5414 async fn build(
5415 self,
5416 config: gaxi::options::ClientConfig,
5417 ) -> gax::client_builder::Result<Self::Client> {
5418 Self::Client::new(config).await
5419 }
5420 }
5421 }
5422
5423 #[derive(Clone, Debug)]
5425 pub(crate) struct RequestBuilder<R: std::default::Default> {
5426 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5427 request: R,
5428 options: gax::options::RequestOptions,
5429 }
5430
5431 impl<R> RequestBuilder<R>
5432 where
5433 R: std::default::Default,
5434 {
5435 pub(crate) fn new(
5436 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5437 ) -> Self {
5438 Self {
5439 stub,
5440 request: R::default(),
5441 options: gax::options::RequestOptions::default(),
5442 }
5443 }
5444 }
5445
5446 #[derive(Clone, Debug)]
5464 pub struct CreateCuration(RequestBuilder<crate::model::CreateCurationRequest>);
5465
5466 impl CreateCuration {
5467 pub(crate) fn new(
5468 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5469 ) -> Self {
5470 Self(RequestBuilder::new(stub))
5471 }
5472
5473 pub fn with_request<V: Into<crate::model::CreateCurationRequest>>(mut self, v: V) -> Self {
5475 self.0.request = v.into();
5476 self
5477 }
5478
5479 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5481 self.0.options = v.into();
5482 self
5483 }
5484
5485 pub async fn send(self) -> Result<crate::model::Curation> {
5487 (*self.0.stub)
5488 .create_curation(self.0.request, self.0.options)
5489 .await
5490 .map(gax::response::Response::into_body)
5491 }
5492
5493 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5497 self.0.request.parent = v.into();
5498 self
5499 }
5500
5501 pub fn set_curation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5503 self.0.request.curation_id = v.into();
5504 self
5505 }
5506
5507 pub fn set_curation<T>(mut self, v: T) -> Self
5511 where
5512 T: std::convert::Into<crate::model::Curation>,
5513 {
5514 self.0.request.curation = std::option::Option::Some(v.into());
5515 self
5516 }
5517
5518 pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
5522 where
5523 T: std::convert::Into<crate::model::Curation>,
5524 {
5525 self.0.request.curation = v.map(|x| x.into());
5526 self
5527 }
5528 }
5529
5530 #[doc(hidden)]
5531 impl gax::options::internal::RequestBuilder for CreateCuration {
5532 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5533 &mut self.0.options
5534 }
5535 }
5536
5537 #[derive(Clone, Debug)]
5555 pub struct GetCuration(RequestBuilder<crate::model::GetCurationRequest>);
5556
5557 impl GetCuration {
5558 pub(crate) fn new(
5559 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5560 ) -> Self {
5561 Self(RequestBuilder::new(stub))
5562 }
5563
5564 pub fn with_request<V: Into<crate::model::GetCurationRequest>>(mut self, v: V) -> Self {
5566 self.0.request = v.into();
5567 self
5568 }
5569
5570 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5572 self.0.options = v.into();
5573 self
5574 }
5575
5576 pub async fn send(self) -> Result<crate::model::Curation> {
5578 (*self.0.stub)
5579 .get_curation(self.0.request, self.0.options)
5580 .await
5581 .map(gax::response::Response::into_body)
5582 }
5583
5584 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5588 self.0.request.name = v.into();
5589 self
5590 }
5591 }
5592
5593 #[doc(hidden)]
5594 impl gax::options::internal::RequestBuilder for GetCuration {
5595 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5596 &mut self.0.options
5597 }
5598 }
5599
5600 #[derive(Clone, Debug)]
5622 pub struct ListCurations(RequestBuilder<crate::model::ListCurationsRequest>);
5623
5624 impl ListCurations {
5625 pub(crate) fn new(
5626 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5627 ) -> Self {
5628 Self(RequestBuilder::new(stub))
5629 }
5630
5631 pub fn with_request<V: Into<crate::model::ListCurationsRequest>>(mut self, v: V) -> Self {
5633 self.0.request = v.into();
5634 self
5635 }
5636
5637 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5639 self.0.options = v.into();
5640 self
5641 }
5642
5643 pub async fn send(self) -> Result<crate::model::ListCurationsResponse> {
5645 (*self.0.stub)
5646 .list_curations(self.0.request, self.0.options)
5647 .await
5648 .map(gax::response::Response::into_body)
5649 }
5650
5651 pub fn by_page(
5653 self,
5654 ) -> impl gax::paginator::Paginator<crate::model::ListCurationsResponse, gax::error::Error>
5655 {
5656 use std::clone::Clone;
5657 let token = self.0.request.page_token.clone();
5658 let execute = move |token: String| {
5659 let mut builder = self.clone();
5660 builder.0.request = builder.0.request.set_page_token(token);
5661 builder.send()
5662 };
5663 gax::paginator::internal::new_paginator(token, execute)
5664 }
5665
5666 pub fn by_item(
5668 self,
5669 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCurationsResponse, gax::error::Error>
5670 {
5671 use gax::paginator::Paginator;
5672 self.by_page().items()
5673 }
5674
5675 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5679 self.0.request.parent = v.into();
5680 self
5681 }
5682
5683 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5685 self.0.request.filter = v.into();
5686 self
5687 }
5688
5689 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5691 self.0.request.page_size = v.into();
5692 self
5693 }
5694
5695 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5697 self.0.request.page_token = v.into();
5698 self
5699 }
5700 }
5701
5702 #[doc(hidden)]
5703 impl gax::options::internal::RequestBuilder for ListCurations {
5704 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5705 &mut self.0.options
5706 }
5707 }
5708
5709 #[derive(Clone, Debug)]
5727 pub struct UpdateCuration(RequestBuilder<crate::model::UpdateCurationRequest>);
5728
5729 impl UpdateCuration {
5730 pub(crate) fn new(
5731 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5732 ) -> Self {
5733 Self(RequestBuilder::new(stub))
5734 }
5735
5736 pub fn with_request<V: Into<crate::model::UpdateCurationRequest>>(mut self, v: V) -> Self {
5738 self.0.request = v.into();
5739 self
5740 }
5741
5742 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5744 self.0.options = v.into();
5745 self
5746 }
5747
5748 pub async fn send(self) -> Result<crate::model::Curation> {
5750 (*self.0.stub)
5751 .update_curation(self.0.request, self.0.options)
5752 .await
5753 .map(gax::response::Response::into_body)
5754 }
5755
5756 pub fn set_curation<T>(mut self, v: T) -> Self
5760 where
5761 T: std::convert::Into<crate::model::Curation>,
5762 {
5763 self.0.request.curation = std::option::Option::Some(v.into());
5764 self
5765 }
5766
5767 pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
5771 where
5772 T: std::convert::Into<crate::model::Curation>,
5773 {
5774 self.0.request.curation = v.map(|x| x.into());
5775 self
5776 }
5777
5778 pub fn set_update_mask<T>(mut self, v: T) -> Self
5780 where
5781 T: std::convert::Into<wkt::FieldMask>,
5782 {
5783 self.0.request.update_mask = std::option::Option::Some(v.into());
5784 self
5785 }
5786
5787 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5789 where
5790 T: std::convert::Into<wkt::FieldMask>,
5791 {
5792 self.0.request.update_mask = v.map(|x| x.into());
5793 self
5794 }
5795 }
5796
5797 #[doc(hidden)]
5798 impl gax::options::internal::RequestBuilder for UpdateCuration {
5799 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5800 &mut self.0.options
5801 }
5802 }
5803
5804 #[derive(Clone, Debug)]
5822 pub struct DeleteCuration(RequestBuilder<crate::model::DeleteCurationRequest>);
5823
5824 impl DeleteCuration {
5825 pub(crate) fn new(
5826 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5827 ) -> Self {
5828 Self(RequestBuilder::new(stub))
5829 }
5830
5831 pub fn with_request<V: Into<crate::model::DeleteCurationRequest>>(mut self, v: V) -> Self {
5833 self.0.request = v.into();
5834 self
5835 }
5836
5837 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5839 self.0.options = v.into();
5840 self
5841 }
5842
5843 pub async fn send(self) -> Result<()> {
5845 (*self.0.stub)
5846 .delete_curation(self.0.request, self.0.options)
5847 .await
5848 .map(gax::response::Response::into_body)
5849 }
5850
5851 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5855 self.0.request.name = v.into();
5856 self
5857 }
5858 }
5859
5860 #[doc(hidden)]
5861 impl gax::options::internal::RequestBuilder for DeleteCuration {
5862 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5863 &mut self.0.options
5864 }
5865 }
5866
5867 #[derive(Clone, Debug)]
5889 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5890
5891 impl ListLocations {
5892 pub(crate) fn new(
5893 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
5894 ) -> Self {
5895 Self(RequestBuilder::new(stub))
5896 }
5897
5898 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5900 mut self,
5901 v: V,
5902 ) -> Self {
5903 self.0.request = v.into();
5904 self
5905 }
5906
5907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5909 self.0.options = v.into();
5910 self
5911 }
5912
5913 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5915 (*self.0.stub)
5916 .list_locations(self.0.request, self.0.options)
5917 .await
5918 .map(gax::response::Response::into_body)
5919 }
5920
5921 pub fn by_page(
5923 self,
5924 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5925 {
5926 use std::clone::Clone;
5927 let token = self.0.request.page_token.clone();
5928 let execute = move |token: String| {
5929 let mut builder = self.clone();
5930 builder.0.request = builder.0.request.set_page_token(token);
5931 builder.send()
5932 };
5933 gax::paginator::internal::new_paginator(token, execute)
5934 }
5935
5936 pub fn by_item(
5938 self,
5939 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5940 {
5941 use gax::paginator::Paginator;
5942 self.by_page().items()
5943 }
5944
5945 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5947 self.0.request.name = v.into();
5948 self
5949 }
5950
5951 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5953 self.0.request.filter = v.into();
5954 self
5955 }
5956
5957 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5959 self.0.request.page_size = v.into();
5960 self
5961 }
5962
5963 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5965 self.0.request.page_token = v.into();
5966 self
5967 }
5968 }
5969
5970 #[doc(hidden)]
5971 impl gax::options::internal::RequestBuilder for ListLocations {
5972 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5973 &mut self.0.options
5974 }
5975 }
5976
5977 #[derive(Clone, Debug)]
5995 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5996
5997 impl GetLocation {
5998 pub(crate) fn new(
5999 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6000 ) -> Self {
6001 Self(RequestBuilder::new(stub))
6002 }
6003
6004 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6006 self.0.request = v.into();
6007 self
6008 }
6009
6010 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6012 self.0.options = v.into();
6013 self
6014 }
6015
6016 pub async fn send(self) -> Result<location::model::Location> {
6018 (*self.0.stub)
6019 .get_location(self.0.request, self.0.options)
6020 .await
6021 .map(gax::response::Response::into_body)
6022 }
6023
6024 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6026 self.0.request.name = v.into();
6027 self
6028 }
6029 }
6030
6031 #[doc(hidden)]
6032 impl gax::options::internal::RequestBuilder for GetLocation {
6033 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6034 &mut self.0.options
6035 }
6036 }
6037
6038 #[derive(Clone, Debug)]
6060 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6061
6062 impl ListOperations {
6063 pub(crate) fn new(
6064 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6065 ) -> Self {
6066 Self(RequestBuilder::new(stub))
6067 }
6068
6069 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6071 mut self,
6072 v: V,
6073 ) -> Self {
6074 self.0.request = v.into();
6075 self
6076 }
6077
6078 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6080 self.0.options = v.into();
6081 self
6082 }
6083
6084 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6086 (*self.0.stub)
6087 .list_operations(self.0.request, self.0.options)
6088 .await
6089 .map(gax::response::Response::into_body)
6090 }
6091
6092 pub fn by_page(
6094 self,
6095 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6096 {
6097 use std::clone::Clone;
6098 let token = self.0.request.page_token.clone();
6099 let execute = move |token: String| {
6100 let mut builder = self.clone();
6101 builder.0.request = builder.0.request.set_page_token(token);
6102 builder.send()
6103 };
6104 gax::paginator::internal::new_paginator(token, execute)
6105 }
6106
6107 pub fn by_item(
6109 self,
6110 ) -> impl gax::paginator::ItemPaginator<
6111 longrunning::model::ListOperationsResponse,
6112 gax::error::Error,
6113 > {
6114 use gax::paginator::Paginator;
6115 self.by_page().items()
6116 }
6117
6118 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6120 self.0.request.name = v.into();
6121 self
6122 }
6123
6124 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6126 self.0.request.filter = v.into();
6127 self
6128 }
6129
6130 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6132 self.0.request.page_size = v.into();
6133 self
6134 }
6135
6136 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6138 self.0.request.page_token = v.into();
6139 self
6140 }
6141
6142 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6144 self.0.request.return_partial_success = v.into();
6145 self
6146 }
6147 }
6148
6149 #[doc(hidden)]
6150 impl gax::options::internal::RequestBuilder for ListOperations {
6151 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6152 &mut self.0.options
6153 }
6154 }
6155
6156 #[derive(Clone, Debug)]
6174 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6175
6176 impl GetOperation {
6177 pub(crate) fn new(
6178 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6179 ) -> Self {
6180 Self(RequestBuilder::new(stub))
6181 }
6182
6183 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6185 mut self,
6186 v: V,
6187 ) -> Self {
6188 self.0.request = v.into();
6189 self
6190 }
6191
6192 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6194 self.0.options = v.into();
6195 self
6196 }
6197
6198 pub async fn send(self) -> Result<longrunning::model::Operation> {
6200 (*self.0.stub)
6201 .get_operation(self.0.request, self.0.options)
6202 .await
6203 .map(gax::response::Response::into_body)
6204 }
6205
6206 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6208 self.0.request.name = v.into();
6209 self
6210 }
6211 }
6212
6213 #[doc(hidden)]
6214 impl gax::options::internal::RequestBuilder for GetOperation {
6215 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6216 &mut self.0.options
6217 }
6218 }
6219
6220 #[derive(Clone, Debug)]
6238 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6239
6240 impl DeleteOperation {
6241 pub(crate) fn new(
6242 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6243 ) -> Self {
6244 Self(RequestBuilder::new(stub))
6245 }
6246
6247 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6249 mut self,
6250 v: V,
6251 ) -> Self {
6252 self.0.request = v.into();
6253 self
6254 }
6255
6256 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6258 self.0.options = v.into();
6259 self
6260 }
6261
6262 pub async fn send(self) -> Result<()> {
6264 (*self.0.stub)
6265 .delete_operation(self.0.request, self.0.options)
6266 .await
6267 .map(gax::response::Response::into_body)
6268 }
6269
6270 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6272 self.0.request.name = v.into();
6273 self
6274 }
6275 }
6276
6277 #[doc(hidden)]
6278 impl gax::options::internal::RequestBuilder for DeleteOperation {
6279 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6280 &mut self.0.options
6281 }
6282 }
6283
6284 #[derive(Clone, Debug)]
6302 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6303
6304 impl CancelOperation {
6305 pub(crate) fn new(
6306 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubCurate>,
6307 ) -> Self {
6308 Self(RequestBuilder::new(stub))
6309 }
6310
6311 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6313 mut self,
6314 v: V,
6315 ) -> Self {
6316 self.0.request = v.into();
6317 self
6318 }
6319
6320 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6322 self.0.options = v.into();
6323 self
6324 }
6325
6326 pub async fn send(self) -> Result<()> {
6328 (*self.0.stub)
6329 .cancel_operation(self.0.request, self.0.options)
6330 .await
6331 .map(gax::response::Response::into_body)
6332 }
6333
6334 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6336 self.0.request.name = v.into();
6337 self
6338 }
6339 }
6340
6341 #[doc(hidden)]
6342 impl gax::options::internal::RequestBuilder for CancelOperation {
6343 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6344 &mut self.0.options
6345 }
6346 }
6347}
6348
6349pub mod api_hub_discovery {
6350 use crate::Result;
6351
6352 pub type ClientBuilder =
6366 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6367
6368 pub(crate) mod client {
6369 use super::super::super::client::ApiHubDiscovery;
6370 pub struct Factory;
6371 impl gax::client_builder::internal::ClientFactory for Factory {
6372 type Client = ApiHubDiscovery;
6373 type Credentials = gaxi::options::Credentials;
6374 async fn build(
6375 self,
6376 config: gaxi::options::ClientConfig,
6377 ) -> gax::client_builder::Result<Self::Client> {
6378 Self::Client::new(config).await
6379 }
6380 }
6381 }
6382
6383 #[derive(Clone, Debug)]
6385 pub(crate) struct RequestBuilder<R: std::default::Default> {
6386 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6387 request: R,
6388 options: gax::options::RequestOptions,
6389 }
6390
6391 impl<R> RequestBuilder<R>
6392 where
6393 R: std::default::Default,
6394 {
6395 pub(crate) fn new(
6396 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6397 ) -> Self {
6398 Self {
6399 stub,
6400 request: R::default(),
6401 options: gax::options::RequestOptions::default(),
6402 }
6403 }
6404 }
6405
6406 #[derive(Clone, Debug)]
6428 pub struct ListDiscoveredApiObservations(
6429 RequestBuilder<crate::model::ListDiscoveredApiObservationsRequest>,
6430 );
6431
6432 impl ListDiscoveredApiObservations {
6433 pub(crate) fn new(
6434 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6435 ) -> Self {
6436 Self(RequestBuilder::new(stub))
6437 }
6438
6439 pub fn with_request<V: Into<crate::model::ListDiscoveredApiObservationsRequest>>(
6441 mut self,
6442 v: V,
6443 ) -> Self {
6444 self.0.request = v.into();
6445 self
6446 }
6447
6448 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6450 self.0.options = v.into();
6451 self
6452 }
6453
6454 pub async fn send(self) -> Result<crate::model::ListDiscoveredApiObservationsResponse> {
6456 (*self.0.stub)
6457 .list_discovered_api_observations(self.0.request, self.0.options)
6458 .await
6459 .map(gax::response::Response::into_body)
6460 }
6461
6462 pub fn by_page(
6464 self,
6465 ) -> impl gax::paginator::Paginator<
6466 crate::model::ListDiscoveredApiObservationsResponse,
6467 gax::error::Error,
6468 > {
6469 use std::clone::Clone;
6470 let token = self.0.request.page_token.clone();
6471 let execute = move |token: String| {
6472 let mut builder = self.clone();
6473 builder.0.request = builder.0.request.set_page_token(token);
6474 builder.send()
6475 };
6476 gax::paginator::internal::new_paginator(token, execute)
6477 }
6478
6479 pub fn by_item(
6481 self,
6482 ) -> impl gax::paginator::ItemPaginator<
6483 crate::model::ListDiscoveredApiObservationsResponse,
6484 gax::error::Error,
6485 > {
6486 use gax::paginator::Paginator;
6487 self.by_page().items()
6488 }
6489
6490 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6494 self.0.request.parent = v.into();
6495 self
6496 }
6497
6498 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6500 self.0.request.page_size = v.into();
6501 self
6502 }
6503
6504 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6506 self.0.request.page_token = v.into();
6507 self
6508 }
6509 }
6510
6511 #[doc(hidden)]
6512 impl gax::options::internal::RequestBuilder for ListDiscoveredApiObservations {
6513 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6514 &mut self.0.options
6515 }
6516 }
6517
6518 #[derive(Clone, Debug)]
6536 pub struct GetDiscoveredApiObservation(
6537 RequestBuilder<crate::model::GetDiscoveredApiObservationRequest>,
6538 );
6539
6540 impl GetDiscoveredApiObservation {
6541 pub(crate) fn new(
6542 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6543 ) -> Self {
6544 Self(RequestBuilder::new(stub))
6545 }
6546
6547 pub fn with_request<V: Into<crate::model::GetDiscoveredApiObservationRequest>>(
6549 mut self,
6550 v: V,
6551 ) -> Self {
6552 self.0.request = v.into();
6553 self
6554 }
6555
6556 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6558 self.0.options = v.into();
6559 self
6560 }
6561
6562 pub async fn send(self) -> Result<crate::model::DiscoveredApiObservation> {
6564 (*self.0.stub)
6565 .get_discovered_api_observation(self.0.request, self.0.options)
6566 .await
6567 .map(gax::response::Response::into_body)
6568 }
6569
6570 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6574 self.0.request.name = v.into();
6575 self
6576 }
6577 }
6578
6579 #[doc(hidden)]
6580 impl gax::options::internal::RequestBuilder for GetDiscoveredApiObservation {
6581 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6582 &mut self.0.options
6583 }
6584 }
6585
6586 #[derive(Clone, Debug)]
6608 pub struct ListDiscoveredApiOperations(
6609 RequestBuilder<crate::model::ListDiscoveredApiOperationsRequest>,
6610 );
6611
6612 impl ListDiscoveredApiOperations {
6613 pub(crate) fn new(
6614 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6615 ) -> Self {
6616 Self(RequestBuilder::new(stub))
6617 }
6618
6619 pub fn with_request<V: Into<crate::model::ListDiscoveredApiOperationsRequest>>(
6621 mut self,
6622 v: V,
6623 ) -> Self {
6624 self.0.request = v.into();
6625 self
6626 }
6627
6628 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6630 self.0.options = v.into();
6631 self
6632 }
6633
6634 pub async fn send(self) -> Result<crate::model::ListDiscoveredApiOperationsResponse> {
6636 (*self.0.stub)
6637 .list_discovered_api_operations(self.0.request, self.0.options)
6638 .await
6639 .map(gax::response::Response::into_body)
6640 }
6641
6642 pub fn by_page(
6644 self,
6645 ) -> impl gax::paginator::Paginator<
6646 crate::model::ListDiscoveredApiOperationsResponse,
6647 gax::error::Error,
6648 > {
6649 use std::clone::Clone;
6650 let token = self.0.request.page_token.clone();
6651 let execute = move |token: String| {
6652 let mut builder = self.clone();
6653 builder.0.request = builder.0.request.set_page_token(token);
6654 builder.send()
6655 };
6656 gax::paginator::internal::new_paginator(token, execute)
6657 }
6658
6659 pub fn by_item(
6661 self,
6662 ) -> impl gax::paginator::ItemPaginator<
6663 crate::model::ListDiscoveredApiOperationsResponse,
6664 gax::error::Error,
6665 > {
6666 use gax::paginator::Paginator;
6667 self.by_page().items()
6668 }
6669
6670 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6674 self.0.request.parent = v.into();
6675 self
6676 }
6677
6678 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6680 self.0.request.page_size = v.into();
6681 self
6682 }
6683
6684 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6686 self.0.request.page_token = v.into();
6687 self
6688 }
6689 }
6690
6691 #[doc(hidden)]
6692 impl gax::options::internal::RequestBuilder for ListDiscoveredApiOperations {
6693 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6694 &mut self.0.options
6695 }
6696 }
6697
6698 #[derive(Clone, Debug)]
6716 pub struct GetDiscoveredApiOperation(
6717 RequestBuilder<crate::model::GetDiscoveredApiOperationRequest>,
6718 );
6719
6720 impl GetDiscoveredApiOperation {
6721 pub(crate) fn new(
6722 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6723 ) -> Self {
6724 Self(RequestBuilder::new(stub))
6725 }
6726
6727 pub fn with_request<V: Into<crate::model::GetDiscoveredApiOperationRequest>>(
6729 mut self,
6730 v: V,
6731 ) -> Self {
6732 self.0.request = v.into();
6733 self
6734 }
6735
6736 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6738 self.0.options = v.into();
6739 self
6740 }
6741
6742 pub async fn send(self) -> Result<crate::model::DiscoveredApiOperation> {
6744 (*self.0.stub)
6745 .get_discovered_api_operation(self.0.request, self.0.options)
6746 .await
6747 .map(gax::response::Response::into_body)
6748 }
6749
6750 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6754 self.0.request.name = v.into();
6755 self
6756 }
6757 }
6758
6759 #[doc(hidden)]
6760 impl gax::options::internal::RequestBuilder for GetDiscoveredApiOperation {
6761 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6762 &mut self.0.options
6763 }
6764 }
6765
6766 #[derive(Clone, Debug)]
6788 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
6789
6790 impl ListLocations {
6791 pub(crate) fn new(
6792 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6793 ) -> Self {
6794 Self(RequestBuilder::new(stub))
6795 }
6796
6797 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
6799 mut self,
6800 v: V,
6801 ) -> Self {
6802 self.0.request = v.into();
6803 self
6804 }
6805
6806 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6808 self.0.options = v.into();
6809 self
6810 }
6811
6812 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
6814 (*self.0.stub)
6815 .list_locations(self.0.request, self.0.options)
6816 .await
6817 .map(gax::response::Response::into_body)
6818 }
6819
6820 pub fn by_page(
6822 self,
6823 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
6824 {
6825 use std::clone::Clone;
6826 let token = self.0.request.page_token.clone();
6827 let execute = move |token: String| {
6828 let mut builder = self.clone();
6829 builder.0.request = builder.0.request.set_page_token(token);
6830 builder.send()
6831 };
6832 gax::paginator::internal::new_paginator(token, execute)
6833 }
6834
6835 pub fn by_item(
6837 self,
6838 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
6839 {
6840 use gax::paginator::Paginator;
6841 self.by_page().items()
6842 }
6843
6844 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6846 self.0.request.name = v.into();
6847 self
6848 }
6849
6850 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6852 self.0.request.filter = v.into();
6853 self
6854 }
6855
6856 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6858 self.0.request.page_size = v.into();
6859 self
6860 }
6861
6862 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6864 self.0.request.page_token = v.into();
6865 self
6866 }
6867 }
6868
6869 #[doc(hidden)]
6870 impl gax::options::internal::RequestBuilder for ListLocations {
6871 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6872 &mut self.0.options
6873 }
6874 }
6875
6876 #[derive(Clone, Debug)]
6894 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
6895
6896 impl GetLocation {
6897 pub(crate) fn new(
6898 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6899 ) -> Self {
6900 Self(RequestBuilder::new(stub))
6901 }
6902
6903 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6905 self.0.request = v.into();
6906 self
6907 }
6908
6909 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6911 self.0.options = v.into();
6912 self
6913 }
6914
6915 pub async fn send(self) -> Result<location::model::Location> {
6917 (*self.0.stub)
6918 .get_location(self.0.request, self.0.options)
6919 .await
6920 .map(gax::response::Response::into_body)
6921 }
6922
6923 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6925 self.0.request.name = v.into();
6926 self
6927 }
6928 }
6929
6930 #[doc(hidden)]
6931 impl gax::options::internal::RequestBuilder for GetLocation {
6932 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6933 &mut self.0.options
6934 }
6935 }
6936
6937 #[derive(Clone, Debug)]
6959 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6960
6961 impl ListOperations {
6962 pub(crate) fn new(
6963 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
6964 ) -> Self {
6965 Self(RequestBuilder::new(stub))
6966 }
6967
6968 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6970 mut self,
6971 v: V,
6972 ) -> Self {
6973 self.0.request = v.into();
6974 self
6975 }
6976
6977 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6979 self.0.options = v.into();
6980 self
6981 }
6982
6983 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6985 (*self.0.stub)
6986 .list_operations(self.0.request, self.0.options)
6987 .await
6988 .map(gax::response::Response::into_body)
6989 }
6990
6991 pub fn by_page(
6993 self,
6994 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6995 {
6996 use std::clone::Clone;
6997 let token = self.0.request.page_token.clone();
6998 let execute = move |token: String| {
6999 let mut builder = self.clone();
7000 builder.0.request = builder.0.request.set_page_token(token);
7001 builder.send()
7002 };
7003 gax::paginator::internal::new_paginator(token, execute)
7004 }
7005
7006 pub fn by_item(
7008 self,
7009 ) -> impl gax::paginator::ItemPaginator<
7010 longrunning::model::ListOperationsResponse,
7011 gax::error::Error,
7012 > {
7013 use gax::paginator::Paginator;
7014 self.by_page().items()
7015 }
7016
7017 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7019 self.0.request.name = v.into();
7020 self
7021 }
7022
7023 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7025 self.0.request.filter = v.into();
7026 self
7027 }
7028
7029 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7031 self.0.request.page_size = v.into();
7032 self
7033 }
7034
7035 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7037 self.0.request.page_token = v.into();
7038 self
7039 }
7040
7041 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7043 self.0.request.return_partial_success = v.into();
7044 self
7045 }
7046 }
7047
7048 #[doc(hidden)]
7049 impl gax::options::internal::RequestBuilder for ListOperations {
7050 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7051 &mut self.0.options
7052 }
7053 }
7054
7055 #[derive(Clone, Debug)]
7073 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7074
7075 impl GetOperation {
7076 pub(crate) fn new(
7077 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
7078 ) -> Self {
7079 Self(RequestBuilder::new(stub))
7080 }
7081
7082 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7084 mut self,
7085 v: V,
7086 ) -> Self {
7087 self.0.request = v.into();
7088 self
7089 }
7090
7091 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7093 self.0.options = v.into();
7094 self
7095 }
7096
7097 pub async fn send(self) -> Result<longrunning::model::Operation> {
7099 (*self.0.stub)
7100 .get_operation(self.0.request, self.0.options)
7101 .await
7102 .map(gax::response::Response::into_body)
7103 }
7104
7105 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7107 self.0.request.name = v.into();
7108 self
7109 }
7110 }
7111
7112 #[doc(hidden)]
7113 impl gax::options::internal::RequestBuilder for GetOperation {
7114 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7115 &mut self.0.options
7116 }
7117 }
7118
7119 #[derive(Clone, Debug)]
7137 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7138
7139 impl DeleteOperation {
7140 pub(crate) fn new(
7141 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
7142 ) -> Self {
7143 Self(RequestBuilder::new(stub))
7144 }
7145
7146 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7148 mut self,
7149 v: V,
7150 ) -> Self {
7151 self.0.request = v.into();
7152 self
7153 }
7154
7155 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7157 self.0.options = v.into();
7158 self
7159 }
7160
7161 pub async fn send(self) -> Result<()> {
7163 (*self.0.stub)
7164 .delete_operation(self.0.request, self.0.options)
7165 .await
7166 .map(gax::response::Response::into_body)
7167 }
7168
7169 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7171 self.0.request.name = v.into();
7172 self
7173 }
7174 }
7175
7176 #[doc(hidden)]
7177 impl gax::options::internal::RequestBuilder for DeleteOperation {
7178 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7179 &mut self.0.options
7180 }
7181 }
7182
7183 #[derive(Clone, Debug)]
7201 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
7202
7203 impl CancelOperation {
7204 pub(crate) fn new(
7205 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubDiscovery>,
7206 ) -> Self {
7207 Self(RequestBuilder::new(stub))
7208 }
7209
7210 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
7212 mut self,
7213 v: V,
7214 ) -> Self {
7215 self.0.request = v.into();
7216 self
7217 }
7218
7219 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7221 self.0.options = v.into();
7222 self
7223 }
7224
7225 pub async fn send(self) -> Result<()> {
7227 (*self.0.stub)
7228 .cancel_operation(self.0.request, self.0.options)
7229 .await
7230 .map(gax::response::Response::into_body)
7231 }
7232
7233 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7235 self.0.request.name = v.into();
7236 self
7237 }
7238 }
7239
7240 #[doc(hidden)]
7241 impl gax::options::internal::RequestBuilder for CancelOperation {
7242 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7243 &mut self.0.options
7244 }
7245 }
7246}
7247
7248pub mod host_project_registration_service {
7249 use crate::Result;
7250
7251 pub type ClientBuilder =
7265 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7266
7267 pub(crate) mod client {
7268 use super::super::super::client::HostProjectRegistrationService;
7269 pub struct Factory;
7270 impl gax::client_builder::internal::ClientFactory for Factory {
7271 type Client = HostProjectRegistrationService;
7272 type Credentials = gaxi::options::Credentials;
7273 async fn build(
7274 self,
7275 config: gaxi::options::ClientConfig,
7276 ) -> gax::client_builder::Result<Self::Client> {
7277 Self::Client::new(config).await
7278 }
7279 }
7280 }
7281
7282 #[derive(Clone, Debug)]
7284 pub(crate) struct RequestBuilder<R: std::default::Default> {
7285 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7286 request: R,
7287 options: gax::options::RequestOptions,
7288 }
7289
7290 impl<R> RequestBuilder<R>
7291 where
7292 R: std::default::Default,
7293 {
7294 pub(crate) fn new(
7295 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7296 ) -> Self {
7297 Self {
7298 stub,
7299 request: R::default(),
7300 options: gax::options::RequestOptions::default(),
7301 }
7302 }
7303 }
7304
7305 #[derive(Clone, Debug)]
7323 pub struct CreateHostProjectRegistration(
7324 RequestBuilder<crate::model::CreateHostProjectRegistrationRequest>,
7325 );
7326
7327 impl CreateHostProjectRegistration {
7328 pub(crate) fn new(
7329 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7330 ) -> Self {
7331 Self(RequestBuilder::new(stub))
7332 }
7333
7334 pub fn with_request<V: Into<crate::model::CreateHostProjectRegistrationRequest>>(
7336 mut self,
7337 v: V,
7338 ) -> Self {
7339 self.0.request = v.into();
7340 self
7341 }
7342
7343 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7345 self.0.options = v.into();
7346 self
7347 }
7348
7349 pub async fn send(self) -> Result<crate::model::HostProjectRegistration> {
7351 (*self.0.stub)
7352 .create_host_project_registration(self.0.request, self.0.options)
7353 .await
7354 .map(gax::response::Response::into_body)
7355 }
7356
7357 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7361 self.0.request.parent = v.into();
7362 self
7363 }
7364
7365 pub fn set_host_project_registration_id<T: Into<std::string::String>>(
7369 mut self,
7370 v: T,
7371 ) -> Self {
7372 self.0.request.host_project_registration_id = v.into();
7373 self
7374 }
7375
7376 pub fn set_host_project_registration<T>(mut self, v: T) -> Self
7380 where
7381 T: std::convert::Into<crate::model::HostProjectRegistration>,
7382 {
7383 self.0.request.host_project_registration = std::option::Option::Some(v.into());
7384 self
7385 }
7386
7387 pub fn set_or_clear_host_project_registration<T>(
7391 mut self,
7392 v: std::option::Option<T>,
7393 ) -> Self
7394 where
7395 T: std::convert::Into<crate::model::HostProjectRegistration>,
7396 {
7397 self.0.request.host_project_registration = v.map(|x| x.into());
7398 self
7399 }
7400 }
7401
7402 #[doc(hidden)]
7403 impl gax::options::internal::RequestBuilder for CreateHostProjectRegistration {
7404 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7405 &mut self.0.options
7406 }
7407 }
7408
7409 #[derive(Clone, Debug)]
7427 pub struct GetHostProjectRegistration(
7428 RequestBuilder<crate::model::GetHostProjectRegistrationRequest>,
7429 );
7430
7431 impl GetHostProjectRegistration {
7432 pub(crate) fn new(
7433 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7434 ) -> Self {
7435 Self(RequestBuilder::new(stub))
7436 }
7437
7438 pub fn with_request<V: Into<crate::model::GetHostProjectRegistrationRequest>>(
7440 mut self,
7441 v: V,
7442 ) -> Self {
7443 self.0.request = v.into();
7444 self
7445 }
7446
7447 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7449 self.0.options = v.into();
7450 self
7451 }
7452
7453 pub async fn send(self) -> Result<crate::model::HostProjectRegistration> {
7455 (*self.0.stub)
7456 .get_host_project_registration(self.0.request, self.0.options)
7457 .await
7458 .map(gax::response::Response::into_body)
7459 }
7460
7461 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7465 self.0.request.name = v.into();
7466 self
7467 }
7468 }
7469
7470 #[doc(hidden)]
7471 impl gax::options::internal::RequestBuilder for GetHostProjectRegistration {
7472 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7473 &mut self.0.options
7474 }
7475 }
7476
7477 #[derive(Clone, Debug)]
7499 pub struct ListHostProjectRegistrations(
7500 RequestBuilder<crate::model::ListHostProjectRegistrationsRequest>,
7501 );
7502
7503 impl ListHostProjectRegistrations {
7504 pub(crate) fn new(
7505 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7506 ) -> Self {
7507 Self(RequestBuilder::new(stub))
7508 }
7509
7510 pub fn with_request<V: Into<crate::model::ListHostProjectRegistrationsRequest>>(
7512 mut self,
7513 v: V,
7514 ) -> Self {
7515 self.0.request = v.into();
7516 self
7517 }
7518
7519 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7521 self.0.options = v.into();
7522 self
7523 }
7524
7525 pub async fn send(self) -> Result<crate::model::ListHostProjectRegistrationsResponse> {
7527 (*self.0.stub)
7528 .list_host_project_registrations(self.0.request, self.0.options)
7529 .await
7530 .map(gax::response::Response::into_body)
7531 }
7532
7533 pub fn by_page(
7535 self,
7536 ) -> impl gax::paginator::Paginator<
7537 crate::model::ListHostProjectRegistrationsResponse,
7538 gax::error::Error,
7539 > {
7540 use std::clone::Clone;
7541 let token = self.0.request.page_token.clone();
7542 let execute = move |token: String| {
7543 let mut builder = self.clone();
7544 builder.0.request = builder.0.request.set_page_token(token);
7545 builder.send()
7546 };
7547 gax::paginator::internal::new_paginator(token, execute)
7548 }
7549
7550 pub fn by_item(
7552 self,
7553 ) -> impl gax::paginator::ItemPaginator<
7554 crate::model::ListHostProjectRegistrationsResponse,
7555 gax::error::Error,
7556 > {
7557 use gax::paginator::Paginator;
7558 self.by_page().items()
7559 }
7560
7561 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7565 self.0.request.parent = v.into();
7566 self
7567 }
7568
7569 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7571 self.0.request.page_size = v.into();
7572 self
7573 }
7574
7575 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7577 self.0.request.page_token = v.into();
7578 self
7579 }
7580
7581 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7583 self.0.request.filter = v.into();
7584 self
7585 }
7586
7587 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7589 self.0.request.order_by = v.into();
7590 self
7591 }
7592 }
7593
7594 #[doc(hidden)]
7595 impl gax::options::internal::RequestBuilder for ListHostProjectRegistrations {
7596 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7597 &mut self.0.options
7598 }
7599 }
7600
7601 #[derive(Clone, Debug)]
7623 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7624
7625 impl ListLocations {
7626 pub(crate) fn new(
7627 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7628 ) -> Self {
7629 Self(RequestBuilder::new(stub))
7630 }
7631
7632 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7634 mut self,
7635 v: V,
7636 ) -> Self {
7637 self.0.request = v.into();
7638 self
7639 }
7640
7641 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7643 self.0.options = v.into();
7644 self
7645 }
7646
7647 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7649 (*self.0.stub)
7650 .list_locations(self.0.request, self.0.options)
7651 .await
7652 .map(gax::response::Response::into_body)
7653 }
7654
7655 pub fn by_page(
7657 self,
7658 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7659 {
7660 use std::clone::Clone;
7661 let token = self.0.request.page_token.clone();
7662 let execute = move |token: String| {
7663 let mut builder = self.clone();
7664 builder.0.request = builder.0.request.set_page_token(token);
7665 builder.send()
7666 };
7667 gax::paginator::internal::new_paginator(token, execute)
7668 }
7669
7670 pub fn by_item(
7672 self,
7673 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7674 {
7675 use gax::paginator::Paginator;
7676 self.by_page().items()
7677 }
7678
7679 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7681 self.0.request.name = v.into();
7682 self
7683 }
7684
7685 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7687 self.0.request.filter = v.into();
7688 self
7689 }
7690
7691 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7693 self.0.request.page_size = v.into();
7694 self
7695 }
7696
7697 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7699 self.0.request.page_token = v.into();
7700 self
7701 }
7702 }
7703
7704 #[doc(hidden)]
7705 impl gax::options::internal::RequestBuilder for ListLocations {
7706 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7707 &mut self.0.options
7708 }
7709 }
7710
7711 #[derive(Clone, Debug)]
7729 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7730
7731 impl GetLocation {
7732 pub(crate) fn new(
7733 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7734 ) -> Self {
7735 Self(RequestBuilder::new(stub))
7736 }
7737
7738 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7740 self.0.request = v.into();
7741 self
7742 }
7743
7744 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7746 self.0.options = v.into();
7747 self
7748 }
7749
7750 pub async fn send(self) -> Result<location::model::Location> {
7752 (*self.0.stub)
7753 .get_location(self.0.request, self.0.options)
7754 .await
7755 .map(gax::response::Response::into_body)
7756 }
7757
7758 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7760 self.0.request.name = v.into();
7761 self
7762 }
7763 }
7764
7765 #[doc(hidden)]
7766 impl gax::options::internal::RequestBuilder for GetLocation {
7767 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7768 &mut self.0.options
7769 }
7770 }
7771
7772 #[derive(Clone, Debug)]
7794 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7795
7796 impl ListOperations {
7797 pub(crate) fn new(
7798 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7799 ) -> Self {
7800 Self(RequestBuilder::new(stub))
7801 }
7802
7803 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7805 mut self,
7806 v: V,
7807 ) -> Self {
7808 self.0.request = v.into();
7809 self
7810 }
7811
7812 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7814 self.0.options = v.into();
7815 self
7816 }
7817
7818 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7820 (*self.0.stub)
7821 .list_operations(self.0.request, self.0.options)
7822 .await
7823 .map(gax::response::Response::into_body)
7824 }
7825
7826 pub fn by_page(
7828 self,
7829 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7830 {
7831 use std::clone::Clone;
7832 let token = self.0.request.page_token.clone();
7833 let execute = move |token: String| {
7834 let mut builder = self.clone();
7835 builder.0.request = builder.0.request.set_page_token(token);
7836 builder.send()
7837 };
7838 gax::paginator::internal::new_paginator(token, execute)
7839 }
7840
7841 pub fn by_item(
7843 self,
7844 ) -> impl gax::paginator::ItemPaginator<
7845 longrunning::model::ListOperationsResponse,
7846 gax::error::Error,
7847 > {
7848 use gax::paginator::Paginator;
7849 self.by_page().items()
7850 }
7851
7852 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7854 self.0.request.name = v.into();
7855 self
7856 }
7857
7858 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7860 self.0.request.filter = v.into();
7861 self
7862 }
7863
7864 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7866 self.0.request.page_size = v.into();
7867 self
7868 }
7869
7870 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7872 self.0.request.page_token = v.into();
7873 self
7874 }
7875
7876 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7878 self.0.request.return_partial_success = v.into();
7879 self
7880 }
7881 }
7882
7883 #[doc(hidden)]
7884 impl gax::options::internal::RequestBuilder for ListOperations {
7885 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7886 &mut self.0.options
7887 }
7888 }
7889
7890 #[derive(Clone, Debug)]
7908 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7909
7910 impl GetOperation {
7911 pub(crate) fn new(
7912 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7913 ) -> Self {
7914 Self(RequestBuilder::new(stub))
7915 }
7916
7917 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7919 mut self,
7920 v: V,
7921 ) -> Self {
7922 self.0.request = v.into();
7923 self
7924 }
7925
7926 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7928 self.0.options = v.into();
7929 self
7930 }
7931
7932 pub async fn send(self) -> Result<longrunning::model::Operation> {
7934 (*self.0.stub)
7935 .get_operation(self.0.request, self.0.options)
7936 .await
7937 .map(gax::response::Response::into_body)
7938 }
7939
7940 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7942 self.0.request.name = v.into();
7943 self
7944 }
7945 }
7946
7947 #[doc(hidden)]
7948 impl gax::options::internal::RequestBuilder for GetOperation {
7949 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7950 &mut self.0.options
7951 }
7952 }
7953
7954 #[derive(Clone, Debug)]
7972 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7973
7974 impl DeleteOperation {
7975 pub(crate) fn new(
7976 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
7977 ) -> Self {
7978 Self(RequestBuilder::new(stub))
7979 }
7980
7981 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7983 mut self,
7984 v: V,
7985 ) -> Self {
7986 self.0.request = v.into();
7987 self
7988 }
7989
7990 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7992 self.0.options = v.into();
7993 self
7994 }
7995
7996 pub async fn send(self) -> Result<()> {
7998 (*self.0.stub)
7999 .delete_operation(self.0.request, self.0.options)
8000 .await
8001 .map(gax::response::Response::into_body)
8002 }
8003
8004 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8006 self.0.request.name = v.into();
8007 self
8008 }
8009 }
8010
8011 #[doc(hidden)]
8012 impl gax::options::internal::RequestBuilder for DeleteOperation {
8013 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8014 &mut self.0.options
8015 }
8016 }
8017
8018 #[derive(Clone, Debug)]
8036 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8037
8038 impl CancelOperation {
8039 pub(crate) fn new(
8040 stub: std::sync::Arc<dyn super::super::stub::dynamic::HostProjectRegistrationService>,
8041 ) -> Self {
8042 Self(RequestBuilder::new(stub))
8043 }
8044
8045 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8047 mut self,
8048 v: V,
8049 ) -> Self {
8050 self.0.request = v.into();
8051 self
8052 }
8053
8054 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8056 self.0.options = v.into();
8057 self
8058 }
8059
8060 pub async fn send(self) -> Result<()> {
8062 (*self.0.stub)
8063 .cancel_operation(self.0.request, self.0.options)
8064 .await
8065 .map(gax::response::Response::into_body)
8066 }
8067
8068 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8070 self.0.request.name = v.into();
8071 self
8072 }
8073 }
8074
8075 #[doc(hidden)]
8076 impl gax::options::internal::RequestBuilder for CancelOperation {
8077 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8078 &mut self.0.options
8079 }
8080 }
8081}
8082
8083pub mod linting_service {
8084 use crate::Result;
8085
8086 pub type ClientBuilder =
8100 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8101
8102 pub(crate) mod client {
8103 use super::super::super::client::LintingService;
8104 pub struct Factory;
8105 impl gax::client_builder::internal::ClientFactory for Factory {
8106 type Client = LintingService;
8107 type Credentials = gaxi::options::Credentials;
8108 async fn build(
8109 self,
8110 config: gaxi::options::ClientConfig,
8111 ) -> gax::client_builder::Result<Self::Client> {
8112 Self::Client::new(config).await
8113 }
8114 }
8115 }
8116
8117 #[derive(Clone, Debug)]
8119 pub(crate) struct RequestBuilder<R: std::default::Default> {
8120 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8121 request: R,
8122 options: gax::options::RequestOptions,
8123 }
8124
8125 impl<R> RequestBuilder<R>
8126 where
8127 R: std::default::Default,
8128 {
8129 pub(crate) fn new(
8130 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8131 ) -> Self {
8132 Self {
8133 stub,
8134 request: R::default(),
8135 options: gax::options::RequestOptions::default(),
8136 }
8137 }
8138 }
8139
8140 #[derive(Clone, Debug)]
8158 pub struct GetStyleGuide(RequestBuilder<crate::model::GetStyleGuideRequest>);
8159
8160 impl GetStyleGuide {
8161 pub(crate) fn new(
8162 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8163 ) -> Self {
8164 Self(RequestBuilder::new(stub))
8165 }
8166
8167 pub fn with_request<V: Into<crate::model::GetStyleGuideRequest>>(mut self, v: V) -> Self {
8169 self.0.request = v.into();
8170 self
8171 }
8172
8173 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8175 self.0.options = v.into();
8176 self
8177 }
8178
8179 pub async fn send(self) -> Result<crate::model::StyleGuide> {
8181 (*self.0.stub)
8182 .get_style_guide(self.0.request, self.0.options)
8183 .await
8184 .map(gax::response::Response::into_body)
8185 }
8186
8187 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8191 self.0.request.name = v.into();
8192 self
8193 }
8194 }
8195
8196 #[doc(hidden)]
8197 impl gax::options::internal::RequestBuilder for GetStyleGuide {
8198 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8199 &mut self.0.options
8200 }
8201 }
8202
8203 #[derive(Clone, Debug)]
8221 pub struct UpdateStyleGuide(RequestBuilder<crate::model::UpdateStyleGuideRequest>);
8222
8223 impl UpdateStyleGuide {
8224 pub(crate) fn new(
8225 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8226 ) -> Self {
8227 Self(RequestBuilder::new(stub))
8228 }
8229
8230 pub fn with_request<V: Into<crate::model::UpdateStyleGuideRequest>>(
8232 mut self,
8233 v: V,
8234 ) -> Self {
8235 self.0.request = v.into();
8236 self
8237 }
8238
8239 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8241 self.0.options = v.into();
8242 self
8243 }
8244
8245 pub async fn send(self) -> Result<crate::model::StyleGuide> {
8247 (*self.0.stub)
8248 .update_style_guide(self.0.request, self.0.options)
8249 .await
8250 .map(gax::response::Response::into_body)
8251 }
8252
8253 pub fn set_style_guide<T>(mut self, v: T) -> Self
8257 where
8258 T: std::convert::Into<crate::model::StyleGuide>,
8259 {
8260 self.0.request.style_guide = std::option::Option::Some(v.into());
8261 self
8262 }
8263
8264 pub fn set_or_clear_style_guide<T>(mut self, v: std::option::Option<T>) -> Self
8268 where
8269 T: std::convert::Into<crate::model::StyleGuide>,
8270 {
8271 self.0.request.style_guide = v.map(|x| x.into());
8272 self
8273 }
8274
8275 pub fn set_update_mask<T>(mut self, v: T) -> Self
8277 where
8278 T: std::convert::Into<wkt::FieldMask>,
8279 {
8280 self.0.request.update_mask = std::option::Option::Some(v.into());
8281 self
8282 }
8283
8284 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8286 where
8287 T: std::convert::Into<wkt::FieldMask>,
8288 {
8289 self.0.request.update_mask = v.map(|x| x.into());
8290 self
8291 }
8292 }
8293
8294 #[doc(hidden)]
8295 impl gax::options::internal::RequestBuilder for UpdateStyleGuide {
8296 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8297 &mut self.0.options
8298 }
8299 }
8300
8301 #[derive(Clone, Debug)]
8319 pub struct GetStyleGuideContents(RequestBuilder<crate::model::GetStyleGuideContentsRequest>);
8320
8321 impl GetStyleGuideContents {
8322 pub(crate) fn new(
8323 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8324 ) -> Self {
8325 Self(RequestBuilder::new(stub))
8326 }
8327
8328 pub fn with_request<V: Into<crate::model::GetStyleGuideContentsRequest>>(
8330 mut self,
8331 v: V,
8332 ) -> Self {
8333 self.0.request = v.into();
8334 self
8335 }
8336
8337 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8339 self.0.options = v.into();
8340 self
8341 }
8342
8343 pub async fn send(self) -> Result<crate::model::StyleGuideContents> {
8345 (*self.0.stub)
8346 .get_style_guide_contents(self.0.request, self.0.options)
8347 .await
8348 .map(gax::response::Response::into_body)
8349 }
8350
8351 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8355 self.0.request.name = v.into();
8356 self
8357 }
8358 }
8359
8360 #[doc(hidden)]
8361 impl gax::options::internal::RequestBuilder for GetStyleGuideContents {
8362 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8363 &mut self.0.options
8364 }
8365 }
8366
8367 #[derive(Clone, Debug)]
8385 pub struct LintSpec(RequestBuilder<crate::model::LintSpecRequest>);
8386
8387 impl LintSpec {
8388 pub(crate) fn new(
8389 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8390 ) -> Self {
8391 Self(RequestBuilder::new(stub))
8392 }
8393
8394 pub fn with_request<V: Into<crate::model::LintSpecRequest>>(mut self, v: V) -> Self {
8396 self.0.request = v.into();
8397 self
8398 }
8399
8400 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8402 self.0.options = v.into();
8403 self
8404 }
8405
8406 pub async fn send(self) -> Result<()> {
8408 (*self.0.stub)
8409 .lint_spec(self.0.request, self.0.options)
8410 .await
8411 .map(gax::response::Response::into_body)
8412 }
8413
8414 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8418 self.0.request.name = v.into();
8419 self
8420 }
8421 }
8422
8423 #[doc(hidden)]
8424 impl gax::options::internal::RequestBuilder for LintSpec {
8425 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8426 &mut self.0.options
8427 }
8428 }
8429
8430 #[derive(Clone, Debug)]
8452 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
8453
8454 impl ListLocations {
8455 pub(crate) fn new(
8456 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8457 ) -> Self {
8458 Self(RequestBuilder::new(stub))
8459 }
8460
8461 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
8463 mut self,
8464 v: V,
8465 ) -> Self {
8466 self.0.request = v.into();
8467 self
8468 }
8469
8470 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8472 self.0.options = v.into();
8473 self
8474 }
8475
8476 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
8478 (*self.0.stub)
8479 .list_locations(self.0.request, self.0.options)
8480 .await
8481 .map(gax::response::Response::into_body)
8482 }
8483
8484 pub fn by_page(
8486 self,
8487 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
8488 {
8489 use std::clone::Clone;
8490 let token = self.0.request.page_token.clone();
8491 let execute = move |token: String| {
8492 let mut builder = self.clone();
8493 builder.0.request = builder.0.request.set_page_token(token);
8494 builder.send()
8495 };
8496 gax::paginator::internal::new_paginator(token, execute)
8497 }
8498
8499 pub fn by_item(
8501 self,
8502 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
8503 {
8504 use gax::paginator::Paginator;
8505 self.by_page().items()
8506 }
8507
8508 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8510 self.0.request.name = v.into();
8511 self
8512 }
8513
8514 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8516 self.0.request.filter = v.into();
8517 self
8518 }
8519
8520 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8522 self.0.request.page_size = v.into();
8523 self
8524 }
8525
8526 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8528 self.0.request.page_token = v.into();
8529 self
8530 }
8531 }
8532
8533 #[doc(hidden)]
8534 impl gax::options::internal::RequestBuilder for ListLocations {
8535 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8536 &mut self.0.options
8537 }
8538 }
8539
8540 #[derive(Clone, Debug)]
8558 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
8559
8560 impl GetLocation {
8561 pub(crate) fn new(
8562 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8563 ) -> Self {
8564 Self(RequestBuilder::new(stub))
8565 }
8566
8567 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
8569 self.0.request = v.into();
8570 self
8571 }
8572
8573 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8575 self.0.options = v.into();
8576 self
8577 }
8578
8579 pub async fn send(self) -> Result<location::model::Location> {
8581 (*self.0.stub)
8582 .get_location(self.0.request, self.0.options)
8583 .await
8584 .map(gax::response::Response::into_body)
8585 }
8586
8587 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8589 self.0.request.name = v.into();
8590 self
8591 }
8592 }
8593
8594 #[doc(hidden)]
8595 impl gax::options::internal::RequestBuilder for GetLocation {
8596 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8597 &mut self.0.options
8598 }
8599 }
8600
8601 #[derive(Clone, Debug)]
8623 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8624
8625 impl ListOperations {
8626 pub(crate) fn new(
8627 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8628 ) -> Self {
8629 Self(RequestBuilder::new(stub))
8630 }
8631
8632 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8634 mut self,
8635 v: V,
8636 ) -> Self {
8637 self.0.request = v.into();
8638 self
8639 }
8640
8641 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8643 self.0.options = v.into();
8644 self
8645 }
8646
8647 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8649 (*self.0.stub)
8650 .list_operations(self.0.request, self.0.options)
8651 .await
8652 .map(gax::response::Response::into_body)
8653 }
8654
8655 pub fn by_page(
8657 self,
8658 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8659 {
8660 use std::clone::Clone;
8661 let token = self.0.request.page_token.clone();
8662 let execute = move |token: String| {
8663 let mut builder = self.clone();
8664 builder.0.request = builder.0.request.set_page_token(token);
8665 builder.send()
8666 };
8667 gax::paginator::internal::new_paginator(token, execute)
8668 }
8669
8670 pub fn by_item(
8672 self,
8673 ) -> impl gax::paginator::ItemPaginator<
8674 longrunning::model::ListOperationsResponse,
8675 gax::error::Error,
8676 > {
8677 use gax::paginator::Paginator;
8678 self.by_page().items()
8679 }
8680
8681 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8683 self.0.request.name = v.into();
8684 self
8685 }
8686
8687 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8689 self.0.request.filter = v.into();
8690 self
8691 }
8692
8693 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8695 self.0.request.page_size = v.into();
8696 self
8697 }
8698
8699 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8701 self.0.request.page_token = v.into();
8702 self
8703 }
8704
8705 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8707 self.0.request.return_partial_success = v.into();
8708 self
8709 }
8710 }
8711
8712 #[doc(hidden)]
8713 impl gax::options::internal::RequestBuilder for ListOperations {
8714 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8715 &mut self.0.options
8716 }
8717 }
8718
8719 #[derive(Clone, Debug)]
8737 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8738
8739 impl GetOperation {
8740 pub(crate) fn new(
8741 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8742 ) -> Self {
8743 Self(RequestBuilder::new(stub))
8744 }
8745
8746 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8748 mut self,
8749 v: V,
8750 ) -> Self {
8751 self.0.request = v.into();
8752 self
8753 }
8754
8755 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8757 self.0.options = v.into();
8758 self
8759 }
8760
8761 pub async fn send(self) -> Result<longrunning::model::Operation> {
8763 (*self.0.stub)
8764 .get_operation(self.0.request, self.0.options)
8765 .await
8766 .map(gax::response::Response::into_body)
8767 }
8768
8769 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8771 self.0.request.name = v.into();
8772 self
8773 }
8774 }
8775
8776 #[doc(hidden)]
8777 impl gax::options::internal::RequestBuilder for GetOperation {
8778 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8779 &mut self.0.options
8780 }
8781 }
8782
8783 #[derive(Clone, Debug)]
8801 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8802
8803 impl DeleteOperation {
8804 pub(crate) fn new(
8805 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8806 ) -> Self {
8807 Self(RequestBuilder::new(stub))
8808 }
8809
8810 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8812 mut self,
8813 v: V,
8814 ) -> Self {
8815 self.0.request = v.into();
8816 self
8817 }
8818
8819 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8821 self.0.options = v.into();
8822 self
8823 }
8824
8825 pub async fn send(self) -> Result<()> {
8827 (*self.0.stub)
8828 .delete_operation(self.0.request, self.0.options)
8829 .await
8830 .map(gax::response::Response::into_body)
8831 }
8832
8833 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8835 self.0.request.name = v.into();
8836 self
8837 }
8838 }
8839
8840 #[doc(hidden)]
8841 impl gax::options::internal::RequestBuilder for DeleteOperation {
8842 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8843 &mut self.0.options
8844 }
8845 }
8846
8847 #[derive(Clone, Debug)]
8865 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8866
8867 impl CancelOperation {
8868 pub(crate) fn new(
8869 stub: std::sync::Arc<dyn super::super::stub::dynamic::LintingService>,
8870 ) -> Self {
8871 Self(RequestBuilder::new(stub))
8872 }
8873
8874 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8876 mut self,
8877 v: V,
8878 ) -> Self {
8879 self.0.request = v.into();
8880 self
8881 }
8882
8883 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8885 self.0.options = v.into();
8886 self
8887 }
8888
8889 pub async fn send(self) -> Result<()> {
8891 (*self.0.stub)
8892 .cancel_operation(self.0.request, self.0.options)
8893 .await
8894 .map(gax::response::Response::into_body)
8895 }
8896
8897 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8899 self.0.request.name = v.into();
8900 self
8901 }
8902 }
8903
8904 #[doc(hidden)]
8905 impl gax::options::internal::RequestBuilder for CancelOperation {
8906 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8907 &mut self.0.options
8908 }
8909 }
8910}
8911
8912pub mod api_hub_plugin {
8913 use crate::Result;
8914
8915 pub type ClientBuilder =
8929 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8930
8931 pub(crate) mod client {
8932 use super::super::super::client::ApiHubPlugin;
8933 pub struct Factory;
8934 impl gax::client_builder::internal::ClientFactory for Factory {
8935 type Client = ApiHubPlugin;
8936 type Credentials = gaxi::options::Credentials;
8937 async fn build(
8938 self,
8939 config: gaxi::options::ClientConfig,
8940 ) -> gax::client_builder::Result<Self::Client> {
8941 Self::Client::new(config).await
8942 }
8943 }
8944 }
8945
8946 #[derive(Clone, Debug)]
8948 pub(crate) struct RequestBuilder<R: std::default::Default> {
8949 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
8950 request: R,
8951 options: gax::options::RequestOptions,
8952 }
8953
8954 impl<R> RequestBuilder<R>
8955 where
8956 R: std::default::Default,
8957 {
8958 pub(crate) fn new(
8959 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
8960 ) -> Self {
8961 Self {
8962 stub,
8963 request: R::default(),
8964 options: gax::options::RequestOptions::default(),
8965 }
8966 }
8967 }
8968
8969 #[derive(Clone, Debug)]
8987 pub struct GetPlugin(RequestBuilder<crate::model::GetPluginRequest>);
8988
8989 impl GetPlugin {
8990 pub(crate) fn new(
8991 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
8992 ) -> Self {
8993 Self(RequestBuilder::new(stub))
8994 }
8995
8996 pub fn with_request<V: Into<crate::model::GetPluginRequest>>(mut self, v: V) -> Self {
8998 self.0.request = v.into();
8999 self
9000 }
9001
9002 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9004 self.0.options = v.into();
9005 self
9006 }
9007
9008 pub async fn send(self) -> Result<crate::model::Plugin> {
9010 (*self.0.stub)
9011 .get_plugin(self.0.request, self.0.options)
9012 .await
9013 .map(gax::response::Response::into_body)
9014 }
9015
9016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9020 self.0.request.name = v.into();
9021 self
9022 }
9023 }
9024
9025 #[doc(hidden)]
9026 impl gax::options::internal::RequestBuilder for GetPlugin {
9027 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9028 &mut self.0.options
9029 }
9030 }
9031
9032 #[derive(Clone, Debug)]
9050 pub struct EnablePlugin(RequestBuilder<crate::model::EnablePluginRequest>);
9051
9052 impl EnablePlugin {
9053 pub(crate) fn new(
9054 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9055 ) -> Self {
9056 Self(RequestBuilder::new(stub))
9057 }
9058
9059 pub fn with_request<V: Into<crate::model::EnablePluginRequest>>(mut self, v: V) -> Self {
9061 self.0.request = v.into();
9062 self
9063 }
9064
9065 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9067 self.0.options = v.into();
9068 self
9069 }
9070
9071 pub async fn send(self) -> Result<crate::model::Plugin> {
9073 (*self.0.stub)
9074 .enable_plugin(self.0.request, self.0.options)
9075 .await
9076 .map(gax::response::Response::into_body)
9077 }
9078
9079 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9083 self.0.request.name = v.into();
9084 self
9085 }
9086 }
9087
9088 #[doc(hidden)]
9089 impl gax::options::internal::RequestBuilder for EnablePlugin {
9090 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9091 &mut self.0.options
9092 }
9093 }
9094
9095 #[derive(Clone, Debug)]
9113 pub struct DisablePlugin(RequestBuilder<crate::model::DisablePluginRequest>);
9114
9115 impl DisablePlugin {
9116 pub(crate) fn new(
9117 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9118 ) -> Self {
9119 Self(RequestBuilder::new(stub))
9120 }
9121
9122 pub fn with_request<V: Into<crate::model::DisablePluginRequest>>(mut self, v: V) -> Self {
9124 self.0.request = v.into();
9125 self
9126 }
9127
9128 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9130 self.0.options = v.into();
9131 self
9132 }
9133
9134 pub async fn send(self) -> Result<crate::model::Plugin> {
9136 (*self.0.stub)
9137 .disable_plugin(self.0.request, self.0.options)
9138 .await
9139 .map(gax::response::Response::into_body)
9140 }
9141
9142 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9146 self.0.request.name = v.into();
9147 self
9148 }
9149 }
9150
9151 #[doc(hidden)]
9152 impl gax::options::internal::RequestBuilder for DisablePlugin {
9153 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9154 &mut self.0.options
9155 }
9156 }
9157
9158 #[derive(Clone, Debug)]
9176 pub struct CreatePlugin(RequestBuilder<crate::model::CreatePluginRequest>);
9177
9178 impl CreatePlugin {
9179 pub(crate) fn new(
9180 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9181 ) -> Self {
9182 Self(RequestBuilder::new(stub))
9183 }
9184
9185 pub fn with_request<V: Into<crate::model::CreatePluginRequest>>(mut self, v: V) -> Self {
9187 self.0.request = v.into();
9188 self
9189 }
9190
9191 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9193 self.0.options = v.into();
9194 self
9195 }
9196
9197 pub async fn send(self) -> Result<crate::model::Plugin> {
9199 (*self.0.stub)
9200 .create_plugin(self.0.request, self.0.options)
9201 .await
9202 .map(gax::response::Response::into_body)
9203 }
9204
9205 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9209 self.0.request.parent = v.into();
9210 self
9211 }
9212
9213 pub fn set_plugin_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9215 self.0.request.plugin_id = v.into();
9216 self
9217 }
9218
9219 pub fn set_plugin<T>(mut self, v: T) -> Self
9223 where
9224 T: std::convert::Into<crate::model::Plugin>,
9225 {
9226 self.0.request.plugin = std::option::Option::Some(v.into());
9227 self
9228 }
9229
9230 pub fn set_or_clear_plugin<T>(mut self, v: std::option::Option<T>) -> Self
9234 where
9235 T: std::convert::Into<crate::model::Plugin>,
9236 {
9237 self.0.request.plugin = v.map(|x| x.into());
9238 self
9239 }
9240 }
9241
9242 #[doc(hidden)]
9243 impl gax::options::internal::RequestBuilder for CreatePlugin {
9244 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9245 &mut self.0.options
9246 }
9247 }
9248
9249 #[derive(Clone, Debug)]
9271 pub struct ListPlugins(RequestBuilder<crate::model::ListPluginsRequest>);
9272
9273 impl ListPlugins {
9274 pub(crate) fn new(
9275 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9276 ) -> Self {
9277 Self(RequestBuilder::new(stub))
9278 }
9279
9280 pub fn with_request<V: Into<crate::model::ListPluginsRequest>>(mut self, v: V) -> Self {
9282 self.0.request = v.into();
9283 self
9284 }
9285
9286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9288 self.0.options = v.into();
9289 self
9290 }
9291
9292 pub async fn send(self) -> Result<crate::model::ListPluginsResponse> {
9294 (*self.0.stub)
9295 .list_plugins(self.0.request, self.0.options)
9296 .await
9297 .map(gax::response::Response::into_body)
9298 }
9299
9300 pub fn by_page(
9302 self,
9303 ) -> impl gax::paginator::Paginator<crate::model::ListPluginsResponse, gax::error::Error>
9304 {
9305 use std::clone::Clone;
9306 let token = self.0.request.page_token.clone();
9307 let execute = move |token: String| {
9308 let mut builder = self.clone();
9309 builder.0.request = builder.0.request.set_page_token(token);
9310 builder.send()
9311 };
9312 gax::paginator::internal::new_paginator(token, execute)
9313 }
9314
9315 pub fn by_item(
9317 self,
9318 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPluginsResponse, gax::error::Error>
9319 {
9320 use gax::paginator::Paginator;
9321 self.by_page().items()
9322 }
9323
9324 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9328 self.0.request.parent = v.into();
9329 self
9330 }
9331
9332 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9334 self.0.request.filter = v.into();
9335 self
9336 }
9337
9338 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9340 self.0.request.page_size = v.into();
9341 self
9342 }
9343
9344 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9346 self.0.request.page_token = v.into();
9347 self
9348 }
9349 }
9350
9351 #[doc(hidden)]
9352 impl gax::options::internal::RequestBuilder for ListPlugins {
9353 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9354 &mut self.0.options
9355 }
9356 }
9357
9358 #[derive(Clone, Debug)]
9377 pub struct DeletePlugin(RequestBuilder<crate::model::DeletePluginRequest>);
9378
9379 impl DeletePlugin {
9380 pub(crate) fn new(
9381 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9382 ) -> Self {
9383 Self(RequestBuilder::new(stub))
9384 }
9385
9386 pub fn with_request<V: Into<crate::model::DeletePluginRequest>>(mut self, v: V) -> Self {
9388 self.0.request = v.into();
9389 self
9390 }
9391
9392 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9394 self.0.options = v.into();
9395 self
9396 }
9397
9398 pub async fn send(self) -> Result<longrunning::model::Operation> {
9405 (*self.0.stub)
9406 .delete_plugin(self.0.request, self.0.options)
9407 .await
9408 .map(gax::response::Response::into_body)
9409 }
9410
9411 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9413 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9414 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9415 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9416
9417 let stub = self.0.stub.clone();
9418 let mut options = self.0.options.clone();
9419 options.set_retry_policy(gax::retry_policy::NeverRetry);
9420 let query = move |name| {
9421 let stub = stub.clone();
9422 let options = options.clone();
9423 async {
9424 let op = GetOperation::new(stub)
9425 .set_name(name)
9426 .with_options(options)
9427 .send()
9428 .await?;
9429 Ok(Operation::new(op))
9430 }
9431 };
9432
9433 let start = move || async {
9434 let op = self.send().await?;
9435 Ok(Operation::new(op))
9436 };
9437
9438 lro::internal::new_unit_response_poller(
9439 polling_error_policy,
9440 polling_backoff_policy,
9441 start,
9442 query,
9443 )
9444 }
9445
9446 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9450 self.0.request.name = v.into();
9451 self
9452 }
9453 }
9454
9455 #[doc(hidden)]
9456 impl gax::options::internal::RequestBuilder for DeletePlugin {
9457 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9458 &mut self.0.options
9459 }
9460 }
9461
9462 #[derive(Clone, Debug)]
9481 pub struct CreatePluginInstance(RequestBuilder<crate::model::CreatePluginInstanceRequest>);
9482
9483 impl CreatePluginInstance {
9484 pub(crate) fn new(
9485 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9486 ) -> Self {
9487 Self(RequestBuilder::new(stub))
9488 }
9489
9490 pub fn with_request<V: Into<crate::model::CreatePluginInstanceRequest>>(
9492 mut self,
9493 v: V,
9494 ) -> Self {
9495 self.0.request = v.into();
9496 self
9497 }
9498
9499 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9501 self.0.options = v.into();
9502 self
9503 }
9504
9505 pub async fn send(self) -> Result<longrunning::model::Operation> {
9512 (*self.0.stub)
9513 .create_plugin_instance(self.0.request, self.0.options)
9514 .await
9515 .map(gax::response::Response::into_body)
9516 }
9517
9518 pub fn poller(
9520 self,
9521 ) -> impl lro::Poller<crate::model::PluginInstance, crate::model::OperationMetadata>
9522 {
9523 type Operation = lro::internal::Operation<
9524 crate::model::PluginInstance,
9525 crate::model::OperationMetadata,
9526 >;
9527 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9528 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9529
9530 let stub = self.0.stub.clone();
9531 let mut options = self.0.options.clone();
9532 options.set_retry_policy(gax::retry_policy::NeverRetry);
9533 let query = move |name| {
9534 let stub = stub.clone();
9535 let options = options.clone();
9536 async {
9537 let op = GetOperation::new(stub)
9538 .set_name(name)
9539 .with_options(options)
9540 .send()
9541 .await?;
9542 Ok(Operation::new(op))
9543 }
9544 };
9545
9546 let start = move || async {
9547 let op = self.send().await?;
9548 Ok(Operation::new(op))
9549 };
9550
9551 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9552 }
9553
9554 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9558 self.0.request.parent = v.into();
9559 self
9560 }
9561
9562 pub fn set_plugin_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9564 self.0.request.plugin_instance_id = v.into();
9565 self
9566 }
9567
9568 pub fn set_plugin_instance<T>(mut self, v: T) -> Self
9572 where
9573 T: std::convert::Into<crate::model::PluginInstance>,
9574 {
9575 self.0.request.plugin_instance = std::option::Option::Some(v.into());
9576 self
9577 }
9578
9579 pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
9583 where
9584 T: std::convert::Into<crate::model::PluginInstance>,
9585 {
9586 self.0.request.plugin_instance = v.map(|x| x.into());
9587 self
9588 }
9589 }
9590
9591 #[doc(hidden)]
9592 impl gax::options::internal::RequestBuilder for CreatePluginInstance {
9593 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9594 &mut self.0.options
9595 }
9596 }
9597
9598 #[derive(Clone, Debug)]
9617 pub struct ExecutePluginInstanceAction(
9618 RequestBuilder<crate::model::ExecutePluginInstanceActionRequest>,
9619 );
9620
9621 impl ExecutePluginInstanceAction {
9622 pub(crate) fn new(
9623 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9624 ) -> Self {
9625 Self(RequestBuilder::new(stub))
9626 }
9627
9628 pub fn with_request<V: Into<crate::model::ExecutePluginInstanceActionRequest>>(
9630 mut self,
9631 v: V,
9632 ) -> Self {
9633 self.0.request = v.into();
9634 self
9635 }
9636
9637 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9639 self.0.options = v.into();
9640 self
9641 }
9642
9643 pub async fn send(self) -> Result<longrunning::model::Operation> {
9650 (*self.0.stub)
9651 .execute_plugin_instance_action(self.0.request, self.0.options)
9652 .await
9653 .map(gax::response::Response::into_body)
9654 }
9655
9656 pub fn poller(
9658 self,
9659 ) -> impl lro::Poller<
9660 crate::model::ExecutePluginInstanceActionResponse,
9661 crate::model::OperationMetadata,
9662 > {
9663 type Operation = lro::internal::Operation<
9664 crate::model::ExecutePluginInstanceActionResponse,
9665 crate::model::OperationMetadata,
9666 >;
9667 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9668 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9669
9670 let stub = self.0.stub.clone();
9671 let mut options = self.0.options.clone();
9672 options.set_retry_policy(gax::retry_policy::NeverRetry);
9673 let query = move |name| {
9674 let stub = stub.clone();
9675 let options = options.clone();
9676 async {
9677 let op = GetOperation::new(stub)
9678 .set_name(name)
9679 .with_options(options)
9680 .send()
9681 .await?;
9682 Ok(Operation::new(op))
9683 }
9684 };
9685
9686 let start = move || async {
9687 let op = self.send().await?;
9688 Ok(Operation::new(op))
9689 };
9690
9691 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9692 }
9693
9694 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9698 self.0.request.name = v.into();
9699 self
9700 }
9701
9702 pub fn set_action_execution_detail<T>(mut self, v: T) -> Self
9706 where
9707 T: std::convert::Into<crate::model::ActionExecutionDetail>,
9708 {
9709 self.0.request.action_execution_detail = std::option::Option::Some(v.into());
9710 self
9711 }
9712
9713 pub fn set_or_clear_action_execution_detail<T>(mut self, v: std::option::Option<T>) -> Self
9717 where
9718 T: std::convert::Into<crate::model::ActionExecutionDetail>,
9719 {
9720 self.0.request.action_execution_detail = v.map(|x| x.into());
9721 self
9722 }
9723 }
9724
9725 #[doc(hidden)]
9726 impl gax::options::internal::RequestBuilder for ExecutePluginInstanceAction {
9727 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9728 &mut self.0.options
9729 }
9730 }
9731
9732 #[derive(Clone, Debug)]
9750 pub struct GetPluginInstance(RequestBuilder<crate::model::GetPluginInstanceRequest>);
9751
9752 impl GetPluginInstance {
9753 pub(crate) fn new(
9754 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9755 ) -> Self {
9756 Self(RequestBuilder::new(stub))
9757 }
9758
9759 pub fn with_request<V: Into<crate::model::GetPluginInstanceRequest>>(
9761 mut self,
9762 v: V,
9763 ) -> Self {
9764 self.0.request = v.into();
9765 self
9766 }
9767
9768 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9770 self.0.options = v.into();
9771 self
9772 }
9773
9774 pub async fn send(self) -> Result<crate::model::PluginInstance> {
9776 (*self.0.stub)
9777 .get_plugin_instance(self.0.request, self.0.options)
9778 .await
9779 .map(gax::response::Response::into_body)
9780 }
9781
9782 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9786 self.0.request.name = v.into();
9787 self
9788 }
9789 }
9790
9791 #[doc(hidden)]
9792 impl gax::options::internal::RequestBuilder for GetPluginInstance {
9793 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9794 &mut self.0.options
9795 }
9796 }
9797
9798 #[derive(Clone, Debug)]
9820 pub struct ListPluginInstances(RequestBuilder<crate::model::ListPluginInstancesRequest>);
9821
9822 impl ListPluginInstances {
9823 pub(crate) fn new(
9824 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9825 ) -> Self {
9826 Self(RequestBuilder::new(stub))
9827 }
9828
9829 pub fn with_request<V: Into<crate::model::ListPluginInstancesRequest>>(
9831 mut self,
9832 v: V,
9833 ) -> Self {
9834 self.0.request = v.into();
9835 self
9836 }
9837
9838 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9840 self.0.options = v.into();
9841 self
9842 }
9843
9844 pub async fn send(self) -> Result<crate::model::ListPluginInstancesResponse> {
9846 (*self.0.stub)
9847 .list_plugin_instances(self.0.request, self.0.options)
9848 .await
9849 .map(gax::response::Response::into_body)
9850 }
9851
9852 pub fn by_page(
9854 self,
9855 ) -> impl gax::paginator::Paginator<crate::model::ListPluginInstancesResponse, gax::error::Error>
9856 {
9857 use std::clone::Clone;
9858 let token = self.0.request.page_token.clone();
9859 let execute = move |token: String| {
9860 let mut builder = self.clone();
9861 builder.0.request = builder.0.request.set_page_token(token);
9862 builder.send()
9863 };
9864 gax::paginator::internal::new_paginator(token, execute)
9865 }
9866
9867 pub fn by_item(
9869 self,
9870 ) -> impl gax::paginator::ItemPaginator<
9871 crate::model::ListPluginInstancesResponse,
9872 gax::error::Error,
9873 > {
9874 use gax::paginator::Paginator;
9875 self.by_page().items()
9876 }
9877
9878 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9882 self.0.request.parent = v.into();
9883 self
9884 }
9885
9886 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9888 self.0.request.filter = v.into();
9889 self
9890 }
9891
9892 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9894 self.0.request.page_size = v.into();
9895 self
9896 }
9897
9898 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9900 self.0.request.page_token = v.into();
9901 self
9902 }
9903 }
9904
9905 #[doc(hidden)]
9906 impl gax::options::internal::RequestBuilder for ListPluginInstances {
9907 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9908 &mut self.0.options
9909 }
9910 }
9911
9912 #[derive(Clone, Debug)]
9931 pub struct EnablePluginInstanceAction(
9932 RequestBuilder<crate::model::EnablePluginInstanceActionRequest>,
9933 );
9934
9935 impl EnablePluginInstanceAction {
9936 pub(crate) fn new(
9937 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
9938 ) -> Self {
9939 Self(RequestBuilder::new(stub))
9940 }
9941
9942 pub fn with_request<V: Into<crate::model::EnablePluginInstanceActionRequest>>(
9944 mut self,
9945 v: V,
9946 ) -> Self {
9947 self.0.request = v.into();
9948 self
9949 }
9950
9951 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9953 self.0.options = v.into();
9954 self
9955 }
9956
9957 pub async fn send(self) -> Result<longrunning::model::Operation> {
9964 (*self.0.stub)
9965 .enable_plugin_instance_action(self.0.request, self.0.options)
9966 .await
9967 .map(gax::response::Response::into_body)
9968 }
9969
9970 pub fn poller(
9972 self,
9973 ) -> impl lro::Poller<
9974 crate::model::EnablePluginInstanceActionResponse,
9975 crate::model::OperationMetadata,
9976 > {
9977 type Operation = lro::internal::Operation<
9978 crate::model::EnablePluginInstanceActionResponse,
9979 crate::model::OperationMetadata,
9980 >;
9981 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9982 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9983
9984 let stub = self.0.stub.clone();
9985 let mut options = self.0.options.clone();
9986 options.set_retry_policy(gax::retry_policy::NeverRetry);
9987 let query = move |name| {
9988 let stub = stub.clone();
9989 let options = options.clone();
9990 async {
9991 let op = GetOperation::new(stub)
9992 .set_name(name)
9993 .with_options(options)
9994 .send()
9995 .await?;
9996 Ok(Operation::new(op))
9997 }
9998 };
9999
10000 let start = move || async {
10001 let op = self.send().await?;
10002 Ok(Operation::new(op))
10003 };
10004
10005 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10006 }
10007
10008 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10012 self.0.request.name = v.into();
10013 self
10014 }
10015
10016 pub fn set_action_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10020 self.0.request.action_id = v.into();
10021 self
10022 }
10023 }
10024
10025 #[doc(hidden)]
10026 impl gax::options::internal::RequestBuilder for EnablePluginInstanceAction {
10027 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10028 &mut self.0.options
10029 }
10030 }
10031
10032 #[derive(Clone, Debug)]
10051 pub struct DisablePluginInstanceAction(
10052 RequestBuilder<crate::model::DisablePluginInstanceActionRequest>,
10053 );
10054
10055 impl DisablePluginInstanceAction {
10056 pub(crate) fn new(
10057 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10058 ) -> Self {
10059 Self(RequestBuilder::new(stub))
10060 }
10061
10062 pub fn with_request<V: Into<crate::model::DisablePluginInstanceActionRequest>>(
10064 mut self,
10065 v: V,
10066 ) -> Self {
10067 self.0.request = v.into();
10068 self
10069 }
10070
10071 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10073 self.0.options = v.into();
10074 self
10075 }
10076
10077 pub async fn send(self) -> Result<longrunning::model::Operation> {
10084 (*self.0.stub)
10085 .disable_plugin_instance_action(self.0.request, self.0.options)
10086 .await
10087 .map(gax::response::Response::into_body)
10088 }
10089
10090 pub fn poller(
10092 self,
10093 ) -> impl lro::Poller<
10094 crate::model::DisablePluginInstanceActionResponse,
10095 crate::model::OperationMetadata,
10096 > {
10097 type Operation = lro::internal::Operation<
10098 crate::model::DisablePluginInstanceActionResponse,
10099 crate::model::OperationMetadata,
10100 >;
10101 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10102 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10103
10104 let stub = self.0.stub.clone();
10105 let mut options = self.0.options.clone();
10106 options.set_retry_policy(gax::retry_policy::NeverRetry);
10107 let query = move |name| {
10108 let stub = stub.clone();
10109 let options = options.clone();
10110 async {
10111 let op = GetOperation::new(stub)
10112 .set_name(name)
10113 .with_options(options)
10114 .send()
10115 .await?;
10116 Ok(Operation::new(op))
10117 }
10118 };
10119
10120 let start = move || async {
10121 let op = self.send().await?;
10122 Ok(Operation::new(op))
10123 };
10124
10125 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10126 }
10127
10128 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10132 self.0.request.name = v.into();
10133 self
10134 }
10135
10136 pub fn set_action_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10140 self.0.request.action_id = v.into();
10141 self
10142 }
10143 }
10144
10145 #[doc(hidden)]
10146 impl gax::options::internal::RequestBuilder for DisablePluginInstanceAction {
10147 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10148 &mut self.0.options
10149 }
10150 }
10151
10152 #[derive(Clone, Debug)]
10170 pub struct UpdatePluginInstance(RequestBuilder<crate::model::UpdatePluginInstanceRequest>);
10171
10172 impl UpdatePluginInstance {
10173 pub(crate) fn new(
10174 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10175 ) -> Self {
10176 Self(RequestBuilder::new(stub))
10177 }
10178
10179 pub fn with_request<V: Into<crate::model::UpdatePluginInstanceRequest>>(
10181 mut self,
10182 v: V,
10183 ) -> Self {
10184 self.0.request = v.into();
10185 self
10186 }
10187
10188 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10190 self.0.options = v.into();
10191 self
10192 }
10193
10194 pub async fn send(self) -> Result<crate::model::PluginInstance> {
10196 (*self.0.stub)
10197 .update_plugin_instance(self.0.request, self.0.options)
10198 .await
10199 .map(gax::response::Response::into_body)
10200 }
10201
10202 pub fn set_plugin_instance<T>(mut self, v: T) -> Self
10206 where
10207 T: std::convert::Into<crate::model::PluginInstance>,
10208 {
10209 self.0.request.plugin_instance = std::option::Option::Some(v.into());
10210 self
10211 }
10212
10213 pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
10217 where
10218 T: std::convert::Into<crate::model::PluginInstance>,
10219 {
10220 self.0.request.plugin_instance = v.map(|x| x.into());
10221 self
10222 }
10223
10224 pub fn set_update_mask<T>(mut self, v: T) -> Self
10226 where
10227 T: std::convert::Into<wkt::FieldMask>,
10228 {
10229 self.0.request.update_mask = std::option::Option::Some(v.into());
10230 self
10231 }
10232
10233 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10235 where
10236 T: std::convert::Into<wkt::FieldMask>,
10237 {
10238 self.0.request.update_mask = v.map(|x| x.into());
10239 self
10240 }
10241 }
10242
10243 #[doc(hidden)]
10244 impl gax::options::internal::RequestBuilder for UpdatePluginInstance {
10245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10246 &mut self.0.options
10247 }
10248 }
10249
10250 #[derive(Clone, Debug)]
10269 pub struct DeletePluginInstance(RequestBuilder<crate::model::DeletePluginInstanceRequest>);
10270
10271 impl DeletePluginInstance {
10272 pub(crate) fn new(
10273 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10274 ) -> Self {
10275 Self(RequestBuilder::new(stub))
10276 }
10277
10278 pub fn with_request<V: Into<crate::model::DeletePluginInstanceRequest>>(
10280 mut self,
10281 v: V,
10282 ) -> Self {
10283 self.0.request = v.into();
10284 self
10285 }
10286
10287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10289 self.0.options = v.into();
10290 self
10291 }
10292
10293 pub async fn send(self) -> Result<longrunning::model::Operation> {
10300 (*self.0.stub)
10301 .delete_plugin_instance(self.0.request, self.0.options)
10302 .await
10303 .map(gax::response::Response::into_body)
10304 }
10305
10306 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10308 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10309 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10310 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10311
10312 let stub = self.0.stub.clone();
10313 let mut options = self.0.options.clone();
10314 options.set_retry_policy(gax::retry_policy::NeverRetry);
10315 let query = move |name| {
10316 let stub = stub.clone();
10317 let options = options.clone();
10318 async {
10319 let op = GetOperation::new(stub)
10320 .set_name(name)
10321 .with_options(options)
10322 .send()
10323 .await?;
10324 Ok(Operation::new(op))
10325 }
10326 };
10327
10328 let start = move || async {
10329 let op = self.send().await?;
10330 Ok(Operation::new(op))
10331 };
10332
10333 lro::internal::new_unit_response_poller(
10334 polling_error_policy,
10335 polling_backoff_policy,
10336 start,
10337 query,
10338 )
10339 }
10340
10341 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10345 self.0.request.name = v.into();
10346 self
10347 }
10348 }
10349
10350 #[doc(hidden)]
10351 impl gax::options::internal::RequestBuilder for DeletePluginInstance {
10352 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10353 &mut self.0.options
10354 }
10355 }
10356
10357 #[derive(Clone, Debug)]
10379 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10380
10381 impl ListLocations {
10382 pub(crate) fn new(
10383 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10384 ) -> Self {
10385 Self(RequestBuilder::new(stub))
10386 }
10387
10388 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10390 mut self,
10391 v: V,
10392 ) -> Self {
10393 self.0.request = v.into();
10394 self
10395 }
10396
10397 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10399 self.0.options = v.into();
10400 self
10401 }
10402
10403 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10405 (*self.0.stub)
10406 .list_locations(self.0.request, self.0.options)
10407 .await
10408 .map(gax::response::Response::into_body)
10409 }
10410
10411 pub fn by_page(
10413 self,
10414 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10415 {
10416 use std::clone::Clone;
10417 let token = self.0.request.page_token.clone();
10418 let execute = move |token: String| {
10419 let mut builder = self.clone();
10420 builder.0.request = builder.0.request.set_page_token(token);
10421 builder.send()
10422 };
10423 gax::paginator::internal::new_paginator(token, execute)
10424 }
10425
10426 pub fn by_item(
10428 self,
10429 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10430 {
10431 use gax::paginator::Paginator;
10432 self.by_page().items()
10433 }
10434
10435 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10437 self.0.request.name = v.into();
10438 self
10439 }
10440
10441 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10443 self.0.request.filter = v.into();
10444 self
10445 }
10446
10447 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10449 self.0.request.page_size = v.into();
10450 self
10451 }
10452
10453 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10455 self.0.request.page_token = v.into();
10456 self
10457 }
10458 }
10459
10460 #[doc(hidden)]
10461 impl gax::options::internal::RequestBuilder for ListLocations {
10462 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10463 &mut self.0.options
10464 }
10465 }
10466
10467 #[derive(Clone, Debug)]
10485 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10486
10487 impl GetLocation {
10488 pub(crate) fn new(
10489 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10490 ) -> Self {
10491 Self(RequestBuilder::new(stub))
10492 }
10493
10494 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10496 self.0.request = v.into();
10497 self
10498 }
10499
10500 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10502 self.0.options = v.into();
10503 self
10504 }
10505
10506 pub async fn send(self) -> Result<location::model::Location> {
10508 (*self.0.stub)
10509 .get_location(self.0.request, self.0.options)
10510 .await
10511 .map(gax::response::Response::into_body)
10512 }
10513
10514 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10516 self.0.request.name = v.into();
10517 self
10518 }
10519 }
10520
10521 #[doc(hidden)]
10522 impl gax::options::internal::RequestBuilder for GetLocation {
10523 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10524 &mut self.0.options
10525 }
10526 }
10527
10528 #[derive(Clone, Debug)]
10550 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10551
10552 impl ListOperations {
10553 pub(crate) fn new(
10554 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10555 ) -> Self {
10556 Self(RequestBuilder::new(stub))
10557 }
10558
10559 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10561 mut self,
10562 v: V,
10563 ) -> Self {
10564 self.0.request = v.into();
10565 self
10566 }
10567
10568 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10570 self.0.options = v.into();
10571 self
10572 }
10573
10574 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10576 (*self.0.stub)
10577 .list_operations(self.0.request, self.0.options)
10578 .await
10579 .map(gax::response::Response::into_body)
10580 }
10581
10582 pub fn by_page(
10584 self,
10585 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10586 {
10587 use std::clone::Clone;
10588 let token = self.0.request.page_token.clone();
10589 let execute = move |token: String| {
10590 let mut builder = self.clone();
10591 builder.0.request = builder.0.request.set_page_token(token);
10592 builder.send()
10593 };
10594 gax::paginator::internal::new_paginator(token, execute)
10595 }
10596
10597 pub fn by_item(
10599 self,
10600 ) -> impl gax::paginator::ItemPaginator<
10601 longrunning::model::ListOperationsResponse,
10602 gax::error::Error,
10603 > {
10604 use gax::paginator::Paginator;
10605 self.by_page().items()
10606 }
10607
10608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10610 self.0.request.name = v.into();
10611 self
10612 }
10613
10614 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10616 self.0.request.filter = v.into();
10617 self
10618 }
10619
10620 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10622 self.0.request.page_size = v.into();
10623 self
10624 }
10625
10626 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10628 self.0.request.page_token = v.into();
10629 self
10630 }
10631
10632 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10634 self.0.request.return_partial_success = v.into();
10635 self
10636 }
10637 }
10638
10639 #[doc(hidden)]
10640 impl gax::options::internal::RequestBuilder for ListOperations {
10641 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10642 &mut self.0.options
10643 }
10644 }
10645
10646 #[derive(Clone, Debug)]
10664 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
10665
10666 impl GetOperation {
10667 pub(crate) fn new(
10668 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10669 ) -> Self {
10670 Self(RequestBuilder::new(stub))
10671 }
10672
10673 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
10675 mut self,
10676 v: V,
10677 ) -> Self {
10678 self.0.request = v.into();
10679 self
10680 }
10681
10682 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10684 self.0.options = v.into();
10685 self
10686 }
10687
10688 pub async fn send(self) -> Result<longrunning::model::Operation> {
10690 (*self.0.stub)
10691 .get_operation(self.0.request, self.0.options)
10692 .await
10693 .map(gax::response::Response::into_body)
10694 }
10695
10696 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10698 self.0.request.name = v.into();
10699 self
10700 }
10701 }
10702
10703 #[doc(hidden)]
10704 impl gax::options::internal::RequestBuilder for GetOperation {
10705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10706 &mut self.0.options
10707 }
10708 }
10709
10710 #[derive(Clone, Debug)]
10728 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
10729
10730 impl DeleteOperation {
10731 pub(crate) fn new(
10732 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10733 ) -> Self {
10734 Self(RequestBuilder::new(stub))
10735 }
10736
10737 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
10739 mut self,
10740 v: V,
10741 ) -> Self {
10742 self.0.request = v.into();
10743 self
10744 }
10745
10746 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10748 self.0.options = v.into();
10749 self
10750 }
10751
10752 pub async fn send(self) -> Result<()> {
10754 (*self.0.stub)
10755 .delete_operation(self.0.request, self.0.options)
10756 .await
10757 .map(gax::response::Response::into_body)
10758 }
10759
10760 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10762 self.0.request.name = v.into();
10763 self
10764 }
10765 }
10766
10767 #[doc(hidden)]
10768 impl gax::options::internal::RequestBuilder for DeleteOperation {
10769 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10770 &mut self.0.options
10771 }
10772 }
10773
10774 #[derive(Clone, Debug)]
10792 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
10793
10794 impl CancelOperation {
10795 pub(crate) fn new(
10796 stub: std::sync::Arc<dyn super::super::stub::dynamic::ApiHubPlugin>,
10797 ) -> Self {
10798 Self(RequestBuilder::new(stub))
10799 }
10800
10801 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
10803 mut self,
10804 v: V,
10805 ) -> Self {
10806 self.0.request = v.into();
10807 self
10808 }
10809
10810 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10812 self.0.options = v.into();
10813 self
10814 }
10815
10816 pub async fn send(self) -> Result<()> {
10818 (*self.0.stub)
10819 .cancel_operation(self.0.request, self.0.options)
10820 .await
10821 .map(gax::response::Response::into_body)
10822 }
10823
10824 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10826 self.0.request.name = v.into();
10827 self
10828 }
10829 }
10830
10831 #[doc(hidden)]
10832 impl gax::options::internal::RequestBuilder for CancelOperation {
10833 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10834 &mut self.0.options
10835 }
10836 }
10837}
10838
10839pub mod provisioning {
10840 use crate::Result;
10841
10842 pub type ClientBuilder =
10856 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10857
10858 pub(crate) mod client {
10859 use super::super::super::client::Provisioning;
10860 pub struct Factory;
10861 impl gax::client_builder::internal::ClientFactory for Factory {
10862 type Client = Provisioning;
10863 type Credentials = gaxi::options::Credentials;
10864 async fn build(
10865 self,
10866 config: gaxi::options::ClientConfig,
10867 ) -> gax::client_builder::Result<Self::Client> {
10868 Self::Client::new(config).await
10869 }
10870 }
10871 }
10872
10873 #[derive(Clone, Debug)]
10875 pub(crate) struct RequestBuilder<R: std::default::Default> {
10876 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
10877 request: R,
10878 options: gax::options::RequestOptions,
10879 }
10880
10881 impl<R> RequestBuilder<R>
10882 where
10883 R: std::default::Default,
10884 {
10885 pub(crate) fn new(
10886 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
10887 ) -> Self {
10888 Self {
10889 stub,
10890 request: R::default(),
10891 options: gax::options::RequestOptions::default(),
10892 }
10893 }
10894 }
10895
10896 #[derive(Clone, Debug)]
10915 pub struct CreateApiHubInstance(RequestBuilder<crate::model::CreateApiHubInstanceRequest>);
10916
10917 impl CreateApiHubInstance {
10918 pub(crate) fn new(
10919 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
10920 ) -> Self {
10921 Self(RequestBuilder::new(stub))
10922 }
10923
10924 pub fn with_request<V: Into<crate::model::CreateApiHubInstanceRequest>>(
10926 mut self,
10927 v: V,
10928 ) -> Self {
10929 self.0.request = v.into();
10930 self
10931 }
10932
10933 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10935 self.0.options = v.into();
10936 self
10937 }
10938
10939 pub async fn send(self) -> Result<longrunning::model::Operation> {
10946 (*self.0.stub)
10947 .create_api_hub_instance(self.0.request, self.0.options)
10948 .await
10949 .map(gax::response::Response::into_body)
10950 }
10951
10952 pub fn poller(
10954 self,
10955 ) -> impl lro::Poller<crate::model::ApiHubInstance, crate::model::OperationMetadata>
10956 {
10957 type Operation = lro::internal::Operation<
10958 crate::model::ApiHubInstance,
10959 crate::model::OperationMetadata,
10960 >;
10961 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10962 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10963
10964 let stub = self.0.stub.clone();
10965 let mut options = self.0.options.clone();
10966 options.set_retry_policy(gax::retry_policy::NeverRetry);
10967 let query = move |name| {
10968 let stub = stub.clone();
10969 let options = options.clone();
10970 async {
10971 let op = GetOperation::new(stub)
10972 .set_name(name)
10973 .with_options(options)
10974 .send()
10975 .await?;
10976 Ok(Operation::new(op))
10977 }
10978 };
10979
10980 let start = move || async {
10981 let op = self.send().await?;
10982 Ok(Operation::new(op))
10983 };
10984
10985 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10986 }
10987
10988 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10992 self.0.request.parent = v.into();
10993 self
10994 }
10995
10996 pub fn set_api_hub_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10998 self.0.request.api_hub_instance_id = v.into();
10999 self
11000 }
11001
11002 pub fn set_api_hub_instance<T>(mut self, v: T) -> Self
11006 where
11007 T: std::convert::Into<crate::model::ApiHubInstance>,
11008 {
11009 self.0.request.api_hub_instance = std::option::Option::Some(v.into());
11010 self
11011 }
11012
11013 pub fn set_or_clear_api_hub_instance<T>(mut self, v: std::option::Option<T>) -> Self
11017 where
11018 T: std::convert::Into<crate::model::ApiHubInstance>,
11019 {
11020 self.0.request.api_hub_instance = v.map(|x| x.into());
11021 self
11022 }
11023 }
11024
11025 #[doc(hidden)]
11026 impl gax::options::internal::RequestBuilder for CreateApiHubInstance {
11027 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11028 &mut self.0.options
11029 }
11030 }
11031
11032 #[derive(Clone, Debug)]
11051 pub struct DeleteApiHubInstance(RequestBuilder<crate::model::DeleteApiHubInstanceRequest>);
11052
11053 impl DeleteApiHubInstance {
11054 pub(crate) fn new(
11055 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11056 ) -> Self {
11057 Self(RequestBuilder::new(stub))
11058 }
11059
11060 pub fn with_request<V: Into<crate::model::DeleteApiHubInstanceRequest>>(
11062 mut self,
11063 v: V,
11064 ) -> Self {
11065 self.0.request = v.into();
11066 self
11067 }
11068
11069 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11071 self.0.options = v.into();
11072 self
11073 }
11074
11075 pub async fn send(self) -> Result<longrunning::model::Operation> {
11082 (*self.0.stub)
11083 .delete_api_hub_instance(self.0.request, self.0.options)
11084 .await
11085 .map(gax::response::Response::into_body)
11086 }
11087
11088 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
11090 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11091 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11092 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11093
11094 let stub = self.0.stub.clone();
11095 let mut options = self.0.options.clone();
11096 options.set_retry_policy(gax::retry_policy::NeverRetry);
11097 let query = move |name| {
11098 let stub = stub.clone();
11099 let options = options.clone();
11100 async {
11101 let op = GetOperation::new(stub)
11102 .set_name(name)
11103 .with_options(options)
11104 .send()
11105 .await?;
11106 Ok(Operation::new(op))
11107 }
11108 };
11109
11110 let start = move || async {
11111 let op = self.send().await?;
11112 Ok(Operation::new(op))
11113 };
11114
11115 lro::internal::new_unit_response_poller(
11116 polling_error_policy,
11117 polling_backoff_policy,
11118 start,
11119 query,
11120 )
11121 }
11122
11123 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11127 self.0.request.name = v.into();
11128 self
11129 }
11130 }
11131
11132 #[doc(hidden)]
11133 impl gax::options::internal::RequestBuilder for DeleteApiHubInstance {
11134 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11135 &mut self.0.options
11136 }
11137 }
11138
11139 #[derive(Clone, Debug)]
11157 pub struct GetApiHubInstance(RequestBuilder<crate::model::GetApiHubInstanceRequest>);
11158
11159 impl GetApiHubInstance {
11160 pub(crate) fn new(
11161 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11162 ) -> Self {
11163 Self(RequestBuilder::new(stub))
11164 }
11165
11166 pub fn with_request<V: Into<crate::model::GetApiHubInstanceRequest>>(
11168 mut self,
11169 v: V,
11170 ) -> Self {
11171 self.0.request = v.into();
11172 self
11173 }
11174
11175 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11177 self.0.options = v.into();
11178 self
11179 }
11180
11181 pub async fn send(self) -> Result<crate::model::ApiHubInstance> {
11183 (*self.0.stub)
11184 .get_api_hub_instance(self.0.request, self.0.options)
11185 .await
11186 .map(gax::response::Response::into_body)
11187 }
11188
11189 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11193 self.0.request.name = v.into();
11194 self
11195 }
11196 }
11197
11198 #[doc(hidden)]
11199 impl gax::options::internal::RequestBuilder for GetApiHubInstance {
11200 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11201 &mut self.0.options
11202 }
11203 }
11204
11205 #[derive(Clone, Debug)]
11223 pub struct LookupApiHubInstance(RequestBuilder<crate::model::LookupApiHubInstanceRequest>);
11224
11225 impl LookupApiHubInstance {
11226 pub(crate) fn new(
11227 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11228 ) -> Self {
11229 Self(RequestBuilder::new(stub))
11230 }
11231
11232 pub fn with_request<V: Into<crate::model::LookupApiHubInstanceRequest>>(
11234 mut self,
11235 v: V,
11236 ) -> Self {
11237 self.0.request = v.into();
11238 self
11239 }
11240
11241 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11243 self.0.options = v.into();
11244 self
11245 }
11246
11247 pub async fn send(self) -> Result<crate::model::LookupApiHubInstanceResponse> {
11249 (*self.0.stub)
11250 .lookup_api_hub_instance(self.0.request, self.0.options)
11251 .await
11252 .map(gax::response::Response::into_body)
11253 }
11254
11255 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11259 self.0.request.parent = v.into();
11260 self
11261 }
11262 }
11263
11264 #[doc(hidden)]
11265 impl gax::options::internal::RequestBuilder for LookupApiHubInstance {
11266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11267 &mut self.0.options
11268 }
11269 }
11270
11271 #[derive(Clone, Debug)]
11293 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
11294
11295 impl ListLocations {
11296 pub(crate) fn new(
11297 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11298 ) -> Self {
11299 Self(RequestBuilder::new(stub))
11300 }
11301
11302 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
11304 mut self,
11305 v: V,
11306 ) -> Self {
11307 self.0.request = v.into();
11308 self
11309 }
11310
11311 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11313 self.0.options = v.into();
11314 self
11315 }
11316
11317 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
11319 (*self.0.stub)
11320 .list_locations(self.0.request, self.0.options)
11321 .await
11322 .map(gax::response::Response::into_body)
11323 }
11324
11325 pub fn by_page(
11327 self,
11328 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
11329 {
11330 use std::clone::Clone;
11331 let token = self.0.request.page_token.clone();
11332 let execute = move |token: String| {
11333 let mut builder = self.clone();
11334 builder.0.request = builder.0.request.set_page_token(token);
11335 builder.send()
11336 };
11337 gax::paginator::internal::new_paginator(token, execute)
11338 }
11339
11340 pub fn by_item(
11342 self,
11343 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
11344 {
11345 use gax::paginator::Paginator;
11346 self.by_page().items()
11347 }
11348
11349 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11351 self.0.request.name = v.into();
11352 self
11353 }
11354
11355 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11357 self.0.request.filter = v.into();
11358 self
11359 }
11360
11361 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11363 self.0.request.page_size = v.into();
11364 self
11365 }
11366
11367 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11369 self.0.request.page_token = v.into();
11370 self
11371 }
11372 }
11373
11374 #[doc(hidden)]
11375 impl gax::options::internal::RequestBuilder for ListLocations {
11376 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11377 &mut self.0.options
11378 }
11379 }
11380
11381 #[derive(Clone, Debug)]
11399 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
11400
11401 impl GetLocation {
11402 pub(crate) fn new(
11403 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11404 ) -> Self {
11405 Self(RequestBuilder::new(stub))
11406 }
11407
11408 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
11410 self.0.request = v.into();
11411 self
11412 }
11413
11414 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11416 self.0.options = v.into();
11417 self
11418 }
11419
11420 pub async fn send(self) -> Result<location::model::Location> {
11422 (*self.0.stub)
11423 .get_location(self.0.request, self.0.options)
11424 .await
11425 .map(gax::response::Response::into_body)
11426 }
11427
11428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11430 self.0.request.name = v.into();
11431 self
11432 }
11433 }
11434
11435 #[doc(hidden)]
11436 impl gax::options::internal::RequestBuilder for GetLocation {
11437 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11438 &mut self.0.options
11439 }
11440 }
11441
11442 #[derive(Clone, Debug)]
11464 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
11465
11466 impl ListOperations {
11467 pub(crate) fn new(
11468 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11469 ) -> Self {
11470 Self(RequestBuilder::new(stub))
11471 }
11472
11473 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
11475 mut self,
11476 v: V,
11477 ) -> Self {
11478 self.0.request = v.into();
11479 self
11480 }
11481
11482 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11484 self.0.options = v.into();
11485 self
11486 }
11487
11488 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
11490 (*self.0.stub)
11491 .list_operations(self.0.request, self.0.options)
11492 .await
11493 .map(gax::response::Response::into_body)
11494 }
11495
11496 pub fn by_page(
11498 self,
11499 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
11500 {
11501 use std::clone::Clone;
11502 let token = self.0.request.page_token.clone();
11503 let execute = move |token: String| {
11504 let mut builder = self.clone();
11505 builder.0.request = builder.0.request.set_page_token(token);
11506 builder.send()
11507 };
11508 gax::paginator::internal::new_paginator(token, execute)
11509 }
11510
11511 pub fn by_item(
11513 self,
11514 ) -> impl gax::paginator::ItemPaginator<
11515 longrunning::model::ListOperationsResponse,
11516 gax::error::Error,
11517 > {
11518 use gax::paginator::Paginator;
11519 self.by_page().items()
11520 }
11521
11522 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11524 self.0.request.name = v.into();
11525 self
11526 }
11527
11528 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11530 self.0.request.filter = v.into();
11531 self
11532 }
11533
11534 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11536 self.0.request.page_size = v.into();
11537 self
11538 }
11539
11540 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11542 self.0.request.page_token = v.into();
11543 self
11544 }
11545
11546 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11548 self.0.request.return_partial_success = v.into();
11549 self
11550 }
11551 }
11552
11553 #[doc(hidden)]
11554 impl gax::options::internal::RequestBuilder for ListOperations {
11555 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11556 &mut self.0.options
11557 }
11558 }
11559
11560 #[derive(Clone, Debug)]
11578 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11579
11580 impl GetOperation {
11581 pub(crate) fn new(
11582 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11583 ) -> Self {
11584 Self(RequestBuilder::new(stub))
11585 }
11586
11587 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11589 mut self,
11590 v: V,
11591 ) -> Self {
11592 self.0.request = v.into();
11593 self
11594 }
11595
11596 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11598 self.0.options = v.into();
11599 self
11600 }
11601
11602 pub async fn send(self) -> Result<longrunning::model::Operation> {
11604 (*self.0.stub)
11605 .get_operation(self.0.request, self.0.options)
11606 .await
11607 .map(gax::response::Response::into_body)
11608 }
11609
11610 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11612 self.0.request.name = v.into();
11613 self
11614 }
11615 }
11616
11617 #[doc(hidden)]
11618 impl gax::options::internal::RequestBuilder for GetOperation {
11619 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11620 &mut self.0.options
11621 }
11622 }
11623
11624 #[derive(Clone, Debug)]
11642 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
11643
11644 impl DeleteOperation {
11645 pub(crate) fn new(
11646 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11647 ) -> Self {
11648 Self(RequestBuilder::new(stub))
11649 }
11650
11651 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
11653 mut self,
11654 v: V,
11655 ) -> Self {
11656 self.0.request = v.into();
11657 self
11658 }
11659
11660 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11662 self.0.options = v.into();
11663 self
11664 }
11665
11666 pub async fn send(self) -> Result<()> {
11668 (*self.0.stub)
11669 .delete_operation(self.0.request, self.0.options)
11670 .await
11671 .map(gax::response::Response::into_body)
11672 }
11673
11674 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11676 self.0.request.name = v.into();
11677 self
11678 }
11679 }
11680
11681 #[doc(hidden)]
11682 impl gax::options::internal::RequestBuilder for DeleteOperation {
11683 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11684 &mut self.0.options
11685 }
11686 }
11687
11688 #[derive(Clone, Debug)]
11706 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11707
11708 impl CancelOperation {
11709 pub(crate) fn new(
11710 stub: std::sync::Arc<dyn super::super::stub::dynamic::Provisioning>,
11711 ) -> Self {
11712 Self(RequestBuilder::new(stub))
11713 }
11714
11715 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11717 mut self,
11718 v: V,
11719 ) -> Self {
11720 self.0.request = v.into();
11721 self
11722 }
11723
11724 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11726 self.0.options = v.into();
11727 self
11728 }
11729
11730 pub async fn send(self) -> Result<()> {
11732 (*self.0.stub)
11733 .cancel_operation(self.0.request, self.0.options)
11734 .await
11735 .map(gax::response::Response::into_body)
11736 }
11737
11738 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11740 self.0.request.name = v.into();
11741 self
11742 }
11743 }
11744
11745 #[doc(hidden)]
11746 impl gax::options::internal::RequestBuilder for CancelOperation {
11747 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11748 &mut self.0.options
11749 }
11750 }
11751}
11752
11753pub mod runtime_project_attachment_service {
11754 use crate::Result;
11755
11756 pub type ClientBuilder =
11770 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11771
11772 pub(crate) mod client {
11773 use super::super::super::client::RuntimeProjectAttachmentService;
11774 pub struct Factory;
11775 impl gax::client_builder::internal::ClientFactory for Factory {
11776 type Client = RuntimeProjectAttachmentService;
11777 type Credentials = gaxi::options::Credentials;
11778 async fn build(
11779 self,
11780 config: gaxi::options::ClientConfig,
11781 ) -> gax::client_builder::Result<Self::Client> {
11782 Self::Client::new(config).await
11783 }
11784 }
11785 }
11786
11787 #[derive(Clone, Debug)]
11789 pub(crate) struct RequestBuilder<R: std::default::Default> {
11790 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
11791 request: R,
11792 options: gax::options::RequestOptions,
11793 }
11794
11795 impl<R> RequestBuilder<R>
11796 where
11797 R: std::default::Default,
11798 {
11799 pub(crate) fn new(
11800 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
11801 ) -> Self {
11802 Self {
11803 stub,
11804 request: R::default(),
11805 options: gax::options::RequestOptions::default(),
11806 }
11807 }
11808 }
11809
11810 #[derive(Clone, Debug)]
11828 pub struct CreateRuntimeProjectAttachment(
11829 RequestBuilder<crate::model::CreateRuntimeProjectAttachmentRequest>,
11830 );
11831
11832 impl CreateRuntimeProjectAttachment {
11833 pub(crate) fn new(
11834 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
11835 ) -> Self {
11836 Self(RequestBuilder::new(stub))
11837 }
11838
11839 pub fn with_request<V: Into<crate::model::CreateRuntimeProjectAttachmentRequest>>(
11841 mut self,
11842 v: V,
11843 ) -> Self {
11844 self.0.request = v.into();
11845 self
11846 }
11847
11848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11850 self.0.options = v.into();
11851 self
11852 }
11853
11854 pub async fn send(self) -> Result<crate::model::RuntimeProjectAttachment> {
11856 (*self.0.stub)
11857 .create_runtime_project_attachment(self.0.request, self.0.options)
11858 .await
11859 .map(gax::response::Response::into_body)
11860 }
11861
11862 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11866 self.0.request.parent = v.into();
11867 self
11868 }
11869
11870 pub fn set_runtime_project_attachment_id<T: Into<std::string::String>>(
11874 mut self,
11875 v: T,
11876 ) -> Self {
11877 self.0.request.runtime_project_attachment_id = v.into();
11878 self
11879 }
11880
11881 pub fn set_runtime_project_attachment<T>(mut self, v: T) -> Self
11885 where
11886 T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
11887 {
11888 self.0.request.runtime_project_attachment = std::option::Option::Some(v.into());
11889 self
11890 }
11891
11892 pub fn set_or_clear_runtime_project_attachment<T>(
11896 mut self,
11897 v: std::option::Option<T>,
11898 ) -> Self
11899 where
11900 T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
11901 {
11902 self.0.request.runtime_project_attachment = v.map(|x| x.into());
11903 self
11904 }
11905 }
11906
11907 #[doc(hidden)]
11908 impl gax::options::internal::RequestBuilder for CreateRuntimeProjectAttachment {
11909 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11910 &mut self.0.options
11911 }
11912 }
11913
11914 #[derive(Clone, Debug)]
11932 pub struct GetRuntimeProjectAttachment(
11933 RequestBuilder<crate::model::GetRuntimeProjectAttachmentRequest>,
11934 );
11935
11936 impl GetRuntimeProjectAttachment {
11937 pub(crate) fn new(
11938 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
11939 ) -> Self {
11940 Self(RequestBuilder::new(stub))
11941 }
11942
11943 pub fn with_request<V: Into<crate::model::GetRuntimeProjectAttachmentRequest>>(
11945 mut self,
11946 v: V,
11947 ) -> Self {
11948 self.0.request = v.into();
11949 self
11950 }
11951
11952 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11954 self.0.options = v.into();
11955 self
11956 }
11957
11958 pub async fn send(self) -> Result<crate::model::RuntimeProjectAttachment> {
11960 (*self.0.stub)
11961 .get_runtime_project_attachment(self.0.request, self.0.options)
11962 .await
11963 .map(gax::response::Response::into_body)
11964 }
11965
11966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11970 self.0.request.name = v.into();
11971 self
11972 }
11973 }
11974
11975 #[doc(hidden)]
11976 impl gax::options::internal::RequestBuilder for GetRuntimeProjectAttachment {
11977 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11978 &mut self.0.options
11979 }
11980 }
11981
11982 #[derive(Clone, Debug)]
12004 pub struct ListRuntimeProjectAttachments(
12005 RequestBuilder<crate::model::ListRuntimeProjectAttachmentsRequest>,
12006 );
12007
12008 impl ListRuntimeProjectAttachments {
12009 pub(crate) fn new(
12010 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12011 ) -> Self {
12012 Self(RequestBuilder::new(stub))
12013 }
12014
12015 pub fn with_request<V: Into<crate::model::ListRuntimeProjectAttachmentsRequest>>(
12017 mut self,
12018 v: V,
12019 ) -> Self {
12020 self.0.request = v.into();
12021 self
12022 }
12023
12024 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12026 self.0.options = v.into();
12027 self
12028 }
12029
12030 pub async fn send(self) -> Result<crate::model::ListRuntimeProjectAttachmentsResponse> {
12032 (*self.0.stub)
12033 .list_runtime_project_attachments(self.0.request, self.0.options)
12034 .await
12035 .map(gax::response::Response::into_body)
12036 }
12037
12038 pub fn by_page(
12040 self,
12041 ) -> impl gax::paginator::Paginator<
12042 crate::model::ListRuntimeProjectAttachmentsResponse,
12043 gax::error::Error,
12044 > {
12045 use std::clone::Clone;
12046 let token = self.0.request.page_token.clone();
12047 let execute = move |token: String| {
12048 let mut builder = self.clone();
12049 builder.0.request = builder.0.request.set_page_token(token);
12050 builder.send()
12051 };
12052 gax::paginator::internal::new_paginator(token, execute)
12053 }
12054
12055 pub fn by_item(
12057 self,
12058 ) -> impl gax::paginator::ItemPaginator<
12059 crate::model::ListRuntimeProjectAttachmentsResponse,
12060 gax::error::Error,
12061 > {
12062 use gax::paginator::Paginator;
12063 self.by_page().items()
12064 }
12065
12066 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12070 self.0.request.parent = v.into();
12071 self
12072 }
12073
12074 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12076 self.0.request.page_size = v.into();
12077 self
12078 }
12079
12080 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12082 self.0.request.page_token = v.into();
12083 self
12084 }
12085
12086 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12088 self.0.request.filter = v.into();
12089 self
12090 }
12091
12092 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12094 self.0.request.order_by = v.into();
12095 self
12096 }
12097 }
12098
12099 #[doc(hidden)]
12100 impl gax::options::internal::RequestBuilder for ListRuntimeProjectAttachments {
12101 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12102 &mut self.0.options
12103 }
12104 }
12105
12106 #[derive(Clone, Debug)]
12124 pub struct DeleteRuntimeProjectAttachment(
12125 RequestBuilder<crate::model::DeleteRuntimeProjectAttachmentRequest>,
12126 );
12127
12128 impl DeleteRuntimeProjectAttachment {
12129 pub(crate) fn new(
12130 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12131 ) -> Self {
12132 Self(RequestBuilder::new(stub))
12133 }
12134
12135 pub fn with_request<V: Into<crate::model::DeleteRuntimeProjectAttachmentRequest>>(
12137 mut self,
12138 v: V,
12139 ) -> Self {
12140 self.0.request = v.into();
12141 self
12142 }
12143
12144 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12146 self.0.options = v.into();
12147 self
12148 }
12149
12150 pub async fn send(self) -> Result<()> {
12152 (*self.0.stub)
12153 .delete_runtime_project_attachment(self.0.request, self.0.options)
12154 .await
12155 .map(gax::response::Response::into_body)
12156 }
12157
12158 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12162 self.0.request.name = v.into();
12163 self
12164 }
12165 }
12166
12167 #[doc(hidden)]
12168 impl gax::options::internal::RequestBuilder for DeleteRuntimeProjectAttachment {
12169 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12170 &mut self.0.options
12171 }
12172 }
12173
12174 #[derive(Clone, Debug)]
12192 pub struct LookupRuntimeProjectAttachment(
12193 RequestBuilder<crate::model::LookupRuntimeProjectAttachmentRequest>,
12194 );
12195
12196 impl LookupRuntimeProjectAttachment {
12197 pub(crate) fn new(
12198 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12199 ) -> Self {
12200 Self(RequestBuilder::new(stub))
12201 }
12202
12203 pub fn with_request<V: Into<crate::model::LookupRuntimeProjectAttachmentRequest>>(
12205 mut self,
12206 v: V,
12207 ) -> Self {
12208 self.0.request = v.into();
12209 self
12210 }
12211
12212 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12214 self.0.options = v.into();
12215 self
12216 }
12217
12218 pub async fn send(self) -> Result<crate::model::LookupRuntimeProjectAttachmentResponse> {
12220 (*self.0.stub)
12221 .lookup_runtime_project_attachment(self.0.request, self.0.options)
12222 .await
12223 .map(gax::response::Response::into_body)
12224 }
12225
12226 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12230 self.0.request.name = v.into();
12231 self
12232 }
12233 }
12234
12235 #[doc(hidden)]
12236 impl gax::options::internal::RequestBuilder for LookupRuntimeProjectAttachment {
12237 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12238 &mut self.0.options
12239 }
12240 }
12241
12242 #[derive(Clone, Debug)]
12264 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
12265
12266 impl ListLocations {
12267 pub(crate) fn new(
12268 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12269 ) -> Self {
12270 Self(RequestBuilder::new(stub))
12271 }
12272
12273 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
12275 mut self,
12276 v: V,
12277 ) -> Self {
12278 self.0.request = v.into();
12279 self
12280 }
12281
12282 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12284 self.0.options = v.into();
12285 self
12286 }
12287
12288 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
12290 (*self.0.stub)
12291 .list_locations(self.0.request, self.0.options)
12292 .await
12293 .map(gax::response::Response::into_body)
12294 }
12295
12296 pub fn by_page(
12298 self,
12299 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
12300 {
12301 use std::clone::Clone;
12302 let token = self.0.request.page_token.clone();
12303 let execute = move |token: String| {
12304 let mut builder = self.clone();
12305 builder.0.request = builder.0.request.set_page_token(token);
12306 builder.send()
12307 };
12308 gax::paginator::internal::new_paginator(token, execute)
12309 }
12310
12311 pub fn by_item(
12313 self,
12314 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
12315 {
12316 use gax::paginator::Paginator;
12317 self.by_page().items()
12318 }
12319
12320 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12322 self.0.request.name = v.into();
12323 self
12324 }
12325
12326 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12328 self.0.request.filter = v.into();
12329 self
12330 }
12331
12332 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12334 self.0.request.page_size = v.into();
12335 self
12336 }
12337
12338 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12340 self.0.request.page_token = v.into();
12341 self
12342 }
12343 }
12344
12345 #[doc(hidden)]
12346 impl gax::options::internal::RequestBuilder for ListLocations {
12347 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12348 &mut self.0.options
12349 }
12350 }
12351
12352 #[derive(Clone, Debug)]
12370 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
12371
12372 impl GetLocation {
12373 pub(crate) fn new(
12374 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12375 ) -> Self {
12376 Self(RequestBuilder::new(stub))
12377 }
12378
12379 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
12381 self.0.request = v.into();
12382 self
12383 }
12384
12385 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12387 self.0.options = v.into();
12388 self
12389 }
12390
12391 pub async fn send(self) -> Result<location::model::Location> {
12393 (*self.0.stub)
12394 .get_location(self.0.request, self.0.options)
12395 .await
12396 .map(gax::response::Response::into_body)
12397 }
12398
12399 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12401 self.0.request.name = v.into();
12402 self
12403 }
12404 }
12405
12406 #[doc(hidden)]
12407 impl gax::options::internal::RequestBuilder for GetLocation {
12408 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12409 &mut self.0.options
12410 }
12411 }
12412
12413 #[derive(Clone, Debug)]
12435 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
12436
12437 impl ListOperations {
12438 pub(crate) fn new(
12439 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12440 ) -> Self {
12441 Self(RequestBuilder::new(stub))
12442 }
12443
12444 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
12446 mut self,
12447 v: V,
12448 ) -> Self {
12449 self.0.request = v.into();
12450 self
12451 }
12452
12453 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12455 self.0.options = v.into();
12456 self
12457 }
12458
12459 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
12461 (*self.0.stub)
12462 .list_operations(self.0.request, self.0.options)
12463 .await
12464 .map(gax::response::Response::into_body)
12465 }
12466
12467 pub fn by_page(
12469 self,
12470 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
12471 {
12472 use std::clone::Clone;
12473 let token = self.0.request.page_token.clone();
12474 let execute = move |token: String| {
12475 let mut builder = self.clone();
12476 builder.0.request = builder.0.request.set_page_token(token);
12477 builder.send()
12478 };
12479 gax::paginator::internal::new_paginator(token, execute)
12480 }
12481
12482 pub fn by_item(
12484 self,
12485 ) -> impl gax::paginator::ItemPaginator<
12486 longrunning::model::ListOperationsResponse,
12487 gax::error::Error,
12488 > {
12489 use gax::paginator::Paginator;
12490 self.by_page().items()
12491 }
12492
12493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12495 self.0.request.name = v.into();
12496 self
12497 }
12498
12499 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12501 self.0.request.filter = v.into();
12502 self
12503 }
12504
12505 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12507 self.0.request.page_size = v.into();
12508 self
12509 }
12510
12511 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12513 self.0.request.page_token = v.into();
12514 self
12515 }
12516
12517 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
12519 self.0.request.return_partial_success = v.into();
12520 self
12521 }
12522 }
12523
12524 #[doc(hidden)]
12525 impl gax::options::internal::RequestBuilder for ListOperations {
12526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12527 &mut self.0.options
12528 }
12529 }
12530
12531 #[derive(Clone, Debug)]
12549 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
12550
12551 impl GetOperation {
12552 pub(crate) fn new(
12553 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12554 ) -> Self {
12555 Self(RequestBuilder::new(stub))
12556 }
12557
12558 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
12560 mut self,
12561 v: V,
12562 ) -> Self {
12563 self.0.request = v.into();
12564 self
12565 }
12566
12567 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12569 self.0.options = v.into();
12570 self
12571 }
12572
12573 pub async fn send(self) -> Result<longrunning::model::Operation> {
12575 (*self.0.stub)
12576 .get_operation(self.0.request, self.0.options)
12577 .await
12578 .map(gax::response::Response::into_body)
12579 }
12580
12581 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12583 self.0.request.name = v.into();
12584 self
12585 }
12586 }
12587
12588 #[doc(hidden)]
12589 impl gax::options::internal::RequestBuilder for GetOperation {
12590 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12591 &mut self.0.options
12592 }
12593 }
12594
12595 #[derive(Clone, Debug)]
12613 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
12614
12615 impl DeleteOperation {
12616 pub(crate) fn new(
12617 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12618 ) -> Self {
12619 Self(RequestBuilder::new(stub))
12620 }
12621
12622 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
12624 mut self,
12625 v: V,
12626 ) -> Self {
12627 self.0.request = v.into();
12628 self
12629 }
12630
12631 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12633 self.0.options = v.into();
12634 self
12635 }
12636
12637 pub async fn send(self) -> Result<()> {
12639 (*self.0.stub)
12640 .delete_operation(self.0.request, self.0.options)
12641 .await
12642 .map(gax::response::Response::into_body)
12643 }
12644
12645 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12647 self.0.request.name = v.into();
12648 self
12649 }
12650 }
12651
12652 #[doc(hidden)]
12653 impl gax::options::internal::RequestBuilder for DeleteOperation {
12654 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12655 &mut self.0.options
12656 }
12657 }
12658
12659 #[derive(Clone, Debug)]
12677 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
12678
12679 impl CancelOperation {
12680 pub(crate) fn new(
12681 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuntimeProjectAttachmentService>,
12682 ) -> Self {
12683 Self(RequestBuilder::new(stub))
12684 }
12685
12686 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
12688 mut self,
12689 v: V,
12690 ) -> Self {
12691 self.0.request = v.into();
12692 self
12693 }
12694
12695 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12697 self.0.options = v.into();
12698 self
12699 }
12700
12701 pub async fn send(self) -> Result<()> {
12703 (*self.0.stub)
12704 .cancel_operation(self.0.request, self.0.options)
12705 .await
12706 .map(gax::response::Response::into_body)
12707 }
12708
12709 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12711 self.0.request.name = v.into();
12712 self
12713 }
12714 }
12715
12716 #[doc(hidden)]
12717 impl gax::options::internal::RequestBuilder for CancelOperation {
12718 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12719 &mut self.0.options
12720 }
12721 }
12722}