1pub mod developer_connect {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::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 crate::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 ) -> crate::ClientBuilderResult<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: crate::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: crate::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<crate::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(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<
128 crate::model::ListConnectionsResponse,
129 crate::Error,
130 > {
131 use std::clone::Clone;
132 let token = self.0.request.page_token.clone();
133 let execute = move |token: String| {
134 let mut builder = self.clone();
135 builder.0.request = builder.0.request.set_page_token(token);
136 builder.send()
137 };
138 google_cloud_gax::paginator::internal::new_paginator(token, execute)
139 }
140
141 pub fn by_item(
143 self,
144 ) -> impl google_cloud_gax::paginator::ItemPaginator<
145 crate::model::ListConnectionsResponse,
146 crate::Error,
147 > {
148 use google_cloud_gax::paginator::Paginator;
149 self.by_page().items()
150 }
151
152 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
156 self.0.request.parent = v.into();
157 self
158 }
159
160 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
162 self.0.request.page_size = v.into();
163 self
164 }
165
166 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
168 self.0.request.page_token = v.into();
169 self
170 }
171
172 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
174 self.0.request.filter = v.into();
175 self
176 }
177
178 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
180 self.0.request.order_by = v.into();
181 self
182 }
183 }
184
185 #[doc(hidden)]
186 impl crate::RequestBuilder for ListConnections {
187 fn request_options(&mut self) -> &mut crate::RequestOptions {
188 &mut self.0.options
189 }
190 }
191
192 #[derive(Clone, Debug)]
209 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
210
211 impl GetConnection {
212 pub(crate) fn new(
213 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
214 ) -> Self {
215 Self(RequestBuilder::new(stub))
216 }
217
218 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
220 self.0.request = v.into();
221 self
222 }
223
224 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
226 self.0.options = v.into();
227 self
228 }
229
230 pub async fn send(self) -> Result<crate::model::Connection> {
232 (*self.0.stub)
233 .get_connection(self.0.request, self.0.options)
234 .await
235 .map(crate::Response::into_body)
236 }
237
238 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
242 self.0.request.name = v.into();
243 self
244 }
245 }
246
247 #[doc(hidden)]
248 impl crate::RequestBuilder for GetConnection {
249 fn request_options(&mut self) -> &mut crate::RequestOptions {
250 &mut self.0.options
251 }
252 }
253
254 #[derive(Clone, Debug)]
272 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
273
274 impl CreateConnection {
275 pub(crate) fn new(
276 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
277 ) -> Self {
278 Self(RequestBuilder::new(stub))
279 }
280
281 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
283 mut self,
284 v: V,
285 ) -> Self {
286 self.0.request = v.into();
287 self
288 }
289
290 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
292 self.0.options = v.into();
293 self
294 }
295
296 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
303 (*self.0.stub)
304 .create_connection(self.0.request, self.0.options)
305 .await
306 .map(crate::Response::into_body)
307 }
308
309 pub fn poller(
311 self,
312 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
313 {
314 type Operation = google_cloud_lro::internal::Operation<
315 crate::model::Connection,
316 crate::model::OperationMetadata,
317 >;
318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
320 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
321 if let Some(ref mut details) = poller_options.tracing {
322 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::create_connection::until_done";
323 }
324
325 let stub = self.0.stub.clone();
326 let mut options = self.0.options.clone();
327 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
328 let query = move |name| {
329 let stub = stub.clone();
330 let options = options.clone();
331 async {
332 let op = GetOperation::new(stub)
333 .set_name(name)
334 .with_options(options)
335 .send()
336 .await?;
337 Ok(Operation::new(op))
338 }
339 };
340
341 let start = move || async {
342 let op = self.send().await?;
343 Ok(Operation::new(op))
344 };
345
346 use google_cloud_lro::internal::PollerExt;
347 {
348 google_cloud_lro::internal::new_poller(
349 polling_error_policy,
350 polling_backoff_policy,
351 start,
352 query,
353 )
354 }
355 .with_options(poller_options)
356 }
357
358 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
362 self.0.request.parent = v.into();
363 self
364 }
365
366 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
370 self.0.request.connection_id = v.into();
371 self
372 }
373
374 pub fn set_connection<T>(mut self, v: T) -> Self
378 where
379 T: std::convert::Into<crate::model::Connection>,
380 {
381 self.0.request.connection = std::option::Option::Some(v.into());
382 self
383 }
384
385 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
389 where
390 T: std::convert::Into<crate::model::Connection>,
391 {
392 self.0.request.connection = v.map(|x| x.into());
393 self
394 }
395
396 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
398 self.0.request.request_id = v.into();
399 self
400 }
401
402 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
404 self.0.request.validate_only = v.into();
405 self
406 }
407 }
408
409 #[doc(hidden)]
410 impl crate::RequestBuilder for CreateConnection {
411 fn request_options(&mut self) -> &mut crate::RequestOptions {
412 &mut self.0.options
413 }
414 }
415
416 #[derive(Clone, Debug)]
434 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
435
436 impl UpdateConnection {
437 pub(crate) fn new(
438 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
439 ) -> Self {
440 Self(RequestBuilder::new(stub))
441 }
442
443 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
445 mut self,
446 v: V,
447 ) -> Self {
448 self.0.request = v.into();
449 self
450 }
451
452 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
454 self.0.options = v.into();
455 self
456 }
457
458 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
465 (*self.0.stub)
466 .update_connection(self.0.request, self.0.options)
467 .await
468 .map(crate::Response::into_body)
469 }
470
471 pub fn poller(
473 self,
474 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
475 {
476 type Operation = google_cloud_lro::internal::Operation<
477 crate::model::Connection,
478 crate::model::OperationMetadata,
479 >;
480 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
481 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
482 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
483 if let Some(ref mut details) = poller_options.tracing {
484 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::update_connection::until_done";
485 }
486
487 let stub = self.0.stub.clone();
488 let mut options = self.0.options.clone();
489 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
490 let query = move |name| {
491 let stub = stub.clone();
492 let options = options.clone();
493 async {
494 let op = GetOperation::new(stub)
495 .set_name(name)
496 .with_options(options)
497 .send()
498 .await?;
499 Ok(Operation::new(op))
500 }
501 };
502
503 let start = move || async {
504 let op = self.send().await?;
505 Ok(Operation::new(op))
506 };
507
508 use google_cloud_lro::internal::PollerExt;
509 {
510 google_cloud_lro::internal::new_poller(
511 polling_error_policy,
512 polling_backoff_policy,
513 start,
514 query,
515 )
516 }
517 .with_options(poller_options)
518 }
519
520 pub fn set_update_mask<T>(mut self, v: T) -> Self
524 where
525 T: std::convert::Into<wkt::FieldMask>,
526 {
527 self.0.request.update_mask = std::option::Option::Some(v.into());
528 self
529 }
530
531 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
535 where
536 T: std::convert::Into<wkt::FieldMask>,
537 {
538 self.0.request.update_mask = v.map(|x| x.into());
539 self
540 }
541
542 pub fn set_connection<T>(mut self, v: T) -> Self
546 where
547 T: std::convert::Into<crate::model::Connection>,
548 {
549 self.0.request.connection = std::option::Option::Some(v.into());
550 self
551 }
552
553 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
557 where
558 T: std::convert::Into<crate::model::Connection>,
559 {
560 self.0.request.connection = v.map(|x| x.into());
561 self
562 }
563
564 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
566 self.0.request.request_id = v.into();
567 self
568 }
569
570 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
572 self.0.request.allow_missing = v.into();
573 self
574 }
575
576 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
578 self.0.request.validate_only = v.into();
579 self
580 }
581 }
582
583 #[doc(hidden)]
584 impl crate::RequestBuilder for UpdateConnection {
585 fn request_options(&mut self) -> &mut crate::RequestOptions {
586 &mut self.0.options
587 }
588 }
589
590 #[derive(Clone, Debug)]
608 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
609
610 impl DeleteConnection {
611 pub(crate) fn new(
612 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
613 ) -> Self {
614 Self(RequestBuilder::new(stub))
615 }
616
617 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
619 mut self,
620 v: V,
621 ) -> Self {
622 self.0.request = v.into();
623 self
624 }
625
626 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
628 self.0.options = v.into();
629 self
630 }
631
632 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
639 (*self.0.stub)
640 .delete_connection(self.0.request, self.0.options)
641 .await
642 .map(crate::Response::into_body)
643 }
644
645 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
647 type Operation =
648 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
649 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
650 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
651 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
652 if let Some(ref mut details) = poller_options.tracing {
653 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::delete_connection::until_done";
654 }
655
656 let stub = self.0.stub.clone();
657 let mut options = self.0.options.clone();
658 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
659 let query = move |name| {
660 let stub = stub.clone();
661 let options = options.clone();
662 async {
663 let op = GetOperation::new(stub)
664 .set_name(name)
665 .with_options(options)
666 .send()
667 .await?;
668 Ok(Operation::new(op))
669 }
670 };
671
672 let start = move || async {
673 let op = self.send().await?;
674 Ok(Operation::new(op))
675 };
676
677 use google_cloud_lro::internal::PollerExt;
678 {
679 google_cloud_lro::internal::new_unit_response_poller(
680 polling_error_policy,
681 polling_backoff_policy,
682 start,
683 query,
684 )
685 }
686 .with_options(poller_options)
687 }
688
689 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
693 self.0.request.name = v.into();
694 self
695 }
696
697 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
699 self.0.request.request_id = v.into();
700 self
701 }
702
703 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
705 self.0.request.validate_only = v.into();
706 self
707 }
708
709 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
711 self.0.request.etag = v.into();
712 self
713 }
714 }
715
716 #[doc(hidden)]
717 impl crate::RequestBuilder for DeleteConnection {
718 fn request_options(&mut self) -> &mut crate::RequestOptions {
719 &mut self.0.options
720 }
721 }
722
723 #[derive(Clone, Debug)]
741 pub struct CreateGitRepositoryLink(
742 RequestBuilder<crate::model::CreateGitRepositoryLinkRequest>,
743 );
744
745 impl CreateGitRepositoryLink {
746 pub(crate) fn new(
747 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
748 ) -> Self {
749 Self(RequestBuilder::new(stub))
750 }
751
752 pub fn with_request<V: Into<crate::model::CreateGitRepositoryLinkRequest>>(
754 mut self,
755 v: V,
756 ) -> Self {
757 self.0.request = v.into();
758 self
759 }
760
761 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
763 self.0.options = v.into();
764 self
765 }
766
767 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
774 (*self.0.stub)
775 .create_git_repository_link(self.0.request, self.0.options)
776 .await
777 .map(crate::Response::into_body)
778 }
779
780 pub fn poller(
782 self,
783 ) -> impl google_cloud_lro::Poller<
784 crate::model::GitRepositoryLink,
785 crate::model::OperationMetadata,
786 > {
787 type Operation = google_cloud_lro::internal::Operation<
788 crate::model::GitRepositoryLink,
789 crate::model::OperationMetadata,
790 >;
791 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
792 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
793 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
794 if let Some(ref mut details) = poller_options.tracing {
795 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::create_git_repository_link::until_done";
796 }
797
798 let stub = self.0.stub.clone();
799 let mut options = self.0.options.clone();
800 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
801 let query = move |name| {
802 let stub = stub.clone();
803 let options = options.clone();
804 async {
805 let op = GetOperation::new(stub)
806 .set_name(name)
807 .with_options(options)
808 .send()
809 .await?;
810 Ok(Operation::new(op))
811 }
812 };
813
814 let start = move || async {
815 let op = self.send().await?;
816 Ok(Operation::new(op))
817 };
818
819 use google_cloud_lro::internal::PollerExt;
820 {
821 google_cloud_lro::internal::new_poller(
822 polling_error_policy,
823 polling_backoff_policy,
824 start,
825 query,
826 )
827 }
828 .with_options(poller_options)
829 }
830
831 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
835 self.0.request.parent = v.into();
836 self
837 }
838
839 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
843 where
844 T: std::convert::Into<crate::model::GitRepositoryLink>,
845 {
846 self.0.request.git_repository_link = std::option::Option::Some(v.into());
847 self
848 }
849
850 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
854 where
855 T: std::convert::Into<crate::model::GitRepositoryLink>,
856 {
857 self.0.request.git_repository_link = v.map(|x| x.into());
858 self
859 }
860
861 pub fn set_git_repository_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
865 self.0.request.git_repository_link_id = v.into();
866 self
867 }
868
869 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
871 self.0.request.request_id = v.into();
872 self
873 }
874
875 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
877 self.0.request.validate_only = v.into();
878 self
879 }
880 }
881
882 #[doc(hidden)]
883 impl crate::RequestBuilder for CreateGitRepositoryLink {
884 fn request_options(&mut self) -> &mut crate::RequestOptions {
885 &mut self.0.options
886 }
887 }
888
889 #[derive(Clone, Debug)]
907 pub struct DeleteGitRepositoryLink(
908 RequestBuilder<crate::model::DeleteGitRepositoryLinkRequest>,
909 );
910
911 impl DeleteGitRepositoryLink {
912 pub(crate) fn new(
913 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
914 ) -> Self {
915 Self(RequestBuilder::new(stub))
916 }
917
918 pub fn with_request<V: Into<crate::model::DeleteGitRepositoryLinkRequest>>(
920 mut self,
921 v: V,
922 ) -> Self {
923 self.0.request = v.into();
924 self
925 }
926
927 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
929 self.0.options = v.into();
930 self
931 }
932
933 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
940 (*self.0.stub)
941 .delete_git_repository_link(self.0.request, self.0.options)
942 .await
943 .map(crate::Response::into_body)
944 }
945
946 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
948 type Operation =
949 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
950 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
951 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
952 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
953 if let Some(ref mut details) = poller_options.tracing {
954 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::delete_git_repository_link::until_done";
955 }
956
957 let stub = self.0.stub.clone();
958 let mut options = self.0.options.clone();
959 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
960 let query = move |name| {
961 let stub = stub.clone();
962 let options = options.clone();
963 async {
964 let op = GetOperation::new(stub)
965 .set_name(name)
966 .with_options(options)
967 .send()
968 .await?;
969 Ok(Operation::new(op))
970 }
971 };
972
973 let start = move || async {
974 let op = self.send().await?;
975 Ok(Operation::new(op))
976 };
977
978 use google_cloud_lro::internal::PollerExt;
979 {
980 google_cloud_lro::internal::new_unit_response_poller(
981 polling_error_policy,
982 polling_backoff_policy,
983 start,
984 query,
985 )
986 }
987 .with_options(poller_options)
988 }
989
990 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
994 self.0.request.name = v.into();
995 self
996 }
997
998 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1000 self.0.request.request_id = v.into();
1001 self
1002 }
1003
1004 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1006 self.0.request.validate_only = v.into();
1007 self
1008 }
1009
1010 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1012 self.0.request.etag = v.into();
1013 self
1014 }
1015 }
1016
1017 #[doc(hidden)]
1018 impl crate::RequestBuilder for DeleteGitRepositoryLink {
1019 fn request_options(&mut self) -> &mut crate::RequestOptions {
1020 &mut self.0.options
1021 }
1022 }
1023
1024 #[derive(Clone, Debug)]
1045 pub struct ListGitRepositoryLinks(RequestBuilder<crate::model::ListGitRepositoryLinksRequest>);
1046
1047 impl ListGitRepositoryLinks {
1048 pub(crate) fn new(
1049 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1050 ) -> Self {
1051 Self(RequestBuilder::new(stub))
1052 }
1053
1054 pub fn with_request<V: Into<crate::model::ListGitRepositoryLinksRequest>>(
1056 mut self,
1057 v: V,
1058 ) -> Self {
1059 self.0.request = v.into();
1060 self
1061 }
1062
1063 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1065 self.0.options = v.into();
1066 self
1067 }
1068
1069 pub async fn send(self) -> Result<crate::model::ListGitRepositoryLinksResponse> {
1071 (*self.0.stub)
1072 .list_git_repository_links(self.0.request, self.0.options)
1073 .await
1074 .map(crate::Response::into_body)
1075 }
1076
1077 pub fn by_page(
1079 self,
1080 ) -> impl google_cloud_gax::paginator::Paginator<
1081 crate::model::ListGitRepositoryLinksResponse,
1082 crate::Error,
1083 > {
1084 use std::clone::Clone;
1085 let token = self.0.request.page_token.clone();
1086 let execute = move |token: String| {
1087 let mut builder = self.clone();
1088 builder.0.request = builder.0.request.set_page_token(token);
1089 builder.send()
1090 };
1091 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1092 }
1093
1094 pub fn by_item(
1096 self,
1097 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1098 crate::model::ListGitRepositoryLinksResponse,
1099 crate::Error,
1100 > {
1101 use google_cloud_gax::paginator::Paginator;
1102 self.by_page().items()
1103 }
1104
1105 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1109 self.0.request.parent = v.into();
1110 self
1111 }
1112
1113 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1115 self.0.request.page_size = v.into();
1116 self
1117 }
1118
1119 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1121 self.0.request.page_token = v.into();
1122 self
1123 }
1124
1125 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1127 self.0.request.filter = v.into();
1128 self
1129 }
1130
1131 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1133 self.0.request.order_by = v.into();
1134 self
1135 }
1136 }
1137
1138 #[doc(hidden)]
1139 impl crate::RequestBuilder for ListGitRepositoryLinks {
1140 fn request_options(&mut self) -> &mut crate::RequestOptions {
1141 &mut self.0.options
1142 }
1143 }
1144
1145 #[derive(Clone, Debug)]
1162 pub struct GetGitRepositoryLink(RequestBuilder<crate::model::GetGitRepositoryLinkRequest>);
1163
1164 impl GetGitRepositoryLink {
1165 pub(crate) fn new(
1166 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1167 ) -> Self {
1168 Self(RequestBuilder::new(stub))
1169 }
1170
1171 pub fn with_request<V: Into<crate::model::GetGitRepositoryLinkRequest>>(
1173 mut self,
1174 v: V,
1175 ) -> Self {
1176 self.0.request = v.into();
1177 self
1178 }
1179
1180 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1182 self.0.options = v.into();
1183 self
1184 }
1185
1186 pub async fn send(self) -> Result<crate::model::GitRepositoryLink> {
1188 (*self.0.stub)
1189 .get_git_repository_link(self.0.request, self.0.options)
1190 .await
1191 .map(crate::Response::into_body)
1192 }
1193
1194 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1198 self.0.request.name = v.into();
1199 self
1200 }
1201 }
1202
1203 #[doc(hidden)]
1204 impl crate::RequestBuilder for GetGitRepositoryLink {
1205 fn request_options(&mut self) -> &mut crate::RequestOptions {
1206 &mut self.0.options
1207 }
1208 }
1209
1210 #[derive(Clone, Debug)]
1227 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1228
1229 impl FetchReadWriteToken {
1230 pub(crate) fn new(
1231 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1232 ) -> Self {
1233 Self(RequestBuilder::new(stub))
1234 }
1235
1236 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1238 mut self,
1239 v: V,
1240 ) -> Self {
1241 self.0.request = v.into();
1242 self
1243 }
1244
1245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1247 self.0.options = v.into();
1248 self
1249 }
1250
1251 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1253 (*self.0.stub)
1254 .fetch_read_write_token(self.0.request, self.0.options)
1255 .await
1256 .map(crate::Response::into_body)
1257 }
1258
1259 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1263 self.0.request.git_repository_link = v.into();
1264 self
1265 }
1266 }
1267
1268 #[doc(hidden)]
1269 impl crate::RequestBuilder for FetchReadWriteToken {
1270 fn request_options(&mut self) -> &mut crate::RequestOptions {
1271 &mut self.0.options
1272 }
1273 }
1274
1275 #[derive(Clone, Debug)]
1292 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1293
1294 impl FetchReadToken {
1295 pub(crate) fn new(
1296 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1297 ) -> Self {
1298 Self(RequestBuilder::new(stub))
1299 }
1300
1301 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1303 self.0.request = v.into();
1304 self
1305 }
1306
1307 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1309 self.0.options = v.into();
1310 self
1311 }
1312
1313 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1315 (*self.0.stub)
1316 .fetch_read_token(self.0.request, self.0.options)
1317 .await
1318 .map(crate::Response::into_body)
1319 }
1320
1321 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1325 self.0.request.git_repository_link = v.into();
1326 self
1327 }
1328 }
1329
1330 #[doc(hidden)]
1331 impl crate::RequestBuilder for FetchReadToken {
1332 fn request_options(&mut self) -> &mut crate::RequestOptions {
1333 &mut self.0.options
1334 }
1335 }
1336
1337 #[derive(Clone, Debug)]
1358 pub struct FetchLinkableGitRepositories(
1359 RequestBuilder<crate::model::FetchLinkableGitRepositoriesRequest>,
1360 );
1361
1362 impl FetchLinkableGitRepositories {
1363 pub(crate) fn new(
1364 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1365 ) -> Self {
1366 Self(RequestBuilder::new(stub))
1367 }
1368
1369 pub fn with_request<V: Into<crate::model::FetchLinkableGitRepositoriesRequest>>(
1371 mut self,
1372 v: V,
1373 ) -> Self {
1374 self.0.request = v.into();
1375 self
1376 }
1377
1378 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1380 self.0.options = v.into();
1381 self
1382 }
1383
1384 pub async fn send(self) -> Result<crate::model::FetchLinkableGitRepositoriesResponse> {
1386 (*self.0.stub)
1387 .fetch_linkable_git_repositories(self.0.request, self.0.options)
1388 .await
1389 .map(crate::Response::into_body)
1390 }
1391
1392 pub fn by_page(
1394 self,
1395 ) -> impl google_cloud_gax::paginator::Paginator<
1396 crate::model::FetchLinkableGitRepositoriesResponse,
1397 crate::Error,
1398 > {
1399 use std::clone::Clone;
1400 let token = self.0.request.page_token.clone();
1401 let execute = move |token: String| {
1402 let mut builder = self.clone();
1403 builder.0.request = builder.0.request.set_page_token(token);
1404 builder.send()
1405 };
1406 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1407 }
1408
1409 pub fn by_item(
1411 self,
1412 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1413 crate::model::FetchLinkableGitRepositoriesResponse,
1414 crate::Error,
1415 > {
1416 use google_cloud_gax::paginator::Paginator;
1417 self.by_page().items()
1418 }
1419
1420 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1424 self.0.request.connection = v.into();
1425 self
1426 }
1427
1428 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1430 self.0.request.page_size = v.into();
1431 self
1432 }
1433
1434 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1436 self.0.request.page_token = v.into();
1437 self
1438 }
1439 }
1440
1441 #[doc(hidden)]
1442 impl crate::RequestBuilder for FetchLinkableGitRepositories {
1443 fn request_options(&mut self) -> &mut crate::RequestOptions {
1444 &mut self.0.options
1445 }
1446 }
1447
1448 #[derive(Clone, Debug)]
1465 pub struct FetchGitHubInstallations(
1466 RequestBuilder<crate::model::FetchGitHubInstallationsRequest>,
1467 );
1468
1469 impl FetchGitHubInstallations {
1470 pub(crate) fn new(
1471 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1472 ) -> Self {
1473 Self(RequestBuilder::new(stub))
1474 }
1475
1476 pub fn with_request<V: Into<crate::model::FetchGitHubInstallationsRequest>>(
1478 mut self,
1479 v: V,
1480 ) -> Self {
1481 self.0.request = v.into();
1482 self
1483 }
1484
1485 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1487 self.0.options = v.into();
1488 self
1489 }
1490
1491 pub async fn send(self) -> Result<crate::model::FetchGitHubInstallationsResponse> {
1493 (*self.0.stub)
1494 .fetch_git_hub_installations(self.0.request, self.0.options)
1495 .await
1496 .map(crate::Response::into_body)
1497 }
1498
1499 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1503 self.0.request.connection = v.into();
1504 self
1505 }
1506 }
1507
1508 #[doc(hidden)]
1509 impl crate::RequestBuilder for FetchGitHubInstallations {
1510 fn request_options(&mut self) -> &mut crate::RequestOptions {
1511 &mut self.0.options
1512 }
1513 }
1514
1515 #[derive(Clone, Debug)]
1532 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1533
1534 impl FetchGitRefs {
1535 pub(crate) fn new(
1536 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1537 ) -> Self {
1538 Self(RequestBuilder::new(stub))
1539 }
1540
1541 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1543 self.0.request = v.into();
1544 self
1545 }
1546
1547 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1549 self.0.options = v.into();
1550 self
1551 }
1552
1553 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1555 (*self.0.stub)
1556 .fetch_git_refs(self.0.request, self.0.options)
1557 .await
1558 .map(crate::Response::into_body)
1559 }
1560
1561 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1565 self.0.request.git_repository_link = v.into();
1566 self
1567 }
1568
1569 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1573 mut self,
1574 v: T,
1575 ) -> Self {
1576 self.0.request.ref_type = v.into();
1577 self
1578 }
1579
1580 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1582 self.0.request.page_size = v.into();
1583 self
1584 }
1585
1586 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1588 self.0.request.page_token = v.into();
1589 self
1590 }
1591 }
1592
1593 #[doc(hidden)]
1594 impl crate::RequestBuilder for FetchGitRefs {
1595 fn request_options(&mut self) -> &mut crate::RequestOptions {
1596 &mut self.0.options
1597 }
1598 }
1599
1600 #[derive(Clone, Debug)]
1621 pub struct ListAccountConnectors(RequestBuilder<crate::model::ListAccountConnectorsRequest>);
1622
1623 impl ListAccountConnectors {
1624 pub(crate) fn new(
1625 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1626 ) -> Self {
1627 Self(RequestBuilder::new(stub))
1628 }
1629
1630 pub fn with_request<V: Into<crate::model::ListAccountConnectorsRequest>>(
1632 mut self,
1633 v: V,
1634 ) -> Self {
1635 self.0.request = v.into();
1636 self
1637 }
1638
1639 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1641 self.0.options = v.into();
1642 self
1643 }
1644
1645 pub async fn send(self) -> Result<crate::model::ListAccountConnectorsResponse> {
1647 (*self.0.stub)
1648 .list_account_connectors(self.0.request, self.0.options)
1649 .await
1650 .map(crate::Response::into_body)
1651 }
1652
1653 pub fn by_page(
1655 self,
1656 ) -> impl google_cloud_gax::paginator::Paginator<
1657 crate::model::ListAccountConnectorsResponse,
1658 crate::Error,
1659 > {
1660 use std::clone::Clone;
1661 let token = self.0.request.page_token.clone();
1662 let execute = move |token: String| {
1663 let mut builder = self.clone();
1664 builder.0.request = builder.0.request.set_page_token(token);
1665 builder.send()
1666 };
1667 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1668 }
1669
1670 pub fn by_item(
1672 self,
1673 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1674 crate::model::ListAccountConnectorsResponse,
1675 crate::Error,
1676 > {
1677 use google_cloud_gax::paginator::Paginator;
1678 self.by_page().items()
1679 }
1680
1681 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1685 self.0.request.parent = v.into();
1686 self
1687 }
1688
1689 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1691 self.0.request.page_size = v.into();
1692 self
1693 }
1694
1695 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1697 self.0.request.page_token = v.into();
1698 self
1699 }
1700
1701 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1703 self.0.request.filter = v.into();
1704 self
1705 }
1706
1707 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1709 self.0.request.order_by = v.into();
1710 self
1711 }
1712 }
1713
1714 #[doc(hidden)]
1715 impl crate::RequestBuilder for ListAccountConnectors {
1716 fn request_options(&mut self) -> &mut crate::RequestOptions {
1717 &mut self.0.options
1718 }
1719 }
1720
1721 #[derive(Clone, Debug)]
1738 pub struct GetAccountConnector(RequestBuilder<crate::model::GetAccountConnectorRequest>);
1739
1740 impl GetAccountConnector {
1741 pub(crate) fn new(
1742 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1743 ) -> Self {
1744 Self(RequestBuilder::new(stub))
1745 }
1746
1747 pub fn with_request<V: Into<crate::model::GetAccountConnectorRequest>>(
1749 mut self,
1750 v: V,
1751 ) -> Self {
1752 self.0.request = v.into();
1753 self
1754 }
1755
1756 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1758 self.0.options = v.into();
1759 self
1760 }
1761
1762 pub async fn send(self) -> Result<crate::model::AccountConnector> {
1764 (*self.0.stub)
1765 .get_account_connector(self.0.request, self.0.options)
1766 .await
1767 .map(crate::Response::into_body)
1768 }
1769
1770 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1774 self.0.request.name = v.into();
1775 self
1776 }
1777 }
1778
1779 #[doc(hidden)]
1780 impl crate::RequestBuilder for GetAccountConnector {
1781 fn request_options(&mut self) -> &mut crate::RequestOptions {
1782 &mut self.0.options
1783 }
1784 }
1785
1786 #[derive(Clone, Debug)]
1804 pub struct CreateAccountConnector(RequestBuilder<crate::model::CreateAccountConnectorRequest>);
1805
1806 impl CreateAccountConnector {
1807 pub(crate) fn new(
1808 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1809 ) -> Self {
1810 Self(RequestBuilder::new(stub))
1811 }
1812
1813 pub fn with_request<V: Into<crate::model::CreateAccountConnectorRequest>>(
1815 mut self,
1816 v: V,
1817 ) -> Self {
1818 self.0.request = v.into();
1819 self
1820 }
1821
1822 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1824 self.0.options = v.into();
1825 self
1826 }
1827
1828 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1835 (*self.0.stub)
1836 .create_account_connector(self.0.request, self.0.options)
1837 .await
1838 .map(crate::Response::into_body)
1839 }
1840
1841 pub fn poller(
1843 self,
1844 ) -> impl google_cloud_lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1845 {
1846 type Operation = google_cloud_lro::internal::Operation<
1847 crate::model::AccountConnector,
1848 crate::model::OperationMetadata,
1849 >;
1850 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1851 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1852 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1853 if let Some(ref mut details) = poller_options.tracing {
1854 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::create_account_connector::until_done";
1855 }
1856
1857 let stub = self.0.stub.clone();
1858 let mut options = self.0.options.clone();
1859 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1860 let query = move |name| {
1861 let stub = stub.clone();
1862 let options = options.clone();
1863 async {
1864 let op = GetOperation::new(stub)
1865 .set_name(name)
1866 .with_options(options)
1867 .send()
1868 .await?;
1869 Ok(Operation::new(op))
1870 }
1871 };
1872
1873 let start = move || async {
1874 let op = self.send().await?;
1875 Ok(Operation::new(op))
1876 };
1877
1878 use google_cloud_lro::internal::PollerExt;
1879 {
1880 google_cloud_lro::internal::new_poller(
1881 polling_error_policy,
1882 polling_backoff_policy,
1883 start,
1884 query,
1885 )
1886 }
1887 .with_options(poller_options)
1888 }
1889
1890 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1894 self.0.request.parent = v.into();
1895 self
1896 }
1897
1898 pub fn set_account_connector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1902 self.0.request.account_connector_id = v.into();
1903 self
1904 }
1905
1906 pub fn set_account_connector<T>(mut self, v: T) -> Self
1910 where
1911 T: std::convert::Into<crate::model::AccountConnector>,
1912 {
1913 self.0.request.account_connector = std::option::Option::Some(v.into());
1914 self
1915 }
1916
1917 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
1921 where
1922 T: std::convert::Into<crate::model::AccountConnector>,
1923 {
1924 self.0.request.account_connector = v.map(|x| x.into());
1925 self
1926 }
1927
1928 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1930 self.0.request.request_id = v.into();
1931 self
1932 }
1933
1934 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1936 self.0.request.validate_only = v.into();
1937 self
1938 }
1939 }
1940
1941 #[doc(hidden)]
1942 impl crate::RequestBuilder for CreateAccountConnector {
1943 fn request_options(&mut self) -> &mut crate::RequestOptions {
1944 &mut self.0.options
1945 }
1946 }
1947
1948 #[derive(Clone, Debug)]
1966 pub struct UpdateAccountConnector(RequestBuilder<crate::model::UpdateAccountConnectorRequest>);
1967
1968 impl UpdateAccountConnector {
1969 pub(crate) fn new(
1970 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1971 ) -> Self {
1972 Self(RequestBuilder::new(stub))
1973 }
1974
1975 pub fn with_request<V: Into<crate::model::UpdateAccountConnectorRequest>>(
1977 mut self,
1978 v: V,
1979 ) -> Self {
1980 self.0.request = v.into();
1981 self
1982 }
1983
1984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1986 self.0.options = v.into();
1987 self
1988 }
1989
1990 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1997 (*self.0.stub)
1998 .update_account_connector(self.0.request, self.0.options)
1999 .await
2000 .map(crate::Response::into_body)
2001 }
2002
2003 pub fn poller(
2005 self,
2006 ) -> impl google_cloud_lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
2007 {
2008 type Operation = google_cloud_lro::internal::Operation<
2009 crate::model::AccountConnector,
2010 crate::model::OperationMetadata,
2011 >;
2012 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2013 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2014 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2015 if let Some(ref mut details) = poller_options.tracing {
2016 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::update_account_connector::until_done";
2017 }
2018
2019 let stub = self.0.stub.clone();
2020 let mut options = self.0.options.clone();
2021 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2022 let query = move |name| {
2023 let stub = stub.clone();
2024 let options = options.clone();
2025 async {
2026 let op = GetOperation::new(stub)
2027 .set_name(name)
2028 .with_options(options)
2029 .send()
2030 .await?;
2031 Ok(Operation::new(op))
2032 }
2033 };
2034
2035 let start = move || async {
2036 let op = self.send().await?;
2037 Ok(Operation::new(op))
2038 };
2039
2040 use google_cloud_lro::internal::PollerExt;
2041 {
2042 google_cloud_lro::internal::new_poller(
2043 polling_error_policy,
2044 polling_backoff_policy,
2045 start,
2046 query,
2047 )
2048 }
2049 .with_options(poller_options)
2050 }
2051
2052 pub fn set_update_mask<T>(mut self, v: T) -> Self
2054 where
2055 T: std::convert::Into<wkt::FieldMask>,
2056 {
2057 self.0.request.update_mask = std::option::Option::Some(v.into());
2058 self
2059 }
2060
2061 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2063 where
2064 T: std::convert::Into<wkt::FieldMask>,
2065 {
2066 self.0.request.update_mask = v.map(|x| x.into());
2067 self
2068 }
2069
2070 pub fn set_account_connector<T>(mut self, v: T) -> Self
2074 where
2075 T: std::convert::Into<crate::model::AccountConnector>,
2076 {
2077 self.0.request.account_connector = std::option::Option::Some(v.into());
2078 self
2079 }
2080
2081 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
2085 where
2086 T: std::convert::Into<crate::model::AccountConnector>,
2087 {
2088 self.0.request.account_connector = v.map(|x| x.into());
2089 self
2090 }
2091
2092 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2094 self.0.request.request_id = v.into();
2095 self
2096 }
2097
2098 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2100 self.0.request.allow_missing = v.into();
2101 self
2102 }
2103
2104 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2106 self.0.request.validate_only = v.into();
2107 self
2108 }
2109 }
2110
2111 #[doc(hidden)]
2112 impl crate::RequestBuilder for UpdateAccountConnector {
2113 fn request_options(&mut self) -> &mut crate::RequestOptions {
2114 &mut self.0.options
2115 }
2116 }
2117
2118 #[derive(Clone, Debug)]
2136 pub struct DeleteAccountConnector(RequestBuilder<crate::model::DeleteAccountConnectorRequest>);
2137
2138 impl DeleteAccountConnector {
2139 pub(crate) fn new(
2140 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2141 ) -> Self {
2142 Self(RequestBuilder::new(stub))
2143 }
2144
2145 pub fn with_request<V: Into<crate::model::DeleteAccountConnectorRequest>>(
2147 mut self,
2148 v: V,
2149 ) -> Self {
2150 self.0.request = v.into();
2151 self
2152 }
2153
2154 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2156 self.0.options = v.into();
2157 self
2158 }
2159
2160 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2167 (*self.0.stub)
2168 .delete_account_connector(self.0.request, self.0.options)
2169 .await
2170 .map(crate::Response::into_body)
2171 }
2172
2173 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2175 type Operation =
2176 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2177 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2178 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2179 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2180 if let Some(ref mut details) = poller_options.tracing {
2181 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::delete_account_connector::until_done";
2182 }
2183
2184 let stub = self.0.stub.clone();
2185 let mut options = self.0.options.clone();
2186 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2187 let query = move |name| {
2188 let stub = stub.clone();
2189 let options = options.clone();
2190 async {
2191 let op = GetOperation::new(stub)
2192 .set_name(name)
2193 .with_options(options)
2194 .send()
2195 .await?;
2196 Ok(Operation::new(op))
2197 }
2198 };
2199
2200 let start = move || async {
2201 let op = self.send().await?;
2202 Ok(Operation::new(op))
2203 };
2204
2205 use google_cloud_lro::internal::PollerExt;
2206 {
2207 google_cloud_lro::internal::new_unit_response_poller(
2208 polling_error_policy,
2209 polling_backoff_policy,
2210 start,
2211 query,
2212 )
2213 }
2214 .with_options(poller_options)
2215 }
2216
2217 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221 self.0.request.name = v.into();
2222 self
2223 }
2224
2225 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2227 self.0.request.request_id = v.into();
2228 self
2229 }
2230
2231 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2233 self.0.request.validate_only = v.into();
2234 self
2235 }
2236
2237 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2239 self.0.request.etag = v.into();
2240 self
2241 }
2242
2243 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2245 self.0.request.force = v.into();
2246 self
2247 }
2248 }
2249
2250 #[doc(hidden)]
2251 impl crate::RequestBuilder for DeleteAccountConnector {
2252 fn request_options(&mut self) -> &mut crate::RequestOptions {
2253 &mut self.0.options
2254 }
2255 }
2256
2257 #[derive(Clone, Debug)]
2274 pub struct FetchAccessToken(RequestBuilder<crate::model::FetchAccessTokenRequest>);
2275
2276 impl FetchAccessToken {
2277 pub(crate) fn new(
2278 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2279 ) -> Self {
2280 Self(RequestBuilder::new(stub))
2281 }
2282
2283 pub fn with_request<V: Into<crate::model::FetchAccessTokenRequest>>(
2285 mut self,
2286 v: V,
2287 ) -> Self {
2288 self.0.request = v.into();
2289 self
2290 }
2291
2292 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2294 self.0.options = v.into();
2295 self
2296 }
2297
2298 pub async fn send(self) -> Result<crate::model::FetchAccessTokenResponse> {
2300 (*self.0.stub)
2301 .fetch_access_token(self.0.request, self.0.options)
2302 .await
2303 .map(crate::Response::into_body)
2304 }
2305
2306 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2310 self.0.request.account_connector = v.into();
2311 self
2312 }
2313 }
2314
2315 #[doc(hidden)]
2316 impl crate::RequestBuilder for FetchAccessToken {
2317 fn request_options(&mut self) -> &mut crate::RequestOptions {
2318 &mut self.0.options
2319 }
2320 }
2321
2322 #[derive(Clone, Debug)]
2343 pub struct ListUsers(RequestBuilder<crate::model::ListUsersRequest>);
2344
2345 impl ListUsers {
2346 pub(crate) fn new(
2347 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2348 ) -> Self {
2349 Self(RequestBuilder::new(stub))
2350 }
2351
2352 pub fn with_request<V: Into<crate::model::ListUsersRequest>>(mut self, v: V) -> Self {
2354 self.0.request = v.into();
2355 self
2356 }
2357
2358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2360 self.0.options = v.into();
2361 self
2362 }
2363
2364 pub async fn send(self) -> Result<crate::model::ListUsersResponse> {
2366 (*self.0.stub)
2367 .list_users(self.0.request, self.0.options)
2368 .await
2369 .map(crate::Response::into_body)
2370 }
2371
2372 pub fn by_page(
2374 self,
2375 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUsersResponse, crate::Error>
2376 {
2377 use std::clone::Clone;
2378 let token = self.0.request.page_token.clone();
2379 let execute = move |token: String| {
2380 let mut builder = self.clone();
2381 builder.0.request = builder.0.request.set_page_token(token);
2382 builder.send()
2383 };
2384 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2385 }
2386
2387 pub fn by_item(
2389 self,
2390 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListUsersResponse, crate::Error>
2391 {
2392 use google_cloud_gax::paginator::Paginator;
2393 self.by_page().items()
2394 }
2395
2396 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2400 self.0.request.parent = v.into();
2401 self
2402 }
2403
2404 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2406 self.0.request.page_size = v.into();
2407 self
2408 }
2409
2410 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2412 self.0.request.page_token = v.into();
2413 self
2414 }
2415
2416 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2418 self.0.request.filter = v.into();
2419 self
2420 }
2421
2422 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2424 self.0.request.order_by = v.into();
2425 self
2426 }
2427 }
2428
2429 #[doc(hidden)]
2430 impl crate::RequestBuilder for ListUsers {
2431 fn request_options(&mut self) -> &mut crate::RequestOptions {
2432 &mut self.0.options
2433 }
2434 }
2435
2436 #[derive(Clone, Debug)]
2454 pub struct DeleteUser(RequestBuilder<crate::model::DeleteUserRequest>);
2455
2456 impl DeleteUser {
2457 pub(crate) fn new(
2458 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2459 ) -> Self {
2460 Self(RequestBuilder::new(stub))
2461 }
2462
2463 pub fn with_request<V: Into<crate::model::DeleteUserRequest>>(mut self, v: V) -> Self {
2465 self.0.request = v.into();
2466 self
2467 }
2468
2469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2471 self.0.options = v.into();
2472 self
2473 }
2474
2475 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2482 (*self.0.stub)
2483 .delete_user(self.0.request, self.0.options)
2484 .await
2485 .map(crate::Response::into_body)
2486 }
2487
2488 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2490 type Operation =
2491 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2492 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2493 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2494 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2495 if let Some(ref mut details) = poller_options.tracing {
2496 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::delete_user::until_done";
2497 }
2498
2499 let stub = self.0.stub.clone();
2500 let mut options = self.0.options.clone();
2501 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2502 let query = move |name| {
2503 let stub = stub.clone();
2504 let options = options.clone();
2505 async {
2506 let op = GetOperation::new(stub)
2507 .set_name(name)
2508 .with_options(options)
2509 .send()
2510 .await?;
2511 Ok(Operation::new(op))
2512 }
2513 };
2514
2515 let start = move || async {
2516 let op = self.send().await?;
2517 Ok(Operation::new(op))
2518 };
2519
2520 use google_cloud_lro::internal::PollerExt;
2521 {
2522 google_cloud_lro::internal::new_unit_response_poller(
2523 polling_error_policy,
2524 polling_backoff_policy,
2525 start,
2526 query,
2527 )
2528 }
2529 .with_options(poller_options)
2530 }
2531
2532 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2536 self.0.request.name = v.into();
2537 self
2538 }
2539
2540 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2542 self.0.request.request_id = v.into();
2543 self
2544 }
2545
2546 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2548 self.0.request.validate_only = v.into();
2549 self
2550 }
2551
2552 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2554 self.0.request.etag = v.into();
2555 self
2556 }
2557 }
2558
2559 #[doc(hidden)]
2560 impl crate::RequestBuilder for DeleteUser {
2561 fn request_options(&mut self) -> &mut crate::RequestOptions {
2562 &mut self.0.options
2563 }
2564 }
2565
2566 #[derive(Clone, Debug)]
2583 pub struct FetchSelf(RequestBuilder<crate::model::FetchSelfRequest>);
2584
2585 impl FetchSelf {
2586 pub(crate) fn new(
2587 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2588 ) -> Self {
2589 Self(RequestBuilder::new(stub))
2590 }
2591
2592 pub fn with_request<V: Into<crate::model::FetchSelfRequest>>(mut self, v: V) -> Self {
2594 self.0.request = v.into();
2595 self
2596 }
2597
2598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2600 self.0.options = v.into();
2601 self
2602 }
2603
2604 pub async fn send(self) -> Result<crate::model::User> {
2606 (*self.0.stub)
2607 .fetch_self(self.0.request, self.0.options)
2608 .await
2609 .map(crate::Response::into_body)
2610 }
2611
2612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2616 self.0.request.name = v.into();
2617 self
2618 }
2619 }
2620
2621 #[doc(hidden)]
2622 impl crate::RequestBuilder for FetchSelf {
2623 fn request_options(&mut self) -> &mut crate::RequestOptions {
2624 &mut self.0.options
2625 }
2626 }
2627
2628 #[derive(Clone, Debug)]
2646 pub struct DeleteSelf(RequestBuilder<crate::model::DeleteSelfRequest>);
2647
2648 impl DeleteSelf {
2649 pub(crate) fn new(
2650 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2651 ) -> Self {
2652 Self(RequestBuilder::new(stub))
2653 }
2654
2655 pub fn with_request<V: Into<crate::model::DeleteSelfRequest>>(mut self, v: V) -> Self {
2657 self.0.request = v.into();
2658 self
2659 }
2660
2661 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2663 self.0.options = v.into();
2664 self
2665 }
2666
2667 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2674 (*self.0.stub)
2675 .delete_self(self.0.request, self.0.options)
2676 .await
2677 .map(crate::Response::into_body)
2678 }
2679
2680 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2682 type Operation =
2683 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2684 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2685 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2686 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2687 if let Some(ref mut details) = poller_options.tracing {
2688 details.method_name = "google_cloud_developerconnect_v1::client::DeveloperConnect::delete_self::until_done";
2689 }
2690
2691 let stub = self.0.stub.clone();
2692 let mut options = self.0.options.clone();
2693 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2694 let query = move |name| {
2695 let stub = stub.clone();
2696 let options = options.clone();
2697 async {
2698 let op = GetOperation::new(stub)
2699 .set_name(name)
2700 .with_options(options)
2701 .send()
2702 .await?;
2703 Ok(Operation::new(op))
2704 }
2705 };
2706
2707 let start = move || async {
2708 let op = self.send().await?;
2709 Ok(Operation::new(op))
2710 };
2711
2712 use google_cloud_lro::internal::PollerExt;
2713 {
2714 google_cloud_lro::internal::new_unit_response_poller(
2715 polling_error_policy,
2716 polling_backoff_policy,
2717 start,
2718 query,
2719 )
2720 }
2721 .with_options(poller_options)
2722 }
2723
2724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2728 self.0.request.name = v.into();
2729 self
2730 }
2731 }
2732
2733 #[doc(hidden)]
2734 impl crate::RequestBuilder for DeleteSelf {
2735 fn request_options(&mut self) -> &mut crate::RequestOptions {
2736 &mut self.0.options
2737 }
2738 }
2739
2740 #[derive(Clone, Debug)]
2757 pub struct StartOAuth(RequestBuilder<crate::model::StartOAuthRequest>);
2758
2759 impl StartOAuth {
2760 pub(crate) fn new(
2761 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2762 ) -> Self {
2763 Self(RequestBuilder::new(stub))
2764 }
2765
2766 pub fn with_request<V: Into<crate::model::StartOAuthRequest>>(mut self, v: V) -> Self {
2768 self.0.request = v.into();
2769 self
2770 }
2771
2772 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2774 self.0.options = v.into();
2775 self
2776 }
2777
2778 pub async fn send(self) -> Result<crate::model::StartOAuthResponse> {
2780 (*self.0.stub)
2781 .start_o_auth(self.0.request, self.0.options)
2782 .await
2783 .map(crate::Response::into_body)
2784 }
2785
2786 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2790 self.0.request.account_connector = v.into();
2791 self
2792 }
2793 }
2794
2795 #[doc(hidden)]
2796 impl crate::RequestBuilder for StartOAuth {
2797 fn request_options(&mut self) -> &mut crate::RequestOptions {
2798 &mut self.0.options
2799 }
2800 }
2801
2802 #[derive(Clone, Debug)]
2819 pub struct FinishOAuth(RequestBuilder<crate::model::FinishOAuthRequest>);
2820
2821 impl FinishOAuth {
2822 pub(crate) fn new(
2823 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2824 ) -> Self {
2825 Self(RequestBuilder::new(stub))
2826 }
2827
2828 pub fn with_request<V: Into<crate::model::FinishOAuthRequest>>(mut self, v: V) -> Self {
2830 self.0.request = v.into();
2831 self
2832 }
2833
2834 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2836 self.0.options = v.into();
2837 self
2838 }
2839
2840 pub async fn send(self) -> Result<crate::model::FinishOAuthResponse> {
2842 (*self.0.stub)
2843 .finish_o_auth(self.0.request, self.0.options)
2844 .await
2845 .map(crate::Response::into_body)
2846 }
2847
2848 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2852 self.0.request.account_connector = v.into();
2853 self
2854 }
2855
2856 pub fn set_params<T: Into<Option<crate::model::finish_o_auth_request::Params>>>(
2861 mut self,
2862 v: T,
2863 ) -> Self {
2864 self.0.request.params = v.into();
2865 self
2866 }
2867
2868 pub fn set_oauth_params<
2874 T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>,
2875 >(
2876 mut self,
2877 v: T,
2878 ) -> Self {
2879 self.0.request = self.0.request.set_oauth_params(v);
2880 self
2881 }
2882
2883 pub fn set_google_oauth_params<
2889 T: std::convert::Into<
2890 std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>,
2891 >,
2892 >(
2893 mut self,
2894 v: T,
2895 ) -> Self {
2896 self.0.request = self.0.request.set_google_oauth_params(v);
2897 self
2898 }
2899 }
2900
2901 #[doc(hidden)]
2902 impl crate::RequestBuilder for FinishOAuth {
2903 fn request_options(&mut self) -> &mut crate::RequestOptions {
2904 &mut self.0.options
2905 }
2906 }
2907
2908 #[derive(Clone, Debug)]
2929 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2930
2931 impl ListLocations {
2932 pub(crate) fn new(
2933 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2934 ) -> Self {
2935 Self(RequestBuilder::new(stub))
2936 }
2937
2938 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2940 mut self,
2941 v: V,
2942 ) -> Self {
2943 self.0.request = v.into();
2944 self
2945 }
2946
2947 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2949 self.0.options = v.into();
2950 self
2951 }
2952
2953 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2955 (*self.0.stub)
2956 .list_locations(self.0.request, self.0.options)
2957 .await
2958 .map(crate::Response::into_body)
2959 }
2960
2961 pub fn by_page(
2963 self,
2964 ) -> impl google_cloud_gax::paginator::Paginator<
2965 google_cloud_location::model::ListLocationsResponse,
2966 crate::Error,
2967 > {
2968 use std::clone::Clone;
2969 let token = self.0.request.page_token.clone();
2970 let execute = move |token: String| {
2971 let mut builder = self.clone();
2972 builder.0.request = builder.0.request.set_page_token(token);
2973 builder.send()
2974 };
2975 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2976 }
2977
2978 pub fn by_item(
2980 self,
2981 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2982 google_cloud_location::model::ListLocationsResponse,
2983 crate::Error,
2984 > {
2985 use google_cloud_gax::paginator::Paginator;
2986 self.by_page().items()
2987 }
2988
2989 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2991 self.0.request.name = v.into();
2992 self
2993 }
2994
2995 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2997 self.0.request.filter = v.into();
2998 self
2999 }
3000
3001 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3003 self.0.request.page_size = v.into();
3004 self
3005 }
3006
3007 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.0.request.page_token = v.into();
3010 self
3011 }
3012 }
3013
3014 #[doc(hidden)]
3015 impl crate::RequestBuilder for ListLocations {
3016 fn request_options(&mut self) -> &mut crate::RequestOptions {
3017 &mut self.0.options
3018 }
3019 }
3020
3021 #[derive(Clone, Debug)]
3038 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3039
3040 impl GetLocation {
3041 pub(crate) fn new(
3042 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3043 ) -> Self {
3044 Self(RequestBuilder::new(stub))
3045 }
3046
3047 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3049 mut self,
3050 v: V,
3051 ) -> Self {
3052 self.0.request = v.into();
3053 self
3054 }
3055
3056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3058 self.0.options = v.into();
3059 self
3060 }
3061
3062 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3064 (*self.0.stub)
3065 .get_location(self.0.request, self.0.options)
3066 .await
3067 .map(crate::Response::into_body)
3068 }
3069
3070 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3072 self.0.request.name = v.into();
3073 self
3074 }
3075 }
3076
3077 #[doc(hidden)]
3078 impl crate::RequestBuilder for GetLocation {
3079 fn request_options(&mut self) -> &mut crate::RequestOptions {
3080 &mut self.0.options
3081 }
3082 }
3083
3084 #[derive(Clone, Debug)]
3105 pub struct ListOperations(
3106 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3107 );
3108
3109 impl ListOperations {
3110 pub(crate) fn new(
3111 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3112 ) -> Self {
3113 Self(RequestBuilder::new(stub))
3114 }
3115
3116 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3118 mut self,
3119 v: V,
3120 ) -> Self {
3121 self.0.request = v.into();
3122 self
3123 }
3124
3125 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3127 self.0.options = v.into();
3128 self
3129 }
3130
3131 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3133 (*self.0.stub)
3134 .list_operations(self.0.request, self.0.options)
3135 .await
3136 .map(crate::Response::into_body)
3137 }
3138
3139 pub fn by_page(
3141 self,
3142 ) -> impl google_cloud_gax::paginator::Paginator<
3143 google_cloud_longrunning::model::ListOperationsResponse,
3144 crate::Error,
3145 > {
3146 use std::clone::Clone;
3147 let token = self.0.request.page_token.clone();
3148 let execute = move |token: String| {
3149 let mut builder = self.clone();
3150 builder.0.request = builder.0.request.set_page_token(token);
3151 builder.send()
3152 };
3153 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3154 }
3155
3156 pub fn by_item(
3158 self,
3159 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3160 google_cloud_longrunning::model::ListOperationsResponse,
3161 crate::Error,
3162 > {
3163 use google_cloud_gax::paginator::Paginator;
3164 self.by_page().items()
3165 }
3166
3167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3169 self.0.request.name = v.into();
3170 self
3171 }
3172
3173 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3175 self.0.request.filter = v.into();
3176 self
3177 }
3178
3179 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3181 self.0.request.page_size = v.into();
3182 self
3183 }
3184
3185 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3187 self.0.request.page_token = v.into();
3188 self
3189 }
3190
3191 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3193 self.0.request.return_partial_success = v.into();
3194 self
3195 }
3196 }
3197
3198 #[doc(hidden)]
3199 impl crate::RequestBuilder for ListOperations {
3200 fn request_options(&mut self) -> &mut crate::RequestOptions {
3201 &mut self.0.options
3202 }
3203 }
3204
3205 #[derive(Clone, Debug)]
3222 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3223
3224 impl GetOperation {
3225 pub(crate) fn new(
3226 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3227 ) -> Self {
3228 Self(RequestBuilder::new(stub))
3229 }
3230
3231 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3233 mut self,
3234 v: V,
3235 ) -> Self {
3236 self.0.request = v.into();
3237 self
3238 }
3239
3240 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3242 self.0.options = v.into();
3243 self
3244 }
3245
3246 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3248 (*self.0.stub)
3249 .get_operation(self.0.request, self.0.options)
3250 .await
3251 .map(crate::Response::into_body)
3252 }
3253
3254 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3256 self.0.request.name = v.into();
3257 self
3258 }
3259 }
3260
3261 #[doc(hidden)]
3262 impl crate::RequestBuilder for GetOperation {
3263 fn request_options(&mut self) -> &mut crate::RequestOptions {
3264 &mut self.0.options
3265 }
3266 }
3267
3268 #[derive(Clone, Debug)]
3285 pub struct DeleteOperation(
3286 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3287 );
3288
3289 impl DeleteOperation {
3290 pub(crate) fn new(
3291 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3292 ) -> Self {
3293 Self(RequestBuilder::new(stub))
3294 }
3295
3296 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3298 mut self,
3299 v: V,
3300 ) -> Self {
3301 self.0.request = v.into();
3302 self
3303 }
3304
3305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3307 self.0.options = v.into();
3308 self
3309 }
3310
3311 pub async fn send(self) -> Result<()> {
3313 (*self.0.stub)
3314 .delete_operation(self.0.request, self.0.options)
3315 .await
3316 .map(crate::Response::into_body)
3317 }
3318
3319 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3321 self.0.request.name = v.into();
3322 self
3323 }
3324 }
3325
3326 #[doc(hidden)]
3327 impl crate::RequestBuilder for DeleteOperation {
3328 fn request_options(&mut self) -> &mut crate::RequestOptions {
3329 &mut self.0.options
3330 }
3331 }
3332
3333 #[derive(Clone, Debug)]
3350 pub struct CancelOperation(
3351 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3352 );
3353
3354 impl CancelOperation {
3355 pub(crate) fn new(
3356 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3357 ) -> Self {
3358 Self(RequestBuilder::new(stub))
3359 }
3360
3361 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3363 mut self,
3364 v: V,
3365 ) -> Self {
3366 self.0.request = v.into();
3367 self
3368 }
3369
3370 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3372 self.0.options = v.into();
3373 self
3374 }
3375
3376 pub async fn send(self) -> Result<()> {
3378 (*self.0.stub)
3379 .cancel_operation(self.0.request, self.0.options)
3380 .await
3381 .map(crate::Response::into_body)
3382 }
3383
3384 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3386 self.0.request.name = v.into();
3387 self
3388 }
3389 }
3390
3391 #[doc(hidden)]
3392 impl crate::RequestBuilder for CancelOperation {
3393 fn request_options(&mut self) -> &mut crate::RequestOptions {
3394 &mut self.0.options
3395 }
3396 }
3397}
3398
3399pub mod insights_config_service {
3401 use crate::Result;
3402
3403 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3417
3418 pub(crate) mod client {
3419 use super::super::super::client::InsightsConfigService;
3420 pub struct Factory;
3421 impl crate::ClientFactory for Factory {
3422 type Client = InsightsConfigService;
3423 type Credentials = gaxi::options::Credentials;
3424 async fn build(
3425 self,
3426 config: gaxi::options::ClientConfig,
3427 ) -> crate::ClientBuilderResult<Self::Client> {
3428 Self::Client::new(config).await
3429 }
3430 }
3431 }
3432
3433 #[derive(Clone, Debug)]
3435 pub(crate) struct RequestBuilder<R: std::default::Default> {
3436 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3437 request: R,
3438 options: crate::RequestOptions,
3439 }
3440
3441 impl<R> RequestBuilder<R>
3442 where
3443 R: std::default::Default,
3444 {
3445 pub(crate) fn new(
3446 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3447 ) -> Self {
3448 Self {
3449 stub,
3450 request: R::default(),
3451 options: crate::RequestOptions::default(),
3452 }
3453 }
3454 }
3455
3456 #[derive(Clone, Debug)]
3477 pub struct ListInsightsConfigs(RequestBuilder<crate::model::ListInsightsConfigsRequest>);
3478
3479 impl ListInsightsConfigs {
3480 pub(crate) fn new(
3481 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3482 ) -> Self {
3483 Self(RequestBuilder::new(stub))
3484 }
3485
3486 pub fn with_request<V: Into<crate::model::ListInsightsConfigsRequest>>(
3488 mut self,
3489 v: V,
3490 ) -> Self {
3491 self.0.request = v.into();
3492 self
3493 }
3494
3495 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3497 self.0.options = v.into();
3498 self
3499 }
3500
3501 pub async fn send(self) -> Result<crate::model::ListInsightsConfigsResponse> {
3503 (*self.0.stub)
3504 .list_insights_configs(self.0.request, self.0.options)
3505 .await
3506 .map(crate::Response::into_body)
3507 }
3508
3509 pub fn by_page(
3511 self,
3512 ) -> impl google_cloud_gax::paginator::Paginator<
3513 crate::model::ListInsightsConfigsResponse,
3514 crate::Error,
3515 > {
3516 use std::clone::Clone;
3517 let token = self.0.request.page_token.clone();
3518 let execute = move |token: String| {
3519 let mut builder = self.clone();
3520 builder.0.request = builder.0.request.set_page_token(token);
3521 builder.send()
3522 };
3523 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3524 }
3525
3526 pub fn by_item(
3528 self,
3529 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3530 crate::model::ListInsightsConfigsResponse,
3531 crate::Error,
3532 > {
3533 use google_cloud_gax::paginator::Paginator;
3534 self.by_page().items()
3535 }
3536
3537 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3541 self.0.request.parent = v.into();
3542 self
3543 }
3544
3545 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3547 self.0.request.page_size = v.into();
3548 self
3549 }
3550
3551 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3553 self.0.request.page_token = v.into();
3554 self
3555 }
3556
3557 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3559 self.0.request.filter = v.into();
3560 self
3561 }
3562
3563 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3565 self.0.request.order_by = v.into();
3566 self
3567 }
3568 }
3569
3570 #[doc(hidden)]
3571 impl crate::RequestBuilder for ListInsightsConfigs {
3572 fn request_options(&mut self) -> &mut crate::RequestOptions {
3573 &mut self.0.options
3574 }
3575 }
3576
3577 #[derive(Clone, Debug)]
3595 pub struct CreateInsightsConfig(RequestBuilder<crate::model::CreateInsightsConfigRequest>);
3596
3597 impl CreateInsightsConfig {
3598 pub(crate) fn new(
3599 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3600 ) -> Self {
3601 Self(RequestBuilder::new(stub))
3602 }
3603
3604 pub fn with_request<V: Into<crate::model::CreateInsightsConfigRequest>>(
3606 mut self,
3607 v: V,
3608 ) -> Self {
3609 self.0.request = v.into();
3610 self
3611 }
3612
3613 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3615 self.0.options = v.into();
3616 self
3617 }
3618
3619 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3626 (*self.0.stub)
3627 .create_insights_config(self.0.request, self.0.options)
3628 .await
3629 .map(crate::Response::into_body)
3630 }
3631
3632 pub fn poller(
3634 self,
3635 ) -> impl google_cloud_lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3636 {
3637 type Operation = google_cloud_lro::internal::Operation<
3638 crate::model::InsightsConfig,
3639 crate::model::OperationMetadata,
3640 >;
3641 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3642 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3643 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3644 if let Some(ref mut details) = poller_options.tracing {
3645 details.method_name = "google_cloud_developerconnect_v1::client::InsightsConfigService::create_insights_config::until_done";
3646 }
3647
3648 let stub = self.0.stub.clone();
3649 let mut options = self.0.options.clone();
3650 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3651 let query = move |name| {
3652 let stub = stub.clone();
3653 let options = options.clone();
3654 async {
3655 let op = GetOperation::new(stub)
3656 .set_name(name)
3657 .with_options(options)
3658 .send()
3659 .await?;
3660 Ok(Operation::new(op))
3661 }
3662 };
3663
3664 let start = move || async {
3665 let op = self.send().await?;
3666 Ok(Operation::new(op))
3667 };
3668
3669 use google_cloud_lro::internal::PollerExt;
3670 {
3671 google_cloud_lro::internal::new_poller(
3672 polling_error_policy,
3673 polling_backoff_policy,
3674 start,
3675 query,
3676 )
3677 }
3678 .with_options(poller_options)
3679 }
3680
3681 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3685 self.0.request.parent = v.into();
3686 self
3687 }
3688
3689 pub fn set_insights_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3693 self.0.request.insights_config_id = v.into();
3694 self
3695 }
3696
3697 pub fn set_insights_config<T>(mut self, v: T) -> Self
3701 where
3702 T: std::convert::Into<crate::model::InsightsConfig>,
3703 {
3704 self.0.request.insights_config = std::option::Option::Some(v.into());
3705 self
3706 }
3707
3708 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3712 where
3713 T: std::convert::Into<crate::model::InsightsConfig>,
3714 {
3715 self.0.request.insights_config = v.map(|x| x.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
3726 #[doc(hidden)]
3727 impl crate::RequestBuilder for CreateInsightsConfig {
3728 fn request_options(&mut self) -> &mut crate::RequestOptions {
3729 &mut self.0.options
3730 }
3731 }
3732
3733 #[derive(Clone, Debug)]
3750 pub struct GetInsightsConfig(RequestBuilder<crate::model::GetInsightsConfigRequest>);
3751
3752 impl GetInsightsConfig {
3753 pub(crate) fn new(
3754 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3755 ) -> Self {
3756 Self(RequestBuilder::new(stub))
3757 }
3758
3759 pub fn with_request<V: Into<crate::model::GetInsightsConfigRequest>>(
3761 mut self,
3762 v: V,
3763 ) -> Self {
3764 self.0.request = v.into();
3765 self
3766 }
3767
3768 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3770 self.0.options = v.into();
3771 self
3772 }
3773
3774 pub async fn send(self) -> Result<crate::model::InsightsConfig> {
3776 (*self.0.stub)
3777 .get_insights_config(self.0.request, self.0.options)
3778 .await
3779 .map(crate::Response::into_body)
3780 }
3781
3782 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3786 self.0.request.name = v.into();
3787 self
3788 }
3789 }
3790
3791 #[doc(hidden)]
3792 impl crate::RequestBuilder for GetInsightsConfig {
3793 fn request_options(&mut self) -> &mut crate::RequestOptions {
3794 &mut self.0.options
3795 }
3796 }
3797
3798 #[derive(Clone, Debug)]
3816 pub struct UpdateInsightsConfig(RequestBuilder<crate::model::UpdateInsightsConfigRequest>);
3817
3818 impl UpdateInsightsConfig {
3819 pub(crate) fn new(
3820 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3821 ) -> Self {
3822 Self(RequestBuilder::new(stub))
3823 }
3824
3825 pub fn with_request<V: Into<crate::model::UpdateInsightsConfigRequest>>(
3827 mut self,
3828 v: V,
3829 ) -> Self {
3830 self.0.request = v.into();
3831 self
3832 }
3833
3834 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3836 self.0.options = v.into();
3837 self
3838 }
3839
3840 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3847 (*self.0.stub)
3848 .update_insights_config(self.0.request, self.0.options)
3849 .await
3850 .map(crate::Response::into_body)
3851 }
3852
3853 pub fn poller(
3855 self,
3856 ) -> impl google_cloud_lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3857 {
3858 type Operation = google_cloud_lro::internal::Operation<
3859 crate::model::InsightsConfig,
3860 crate::model::OperationMetadata,
3861 >;
3862 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3863 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3864 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3865 if let Some(ref mut details) = poller_options.tracing {
3866 details.method_name = "google_cloud_developerconnect_v1::client::InsightsConfigService::update_insights_config::until_done";
3867 }
3868
3869 let stub = self.0.stub.clone();
3870 let mut options = self.0.options.clone();
3871 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3872 let query = move |name| {
3873 let stub = stub.clone();
3874 let options = options.clone();
3875 async {
3876 let op = GetOperation::new(stub)
3877 .set_name(name)
3878 .with_options(options)
3879 .send()
3880 .await?;
3881 Ok(Operation::new(op))
3882 }
3883 };
3884
3885 let start = move || async {
3886 let op = self.send().await?;
3887 Ok(Operation::new(op))
3888 };
3889
3890 use google_cloud_lro::internal::PollerExt;
3891 {
3892 google_cloud_lro::internal::new_poller(
3893 polling_error_policy,
3894 polling_backoff_policy,
3895 start,
3896 query,
3897 )
3898 }
3899 .with_options(poller_options)
3900 }
3901
3902 pub fn set_insights_config<T>(mut self, v: T) -> Self
3906 where
3907 T: std::convert::Into<crate::model::InsightsConfig>,
3908 {
3909 self.0.request.insights_config = std::option::Option::Some(v.into());
3910 self
3911 }
3912
3913 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3917 where
3918 T: std::convert::Into<crate::model::InsightsConfig>,
3919 {
3920 self.0.request.insights_config = v.map(|x| x.into());
3921 self
3922 }
3923
3924 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3926 self.0.request.request_id = v.into();
3927 self
3928 }
3929
3930 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
3932 self.0.request.allow_missing = v.into();
3933 self
3934 }
3935
3936 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3938 self.0.request.validate_only = v.into();
3939 self
3940 }
3941 }
3942
3943 #[doc(hidden)]
3944 impl crate::RequestBuilder for UpdateInsightsConfig {
3945 fn request_options(&mut self) -> &mut crate::RequestOptions {
3946 &mut self.0.options
3947 }
3948 }
3949
3950 #[derive(Clone, Debug)]
3968 pub struct DeleteInsightsConfig(RequestBuilder<crate::model::DeleteInsightsConfigRequest>);
3969
3970 impl DeleteInsightsConfig {
3971 pub(crate) fn new(
3972 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3973 ) -> Self {
3974 Self(RequestBuilder::new(stub))
3975 }
3976
3977 pub fn with_request<V: Into<crate::model::DeleteInsightsConfigRequest>>(
3979 mut self,
3980 v: V,
3981 ) -> Self {
3982 self.0.request = v.into();
3983 self
3984 }
3985
3986 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3988 self.0.options = v.into();
3989 self
3990 }
3991
3992 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3999 (*self.0.stub)
4000 .delete_insights_config(self.0.request, self.0.options)
4001 .await
4002 .map(crate::Response::into_body)
4003 }
4004
4005 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4007 type Operation =
4008 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4009 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4010 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4011 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4012 if let Some(ref mut details) = poller_options.tracing {
4013 details.method_name = "google_cloud_developerconnect_v1::client::InsightsConfigService::delete_insights_config::until_done";
4014 }
4015
4016 let stub = self.0.stub.clone();
4017 let mut options = self.0.options.clone();
4018 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4019 let query = move |name| {
4020 let stub = stub.clone();
4021 let options = options.clone();
4022 async {
4023 let op = GetOperation::new(stub)
4024 .set_name(name)
4025 .with_options(options)
4026 .send()
4027 .await?;
4028 Ok(Operation::new(op))
4029 }
4030 };
4031
4032 let start = move || async {
4033 let op = self.send().await?;
4034 Ok(Operation::new(op))
4035 };
4036
4037 use google_cloud_lro::internal::PollerExt;
4038 {
4039 google_cloud_lro::internal::new_unit_response_poller(
4040 polling_error_policy,
4041 polling_backoff_policy,
4042 start,
4043 query,
4044 )
4045 }
4046 .with_options(poller_options)
4047 }
4048
4049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4053 self.0.request.name = v.into();
4054 self
4055 }
4056
4057 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4059 self.0.request.request_id = v.into();
4060 self
4061 }
4062
4063 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4065 self.0.request.validate_only = v.into();
4066 self
4067 }
4068
4069 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4071 self.0.request.etag = v.into();
4072 self
4073 }
4074 }
4075
4076 #[doc(hidden)]
4077 impl crate::RequestBuilder for DeleteInsightsConfig {
4078 fn request_options(&mut self) -> &mut crate::RequestOptions {
4079 &mut self.0.options
4080 }
4081 }
4082
4083 #[derive(Clone, Debug)]
4100 pub struct GetDeploymentEvent(RequestBuilder<crate::model::GetDeploymentEventRequest>);
4101
4102 impl GetDeploymentEvent {
4103 pub(crate) fn new(
4104 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4105 ) -> Self {
4106 Self(RequestBuilder::new(stub))
4107 }
4108
4109 pub fn with_request<V: Into<crate::model::GetDeploymentEventRequest>>(
4111 mut self,
4112 v: V,
4113 ) -> Self {
4114 self.0.request = v.into();
4115 self
4116 }
4117
4118 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4120 self.0.options = v.into();
4121 self
4122 }
4123
4124 pub async fn send(self) -> Result<crate::model::DeploymentEvent> {
4126 (*self.0.stub)
4127 .get_deployment_event(self.0.request, self.0.options)
4128 .await
4129 .map(crate::Response::into_body)
4130 }
4131
4132 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4136 self.0.request.name = v.into();
4137 self
4138 }
4139 }
4140
4141 #[doc(hidden)]
4142 impl crate::RequestBuilder for GetDeploymentEvent {
4143 fn request_options(&mut self) -> &mut crate::RequestOptions {
4144 &mut self.0.options
4145 }
4146 }
4147
4148 #[derive(Clone, Debug)]
4169 pub struct ListDeploymentEvents(RequestBuilder<crate::model::ListDeploymentEventsRequest>);
4170
4171 impl ListDeploymentEvents {
4172 pub(crate) fn new(
4173 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4174 ) -> Self {
4175 Self(RequestBuilder::new(stub))
4176 }
4177
4178 pub fn with_request<V: Into<crate::model::ListDeploymentEventsRequest>>(
4180 mut self,
4181 v: V,
4182 ) -> Self {
4183 self.0.request = v.into();
4184 self
4185 }
4186
4187 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4189 self.0.options = v.into();
4190 self
4191 }
4192
4193 pub async fn send(self) -> Result<crate::model::ListDeploymentEventsResponse> {
4195 (*self.0.stub)
4196 .list_deployment_events(self.0.request, self.0.options)
4197 .await
4198 .map(crate::Response::into_body)
4199 }
4200
4201 pub fn by_page(
4203 self,
4204 ) -> impl google_cloud_gax::paginator::Paginator<
4205 crate::model::ListDeploymentEventsResponse,
4206 crate::Error,
4207 > {
4208 use std::clone::Clone;
4209 let token = self.0.request.page_token.clone();
4210 let execute = move |token: String| {
4211 let mut builder = self.clone();
4212 builder.0.request = builder.0.request.set_page_token(token);
4213 builder.send()
4214 };
4215 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4216 }
4217
4218 pub fn by_item(
4220 self,
4221 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4222 crate::model::ListDeploymentEventsResponse,
4223 crate::Error,
4224 > {
4225 use google_cloud_gax::paginator::Paginator;
4226 self.by_page().items()
4227 }
4228
4229 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4233 self.0.request.parent = v.into();
4234 self
4235 }
4236
4237 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4239 self.0.request.page_size = v.into();
4240 self
4241 }
4242
4243 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4245 self.0.request.page_token = v.into();
4246 self
4247 }
4248
4249 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4251 self.0.request.filter = v.into();
4252 self
4253 }
4254 }
4255
4256 #[doc(hidden)]
4257 impl crate::RequestBuilder for ListDeploymentEvents {
4258 fn request_options(&mut self) -> &mut crate::RequestOptions {
4259 &mut self.0.options
4260 }
4261 }
4262
4263 #[derive(Clone, Debug)]
4284 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4285
4286 impl ListLocations {
4287 pub(crate) fn new(
4288 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4289 ) -> Self {
4290 Self(RequestBuilder::new(stub))
4291 }
4292
4293 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4295 mut self,
4296 v: V,
4297 ) -> Self {
4298 self.0.request = v.into();
4299 self
4300 }
4301
4302 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4304 self.0.options = v.into();
4305 self
4306 }
4307
4308 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4310 (*self.0.stub)
4311 .list_locations(self.0.request, self.0.options)
4312 .await
4313 .map(crate::Response::into_body)
4314 }
4315
4316 pub fn by_page(
4318 self,
4319 ) -> impl google_cloud_gax::paginator::Paginator<
4320 google_cloud_location::model::ListLocationsResponse,
4321 crate::Error,
4322 > {
4323 use std::clone::Clone;
4324 let token = self.0.request.page_token.clone();
4325 let execute = move |token: String| {
4326 let mut builder = self.clone();
4327 builder.0.request = builder.0.request.set_page_token(token);
4328 builder.send()
4329 };
4330 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4331 }
4332
4333 pub fn by_item(
4335 self,
4336 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4337 google_cloud_location::model::ListLocationsResponse,
4338 crate::Error,
4339 > {
4340 use google_cloud_gax::paginator::Paginator;
4341 self.by_page().items()
4342 }
4343
4344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4346 self.0.request.name = v.into();
4347 self
4348 }
4349
4350 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4352 self.0.request.filter = v.into();
4353 self
4354 }
4355
4356 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4358 self.0.request.page_size = v.into();
4359 self
4360 }
4361
4362 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4364 self.0.request.page_token = v.into();
4365 self
4366 }
4367 }
4368
4369 #[doc(hidden)]
4370 impl crate::RequestBuilder for ListLocations {
4371 fn request_options(&mut self) -> &mut crate::RequestOptions {
4372 &mut self.0.options
4373 }
4374 }
4375
4376 #[derive(Clone, Debug)]
4393 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4394
4395 impl GetLocation {
4396 pub(crate) fn new(
4397 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4398 ) -> Self {
4399 Self(RequestBuilder::new(stub))
4400 }
4401
4402 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4404 mut self,
4405 v: V,
4406 ) -> Self {
4407 self.0.request = v.into();
4408 self
4409 }
4410
4411 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4413 self.0.options = v.into();
4414 self
4415 }
4416
4417 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4419 (*self.0.stub)
4420 .get_location(self.0.request, self.0.options)
4421 .await
4422 .map(crate::Response::into_body)
4423 }
4424
4425 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4427 self.0.request.name = v.into();
4428 self
4429 }
4430 }
4431
4432 #[doc(hidden)]
4433 impl crate::RequestBuilder for GetLocation {
4434 fn request_options(&mut self) -> &mut crate::RequestOptions {
4435 &mut self.0.options
4436 }
4437 }
4438
4439 #[derive(Clone, Debug)]
4460 pub struct ListOperations(
4461 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4462 );
4463
4464 impl ListOperations {
4465 pub(crate) fn new(
4466 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4467 ) -> Self {
4468 Self(RequestBuilder::new(stub))
4469 }
4470
4471 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4473 mut self,
4474 v: V,
4475 ) -> Self {
4476 self.0.request = v.into();
4477 self
4478 }
4479
4480 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4482 self.0.options = v.into();
4483 self
4484 }
4485
4486 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4488 (*self.0.stub)
4489 .list_operations(self.0.request, self.0.options)
4490 .await
4491 .map(crate::Response::into_body)
4492 }
4493
4494 pub fn by_page(
4496 self,
4497 ) -> impl google_cloud_gax::paginator::Paginator<
4498 google_cloud_longrunning::model::ListOperationsResponse,
4499 crate::Error,
4500 > {
4501 use std::clone::Clone;
4502 let token = self.0.request.page_token.clone();
4503 let execute = move |token: String| {
4504 let mut builder = self.clone();
4505 builder.0.request = builder.0.request.set_page_token(token);
4506 builder.send()
4507 };
4508 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4509 }
4510
4511 pub fn by_item(
4513 self,
4514 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4515 google_cloud_longrunning::model::ListOperationsResponse,
4516 crate::Error,
4517 > {
4518 use google_cloud_gax::paginator::Paginator;
4519 self.by_page().items()
4520 }
4521
4522 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4524 self.0.request.name = v.into();
4525 self
4526 }
4527
4528 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4530 self.0.request.filter = v.into();
4531 self
4532 }
4533
4534 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4536 self.0.request.page_size = v.into();
4537 self
4538 }
4539
4540 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4542 self.0.request.page_token = v.into();
4543 self
4544 }
4545
4546 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4548 self.0.request.return_partial_success = v.into();
4549 self
4550 }
4551 }
4552
4553 #[doc(hidden)]
4554 impl crate::RequestBuilder for ListOperations {
4555 fn request_options(&mut self) -> &mut crate::RequestOptions {
4556 &mut self.0.options
4557 }
4558 }
4559
4560 #[derive(Clone, Debug)]
4577 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4578
4579 impl GetOperation {
4580 pub(crate) fn new(
4581 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4582 ) -> Self {
4583 Self(RequestBuilder::new(stub))
4584 }
4585
4586 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4588 mut self,
4589 v: V,
4590 ) -> Self {
4591 self.0.request = v.into();
4592 self
4593 }
4594
4595 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4597 self.0.options = v.into();
4598 self
4599 }
4600
4601 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4603 (*self.0.stub)
4604 .get_operation(self.0.request, self.0.options)
4605 .await
4606 .map(crate::Response::into_body)
4607 }
4608
4609 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4611 self.0.request.name = v.into();
4612 self
4613 }
4614 }
4615
4616 #[doc(hidden)]
4617 impl crate::RequestBuilder for GetOperation {
4618 fn request_options(&mut self) -> &mut crate::RequestOptions {
4619 &mut self.0.options
4620 }
4621 }
4622
4623 #[derive(Clone, Debug)]
4640 pub struct DeleteOperation(
4641 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4642 );
4643
4644 impl DeleteOperation {
4645 pub(crate) fn new(
4646 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4647 ) -> Self {
4648 Self(RequestBuilder::new(stub))
4649 }
4650
4651 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4653 mut self,
4654 v: V,
4655 ) -> Self {
4656 self.0.request = v.into();
4657 self
4658 }
4659
4660 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4662 self.0.options = v.into();
4663 self
4664 }
4665
4666 pub async fn send(self) -> Result<()> {
4668 (*self.0.stub)
4669 .delete_operation(self.0.request, self.0.options)
4670 .await
4671 .map(crate::Response::into_body)
4672 }
4673
4674 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4676 self.0.request.name = v.into();
4677 self
4678 }
4679 }
4680
4681 #[doc(hidden)]
4682 impl crate::RequestBuilder for DeleteOperation {
4683 fn request_options(&mut self) -> &mut crate::RequestOptions {
4684 &mut self.0.options
4685 }
4686 }
4687
4688 #[derive(Clone, Debug)]
4705 pub struct CancelOperation(
4706 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4707 );
4708
4709 impl CancelOperation {
4710 pub(crate) fn new(
4711 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4712 ) -> Self {
4713 Self(RequestBuilder::new(stub))
4714 }
4715
4716 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4718 mut self,
4719 v: V,
4720 ) -> Self {
4721 self.0.request = v.into();
4722 self
4723 }
4724
4725 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4727 self.0.options = v.into();
4728 self
4729 }
4730
4731 pub async fn send(self) -> Result<()> {
4733 (*self.0.stub)
4734 .cancel_operation(self.0.request, self.0.options)
4735 .await
4736 .map(crate::Response::into_body)
4737 }
4738
4739 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4741 self.0.request.name = v.into();
4742 self
4743 }
4744 }
4745
4746 #[doc(hidden)]
4747 impl crate::RequestBuilder for CancelOperation {
4748 fn request_options(&mut self) -> &mut crate::RequestOptions {
4749 &mut self.0.options
4750 }
4751 }
4752}