1pub mod developer_connect {
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::DeveloperConnect;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = DeveloperConnect;
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::DeveloperConnect>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
96
97 impl ListConnections {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
118 (*self.0.stub)
119 .list_connections(self.0.request, self.0.options)
120 .await
121 .map(gax::response::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl gax::paginator::ItemPaginator<crate::model::ListConnectionsResponse, gax::error::Error>
143 {
144 use gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167
168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173
174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.order_by = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl gax::options::internal::RequestBuilder for ListConnections {
183 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
206
207 impl GetConnection {
208 pub(crate) fn new(
209 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
210 ) -> Self {
211 Self(RequestBuilder::new(stub))
212 }
213
214 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
216 self.0.request = v.into();
217 self
218 }
219
220 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
222 self.0.options = v.into();
223 self
224 }
225
226 pub async fn send(self) -> Result<crate::model::Connection> {
228 (*self.0.stub)
229 .get_connection(self.0.request, self.0.options)
230 .await
231 .map(gax::response::Response::into_body)
232 }
233
234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.name = v.into();
239 self
240 }
241 }
242
243 #[doc(hidden)]
244 impl gax::options::internal::RequestBuilder for GetConnection {
245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 #[derive(Clone, Debug)]
268 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
269
270 impl CreateConnection {
271 pub(crate) fn new(
272 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
273 ) -> Self {
274 Self(RequestBuilder::new(stub))
275 }
276
277 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
279 mut self,
280 v: V,
281 ) -> Self {
282 self.0.request = v.into();
283 self
284 }
285
286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
288 self.0.options = v.into();
289 self
290 }
291
292 pub async fn send(self) -> Result<longrunning::model::Operation> {
299 (*self.0.stub)
300 .create_connection(self.0.request, self.0.options)
301 .await
302 .map(gax::response::Response::into_body)
303 }
304
305 pub fn poller(
307 self,
308 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
309 type Operation =
310 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
311 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
312 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
313
314 let stub = self.0.stub.clone();
315 let mut options = self.0.options.clone();
316 options.set_retry_policy(gax::retry_policy::NeverRetry);
317 let query = move |name| {
318 let stub = stub.clone();
319 let options = options.clone();
320 async {
321 let op = GetOperation::new(stub)
322 .set_name(name)
323 .with_options(options)
324 .send()
325 .await?;
326 Ok(Operation::new(op))
327 }
328 };
329
330 let start = move || async {
331 let op = self.send().await?;
332 Ok(Operation::new(op))
333 };
334
335 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
336 }
337
338 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
342 self.0.request.parent = v.into();
343 self
344 }
345
346 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
350 self.0.request.connection_id = v.into();
351 self
352 }
353
354 pub fn set_connection<T>(mut self, v: T) -> Self
358 where
359 T: std::convert::Into<crate::model::Connection>,
360 {
361 self.0.request.connection = std::option::Option::Some(v.into());
362 self
363 }
364
365 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
369 where
370 T: std::convert::Into<crate::model::Connection>,
371 {
372 self.0.request.connection = v.map(|x| x.into());
373 self
374 }
375
376 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
378 self.0.request.request_id = v.into();
379 self
380 }
381
382 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
384 self.0.request.validate_only = v.into();
385 self
386 }
387 }
388
389 #[doc(hidden)]
390 impl gax::options::internal::RequestBuilder for CreateConnection {
391 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
392 &mut self.0.options
393 }
394 }
395
396 #[derive(Clone, Debug)]
414 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
415
416 impl UpdateConnection {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
425 mut self,
426 v: V,
427 ) -> Self {
428 self.0.request = v.into();
429 self
430 }
431
432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
434 self.0.options = v.into();
435 self
436 }
437
438 pub async fn send(self) -> Result<longrunning::model::Operation> {
445 (*self.0.stub)
446 .update_connection(self.0.request, self.0.options)
447 .await
448 .map(gax::response::Response::into_body)
449 }
450
451 pub fn poller(
453 self,
454 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
455 type Operation =
456 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
457 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
458 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
459
460 let stub = self.0.stub.clone();
461 let mut options = self.0.options.clone();
462 options.set_retry_policy(gax::retry_policy::NeverRetry);
463 let query = move |name| {
464 let stub = stub.clone();
465 let options = options.clone();
466 async {
467 let op = GetOperation::new(stub)
468 .set_name(name)
469 .with_options(options)
470 .send()
471 .await?;
472 Ok(Operation::new(op))
473 }
474 };
475
476 let start = move || async {
477 let op = self.send().await?;
478 Ok(Operation::new(op))
479 };
480
481 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
482 }
483
484 pub fn set_update_mask<T>(mut self, v: T) -> Self
488 where
489 T: std::convert::Into<wkt::FieldMask>,
490 {
491 self.0.request.update_mask = std::option::Option::Some(v.into());
492 self
493 }
494
495 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
499 where
500 T: std::convert::Into<wkt::FieldMask>,
501 {
502 self.0.request.update_mask = v.map(|x| x.into());
503 self
504 }
505
506 pub fn set_connection<T>(mut self, v: T) -> Self
510 where
511 T: std::convert::Into<crate::model::Connection>,
512 {
513 self.0.request.connection = std::option::Option::Some(v.into());
514 self
515 }
516
517 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
521 where
522 T: std::convert::Into<crate::model::Connection>,
523 {
524 self.0.request.connection = v.map(|x| x.into());
525 self
526 }
527
528 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
530 self.0.request.request_id = v.into();
531 self
532 }
533
534 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
536 self.0.request.allow_missing = v.into();
537 self
538 }
539
540 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
542 self.0.request.validate_only = v.into();
543 self
544 }
545 }
546
547 #[doc(hidden)]
548 impl gax::options::internal::RequestBuilder for UpdateConnection {
549 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
550 &mut self.0.options
551 }
552 }
553
554 #[derive(Clone, Debug)]
572 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
573
574 impl DeleteConnection {
575 pub(crate) fn new(
576 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
577 ) -> Self {
578 Self(RequestBuilder::new(stub))
579 }
580
581 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
583 mut self,
584 v: V,
585 ) -> Self {
586 self.0.request = v.into();
587 self
588 }
589
590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
592 self.0.options = v.into();
593 self
594 }
595
596 pub async fn send(self) -> Result<longrunning::model::Operation> {
603 (*self.0.stub)
604 .delete_connection(self.0.request, self.0.options)
605 .await
606 .map(gax::response::Response::into_body)
607 }
608
609 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
611 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
612 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
613 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
614
615 let stub = self.0.stub.clone();
616 let mut options = self.0.options.clone();
617 options.set_retry_policy(gax::retry_policy::NeverRetry);
618 let query = move |name| {
619 let stub = stub.clone();
620 let options = options.clone();
621 async {
622 let op = GetOperation::new(stub)
623 .set_name(name)
624 .with_options(options)
625 .send()
626 .await?;
627 Ok(Operation::new(op))
628 }
629 };
630
631 let start = move || async {
632 let op = self.send().await?;
633 Ok(Operation::new(op))
634 };
635
636 lro::internal::new_unit_response_poller(
637 polling_error_policy,
638 polling_backoff_policy,
639 start,
640 query,
641 )
642 }
643
644 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
648 self.0.request.name = v.into();
649 self
650 }
651
652 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
654 self.0.request.request_id = v.into();
655 self
656 }
657
658 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
660 self.0.request.validate_only = v.into();
661 self
662 }
663
664 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
666 self.0.request.etag = v.into();
667 self
668 }
669 }
670
671 #[doc(hidden)]
672 impl gax::options::internal::RequestBuilder for DeleteConnection {
673 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
674 &mut self.0.options
675 }
676 }
677
678 #[derive(Clone, Debug)]
696 pub struct CreateGitRepositoryLink(
697 RequestBuilder<crate::model::CreateGitRepositoryLinkRequest>,
698 );
699
700 impl CreateGitRepositoryLink {
701 pub(crate) fn new(
702 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
703 ) -> Self {
704 Self(RequestBuilder::new(stub))
705 }
706
707 pub fn with_request<V: Into<crate::model::CreateGitRepositoryLinkRequest>>(
709 mut self,
710 v: V,
711 ) -> Self {
712 self.0.request = v.into();
713 self
714 }
715
716 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
718 self.0.options = v.into();
719 self
720 }
721
722 pub async fn send(self) -> Result<longrunning::model::Operation> {
729 (*self.0.stub)
730 .create_git_repository_link(self.0.request, self.0.options)
731 .await
732 .map(gax::response::Response::into_body)
733 }
734
735 pub fn poller(
737 self,
738 ) -> impl lro::Poller<crate::model::GitRepositoryLink, crate::model::OperationMetadata>
739 {
740 type Operation = lro::internal::Operation<
741 crate::model::GitRepositoryLink,
742 crate::model::OperationMetadata,
743 >;
744 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
745 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
746
747 let stub = self.0.stub.clone();
748 let mut options = self.0.options.clone();
749 options.set_retry_policy(gax::retry_policy::NeverRetry);
750 let query = move |name| {
751 let stub = stub.clone();
752 let options = options.clone();
753 async {
754 let op = GetOperation::new(stub)
755 .set_name(name)
756 .with_options(options)
757 .send()
758 .await?;
759 Ok(Operation::new(op))
760 }
761 };
762
763 let start = move || async {
764 let op = self.send().await?;
765 Ok(Operation::new(op))
766 };
767
768 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
769 }
770
771 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
775 self.0.request.parent = v.into();
776 self
777 }
778
779 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
783 where
784 T: std::convert::Into<crate::model::GitRepositoryLink>,
785 {
786 self.0.request.git_repository_link = std::option::Option::Some(v.into());
787 self
788 }
789
790 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
794 where
795 T: std::convert::Into<crate::model::GitRepositoryLink>,
796 {
797 self.0.request.git_repository_link = v.map(|x| x.into());
798 self
799 }
800
801 pub fn set_git_repository_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
805 self.0.request.git_repository_link_id = v.into();
806 self
807 }
808
809 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
811 self.0.request.request_id = v.into();
812 self
813 }
814
815 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
817 self.0.request.validate_only = v.into();
818 self
819 }
820 }
821
822 #[doc(hidden)]
823 impl gax::options::internal::RequestBuilder for CreateGitRepositoryLink {
824 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
825 &mut self.0.options
826 }
827 }
828
829 #[derive(Clone, Debug)]
847 pub struct DeleteGitRepositoryLink(
848 RequestBuilder<crate::model::DeleteGitRepositoryLinkRequest>,
849 );
850
851 impl DeleteGitRepositoryLink {
852 pub(crate) fn new(
853 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
854 ) -> Self {
855 Self(RequestBuilder::new(stub))
856 }
857
858 pub fn with_request<V: Into<crate::model::DeleteGitRepositoryLinkRequest>>(
860 mut self,
861 v: V,
862 ) -> Self {
863 self.0.request = v.into();
864 self
865 }
866
867 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
869 self.0.options = v.into();
870 self
871 }
872
873 pub async fn send(self) -> Result<longrunning::model::Operation> {
880 (*self.0.stub)
881 .delete_git_repository_link(self.0.request, self.0.options)
882 .await
883 .map(gax::response::Response::into_body)
884 }
885
886 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
888 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
889 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
890 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
891
892 let stub = self.0.stub.clone();
893 let mut options = self.0.options.clone();
894 options.set_retry_policy(gax::retry_policy::NeverRetry);
895 let query = move |name| {
896 let stub = stub.clone();
897 let options = options.clone();
898 async {
899 let op = GetOperation::new(stub)
900 .set_name(name)
901 .with_options(options)
902 .send()
903 .await?;
904 Ok(Operation::new(op))
905 }
906 };
907
908 let start = move || async {
909 let op = self.send().await?;
910 Ok(Operation::new(op))
911 };
912
913 lro::internal::new_unit_response_poller(
914 polling_error_policy,
915 polling_backoff_policy,
916 start,
917 query,
918 )
919 }
920
921 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
925 self.0.request.name = v.into();
926 self
927 }
928
929 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
931 self.0.request.request_id = v.into();
932 self
933 }
934
935 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
937 self.0.request.validate_only = v.into();
938 self
939 }
940
941 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
943 self.0.request.etag = v.into();
944 self
945 }
946 }
947
948 #[doc(hidden)]
949 impl gax::options::internal::RequestBuilder for DeleteGitRepositoryLink {
950 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
951 &mut self.0.options
952 }
953 }
954
955 #[derive(Clone, Debug)]
976 pub struct ListGitRepositoryLinks(RequestBuilder<crate::model::ListGitRepositoryLinksRequest>);
977
978 impl ListGitRepositoryLinks {
979 pub(crate) fn new(
980 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
981 ) -> Self {
982 Self(RequestBuilder::new(stub))
983 }
984
985 pub fn with_request<V: Into<crate::model::ListGitRepositoryLinksRequest>>(
987 mut self,
988 v: V,
989 ) -> Self {
990 self.0.request = v.into();
991 self
992 }
993
994 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
996 self.0.options = v.into();
997 self
998 }
999
1000 pub async fn send(self) -> Result<crate::model::ListGitRepositoryLinksResponse> {
1002 (*self.0.stub)
1003 .list_git_repository_links(self.0.request, self.0.options)
1004 .await
1005 .map(gax::response::Response::into_body)
1006 }
1007
1008 pub fn by_page(
1010 self,
1011 ) -> impl gax::paginator::Paginator<
1012 crate::model::ListGitRepositoryLinksResponse,
1013 gax::error::Error,
1014 > {
1015 use std::clone::Clone;
1016 let token = self.0.request.page_token.clone();
1017 let execute = move |token: String| {
1018 let mut builder = self.clone();
1019 builder.0.request = builder.0.request.set_page_token(token);
1020 builder.send()
1021 };
1022 gax::paginator::internal::new_paginator(token, execute)
1023 }
1024
1025 pub fn by_item(
1027 self,
1028 ) -> impl gax::paginator::ItemPaginator<
1029 crate::model::ListGitRepositoryLinksResponse,
1030 gax::error::Error,
1031 > {
1032 use gax::paginator::Paginator;
1033 self.by_page().items()
1034 }
1035
1036 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1040 self.0.request.parent = v.into();
1041 self
1042 }
1043
1044 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1046 self.0.request.page_size = v.into();
1047 self
1048 }
1049
1050 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052 self.0.request.page_token = v.into();
1053 self
1054 }
1055
1056 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1058 self.0.request.filter = v.into();
1059 self
1060 }
1061
1062 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1064 self.0.request.order_by = v.into();
1065 self
1066 }
1067 }
1068
1069 #[doc(hidden)]
1070 impl gax::options::internal::RequestBuilder for ListGitRepositoryLinks {
1071 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1072 &mut self.0.options
1073 }
1074 }
1075
1076 #[derive(Clone, Debug)]
1093 pub struct GetGitRepositoryLink(RequestBuilder<crate::model::GetGitRepositoryLinkRequest>);
1094
1095 impl GetGitRepositoryLink {
1096 pub(crate) fn new(
1097 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1098 ) -> Self {
1099 Self(RequestBuilder::new(stub))
1100 }
1101
1102 pub fn with_request<V: Into<crate::model::GetGitRepositoryLinkRequest>>(
1104 mut self,
1105 v: V,
1106 ) -> Self {
1107 self.0.request = v.into();
1108 self
1109 }
1110
1111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1113 self.0.options = v.into();
1114 self
1115 }
1116
1117 pub async fn send(self) -> Result<crate::model::GitRepositoryLink> {
1119 (*self.0.stub)
1120 .get_git_repository_link(self.0.request, self.0.options)
1121 .await
1122 .map(gax::response::Response::into_body)
1123 }
1124
1125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1129 self.0.request.name = v.into();
1130 self
1131 }
1132 }
1133
1134 #[doc(hidden)]
1135 impl gax::options::internal::RequestBuilder for GetGitRepositoryLink {
1136 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1137 &mut self.0.options
1138 }
1139 }
1140
1141 #[derive(Clone, Debug)]
1158 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1159
1160 impl FetchReadWriteToken {
1161 pub(crate) fn new(
1162 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1163 ) -> Self {
1164 Self(RequestBuilder::new(stub))
1165 }
1166
1167 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1169 mut self,
1170 v: V,
1171 ) -> Self {
1172 self.0.request = v.into();
1173 self
1174 }
1175
1176 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1178 self.0.options = v.into();
1179 self
1180 }
1181
1182 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1184 (*self.0.stub)
1185 .fetch_read_write_token(self.0.request, self.0.options)
1186 .await
1187 .map(gax::response::Response::into_body)
1188 }
1189
1190 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.0.request.git_repository_link = v.into();
1195 self
1196 }
1197 }
1198
1199 #[doc(hidden)]
1200 impl gax::options::internal::RequestBuilder for FetchReadWriteToken {
1201 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1202 &mut self.0.options
1203 }
1204 }
1205
1206 #[derive(Clone, Debug)]
1223 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1224
1225 impl FetchReadToken {
1226 pub(crate) fn new(
1227 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1228 ) -> Self {
1229 Self(RequestBuilder::new(stub))
1230 }
1231
1232 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1234 self.0.request = v.into();
1235 self
1236 }
1237
1238 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1240 self.0.options = v.into();
1241 self
1242 }
1243
1244 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1246 (*self.0.stub)
1247 .fetch_read_token(self.0.request, self.0.options)
1248 .await
1249 .map(gax::response::Response::into_body)
1250 }
1251
1252 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1256 self.0.request.git_repository_link = v.into();
1257 self
1258 }
1259 }
1260
1261 #[doc(hidden)]
1262 impl gax::options::internal::RequestBuilder for FetchReadToken {
1263 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1264 &mut self.0.options
1265 }
1266 }
1267
1268 #[derive(Clone, Debug)]
1289 pub struct FetchLinkableGitRepositories(
1290 RequestBuilder<crate::model::FetchLinkableGitRepositoriesRequest>,
1291 );
1292
1293 impl FetchLinkableGitRepositories {
1294 pub(crate) fn new(
1295 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1296 ) -> Self {
1297 Self(RequestBuilder::new(stub))
1298 }
1299
1300 pub fn with_request<V: Into<crate::model::FetchLinkableGitRepositoriesRequest>>(
1302 mut self,
1303 v: V,
1304 ) -> Self {
1305 self.0.request = v.into();
1306 self
1307 }
1308
1309 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1311 self.0.options = v.into();
1312 self
1313 }
1314
1315 pub async fn send(self) -> Result<crate::model::FetchLinkableGitRepositoriesResponse> {
1317 (*self.0.stub)
1318 .fetch_linkable_git_repositories(self.0.request, self.0.options)
1319 .await
1320 .map(gax::response::Response::into_body)
1321 }
1322
1323 pub fn by_page(
1325 self,
1326 ) -> impl gax::paginator::Paginator<
1327 crate::model::FetchLinkableGitRepositoriesResponse,
1328 gax::error::Error,
1329 > {
1330 use std::clone::Clone;
1331 let token = self.0.request.page_token.clone();
1332 let execute = move |token: String| {
1333 let mut builder = self.clone();
1334 builder.0.request = builder.0.request.set_page_token(token);
1335 builder.send()
1336 };
1337 gax::paginator::internal::new_paginator(token, execute)
1338 }
1339
1340 pub fn by_item(
1342 self,
1343 ) -> impl gax::paginator::ItemPaginator<
1344 crate::model::FetchLinkableGitRepositoriesResponse,
1345 gax::error::Error,
1346 > {
1347 use gax::paginator::Paginator;
1348 self.by_page().items()
1349 }
1350
1351 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355 self.0.request.connection = v.into();
1356 self
1357 }
1358
1359 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1361 self.0.request.page_size = v.into();
1362 self
1363 }
1364
1365 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1367 self.0.request.page_token = v.into();
1368 self
1369 }
1370 }
1371
1372 #[doc(hidden)]
1373 impl gax::options::internal::RequestBuilder for FetchLinkableGitRepositories {
1374 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1375 &mut self.0.options
1376 }
1377 }
1378
1379 #[derive(Clone, Debug)]
1396 pub struct FetchGitHubInstallations(
1397 RequestBuilder<crate::model::FetchGitHubInstallationsRequest>,
1398 );
1399
1400 impl FetchGitHubInstallations {
1401 pub(crate) fn new(
1402 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1403 ) -> Self {
1404 Self(RequestBuilder::new(stub))
1405 }
1406
1407 pub fn with_request<V: Into<crate::model::FetchGitHubInstallationsRequest>>(
1409 mut self,
1410 v: V,
1411 ) -> Self {
1412 self.0.request = v.into();
1413 self
1414 }
1415
1416 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1418 self.0.options = v.into();
1419 self
1420 }
1421
1422 pub async fn send(self) -> Result<crate::model::FetchGitHubInstallationsResponse> {
1424 (*self.0.stub)
1425 .fetch_git_hub_installations(self.0.request, self.0.options)
1426 .await
1427 .map(gax::response::Response::into_body)
1428 }
1429
1430 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1434 self.0.request.connection = v.into();
1435 self
1436 }
1437 }
1438
1439 #[doc(hidden)]
1440 impl gax::options::internal::RequestBuilder for FetchGitHubInstallations {
1441 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1442 &mut self.0.options
1443 }
1444 }
1445
1446 #[derive(Clone, Debug)]
1463 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1464
1465 impl FetchGitRefs {
1466 pub(crate) fn new(
1467 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1468 ) -> Self {
1469 Self(RequestBuilder::new(stub))
1470 }
1471
1472 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1474 self.0.request = v.into();
1475 self
1476 }
1477
1478 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1480 self.0.options = v.into();
1481 self
1482 }
1483
1484 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1486 (*self.0.stub)
1487 .fetch_git_refs(self.0.request, self.0.options)
1488 .await
1489 .map(gax::response::Response::into_body)
1490 }
1491
1492 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496 self.0.request.git_repository_link = v.into();
1497 self
1498 }
1499
1500 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1504 mut self,
1505 v: T,
1506 ) -> Self {
1507 self.0.request.ref_type = v.into();
1508 self
1509 }
1510
1511 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1513 self.0.request.page_size = v.into();
1514 self
1515 }
1516
1517 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1519 self.0.request.page_token = v.into();
1520 self
1521 }
1522 }
1523
1524 #[doc(hidden)]
1525 impl gax::options::internal::RequestBuilder for FetchGitRefs {
1526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1527 &mut self.0.options
1528 }
1529 }
1530
1531 #[derive(Clone, Debug)]
1552 pub struct ListAccountConnectors(RequestBuilder<crate::model::ListAccountConnectorsRequest>);
1553
1554 impl ListAccountConnectors {
1555 pub(crate) fn new(
1556 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1557 ) -> Self {
1558 Self(RequestBuilder::new(stub))
1559 }
1560
1561 pub fn with_request<V: Into<crate::model::ListAccountConnectorsRequest>>(
1563 mut self,
1564 v: V,
1565 ) -> Self {
1566 self.0.request = v.into();
1567 self
1568 }
1569
1570 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1572 self.0.options = v.into();
1573 self
1574 }
1575
1576 pub async fn send(self) -> Result<crate::model::ListAccountConnectorsResponse> {
1578 (*self.0.stub)
1579 .list_account_connectors(self.0.request, self.0.options)
1580 .await
1581 .map(gax::response::Response::into_body)
1582 }
1583
1584 pub fn by_page(
1586 self,
1587 ) -> impl gax::paginator::Paginator<crate::model::ListAccountConnectorsResponse, gax::error::Error>
1588 {
1589 use std::clone::Clone;
1590 let token = self.0.request.page_token.clone();
1591 let execute = move |token: String| {
1592 let mut builder = self.clone();
1593 builder.0.request = builder.0.request.set_page_token(token);
1594 builder.send()
1595 };
1596 gax::paginator::internal::new_paginator(token, execute)
1597 }
1598
1599 pub fn by_item(
1601 self,
1602 ) -> impl gax::paginator::ItemPaginator<
1603 crate::model::ListAccountConnectorsResponse,
1604 gax::error::Error,
1605 > {
1606 use gax::paginator::Paginator;
1607 self.by_page().items()
1608 }
1609
1610 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1614 self.0.request.parent = v.into();
1615 self
1616 }
1617
1618 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1620 self.0.request.page_size = v.into();
1621 self
1622 }
1623
1624 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1626 self.0.request.page_token = v.into();
1627 self
1628 }
1629
1630 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1632 self.0.request.filter = v.into();
1633 self
1634 }
1635
1636 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1638 self.0.request.order_by = v.into();
1639 self
1640 }
1641 }
1642
1643 #[doc(hidden)]
1644 impl gax::options::internal::RequestBuilder for ListAccountConnectors {
1645 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1646 &mut self.0.options
1647 }
1648 }
1649
1650 #[derive(Clone, Debug)]
1667 pub struct GetAccountConnector(RequestBuilder<crate::model::GetAccountConnectorRequest>);
1668
1669 impl GetAccountConnector {
1670 pub(crate) fn new(
1671 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1672 ) -> Self {
1673 Self(RequestBuilder::new(stub))
1674 }
1675
1676 pub fn with_request<V: Into<crate::model::GetAccountConnectorRequest>>(
1678 mut self,
1679 v: V,
1680 ) -> Self {
1681 self.0.request = v.into();
1682 self
1683 }
1684
1685 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1687 self.0.options = v.into();
1688 self
1689 }
1690
1691 pub async fn send(self) -> Result<crate::model::AccountConnector> {
1693 (*self.0.stub)
1694 .get_account_connector(self.0.request, self.0.options)
1695 .await
1696 .map(gax::response::Response::into_body)
1697 }
1698
1699 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1703 self.0.request.name = v.into();
1704 self
1705 }
1706 }
1707
1708 #[doc(hidden)]
1709 impl gax::options::internal::RequestBuilder for GetAccountConnector {
1710 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1711 &mut self.0.options
1712 }
1713 }
1714
1715 #[derive(Clone, Debug)]
1733 pub struct CreateAccountConnector(RequestBuilder<crate::model::CreateAccountConnectorRequest>);
1734
1735 impl CreateAccountConnector {
1736 pub(crate) fn new(
1737 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1738 ) -> Self {
1739 Self(RequestBuilder::new(stub))
1740 }
1741
1742 pub fn with_request<V: Into<crate::model::CreateAccountConnectorRequest>>(
1744 mut self,
1745 v: V,
1746 ) -> Self {
1747 self.0.request = v.into();
1748 self
1749 }
1750
1751 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1753 self.0.options = v.into();
1754 self
1755 }
1756
1757 pub async fn send(self) -> Result<longrunning::model::Operation> {
1764 (*self.0.stub)
1765 .create_account_connector(self.0.request, self.0.options)
1766 .await
1767 .map(gax::response::Response::into_body)
1768 }
1769
1770 pub fn poller(
1772 self,
1773 ) -> impl lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1774 {
1775 type Operation = lro::internal::Operation<
1776 crate::model::AccountConnector,
1777 crate::model::OperationMetadata,
1778 >;
1779 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1780 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1781
1782 let stub = self.0.stub.clone();
1783 let mut options = self.0.options.clone();
1784 options.set_retry_policy(gax::retry_policy::NeverRetry);
1785 let query = move |name| {
1786 let stub = stub.clone();
1787 let options = options.clone();
1788 async {
1789 let op = GetOperation::new(stub)
1790 .set_name(name)
1791 .with_options(options)
1792 .send()
1793 .await?;
1794 Ok(Operation::new(op))
1795 }
1796 };
1797
1798 let start = move || async {
1799 let op = self.send().await?;
1800 Ok(Operation::new(op))
1801 };
1802
1803 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1804 }
1805
1806 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1810 self.0.request.parent = v.into();
1811 self
1812 }
1813
1814 pub fn set_account_connector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1818 self.0.request.account_connector_id = v.into();
1819 self
1820 }
1821
1822 pub fn set_account_connector<T>(mut self, v: T) -> Self
1826 where
1827 T: std::convert::Into<crate::model::AccountConnector>,
1828 {
1829 self.0.request.account_connector = std::option::Option::Some(v.into());
1830 self
1831 }
1832
1833 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
1837 where
1838 T: std::convert::Into<crate::model::AccountConnector>,
1839 {
1840 self.0.request.account_connector = v.map(|x| x.into());
1841 self
1842 }
1843
1844 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1846 self.0.request.request_id = v.into();
1847 self
1848 }
1849
1850 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1852 self.0.request.validate_only = v.into();
1853 self
1854 }
1855 }
1856
1857 #[doc(hidden)]
1858 impl gax::options::internal::RequestBuilder for CreateAccountConnector {
1859 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1860 &mut self.0.options
1861 }
1862 }
1863
1864 #[derive(Clone, Debug)]
1882 pub struct UpdateAccountConnector(RequestBuilder<crate::model::UpdateAccountConnectorRequest>);
1883
1884 impl UpdateAccountConnector {
1885 pub(crate) fn new(
1886 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1887 ) -> Self {
1888 Self(RequestBuilder::new(stub))
1889 }
1890
1891 pub fn with_request<V: Into<crate::model::UpdateAccountConnectorRequest>>(
1893 mut self,
1894 v: V,
1895 ) -> Self {
1896 self.0.request = v.into();
1897 self
1898 }
1899
1900 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1902 self.0.options = v.into();
1903 self
1904 }
1905
1906 pub async fn send(self) -> Result<longrunning::model::Operation> {
1913 (*self.0.stub)
1914 .update_account_connector(self.0.request, self.0.options)
1915 .await
1916 .map(gax::response::Response::into_body)
1917 }
1918
1919 pub fn poller(
1921 self,
1922 ) -> impl lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1923 {
1924 type Operation = lro::internal::Operation<
1925 crate::model::AccountConnector,
1926 crate::model::OperationMetadata,
1927 >;
1928 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1929 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1930
1931 let stub = self.0.stub.clone();
1932 let mut options = self.0.options.clone();
1933 options.set_retry_policy(gax::retry_policy::NeverRetry);
1934 let query = move |name| {
1935 let stub = stub.clone();
1936 let options = options.clone();
1937 async {
1938 let op = GetOperation::new(stub)
1939 .set_name(name)
1940 .with_options(options)
1941 .send()
1942 .await?;
1943 Ok(Operation::new(op))
1944 }
1945 };
1946
1947 let start = move || async {
1948 let op = self.send().await?;
1949 Ok(Operation::new(op))
1950 };
1951
1952 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1953 }
1954
1955 pub fn set_update_mask<T>(mut self, v: T) -> Self
1957 where
1958 T: std::convert::Into<wkt::FieldMask>,
1959 {
1960 self.0.request.update_mask = std::option::Option::Some(v.into());
1961 self
1962 }
1963
1964 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1966 where
1967 T: std::convert::Into<wkt::FieldMask>,
1968 {
1969 self.0.request.update_mask = v.map(|x| x.into());
1970 self
1971 }
1972
1973 pub fn set_account_connector<T>(mut self, v: T) -> Self
1977 where
1978 T: std::convert::Into<crate::model::AccountConnector>,
1979 {
1980 self.0.request.account_connector = std::option::Option::Some(v.into());
1981 self
1982 }
1983
1984 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
1988 where
1989 T: std::convert::Into<crate::model::AccountConnector>,
1990 {
1991 self.0.request.account_connector = v.map(|x| x.into());
1992 self
1993 }
1994
1995 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1997 self.0.request.request_id = v.into();
1998 self
1999 }
2000
2001 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2003 self.0.request.allow_missing = v.into();
2004 self
2005 }
2006
2007 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2009 self.0.request.validate_only = v.into();
2010 self
2011 }
2012 }
2013
2014 #[doc(hidden)]
2015 impl gax::options::internal::RequestBuilder for UpdateAccountConnector {
2016 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2017 &mut self.0.options
2018 }
2019 }
2020
2021 #[derive(Clone, Debug)]
2039 pub struct DeleteAccountConnector(RequestBuilder<crate::model::DeleteAccountConnectorRequest>);
2040
2041 impl DeleteAccountConnector {
2042 pub(crate) fn new(
2043 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2044 ) -> Self {
2045 Self(RequestBuilder::new(stub))
2046 }
2047
2048 pub fn with_request<V: Into<crate::model::DeleteAccountConnectorRequest>>(
2050 mut self,
2051 v: V,
2052 ) -> Self {
2053 self.0.request = v.into();
2054 self
2055 }
2056
2057 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2059 self.0.options = v.into();
2060 self
2061 }
2062
2063 pub async fn send(self) -> Result<longrunning::model::Operation> {
2070 (*self.0.stub)
2071 .delete_account_connector(self.0.request, self.0.options)
2072 .await
2073 .map(gax::response::Response::into_body)
2074 }
2075
2076 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2078 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2079 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2080 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2081
2082 let stub = self.0.stub.clone();
2083 let mut options = self.0.options.clone();
2084 options.set_retry_policy(gax::retry_policy::NeverRetry);
2085 let query = move |name| {
2086 let stub = stub.clone();
2087 let options = options.clone();
2088 async {
2089 let op = GetOperation::new(stub)
2090 .set_name(name)
2091 .with_options(options)
2092 .send()
2093 .await?;
2094 Ok(Operation::new(op))
2095 }
2096 };
2097
2098 let start = move || async {
2099 let op = self.send().await?;
2100 Ok(Operation::new(op))
2101 };
2102
2103 lro::internal::new_unit_response_poller(
2104 polling_error_policy,
2105 polling_backoff_policy,
2106 start,
2107 query,
2108 )
2109 }
2110
2111 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2115 self.0.request.name = v.into();
2116 self
2117 }
2118
2119 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2121 self.0.request.request_id = v.into();
2122 self
2123 }
2124
2125 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2127 self.0.request.validate_only = v.into();
2128 self
2129 }
2130
2131 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2133 self.0.request.etag = v.into();
2134 self
2135 }
2136
2137 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2139 self.0.request.force = v.into();
2140 self
2141 }
2142 }
2143
2144 #[doc(hidden)]
2145 impl gax::options::internal::RequestBuilder for DeleteAccountConnector {
2146 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2147 &mut self.0.options
2148 }
2149 }
2150
2151 #[derive(Clone, Debug)]
2168 pub struct FetchAccessToken(RequestBuilder<crate::model::FetchAccessTokenRequest>);
2169
2170 impl FetchAccessToken {
2171 pub(crate) fn new(
2172 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2173 ) -> Self {
2174 Self(RequestBuilder::new(stub))
2175 }
2176
2177 pub fn with_request<V: Into<crate::model::FetchAccessTokenRequest>>(
2179 mut self,
2180 v: V,
2181 ) -> Self {
2182 self.0.request = v.into();
2183 self
2184 }
2185
2186 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2188 self.0.options = v.into();
2189 self
2190 }
2191
2192 pub async fn send(self) -> Result<crate::model::FetchAccessTokenResponse> {
2194 (*self.0.stub)
2195 .fetch_access_token(self.0.request, self.0.options)
2196 .await
2197 .map(gax::response::Response::into_body)
2198 }
2199
2200 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2204 self.0.request.account_connector = v.into();
2205 self
2206 }
2207 }
2208
2209 #[doc(hidden)]
2210 impl gax::options::internal::RequestBuilder for FetchAccessToken {
2211 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2212 &mut self.0.options
2213 }
2214 }
2215
2216 #[derive(Clone, Debug)]
2237 pub struct ListUsers(RequestBuilder<crate::model::ListUsersRequest>);
2238
2239 impl ListUsers {
2240 pub(crate) fn new(
2241 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2242 ) -> Self {
2243 Self(RequestBuilder::new(stub))
2244 }
2245
2246 pub fn with_request<V: Into<crate::model::ListUsersRequest>>(mut self, v: V) -> Self {
2248 self.0.request = v.into();
2249 self
2250 }
2251
2252 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2254 self.0.options = v.into();
2255 self
2256 }
2257
2258 pub async fn send(self) -> Result<crate::model::ListUsersResponse> {
2260 (*self.0.stub)
2261 .list_users(self.0.request, self.0.options)
2262 .await
2263 .map(gax::response::Response::into_body)
2264 }
2265
2266 pub fn by_page(
2268 self,
2269 ) -> impl gax::paginator::Paginator<crate::model::ListUsersResponse, gax::error::Error>
2270 {
2271 use std::clone::Clone;
2272 let token = self.0.request.page_token.clone();
2273 let execute = move |token: String| {
2274 let mut builder = self.clone();
2275 builder.0.request = builder.0.request.set_page_token(token);
2276 builder.send()
2277 };
2278 gax::paginator::internal::new_paginator(token, execute)
2279 }
2280
2281 pub fn by_item(
2283 self,
2284 ) -> impl gax::paginator::ItemPaginator<crate::model::ListUsersResponse, gax::error::Error>
2285 {
2286 use gax::paginator::Paginator;
2287 self.by_page().items()
2288 }
2289
2290 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2294 self.0.request.parent = v.into();
2295 self
2296 }
2297
2298 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2300 self.0.request.page_size = v.into();
2301 self
2302 }
2303
2304 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2306 self.0.request.page_token = v.into();
2307 self
2308 }
2309
2310 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312 self.0.request.filter = v.into();
2313 self
2314 }
2315
2316 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.0.request.order_by = v.into();
2319 self
2320 }
2321 }
2322
2323 #[doc(hidden)]
2324 impl gax::options::internal::RequestBuilder for ListUsers {
2325 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2326 &mut self.0.options
2327 }
2328 }
2329
2330 #[derive(Clone, Debug)]
2348 pub struct DeleteUser(RequestBuilder<crate::model::DeleteUserRequest>);
2349
2350 impl DeleteUser {
2351 pub(crate) fn new(
2352 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2353 ) -> Self {
2354 Self(RequestBuilder::new(stub))
2355 }
2356
2357 pub fn with_request<V: Into<crate::model::DeleteUserRequest>>(mut self, v: V) -> Self {
2359 self.0.request = v.into();
2360 self
2361 }
2362
2363 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2365 self.0.options = v.into();
2366 self
2367 }
2368
2369 pub async fn send(self) -> Result<longrunning::model::Operation> {
2376 (*self.0.stub)
2377 .delete_user(self.0.request, self.0.options)
2378 .await
2379 .map(gax::response::Response::into_body)
2380 }
2381
2382 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2384 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2385 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2386 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2387
2388 let stub = self.0.stub.clone();
2389 let mut options = self.0.options.clone();
2390 options.set_retry_policy(gax::retry_policy::NeverRetry);
2391 let query = move |name| {
2392 let stub = stub.clone();
2393 let options = options.clone();
2394 async {
2395 let op = GetOperation::new(stub)
2396 .set_name(name)
2397 .with_options(options)
2398 .send()
2399 .await?;
2400 Ok(Operation::new(op))
2401 }
2402 };
2403
2404 let start = move || async {
2405 let op = self.send().await?;
2406 Ok(Operation::new(op))
2407 };
2408
2409 lro::internal::new_unit_response_poller(
2410 polling_error_policy,
2411 polling_backoff_policy,
2412 start,
2413 query,
2414 )
2415 }
2416
2417 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2421 self.0.request.name = v.into();
2422 self
2423 }
2424
2425 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.0.request.request_id = v.into();
2428 self
2429 }
2430
2431 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2433 self.0.request.validate_only = v.into();
2434 self
2435 }
2436
2437 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2439 self.0.request.etag = v.into();
2440 self
2441 }
2442 }
2443
2444 #[doc(hidden)]
2445 impl gax::options::internal::RequestBuilder for DeleteUser {
2446 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2447 &mut self.0.options
2448 }
2449 }
2450
2451 #[derive(Clone, Debug)]
2468 pub struct FetchSelf(RequestBuilder<crate::model::FetchSelfRequest>);
2469
2470 impl FetchSelf {
2471 pub(crate) fn new(
2472 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2473 ) -> Self {
2474 Self(RequestBuilder::new(stub))
2475 }
2476
2477 pub fn with_request<V: Into<crate::model::FetchSelfRequest>>(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::User> {
2491 (*self.0.stub)
2492 .fetch_self(self.0.request, self.0.options)
2493 .await
2494 .map(gax::response::Response::into_body)
2495 }
2496
2497 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2501 self.0.request.name = v.into();
2502 self
2503 }
2504 }
2505
2506 #[doc(hidden)]
2507 impl gax::options::internal::RequestBuilder for FetchSelf {
2508 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2509 &mut self.0.options
2510 }
2511 }
2512
2513 #[derive(Clone, Debug)]
2531 pub struct DeleteSelf(RequestBuilder<crate::model::DeleteSelfRequest>);
2532
2533 impl DeleteSelf {
2534 pub(crate) fn new(
2535 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2536 ) -> Self {
2537 Self(RequestBuilder::new(stub))
2538 }
2539
2540 pub fn with_request<V: Into<crate::model::DeleteSelfRequest>>(mut self, v: V) -> Self {
2542 self.0.request = v.into();
2543 self
2544 }
2545
2546 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2548 self.0.options = v.into();
2549 self
2550 }
2551
2552 pub async fn send(self) -> Result<longrunning::model::Operation> {
2559 (*self.0.stub)
2560 .delete_self(self.0.request, self.0.options)
2561 .await
2562 .map(gax::response::Response::into_body)
2563 }
2564
2565 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2567 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2568 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2569 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2570
2571 let stub = self.0.stub.clone();
2572 let mut options = self.0.options.clone();
2573 options.set_retry_policy(gax::retry_policy::NeverRetry);
2574 let query = move |name| {
2575 let stub = stub.clone();
2576 let options = options.clone();
2577 async {
2578 let op = GetOperation::new(stub)
2579 .set_name(name)
2580 .with_options(options)
2581 .send()
2582 .await?;
2583 Ok(Operation::new(op))
2584 }
2585 };
2586
2587 let start = move || async {
2588 let op = self.send().await?;
2589 Ok(Operation::new(op))
2590 };
2591
2592 lro::internal::new_unit_response_poller(
2593 polling_error_policy,
2594 polling_backoff_policy,
2595 start,
2596 query,
2597 )
2598 }
2599
2600 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2604 self.0.request.name = v.into();
2605 self
2606 }
2607 }
2608
2609 #[doc(hidden)]
2610 impl gax::options::internal::RequestBuilder for DeleteSelf {
2611 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2612 &mut self.0.options
2613 }
2614 }
2615
2616 #[derive(Clone, Debug)]
2637 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2638
2639 impl ListLocations {
2640 pub(crate) fn new(
2641 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2642 ) -> Self {
2643 Self(RequestBuilder::new(stub))
2644 }
2645
2646 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2648 mut self,
2649 v: V,
2650 ) -> Self {
2651 self.0.request = v.into();
2652 self
2653 }
2654
2655 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2657 self.0.options = v.into();
2658 self
2659 }
2660
2661 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2663 (*self.0.stub)
2664 .list_locations(self.0.request, self.0.options)
2665 .await
2666 .map(gax::response::Response::into_body)
2667 }
2668
2669 pub fn by_page(
2671 self,
2672 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2673 {
2674 use std::clone::Clone;
2675 let token = self.0.request.page_token.clone();
2676 let execute = move |token: String| {
2677 let mut builder = self.clone();
2678 builder.0.request = builder.0.request.set_page_token(token);
2679 builder.send()
2680 };
2681 gax::paginator::internal::new_paginator(token, execute)
2682 }
2683
2684 pub fn by_item(
2686 self,
2687 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2688 {
2689 use gax::paginator::Paginator;
2690 self.by_page().items()
2691 }
2692
2693 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2695 self.0.request.name = v.into();
2696 self
2697 }
2698
2699 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2701 self.0.request.filter = v.into();
2702 self
2703 }
2704
2705 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2707 self.0.request.page_size = v.into();
2708 self
2709 }
2710
2711 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2713 self.0.request.page_token = v.into();
2714 self
2715 }
2716 }
2717
2718 #[doc(hidden)]
2719 impl gax::options::internal::RequestBuilder for ListLocations {
2720 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2721 &mut self.0.options
2722 }
2723 }
2724
2725 #[derive(Clone, Debug)]
2742 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2743
2744 impl GetLocation {
2745 pub(crate) fn new(
2746 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2747 ) -> Self {
2748 Self(RequestBuilder::new(stub))
2749 }
2750
2751 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2753 self.0.request = v.into();
2754 self
2755 }
2756
2757 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2759 self.0.options = v.into();
2760 self
2761 }
2762
2763 pub async fn send(self) -> Result<location::model::Location> {
2765 (*self.0.stub)
2766 .get_location(self.0.request, self.0.options)
2767 .await
2768 .map(gax::response::Response::into_body)
2769 }
2770
2771 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2773 self.0.request.name = v.into();
2774 self
2775 }
2776 }
2777
2778 #[doc(hidden)]
2779 impl gax::options::internal::RequestBuilder for GetLocation {
2780 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2781 &mut self.0.options
2782 }
2783 }
2784
2785 #[derive(Clone, Debug)]
2806 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2807
2808 impl ListOperations {
2809 pub(crate) fn new(
2810 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2811 ) -> Self {
2812 Self(RequestBuilder::new(stub))
2813 }
2814
2815 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2817 mut self,
2818 v: V,
2819 ) -> Self {
2820 self.0.request = v.into();
2821 self
2822 }
2823
2824 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2826 self.0.options = v.into();
2827 self
2828 }
2829
2830 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2832 (*self.0.stub)
2833 .list_operations(self.0.request, self.0.options)
2834 .await
2835 .map(gax::response::Response::into_body)
2836 }
2837
2838 pub fn by_page(
2840 self,
2841 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2842 {
2843 use std::clone::Clone;
2844 let token = self.0.request.page_token.clone();
2845 let execute = move |token: String| {
2846 let mut builder = self.clone();
2847 builder.0.request = builder.0.request.set_page_token(token);
2848 builder.send()
2849 };
2850 gax::paginator::internal::new_paginator(token, execute)
2851 }
2852
2853 pub fn by_item(
2855 self,
2856 ) -> impl gax::paginator::ItemPaginator<
2857 longrunning::model::ListOperationsResponse,
2858 gax::error::Error,
2859 > {
2860 use gax::paginator::Paginator;
2861 self.by_page().items()
2862 }
2863
2864 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2866 self.0.request.name = v.into();
2867 self
2868 }
2869
2870 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2872 self.0.request.filter = v.into();
2873 self
2874 }
2875
2876 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2878 self.0.request.page_size = v.into();
2879 self
2880 }
2881
2882 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2884 self.0.request.page_token = v.into();
2885 self
2886 }
2887
2888 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2890 self.0.request.return_partial_success = v.into();
2891 self
2892 }
2893 }
2894
2895 #[doc(hidden)]
2896 impl gax::options::internal::RequestBuilder for ListOperations {
2897 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2898 &mut self.0.options
2899 }
2900 }
2901
2902 #[derive(Clone, Debug)]
2919 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2920
2921 impl GetOperation {
2922 pub(crate) fn new(
2923 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2924 ) -> Self {
2925 Self(RequestBuilder::new(stub))
2926 }
2927
2928 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2930 mut self,
2931 v: V,
2932 ) -> Self {
2933 self.0.request = v.into();
2934 self
2935 }
2936
2937 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2939 self.0.options = v.into();
2940 self
2941 }
2942
2943 pub async fn send(self) -> Result<longrunning::model::Operation> {
2945 (*self.0.stub)
2946 .get_operation(self.0.request, self.0.options)
2947 .await
2948 .map(gax::response::Response::into_body)
2949 }
2950
2951 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2953 self.0.request.name = v.into();
2954 self
2955 }
2956 }
2957
2958 #[doc(hidden)]
2959 impl gax::options::internal::RequestBuilder for GetOperation {
2960 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2961 &mut self.0.options
2962 }
2963 }
2964
2965 #[derive(Clone, Debug)]
2982 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2983
2984 impl DeleteOperation {
2985 pub(crate) fn new(
2986 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2987 ) -> Self {
2988 Self(RequestBuilder::new(stub))
2989 }
2990
2991 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2993 mut self,
2994 v: V,
2995 ) -> Self {
2996 self.0.request = v.into();
2997 self
2998 }
2999
3000 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3002 self.0.options = v.into();
3003 self
3004 }
3005
3006 pub async fn send(self) -> Result<()> {
3008 (*self.0.stub)
3009 .delete_operation(self.0.request, self.0.options)
3010 .await
3011 .map(gax::response::Response::into_body)
3012 }
3013
3014 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3016 self.0.request.name = v.into();
3017 self
3018 }
3019 }
3020
3021 #[doc(hidden)]
3022 impl gax::options::internal::RequestBuilder for DeleteOperation {
3023 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3024 &mut self.0.options
3025 }
3026 }
3027
3028 #[derive(Clone, Debug)]
3045 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3046
3047 impl CancelOperation {
3048 pub(crate) fn new(
3049 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3050 ) -> Self {
3051 Self(RequestBuilder::new(stub))
3052 }
3053
3054 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3056 mut self,
3057 v: V,
3058 ) -> Self {
3059 self.0.request = v.into();
3060 self
3061 }
3062
3063 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3065 self.0.options = v.into();
3066 self
3067 }
3068
3069 pub async fn send(self) -> Result<()> {
3071 (*self.0.stub)
3072 .cancel_operation(self.0.request, self.0.options)
3073 .await
3074 .map(gax::response::Response::into_body)
3075 }
3076
3077 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3079 self.0.request.name = v.into();
3080 self
3081 }
3082 }
3083
3084 #[doc(hidden)]
3085 impl gax::options::internal::RequestBuilder for CancelOperation {
3086 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3087 &mut self.0.options
3088 }
3089 }
3090}
3091
3092pub mod insights_config_service {
3093 use crate::Result;
3094
3095 pub type ClientBuilder =
3109 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3110
3111 pub(crate) mod client {
3112 use super::super::super::client::InsightsConfigService;
3113 pub struct Factory;
3114 impl gax::client_builder::internal::ClientFactory for Factory {
3115 type Client = InsightsConfigService;
3116 type Credentials = gaxi::options::Credentials;
3117 async fn build(
3118 self,
3119 config: gaxi::options::ClientConfig,
3120 ) -> gax::client_builder::Result<Self::Client> {
3121 Self::Client::new(config).await
3122 }
3123 }
3124 }
3125
3126 #[derive(Clone, Debug)]
3128 pub(crate) struct RequestBuilder<R: std::default::Default> {
3129 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3130 request: R,
3131 options: gax::options::RequestOptions,
3132 }
3133
3134 impl<R> RequestBuilder<R>
3135 where
3136 R: std::default::Default,
3137 {
3138 pub(crate) fn new(
3139 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3140 ) -> Self {
3141 Self {
3142 stub,
3143 request: R::default(),
3144 options: gax::options::RequestOptions::default(),
3145 }
3146 }
3147 }
3148
3149 #[derive(Clone, Debug)]
3170 pub struct ListInsightsConfigs(RequestBuilder<crate::model::ListInsightsConfigsRequest>);
3171
3172 impl ListInsightsConfigs {
3173 pub(crate) fn new(
3174 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3175 ) -> Self {
3176 Self(RequestBuilder::new(stub))
3177 }
3178
3179 pub fn with_request<V: Into<crate::model::ListInsightsConfigsRequest>>(
3181 mut self,
3182 v: V,
3183 ) -> Self {
3184 self.0.request = v.into();
3185 self
3186 }
3187
3188 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3190 self.0.options = v.into();
3191 self
3192 }
3193
3194 pub async fn send(self) -> Result<crate::model::ListInsightsConfigsResponse> {
3196 (*self.0.stub)
3197 .list_insights_configs(self.0.request, self.0.options)
3198 .await
3199 .map(gax::response::Response::into_body)
3200 }
3201
3202 pub fn by_page(
3204 self,
3205 ) -> impl gax::paginator::Paginator<crate::model::ListInsightsConfigsResponse, gax::error::Error>
3206 {
3207 use std::clone::Clone;
3208 let token = self.0.request.page_token.clone();
3209 let execute = move |token: String| {
3210 let mut builder = self.clone();
3211 builder.0.request = builder.0.request.set_page_token(token);
3212 builder.send()
3213 };
3214 gax::paginator::internal::new_paginator(token, execute)
3215 }
3216
3217 pub fn by_item(
3219 self,
3220 ) -> impl gax::paginator::ItemPaginator<
3221 crate::model::ListInsightsConfigsResponse,
3222 gax::error::Error,
3223 > {
3224 use gax::paginator::Paginator;
3225 self.by_page().items()
3226 }
3227
3228 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3232 self.0.request.parent = v.into();
3233 self
3234 }
3235
3236 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3238 self.0.request.page_size = v.into();
3239 self
3240 }
3241
3242 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3244 self.0.request.page_token = v.into();
3245 self
3246 }
3247
3248 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3250 self.0.request.filter = v.into();
3251 self
3252 }
3253
3254 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3256 self.0.request.order_by = v.into();
3257 self
3258 }
3259 }
3260
3261 #[doc(hidden)]
3262 impl gax::options::internal::RequestBuilder for ListInsightsConfigs {
3263 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3264 &mut self.0.options
3265 }
3266 }
3267
3268 #[derive(Clone, Debug)]
3286 pub struct CreateInsightsConfig(RequestBuilder<crate::model::CreateInsightsConfigRequest>);
3287
3288 impl CreateInsightsConfig {
3289 pub(crate) fn new(
3290 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3291 ) -> Self {
3292 Self(RequestBuilder::new(stub))
3293 }
3294
3295 pub fn with_request<V: Into<crate::model::CreateInsightsConfigRequest>>(
3297 mut self,
3298 v: V,
3299 ) -> Self {
3300 self.0.request = v.into();
3301 self
3302 }
3303
3304 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3306 self.0.options = v.into();
3307 self
3308 }
3309
3310 pub async fn send(self) -> Result<longrunning::model::Operation> {
3317 (*self.0.stub)
3318 .create_insights_config(self.0.request, self.0.options)
3319 .await
3320 .map(gax::response::Response::into_body)
3321 }
3322
3323 pub fn poller(
3325 self,
3326 ) -> impl lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3327 {
3328 type Operation = lro::internal::Operation<
3329 crate::model::InsightsConfig,
3330 crate::model::OperationMetadata,
3331 >;
3332 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3333 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3334
3335 let stub = self.0.stub.clone();
3336 let mut options = self.0.options.clone();
3337 options.set_retry_policy(gax::retry_policy::NeverRetry);
3338 let query = move |name| {
3339 let stub = stub.clone();
3340 let options = options.clone();
3341 async {
3342 let op = GetOperation::new(stub)
3343 .set_name(name)
3344 .with_options(options)
3345 .send()
3346 .await?;
3347 Ok(Operation::new(op))
3348 }
3349 };
3350
3351 let start = move || async {
3352 let op = self.send().await?;
3353 Ok(Operation::new(op))
3354 };
3355
3356 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3357 }
3358
3359 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3363 self.0.request.parent = v.into();
3364 self
3365 }
3366
3367 pub fn set_insights_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3371 self.0.request.insights_config_id = v.into();
3372 self
3373 }
3374
3375 pub fn set_insights_config<T>(mut self, v: T) -> Self
3379 where
3380 T: std::convert::Into<crate::model::InsightsConfig>,
3381 {
3382 self.0.request.insights_config = std::option::Option::Some(v.into());
3383 self
3384 }
3385
3386 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3390 where
3391 T: std::convert::Into<crate::model::InsightsConfig>,
3392 {
3393 self.0.request.insights_config = v.map(|x| x.into());
3394 self
3395 }
3396
3397 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3399 self.0.request.validate_only = v.into();
3400 self
3401 }
3402 }
3403
3404 #[doc(hidden)]
3405 impl gax::options::internal::RequestBuilder for CreateInsightsConfig {
3406 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3407 &mut self.0.options
3408 }
3409 }
3410
3411 #[derive(Clone, Debug)]
3428 pub struct GetInsightsConfig(RequestBuilder<crate::model::GetInsightsConfigRequest>);
3429
3430 impl GetInsightsConfig {
3431 pub(crate) fn new(
3432 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3433 ) -> Self {
3434 Self(RequestBuilder::new(stub))
3435 }
3436
3437 pub fn with_request<V: Into<crate::model::GetInsightsConfigRequest>>(
3439 mut self,
3440 v: V,
3441 ) -> Self {
3442 self.0.request = v.into();
3443 self
3444 }
3445
3446 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3448 self.0.options = v.into();
3449 self
3450 }
3451
3452 pub async fn send(self) -> Result<crate::model::InsightsConfig> {
3454 (*self.0.stub)
3455 .get_insights_config(self.0.request, self.0.options)
3456 .await
3457 .map(gax::response::Response::into_body)
3458 }
3459
3460 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3464 self.0.request.name = v.into();
3465 self
3466 }
3467 }
3468
3469 #[doc(hidden)]
3470 impl gax::options::internal::RequestBuilder for GetInsightsConfig {
3471 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3472 &mut self.0.options
3473 }
3474 }
3475
3476 #[derive(Clone, Debug)]
3494 pub struct UpdateInsightsConfig(RequestBuilder<crate::model::UpdateInsightsConfigRequest>);
3495
3496 impl UpdateInsightsConfig {
3497 pub(crate) fn new(
3498 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3499 ) -> Self {
3500 Self(RequestBuilder::new(stub))
3501 }
3502
3503 pub fn with_request<V: Into<crate::model::UpdateInsightsConfigRequest>>(
3505 mut self,
3506 v: V,
3507 ) -> Self {
3508 self.0.request = v.into();
3509 self
3510 }
3511
3512 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3514 self.0.options = v.into();
3515 self
3516 }
3517
3518 pub async fn send(self) -> Result<longrunning::model::Operation> {
3525 (*self.0.stub)
3526 .update_insights_config(self.0.request, self.0.options)
3527 .await
3528 .map(gax::response::Response::into_body)
3529 }
3530
3531 pub fn poller(
3533 self,
3534 ) -> impl lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3535 {
3536 type Operation = lro::internal::Operation<
3537 crate::model::InsightsConfig,
3538 crate::model::OperationMetadata,
3539 >;
3540 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3541 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3542
3543 let stub = self.0.stub.clone();
3544 let mut options = self.0.options.clone();
3545 options.set_retry_policy(gax::retry_policy::NeverRetry);
3546 let query = move |name| {
3547 let stub = stub.clone();
3548 let options = options.clone();
3549 async {
3550 let op = GetOperation::new(stub)
3551 .set_name(name)
3552 .with_options(options)
3553 .send()
3554 .await?;
3555 Ok(Operation::new(op))
3556 }
3557 };
3558
3559 let start = move || async {
3560 let op = self.send().await?;
3561 Ok(Operation::new(op))
3562 };
3563
3564 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3565 }
3566
3567 pub fn set_insights_config<T>(mut self, v: T) -> Self
3571 where
3572 T: std::convert::Into<crate::model::InsightsConfig>,
3573 {
3574 self.0.request.insights_config = std::option::Option::Some(v.into());
3575 self
3576 }
3577
3578 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3582 where
3583 T: std::convert::Into<crate::model::InsightsConfig>,
3584 {
3585 self.0.request.insights_config = v.map(|x| x.into());
3586 self
3587 }
3588
3589 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3591 self.0.request.request_id = v.into();
3592 self
3593 }
3594
3595 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
3597 self.0.request.allow_missing = v.into();
3598 self
3599 }
3600
3601 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3603 self.0.request.validate_only = v.into();
3604 self
3605 }
3606 }
3607
3608 #[doc(hidden)]
3609 impl gax::options::internal::RequestBuilder for UpdateInsightsConfig {
3610 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3611 &mut self.0.options
3612 }
3613 }
3614
3615 #[derive(Clone, Debug)]
3633 pub struct DeleteInsightsConfig(RequestBuilder<crate::model::DeleteInsightsConfigRequest>);
3634
3635 impl DeleteInsightsConfig {
3636 pub(crate) fn new(
3637 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3638 ) -> Self {
3639 Self(RequestBuilder::new(stub))
3640 }
3641
3642 pub fn with_request<V: Into<crate::model::DeleteInsightsConfigRequest>>(
3644 mut self,
3645 v: V,
3646 ) -> Self {
3647 self.0.request = v.into();
3648 self
3649 }
3650
3651 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3653 self.0.options = v.into();
3654 self
3655 }
3656
3657 pub async fn send(self) -> Result<longrunning::model::Operation> {
3664 (*self.0.stub)
3665 .delete_insights_config(self.0.request, self.0.options)
3666 .await
3667 .map(gax::response::Response::into_body)
3668 }
3669
3670 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3672 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3673 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3674 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3675
3676 let stub = self.0.stub.clone();
3677 let mut options = self.0.options.clone();
3678 options.set_retry_policy(gax::retry_policy::NeverRetry);
3679 let query = move |name| {
3680 let stub = stub.clone();
3681 let options = options.clone();
3682 async {
3683 let op = GetOperation::new(stub)
3684 .set_name(name)
3685 .with_options(options)
3686 .send()
3687 .await?;
3688 Ok(Operation::new(op))
3689 }
3690 };
3691
3692 let start = move || async {
3693 let op = self.send().await?;
3694 Ok(Operation::new(op))
3695 };
3696
3697 lro::internal::new_unit_response_poller(
3698 polling_error_policy,
3699 polling_backoff_policy,
3700 start,
3701 query,
3702 )
3703 }
3704
3705 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3709 self.0.request.name = v.into();
3710 self
3711 }
3712
3713 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3715 self.0.request.request_id = v.into();
3716 self
3717 }
3718
3719 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3721 self.0.request.validate_only = v.into();
3722 self
3723 }
3724
3725 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3727 self.0.request.etag = v.into();
3728 self
3729 }
3730 }
3731
3732 #[doc(hidden)]
3733 impl gax::options::internal::RequestBuilder for DeleteInsightsConfig {
3734 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3735 &mut self.0.options
3736 }
3737 }
3738
3739 #[derive(Clone, Debug)]
3760 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3761
3762 impl ListLocations {
3763 pub(crate) fn new(
3764 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3765 ) -> Self {
3766 Self(RequestBuilder::new(stub))
3767 }
3768
3769 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3771 mut self,
3772 v: V,
3773 ) -> Self {
3774 self.0.request = v.into();
3775 self
3776 }
3777
3778 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3780 self.0.options = v.into();
3781 self
3782 }
3783
3784 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3786 (*self.0.stub)
3787 .list_locations(self.0.request, self.0.options)
3788 .await
3789 .map(gax::response::Response::into_body)
3790 }
3791
3792 pub fn by_page(
3794 self,
3795 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3796 {
3797 use std::clone::Clone;
3798 let token = self.0.request.page_token.clone();
3799 let execute = move |token: String| {
3800 let mut builder = self.clone();
3801 builder.0.request = builder.0.request.set_page_token(token);
3802 builder.send()
3803 };
3804 gax::paginator::internal::new_paginator(token, execute)
3805 }
3806
3807 pub fn by_item(
3809 self,
3810 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3811 {
3812 use gax::paginator::Paginator;
3813 self.by_page().items()
3814 }
3815
3816 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3818 self.0.request.name = v.into();
3819 self
3820 }
3821
3822 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3824 self.0.request.filter = v.into();
3825 self
3826 }
3827
3828 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3830 self.0.request.page_size = v.into();
3831 self
3832 }
3833
3834 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3836 self.0.request.page_token = v.into();
3837 self
3838 }
3839 }
3840
3841 #[doc(hidden)]
3842 impl gax::options::internal::RequestBuilder for ListLocations {
3843 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3844 &mut self.0.options
3845 }
3846 }
3847
3848 #[derive(Clone, Debug)]
3865 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3866
3867 impl GetLocation {
3868 pub(crate) fn new(
3869 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3870 ) -> Self {
3871 Self(RequestBuilder::new(stub))
3872 }
3873
3874 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3876 self.0.request = v.into();
3877 self
3878 }
3879
3880 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3882 self.0.options = v.into();
3883 self
3884 }
3885
3886 pub async fn send(self) -> Result<location::model::Location> {
3888 (*self.0.stub)
3889 .get_location(self.0.request, self.0.options)
3890 .await
3891 .map(gax::response::Response::into_body)
3892 }
3893
3894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3896 self.0.request.name = v.into();
3897 self
3898 }
3899 }
3900
3901 #[doc(hidden)]
3902 impl gax::options::internal::RequestBuilder for GetLocation {
3903 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3904 &mut self.0.options
3905 }
3906 }
3907
3908 #[derive(Clone, Debug)]
3929 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3930
3931 impl ListOperations {
3932 pub(crate) fn new(
3933 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3934 ) -> Self {
3935 Self(RequestBuilder::new(stub))
3936 }
3937
3938 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3940 mut self,
3941 v: V,
3942 ) -> Self {
3943 self.0.request = v.into();
3944 self
3945 }
3946
3947 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3949 self.0.options = v.into();
3950 self
3951 }
3952
3953 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3955 (*self.0.stub)
3956 .list_operations(self.0.request, self.0.options)
3957 .await
3958 .map(gax::response::Response::into_body)
3959 }
3960
3961 pub fn by_page(
3963 self,
3964 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3965 {
3966 use std::clone::Clone;
3967 let token = self.0.request.page_token.clone();
3968 let execute = move |token: String| {
3969 let mut builder = self.clone();
3970 builder.0.request = builder.0.request.set_page_token(token);
3971 builder.send()
3972 };
3973 gax::paginator::internal::new_paginator(token, execute)
3974 }
3975
3976 pub fn by_item(
3978 self,
3979 ) -> impl gax::paginator::ItemPaginator<
3980 longrunning::model::ListOperationsResponse,
3981 gax::error::Error,
3982 > {
3983 use gax::paginator::Paginator;
3984 self.by_page().items()
3985 }
3986
3987 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3989 self.0.request.name = v.into();
3990 self
3991 }
3992
3993 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3995 self.0.request.filter = v.into();
3996 self
3997 }
3998
3999 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4001 self.0.request.page_size = v.into();
4002 self
4003 }
4004
4005 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4007 self.0.request.page_token = v.into();
4008 self
4009 }
4010
4011 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4013 self.0.request.return_partial_success = v.into();
4014 self
4015 }
4016 }
4017
4018 #[doc(hidden)]
4019 impl gax::options::internal::RequestBuilder for ListOperations {
4020 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4021 &mut self.0.options
4022 }
4023 }
4024
4025 #[derive(Clone, Debug)]
4042 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4043
4044 impl GetOperation {
4045 pub(crate) fn new(
4046 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4047 ) -> Self {
4048 Self(RequestBuilder::new(stub))
4049 }
4050
4051 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4053 mut self,
4054 v: V,
4055 ) -> Self {
4056 self.0.request = v.into();
4057 self
4058 }
4059
4060 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4062 self.0.options = v.into();
4063 self
4064 }
4065
4066 pub async fn send(self) -> Result<longrunning::model::Operation> {
4068 (*self.0.stub)
4069 .get_operation(self.0.request, self.0.options)
4070 .await
4071 .map(gax::response::Response::into_body)
4072 }
4073
4074 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4076 self.0.request.name = v.into();
4077 self
4078 }
4079 }
4080
4081 #[doc(hidden)]
4082 impl gax::options::internal::RequestBuilder for GetOperation {
4083 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4084 &mut self.0.options
4085 }
4086 }
4087
4088 #[derive(Clone, Debug)]
4105 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4106
4107 impl DeleteOperation {
4108 pub(crate) fn new(
4109 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4110 ) -> Self {
4111 Self(RequestBuilder::new(stub))
4112 }
4113
4114 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4116 mut self,
4117 v: V,
4118 ) -> Self {
4119 self.0.request = v.into();
4120 self
4121 }
4122
4123 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4125 self.0.options = v.into();
4126 self
4127 }
4128
4129 pub async fn send(self) -> Result<()> {
4131 (*self.0.stub)
4132 .delete_operation(self.0.request, self.0.options)
4133 .await
4134 .map(gax::response::Response::into_body)
4135 }
4136
4137 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4139 self.0.request.name = v.into();
4140 self
4141 }
4142 }
4143
4144 #[doc(hidden)]
4145 impl gax::options::internal::RequestBuilder for DeleteOperation {
4146 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4147 &mut self.0.options
4148 }
4149 }
4150
4151 #[derive(Clone, Debug)]
4168 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4169
4170 impl CancelOperation {
4171 pub(crate) fn new(
4172 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4173 ) -> Self {
4174 Self(RequestBuilder::new(stub))
4175 }
4176
4177 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4179 mut self,
4180 v: V,
4181 ) -> Self {
4182 self.0.request = v.into();
4183 self
4184 }
4185
4186 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4188 self.0.options = v.into();
4189 self
4190 }
4191
4192 pub async fn send(self) -> Result<()> {
4194 (*self.0.stub)
4195 .cancel_operation(self.0.request, self.0.options)
4196 .await
4197 .map(gax::response::Response::into_body)
4198 }
4199
4200 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4202 self.0.request.name = v.into();
4203 self
4204 }
4205 }
4206
4207 #[doc(hidden)]
4208 impl gax::options::internal::RequestBuilder for CancelOperation {
4209 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4210 &mut self.0.options
4211 }
4212 }
4213}