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)]
96 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
97
98 impl ListConnections {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
107 self.0.request = v.into();
108 self
109 }
110
111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113 self.0.options = v.into();
114 self
115 }
116
117 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
119 (*self.0.stub)
120 .list_connections(self.0.request, self.0.options)
121 .await
122 .map(gax::response::Response::into_body)
123 }
124
125 pub fn by_page(
127 self,
128 ) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl gax::paginator::ItemPaginator<crate::model::ListConnectionsResponse, gax::error::Error>
144 {
145 use gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.filter = v.into();
172 self
173 }
174
175 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.order_by = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl gax::options::internal::RequestBuilder for ListConnections {
184 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
207 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
208
209 impl GetConnection {
210 pub(crate) fn new(
211 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
212 ) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
218 self.0.request = v.into();
219 self
220 }
221
222 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
224 self.0.options = v.into();
225 self
226 }
227
228 pub async fn send(self) -> Result<crate::model::Connection> {
230 (*self.0.stub)
231 .get_connection(self.0.request, self.0.options)
232 .await
233 .map(gax::response::Response::into_body)
234 }
235
236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.name = v.into();
241 self
242 }
243 }
244
245 #[doc(hidden)]
246 impl gax::options::internal::RequestBuilder for GetConnection {
247 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
248 &mut self.0.options
249 }
250 }
251
252 #[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<gax::options::RequestOptions>>(mut self, v: V) -> Self {
291 self.0.options = v.into();
292 self
293 }
294
295 pub async fn send(self) -> Result<longrunning::model::Operation> {
302 (*self.0.stub)
303 .create_connection(self.0.request, self.0.options)
304 .await
305 .map(gax::response::Response::into_body)
306 }
307
308 pub fn poller(
310 self,
311 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
312 type Operation =
313 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
314 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
315 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
316
317 let stub = self.0.stub.clone();
318 let mut options = self.0.options.clone();
319 options.set_retry_policy(gax::retry_policy::NeverRetry);
320 let query = move |name| {
321 let stub = stub.clone();
322 let options = options.clone();
323 async {
324 let op = GetOperation::new(stub)
325 .set_name(name)
326 .with_options(options)
327 .send()
328 .await?;
329 Ok(Operation::new(op))
330 }
331 };
332
333 let start = move || async {
334 let op = self.send().await?;
335 Ok(Operation::new(op))
336 };
337
338 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
339 }
340
341 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
345 self.0.request.parent = v.into();
346 self
347 }
348
349 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
353 self.0.request.connection_id = v.into();
354 self
355 }
356
357 pub fn set_connection<T>(mut self, v: T) -> Self
361 where
362 T: std::convert::Into<crate::model::Connection>,
363 {
364 self.0.request.connection = std::option::Option::Some(v.into());
365 self
366 }
367
368 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
372 where
373 T: std::convert::Into<crate::model::Connection>,
374 {
375 self.0.request.connection = v.map(|x| x.into());
376 self
377 }
378
379 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
381 self.0.request.request_id = v.into();
382 self
383 }
384
385 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
387 self.0.request.validate_only = v.into();
388 self
389 }
390 }
391
392 #[doc(hidden)]
393 impl gax::options::internal::RequestBuilder for CreateConnection {
394 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
395 &mut self.0.options
396 }
397 }
398
399 #[derive(Clone, Debug)]
418 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
419
420 impl UpdateConnection {
421 pub(crate) fn new(
422 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
423 ) -> Self {
424 Self(RequestBuilder::new(stub))
425 }
426
427 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
429 mut self,
430 v: V,
431 ) -> Self {
432 self.0.request = v.into();
433 self
434 }
435
436 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
438 self.0.options = v.into();
439 self
440 }
441
442 pub async fn send(self) -> Result<longrunning::model::Operation> {
449 (*self.0.stub)
450 .update_connection(self.0.request, self.0.options)
451 .await
452 .map(gax::response::Response::into_body)
453 }
454
455 pub fn poller(
457 self,
458 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
459 type Operation =
460 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
461 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
462 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
463
464 let stub = self.0.stub.clone();
465 let mut options = self.0.options.clone();
466 options.set_retry_policy(gax::retry_policy::NeverRetry);
467 let query = move |name| {
468 let stub = stub.clone();
469 let options = options.clone();
470 async {
471 let op = GetOperation::new(stub)
472 .set_name(name)
473 .with_options(options)
474 .send()
475 .await?;
476 Ok(Operation::new(op))
477 }
478 };
479
480 let start = move || async {
481 let op = self.send().await?;
482 Ok(Operation::new(op))
483 };
484
485 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
486 }
487
488 pub fn set_update_mask<T>(mut self, v: T) -> Self
492 where
493 T: std::convert::Into<wkt::FieldMask>,
494 {
495 self.0.request.update_mask = std::option::Option::Some(v.into());
496 self
497 }
498
499 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
503 where
504 T: std::convert::Into<wkt::FieldMask>,
505 {
506 self.0.request.update_mask = v.map(|x| x.into());
507 self
508 }
509
510 pub fn set_connection<T>(mut self, v: T) -> Self
514 where
515 T: std::convert::Into<crate::model::Connection>,
516 {
517 self.0.request.connection = std::option::Option::Some(v.into());
518 self
519 }
520
521 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
525 where
526 T: std::convert::Into<crate::model::Connection>,
527 {
528 self.0.request.connection = v.map(|x| x.into());
529 self
530 }
531
532 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
534 self.0.request.request_id = v.into();
535 self
536 }
537
538 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
540 self.0.request.allow_missing = v.into();
541 self
542 }
543
544 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
546 self.0.request.validate_only = v.into();
547 self
548 }
549 }
550
551 #[doc(hidden)]
552 impl gax::options::internal::RequestBuilder for UpdateConnection {
553 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
554 &mut self.0.options
555 }
556 }
557
558 #[derive(Clone, Debug)]
577 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
578
579 impl DeleteConnection {
580 pub(crate) fn new(
581 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
582 ) -> Self {
583 Self(RequestBuilder::new(stub))
584 }
585
586 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
588 mut self,
589 v: V,
590 ) -> Self {
591 self.0.request = v.into();
592 self
593 }
594
595 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
597 self.0.options = v.into();
598 self
599 }
600
601 pub async fn send(self) -> Result<longrunning::model::Operation> {
608 (*self.0.stub)
609 .delete_connection(self.0.request, self.0.options)
610 .await
611 .map(gax::response::Response::into_body)
612 }
613
614 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
616 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
617 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
618 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
619
620 let stub = self.0.stub.clone();
621 let mut options = self.0.options.clone();
622 options.set_retry_policy(gax::retry_policy::NeverRetry);
623 let query = move |name| {
624 let stub = stub.clone();
625 let options = options.clone();
626 async {
627 let op = GetOperation::new(stub)
628 .set_name(name)
629 .with_options(options)
630 .send()
631 .await?;
632 Ok(Operation::new(op))
633 }
634 };
635
636 let start = move || async {
637 let op = self.send().await?;
638 Ok(Operation::new(op))
639 };
640
641 lro::internal::new_unit_response_poller(
642 polling_error_policy,
643 polling_backoff_policy,
644 start,
645 query,
646 )
647 }
648
649 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
653 self.0.request.name = v.into();
654 self
655 }
656
657 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
659 self.0.request.request_id = v.into();
660 self
661 }
662
663 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
665 self.0.request.validate_only = v.into();
666 self
667 }
668
669 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
671 self.0.request.etag = v.into();
672 self
673 }
674 }
675
676 #[doc(hidden)]
677 impl gax::options::internal::RequestBuilder for DeleteConnection {
678 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
679 &mut self.0.options
680 }
681 }
682
683 #[derive(Clone, Debug)]
702 pub struct CreateGitRepositoryLink(
703 RequestBuilder<crate::model::CreateGitRepositoryLinkRequest>,
704 );
705
706 impl CreateGitRepositoryLink {
707 pub(crate) fn new(
708 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
709 ) -> Self {
710 Self(RequestBuilder::new(stub))
711 }
712
713 pub fn with_request<V: Into<crate::model::CreateGitRepositoryLinkRequest>>(
715 mut self,
716 v: V,
717 ) -> Self {
718 self.0.request = v.into();
719 self
720 }
721
722 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
724 self.0.options = v.into();
725 self
726 }
727
728 pub async fn send(self) -> Result<longrunning::model::Operation> {
735 (*self.0.stub)
736 .create_git_repository_link(self.0.request, self.0.options)
737 .await
738 .map(gax::response::Response::into_body)
739 }
740
741 pub fn poller(
743 self,
744 ) -> impl lro::Poller<crate::model::GitRepositoryLink, crate::model::OperationMetadata>
745 {
746 type Operation = lro::internal::Operation<
747 crate::model::GitRepositoryLink,
748 crate::model::OperationMetadata,
749 >;
750 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
751 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
752
753 let stub = self.0.stub.clone();
754 let mut options = self.0.options.clone();
755 options.set_retry_policy(gax::retry_policy::NeverRetry);
756 let query = move |name| {
757 let stub = stub.clone();
758 let options = options.clone();
759 async {
760 let op = GetOperation::new(stub)
761 .set_name(name)
762 .with_options(options)
763 .send()
764 .await?;
765 Ok(Operation::new(op))
766 }
767 };
768
769 let start = move || async {
770 let op = self.send().await?;
771 Ok(Operation::new(op))
772 };
773
774 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
775 }
776
777 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
781 self.0.request.parent = v.into();
782 self
783 }
784
785 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
789 where
790 T: std::convert::Into<crate::model::GitRepositoryLink>,
791 {
792 self.0.request.git_repository_link = std::option::Option::Some(v.into());
793 self
794 }
795
796 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
800 where
801 T: std::convert::Into<crate::model::GitRepositoryLink>,
802 {
803 self.0.request.git_repository_link = v.map(|x| x.into());
804 self
805 }
806
807 pub fn set_git_repository_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
811 self.0.request.git_repository_link_id = v.into();
812 self
813 }
814
815 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
817 self.0.request.request_id = v.into();
818 self
819 }
820
821 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
823 self.0.request.validate_only = v.into();
824 self
825 }
826 }
827
828 #[doc(hidden)]
829 impl gax::options::internal::RequestBuilder for CreateGitRepositoryLink {
830 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
831 &mut self.0.options
832 }
833 }
834
835 #[derive(Clone, Debug)]
854 pub struct DeleteGitRepositoryLink(
855 RequestBuilder<crate::model::DeleteGitRepositoryLinkRequest>,
856 );
857
858 impl DeleteGitRepositoryLink {
859 pub(crate) fn new(
860 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
861 ) -> Self {
862 Self(RequestBuilder::new(stub))
863 }
864
865 pub fn with_request<V: Into<crate::model::DeleteGitRepositoryLinkRequest>>(
867 mut self,
868 v: V,
869 ) -> Self {
870 self.0.request = v.into();
871 self
872 }
873
874 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
876 self.0.options = v.into();
877 self
878 }
879
880 pub async fn send(self) -> Result<longrunning::model::Operation> {
887 (*self.0.stub)
888 .delete_git_repository_link(self.0.request, self.0.options)
889 .await
890 .map(gax::response::Response::into_body)
891 }
892
893 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
895 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
896 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
897 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
898
899 let stub = self.0.stub.clone();
900 let mut options = self.0.options.clone();
901 options.set_retry_policy(gax::retry_policy::NeverRetry);
902 let query = move |name| {
903 let stub = stub.clone();
904 let options = options.clone();
905 async {
906 let op = GetOperation::new(stub)
907 .set_name(name)
908 .with_options(options)
909 .send()
910 .await?;
911 Ok(Operation::new(op))
912 }
913 };
914
915 let start = move || async {
916 let op = self.send().await?;
917 Ok(Operation::new(op))
918 };
919
920 lro::internal::new_unit_response_poller(
921 polling_error_policy,
922 polling_backoff_policy,
923 start,
924 query,
925 )
926 }
927
928 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
932 self.0.request.name = v.into();
933 self
934 }
935
936 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
938 self.0.request.request_id = v.into();
939 self
940 }
941
942 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
944 self.0.request.validate_only = v.into();
945 self
946 }
947
948 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
950 self.0.request.etag = v.into();
951 self
952 }
953 }
954
955 #[doc(hidden)]
956 impl gax::options::internal::RequestBuilder for DeleteGitRepositoryLink {
957 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
958 &mut self.0.options
959 }
960 }
961
962 #[derive(Clone, Debug)]
984 pub struct ListGitRepositoryLinks(RequestBuilder<crate::model::ListGitRepositoryLinksRequest>);
985
986 impl ListGitRepositoryLinks {
987 pub(crate) fn new(
988 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
989 ) -> Self {
990 Self(RequestBuilder::new(stub))
991 }
992
993 pub fn with_request<V: Into<crate::model::ListGitRepositoryLinksRequest>>(
995 mut self,
996 v: V,
997 ) -> Self {
998 self.0.request = v.into();
999 self
1000 }
1001
1002 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1004 self.0.options = v.into();
1005 self
1006 }
1007
1008 pub async fn send(self) -> Result<crate::model::ListGitRepositoryLinksResponse> {
1010 (*self.0.stub)
1011 .list_git_repository_links(self.0.request, self.0.options)
1012 .await
1013 .map(gax::response::Response::into_body)
1014 }
1015
1016 pub fn by_page(
1018 self,
1019 ) -> impl gax::paginator::Paginator<
1020 crate::model::ListGitRepositoryLinksResponse,
1021 gax::error::Error,
1022 > {
1023 use std::clone::Clone;
1024 let token = self.0.request.page_token.clone();
1025 let execute = move |token: String| {
1026 let mut builder = self.clone();
1027 builder.0.request = builder.0.request.set_page_token(token);
1028 builder.send()
1029 };
1030 gax::paginator::internal::new_paginator(token, execute)
1031 }
1032
1033 pub fn by_item(
1035 self,
1036 ) -> impl gax::paginator::ItemPaginator<
1037 crate::model::ListGitRepositoryLinksResponse,
1038 gax::error::Error,
1039 > {
1040 use gax::paginator::Paginator;
1041 self.by_page().items()
1042 }
1043
1044 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1048 self.0.request.parent = v.into();
1049 self
1050 }
1051
1052 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1054 self.0.request.page_size = v.into();
1055 self
1056 }
1057
1058 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.0.request.page_token = v.into();
1061 self
1062 }
1063
1064 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1066 self.0.request.filter = v.into();
1067 self
1068 }
1069
1070 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.0.request.order_by = v.into();
1073 self
1074 }
1075 }
1076
1077 #[doc(hidden)]
1078 impl gax::options::internal::RequestBuilder for ListGitRepositoryLinks {
1079 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1080 &mut self.0.options
1081 }
1082 }
1083
1084 #[derive(Clone, Debug)]
1102 pub struct GetGitRepositoryLink(RequestBuilder<crate::model::GetGitRepositoryLinkRequest>);
1103
1104 impl GetGitRepositoryLink {
1105 pub(crate) fn new(
1106 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1107 ) -> Self {
1108 Self(RequestBuilder::new(stub))
1109 }
1110
1111 pub fn with_request<V: Into<crate::model::GetGitRepositoryLinkRequest>>(
1113 mut self,
1114 v: V,
1115 ) -> Self {
1116 self.0.request = v.into();
1117 self
1118 }
1119
1120 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1122 self.0.options = v.into();
1123 self
1124 }
1125
1126 pub async fn send(self) -> Result<crate::model::GitRepositoryLink> {
1128 (*self.0.stub)
1129 .get_git_repository_link(self.0.request, self.0.options)
1130 .await
1131 .map(gax::response::Response::into_body)
1132 }
1133
1134 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1138 self.0.request.name = v.into();
1139 self
1140 }
1141 }
1142
1143 #[doc(hidden)]
1144 impl gax::options::internal::RequestBuilder for GetGitRepositoryLink {
1145 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1146 &mut self.0.options
1147 }
1148 }
1149
1150 #[derive(Clone, Debug)]
1168 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1169
1170 impl FetchReadWriteToken {
1171 pub(crate) fn new(
1172 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1173 ) -> Self {
1174 Self(RequestBuilder::new(stub))
1175 }
1176
1177 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1179 mut self,
1180 v: V,
1181 ) -> Self {
1182 self.0.request = v.into();
1183 self
1184 }
1185
1186 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1188 self.0.options = v.into();
1189 self
1190 }
1191
1192 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1194 (*self.0.stub)
1195 .fetch_read_write_token(self.0.request, self.0.options)
1196 .await
1197 .map(gax::response::Response::into_body)
1198 }
1199
1200 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1204 self.0.request.git_repository_link = v.into();
1205 self
1206 }
1207 }
1208
1209 #[doc(hidden)]
1210 impl gax::options::internal::RequestBuilder for FetchReadWriteToken {
1211 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1212 &mut self.0.options
1213 }
1214 }
1215
1216 #[derive(Clone, Debug)]
1234 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1235
1236 impl FetchReadToken {
1237 pub(crate) fn new(
1238 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1239 ) -> Self {
1240 Self(RequestBuilder::new(stub))
1241 }
1242
1243 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1245 self.0.request = v.into();
1246 self
1247 }
1248
1249 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1251 self.0.options = v.into();
1252 self
1253 }
1254
1255 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1257 (*self.0.stub)
1258 .fetch_read_token(self.0.request, self.0.options)
1259 .await
1260 .map(gax::response::Response::into_body)
1261 }
1262
1263 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1267 self.0.request.git_repository_link = v.into();
1268 self
1269 }
1270 }
1271
1272 #[doc(hidden)]
1273 impl gax::options::internal::RequestBuilder for FetchReadToken {
1274 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1275 &mut self.0.options
1276 }
1277 }
1278
1279 #[derive(Clone, Debug)]
1301 pub struct FetchLinkableGitRepositories(
1302 RequestBuilder<crate::model::FetchLinkableGitRepositoriesRequest>,
1303 );
1304
1305 impl FetchLinkableGitRepositories {
1306 pub(crate) fn new(
1307 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1308 ) -> Self {
1309 Self(RequestBuilder::new(stub))
1310 }
1311
1312 pub fn with_request<V: Into<crate::model::FetchLinkableGitRepositoriesRequest>>(
1314 mut self,
1315 v: V,
1316 ) -> Self {
1317 self.0.request = v.into();
1318 self
1319 }
1320
1321 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1323 self.0.options = v.into();
1324 self
1325 }
1326
1327 pub async fn send(self) -> Result<crate::model::FetchLinkableGitRepositoriesResponse> {
1329 (*self.0.stub)
1330 .fetch_linkable_git_repositories(self.0.request, self.0.options)
1331 .await
1332 .map(gax::response::Response::into_body)
1333 }
1334
1335 pub fn by_page(
1337 self,
1338 ) -> impl gax::paginator::Paginator<
1339 crate::model::FetchLinkableGitRepositoriesResponse,
1340 gax::error::Error,
1341 > {
1342 use std::clone::Clone;
1343 let token = self.0.request.page_token.clone();
1344 let execute = move |token: String| {
1345 let mut builder = self.clone();
1346 builder.0.request = builder.0.request.set_page_token(token);
1347 builder.send()
1348 };
1349 gax::paginator::internal::new_paginator(token, execute)
1350 }
1351
1352 pub fn by_item(
1354 self,
1355 ) -> impl gax::paginator::ItemPaginator<
1356 crate::model::FetchLinkableGitRepositoriesResponse,
1357 gax::error::Error,
1358 > {
1359 use gax::paginator::Paginator;
1360 self.by_page().items()
1361 }
1362
1363 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1367 self.0.request.connection = v.into();
1368 self
1369 }
1370
1371 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1373 self.0.request.page_size = v.into();
1374 self
1375 }
1376
1377 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1379 self.0.request.page_token = v.into();
1380 self
1381 }
1382 }
1383
1384 #[doc(hidden)]
1385 impl gax::options::internal::RequestBuilder for FetchLinkableGitRepositories {
1386 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1387 &mut self.0.options
1388 }
1389 }
1390
1391 #[derive(Clone, Debug)]
1409 pub struct FetchGitHubInstallations(
1410 RequestBuilder<crate::model::FetchGitHubInstallationsRequest>,
1411 );
1412
1413 impl FetchGitHubInstallations {
1414 pub(crate) fn new(
1415 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1416 ) -> Self {
1417 Self(RequestBuilder::new(stub))
1418 }
1419
1420 pub fn with_request<V: Into<crate::model::FetchGitHubInstallationsRequest>>(
1422 mut self,
1423 v: V,
1424 ) -> Self {
1425 self.0.request = v.into();
1426 self
1427 }
1428
1429 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1431 self.0.options = v.into();
1432 self
1433 }
1434
1435 pub async fn send(self) -> Result<crate::model::FetchGitHubInstallationsResponse> {
1437 (*self.0.stub)
1438 .fetch_git_hub_installations(self.0.request, self.0.options)
1439 .await
1440 .map(gax::response::Response::into_body)
1441 }
1442
1443 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1447 self.0.request.connection = v.into();
1448 self
1449 }
1450 }
1451
1452 #[doc(hidden)]
1453 impl gax::options::internal::RequestBuilder for FetchGitHubInstallations {
1454 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1455 &mut self.0.options
1456 }
1457 }
1458
1459 #[derive(Clone, Debug)]
1477 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1478
1479 impl FetchGitRefs {
1480 pub(crate) fn new(
1481 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1482 ) -> Self {
1483 Self(RequestBuilder::new(stub))
1484 }
1485
1486 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1488 self.0.request = v.into();
1489 self
1490 }
1491
1492 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1494 self.0.options = v.into();
1495 self
1496 }
1497
1498 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1500 (*self.0.stub)
1501 .fetch_git_refs(self.0.request, self.0.options)
1502 .await
1503 .map(gax::response::Response::into_body)
1504 }
1505
1506 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1510 self.0.request.git_repository_link = v.into();
1511 self
1512 }
1513
1514 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1518 mut self,
1519 v: T,
1520 ) -> Self {
1521 self.0.request.ref_type = v.into();
1522 self
1523 }
1524
1525 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1527 self.0.request.page_size = v.into();
1528 self
1529 }
1530
1531 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1533 self.0.request.page_token = v.into();
1534 self
1535 }
1536 }
1537
1538 #[doc(hidden)]
1539 impl gax::options::internal::RequestBuilder for FetchGitRefs {
1540 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1541 &mut self.0.options
1542 }
1543 }
1544
1545 #[derive(Clone, Debug)]
1567 pub struct ListAccountConnectors(RequestBuilder<crate::model::ListAccountConnectorsRequest>);
1568
1569 impl ListAccountConnectors {
1570 pub(crate) fn new(
1571 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1572 ) -> Self {
1573 Self(RequestBuilder::new(stub))
1574 }
1575
1576 pub fn with_request<V: Into<crate::model::ListAccountConnectorsRequest>>(
1578 mut self,
1579 v: V,
1580 ) -> Self {
1581 self.0.request = v.into();
1582 self
1583 }
1584
1585 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1587 self.0.options = v.into();
1588 self
1589 }
1590
1591 pub async fn send(self) -> Result<crate::model::ListAccountConnectorsResponse> {
1593 (*self.0.stub)
1594 .list_account_connectors(self.0.request, self.0.options)
1595 .await
1596 .map(gax::response::Response::into_body)
1597 }
1598
1599 pub fn by_page(
1601 self,
1602 ) -> impl gax::paginator::Paginator<crate::model::ListAccountConnectorsResponse, gax::error::Error>
1603 {
1604 use std::clone::Clone;
1605 let token = self.0.request.page_token.clone();
1606 let execute = move |token: String| {
1607 let mut builder = self.clone();
1608 builder.0.request = builder.0.request.set_page_token(token);
1609 builder.send()
1610 };
1611 gax::paginator::internal::new_paginator(token, execute)
1612 }
1613
1614 pub fn by_item(
1616 self,
1617 ) -> impl gax::paginator::ItemPaginator<
1618 crate::model::ListAccountConnectorsResponse,
1619 gax::error::Error,
1620 > {
1621 use gax::paginator::Paginator;
1622 self.by_page().items()
1623 }
1624
1625 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1629 self.0.request.parent = v.into();
1630 self
1631 }
1632
1633 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1635 self.0.request.page_size = v.into();
1636 self
1637 }
1638
1639 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641 self.0.request.page_token = v.into();
1642 self
1643 }
1644
1645 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1647 self.0.request.filter = v.into();
1648 self
1649 }
1650
1651 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1653 self.0.request.order_by = v.into();
1654 self
1655 }
1656 }
1657
1658 #[doc(hidden)]
1659 impl gax::options::internal::RequestBuilder for ListAccountConnectors {
1660 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1661 &mut self.0.options
1662 }
1663 }
1664
1665 #[derive(Clone, Debug)]
1683 pub struct GetAccountConnector(RequestBuilder<crate::model::GetAccountConnectorRequest>);
1684
1685 impl GetAccountConnector {
1686 pub(crate) fn new(
1687 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1688 ) -> Self {
1689 Self(RequestBuilder::new(stub))
1690 }
1691
1692 pub fn with_request<V: Into<crate::model::GetAccountConnectorRequest>>(
1694 mut self,
1695 v: V,
1696 ) -> Self {
1697 self.0.request = v.into();
1698 self
1699 }
1700
1701 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1703 self.0.options = v.into();
1704 self
1705 }
1706
1707 pub async fn send(self) -> Result<crate::model::AccountConnector> {
1709 (*self.0.stub)
1710 .get_account_connector(self.0.request, self.0.options)
1711 .await
1712 .map(gax::response::Response::into_body)
1713 }
1714
1715 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1719 self.0.request.name = v.into();
1720 self
1721 }
1722 }
1723
1724 #[doc(hidden)]
1725 impl gax::options::internal::RequestBuilder for GetAccountConnector {
1726 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1727 &mut self.0.options
1728 }
1729 }
1730
1731 #[derive(Clone, Debug)]
1750 pub struct CreateAccountConnector(RequestBuilder<crate::model::CreateAccountConnectorRequest>);
1751
1752 impl CreateAccountConnector {
1753 pub(crate) fn new(
1754 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1755 ) -> Self {
1756 Self(RequestBuilder::new(stub))
1757 }
1758
1759 pub fn with_request<V: Into<crate::model::CreateAccountConnectorRequest>>(
1761 mut self,
1762 v: V,
1763 ) -> Self {
1764 self.0.request = v.into();
1765 self
1766 }
1767
1768 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1770 self.0.options = v.into();
1771 self
1772 }
1773
1774 pub async fn send(self) -> Result<longrunning::model::Operation> {
1781 (*self.0.stub)
1782 .create_account_connector(self.0.request, self.0.options)
1783 .await
1784 .map(gax::response::Response::into_body)
1785 }
1786
1787 pub fn poller(
1789 self,
1790 ) -> impl lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1791 {
1792 type Operation = lro::internal::Operation<
1793 crate::model::AccountConnector,
1794 crate::model::OperationMetadata,
1795 >;
1796 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1797 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1798
1799 let stub = self.0.stub.clone();
1800 let mut options = self.0.options.clone();
1801 options.set_retry_policy(gax::retry_policy::NeverRetry);
1802 let query = move |name| {
1803 let stub = stub.clone();
1804 let options = options.clone();
1805 async {
1806 let op = GetOperation::new(stub)
1807 .set_name(name)
1808 .with_options(options)
1809 .send()
1810 .await?;
1811 Ok(Operation::new(op))
1812 }
1813 };
1814
1815 let start = move || async {
1816 let op = self.send().await?;
1817 Ok(Operation::new(op))
1818 };
1819
1820 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1821 }
1822
1823 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1827 self.0.request.parent = v.into();
1828 self
1829 }
1830
1831 pub fn set_account_connector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1835 self.0.request.account_connector_id = v.into();
1836 self
1837 }
1838
1839 pub fn set_account_connector<T>(mut self, v: T) -> Self
1843 where
1844 T: std::convert::Into<crate::model::AccountConnector>,
1845 {
1846 self.0.request.account_connector = std::option::Option::Some(v.into());
1847 self
1848 }
1849
1850 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
1854 where
1855 T: std::convert::Into<crate::model::AccountConnector>,
1856 {
1857 self.0.request.account_connector = v.map(|x| x.into());
1858 self
1859 }
1860
1861 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1863 self.0.request.request_id = v.into();
1864 self
1865 }
1866
1867 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1869 self.0.request.validate_only = v.into();
1870 self
1871 }
1872 }
1873
1874 #[doc(hidden)]
1875 impl gax::options::internal::RequestBuilder for CreateAccountConnector {
1876 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1877 &mut self.0.options
1878 }
1879 }
1880
1881 #[derive(Clone, Debug)]
1900 pub struct UpdateAccountConnector(RequestBuilder<crate::model::UpdateAccountConnectorRequest>);
1901
1902 impl UpdateAccountConnector {
1903 pub(crate) fn new(
1904 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1905 ) -> Self {
1906 Self(RequestBuilder::new(stub))
1907 }
1908
1909 pub fn with_request<V: Into<crate::model::UpdateAccountConnectorRequest>>(
1911 mut self,
1912 v: V,
1913 ) -> Self {
1914 self.0.request = v.into();
1915 self
1916 }
1917
1918 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1920 self.0.options = v.into();
1921 self
1922 }
1923
1924 pub async fn send(self) -> Result<longrunning::model::Operation> {
1931 (*self.0.stub)
1932 .update_account_connector(self.0.request, self.0.options)
1933 .await
1934 .map(gax::response::Response::into_body)
1935 }
1936
1937 pub fn poller(
1939 self,
1940 ) -> impl lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1941 {
1942 type Operation = lro::internal::Operation<
1943 crate::model::AccountConnector,
1944 crate::model::OperationMetadata,
1945 >;
1946 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1947 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1948
1949 let stub = self.0.stub.clone();
1950 let mut options = self.0.options.clone();
1951 options.set_retry_policy(gax::retry_policy::NeverRetry);
1952 let query = move |name| {
1953 let stub = stub.clone();
1954 let options = options.clone();
1955 async {
1956 let op = GetOperation::new(stub)
1957 .set_name(name)
1958 .with_options(options)
1959 .send()
1960 .await?;
1961 Ok(Operation::new(op))
1962 }
1963 };
1964
1965 let start = move || async {
1966 let op = self.send().await?;
1967 Ok(Operation::new(op))
1968 };
1969
1970 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1971 }
1972
1973 pub fn set_update_mask<T>(mut self, v: T) -> Self
1975 where
1976 T: std::convert::Into<wkt::FieldMask>,
1977 {
1978 self.0.request.update_mask = std::option::Option::Some(v.into());
1979 self
1980 }
1981
1982 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1984 where
1985 T: std::convert::Into<wkt::FieldMask>,
1986 {
1987 self.0.request.update_mask = v.map(|x| x.into());
1988 self
1989 }
1990
1991 pub fn set_account_connector<T>(mut self, v: T) -> Self
1995 where
1996 T: std::convert::Into<crate::model::AccountConnector>,
1997 {
1998 self.0.request.account_connector = std::option::Option::Some(v.into());
1999 self
2000 }
2001
2002 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
2006 where
2007 T: std::convert::Into<crate::model::AccountConnector>,
2008 {
2009 self.0.request.account_connector = v.map(|x| x.into());
2010 self
2011 }
2012
2013 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2015 self.0.request.request_id = v.into();
2016 self
2017 }
2018
2019 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2021 self.0.request.allow_missing = v.into();
2022 self
2023 }
2024
2025 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2027 self.0.request.validate_only = v.into();
2028 self
2029 }
2030 }
2031
2032 #[doc(hidden)]
2033 impl gax::options::internal::RequestBuilder for UpdateAccountConnector {
2034 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2035 &mut self.0.options
2036 }
2037 }
2038
2039 #[derive(Clone, Debug)]
2058 pub struct DeleteAccountConnector(RequestBuilder<crate::model::DeleteAccountConnectorRequest>);
2059
2060 impl DeleteAccountConnector {
2061 pub(crate) fn new(
2062 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2063 ) -> Self {
2064 Self(RequestBuilder::new(stub))
2065 }
2066
2067 pub fn with_request<V: Into<crate::model::DeleteAccountConnectorRequest>>(
2069 mut self,
2070 v: V,
2071 ) -> Self {
2072 self.0.request = v.into();
2073 self
2074 }
2075
2076 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2078 self.0.options = v.into();
2079 self
2080 }
2081
2082 pub async fn send(self) -> Result<longrunning::model::Operation> {
2089 (*self.0.stub)
2090 .delete_account_connector(self.0.request, self.0.options)
2091 .await
2092 .map(gax::response::Response::into_body)
2093 }
2094
2095 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2097 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2098 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2099 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2100
2101 let stub = self.0.stub.clone();
2102 let mut options = self.0.options.clone();
2103 options.set_retry_policy(gax::retry_policy::NeverRetry);
2104 let query = move |name| {
2105 let stub = stub.clone();
2106 let options = options.clone();
2107 async {
2108 let op = GetOperation::new(stub)
2109 .set_name(name)
2110 .with_options(options)
2111 .send()
2112 .await?;
2113 Ok(Operation::new(op))
2114 }
2115 };
2116
2117 let start = move || async {
2118 let op = self.send().await?;
2119 Ok(Operation::new(op))
2120 };
2121
2122 lro::internal::new_unit_response_poller(
2123 polling_error_policy,
2124 polling_backoff_policy,
2125 start,
2126 query,
2127 )
2128 }
2129
2130 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2134 self.0.request.name = v.into();
2135 self
2136 }
2137
2138 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2140 self.0.request.request_id = v.into();
2141 self
2142 }
2143
2144 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2146 self.0.request.validate_only = v.into();
2147 self
2148 }
2149
2150 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2152 self.0.request.etag = v.into();
2153 self
2154 }
2155
2156 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2158 self.0.request.force = v.into();
2159 self
2160 }
2161 }
2162
2163 #[doc(hidden)]
2164 impl gax::options::internal::RequestBuilder for DeleteAccountConnector {
2165 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2166 &mut self.0.options
2167 }
2168 }
2169
2170 #[derive(Clone, Debug)]
2188 pub struct FetchAccessToken(RequestBuilder<crate::model::FetchAccessTokenRequest>);
2189
2190 impl FetchAccessToken {
2191 pub(crate) fn new(
2192 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2193 ) -> Self {
2194 Self(RequestBuilder::new(stub))
2195 }
2196
2197 pub fn with_request<V: Into<crate::model::FetchAccessTokenRequest>>(
2199 mut self,
2200 v: V,
2201 ) -> Self {
2202 self.0.request = v.into();
2203 self
2204 }
2205
2206 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2208 self.0.options = v.into();
2209 self
2210 }
2211
2212 pub async fn send(self) -> Result<crate::model::FetchAccessTokenResponse> {
2214 (*self.0.stub)
2215 .fetch_access_token(self.0.request, self.0.options)
2216 .await
2217 .map(gax::response::Response::into_body)
2218 }
2219
2220 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2224 self.0.request.account_connector = v.into();
2225 self
2226 }
2227 }
2228
2229 #[doc(hidden)]
2230 impl gax::options::internal::RequestBuilder for FetchAccessToken {
2231 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2232 &mut self.0.options
2233 }
2234 }
2235
2236 #[derive(Clone, Debug)]
2258 pub struct ListUsers(RequestBuilder<crate::model::ListUsersRequest>);
2259
2260 impl ListUsers {
2261 pub(crate) fn new(
2262 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2263 ) -> Self {
2264 Self(RequestBuilder::new(stub))
2265 }
2266
2267 pub fn with_request<V: Into<crate::model::ListUsersRequest>>(mut self, v: V) -> Self {
2269 self.0.request = v.into();
2270 self
2271 }
2272
2273 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2275 self.0.options = v.into();
2276 self
2277 }
2278
2279 pub async fn send(self) -> Result<crate::model::ListUsersResponse> {
2281 (*self.0.stub)
2282 .list_users(self.0.request, self.0.options)
2283 .await
2284 .map(gax::response::Response::into_body)
2285 }
2286
2287 pub fn by_page(
2289 self,
2290 ) -> impl gax::paginator::Paginator<crate::model::ListUsersResponse, gax::error::Error>
2291 {
2292 use std::clone::Clone;
2293 let token = self.0.request.page_token.clone();
2294 let execute = move |token: String| {
2295 let mut builder = self.clone();
2296 builder.0.request = builder.0.request.set_page_token(token);
2297 builder.send()
2298 };
2299 gax::paginator::internal::new_paginator(token, execute)
2300 }
2301
2302 pub fn by_item(
2304 self,
2305 ) -> impl gax::paginator::ItemPaginator<crate::model::ListUsersResponse, gax::error::Error>
2306 {
2307 use gax::paginator::Paginator;
2308 self.by_page().items()
2309 }
2310
2311 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2315 self.0.request.parent = v.into();
2316 self
2317 }
2318
2319 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2321 self.0.request.page_size = v.into();
2322 self
2323 }
2324
2325 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2327 self.0.request.page_token = v.into();
2328 self
2329 }
2330
2331 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2333 self.0.request.filter = v.into();
2334 self
2335 }
2336
2337 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2339 self.0.request.order_by = v.into();
2340 self
2341 }
2342 }
2343
2344 #[doc(hidden)]
2345 impl gax::options::internal::RequestBuilder for ListUsers {
2346 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2347 &mut self.0.options
2348 }
2349 }
2350
2351 #[derive(Clone, Debug)]
2370 pub struct DeleteUser(RequestBuilder<crate::model::DeleteUserRequest>);
2371
2372 impl DeleteUser {
2373 pub(crate) fn new(
2374 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2375 ) -> Self {
2376 Self(RequestBuilder::new(stub))
2377 }
2378
2379 pub fn with_request<V: Into<crate::model::DeleteUserRequest>>(mut self, v: V) -> Self {
2381 self.0.request = v.into();
2382 self
2383 }
2384
2385 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2387 self.0.options = v.into();
2388 self
2389 }
2390
2391 pub async fn send(self) -> Result<longrunning::model::Operation> {
2398 (*self.0.stub)
2399 .delete_user(self.0.request, self.0.options)
2400 .await
2401 .map(gax::response::Response::into_body)
2402 }
2403
2404 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2406 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2407 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2408 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2409
2410 let stub = self.0.stub.clone();
2411 let mut options = self.0.options.clone();
2412 options.set_retry_policy(gax::retry_policy::NeverRetry);
2413 let query = move |name| {
2414 let stub = stub.clone();
2415 let options = options.clone();
2416 async {
2417 let op = GetOperation::new(stub)
2418 .set_name(name)
2419 .with_options(options)
2420 .send()
2421 .await?;
2422 Ok(Operation::new(op))
2423 }
2424 };
2425
2426 let start = move || async {
2427 let op = self.send().await?;
2428 Ok(Operation::new(op))
2429 };
2430
2431 lro::internal::new_unit_response_poller(
2432 polling_error_policy,
2433 polling_backoff_policy,
2434 start,
2435 query,
2436 )
2437 }
2438
2439 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2443 self.0.request.name = v.into();
2444 self
2445 }
2446
2447 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2449 self.0.request.request_id = v.into();
2450 self
2451 }
2452
2453 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2455 self.0.request.validate_only = v.into();
2456 self
2457 }
2458
2459 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2461 self.0.request.etag = v.into();
2462 self
2463 }
2464 }
2465
2466 #[doc(hidden)]
2467 impl gax::options::internal::RequestBuilder for DeleteUser {
2468 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2469 &mut self.0.options
2470 }
2471 }
2472
2473 #[derive(Clone, Debug)]
2491 pub struct FetchSelf(RequestBuilder<crate::model::FetchSelfRequest>);
2492
2493 impl FetchSelf {
2494 pub(crate) fn new(
2495 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2496 ) -> Self {
2497 Self(RequestBuilder::new(stub))
2498 }
2499
2500 pub fn with_request<V: Into<crate::model::FetchSelfRequest>>(mut self, v: V) -> Self {
2502 self.0.request = v.into();
2503 self
2504 }
2505
2506 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2508 self.0.options = v.into();
2509 self
2510 }
2511
2512 pub async fn send(self) -> Result<crate::model::User> {
2514 (*self.0.stub)
2515 .fetch_self(self.0.request, self.0.options)
2516 .await
2517 .map(gax::response::Response::into_body)
2518 }
2519
2520 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2524 self.0.request.name = v.into();
2525 self
2526 }
2527 }
2528
2529 #[doc(hidden)]
2530 impl gax::options::internal::RequestBuilder for FetchSelf {
2531 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2532 &mut self.0.options
2533 }
2534 }
2535
2536 #[derive(Clone, Debug)]
2555 pub struct DeleteSelf(RequestBuilder<crate::model::DeleteSelfRequest>);
2556
2557 impl DeleteSelf {
2558 pub(crate) fn new(
2559 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2560 ) -> Self {
2561 Self(RequestBuilder::new(stub))
2562 }
2563
2564 pub fn with_request<V: Into<crate::model::DeleteSelfRequest>>(mut self, v: V) -> Self {
2566 self.0.request = v.into();
2567 self
2568 }
2569
2570 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2572 self.0.options = v.into();
2573 self
2574 }
2575
2576 pub async fn send(self) -> Result<longrunning::model::Operation> {
2583 (*self.0.stub)
2584 .delete_self(self.0.request, self.0.options)
2585 .await
2586 .map(gax::response::Response::into_body)
2587 }
2588
2589 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2591 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2592 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2593 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2594
2595 let stub = self.0.stub.clone();
2596 let mut options = self.0.options.clone();
2597 options.set_retry_policy(gax::retry_policy::NeverRetry);
2598 let query = move |name| {
2599 let stub = stub.clone();
2600 let options = options.clone();
2601 async {
2602 let op = GetOperation::new(stub)
2603 .set_name(name)
2604 .with_options(options)
2605 .send()
2606 .await?;
2607 Ok(Operation::new(op))
2608 }
2609 };
2610
2611 let start = move || async {
2612 let op = self.send().await?;
2613 Ok(Operation::new(op))
2614 };
2615
2616 lro::internal::new_unit_response_poller(
2617 polling_error_policy,
2618 polling_backoff_policy,
2619 start,
2620 query,
2621 )
2622 }
2623
2624 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2628 self.0.request.name = v.into();
2629 self
2630 }
2631 }
2632
2633 #[doc(hidden)]
2634 impl gax::options::internal::RequestBuilder for DeleteSelf {
2635 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2636 &mut self.0.options
2637 }
2638 }
2639
2640 #[derive(Clone, Debug)]
2662 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2663
2664 impl ListLocations {
2665 pub(crate) fn new(
2666 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2667 ) -> Self {
2668 Self(RequestBuilder::new(stub))
2669 }
2670
2671 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2673 mut self,
2674 v: V,
2675 ) -> Self {
2676 self.0.request = v.into();
2677 self
2678 }
2679
2680 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2682 self.0.options = v.into();
2683 self
2684 }
2685
2686 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2688 (*self.0.stub)
2689 .list_locations(self.0.request, self.0.options)
2690 .await
2691 .map(gax::response::Response::into_body)
2692 }
2693
2694 pub fn by_page(
2696 self,
2697 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2698 {
2699 use std::clone::Clone;
2700 let token = self.0.request.page_token.clone();
2701 let execute = move |token: String| {
2702 let mut builder = self.clone();
2703 builder.0.request = builder.0.request.set_page_token(token);
2704 builder.send()
2705 };
2706 gax::paginator::internal::new_paginator(token, execute)
2707 }
2708
2709 pub fn by_item(
2711 self,
2712 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2713 {
2714 use gax::paginator::Paginator;
2715 self.by_page().items()
2716 }
2717
2718 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2720 self.0.request.name = v.into();
2721 self
2722 }
2723
2724 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2726 self.0.request.filter = v.into();
2727 self
2728 }
2729
2730 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2732 self.0.request.page_size = v.into();
2733 self
2734 }
2735
2736 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2738 self.0.request.page_token = v.into();
2739 self
2740 }
2741 }
2742
2743 #[doc(hidden)]
2744 impl gax::options::internal::RequestBuilder for ListLocations {
2745 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2746 &mut self.0.options
2747 }
2748 }
2749
2750 #[derive(Clone, Debug)]
2768 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2769
2770 impl GetLocation {
2771 pub(crate) fn new(
2772 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2773 ) -> Self {
2774 Self(RequestBuilder::new(stub))
2775 }
2776
2777 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2779 self.0.request = v.into();
2780 self
2781 }
2782
2783 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2785 self.0.options = v.into();
2786 self
2787 }
2788
2789 pub async fn send(self) -> Result<location::model::Location> {
2791 (*self.0.stub)
2792 .get_location(self.0.request, self.0.options)
2793 .await
2794 .map(gax::response::Response::into_body)
2795 }
2796
2797 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2799 self.0.request.name = v.into();
2800 self
2801 }
2802 }
2803
2804 #[doc(hidden)]
2805 impl gax::options::internal::RequestBuilder for GetLocation {
2806 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2807 &mut self.0.options
2808 }
2809 }
2810
2811 #[derive(Clone, Debug)]
2833 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2834
2835 impl ListOperations {
2836 pub(crate) fn new(
2837 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2838 ) -> Self {
2839 Self(RequestBuilder::new(stub))
2840 }
2841
2842 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2844 mut self,
2845 v: V,
2846 ) -> Self {
2847 self.0.request = v.into();
2848 self
2849 }
2850
2851 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2853 self.0.options = v.into();
2854 self
2855 }
2856
2857 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2859 (*self.0.stub)
2860 .list_operations(self.0.request, self.0.options)
2861 .await
2862 .map(gax::response::Response::into_body)
2863 }
2864
2865 pub fn by_page(
2867 self,
2868 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2869 {
2870 use std::clone::Clone;
2871 let token = self.0.request.page_token.clone();
2872 let execute = move |token: String| {
2873 let mut builder = self.clone();
2874 builder.0.request = builder.0.request.set_page_token(token);
2875 builder.send()
2876 };
2877 gax::paginator::internal::new_paginator(token, execute)
2878 }
2879
2880 pub fn by_item(
2882 self,
2883 ) -> impl gax::paginator::ItemPaginator<
2884 longrunning::model::ListOperationsResponse,
2885 gax::error::Error,
2886 > {
2887 use gax::paginator::Paginator;
2888 self.by_page().items()
2889 }
2890
2891 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893 self.0.request.name = v.into();
2894 self
2895 }
2896
2897 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2899 self.0.request.filter = v.into();
2900 self
2901 }
2902
2903 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2905 self.0.request.page_size = v.into();
2906 self
2907 }
2908
2909 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2911 self.0.request.page_token = v.into();
2912 self
2913 }
2914 }
2915
2916 #[doc(hidden)]
2917 impl gax::options::internal::RequestBuilder for ListOperations {
2918 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2919 &mut self.0.options
2920 }
2921 }
2922
2923 #[derive(Clone, Debug)]
2941 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2942
2943 impl GetOperation {
2944 pub(crate) fn new(
2945 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2946 ) -> Self {
2947 Self(RequestBuilder::new(stub))
2948 }
2949
2950 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2952 mut self,
2953 v: V,
2954 ) -> Self {
2955 self.0.request = v.into();
2956 self
2957 }
2958
2959 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2961 self.0.options = v.into();
2962 self
2963 }
2964
2965 pub async fn send(self) -> Result<longrunning::model::Operation> {
2967 (*self.0.stub)
2968 .get_operation(self.0.request, self.0.options)
2969 .await
2970 .map(gax::response::Response::into_body)
2971 }
2972
2973 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2975 self.0.request.name = v.into();
2976 self
2977 }
2978 }
2979
2980 #[doc(hidden)]
2981 impl gax::options::internal::RequestBuilder for GetOperation {
2982 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2983 &mut self.0.options
2984 }
2985 }
2986
2987 #[derive(Clone, Debug)]
3005 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3006
3007 impl DeleteOperation {
3008 pub(crate) fn new(
3009 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3010 ) -> Self {
3011 Self(RequestBuilder::new(stub))
3012 }
3013
3014 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3016 mut self,
3017 v: V,
3018 ) -> Self {
3019 self.0.request = v.into();
3020 self
3021 }
3022
3023 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3025 self.0.options = v.into();
3026 self
3027 }
3028
3029 pub async fn send(self) -> Result<()> {
3031 (*self.0.stub)
3032 .delete_operation(self.0.request, self.0.options)
3033 .await
3034 .map(gax::response::Response::into_body)
3035 }
3036
3037 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3039 self.0.request.name = v.into();
3040 self
3041 }
3042 }
3043
3044 #[doc(hidden)]
3045 impl gax::options::internal::RequestBuilder for DeleteOperation {
3046 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3047 &mut self.0.options
3048 }
3049 }
3050
3051 #[derive(Clone, Debug)]
3069 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3070
3071 impl CancelOperation {
3072 pub(crate) fn new(
3073 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3074 ) -> Self {
3075 Self(RequestBuilder::new(stub))
3076 }
3077
3078 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3080 mut self,
3081 v: V,
3082 ) -> Self {
3083 self.0.request = v.into();
3084 self
3085 }
3086
3087 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3089 self.0.options = v.into();
3090 self
3091 }
3092
3093 pub async fn send(self) -> Result<()> {
3095 (*self.0.stub)
3096 .cancel_operation(self.0.request, self.0.options)
3097 .await
3098 .map(gax::response::Response::into_body)
3099 }
3100
3101 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3103 self.0.request.name = v.into();
3104 self
3105 }
3106 }
3107
3108 #[doc(hidden)]
3109 impl gax::options::internal::RequestBuilder for CancelOperation {
3110 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3111 &mut self.0.options
3112 }
3113 }
3114}
3115
3116pub mod insights_config_service {
3117 use crate::Result;
3118
3119 pub type ClientBuilder =
3133 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3134
3135 pub(crate) mod client {
3136 use super::super::super::client::InsightsConfigService;
3137 pub struct Factory;
3138 impl gax::client_builder::internal::ClientFactory for Factory {
3139 type Client = InsightsConfigService;
3140 type Credentials = gaxi::options::Credentials;
3141 async fn build(
3142 self,
3143 config: gaxi::options::ClientConfig,
3144 ) -> gax::client_builder::Result<Self::Client> {
3145 Self::Client::new(config).await
3146 }
3147 }
3148 }
3149
3150 #[derive(Clone, Debug)]
3152 pub(crate) struct RequestBuilder<R: std::default::Default> {
3153 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3154 request: R,
3155 options: gax::options::RequestOptions,
3156 }
3157
3158 impl<R> RequestBuilder<R>
3159 where
3160 R: std::default::Default,
3161 {
3162 pub(crate) fn new(
3163 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3164 ) -> Self {
3165 Self {
3166 stub,
3167 request: R::default(),
3168 options: gax::options::RequestOptions::default(),
3169 }
3170 }
3171 }
3172
3173 #[derive(Clone, Debug)]
3195 pub struct ListInsightsConfigs(RequestBuilder<crate::model::ListInsightsConfigsRequest>);
3196
3197 impl ListInsightsConfigs {
3198 pub(crate) fn new(
3199 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3200 ) -> Self {
3201 Self(RequestBuilder::new(stub))
3202 }
3203
3204 pub fn with_request<V: Into<crate::model::ListInsightsConfigsRequest>>(
3206 mut self,
3207 v: V,
3208 ) -> Self {
3209 self.0.request = v.into();
3210 self
3211 }
3212
3213 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3215 self.0.options = v.into();
3216 self
3217 }
3218
3219 pub async fn send(self) -> Result<crate::model::ListInsightsConfigsResponse> {
3221 (*self.0.stub)
3222 .list_insights_configs(self.0.request, self.0.options)
3223 .await
3224 .map(gax::response::Response::into_body)
3225 }
3226
3227 pub fn by_page(
3229 self,
3230 ) -> impl gax::paginator::Paginator<crate::model::ListInsightsConfigsResponse, gax::error::Error>
3231 {
3232 use std::clone::Clone;
3233 let token = self.0.request.page_token.clone();
3234 let execute = move |token: String| {
3235 let mut builder = self.clone();
3236 builder.0.request = builder.0.request.set_page_token(token);
3237 builder.send()
3238 };
3239 gax::paginator::internal::new_paginator(token, execute)
3240 }
3241
3242 pub fn by_item(
3244 self,
3245 ) -> impl gax::paginator::ItemPaginator<
3246 crate::model::ListInsightsConfigsResponse,
3247 gax::error::Error,
3248 > {
3249 use gax::paginator::Paginator;
3250 self.by_page().items()
3251 }
3252
3253 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3257 self.0.request.parent = v.into();
3258 self
3259 }
3260
3261 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3263 self.0.request.page_size = v.into();
3264 self
3265 }
3266
3267 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3269 self.0.request.page_token = v.into();
3270 self
3271 }
3272
3273 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3275 self.0.request.filter = v.into();
3276 self
3277 }
3278
3279 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3281 self.0.request.order_by = v.into();
3282 self
3283 }
3284 }
3285
3286 #[doc(hidden)]
3287 impl gax::options::internal::RequestBuilder for ListInsightsConfigs {
3288 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3289 &mut self.0.options
3290 }
3291 }
3292
3293 #[derive(Clone, Debug)]
3312 pub struct CreateInsightsConfig(RequestBuilder<crate::model::CreateInsightsConfigRequest>);
3313
3314 impl CreateInsightsConfig {
3315 pub(crate) fn new(
3316 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3317 ) -> Self {
3318 Self(RequestBuilder::new(stub))
3319 }
3320
3321 pub fn with_request<V: Into<crate::model::CreateInsightsConfigRequest>>(
3323 mut self,
3324 v: V,
3325 ) -> Self {
3326 self.0.request = v.into();
3327 self
3328 }
3329
3330 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3332 self.0.options = v.into();
3333 self
3334 }
3335
3336 pub async fn send(self) -> Result<longrunning::model::Operation> {
3343 (*self.0.stub)
3344 .create_insights_config(self.0.request, self.0.options)
3345 .await
3346 .map(gax::response::Response::into_body)
3347 }
3348
3349 pub fn poller(
3351 self,
3352 ) -> impl lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3353 {
3354 type Operation = lro::internal::Operation<
3355 crate::model::InsightsConfig,
3356 crate::model::OperationMetadata,
3357 >;
3358 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3359 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3360
3361 let stub = self.0.stub.clone();
3362 let mut options = self.0.options.clone();
3363 options.set_retry_policy(gax::retry_policy::NeverRetry);
3364 let query = move |name| {
3365 let stub = stub.clone();
3366 let options = options.clone();
3367 async {
3368 let op = GetOperation::new(stub)
3369 .set_name(name)
3370 .with_options(options)
3371 .send()
3372 .await?;
3373 Ok(Operation::new(op))
3374 }
3375 };
3376
3377 let start = move || async {
3378 let op = self.send().await?;
3379 Ok(Operation::new(op))
3380 };
3381
3382 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3383 }
3384
3385 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3389 self.0.request.parent = v.into();
3390 self
3391 }
3392
3393 pub fn set_insights_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3397 self.0.request.insights_config_id = v.into();
3398 self
3399 }
3400
3401 pub fn set_insights_config<T>(mut self, v: T) -> Self
3405 where
3406 T: std::convert::Into<crate::model::InsightsConfig>,
3407 {
3408 self.0.request.insights_config = std::option::Option::Some(v.into());
3409 self
3410 }
3411
3412 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3416 where
3417 T: std::convert::Into<crate::model::InsightsConfig>,
3418 {
3419 self.0.request.insights_config = v.map(|x| x.into());
3420 self
3421 }
3422
3423 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3425 self.0.request.validate_only = v.into();
3426 self
3427 }
3428 }
3429
3430 #[doc(hidden)]
3431 impl gax::options::internal::RequestBuilder for CreateInsightsConfig {
3432 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3433 &mut self.0.options
3434 }
3435 }
3436
3437 #[derive(Clone, Debug)]
3455 pub struct GetInsightsConfig(RequestBuilder<crate::model::GetInsightsConfigRequest>);
3456
3457 impl GetInsightsConfig {
3458 pub(crate) fn new(
3459 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3460 ) -> Self {
3461 Self(RequestBuilder::new(stub))
3462 }
3463
3464 pub fn with_request<V: Into<crate::model::GetInsightsConfigRequest>>(
3466 mut self,
3467 v: V,
3468 ) -> Self {
3469 self.0.request = v.into();
3470 self
3471 }
3472
3473 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3475 self.0.options = v.into();
3476 self
3477 }
3478
3479 pub async fn send(self) -> Result<crate::model::InsightsConfig> {
3481 (*self.0.stub)
3482 .get_insights_config(self.0.request, self.0.options)
3483 .await
3484 .map(gax::response::Response::into_body)
3485 }
3486
3487 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3491 self.0.request.name = v.into();
3492 self
3493 }
3494 }
3495
3496 #[doc(hidden)]
3497 impl gax::options::internal::RequestBuilder for GetInsightsConfig {
3498 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3499 &mut self.0.options
3500 }
3501 }
3502
3503 #[derive(Clone, Debug)]
3522 pub struct UpdateInsightsConfig(RequestBuilder<crate::model::UpdateInsightsConfigRequest>);
3523
3524 impl UpdateInsightsConfig {
3525 pub(crate) fn new(
3526 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3527 ) -> Self {
3528 Self(RequestBuilder::new(stub))
3529 }
3530
3531 pub fn with_request<V: Into<crate::model::UpdateInsightsConfigRequest>>(
3533 mut self,
3534 v: V,
3535 ) -> Self {
3536 self.0.request = v.into();
3537 self
3538 }
3539
3540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3542 self.0.options = v.into();
3543 self
3544 }
3545
3546 pub async fn send(self) -> Result<longrunning::model::Operation> {
3553 (*self.0.stub)
3554 .update_insights_config(self.0.request, self.0.options)
3555 .await
3556 .map(gax::response::Response::into_body)
3557 }
3558
3559 pub fn poller(
3561 self,
3562 ) -> impl lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3563 {
3564 type Operation = lro::internal::Operation<
3565 crate::model::InsightsConfig,
3566 crate::model::OperationMetadata,
3567 >;
3568 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3569 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3570
3571 let stub = self.0.stub.clone();
3572 let mut options = self.0.options.clone();
3573 options.set_retry_policy(gax::retry_policy::NeverRetry);
3574 let query = move |name| {
3575 let stub = stub.clone();
3576 let options = options.clone();
3577 async {
3578 let op = GetOperation::new(stub)
3579 .set_name(name)
3580 .with_options(options)
3581 .send()
3582 .await?;
3583 Ok(Operation::new(op))
3584 }
3585 };
3586
3587 let start = move || async {
3588 let op = self.send().await?;
3589 Ok(Operation::new(op))
3590 };
3591
3592 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3593 }
3594
3595 pub fn set_insights_config<T>(mut self, v: T) -> Self
3599 where
3600 T: std::convert::Into<crate::model::InsightsConfig>,
3601 {
3602 self.0.request.insights_config = std::option::Option::Some(v.into());
3603 self
3604 }
3605
3606 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3610 where
3611 T: std::convert::Into<crate::model::InsightsConfig>,
3612 {
3613 self.0.request.insights_config = v.map(|x| x.into());
3614 self
3615 }
3616
3617 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3619 self.0.request.request_id = v.into();
3620 self
3621 }
3622
3623 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
3625 self.0.request.allow_missing = v.into();
3626 self
3627 }
3628
3629 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3631 self.0.request.validate_only = v.into();
3632 self
3633 }
3634 }
3635
3636 #[doc(hidden)]
3637 impl gax::options::internal::RequestBuilder for UpdateInsightsConfig {
3638 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3639 &mut self.0.options
3640 }
3641 }
3642
3643 #[derive(Clone, Debug)]
3662 pub struct DeleteInsightsConfig(RequestBuilder<crate::model::DeleteInsightsConfigRequest>);
3663
3664 impl DeleteInsightsConfig {
3665 pub(crate) fn new(
3666 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3667 ) -> Self {
3668 Self(RequestBuilder::new(stub))
3669 }
3670
3671 pub fn with_request<V: Into<crate::model::DeleteInsightsConfigRequest>>(
3673 mut self,
3674 v: V,
3675 ) -> Self {
3676 self.0.request = v.into();
3677 self
3678 }
3679
3680 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3682 self.0.options = v.into();
3683 self
3684 }
3685
3686 pub async fn send(self) -> Result<longrunning::model::Operation> {
3693 (*self.0.stub)
3694 .delete_insights_config(self.0.request, self.0.options)
3695 .await
3696 .map(gax::response::Response::into_body)
3697 }
3698
3699 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3701 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3702 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3703 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3704
3705 let stub = self.0.stub.clone();
3706 let mut options = self.0.options.clone();
3707 options.set_retry_policy(gax::retry_policy::NeverRetry);
3708 let query = move |name| {
3709 let stub = stub.clone();
3710 let options = options.clone();
3711 async {
3712 let op = GetOperation::new(stub)
3713 .set_name(name)
3714 .with_options(options)
3715 .send()
3716 .await?;
3717 Ok(Operation::new(op))
3718 }
3719 };
3720
3721 let start = move || async {
3722 let op = self.send().await?;
3723 Ok(Operation::new(op))
3724 };
3725
3726 lro::internal::new_unit_response_poller(
3727 polling_error_policy,
3728 polling_backoff_policy,
3729 start,
3730 query,
3731 )
3732 }
3733
3734 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3738 self.0.request.name = v.into();
3739 self
3740 }
3741
3742 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3744 self.0.request.request_id = v.into();
3745 self
3746 }
3747
3748 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3750 self.0.request.validate_only = v.into();
3751 self
3752 }
3753
3754 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3756 self.0.request.etag = v.into();
3757 self
3758 }
3759 }
3760
3761 #[doc(hidden)]
3762 impl gax::options::internal::RequestBuilder for DeleteInsightsConfig {
3763 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3764 &mut self.0.options
3765 }
3766 }
3767
3768 #[derive(Clone, Debug)]
3790 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3791
3792 impl ListLocations {
3793 pub(crate) fn new(
3794 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3795 ) -> Self {
3796 Self(RequestBuilder::new(stub))
3797 }
3798
3799 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3801 mut self,
3802 v: V,
3803 ) -> Self {
3804 self.0.request = v.into();
3805 self
3806 }
3807
3808 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3810 self.0.options = v.into();
3811 self
3812 }
3813
3814 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3816 (*self.0.stub)
3817 .list_locations(self.0.request, self.0.options)
3818 .await
3819 .map(gax::response::Response::into_body)
3820 }
3821
3822 pub fn by_page(
3824 self,
3825 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3826 {
3827 use std::clone::Clone;
3828 let token = self.0.request.page_token.clone();
3829 let execute = move |token: String| {
3830 let mut builder = self.clone();
3831 builder.0.request = builder.0.request.set_page_token(token);
3832 builder.send()
3833 };
3834 gax::paginator::internal::new_paginator(token, execute)
3835 }
3836
3837 pub fn by_item(
3839 self,
3840 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3841 {
3842 use gax::paginator::Paginator;
3843 self.by_page().items()
3844 }
3845
3846 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3848 self.0.request.name = v.into();
3849 self
3850 }
3851
3852 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3854 self.0.request.filter = v.into();
3855 self
3856 }
3857
3858 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3860 self.0.request.page_size = v.into();
3861 self
3862 }
3863
3864 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3866 self.0.request.page_token = v.into();
3867 self
3868 }
3869 }
3870
3871 #[doc(hidden)]
3872 impl gax::options::internal::RequestBuilder for ListLocations {
3873 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3874 &mut self.0.options
3875 }
3876 }
3877
3878 #[derive(Clone, Debug)]
3896 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3897
3898 impl GetLocation {
3899 pub(crate) fn new(
3900 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3901 ) -> Self {
3902 Self(RequestBuilder::new(stub))
3903 }
3904
3905 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3907 self.0.request = v.into();
3908 self
3909 }
3910
3911 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3913 self.0.options = v.into();
3914 self
3915 }
3916
3917 pub async fn send(self) -> Result<location::model::Location> {
3919 (*self.0.stub)
3920 .get_location(self.0.request, self.0.options)
3921 .await
3922 .map(gax::response::Response::into_body)
3923 }
3924
3925 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3927 self.0.request.name = v.into();
3928 self
3929 }
3930 }
3931
3932 #[doc(hidden)]
3933 impl gax::options::internal::RequestBuilder for GetLocation {
3934 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3935 &mut self.0.options
3936 }
3937 }
3938
3939 #[derive(Clone, Debug)]
3961 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3962
3963 impl ListOperations {
3964 pub(crate) fn new(
3965 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3966 ) -> Self {
3967 Self(RequestBuilder::new(stub))
3968 }
3969
3970 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3972 mut self,
3973 v: V,
3974 ) -> Self {
3975 self.0.request = v.into();
3976 self
3977 }
3978
3979 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3981 self.0.options = v.into();
3982 self
3983 }
3984
3985 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3987 (*self.0.stub)
3988 .list_operations(self.0.request, self.0.options)
3989 .await
3990 .map(gax::response::Response::into_body)
3991 }
3992
3993 pub fn by_page(
3995 self,
3996 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3997 {
3998 use std::clone::Clone;
3999 let token = self.0.request.page_token.clone();
4000 let execute = move |token: String| {
4001 let mut builder = self.clone();
4002 builder.0.request = builder.0.request.set_page_token(token);
4003 builder.send()
4004 };
4005 gax::paginator::internal::new_paginator(token, execute)
4006 }
4007
4008 pub fn by_item(
4010 self,
4011 ) -> impl gax::paginator::ItemPaginator<
4012 longrunning::model::ListOperationsResponse,
4013 gax::error::Error,
4014 > {
4015 use gax::paginator::Paginator;
4016 self.by_page().items()
4017 }
4018
4019 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4021 self.0.request.name = v.into();
4022 self
4023 }
4024
4025 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4027 self.0.request.filter = v.into();
4028 self
4029 }
4030
4031 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4033 self.0.request.page_size = v.into();
4034 self
4035 }
4036
4037 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4039 self.0.request.page_token = v.into();
4040 self
4041 }
4042 }
4043
4044 #[doc(hidden)]
4045 impl gax::options::internal::RequestBuilder for ListOperations {
4046 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4047 &mut self.0.options
4048 }
4049 }
4050
4051 #[derive(Clone, Debug)]
4069 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4070
4071 impl GetOperation {
4072 pub(crate) fn new(
4073 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4074 ) -> Self {
4075 Self(RequestBuilder::new(stub))
4076 }
4077
4078 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4080 mut self,
4081 v: V,
4082 ) -> Self {
4083 self.0.request = v.into();
4084 self
4085 }
4086
4087 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4089 self.0.options = v.into();
4090 self
4091 }
4092
4093 pub async fn send(self) -> Result<longrunning::model::Operation> {
4095 (*self.0.stub)
4096 .get_operation(self.0.request, self.0.options)
4097 .await
4098 .map(gax::response::Response::into_body)
4099 }
4100
4101 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4103 self.0.request.name = v.into();
4104 self
4105 }
4106 }
4107
4108 #[doc(hidden)]
4109 impl gax::options::internal::RequestBuilder for GetOperation {
4110 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4111 &mut self.0.options
4112 }
4113 }
4114
4115 #[derive(Clone, Debug)]
4133 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4134
4135 impl DeleteOperation {
4136 pub(crate) fn new(
4137 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4138 ) -> Self {
4139 Self(RequestBuilder::new(stub))
4140 }
4141
4142 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4144 mut self,
4145 v: V,
4146 ) -> Self {
4147 self.0.request = v.into();
4148 self
4149 }
4150
4151 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4153 self.0.options = v.into();
4154 self
4155 }
4156
4157 pub async fn send(self) -> Result<()> {
4159 (*self.0.stub)
4160 .delete_operation(self.0.request, self.0.options)
4161 .await
4162 .map(gax::response::Response::into_body)
4163 }
4164
4165 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4167 self.0.request.name = v.into();
4168 self
4169 }
4170 }
4171
4172 #[doc(hidden)]
4173 impl gax::options::internal::RequestBuilder for DeleteOperation {
4174 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4175 &mut self.0.options
4176 }
4177 }
4178
4179 #[derive(Clone, Debug)]
4197 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4198
4199 impl CancelOperation {
4200 pub(crate) fn new(
4201 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4202 ) -> Self {
4203 Self(RequestBuilder::new(stub))
4204 }
4205
4206 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4208 mut self,
4209 v: V,
4210 ) -> Self {
4211 self.0.request = v.into();
4212 self
4213 }
4214
4215 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4217 self.0.options = v.into();
4218 self
4219 }
4220
4221 pub async fn send(self) -> Result<()> {
4223 (*self.0.stub)
4224 .cancel_operation(self.0.request, self.0.options)
4225 .await
4226 .map(gax::response::Response::into_body)
4227 }
4228
4229 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4231 self.0.request.name = v.into();
4232 self
4233 }
4234 }
4235
4236 #[doc(hidden)]
4237 impl gax::options::internal::RequestBuilder for CancelOperation {
4238 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4239 &mut self.0.options
4240 }
4241 }
4242}