1pub mod developer_connect {
18 use crate::Result;
19 use std::sync::Arc;
20
21 pub type ClientBuilder =
35 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
36
37 pub(crate) mod client {
38 use super::super::super::client::DeveloperConnect;
39 pub struct Factory;
40 impl gax::client_builder::internal::ClientFactory for Factory {
41 type Client = DeveloperConnect;
42 type Credentials = gaxi::options::Credentials;
43 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
44 Self::Client::new(config).await
45 }
46 }
47 }
48
49 #[derive(Clone, Debug)]
51 pub(crate) struct RequestBuilder<R: std::default::Default> {
52 stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
53 request: R,
54 options: gax::options::RequestOptions,
55 }
56
57 impl<R> RequestBuilder<R>
58 where
59 R: std::default::Default,
60 {
61 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
62 Self {
63 stub,
64 request: R::default(),
65 options: gax::options::RequestOptions::default(),
66 }
67 }
68 }
69
70 #[derive(Clone, Debug)]
72 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
73
74 impl ListConnections {
75 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
76 Self(RequestBuilder::new(stub))
77 }
78
79 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
81 self.0.request = v.into();
82 self
83 }
84
85 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
87 self.0.options = v.into();
88 self
89 }
90
91 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
93 (*self.0.stub)
94 .list_connections(self.0.request, self.0.options)
95 .await
96 .map(gax::response::Response::into_body)
97 }
98
99 pub async fn paginator(
101 self,
102 ) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::Error>
103 {
104 use std::clone::Clone;
105 let token = self.0.request.page_token.clone();
106 let execute = move |token: String| {
107 let mut builder = self.clone();
108 builder.0.request = builder.0.request.set_page_token(token);
109 builder.send()
110 };
111 gax::paginator::internal::new_paginator(token, execute)
112 }
113
114 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
116 self.0.request.parent = v.into();
117 self
118 }
119
120 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
122 self.0.request.page_size = v.into();
123 self
124 }
125
126 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
128 self.0.request.page_token = v.into();
129 self
130 }
131
132 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
134 self.0.request.filter = v.into();
135 self
136 }
137
138 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
140 self.0.request.order_by = v.into();
141 self
142 }
143 }
144
145 #[doc(hidden)]
146 impl gax::options::internal::RequestBuilder for ListConnections {
147 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
148 &mut self.0.options
149 }
150 }
151
152 #[derive(Clone, Debug)]
154 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
155
156 impl GetConnection {
157 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
158 Self(RequestBuilder::new(stub))
159 }
160
161 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
163 self.0.request = v.into();
164 self
165 }
166
167 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
169 self.0.options = v.into();
170 self
171 }
172
173 pub async fn send(self) -> Result<crate::model::Connection> {
175 (*self.0.stub)
176 .get_connection(self.0.request, self.0.options)
177 .await
178 .map(gax::response::Response::into_body)
179 }
180
181 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
183 self.0.request.name = v.into();
184 self
185 }
186 }
187
188 #[doc(hidden)]
189 impl gax::options::internal::RequestBuilder for GetConnection {
190 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
191 &mut self.0.options
192 }
193 }
194
195 #[derive(Clone, Debug)]
197 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
198
199 impl CreateConnection {
200 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
201 Self(RequestBuilder::new(stub))
202 }
203
204 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
206 mut self,
207 v: V,
208 ) -> Self {
209 self.0.request = v.into();
210 self
211 }
212
213 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
215 self.0.options = v.into();
216 self
217 }
218
219 pub async fn send(self) -> Result<longrunning::model::Operation> {
226 (*self.0.stub)
227 .create_connection(self.0.request, self.0.options)
228 .await
229 .map(gax::response::Response::into_body)
230 }
231
232 pub fn poller(
234 self,
235 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
236 type Operation =
237 lro::Operation<crate::model::Connection, crate::model::OperationMetadata>;
238 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
239 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
240
241 let stub = self.0.stub.clone();
242 let mut options = self.0.options.clone();
243 options.set_retry_policy(gax::retry_policy::NeverRetry);
244 let query = move |name| {
245 let stub = stub.clone();
246 let options = options.clone();
247 async {
248 let op = GetOperation::new(stub)
249 .set_name(name)
250 .with_options(options)
251 .send()
252 .await?;
253 Ok(Operation::new(op))
254 }
255 };
256
257 let start = move || async {
258 let op = self.send().await?;
259 Ok(Operation::new(op))
260 };
261
262 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
263 }
264
265 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
267 self.0.request.parent = v.into();
268 self
269 }
270
271 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
273 self.0.request.connection_id = v.into();
274 self
275 }
276
277 pub fn set_connection<T: Into<std::option::Option<crate::model::Connection>>>(
279 mut self,
280 v: T,
281 ) -> Self {
282 self.0.request.connection = v.into();
283 self
284 }
285
286 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
288 self.0.request.request_id = v.into();
289 self
290 }
291
292 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
294 self.0.request.validate_only = v.into();
295 self
296 }
297 }
298
299 #[doc(hidden)]
300 impl gax::options::internal::RequestBuilder for CreateConnection {
301 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
302 &mut self.0.options
303 }
304 }
305
306 #[derive(Clone, Debug)]
308 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
309
310 impl UpdateConnection {
311 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
312 Self(RequestBuilder::new(stub))
313 }
314
315 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
317 mut self,
318 v: V,
319 ) -> Self {
320 self.0.request = v.into();
321 self
322 }
323
324 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
326 self.0.options = v.into();
327 self
328 }
329
330 pub async fn send(self) -> Result<longrunning::model::Operation> {
337 (*self.0.stub)
338 .update_connection(self.0.request, self.0.options)
339 .await
340 .map(gax::response::Response::into_body)
341 }
342
343 pub fn poller(
345 self,
346 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
347 type Operation =
348 lro::Operation<crate::model::Connection, crate::model::OperationMetadata>;
349 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
350 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
351
352 let stub = self.0.stub.clone();
353 let mut options = self.0.options.clone();
354 options.set_retry_policy(gax::retry_policy::NeverRetry);
355 let query = move |name| {
356 let stub = stub.clone();
357 let options = options.clone();
358 async {
359 let op = GetOperation::new(stub)
360 .set_name(name)
361 .with_options(options)
362 .send()
363 .await?;
364 Ok(Operation::new(op))
365 }
366 };
367
368 let start = move || async {
369 let op = self.send().await?;
370 Ok(Operation::new(op))
371 };
372
373 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
374 }
375
376 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
378 mut self,
379 v: T,
380 ) -> Self {
381 self.0.request.update_mask = v.into();
382 self
383 }
384
385 pub fn set_connection<T: Into<std::option::Option<crate::model::Connection>>>(
387 mut self,
388 v: T,
389 ) -> Self {
390 self.0.request.connection = v.into();
391 self
392 }
393
394 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
396 self.0.request.request_id = v.into();
397 self
398 }
399
400 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
402 self.0.request.allow_missing = v.into();
403 self
404 }
405
406 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
408 self.0.request.validate_only = v.into();
409 self
410 }
411 }
412
413 #[doc(hidden)]
414 impl gax::options::internal::RequestBuilder for UpdateConnection {
415 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
416 &mut self.0.options
417 }
418 }
419
420 #[derive(Clone, Debug)]
422 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
423
424 impl DeleteConnection {
425 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
426 Self(RequestBuilder::new(stub))
427 }
428
429 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
431 mut self,
432 v: V,
433 ) -> Self {
434 self.0.request = v.into();
435 self
436 }
437
438 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
440 self.0.options = v.into();
441 self
442 }
443
444 pub async fn send(self) -> Result<longrunning::model::Operation> {
451 (*self.0.stub)
452 .delete_connection(self.0.request, self.0.options)
453 .await
454 .map(gax::response::Response::into_body)
455 }
456
457 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
459 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
460 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
461 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
462
463 let stub = self.0.stub.clone();
464 let mut options = self.0.options.clone();
465 options.set_retry_policy(gax::retry_policy::NeverRetry);
466 let query = move |name| {
467 let stub = stub.clone();
468 let options = options.clone();
469 async {
470 let op = GetOperation::new(stub)
471 .set_name(name)
472 .with_options(options)
473 .send()
474 .await?;
475 Ok(Operation::new(op))
476 }
477 };
478
479 let start = move || async {
480 let op = self.send().await?;
481 Ok(Operation::new(op))
482 };
483
484 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
485 }
486
487 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
489 self.0.request.name = v.into();
490 self
491 }
492
493 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
495 self.0.request.request_id = v.into();
496 self
497 }
498
499 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
501 self.0.request.validate_only = v.into();
502 self
503 }
504
505 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
507 self.0.request.etag = v.into();
508 self
509 }
510 }
511
512 #[doc(hidden)]
513 impl gax::options::internal::RequestBuilder for DeleteConnection {
514 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
515 &mut self.0.options
516 }
517 }
518
519 #[derive(Clone, Debug)]
521 pub struct CreateGitRepositoryLink(
522 RequestBuilder<crate::model::CreateGitRepositoryLinkRequest>,
523 );
524
525 impl CreateGitRepositoryLink {
526 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
527 Self(RequestBuilder::new(stub))
528 }
529
530 pub fn with_request<V: Into<crate::model::CreateGitRepositoryLinkRequest>>(
532 mut self,
533 v: V,
534 ) -> Self {
535 self.0.request = v.into();
536 self
537 }
538
539 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
541 self.0.options = v.into();
542 self
543 }
544
545 pub async fn send(self) -> Result<longrunning::model::Operation> {
552 (*self.0.stub)
553 .create_git_repository_link(self.0.request, self.0.options)
554 .await
555 .map(gax::response::Response::into_body)
556 }
557
558 pub fn poller(
560 self,
561 ) -> impl lro::Poller<crate::model::GitRepositoryLink, crate::model::OperationMetadata>
562 {
563 type Operation =
564 lro::Operation<crate::model::GitRepositoryLink, crate::model::OperationMetadata>;
565 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
566 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
567
568 let stub = self.0.stub.clone();
569 let mut options = self.0.options.clone();
570 options.set_retry_policy(gax::retry_policy::NeverRetry);
571 let query = move |name| {
572 let stub = stub.clone();
573 let options = options.clone();
574 async {
575 let op = GetOperation::new(stub)
576 .set_name(name)
577 .with_options(options)
578 .send()
579 .await?;
580 Ok(Operation::new(op))
581 }
582 };
583
584 let start = move || async {
585 let op = self.send().await?;
586 Ok(Operation::new(op))
587 };
588
589 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
590 }
591
592 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
594 self.0.request.parent = v.into();
595 self
596 }
597
598 pub fn set_git_repository_link<
600 T: Into<std::option::Option<crate::model::GitRepositoryLink>>,
601 >(
602 mut self,
603 v: T,
604 ) -> Self {
605 self.0.request.git_repository_link = v.into();
606 self
607 }
608
609 pub fn set_git_repository_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
611 self.0.request.git_repository_link_id = v.into();
612 self
613 }
614
615 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
617 self.0.request.request_id = v.into();
618 self
619 }
620
621 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
623 self.0.request.validate_only = v.into();
624 self
625 }
626 }
627
628 #[doc(hidden)]
629 impl gax::options::internal::RequestBuilder for CreateGitRepositoryLink {
630 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
631 &mut self.0.options
632 }
633 }
634
635 #[derive(Clone, Debug)]
637 pub struct DeleteGitRepositoryLink(
638 RequestBuilder<crate::model::DeleteGitRepositoryLinkRequest>,
639 );
640
641 impl DeleteGitRepositoryLink {
642 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
643 Self(RequestBuilder::new(stub))
644 }
645
646 pub fn with_request<V: Into<crate::model::DeleteGitRepositoryLinkRequest>>(
648 mut self,
649 v: V,
650 ) -> Self {
651 self.0.request = v.into();
652 self
653 }
654
655 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
657 self.0.options = v.into();
658 self
659 }
660
661 pub async fn send(self) -> Result<longrunning::model::Operation> {
668 (*self.0.stub)
669 .delete_git_repository_link(self.0.request, self.0.options)
670 .await
671 .map(gax::response::Response::into_body)
672 }
673
674 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
676 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
677 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
678 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
679
680 let stub = self.0.stub.clone();
681 let mut options = self.0.options.clone();
682 options.set_retry_policy(gax::retry_policy::NeverRetry);
683 let query = move |name| {
684 let stub = stub.clone();
685 let options = options.clone();
686 async {
687 let op = GetOperation::new(stub)
688 .set_name(name)
689 .with_options(options)
690 .send()
691 .await?;
692 Ok(Operation::new(op))
693 }
694 };
695
696 let start = move || async {
697 let op = self.send().await?;
698 Ok(Operation::new(op))
699 };
700
701 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
702 }
703
704 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
706 self.0.request.name = v.into();
707 self
708 }
709
710 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
712 self.0.request.request_id = v.into();
713 self
714 }
715
716 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
718 self.0.request.validate_only = v.into();
719 self
720 }
721
722 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
724 self.0.request.etag = v.into();
725 self
726 }
727 }
728
729 #[doc(hidden)]
730 impl gax::options::internal::RequestBuilder for DeleteGitRepositoryLink {
731 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
732 &mut self.0.options
733 }
734 }
735
736 #[derive(Clone, Debug)]
738 pub struct ListGitRepositoryLinks(RequestBuilder<crate::model::ListGitRepositoryLinksRequest>);
739
740 impl ListGitRepositoryLinks {
741 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
742 Self(RequestBuilder::new(stub))
743 }
744
745 pub fn with_request<V: Into<crate::model::ListGitRepositoryLinksRequest>>(
747 mut self,
748 v: V,
749 ) -> Self {
750 self.0.request = v.into();
751 self
752 }
753
754 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
756 self.0.options = v.into();
757 self
758 }
759
760 pub async fn send(self) -> Result<crate::model::ListGitRepositoryLinksResponse> {
762 (*self.0.stub)
763 .list_git_repository_links(self.0.request, self.0.options)
764 .await
765 .map(gax::response::Response::into_body)
766 }
767
768 pub async fn paginator(
770 self,
771 ) -> impl gax::paginator::Paginator<
772 crate::model::ListGitRepositoryLinksResponse,
773 gax::error::Error,
774 > {
775 use std::clone::Clone;
776 let token = self.0.request.page_token.clone();
777 let execute = move |token: String| {
778 let mut builder = self.clone();
779 builder.0.request = builder.0.request.set_page_token(token);
780 builder.send()
781 };
782 gax::paginator::internal::new_paginator(token, execute)
783 }
784
785 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
787 self.0.request.parent = v.into();
788 self
789 }
790
791 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
793 self.0.request.page_size = v.into();
794 self
795 }
796
797 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
799 self.0.request.page_token = v.into();
800 self
801 }
802
803 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
805 self.0.request.filter = v.into();
806 self
807 }
808
809 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
811 self.0.request.order_by = v.into();
812 self
813 }
814 }
815
816 #[doc(hidden)]
817 impl gax::options::internal::RequestBuilder for ListGitRepositoryLinks {
818 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
819 &mut self.0.options
820 }
821 }
822
823 #[derive(Clone, Debug)]
825 pub struct GetGitRepositoryLink(RequestBuilder<crate::model::GetGitRepositoryLinkRequest>);
826
827 impl GetGitRepositoryLink {
828 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
829 Self(RequestBuilder::new(stub))
830 }
831
832 pub fn with_request<V: Into<crate::model::GetGitRepositoryLinkRequest>>(
834 mut self,
835 v: V,
836 ) -> Self {
837 self.0.request = v.into();
838 self
839 }
840
841 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
843 self.0.options = v.into();
844 self
845 }
846
847 pub async fn send(self) -> Result<crate::model::GitRepositoryLink> {
849 (*self.0.stub)
850 .get_git_repository_link(self.0.request, self.0.options)
851 .await
852 .map(gax::response::Response::into_body)
853 }
854
855 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
857 self.0.request.name = v.into();
858 self
859 }
860 }
861
862 #[doc(hidden)]
863 impl gax::options::internal::RequestBuilder for GetGitRepositoryLink {
864 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
865 &mut self.0.options
866 }
867 }
868
869 #[derive(Clone, Debug)]
871 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
872
873 impl FetchReadWriteToken {
874 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
875 Self(RequestBuilder::new(stub))
876 }
877
878 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
880 mut self,
881 v: V,
882 ) -> Self {
883 self.0.request = v.into();
884 self
885 }
886
887 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
889 self.0.options = v.into();
890 self
891 }
892
893 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
895 (*self.0.stub)
896 .fetch_read_write_token(self.0.request, self.0.options)
897 .await
898 .map(gax::response::Response::into_body)
899 }
900
901 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
903 self.0.request.git_repository_link = v.into();
904 self
905 }
906 }
907
908 #[doc(hidden)]
909 impl gax::options::internal::RequestBuilder for FetchReadWriteToken {
910 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
911 &mut self.0.options
912 }
913 }
914
915 #[derive(Clone, Debug)]
917 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
918
919 impl FetchReadToken {
920 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
921 Self(RequestBuilder::new(stub))
922 }
923
924 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
926 self.0.request = v.into();
927 self
928 }
929
930 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
932 self.0.options = v.into();
933 self
934 }
935
936 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
938 (*self.0.stub)
939 .fetch_read_token(self.0.request, self.0.options)
940 .await
941 .map(gax::response::Response::into_body)
942 }
943
944 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
946 self.0.request.git_repository_link = v.into();
947 self
948 }
949 }
950
951 #[doc(hidden)]
952 impl gax::options::internal::RequestBuilder for FetchReadToken {
953 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
954 &mut self.0.options
955 }
956 }
957
958 #[derive(Clone, Debug)]
960 pub struct FetchLinkableGitRepositories(
961 RequestBuilder<crate::model::FetchLinkableGitRepositoriesRequest>,
962 );
963
964 impl FetchLinkableGitRepositories {
965 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
966 Self(RequestBuilder::new(stub))
967 }
968
969 pub fn with_request<V: Into<crate::model::FetchLinkableGitRepositoriesRequest>>(
971 mut self,
972 v: V,
973 ) -> Self {
974 self.0.request = v.into();
975 self
976 }
977
978 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
980 self.0.options = v.into();
981 self
982 }
983
984 pub async fn send(self) -> Result<crate::model::FetchLinkableGitRepositoriesResponse> {
986 (*self.0.stub)
987 .fetch_linkable_git_repositories(self.0.request, self.0.options)
988 .await
989 .map(gax::response::Response::into_body)
990 }
991
992 pub async fn paginator(
994 self,
995 ) -> impl gax::paginator::Paginator<
996 crate::model::FetchLinkableGitRepositoriesResponse,
997 gax::error::Error,
998 > {
999 use std::clone::Clone;
1000 let token = self.0.request.page_token.clone();
1001 let execute = move |token: String| {
1002 let mut builder = self.clone();
1003 builder.0.request = builder.0.request.set_page_token(token);
1004 builder.send()
1005 };
1006 gax::paginator::internal::new_paginator(token, execute)
1007 }
1008
1009 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1011 self.0.request.connection = v.into();
1012 self
1013 }
1014
1015 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1017 self.0.request.page_size = v.into();
1018 self
1019 }
1020
1021 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1023 self.0.request.page_token = v.into();
1024 self
1025 }
1026 }
1027
1028 #[doc(hidden)]
1029 impl gax::options::internal::RequestBuilder for FetchLinkableGitRepositories {
1030 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1031 &mut self.0.options
1032 }
1033 }
1034
1035 #[derive(Clone, Debug)]
1037 pub struct FetchGitHubInstallations(
1038 RequestBuilder<crate::model::FetchGitHubInstallationsRequest>,
1039 );
1040
1041 impl FetchGitHubInstallations {
1042 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
1043 Self(RequestBuilder::new(stub))
1044 }
1045
1046 pub fn with_request<V: Into<crate::model::FetchGitHubInstallationsRequest>>(
1048 mut self,
1049 v: V,
1050 ) -> Self {
1051 self.0.request = v.into();
1052 self
1053 }
1054
1055 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1057 self.0.options = v.into();
1058 self
1059 }
1060
1061 pub async fn send(self) -> Result<crate::model::FetchGitHubInstallationsResponse> {
1063 (*self.0.stub)
1064 .fetch_git_hub_installations(self.0.request, self.0.options)
1065 .await
1066 .map(gax::response::Response::into_body)
1067 }
1068
1069 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1071 self.0.request.connection = v.into();
1072 self
1073 }
1074 }
1075
1076 #[doc(hidden)]
1077 impl gax::options::internal::RequestBuilder for FetchGitHubInstallations {
1078 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1079 &mut self.0.options
1080 }
1081 }
1082
1083 #[derive(Clone, Debug)]
1085 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1086
1087 impl FetchGitRefs {
1088 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
1089 Self(RequestBuilder::new(stub))
1090 }
1091
1092 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1094 self.0.request = v.into();
1095 self
1096 }
1097
1098 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1100 self.0.options = v.into();
1101 self
1102 }
1103
1104 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1106 (*self.0.stub)
1107 .fetch_git_refs(self.0.request, self.0.options)
1108 .await
1109 .map(gax::response::Response::into_body)
1110 }
1111
1112 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1114 self.0.request.git_repository_link = v.into();
1115 self
1116 }
1117
1118 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1120 mut self,
1121 v: T,
1122 ) -> Self {
1123 self.0.request.ref_type = v.into();
1124 self
1125 }
1126
1127 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1129 self.0.request.page_size = v.into();
1130 self
1131 }
1132
1133 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1135 self.0.request.page_token = v.into();
1136 self
1137 }
1138 }
1139
1140 #[doc(hidden)]
1141 impl gax::options::internal::RequestBuilder for FetchGitRefs {
1142 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1143 &mut self.0.options
1144 }
1145 }
1146
1147 #[derive(Clone, Debug)]
1149 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1150
1151 impl ListLocations {
1152 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
1153 Self(RequestBuilder::new(stub))
1154 }
1155
1156 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1158 mut self,
1159 v: V,
1160 ) -> Self {
1161 self.0.request = v.into();
1162 self
1163 }
1164
1165 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1167 self.0.options = v.into();
1168 self
1169 }
1170
1171 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1173 (*self.0.stub)
1174 .list_locations(self.0.request, self.0.options)
1175 .await
1176 .map(gax::response::Response::into_body)
1177 }
1178
1179 pub async fn paginator(
1181 self,
1182 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1183 {
1184 use std::clone::Clone;
1185 let token = self.0.request.page_token.clone();
1186 let execute = move |token: String| {
1187 let mut builder = self.clone();
1188 builder.0.request = builder.0.request.set_page_token(token);
1189 builder.send()
1190 };
1191 gax::paginator::internal::new_paginator(token, execute)
1192 }
1193
1194 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1196 self.0.request.name = v.into();
1197 self
1198 }
1199
1200 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1202 self.0.request.filter = v.into();
1203 self
1204 }
1205
1206 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1208 self.0.request.page_size = v.into();
1209 self
1210 }
1211
1212 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1214 self.0.request.page_token = v.into();
1215 self
1216 }
1217 }
1218
1219 #[doc(hidden)]
1220 impl gax::options::internal::RequestBuilder for ListLocations {
1221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1222 &mut self.0.options
1223 }
1224 }
1225
1226 #[derive(Clone, Debug)]
1228 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1229
1230 impl GetLocation {
1231 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
1232 Self(RequestBuilder::new(stub))
1233 }
1234
1235 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1237 self.0.request = v.into();
1238 self
1239 }
1240
1241 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1243 self.0.options = v.into();
1244 self
1245 }
1246
1247 pub async fn send(self) -> Result<location::model::Location> {
1249 (*self.0.stub)
1250 .get_location(self.0.request, self.0.options)
1251 .await
1252 .map(gax::response::Response::into_body)
1253 }
1254
1255 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1257 self.0.request.name = v.into();
1258 self
1259 }
1260 }
1261
1262 #[doc(hidden)]
1263 impl gax::options::internal::RequestBuilder for GetLocation {
1264 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1265 &mut self.0.options
1266 }
1267 }
1268
1269 #[derive(Clone, Debug)]
1271 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1272
1273 impl ListOperations {
1274 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
1275 Self(RequestBuilder::new(stub))
1276 }
1277
1278 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1280 mut self,
1281 v: V,
1282 ) -> Self {
1283 self.0.request = v.into();
1284 self
1285 }
1286
1287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1289 self.0.options = v.into();
1290 self
1291 }
1292
1293 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1295 (*self.0.stub)
1296 .list_operations(self.0.request, self.0.options)
1297 .await
1298 .map(gax::response::Response::into_body)
1299 }
1300
1301 pub async fn paginator(
1303 self,
1304 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1305 {
1306 use std::clone::Clone;
1307 let token = self.0.request.page_token.clone();
1308 let execute = move |token: String| {
1309 let mut builder = self.clone();
1310 builder.0.request = builder.0.request.set_page_token(token);
1311 builder.send()
1312 };
1313 gax::paginator::internal::new_paginator(token, execute)
1314 }
1315
1316 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1318 self.0.request.name = v.into();
1319 self
1320 }
1321
1322 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1324 self.0.request.filter = v.into();
1325 self
1326 }
1327
1328 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1330 self.0.request.page_size = v.into();
1331 self
1332 }
1333
1334 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.0.request.page_token = v.into();
1337 self
1338 }
1339 }
1340
1341 #[doc(hidden)]
1342 impl gax::options::internal::RequestBuilder for ListOperations {
1343 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1344 &mut self.0.options
1345 }
1346 }
1347
1348 #[derive(Clone, Debug)]
1350 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1351
1352 impl GetOperation {
1353 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
1354 Self(RequestBuilder::new(stub))
1355 }
1356
1357 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1359 mut self,
1360 v: V,
1361 ) -> Self {
1362 self.0.request = v.into();
1363 self
1364 }
1365
1366 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1368 self.0.options = v.into();
1369 self
1370 }
1371
1372 pub async fn send(self) -> Result<longrunning::model::Operation> {
1374 (*self.0.stub)
1375 .get_operation(self.0.request, self.0.options)
1376 .await
1377 .map(gax::response::Response::into_body)
1378 }
1379
1380 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1382 self.0.request.name = v.into();
1383 self
1384 }
1385 }
1386
1387 #[doc(hidden)]
1388 impl gax::options::internal::RequestBuilder for GetOperation {
1389 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1390 &mut self.0.options
1391 }
1392 }
1393
1394 #[derive(Clone, Debug)]
1396 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1397
1398 impl DeleteOperation {
1399 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
1400 Self(RequestBuilder::new(stub))
1401 }
1402
1403 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1405 mut self,
1406 v: V,
1407 ) -> Self {
1408 self.0.request = v.into();
1409 self
1410 }
1411
1412 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1414 self.0.options = v.into();
1415 self
1416 }
1417
1418 pub async fn send(self) -> Result<()> {
1420 (*self.0.stub)
1421 .delete_operation(self.0.request, self.0.options)
1422 .await
1423 .map(gax::response::Response::into_body)
1424 }
1425
1426 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1428 self.0.request.name = v.into();
1429 self
1430 }
1431 }
1432
1433 #[doc(hidden)]
1434 impl gax::options::internal::RequestBuilder for DeleteOperation {
1435 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1436 &mut self.0.options
1437 }
1438 }
1439
1440 #[derive(Clone, Debug)]
1442 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1443
1444 impl CancelOperation {
1445 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DeveloperConnect>) -> Self {
1446 Self(RequestBuilder::new(stub))
1447 }
1448
1449 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1451 mut self,
1452 v: V,
1453 ) -> Self {
1454 self.0.request = v.into();
1455 self
1456 }
1457
1458 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1460 self.0.options = v.into();
1461 self
1462 }
1463
1464 pub async fn send(self) -> Result<()> {
1466 (*self.0.stub)
1467 .cancel_operation(self.0.request, self.0.options)
1468 .await
1469 .map(gax::response::Response::into_body)
1470 }
1471
1472 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1474 self.0.request.name = v.into();
1475 self
1476 }
1477 }
1478
1479 #[doc(hidden)]
1480 impl gax::options::internal::RequestBuilder for CancelOperation {
1481 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1482 &mut self.0.options
1483 }
1484 }
1485}