1pub mod developer_connect {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::DeveloperConnect;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = DeveloperConnect;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
95
96 impl ListConnections {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
117 (*self.0.stub)
118 .list_connections(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn by_page(
125 self,
126 ) -> impl google_cloud_gax::paginator::Paginator<
127 crate::model::ListConnectionsResponse,
128 crate::Error,
129 > {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 google_cloud_gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl google_cloud_gax::paginator::ItemPaginator<
144 crate::model::ListConnectionsResponse,
145 crate::Error,
146 > {
147 use google_cloud_gax::paginator::Paginator;
148 self.by_page().items()
149 }
150
151 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
155 self.0.request.parent = v.into();
156 self
157 }
158
159 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
161 self.0.request.page_size = v.into();
162 self
163 }
164
165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
167 self.0.request.page_token = v.into();
168 self
169 }
170
171 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
173 self.0.request.filter = v.into();
174 self
175 }
176
177 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
179 self.0.request.order_by = v.into();
180 self
181 }
182 }
183
184 #[doc(hidden)]
185 impl crate::RequestBuilder for ListConnections {
186 fn request_options(&mut self) -> &mut crate::RequestOptions {
187 &mut self.0.options
188 }
189 }
190
191 #[derive(Clone, Debug)]
208 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
209
210 impl GetConnection {
211 pub(crate) fn new(
212 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
213 ) -> Self {
214 Self(RequestBuilder::new(stub))
215 }
216
217 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
219 self.0.request = v.into();
220 self
221 }
222
223 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
225 self.0.options = v.into();
226 self
227 }
228
229 pub async fn send(self) -> Result<crate::model::Connection> {
231 (*self.0.stub)
232 .get_connection(self.0.request, self.0.options)
233 .await
234 .map(crate::Response::into_body)
235 }
236
237 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
241 self.0.request.name = v.into();
242 self
243 }
244 }
245
246 #[doc(hidden)]
247 impl crate::RequestBuilder for GetConnection {
248 fn request_options(&mut self) -> &mut crate::RequestOptions {
249 &mut self.0.options
250 }
251 }
252
253 #[derive(Clone, Debug)]
271 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
272
273 impl CreateConnection {
274 pub(crate) fn new(
275 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
276 ) -> Self {
277 Self(RequestBuilder::new(stub))
278 }
279
280 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
282 mut self,
283 v: V,
284 ) -> Self {
285 self.0.request = v.into();
286 self
287 }
288
289 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
291 self.0.options = v.into();
292 self
293 }
294
295 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
302 (*self.0.stub)
303 .create_connection(self.0.request, self.0.options)
304 .await
305 .map(crate::Response::into_body)
306 }
307
308 pub fn poller(
310 self,
311 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
312 {
313 type Operation = google_cloud_lro::internal::Operation<
314 crate::model::Connection,
315 crate::model::OperationMetadata,
316 >;
317 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
318 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
319
320 let stub = self.0.stub.clone();
321 let mut options = self.0.options.clone();
322 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
323 let query = move |name| {
324 let stub = stub.clone();
325 let options = options.clone();
326 async {
327 let op = GetOperation::new(stub)
328 .set_name(name)
329 .with_options(options)
330 .send()
331 .await?;
332 Ok(Operation::new(op))
333 }
334 };
335
336 let start = move || async {
337 let op = self.send().await?;
338 Ok(Operation::new(op))
339 };
340
341 google_cloud_lro::internal::new_poller(
342 polling_error_policy,
343 polling_backoff_policy,
344 start,
345 query,
346 )
347 }
348
349 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
353 self.0.request.parent = v.into();
354 self
355 }
356
357 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
361 self.0.request.connection_id = v.into();
362 self
363 }
364
365 pub fn set_connection<T>(mut self, v: T) -> Self
369 where
370 T: std::convert::Into<crate::model::Connection>,
371 {
372 self.0.request.connection = std::option::Option::Some(v.into());
373 self
374 }
375
376 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
380 where
381 T: std::convert::Into<crate::model::Connection>,
382 {
383 self.0.request.connection = v.map(|x| x.into());
384 self
385 }
386
387 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
389 self.0.request.request_id = v.into();
390 self
391 }
392
393 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
395 self.0.request.validate_only = v.into();
396 self
397 }
398 }
399
400 #[doc(hidden)]
401 impl crate::RequestBuilder for CreateConnection {
402 fn request_options(&mut self) -> &mut crate::RequestOptions {
403 &mut self.0.options
404 }
405 }
406
407 #[derive(Clone, Debug)]
425 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
426
427 impl UpdateConnection {
428 pub(crate) fn new(
429 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
430 ) -> Self {
431 Self(RequestBuilder::new(stub))
432 }
433
434 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
436 mut self,
437 v: V,
438 ) -> Self {
439 self.0.request = v.into();
440 self
441 }
442
443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
445 self.0.options = v.into();
446 self
447 }
448
449 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
456 (*self.0.stub)
457 .update_connection(self.0.request, self.0.options)
458 .await
459 .map(crate::Response::into_body)
460 }
461
462 pub fn poller(
464 self,
465 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
466 {
467 type Operation = google_cloud_lro::internal::Operation<
468 crate::model::Connection,
469 crate::model::OperationMetadata,
470 >;
471 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
472 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
473
474 let stub = self.0.stub.clone();
475 let mut options = self.0.options.clone();
476 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
477 let query = move |name| {
478 let stub = stub.clone();
479 let options = options.clone();
480 async {
481 let op = GetOperation::new(stub)
482 .set_name(name)
483 .with_options(options)
484 .send()
485 .await?;
486 Ok(Operation::new(op))
487 }
488 };
489
490 let start = move || async {
491 let op = self.send().await?;
492 Ok(Operation::new(op))
493 };
494
495 google_cloud_lro::internal::new_poller(
496 polling_error_policy,
497 polling_backoff_policy,
498 start,
499 query,
500 )
501 }
502
503 pub fn set_update_mask<T>(mut self, v: T) -> Self
507 where
508 T: std::convert::Into<wkt::FieldMask>,
509 {
510 self.0.request.update_mask = std::option::Option::Some(v.into());
511 self
512 }
513
514 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
518 where
519 T: std::convert::Into<wkt::FieldMask>,
520 {
521 self.0.request.update_mask = v.map(|x| x.into());
522 self
523 }
524
525 pub fn set_connection<T>(mut self, v: T) -> Self
529 where
530 T: std::convert::Into<crate::model::Connection>,
531 {
532 self.0.request.connection = std::option::Option::Some(v.into());
533 self
534 }
535
536 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
540 where
541 T: std::convert::Into<crate::model::Connection>,
542 {
543 self.0.request.connection = v.map(|x| x.into());
544 self
545 }
546
547 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
549 self.0.request.request_id = v.into();
550 self
551 }
552
553 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
555 self.0.request.allow_missing = v.into();
556 self
557 }
558
559 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
561 self.0.request.validate_only = v.into();
562 self
563 }
564 }
565
566 #[doc(hidden)]
567 impl crate::RequestBuilder for UpdateConnection {
568 fn request_options(&mut self) -> &mut crate::RequestOptions {
569 &mut self.0.options
570 }
571 }
572
573 #[derive(Clone, Debug)]
591 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
592
593 impl DeleteConnection {
594 pub(crate) fn new(
595 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
596 ) -> Self {
597 Self(RequestBuilder::new(stub))
598 }
599
600 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
602 mut self,
603 v: V,
604 ) -> Self {
605 self.0.request = v.into();
606 self
607 }
608
609 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
611 self.0.options = v.into();
612 self
613 }
614
615 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
622 (*self.0.stub)
623 .delete_connection(self.0.request, self.0.options)
624 .await
625 .map(crate::Response::into_body)
626 }
627
628 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
630 type Operation =
631 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
632 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
633 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
634
635 let stub = self.0.stub.clone();
636 let mut options = self.0.options.clone();
637 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
638 let query = move |name| {
639 let stub = stub.clone();
640 let options = options.clone();
641 async {
642 let op = GetOperation::new(stub)
643 .set_name(name)
644 .with_options(options)
645 .send()
646 .await?;
647 Ok(Operation::new(op))
648 }
649 };
650
651 let start = move || async {
652 let op = self.send().await?;
653 Ok(Operation::new(op))
654 };
655
656 google_cloud_lro::internal::new_unit_response_poller(
657 polling_error_policy,
658 polling_backoff_policy,
659 start,
660 query,
661 )
662 }
663
664 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
668 self.0.request.name = v.into();
669 self
670 }
671
672 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
674 self.0.request.request_id = v.into();
675 self
676 }
677
678 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
680 self.0.request.validate_only = v.into();
681 self
682 }
683
684 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
686 self.0.request.etag = v.into();
687 self
688 }
689 }
690
691 #[doc(hidden)]
692 impl crate::RequestBuilder for DeleteConnection {
693 fn request_options(&mut self) -> &mut crate::RequestOptions {
694 &mut self.0.options
695 }
696 }
697
698 #[derive(Clone, Debug)]
716 pub struct CreateGitRepositoryLink(
717 RequestBuilder<crate::model::CreateGitRepositoryLinkRequest>,
718 );
719
720 impl CreateGitRepositoryLink {
721 pub(crate) fn new(
722 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
723 ) -> Self {
724 Self(RequestBuilder::new(stub))
725 }
726
727 pub fn with_request<V: Into<crate::model::CreateGitRepositoryLinkRequest>>(
729 mut self,
730 v: V,
731 ) -> Self {
732 self.0.request = v.into();
733 self
734 }
735
736 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
738 self.0.options = v.into();
739 self
740 }
741
742 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
749 (*self.0.stub)
750 .create_git_repository_link(self.0.request, self.0.options)
751 .await
752 .map(crate::Response::into_body)
753 }
754
755 pub fn poller(
757 self,
758 ) -> impl google_cloud_lro::Poller<
759 crate::model::GitRepositoryLink,
760 crate::model::OperationMetadata,
761 > {
762 type Operation = google_cloud_lro::internal::Operation<
763 crate::model::GitRepositoryLink,
764 crate::model::OperationMetadata,
765 >;
766 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
767 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
768
769 let stub = self.0.stub.clone();
770 let mut options = self.0.options.clone();
771 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
772 let query = move |name| {
773 let stub = stub.clone();
774 let options = options.clone();
775 async {
776 let op = GetOperation::new(stub)
777 .set_name(name)
778 .with_options(options)
779 .send()
780 .await?;
781 Ok(Operation::new(op))
782 }
783 };
784
785 let start = move || async {
786 let op = self.send().await?;
787 Ok(Operation::new(op))
788 };
789
790 google_cloud_lro::internal::new_poller(
791 polling_error_policy,
792 polling_backoff_policy,
793 start,
794 query,
795 )
796 }
797
798 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
802 self.0.request.parent = v.into();
803 self
804 }
805
806 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
810 where
811 T: std::convert::Into<crate::model::GitRepositoryLink>,
812 {
813 self.0.request.git_repository_link = std::option::Option::Some(v.into());
814 self
815 }
816
817 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
821 where
822 T: std::convert::Into<crate::model::GitRepositoryLink>,
823 {
824 self.0.request.git_repository_link = v.map(|x| x.into());
825 self
826 }
827
828 pub fn set_git_repository_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
832 self.0.request.git_repository_link_id = v.into();
833 self
834 }
835
836 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
838 self.0.request.request_id = v.into();
839 self
840 }
841
842 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
844 self.0.request.validate_only = v.into();
845 self
846 }
847 }
848
849 #[doc(hidden)]
850 impl crate::RequestBuilder for CreateGitRepositoryLink {
851 fn request_options(&mut self) -> &mut crate::RequestOptions {
852 &mut self.0.options
853 }
854 }
855
856 #[derive(Clone, Debug)]
874 pub struct DeleteGitRepositoryLink(
875 RequestBuilder<crate::model::DeleteGitRepositoryLinkRequest>,
876 );
877
878 impl DeleteGitRepositoryLink {
879 pub(crate) fn new(
880 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
881 ) -> Self {
882 Self(RequestBuilder::new(stub))
883 }
884
885 pub fn with_request<V: Into<crate::model::DeleteGitRepositoryLinkRequest>>(
887 mut self,
888 v: V,
889 ) -> Self {
890 self.0.request = v.into();
891 self
892 }
893
894 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
896 self.0.options = v.into();
897 self
898 }
899
900 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
907 (*self.0.stub)
908 .delete_git_repository_link(self.0.request, self.0.options)
909 .await
910 .map(crate::Response::into_body)
911 }
912
913 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
915 type Operation =
916 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
917 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
918 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
919
920 let stub = self.0.stub.clone();
921 let mut options = self.0.options.clone();
922 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
923 let query = move |name| {
924 let stub = stub.clone();
925 let options = options.clone();
926 async {
927 let op = GetOperation::new(stub)
928 .set_name(name)
929 .with_options(options)
930 .send()
931 .await?;
932 Ok(Operation::new(op))
933 }
934 };
935
936 let start = move || async {
937 let op = self.send().await?;
938 Ok(Operation::new(op))
939 };
940
941 google_cloud_lro::internal::new_unit_response_poller(
942 polling_error_policy,
943 polling_backoff_policy,
944 start,
945 query,
946 )
947 }
948
949 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
953 self.0.request.name = v.into();
954 self
955 }
956
957 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
959 self.0.request.request_id = v.into();
960 self
961 }
962
963 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
965 self.0.request.validate_only = v.into();
966 self
967 }
968
969 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
971 self.0.request.etag = v.into();
972 self
973 }
974 }
975
976 #[doc(hidden)]
977 impl crate::RequestBuilder for DeleteGitRepositoryLink {
978 fn request_options(&mut self) -> &mut crate::RequestOptions {
979 &mut self.0.options
980 }
981 }
982
983 #[derive(Clone, Debug)]
1004 pub struct ListGitRepositoryLinks(RequestBuilder<crate::model::ListGitRepositoryLinksRequest>);
1005
1006 impl ListGitRepositoryLinks {
1007 pub(crate) fn new(
1008 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1009 ) -> Self {
1010 Self(RequestBuilder::new(stub))
1011 }
1012
1013 pub fn with_request<V: Into<crate::model::ListGitRepositoryLinksRequest>>(
1015 mut self,
1016 v: V,
1017 ) -> Self {
1018 self.0.request = v.into();
1019 self
1020 }
1021
1022 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1024 self.0.options = v.into();
1025 self
1026 }
1027
1028 pub async fn send(self) -> Result<crate::model::ListGitRepositoryLinksResponse> {
1030 (*self.0.stub)
1031 .list_git_repository_links(self.0.request, self.0.options)
1032 .await
1033 .map(crate::Response::into_body)
1034 }
1035
1036 pub fn by_page(
1038 self,
1039 ) -> impl google_cloud_gax::paginator::Paginator<
1040 crate::model::ListGitRepositoryLinksResponse,
1041 crate::Error,
1042 > {
1043 use std::clone::Clone;
1044 let token = self.0.request.page_token.clone();
1045 let execute = move |token: String| {
1046 let mut builder = self.clone();
1047 builder.0.request = builder.0.request.set_page_token(token);
1048 builder.send()
1049 };
1050 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1051 }
1052
1053 pub fn by_item(
1055 self,
1056 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1057 crate::model::ListGitRepositoryLinksResponse,
1058 crate::Error,
1059 > {
1060 use google_cloud_gax::paginator::Paginator;
1061 self.by_page().items()
1062 }
1063
1064 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1068 self.0.request.parent = v.into();
1069 self
1070 }
1071
1072 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1074 self.0.request.page_size = v.into();
1075 self
1076 }
1077
1078 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1080 self.0.request.page_token = v.into();
1081 self
1082 }
1083
1084 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1086 self.0.request.filter = v.into();
1087 self
1088 }
1089
1090 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1092 self.0.request.order_by = v.into();
1093 self
1094 }
1095 }
1096
1097 #[doc(hidden)]
1098 impl crate::RequestBuilder for ListGitRepositoryLinks {
1099 fn request_options(&mut self) -> &mut crate::RequestOptions {
1100 &mut self.0.options
1101 }
1102 }
1103
1104 #[derive(Clone, Debug)]
1121 pub struct GetGitRepositoryLink(RequestBuilder<crate::model::GetGitRepositoryLinkRequest>);
1122
1123 impl GetGitRepositoryLink {
1124 pub(crate) fn new(
1125 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1126 ) -> Self {
1127 Self(RequestBuilder::new(stub))
1128 }
1129
1130 pub fn with_request<V: Into<crate::model::GetGitRepositoryLinkRequest>>(
1132 mut self,
1133 v: V,
1134 ) -> Self {
1135 self.0.request = v.into();
1136 self
1137 }
1138
1139 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1141 self.0.options = v.into();
1142 self
1143 }
1144
1145 pub async fn send(self) -> Result<crate::model::GitRepositoryLink> {
1147 (*self.0.stub)
1148 .get_git_repository_link(self.0.request, self.0.options)
1149 .await
1150 .map(crate::Response::into_body)
1151 }
1152
1153 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1157 self.0.request.name = v.into();
1158 self
1159 }
1160 }
1161
1162 #[doc(hidden)]
1163 impl crate::RequestBuilder for GetGitRepositoryLink {
1164 fn request_options(&mut self) -> &mut crate::RequestOptions {
1165 &mut self.0.options
1166 }
1167 }
1168
1169 #[derive(Clone, Debug)]
1186 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1187
1188 impl FetchReadWriteToken {
1189 pub(crate) fn new(
1190 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1191 ) -> Self {
1192 Self(RequestBuilder::new(stub))
1193 }
1194
1195 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1197 mut self,
1198 v: V,
1199 ) -> Self {
1200 self.0.request = v.into();
1201 self
1202 }
1203
1204 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1206 self.0.options = v.into();
1207 self
1208 }
1209
1210 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1212 (*self.0.stub)
1213 .fetch_read_write_token(self.0.request, self.0.options)
1214 .await
1215 .map(crate::Response::into_body)
1216 }
1217
1218 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1222 self.0.request.git_repository_link = v.into();
1223 self
1224 }
1225 }
1226
1227 #[doc(hidden)]
1228 impl crate::RequestBuilder for FetchReadWriteToken {
1229 fn request_options(&mut self) -> &mut crate::RequestOptions {
1230 &mut self.0.options
1231 }
1232 }
1233
1234 #[derive(Clone, Debug)]
1251 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1252
1253 impl FetchReadToken {
1254 pub(crate) fn new(
1255 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1256 ) -> Self {
1257 Self(RequestBuilder::new(stub))
1258 }
1259
1260 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1262 self.0.request = v.into();
1263 self
1264 }
1265
1266 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1268 self.0.options = v.into();
1269 self
1270 }
1271
1272 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1274 (*self.0.stub)
1275 .fetch_read_token(self.0.request, self.0.options)
1276 .await
1277 .map(crate::Response::into_body)
1278 }
1279
1280 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1284 self.0.request.git_repository_link = v.into();
1285 self
1286 }
1287 }
1288
1289 #[doc(hidden)]
1290 impl crate::RequestBuilder for FetchReadToken {
1291 fn request_options(&mut self) -> &mut crate::RequestOptions {
1292 &mut self.0.options
1293 }
1294 }
1295
1296 #[derive(Clone, Debug)]
1317 pub struct FetchLinkableGitRepositories(
1318 RequestBuilder<crate::model::FetchLinkableGitRepositoriesRequest>,
1319 );
1320
1321 impl FetchLinkableGitRepositories {
1322 pub(crate) fn new(
1323 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1324 ) -> Self {
1325 Self(RequestBuilder::new(stub))
1326 }
1327
1328 pub fn with_request<V: Into<crate::model::FetchLinkableGitRepositoriesRequest>>(
1330 mut self,
1331 v: V,
1332 ) -> Self {
1333 self.0.request = v.into();
1334 self
1335 }
1336
1337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1339 self.0.options = v.into();
1340 self
1341 }
1342
1343 pub async fn send(self) -> Result<crate::model::FetchLinkableGitRepositoriesResponse> {
1345 (*self.0.stub)
1346 .fetch_linkable_git_repositories(self.0.request, self.0.options)
1347 .await
1348 .map(crate::Response::into_body)
1349 }
1350
1351 pub fn by_page(
1353 self,
1354 ) -> impl google_cloud_gax::paginator::Paginator<
1355 crate::model::FetchLinkableGitRepositoriesResponse,
1356 crate::Error,
1357 > {
1358 use std::clone::Clone;
1359 let token = self.0.request.page_token.clone();
1360 let execute = move |token: String| {
1361 let mut builder = self.clone();
1362 builder.0.request = builder.0.request.set_page_token(token);
1363 builder.send()
1364 };
1365 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1366 }
1367
1368 pub fn by_item(
1370 self,
1371 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1372 crate::model::FetchLinkableGitRepositoriesResponse,
1373 crate::Error,
1374 > {
1375 use google_cloud_gax::paginator::Paginator;
1376 self.by_page().items()
1377 }
1378
1379 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1383 self.0.request.connection = v.into();
1384 self
1385 }
1386
1387 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1389 self.0.request.page_size = v.into();
1390 self
1391 }
1392
1393 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1395 self.0.request.page_token = v.into();
1396 self
1397 }
1398 }
1399
1400 #[doc(hidden)]
1401 impl crate::RequestBuilder for FetchLinkableGitRepositories {
1402 fn request_options(&mut self) -> &mut crate::RequestOptions {
1403 &mut self.0.options
1404 }
1405 }
1406
1407 #[derive(Clone, Debug)]
1424 pub struct FetchGitHubInstallations(
1425 RequestBuilder<crate::model::FetchGitHubInstallationsRequest>,
1426 );
1427
1428 impl FetchGitHubInstallations {
1429 pub(crate) fn new(
1430 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1431 ) -> Self {
1432 Self(RequestBuilder::new(stub))
1433 }
1434
1435 pub fn with_request<V: Into<crate::model::FetchGitHubInstallationsRequest>>(
1437 mut self,
1438 v: V,
1439 ) -> Self {
1440 self.0.request = v.into();
1441 self
1442 }
1443
1444 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1446 self.0.options = v.into();
1447 self
1448 }
1449
1450 pub async fn send(self) -> Result<crate::model::FetchGitHubInstallationsResponse> {
1452 (*self.0.stub)
1453 .fetch_git_hub_installations(self.0.request, self.0.options)
1454 .await
1455 .map(crate::Response::into_body)
1456 }
1457
1458 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462 self.0.request.connection = v.into();
1463 self
1464 }
1465 }
1466
1467 #[doc(hidden)]
1468 impl crate::RequestBuilder for FetchGitHubInstallations {
1469 fn request_options(&mut self) -> &mut crate::RequestOptions {
1470 &mut self.0.options
1471 }
1472 }
1473
1474 #[derive(Clone, Debug)]
1491 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1492
1493 impl FetchGitRefs {
1494 pub(crate) fn new(
1495 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1496 ) -> Self {
1497 Self(RequestBuilder::new(stub))
1498 }
1499
1500 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1502 self.0.request = v.into();
1503 self
1504 }
1505
1506 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1508 self.0.options = v.into();
1509 self
1510 }
1511
1512 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1514 (*self.0.stub)
1515 .fetch_git_refs(self.0.request, self.0.options)
1516 .await
1517 .map(crate::Response::into_body)
1518 }
1519
1520 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1524 self.0.request.git_repository_link = v.into();
1525 self
1526 }
1527
1528 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1532 mut self,
1533 v: T,
1534 ) -> Self {
1535 self.0.request.ref_type = v.into();
1536 self
1537 }
1538
1539 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1541 self.0.request.page_size = v.into();
1542 self
1543 }
1544
1545 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1547 self.0.request.page_token = v.into();
1548 self
1549 }
1550 }
1551
1552 #[doc(hidden)]
1553 impl crate::RequestBuilder for FetchGitRefs {
1554 fn request_options(&mut self) -> &mut crate::RequestOptions {
1555 &mut self.0.options
1556 }
1557 }
1558
1559 #[derive(Clone, Debug)]
1580 pub struct ListAccountConnectors(RequestBuilder<crate::model::ListAccountConnectorsRequest>);
1581
1582 impl ListAccountConnectors {
1583 pub(crate) fn new(
1584 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1585 ) -> Self {
1586 Self(RequestBuilder::new(stub))
1587 }
1588
1589 pub fn with_request<V: Into<crate::model::ListAccountConnectorsRequest>>(
1591 mut self,
1592 v: V,
1593 ) -> Self {
1594 self.0.request = v.into();
1595 self
1596 }
1597
1598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1600 self.0.options = v.into();
1601 self
1602 }
1603
1604 pub async fn send(self) -> Result<crate::model::ListAccountConnectorsResponse> {
1606 (*self.0.stub)
1607 .list_account_connectors(self.0.request, self.0.options)
1608 .await
1609 .map(crate::Response::into_body)
1610 }
1611
1612 pub fn by_page(
1614 self,
1615 ) -> impl google_cloud_gax::paginator::Paginator<
1616 crate::model::ListAccountConnectorsResponse,
1617 crate::Error,
1618 > {
1619 use std::clone::Clone;
1620 let token = self.0.request.page_token.clone();
1621 let execute = move |token: String| {
1622 let mut builder = self.clone();
1623 builder.0.request = builder.0.request.set_page_token(token);
1624 builder.send()
1625 };
1626 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1627 }
1628
1629 pub fn by_item(
1631 self,
1632 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1633 crate::model::ListAccountConnectorsResponse,
1634 crate::Error,
1635 > {
1636 use google_cloud_gax::paginator::Paginator;
1637 self.by_page().items()
1638 }
1639
1640 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1644 self.0.request.parent = v.into();
1645 self
1646 }
1647
1648 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1650 self.0.request.page_size = v.into();
1651 self
1652 }
1653
1654 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.0.request.page_token = v.into();
1657 self
1658 }
1659
1660 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1662 self.0.request.filter = v.into();
1663 self
1664 }
1665
1666 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1668 self.0.request.order_by = v.into();
1669 self
1670 }
1671 }
1672
1673 #[doc(hidden)]
1674 impl crate::RequestBuilder for ListAccountConnectors {
1675 fn request_options(&mut self) -> &mut crate::RequestOptions {
1676 &mut self.0.options
1677 }
1678 }
1679
1680 #[derive(Clone, Debug)]
1697 pub struct GetAccountConnector(RequestBuilder<crate::model::GetAccountConnectorRequest>);
1698
1699 impl GetAccountConnector {
1700 pub(crate) fn new(
1701 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1702 ) -> Self {
1703 Self(RequestBuilder::new(stub))
1704 }
1705
1706 pub fn with_request<V: Into<crate::model::GetAccountConnectorRequest>>(
1708 mut self,
1709 v: V,
1710 ) -> Self {
1711 self.0.request = v.into();
1712 self
1713 }
1714
1715 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1717 self.0.options = v.into();
1718 self
1719 }
1720
1721 pub async fn send(self) -> Result<crate::model::AccountConnector> {
1723 (*self.0.stub)
1724 .get_account_connector(self.0.request, self.0.options)
1725 .await
1726 .map(crate::Response::into_body)
1727 }
1728
1729 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1733 self.0.request.name = v.into();
1734 self
1735 }
1736 }
1737
1738 #[doc(hidden)]
1739 impl crate::RequestBuilder for GetAccountConnector {
1740 fn request_options(&mut self) -> &mut crate::RequestOptions {
1741 &mut self.0.options
1742 }
1743 }
1744
1745 #[derive(Clone, Debug)]
1763 pub struct CreateAccountConnector(RequestBuilder<crate::model::CreateAccountConnectorRequest>);
1764
1765 impl CreateAccountConnector {
1766 pub(crate) fn new(
1767 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1768 ) -> Self {
1769 Self(RequestBuilder::new(stub))
1770 }
1771
1772 pub fn with_request<V: Into<crate::model::CreateAccountConnectorRequest>>(
1774 mut self,
1775 v: V,
1776 ) -> Self {
1777 self.0.request = v.into();
1778 self
1779 }
1780
1781 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1783 self.0.options = v.into();
1784 self
1785 }
1786
1787 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1794 (*self.0.stub)
1795 .create_account_connector(self.0.request, self.0.options)
1796 .await
1797 .map(crate::Response::into_body)
1798 }
1799
1800 pub fn poller(
1802 self,
1803 ) -> impl google_cloud_lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1804 {
1805 type Operation = google_cloud_lro::internal::Operation<
1806 crate::model::AccountConnector,
1807 crate::model::OperationMetadata,
1808 >;
1809 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1810 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1811
1812 let stub = self.0.stub.clone();
1813 let mut options = self.0.options.clone();
1814 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1815 let query = move |name| {
1816 let stub = stub.clone();
1817 let options = options.clone();
1818 async {
1819 let op = GetOperation::new(stub)
1820 .set_name(name)
1821 .with_options(options)
1822 .send()
1823 .await?;
1824 Ok(Operation::new(op))
1825 }
1826 };
1827
1828 let start = move || async {
1829 let op = self.send().await?;
1830 Ok(Operation::new(op))
1831 };
1832
1833 google_cloud_lro::internal::new_poller(
1834 polling_error_policy,
1835 polling_backoff_policy,
1836 start,
1837 query,
1838 )
1839 }
1840
1841 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1845 self.0.request.parent = v.into();
1846 self
1847 }
1848
1849 pub fn set_account_connector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1853 self.0.request.account_connector_id = v.into();
1854 self
1855 }
1856
1857 pub fn set_account_connector<T>(mut self, v: T) -> Self
1861 where
1862 T: std::convert::Into<crate::model::AccountConnector>,
1863 {
1864 self.0.request.account_connector = std::option::Option::Some(v.into());
1865 self
1866 }
1867
1868 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
1872 where
1873 T: std::convert::Into<crate::model::AccountConnector>,
1874 {
1875 self.0.request.account_connector = v.map(|x| x.into());
1876 self
1877 }
1878
1879 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1881 self.0.request.request_id = v.into();
1882 self
1883 }
1884
1885 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1887 self.0.request.validate_only = v.into();
1888 self
1889 }
1890 }
1891
1892 #[doc(hidden)]
1893 impl crate::RequestBuilder for CreateAccountConnector {
1894 fn request_options(&mut self) -> &mut crate::RequestOptions {
1895 &mut self.0.options
1896 }
1897 }
1898
1899 #[derive(Clone, Debug)]
1917 pub struct UpdateAccountConnector(RequestBuilder<crate::model::UpdateAccountConnectorRequest>);
1918
1919 impl UpdateAccountConnector {
1920 pub(crate) fn new(
1921 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1922 ) -> Self {
1923 Self(RequestBuilder::new(stub))
1924 }
1925
1926 pub fn with_request<V: Into<crate::model::UpdateAccountConnectorRequest>>(
1928 mut self,
1929 v: V,
1930 ) -> Self {
1931 self.0.request = v.into();
1932 self
1933 }
1934
1935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1937 self.0.options = v.into();
1938 self
1939 }
1940
1941 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1948 (*self.0.stub)
1949 .update_account_connector(self.0.request, self.0.options)
1950 .await
1951 .map(crate::Response::into_body)
1952 }
1953
1954 pub fn poller(
1956 self,
1957 ) -> impl google_cloud_lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1958 {
1959 type Operation = google_cloud_lro::internal::Operation<
1960 crate::model::AccountConnector,
1961 crate::model::OperationMetadata,
1962 >;
1963 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1964 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1965
1966 let stub = self.0.stub.clone();
1967 let mut options = self.0.options.clone();
1968 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1969 let query = move |name| {
1970 let stub = stub.clone();
1971 let options = options.clone();
1972 async {
1973 let op = GetOperation::new(stub)
1974 .set_name(name)
1975 .with_options(options)
1976 .send()
1977 .await?;
1978 Ok(Operation::new(op))
1979 }
1980 };
1981
1982 let start = move || async {
1983 let op = self.send().await?;
1984 Ok(Operation::new(op))
1985 };
1986
1987 google_cloud_lro::internal::new_poller(
1988 polling_error_policy,
1989 polling_backoff_policy,
1990 start,
1991 query,
1992 )
1993 }
1994
1995 pub fn set_update_mask<T>(mut self, v: T) -> Self
1997 where
1998 T: std::convert::Into<wkt::FieldMask>,
1999 {
2000 self.0.request.update_mask = std::option::Option::Some(v.into());
2001 self
2002 }
2003
2004 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2006 where
2007 T: std::convert::Into<wkt::FieldMask>,
2008 {
2009 self.0.request.update_mask = v.map(|x| x.into());
2010 self
2011 }
2012
2013 pub fn set_account_connector<T>(mut self, v: T) -> Self
2017 where
2018 T: std::convert::Into<crate::model::AccountConnector>,
2019 {
2020 self.0.request.account_connector = std::option::Option::Some(v.into());
2021 self
2022 }
2023
2024 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
2028 where
2029 T: std::convert::Into<crate::model::AccountConnector>,
2030 {
2031 self.0.request.account_connector = v.map(|x| x.into());
2032 self
2033 }
2034
2035 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2037 self.0.request.request_id = v.into();
2038 self
2039 }
2040
2041 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2043 self.0.request.allow_missing = v.into();
2044 self
2045 }
2046
2047 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2049 self.0.request.validate_only = v.into();
2050 self
2051 }
2052 }
2053
2054 #[doc(hidden)]
2055 impl crate::RequestBuilder for UpdateAccountConnector {
2056 fn request_options(&mut self) -> &mut crate::RequestOptions {
2057 &mut self.0.options
2058 }
2059 }
2060
2061 #[derive(Clone, Debug)]
2079 pub struct DeleteAccountConnector(RequestBuilder<crate::model::DeleteAccountConnectorRequest>);
2080
2081 impl DeleteAccountConnector {
2082 pub(crate) fn new(
2083 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2084 ) -> Self {
2085 Self(RequestBuilder::new(stub))
2086 }
2087
2088 pub fn with_request<V: Into<crate::model::DeleteAccountConnectorRequest>>(
2090 mut self,
2091 v: V,
2092 ) -> Self {
2093 self.0.request = v.into();
2094 self
2095 }
2096
2097 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2099 self.0.options = v.into();
2100 self
2101 }
2102
2103 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2110 (*self.0.stub)
2111 .delete_account_connector(self.0.request, self.0.options)
2112 .await
2113 .map(crate::Response::into_body)
2114 }
2115
2116 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2118 type Operation =
2119 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2120 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2121 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2122
2123 let stub = self.0.stub.clone();
2124 let mut options = self.0.options.clone();
2125 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2126 let query = move |name| {
2127 let stub = stub.clone();
2128 let options = options.clone();
2129 async {
2130 let op = GetOperation::new(stub)
2131 .set_name(name)
2132 .with_options(options)
2133 .send()
2134 .await?;
2135 Ok(Operation::new(op))
2136 }
2137 };
2138
2139 let start = move || async {
2140 let op = self.send().await?;
2141 Ok(Operation::new(op))
2142 };
2143
2144 google_cloud_lro::internal::new_unit_response_poller(
2145 polling_error_policy,
2146 polling_backoff_policy,
2147 start,
2148 query,
2149 )
2150 }
2151
2152 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2156 self.0.request.name = v.into();
2157 self
2158 }
2159
2160 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2162 self.0.request.request_id = v.into();
2163 self
2164 }
2165
2166 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2168 self.0.request.validate_only = v.into();
2169 self
2170 }
2171
2172 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2174 self.0.request.etag = v.into();
2175 self
2176 }
2177
2178 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2180 self.0.request.force = v.into();
2181 self
2182 }
2183 }
2184
2185 #[doc(hidden)]
2186 impl crate::RequestBuilder for DeleteAccountConnector {
2187 fn request_options(&mut self) -> &mut crate::RequestOptions {
2188 &mut self.0.options
2189 }
2190 }
2191
2192 #[derive(Clone, Debug)]
2209 pub struct FetchAccessToken(RequestBuilder<crate::model::FetchAccessTokenRequest>);
2210
2211 impl FetchAccessToken {
2212 pub(crate) fn new(
2213 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2214 ) -> Self {
2215 Self(RequestBuilder::new(stub))
2216 }
2217
2218 pub fn with_request<V: Into<crate::model::FetchAccessTokenRequest>>(
2220 mut self,
2221 v: V,
2222 ) -> Self {
2223 self.0.request = v.into();
2224 self
2225 }
2226
2227 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2229 self.0.options = v.into();
2230 self
2231 }
2232
2233 pub async fn send(self) -> Result<crate::model::FetchAccessTokenResponse> {
2235 (*self.0.stub)
2236 .fetch_access_token(self.0.request, self.0.options)
2237 .await
2238 .map(crate::Response::into_body)
2239 }
2240
2241 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2245 self.0.request.account_connector = v.into();
2246 self
2247 }
2248 }
2249
2250 #[doc(hidden)]
2251 impl crate::RequestBuilder for FetchAccessToken {
2252 fn request_options(&mut self) -> &mut crate::RequestOptions {
2253 &mut self.0.options
2254 }
2255 }
2256
2257 #[derive(Clone, Debug)]
2278 pub struct ListUsers(RequestBuilder<crate::model::ListUsersRequest>);
2279
2280 impl ListUsers {
2281 pub(crate) fn new(
2282 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2283 ) -> Self {
2284 Self(RequestBuilder::new(stub))
2285 }
2286
2287 pub fn with_request<V: Into<crate::model::ListUsersRequest>>(mut self, v: V) -> Self {
2289 self.0.request = v.into();
2290 self
2291 }
2292
2293 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2295 self.0.options = v.into();
2296 self
2297 }
2298
2299 pub async fn send(self) -> Result<crate::model::ListUsersResponse> {
2301 (*self.0.stub)
2302 .list_users(self.0.request, self.0.options)
2303 .await
2304 .map(crate::Response::into_body)
2305 }
2306
2307 pub fn by_page(
2309 self,
2310 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUsersResponse, crate::Error>
2311 {
2312 use std::clone::Clone;
2313 let token = self.0.request.page_token.clone();
2314 let execute = move |token: String| {
2315 let mut builder = self.clone();
2316 builder.0.request = builder.0.request.set_page_token(token);
2317 builder.send()
2318 };
2319 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2320 }
2321
2322 pub fn by_item(
2324 self,
2325 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListUsersResponse, crate::Error>
2326 {
2327 use google_cloud_gax::paginator::Paginator;
2328 self.by_page().items()
2329 }
2330
2331 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2335 self.0.request.parent = v.into();
2336 self
2337 }
2338
2339 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2341 self.0.request.page_size = v.into();
2342 self
2343 }
2344
2345 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2347 self.0.request.page_token = v.into();
2348 self
2349 }
2350
2351 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2353 self.0.request.filter = v.into();
2354 self
2355 }
2356
2357 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2359 self.0.request.order_by = v.into();
2360 self
2361 }
2362 }
2363
2364 #[doc(hidden)]
2365 impl crate::RequestBuilder for ListUsers {
2366 fn request_options(&mut self) -> &mut crate::RequestOptions {
2367 &mut self.0.options
2368 }
2369 }
2370
2371 #[derive(Clone, Debug)]
2389 pub struct DeleteUser(RequestBuilder<crate::model::DeleteUserRequest>);
2390
2391 impl DeleteUser {
2392 pub(crate) fn new(
2393 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2394 ) -> Self {
2395 Self(RequestBuilder::new(stub))
2396 }
2397
2398 pub fn with_request<V: Into<crate::model::DeleteUserRequest>>(mut self, v: V) -> Self {
2400 self.0.request = v.into();
2401 self
2402 }
2403
2404 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2406 self.0.options = v.into();
2407 self
2408 }
2409
2410 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2417 (*self.0.stub)
2418 .delete_user(self.0.request, self.0.options)
2419 .await
2420 .map(crate::Response::into_body)
2421 }
2422
2423 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2425 type Operation =
2426 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2427 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2428 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2429
2430 let stub = self.0.stub.clone();
2431 let mut options = self.0.options.clone();
2432 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2433 let query = move |name| {
2434 let stub = stub.clone();
2435 let options = options.clone();
2436 async {
2437 let op = GetOperation::new(stub)
2438 .set_name(name)
2439 .with_options(options)
2440 .send()
2441 .await?;
2442 Ok(Operation::new(op))
2443 }
2444 };
2445
2446 let start = move || async {
2447 let op = self.send().await?;
2448 Ok(Operation::new(op))
2449 };
2450
2451 google_cloud_lro::internal::new_unit_response_poller(
2452 polling_error_policy,
2453 polling_backoff_policy,
2454 start,
2455 query,
2456 )
2457 }
2458
2459 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2463 self.0.request.name = v.into();
2464 self
2465 }
2466
2467 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2469 self.0.request.request_id = v.into();
2470 self
2471 }
2472
2473 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2475 self.0.request.validate_only = v.into();
2476 self
2477 }
2478
2479 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2481 self.0.request.etag = v.into();
2482 self
2483 }
2484 }
2485
2486 #[doc(hidden)]
2487 impl crate::RequestBuilder for DeleteUser {
2488 fn request_options(&mut self) -> &mut crate::RequestOptions {
2489 &mut self.0.options
2490 }
2491 }
2492
2493 #[derive(Clone, Debug)]
2510 pub struct FetchSelf(RequestBuilder<crate::model::FetchSelfRequest>);
2511
2512 impl FetchSelf {
2513 pub(crate) fn new(
2514 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2515 ) -> Self {
2516 Self(RequestBuilder::new(stub))
2517 }
2518
2519 pub fn with_request<V: Into<crate::model::FetchSelfRequest>>(mut self, v: V) -> Self {
2521 self.0.request = v.into();
2522 self
2523 }
2524
2525 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2527 self.0.options = v.into();
2528 self
2529 }
2530
2531 pub async fn send(self) -> Result<crate::model::User> {
2533 (*self.0.stub)
2534 .fetch_self(self.0.request, self.0.options)
2535 .await
2536 .map(crate::Response::into_body)
2537 }
2538
2539 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2543 self.0.request.name = v.into();
2544 self
2545 }
2546 }
2547
2548 #[doc(hidden)]
2549 impl crate::RequestBuilder for FetchSelf {
2550 fn request_options(&mut self) -> &mut crate::RequestOptions {
2551 &mut self.0.options
2552 }
2553 }
2554
2555 #[derive(Clone, Debug)]
2573 pub struct DeleteSelf(RequestBuilder<crate::model::DeleteSelfRequest>);
2574
2575 impl DeleteSelf {
2576 pub(crate) fn new(
2577 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2578 ) -> Self {
2579 Self(RequestBuilder::new(stub))
2580 }
2581
2582 pub fn with_request<V: Into<crate::model::DeleteSelfRequest>>(mut self, v: V) -> Self {
2584 self.0.request = v.into();
2585 self
2586 }
2587
2588 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2590 self.0.options = v.into();
2591 self
2592 }
2593
2594 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2601 (*self.0.stub)
2602 .delete_self(self.0.request, self.0.options)
2603 .await
2604 .map(crate::Response::into_body)
2605 }
2606
2607 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2609 type Operation =
2610 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2611 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2612 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2613
2614 let stub = self.0.stub.clone();
2615 let mut options = self.0.options.clone();
2616 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2617 let query = move |name| {
2618 let stub = stub.clone();
2619 let options = options.clone();
2620 async {
2621 let op = GetOperation::new(stub)
2622 .set_name(name)
2623 .with_options(options)
2624 .send()
2625 .await?;
2626 Ok(Operation::new(op))
2627 }
2628 };
2629
2630 let start = move || async {
2631 let op = self.send().await?;
2632 Ok(Operation::new(op))
2633 };
2634
2635 google_cloud_lro::internal::new_unit_response_poller(
2636 polling_error_policy,
2637 polling_backoff_policy,
2638 start,
2639 query,
2640 )
2641 }
2642
2643 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2647 self.0.request.name = v.into();
2648 self
2649 }
2650 }
2651
2652 #[doc(hidden)]
2653 impl crate::RequestBuilder for DeleteSelf {
2654 fn request_options(&mut self) -> &mut crate::RequestOptions {
2655 &mut self.0.options
2656 }
2657 }
2658
2659 #[derive(Clone, Debug)]
2680 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2681
2682 impl ListLocations {
2683 pub(crate) fn new(
2684 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2685 ) -> Self {
2686 Self(RequestBuilder::new(stub))
2687 }
2688
2689 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2691 mut self,
2692 v: V,
2693 ) -> Self {
2694 self.0.request = v.into();
2695 self
2696 }
2697
2698 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2700 self.0.options = v.into();
2701 self
2702 }
2703
2704 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2706 (*self.0.stub)
2707 .list_locations(self.0.request, self.0.options)
2708 .await
2709 .map(crate::Response::into_body)
2710 }
2711
2712 pub fn by_page(
2714 self,
2715 ) -> impl google_cloud_gax::paginator::Paginator<
2716 google_cloud_location::model::ListLocationsResponse,
2717 crate::Error,
2718 > {
2719 use std::clone::Clone;
2720 let token = self.0.request.page_token.clone();
2721 let execute = move |token: String| {
2722 let mut builder = self.clone();
2723 builder.0.request = builder.0.request.set_page_token(token);
2724 builder.send()
2725 };
2726 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2727 }
2728
2729 pub fn by_item(
2731 self,
2732 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2733 google_cloud_location::model::ListLocationsResponse,
2734 crate::Error,
2735 > {
2736 use google_cloud_gax::paginator::Paginator;
2737 self.by_page().items()
2738 }
2739
2740 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2742 self.0.request.name = v.into();
2743 self
2744 }
2745
2746 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2748 self.0.request.filter = v.into();
2749 self
2750 }
2751
2752 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2754 self.0.request.page_size = v.into();
2755 self
2756 }
2757
2758 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2760 self.0.request.page_token = v.into();
2761 self
2762 }
2763 }
2764
2765 #[doc(hidden)]
2766 impl crate::RequestBuilder for ListLocations {
2767 fn request_options(&mut self) -> &mut crate::RequestOptions {
2768 &mut self.0.options
2769 }
2770 }
2771
2772 #[derive(Clone, Debug)]
2789 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2790
2791 impl GetLocation {
2792 pub(crate) fn new(
2793 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2794 ) -> Self {
2795 Self(RequestBuilder::new(stub))
2796 }
2797
2798 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2800 mut self,
2801 v: V,
2802 ) -> Self {
2803 self.0.request = v.into();
2804 self
2805 }
2806
2807 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2809 self.0.options = v.into();
2810 self
2811 }
2812
2813 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2815 (*self.0.stub)
2816 .get_location(self.0.request, self.0.options)
2817 .await
2818 .map(crate::Response::into_body)
2819 }
2820
2821 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2823 self.0.request.name = v.into();
2824 self
2825 }
2826 }
2827
2828 #[doc(hidden)]
2829 impl crate::RequestBuilder for GetLocation {
2830 fn request_options(&mut self) -> &mut crate::RequestOptions {
2831 &mut self.0.options
2832 }
2833 }
2834
2835 #[derive(Clone, Debug)]
2856 pub struct ListOperations(
2857 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2858 );
2859
2860 impl ListOperations {
2861 pub(crate) fn new(
2862 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2863 ) -> Self {
2864 Self(RequestBuilder::new(stub))
2865 }
2866
2867 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2869 mut self,
2870 v: V,
2871 ) -> Self {
2872 self.0.request = v.into();
2873 self
2874 }
2875
2876 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2878 self.0.options = v.into();
2879 self
2880 }
2881
2882 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2884 (*self.0.stub)
2885 .list_operations(self.0.request, self.0.options)
2886 .await
2887 .map(crate::Response::into_body)
2888 }
2889
2890 pub fn by_page(
2892 self,
2893 ) -> impl google_cloud_gax::paginator::Paginator<
2894 google_cloud_longrunning::model::ListOperationsResponse,
2895 crate::Error,
2896 > {
2897 use std::clone::Clone;
2898 let token = self.0.request.page_token.clone();
2899 let execute = move |token: String| {
2900 let mut builder = self.clone();
2901 builder.0.request = builder.0.request.set_page_token(token);
2902 builder.send()
2903 };
2904 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2905 }
2906
2907 pub fn by_item(
2909 self,
2910 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2911 google_cloud_longrunning::model::ListOperationsResponse,
2912 crate::Error,
2913 > {
2914 use google_cloud_gax::paginator::Paginator;
2915 self.by_page().items()
2916 }
2917
2918 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920 self.0.request.name = v.into();
2921 self
2922 }
2923
2924 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2926 self.0.request.filter = v.into();
2927 self
2928 }
2929
2930 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2932 self.0.request.page_size = v.into();
2933 self
2934 }
2935
2936 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2938 self.0.request.page_token = v.into();
2939 self
2940 }
2941
2942 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2944 self.0.request.return_partial_success = v.into();
2945 self
2946 }
2947 }
2948
2949 #[doc(hidden)]
2950 impl crate::RequestBuilder for ListOperations {
2951 fn request_options(&mut self) -> &mut crate::RequestOptions {
2952 &mut self.0.options
2953 }
2954 }
2955
2956 #[derive(Clone, Debug)]
2973 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2974
2975 impl GetOperation {
2976 pub(crate) fn new(
2977 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2978 ) -> Self {
2979 Self(RequestBuilder::new(stub))
2980 }
2981
2982 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2984 mut self,
2985 v: V,
2986 ) -> Self {
2987 self.0.request = v.into();
2988 self
2989 }
2990
2991 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2993 self.0.options = v.into();
2994 self
2995 }
2996
2997 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2999 (*self.0.stub)
3000 .get_operation(self.0.request, self.0.options)
3001 .await
3002 .map(crate::Response::into_body)
3003 }
3004
3005 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3007 self.0.request.name = v.into();
3008 self
3009 }
3010 }
3011
3012 #[doc(hidden)]
3013 impl crate::RequestBuilder for GetOperation {
3014 fn request_options(&mut self) -> &mut crate::RequestOptions {
3015 &mut self.0.options
3016 }
3017 }
3018
3019 #[derive(Clone, Debug)]
3036 pub struct DeleteOperation(
3037 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3038 );
3039
3040 impl DeleteOperation {
3041 pub(crate) fn new(
3042 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3043 ) -> Self {
3044 Self(RequestBuilder::new(stub))
3045 }
3046
3047 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3049 mut self,
3050 v: V,
3051 ) -> Self {
3052 self.0.request = v.into();
3053 self
3054 }
3055
3056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3058 self.0.options = v.into();
3059 self
3060 }
3061
3062 pub async fn send(self) -> Result<()> {
3064 (*self.0.stub)
3065 .delete_operation(self.0.request, self.0.options)
3066 .await
3067 .map(crate::Response::into_body)
3068 }
3069
3070 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3072 self.0.request.name = v.into();
3073 self
3074 }
3075 }
3076
3077 #[doc(hidden)]
3078 impl crate::RequestBuilder for DeleteOperation {
3079 fn request_options(&mut self) -> &mut crate::RequestOptions {
3080 &mut self.0.options
3081 }
3082 }
3083
3084 #[derive(Clone, Debug)]
3101 pub struct CancelOperation(
3102 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3103 );
3104
3105 impl CancelOperation {
3106 pub(crate) fn new(
3107 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3108 ) -> Self {
3109 Self(RequestBuilder::new(stub))
3110 }
3111
3112 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3114 mut self,
3115 v: V,
3116 ) -> Self {
3117 self.0.request = v.into();
3118 self
3119 }
3120
3121 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3123 self.0.options = v.into();
3124 self
3125 }
3126
3127 pub async fn send(self) -> Result<()> {
3129 (*self.0.stub)
3130 .cancel_operation(self.0.request, self.0.options)
3131 .await
3132 .map(crate::Response::into_body)
3133 }
3134
3135 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 crate::RequestBuilder for CancelOperation {
3144 fn request_options(&mut self) -> &mut crate::RequestOptions {
3145 &mut self.0.options
3146 }
3147 }
3148}
3149
3150pub mod insights_config_service {
3151 use crate::Result;
3152
3153 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3167
3168 pub(crate) mod client {
3169 use super::super::super::client::InsightsConfigService;
3170 pub struct Factory;
3171 impl crate::ClientFactory for Factory {
3172 type Client = InsightsConfigService;
3173 type Credentials = gaxi::options::Credentials;
3174 async fn build(
3175 self,
3176 config: gaxi::options::ClientConfig,
3177 ) -> crate::ClientBuilderResult<Self::Client> {
3178 Self::Client::new(config).await
3179 }
3180 }
3181 }
3182
3183 #[derive(Clone, Debug)]
3185 pub(crate) struct RequestBuilder<R: std::default::Default> {
3186 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3187 request: R,
3188 options: crate::RequestOptions,
3189 }
3190
3191 impl<R> RequestBuilder<R>
3192 where
3193 R: std::default::Default,
3194 {
3195 pub(crate) fn new(
3196 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3197 ) -> Self {
3198 Self {
3199 stub,
3200 request: R::default(),
3201 options: crate::RequestOptions::default(),
3202 }
3203 }
3204 }
3205
3206 #[derive(Clone, Debug)]
3227 pub struct ListInsightsConfigs(RequestBuilder<crate::model::ListInsightsConfigsRequest>);
3228
3229 impl ListInsightsConfigs {
3230 pub(crate) fn new(
3231 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3232 ) -> Self {
3233 Self(RequestBuilder::new(stub))
3234 }
3235
3236 pub fn with_request<V: Into<crate::model::ListInsightsConfigsRequest>>(
3238 mut self,
3239 v: V,
3240 ) -> Self {
3241 self.0.request = v.into();
3242 self
3243 }
3244
3245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3247 self.0.options = v.into();
3248 self
3249 }
3250
3251 pub async fn send(self) -> Result<crate::model::ListInsightsConfigsResponse> {
3253 (*self.0.stub)
3254 .list_insights_configs(self.0.request, self.0.options)
3255 .await
3256 .map(crate::Response::into_body)
3257 }
3258
3259 pub fn by_page(
3261 self,
3262 ) -> impl google_cloud_gax::paginator::Paginator<
3263 crate::model::ListInsightsConfigsResponse,
3264 crate::Error,
3265 > {
3266 use std::clone::Clone;
3267 let token = self.0.request.page_token.clone();
3268 let execute = move |token: String| {
3269 let mut builder = self.clone();
3270 builder.0.request = builder.0.request.set_page_token(token);
3271 builder.send()
3272 };
3273 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3274 }
3275
3276 pub fn by_item(
3278 self,
3279 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3280 crate::model::ListInsightsConfigsResponse,
3281 crate::Error,
3282 > {
3283 use google_cloud_gax::paginator::Paginator;
3284 self.by_page().items()
3285 }
3286
3287 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3291 self.0.request.parent = v.into();
3292 self
3293 }
3294
3295 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3297 self.0.request.page_size = v.into();
3298 self
3299 }
3300
3301 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3303 self.0.request.page_token = v.into();
3304 self
3305 }
3306
3307 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3309 self.0.request.filter = v.into();
3310 self
3311 }
3312
3313 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3315 self.0.request.order_by = v.into();
3316 self
3317 }
3318 }
3319
3320 #[doc(hidden)]
3321 impl crate::RequestBuilder for ListInsightsConfigs {
3322 fn request_options(&mut self) -> &mut crate::RequestOptions {
3323 &mut self.0.options
3324 }
3325 }
3326
3327 #[derive(Clone, Debug)]
3345 pub struct CreateInsightsConfig(RequestBuilder<crate::model::CreateInsightsConfigRequest>);
3346
3347 impl CreateInsightsConfig {
3348 pub(crate) fn new(
3349 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3350 ) -> Self {
3351 Self(RequestBuilder::new(stub))
3352 }
3353
3354 pub fn with_request<V: Into<crate::model::CreateInsightsConfigRequest>>(
3356 mut self,
3357 v: V,
3358 ) -> Self {
3359 self.0.request = v.into();
3360 self
3361 }
3362
3363 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3365 self.0.options = v.into();
3366 self
3367 }
3368
3369 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3376 (*self.0.stub)
3377 .create_insights_config(self.0.request, self.0.options)
3378 .await
3379 .map(crate::Response::into_body)
3380 }
3381
3382 pub fn poller(
3384 self,
3385 ) -> impl google_cloud_lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3386 {
3387 type Operation = google_cloud_lro::internal::Operation<
3388 crate::model::InsightsConfig,
3389 crate::model::OperationMetadata,
3390 >;
3391 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3392 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3393
3394 let stub = self.0.stub.clone();
3395 let mut options = self.0.options.clone();
3396 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3397 let query = move |name| {
3398 let stub = stub.clone();
3399 let options = options.clone();
3400 async {
3401 let op = GetOperation::new(stub)
3402 .set_name(name)
3403 .with_options(options)
3404 .send()
3405 .await?;
3406 Ok(Operation::new(op))
3407 }
3408 };
3409
3410 let start = move || async {
3411 let op = self.send().await?;
3412 Ok(Operation::new(op))
3413 };
3414
3415 google_cloud_lro::internal::new_poller(
3416 polling_error_policy,
3417 polling_backoff_policy,
3418 start,
3419 query,
3420 )
3421 }
3422
3423 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3427 self.0.request.parent = v.into();
3428 self
3429 }
3430
3431 pub fn set_insights_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3435 self.0.request.insights_config_id = v.into();
3436 self
3437 }
3438
3439 pub fn set_insights_config<T>(mut self, v: T) -> Self
3443 where
3444 T: std::convert::Into<crate::model::InsightsConfig>,
3445 {
3446 self.0.request.insights_config = std::option::Option::Some(v.into());
3447 self
3448 }
3449
3450 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3454 where
3455 T: std::convert::Into<crate::model::InsightsConfig>,
3456 {
3457 self.0.request.insights_config = v.map(|x| x.into());
3458 self
3459 }
3460
3461 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3463 self.0.request.validate_only = v.into();
3464 self
3465 }
3466 }
3467
3468 #[doc(hidden)]
3469 impl crate::RequestBuilder for CreateInsightsConfig {
3470 fn request_options(&mut self) -> &mut crate::RequestOptions {
3471 &mut self.0.options
3472 }
3473 }
3474
3475 #[derive(Clone, Debug)]
3492 pub struct GetInsightsConfig(RequestBuilder<crate::model::GetInsightsConfigRequest>);
3493
3494 impl GetInsightsConfig {
3495 pub(crate) fn new(
3496 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3497 ) -> Self {
3498 Self(RequestBuilder::new(stub))
3499 }
3500
3501 pub fn with_request<V: Into<crate::model::GetInsightsConfigRequest>>(
3503 mut self,
3504 v: V,
3505 ) -> Self {
3506 self.0.request = v.into();
3507 self
3508 }
3509
3510 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3512 self.0.options = v.into();
3513 self
3514 }
3515
3516 pub async fn send(self) -> Result<crate::model::InsightsConfig> {
3518 (*self.0.stub)
3519 .get_insights_config(self.0.request, self.0.options)
3520 .await
3521 .map(crate::Response::into_body)
3522 }
3523
3524 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3528 self.0.request.name = v.into();
3529 self
3530 }
3531 }
3532
3533 #[doc(hidden)]
3534 impl crate::RequestBuilder for GetInsightsConfig {
3535 fn request_options(&mut self) -> &mut crate::RequestOptions {
3536 &mut self.0.options
3537 }
3538 }
3539
3540 #[derive(Clone, Debug)]
3558 pub struct UpdateInsightsConfig(RequestBuilder<crate::model::UpdateInsightsConfigRequest>);
3559
3560 impl UpdateInsightsConfig {
3561 pub(crate) fn new(
3562 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3563 ) -> Self {
3564 Self(RequestBuilder::new(stub))
3565 }
3566
3567 pub fn with_request<V: Into<crate::model::UpdateInsightsConfigRequest>>(
3569 mut self,
3570 v: V,
3571 ) -> Self {
3572 self.0.request = v.into();
3573 self
3574 }
3575
3576 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3578 self.0.options = v.into();
3579 self
3580 }
3581
3582 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3589 (*self.0.stub)
3590 .update_insights_config(self.0.request, self.0.options)
3591 .await
3592 .map(crate::Response::into_body)
3593 }
3594
3595 pub fn poller(
3597 self,
3598 ) -> impl google_cloud_lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3599 {
3600 type Operation = google_cloud_lro::internal::Operation<
3601 crate::model::InsightsConfig,
3602 crate::model::OperationMetadata,
3603 >;
3604 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3605 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3606
3607 let stub = self.0.stub.clone();
3608 let mut options = self.0.options.clone();
3609 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3610 let query = move |name| {
3611 let stub = stub.clone();
3612 let options = options.clone();
3613 async {
3614 let op = GetOperation::new(stub)
3615 .set_name(name)
3616 .with_options(options)
3617 .send()
3618 .await?;
3619 Ok(Operation::new(op))
3620 }
3621 };
3622
3623 let start = move || async {
3624 let op = self.send().await?;
3625 Ok(Operation::new(op))
3626 };
3627
3628 google_cloud_lro::internal::new_poller(
3629 polling_error_policy,
3630 polling_backoff_policy,
3631 start,
3632 query,
3633 )
3634 }
3635
3636 pub fn set_insights_config<T>(mut self, v: T) -> Self
3640 where
3641 T: std::convert::Into<crate::model::InsightsConfig>,
3642 {
3643 self.0.request.insights_config = std::option::Option::Some(v.into());
3644 self
3645 }
3646
3647 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3651 where
3652 T: std::convert::Into<crate::model::InsightsConfig>,
3653 {
3654 self.0.request.insights_config = v.map(|x| x.into());
3655 self
3656 }
3657
3658 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3660 self.0.request.request_id = v.into();
3661 self
3662 }
3663
3664 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
3666 self.0.request.allow_missing = v.into();
3667 self
3668 }
3669
3670 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3672 self.0.request.validate_only = v.into();
3673 self
3674 }
3675 }
3676
3677 #[doc(hidden)]
3678 impl crate::RequestBuilder for UpdateInsightsConfig {
3679 fn request_options(&mut self) -> &mut crate::RequestOptions {
3680 &mut self.0.options
3681 }
3682 }
3683
3684 #[derive(Clone, Debug)]
3702 pub struct DeleteInsightsConfig(RequestBuilder<crate::model::DeleteInsightsConfigRequest>);
3703
3704 impl DeleteInsightsConfig {
3705 pub(crate) fn new(
3706 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3707 ) -> Self {
3708 Self(RequestBuilder::new(stub))
3709 }
3710
3711 pub fn with_request<V: Into<crate::model::DeleteInsightsConfigRequest>>(
3713 mut self,
3714 v: V,
3715 ) -> Self {
3716 self.0.request = v.into();
3717 self
3718 }
3719
3720 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3722 self.0.options = v.into();
3723 self
3724 }
3725
3726 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3733 (*self.0.stub)
3734 .delete_insights_config(self.0.request, self.0.options)
3735 .await
3736 .map(crate::Response::into_body)
3737 }
3738
3739 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3741 type Operation =
3742 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3743 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3744 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3745
3746 let stub = self.0.stub.clone();
3747 let mut options = self.0.options.clone();
3748 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3749 let query = move |name| {
3750 let stub = stub.clone();
3751 let options = options.clone();
3752 async {
3753 let op = GetOperation::new(stub)
3754 .set_name(name)
3755 .with_options(options)
3756 .send()
3757 .await?;
3758 Ok(Operation::new(op))
3759 }
3760 };
3761
3762 let start = move || async {
3763 let op = self.send().await?;
3764 Ok(Operation::new(op))
3765 };
3766
3767 google_cloud_lro::internal::new_unit_response_poller(
3768 polling_error_policy,
3769 polling_backoff_policy,
3770 start,
3771 query,
3772 )
3773 }
3774
3775 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3779 self.0.request.name = v.into();
3780 self
3781 }
3782
3783 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3785 self.0.request.request_id = v.into();
3786 self
3787 }
3788
3789 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3791 self.0.request.validate_only = v.into();
3792 self
3793 }
3794
3795 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3797 self.0.request.etag = v.into();
3798 self
3799 }
3800 }
3801
3802 #[doc(hidden)]
3803 impl crate::RequestBuilder for DeleteInsightsConfig {
3804 fn request_options(&mut self) -> &mut crate::RequestOptions {
3805 &mut self.0.options
3806 }
3807 }
3808
3809 #[derive(Clone, Debug)]
3830 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3831
3832 impl ListLocations {
3833 pub(crate) fn new(
3834 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3835 ) -> Self {
3836 Self(RequestBuilder::new(stub))
3837 }
3838
3839 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3841 mut self,
3842 v: V,
3843 ) -> Self {
3844 self.0.request = v.into();
3845 self
3846 }
3847
3848 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3850 self.0.options = v.into();
3851 self
3852 }
3853
3854 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3856 (*self.0.stub)
3857 .list_locations(self.0.request, self.0.options)
3858 .await
3859 .map(crate::Response::into_body)
3860 }
3861
3862 pub fn by_page(
3864 self,
3865 ) -> impl google_cloud_gax::paginator::Paginator<
3866 google_cloud_location::model::ListLocationsResponse,
3867 crate::Error,
3868 > {
3869 use std::clone::Clone;
3870 let token = self.0.request.page_token.clone();
3871 let execute = move |token: String| {
3872 let mut builder = self.clone();
3873 builder.0.request = builder.0.request.set_page_token(token);
3874 builder.send()
3875 };
3876 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3877 }
3878
3879 pub fn by_item(
3881 self,
3882 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3883 google_cloud_location::model::ListLocationsResponse,
3884 crate::Error,
3885 > {
3886 use google_cloud_gax::paginator::Paginator;
3887 self.by_page().items()
3888 }
3889
3890 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892 self.0.request.name = v.into();
3893 self
3894 }
3895
3896 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3898 self.0.request.filter = v.into();
3899 self
3900 }
3901
3902 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3904 self.0.request.page_size = v.into();
3905 self
3906 }
3907
3908 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3910 self.0.request.page_token = v.into();
3911 self
3912 }
3913 }
3914
3915 #[doc(hidden)]
3916 impl crate::RequestBuilder for ListLocations {
3917 fn request_options(&mut self) -> &mut crate::RequestOptions {
3918 &mut self.0.options
3919 }
3920 }
3921
3922 #[derive(Clone, Debug)]
3939 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3940
3941 impl GetLocation {
3942 pub(crate) fn new(
3943 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3944 ) -> Self {
3945 Self(RequestBuilder::new(stub))
3946 }
3947
3948 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3950 mut self,
3951 v: V,
3952 ) -> Self {
3953 self.0.request = v.into();
3954 self
3955 }
3956
3957 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3959 self.0.options = v.into();
3960 self
3961 }
3962
3963 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3965 (*self.0.stub)
3966 .get_location(self.0.request, self.0.options)
3967 .await
3968 .map(crate::Response::into_body)
3969 }
3970
3971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3973 self.0.request.name = v.into();
3974 self
3975 }
3976 }
3977
3978 #[doc(hidden)]
3979 impl crate::RequestBuilder for GetLocation {
3980 fn request_options(&mut self) -> &mut crate::RequestOptions {
3981 &mut self.0.options
3982 }
3983 }
3984
3985 #[derive(Clone, Debug)]
4006 pub struct ListOperations(
4007 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4008 );
4009
4010 impl ListOperations {
4011 pub(crate) fn new(
4012 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4013 ) -> Self {
4014 Self(RequestBuilder::new(stub))
4015 }
4016
4017 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4019 mut self,
4020 v: V,
4021 ) -> Self {
4022 self.0.request = v.into();
4023 self
4024 }
4025
4026 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4028 self.0.options = v.into();
4029 self
4030 }
4031
4032 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4034 (*self.0.stub)
4035 .list_operations(self.0.request, self.0.options)
4036 .await
4037 .map(crate::Response::into_body)
4038 }
4039
4040 pub fn by_page(
4042 self,
4043 ) -> impl google_cloud_gax::paginator::Paginator<
4044 google_cloud_longrunning::model::ListOperationsResponse,
4045 crate::Error,
4046 > {
4047 use std::clone::Clone;
4048 let token = self.0.request.page_token.clone();
4049 let execute = move |token: String| {
4050 let mut builder = self.clone();
4051 builder.0.request = builder.0.request.set_page_token(token);
4052 builder.send()
4053 };
4054 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4055 }
4056
4057 pub fn by_item(
4059 self,
4060 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4061 google_cloud_longrunning::model::ListOperationsResponse,
4062 crate::Error,
4063 > {
4064 use google_cloud_gax::paginator::Paginator;
4065 self.by_page().items()
4066 }
4067
4068 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4070 self.0.request.name = v.into();
4071 self
4072 }
4073
4074 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4076 self.0.request.filter = v.into();
4077 self
4078 }
4079
4080 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4082 self.0.request.page_size = v.into();
4083 self
4084 }
4085
4086 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4088 self.0.request.page_token = v.into();
4089 self
4090 }
4091
4092 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4094 self.0.request.return_partial_success = v.into();
4095 self
4096 }
4097 }
4098
4099 #[doc(hidden)]
4100 impl crate::RequestBuilder for ListOperations {
4101 fn request_options(&mut self) -> &mut crate::RequestOptions {
4102 &mut self.0.options
4103 }
4104 }
4105
4106 #[derive(Clone, Debug)]
4123 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4124
4125 impl GetOperation {
4126 pub(crate) fn new(
4127 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4128 ) -> Self {
4129 Self(RequestBuilder::new(stub))
4130 }
4131
4132 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4134 mut self,
4135 v: V,
4136 ) -> Self {
4137 self.0.request = v.into();
4138 self
4139 }
4140
4141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4143 self.0.options = v.into();
4144 self
4145 }
4146
4147 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4149 (*self.0.stub)
4150 .get_operation(self.0.request, self.0.options)
4151 .await
4152 .map(crate::Response::into_body)
4153 }
4154
4155 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4157 self.0.request.name = v.into();
4158 self
4159 }
4160 }
4161
4162 #[doc(hidden)]
4163 impl crate::RequestBuilder for GetOperation {
4164 fn request_options(&mut self) -> &mut crate::RequestOptions {
4165 &mut self.0.options
4166 }
4167 }
4168
4169 #[derive(Clone, Debug)]
4186 pub struct DeleteOperation(
4187 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4188 );
4189
4190 impl DeleteOperation {
4191 pub(crate) fn new(
4192 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4193 ) -> Self {
4194 Self(RequestBuilder::new(stub))
4195 }
4196
4197 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4199 mut self,
4200 v: V,
4201 ) -> Self {
4202 self.0.request = v.into();
4203 self
4204 }
4205
4206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4208 self.0.options = v.into();
4209 self
4210 }
4211
4212 pub async fn send(self) -> Result<()> {
4214 (*self.0.stub)
4215 .delete_operation(self.0.request, self.0.options)
4216 .await
4217 .map(crate::Response::into_body)
4218 }
4219
4220 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4222 self.0.request.name = v.into();
4223 self
4224 }
4225 }
4226
4227 #[doc(hidden)]
4228 impl crate::RequestBuilder for DeleteOperation {
4229 fn request_options(&mut self) -> &mut crate::RequestOptions {
4230 &mut self.0.options
4231 }
4232 }
4233
4234 #[derive(Clone, Debug)]
4251 pub struct CancelOperation(
4252 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4253 );
4254
4255 impl CancelOperation {
4256 pub(crate) fn new(
4257 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4258 ) -> Self {
4259 Self(RequestBuilder::new(stub))
4260 }
4261
4262 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4264 mut self,
4265 v: V,
4266 ) -> Self {
4267 self.0.request = v.into();
4268 self
4269 }
4270
4271 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4273 self.0.options = v.into();
4274 self
4275 }
4276
4277 pub async fn send(self) -> Result<()> {
4279 (*self.0.stub)
4280 .cancel_operation(self.0.request, self.0.options)
4281 .await
4282 .map(crate::Response::into_body)
4283 }
4284
4285 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4287 self.0.request.name = v.into();
4288 self
4289 }
4290 }
4291
4292 #[doc(hidden)]
4293 impl crate::RequestBuilder for CancelOperation {
4294 fn request_options(&mut self) -> &mut crate::RequestOptions {
4295 &mut self.0.options
4296 }
4297 }
4298}