1pub mod app_hub {
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::AppHub;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = AppHub;
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::AppHub>,
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(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
89 pub struct LookupServiceProjectAttachment(
90 RequestBuilder<crate::model::LookupServiceProjectAttachmentRequest>,
91 );
92
93 impl LookupServiceProjectAttachment {
94 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
95 Self(RequestBuilder::new(stub))
96 }
97
98 pub fn with_request<V: Into<crate::model::LookupServiceProjectAttachmentRequest>>(
100 mut self,
101 v: V,
102 ) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<crate::model::LookupServiceProjectAttachmentResponse> {
115 (*self.0.stub)
116 .lookup_service_project_attachment(self.0.request, self.0.options)
117 .await
118 .map(crate::Response::into_body)
119 }
120
121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
125 self.0.request.name = v.into();
126 self
127 }
128 }
129
130 #[doc(hidden)]
131 impl crate::RequestBuilder for LookupServiceProjectAttachment {
132 fn request_options(&mut self) -> &mut crate::RequestOptions {
133 &mut self.0.options
134 }
135 }
136
137 #[derive(Clone, Debug)]
158 pub struct ListServiceProjectAttachments(
159 RequestBuilder<crate::model::ListServiceProjectAttachmentsRequest>,
160 );
161
162 impl ListServiceProjectAttachments {
163 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
164 Self(RequestBuilder::new(stub))
165 }
166
167 pub fn with_request<V: Into<crate::model::ListServiceProjectAttachmentsRequest>>(
169 mut self,
170 v: V,
171 ) -> Self {
172 self.0.request = v.into();
173 self
174 }
175
176 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
178 self.0.options = v.into();
179 self
180 }
181
182 pub async fn send(self) -> Result<crate::model::ListServiceProjectAttachmentsResponse> {
184 (*self.0.stub)
185 .list_service_project_attachments(self.0.request, self.0.options)
186 .await
187 .map(crate::Response::into_body)
188 }
189
190 pub fn by_page(
192 self,
193 ) -> impl google_cloud_gax::paginator::Paginator<
194 crate::model::ListServiceProjectAttachmentsResponse,
195 crate::Error,
196 > {
197 use std::clone::Clone;
198 let token = self.0.request.page_token.clone();
199 let execute = move |token: String| {
200 let mut builder = self.clone();
201 builder.0.request = builder.0.request.set_page_token(token);
202 builder.send()
203 };
204 google_cloud_gax::paginator::internal::new_paginator(token, execute)
205 }
206
207 pub fn by_item(
209 self,
210 ) -> impl google_cloud_gax::paginator::ItemPaginator<
211 crate::model::ListServiceProjectAttachmentsResponse,
212 crate::Error,
213 > {
214 use google_cloud_gax::paginator::Paginator;
215 self.by_page().items()
216 }
217
218 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
222 self.0.request.parent = v.into();
223 self
224 }
225
226 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
228 self.0.request.page_size = v.into();
229 self
230 }
231
232 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
234 self.0.request.page_token = v.into();
235 self
236 }
237
238 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.filter = v.into();
241 self
242 }
243
244 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
246 self.0.request.order_by = v.into();
247 self
248 }
249 }
250
251 #[doc(hidden)]
252 impl crate::RequestBuilder for ListServiceProjectAttachments {
253 fn request_options(&mut self) -> &mut crate::RequestOptions {
254 &mut self.0.options
255 }
256 }
257
258 #[derive(Clone, Debug)]
276 pub struct CreateServiceProjectAttachment(
277 RequestBuilder<crate::model::CreateServiceProjectAttachmentRequest>,
278 );
279
280 impl CreateServiceProjectAttachment {
281 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
282 Self(RequestBuilder::new(stub))
283 }
284
285 pub fn with_request<V: Into<crate::model::CreateServiceProjectAttachmentRequest>>(
287 mut self,
288 v: V,
289 ) -> Self {
290 self.0.request = v.into();
291 self
292 }
293
294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
296 self.0.options = v.into();
297 self
298 }
299
300 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
307 (*self.0.stub)
308 .create_service_project_attachment(self.0.request, self.0.options)
309 .await
310 .map(crate::Response::into_body)
311 }
312
313 pub fn poller(
315 self,
316 ) -> impl google_cloud_lro::Poller<
317 crate::model::ServiceProjectAttachment,
318 crate::model::OperationMetadata,
319 > {
320 type Operation = google_cloud_lro::internal::Operation<
321 crate::model::ServiceProjectAttachment,
322 crate::model::OperationMetadata,
323 >;
324 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
325 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
326 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
327 if let Some(ref mut details) = poller_options.tracing {
328 details.method_name = "google_cloud_apphub_v1::client::AppHub::create_service_project_attachment::until_done";
329 }
330
331 let stub = self.0.stub.clone();
332 let mut options = self.0.options.clone();
333 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
334 let query = move |name| {
335 let stub = stub.clone();
336 let options = options.clone();
337 async {
338 let op = GetOperation::new(stub)
339 .set_name(name)
340 .with_options(options)
341 .send()
342 .await?;
343 Ok(Operation::new(op))
344 }
345 };
346
347 let start = move || async {
348 let op = self.send().await?;
349 Ok(Operation::new(op))
350 };
351
352 use google_cloud_lro::internal::PollerExt;
353 {
354 google_cloud_lro::internal::new_poller(
355 polling_error_policy,
356 polling_backoff_policy,
357 start,
358 query,
359 )
360 }
361 .with_options(poller_options)
362 }
363
364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368 self.0.request.parent = v.into();
369 self
370 }
371
372 pub fn set_service_project_attachment_id<T: Into<std::string::String>>(
376 mut self,
377 v: T,
378 ) -> Self {
379 self.0.request.service_project_attachment_id = v.into();
380 self
381 }
382
383 pub fn set_service_project_attachment<T>(mut self, v: T) -> Self
387 where
388 T: std::convert::Into<crate::model::ServiceProjectAttachment>,
389 {
390 self.0.request.service_project_attachment = std::option::Option::Some(v.into());
391 self
392 }
393
394 pub fn set_or_clear_service_project_attachment<T>(
398 mut self,
399 v: std::option::Option<T>,
400 ) -> Self
401 where
402 T: std::convert::Into<crate::model::ServiceProjectAttachment>,
403 {
404 self.0.request.service_project_attachment = v.map(|x| x.into());
405 self
406 }
407
408 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
410 self.0.request.request_id = v.into();
411 self
412 }
413 }
414
415 #[doc(hidden)]
416 impl crate::RequestBuilder for CreateServiceProjectAttachment {
417 fn request_options(&mut self) -> &mut crate::RequestOptions {
418 &mut self.0.options
419 }
420 }
421
422 #[derive(Clone, Debug)]
439 pub struct GetServiceProjectAttachment(
440 RequestBuilder<crate::model::GetServiceProjectAttachmentRequest>,
441 );
442
443 impl GetServiceProjectAttachment {
444 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
445 Self(RequestBuilder::new(stub))
446 }
447
448 pub fn with_request<V: Into<crate::model::GetServiceProjectAttachmentRequest>>(
450 mut self,
451 v: V,
452 ) -> Self {
453 self.0.request = v.into();
454 self
455 }
456
457 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
459 self.0.options = v.into();
460 self
461 }
462
463 pub async fn send(self) -> Result<crate::model::ServiceProjectAttachment> {
465 (*self.0.stub)
466 .get_service_project_attachment(self.0.request, self.0.options)
467 .await
468 .map(crate::Response::into_body)
469 }
470
471 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
475 self.0.request.name = v.into();
476 self
477 }
478 }
479
480 #[doc(hidden)]
481 impl crate::RequestBuilder for GetServiceProjectAttachment {
482 fn request_options(&mut self) -> &mut crate::RequestOptions {
483 &mut self.0.options
484 }
485 }
486
487 #[derive(Clone, Debug)]
505 pub struct DeleteServiceProjectAttachment(
506 RequestBuilder<crate::model::DeleteServiceProjectAttachmentRequest>,
507 );
508
509 impl DeleteServiceProjectAttachment {
510 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
511 Self(RequestBuilder::new(stub))
512 }
513
514 pub fn with_request<V: Into<crate::model::DeleteServiceProjectAttachmentRequest>>(
516 mut self,
517 v: V,
518 ) -> Self {
519 self.0.request = v.into();
520 self
521 }
522
523 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
525 self.0.options = v.into();
526 self
527 }
528
529 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
536 (*self.0.stub)
537 .delete_service_project_attachment(self.0.request, self.0.options)
538 .await
539 .map(crate::Response::into_body)
540 }
541
542 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
544 type Operation =
545 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
546 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
547 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
548 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
549 if let Some(ref mut details) = poller_options.tracing {
550 details.method_name = "google_cloud_apphub_v1::client::AppHub::delete_service_project_attachment::until_done";
551 }
552
553 let stub = self.0.stub.clone();
554 let mut options = self.0.options.clone();
555 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
556 let query = move |name| {
557 let stub = stub.clone();
558 let options = options.clone();
559 async {
560 let op = GetOperation::new(stub)
561 .set_name(name)
562 .with_options(options)
563 .send()
564 .await?;
565 Ok(Operation::new(op))
566 }
567 };
568
569 let start = move || async {
570 let op = self.send().await?;
571 Ok(Operation::new(op))
572 };
573
574 use google_cloud_lro::internal::PollerExt;
575 {
576 google_cloud_lro::internal::new_unit_response_poller(
577 polling_error_policy,
578 polling_backoff_policy,
579 start,
580 query,
581 )
582 }
583 .with_options(poller_options)
584 }
585
586 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
590 self.0.request.name = v.into();
591 self
592 }
593
594 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
596 self.0.request.request_id = v.into();
597 self
598 }
599 }
600
601 #[doc(hidden)]
602 impl crate::RequestBuilder for DeleteServiceProjectAttachment {
603 fn request_options(&mut self) -> &mut crate::RequestOptions {
604 &mut self.0.options
605 }
606 }
607
608 #[derive(Clone, Debug)]
625 pub struct DetachServiceProjectAttachment(
626 RequestBuilder<crate::model::DetachServiceProjectAttachmentRequest>,
627 );
628
629 impl DetachServiceProjectAttachment {
630 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
631 Self(RequestBuilder::new(stub))
632 }
633
634 pub fn with_request<V: Into<crate::model::DetachServiceProjectAttachmentRequest>>(
636 mut self,
637 v: V,
638 ) -> Self {
639 self.0.request = v.into();
640 self
641 }
642
643 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
645 self.0.options = v.into();
646 self
647 }
648
649 pub async fn send(self) -> Result<crate::model::DetachServiceProjectAttachmentResponse> {
651 (*self.0.stub)
652 .detach_service_project_attachment(self.0.request, self.0.options)
653 .await
654 .map(crate::Response::into_body)
655 }
656
657 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
661 self.0.request.name = v.into();
662 self
663 }
664 }
665
666 #[doc(hidden)]
667 impl crate::RequestBuilder for DetachServiceProjectAttachment {
668 fn request_options(&mut self) -> &mut crate::RequestOptions {
669 &mut self.0.options
670 }
671 }
672
673 #[derive(Clone, Debug)]
694 pub struct ListDiscoveredServices(RequestBuilder<crate::model::ListDiscoveredServicesRequest>);
695
696 impl ListDiscoveredServices {
697 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
698 Self(RequestBuilder::new(stub))
699 }
700
701 pub fn with_request<V: Into<crate::model::ListDiscoveredServicesRequest>>(
703 mut self,
704 v: V,
705 ) -> Self {
706 self.0.request = v.into();
707 self
708 }
709
710 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
712 self.0.options = v.into();
713 self
714 }
715
716 pub async fn send(self) -> Result<crate::model::ListDiscoveredServicesResponse> {
718 (*self.0.stub)
719 .list_discovered_services(self.0.request, self.0.options)
720 .await
721 .map(crate::Response::into_body)
722 }
723
724 pub fn by_page(
726 self,
727 ) -> impl google_cloud_gax::paginator::Paginator<
728 crate::model::ListDiscoveredServicesResponse,
729 crate::Error,
730 > {
731 use std::clone::Clone;
732 let token = self.0.request.page_token.clone();
733 let execute = move |token: String| {
734 let mut builder = self.clone();
735 builder.0.request = builder.0.request.set_page_token(token);
736 builder.send()
737 };
738 google_cloud_gax::paginator::internal::new_paginator(token, execute)
739 }
740
741 pub fn by_item(
743 self,
744 ) -> impl google_cloud_gax::paginator::ItemPaginator<
745 crate::model::ListDiscoveredServicesResponse,
746 crate::Error,
747 > {
748 use google_cloud_gax::paginator::Paginator;
749 self.by_page().items()
750 }
751
752 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
756 self.0.request.parent = v.into();
757 self
758 }
759
760 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
762 self.0.request.page_size = v.into();
763 self
764 }
765
766 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
768 self.0.request.page_token = v.into();
769 self
770 }
771
772 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
774 self.0.request.filter = v.into();
775 self
776 }
777
778 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
780 self.0.request.order_by = v.into();
781 self
782 }
783 }
784
785 #[doc(hidden)]
786 impl crate::RequestBuilder for ListDiscoveredServices {
787 fn request_options(&mut self) -> &mut crate::RequestOptions {
788 &mut self.0.options
789 }
790 }
791
792 #[derive(Clone, Debug)]
809 pub struct GetDiscoveredService(RequestBuilder<crate::model::GetDiscoveredServiceRequest>);
810
811 impl GetDiscoveredService {
812 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
813 Self(RequestBuilder::new(stub))
814 }
815
816 pub fn with_request<V: Into<crate::model::GetDiscoveredServiceRequest>>(
818 mut self,
819 v: V,
820 ) -> Self {
821 self.0.request = v.into();
822 self
823 }
824
825 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
827 self.0.options = v.into();
828 self
829 }
830
831 pub async fn send(self) -> Result<crate::model::DiscoveredService> {
833 (*self.0.stub)
834 .get_discovered_service(self.0.request, self.0.options)
835 .await
836 .map(crate::Response::into_body)
837 }
838
839 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
843 self.0.request.name = v.into();
844 self
845 }
846 }
847
848 #[doc(hidden)]
849 impl crate::RequestBuilder for GetDiscoveredService {
850 fn request_options(&mut self) -> &mut crate::RequestOptions {
851 &mut self.0.options
852 }
853 }
854
855 #[derive(Clone, Debug)]
872 pub struct LookupDiscoveredService(
873 RequestBuilder<crate::model::LookupDiscoveredServiceRequest>,
874 );
875
876 impl LookupDiscoveredService {
877 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
878 Self(RequestBuilder::new(stub))
879 }
880
881 pub fn with_request<V: Into<crate::model::LookupDiscoveredServiceRequest>>(
883 mut self,
884 v: V,
885 ) -> Self {
886 self.0.request = v.into();
887 self
888 }
889
890 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
892 self.0.options = v.into();
893 self
894 }
895
896 pub async fn send(self) -> Result<crate::model::LookupDiscoveredServiceResponse> {
898 (*self.0.stub)
899 .lookup_discovered_service(self.0.request, self.0.options)
900 .await
901 .map(crate::Response::into_body)
902 }
903
904 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
908 self.0.request.parent = v.into();
909 self
910 }
911
912 pub fn set_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
916 self.0.request.uri = v.into();
917 self
918 }
919 }
920
921 #[doc(hidden)]
922 impl crate::RequestBuilder for LookupDiscoveredService {
923 fn request_options(&mut self) -> &mut crate::RequestOptions {
924 &mut self.0.options
925 }
926 }
927
928 #[derive(Clone, Debug)]
949 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
950
951 impl ListServices {
952 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
953 Self(RequestBuilder::new(stub))
954 }
955
956 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
958 self.0.request = v.into();
959 self
960 }
961
962 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
964 self.0.options = v.into();
965 self
966 }
967
968 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
970 (*self.0.stub)
971 .list_services(self.0.request, self.0.options)
972 .await
973 .map(crate::Response::into_body)
974 }
975
976 pub fn by_page(
978 self,
979 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListServicesResponse, crate::Error>
980 {
981 use std::clone::Clone;
982 let token = self.0.request.page_token.clone();
983 let execute = move |token: String| {
984 let mut builder = self.clone();
985 builder.0.request = builder.0.request.set_page_token(token);
986 builder.send()
987 };
988 google_cloud_gax::paginator::internal::new_paginator(token, execute)
989 }
990
991 pub fn by_item(
993 self,
994 ) -> impl google_cloud_gax::paginator::ItemPaginator<
995 crate::model::ListServicesResponse,
996 crate::Error,
997 > {
998 use google_cloud_gax::paginator::Paginator;
999 self.by_page().items()
1000 }
1001
1002 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1006 self.0.request.parent = v.into();
1007 self
1008 }
1009
1010 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1012 self.0.request.page_size = v.into();
1013 self
1014 }
1015
1016 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1018 self.0.request.page_token = v.into();
1019 self
1020 }
1021
1022 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1024 self.0.request.filter = v.into();
1025 self
1026 }
1027
1028 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1030 self.0.request.order_by = v.into();
1031 self
1032 }
1033 }
1034
1035 #[doc(hidden)]
1036 impl crate::RequestBuilder for ListServices {
1037 fn request_options(&mut self) -> &mut crate::RequestOptions {
1038 &mut self.0.options
1039 }
1040 }
1041
1042 #[derive(Clone, Debug)]
1060 pub struct CreateService(RequestBuilder<crate::model::CreateServiceRequest>);
1061
1062 impl CreateService {
1063 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1064 Self(RequestBuilder::new(stub))
1065 }
1066
1067 pub fn with_request<V: Into<crate::model::CreateServiceRequest>>(mut self, v: V) -> Self {
1069 self.0.request = v.into();
1070 self
1071 }
1072
1073 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1075 self.0.options = v.into();
1076 self
1077 }
1078
1079 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1086 (*self.0.stub)
1087 .create_service(self.0.request, self.0.options)
1088 .await
1089 .map(crate::Response::into_body)
1090 }
1091
1092 pub fn poller(
1094 self,
1095 ) -> impl google_cloud_lro::Poller<crate::model::Service, crate::model::OperationMetadata>
1096 {
1097 type Operation = google_cloud_lro::internal::Operation<
1098 crate::model::Service,
1099 crate::model::OperationMetadata,
1100 >;
1101 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1102 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1103 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1104 if let Some(ref mut details) = poller_options.tracing {
1105 details.method_name =
1106 "google_cloud_apphub_v1::client::AppHub::create_service::until_done";
1107 }
1108
1109 let stub = self.0.stub.clone();
1110 let mut options = self.0.options.clone();
1111 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1112 let query = move |name| {
1113 let stub = stub.clone();
1114 let options = options.clone();
1115 async {
1116 let op = GetOperation::new(stub)
1117 .set_name(name)
1118 .with_options(options)
1119 .send()
1120 .await?;
1121 Ok(Operation::new(op))
1122 }
1123 };
1124
1125 let start = move || async {
1126 let op = self.send().await?;
1127 Ok(Operation::new(op))
1128 };
1129
1130 use google_cloud_lro::internal::PollerExt;
1131 {
1132 google_cloud_lro::internal::new_poller(
1133 polling_error_policy,
1134 polling_backoff_policy,
1135 start,
1136 query,
1137 )
1138 }
1139 .with_options(poller_options)
1140 }
1141
1142 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1146 self.0.request.parent = v.into();
1147 self
1148 }
1149
1150 pub fn set_service_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1154 self.0.request.service_id = v.into();
1155 self
1156 }
1157
1158 pub fn set_service<T>(mut self, v: T) -> Self
1162 where
1163 T: std::convert::Into<crate::model::Service>,
1164 {
1165 self.0.request.service = std::option::Option::Some(v.into());
1166 self
1167 }
1168
1169 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
1173 where
1174 T: std::convert::Into<crate::model::Service>,
1175 {
1176 self.0.request.service = v.map(|x| x.into());
1177 self
1178 }
1179
1180 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1182 self.0.request.request_id = v.into();
1183 self
1184 }
1185 }
1186
1187 #[doc(hidden)]
1188 impl crate::RequestBuilder for CreateService {
1189 fn request_options(&mut self) -> &mut crate::RequestOptions {
1190 &mut self.0.options
1191 }
1192 }
1193
1194 #[derive(Clone, Debug)]
1211 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
1212
1213 impl GetService {
1214 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1215 Self(RequestBuilder::new(stub))
1216 }
1217
1218 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
1220 self.0.request = v.into();
1221 self
1222 }
1223
1224 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1226 self.0.options = v.into();
1227 self
1228 }
1229
1230 pub async fn send(self) -> Result<crate::model::Service> {
1232 (*self.0.stub)
1233 .get_service(self.0.request, self.0.options)
1234 .await
1235 .map(crate::Response::into_body)
1236 }
1237
1238 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1242 self.0.request.name = v.into();
1243 self
1244 }
1245 }
1246
1247 #[doc(hidden)]
1248 impl crate::RequestBuilder for GetService {
1249 fn request_options(&mut self) -> &mut crate::RequestOptions {
1250 &mut self.0.options
1251 }
1252 }
1253
1254 #[derive(Clone, Debug)]
1272 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
1273
1274 impl UpdateService {
1275 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1276 Self(RequestBuilder::new(stub))
1277 }
1278
1279 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
1281 self.0.request = v.into();
1282 self
1283 }
1284
1285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1287 self.0.options = v.into();
1288 self
1289 }
1290
1291 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1298 (*self.0.stub)
1299 .update_service(self.0.request, self.0.options)
1300 .await
1301 .map(crate::Response::into_body)
1302 }
1303
1304 pub fn poller(
1306 self,
1307 ) -> impl google_cloud_lro::Poller<crate::model::Service, crate::model::OperationMetadata>
1308 {
1309 type Operation = google_cloud_lro::internal::Operation<
1310 crate::model::Service,
1311 crate::model::OperationMetadata,
1312 >;
1313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1315 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1316 if let Some(ref mut details) = poller_options.tracing {
1317 details.method_name =
1318 "google_cloud_apphub_v1::client::AppHub::update_service::until_done";
1319 }
1320
1321 let stub = self.0.stub.clone();
1322 let mut options = self.0.options.clone();
1323 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1324 let query = move |name| {
1325 let stub = stub.clone();
1326 let options = options.clone();
1327 async {
1328 let op = GetOperation::new(stub)
1329 .set_name(name)
1330 .with_options(options)
1331 .send()
1332 .await?;
1333 Ok(Operation::new(op))
1334 }
1335 };
1336
1337 let start = move || async {
1338 let op = self.send().await?;
1339 Ok(Operation::new(op))
1340 };
1341
1342 use google_cloud_lro::internal::PollerExt;
1343 {
1344 google_cloud_lro::internal::new_poller(
1345 polling_error_policy,
1346 polling_backoff_policy,
1347 start,
1348 query,
1349 )
1350 }
1351 .with_options(poller_options)
1352 }
1353
1354 pub fn set_update_mask<T>(mut self, v: T) -> Self
1358 where
1359 T: std::convert::Into<wkt::FieldMask>,
1360 {
1361 self.0.request.update_mask = std::option::Option::Some(v.into());
1362 self
1363 }
1364
1365 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1369 where
1370 T: std::convert::Into<wkt::FieldMask>,
1371 {
1372 self.0.request.update_mask = v.map(|x| x.into());
1373 self
1374 }
1375
1376 pub fn set_service<T>(mut self, v: T) -> Self
1380 where
1381 T: std::convert::Into<crate::model::Service>,
1382 {
1383 self.0.request.service = std::option::Option::Some(v.into());
1384 self
1385 }
1386
1387 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
1391 where
1392 T: std::convert::Into<crate::model::Service>,
1393 {
1394 self.0.request.service = v.map(|x| x.into());
1395 self
1396 }
1397
1398 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1400 self.0.request.request_id = v.into();
1401 self
1402 }
1403 }
1404
1405 #[doc(hidden)]
1406 impl crate::RequestBuilder for UpdateService {
1407 fn request_options(&mut self) -> &mut crate::RequestOptions {
1408 &mut self.0.options
1409 }
1410 }
1411
1412 #[derive(Clone, Debug)]
1430 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1431
1432 impl DeleteService {
1433 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1434 Self(RequestBuilder::new(stub))
1435 }
1436
1437 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1439 self.0.request = v.into();
1440 self
1441 }
1442
1443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1445 self.0.options = v.into();
1446 self
1447 }
1448
1449 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1456 (*self.0.stub)
1457 .delete_service(self.0.request, self.0.options)
1458 .await
1459 .map(crate::Response::into_body)
1460 }
1461
1462 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1464 type Operation =
1465 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1468 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1469 if let Some(ref mut details) = poller_options.tracing {
1470 details.method_name =
1471 "google_cloud_apphub_v1::client::AppHub::delete_service::until_done";
1472 }
1473
1474 let stub = self.0.stub.clone();
1475 let mut options = self.0.options.clone();
1476 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1477 let query = move |name| {
1478 let stub = stub.clone();
1479 let options = options.clone();
1480 async {
1481 let op = GetOperation::new(stub)
1482 .set_name(name)
1483 .with_options(options)
1484 .send()
1485 .await?;
1486 Ok(Operation::new(op))
1487 }
1488 };
1489
1490 let start = move || async {
1491 let op = self.send().await?;
1492 Ok(Operation::new(op))
1493 };
1494
1495 use google_cloud_lro::internal::PollerExt;
1496 {
1497 google_cloud_lro::internal::new_unit_response_poller(
1498 polling_error_policy,
1499 polling_backoff_policy,
1500 start,
1501 query,
1502 )
1503 }
1504 .with_options(poller_options)
1505 }
1506
1507 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1511 self.0.request.name = v.into();
1512 self
1513 }
1514
1515 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1517 self.0.request.request_id = v.into();
1518 self
1519 }
1520 }
1521
1522 #[doc(hidden)]
1523 impl crate::RequestBuilder for DeleteService {
1524 fn request_options(&mut self) -> &mut crate::RequestOptions {
1525 &mut self.0.options
1526 }
1527 }
1528
1529 #[derive(Clone, Debug)]
1550 pub struct ListDiscoveredWorkloads(
1551 RequestBuilder<crate::model::ListDiscoveredWorkloadsRequest>,
1552 );
1553
1554 impl ListDiscoveredWorkloads {
1555 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1556 Self(RequestBuilder::new(stub))
1557 }
1558
1559 pub fn with_request<V: Into<crate::model::ListDiscoveredWorkloadsRequest>>(
1561 mut self,
1562 v: V,
1563 ) -> Self {
1564 self.0.request = v.into();
1565 self
1566 }
1567
1568 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1570 self.0.options = v.into();
1571 self
1572 }
1573
1574 pub async fn send(self) -> Result<crate::model::ListDiscoveredWorkloadsResponse> {
1576 (*self.0.stub)
1577 .list_discovered_workloads(self.0.request, self.0.options)
1578 .await
1579 .map(crate::Response::into_body)
1580 }
1581
1582 pub fn by_page(
1584 self,
1585 ) -> impl google_cloud_gax::paginator::Paginator<
1586 crate::model::ListDiscoveredWorkloadsResponse,
1587 crate::Error,
1588 > {
1589 use std::clone::Clone;
1590 let token = self.0.request.page_token.clone();
1591 let execute = move |token: String| {
1592 let mut builder = self.clone();
1593 builder.0.request = builder.0.request.set_page_token(token);
1594 builder.send()
1595 };
1596 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1597 }
1598
1599 pub fn by_item(
1601 self,
1602 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1603 crate::model::ListDiscoveredWorkloadsResponse,
1604 crate::Error,
1605 > {
1606 use google_cloud_gax::paginator::Paginator;
1607 self.by_page().items()
1608 }
1609
1610 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1614 self.0.request.parent = v.into();
1615 self
1616 }
1617
1618 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1620 self.0.request.page_size = v.into();
1621 self
1622 }
1623
1624 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1626 self.0.request.page_token = v.into();
1627 self
1628 }
1629
1630 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1632 self.0.request.filter = v.into();
1633 self
1634 }
1635
1636 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1638 self.0.request.order_by = v.into();
1639 self
1640 }
1641 }
1642
1643 #[doc(hidden)]
1644 impl crate::RequestBuilder for ListDiscoveredWorkloads {
1645 fn request_options(&mut self) -> &mut crate::RequestOptions {
1646 &mut self.0.options
1647 }
1648 }
1649
1650 #[derive(Clone, Debug)]
1667 pub struct GetDiscoveredWorkload(RequestBuilder<crate::model::GetDiscoveredWorkloadRequest>);
1668
1669 impl GetDiscoveredWorkload {
1670 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1671 Self(RequestBuilder::new(stub))
1672 }
1673
1674 pub fn with_request<V: Into<crate::model::GetDiscoveredWorkloadRequest>>(
1676 mut self,
1677 v: V,
1678 ) -> Self {
1679 self.0.request = v.into();
1680 self
1681 }
1682
1683 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1685 self.0.options = v.into();
1686 self
1687 }
1688
1689 pub async fn send(self) -> Result<crate::model::DiscoveredWorkload> {
1691 (*self.0.stub)
1692 .get_discovered_workload(self.0.request, self.0.options)
1693 .await
1694 .map(crate::Response::into_body)
1695 }
1696
1697 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1701 self.0.request.name = v.into();
1702 self
1703 }
1704 }
1705
1706 #[doc(hidden)]
1707 impl crate::RequestBuilder for GetDiscoveredWorkload {
1708 fn request_options(&mut self) -> &mut crate::RequestOptions {
1709 &mut self.0.options
1710 }
1711 }
1712
1713 #[derive(Clone, Debug)]
1730 pub struct LookupDiscoveredWorkload(
1731 RequestBuilder<crate::model::LookupDiscoveredWorkloadRequest>,
1732 );
1733
1734 impl LookupDiscoveredWorkload {
1735 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1736 Self(RequestBuilder::new(stub))
1737 }
1738
1739 pub fn with_request<V: Into<crate::model::LookupDiscoveredWorkloadRequest>>(
1741 mut self,
1742 v: V,
1743 ) -> Self {
1744 self.0.request = v.into();
1745 self
1746 }
1747
1748 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1750 self.0.options = v.into();
1751 self
1752 }
1753
1754 pub async fn send(self) -> Result<crate::model::LookupDiscoveredWorkloadResponse> {
1756 (*self.0.stub)
1757 .lookup_discovered_workload(self.0.request, self.0.options)
1758 .await
1759 .map(crate::Response::into_body)
1760 }
1761
1762 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1766 self.0.request.parent = v.into();
1767 self
1768 }
1769
1770 pub fn set_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
1774 self.0.request.uri = v.into();
1775 self
1776 }
1777 }
1778
1779 #[doc(hidden)]
1780 impl crate::RequestBuilder for LookupDiscoveredWorkload {
1781 fn request_options(&mut self) -> &mut crate::RequestOptions {
1782 &mut self.0.options
1783 }
1784 }
1785
1786 #[derive(Clone, Debug)]
1807 pub struct ListWorkloads(RequestBuilder<crate::model::ListWorkloadsRequest>);
1808
1809 impl ListWorkloads {
1810 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1811 Self(RequestBuilder::new(stub))
1812 }
1813
1814 pub fn with_request<V: Into<crate::model::ListWorkloadsRequest>>(mut self, v: V) -> Self {
1816 self.0.request = v.into();
1817 self
1818 }
1819
1820 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1822 self.0.options = v.into();
1823 self
1824 }
1825
1826 pub async fn send(self) -> Result<crate::model::ListWorkloadsResponse> {
1828 (*self.0.stub)
1829 .list_workloads(self.0.request, self.0.options)
1830 .await
1831 .map(crate::Response::into_body)
1832 }
1833
1834 pub fn by_page(
1836 self,
1837 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListWorkloadsResponse, crate::Error>
1838 {
1839 use std::clone::Clone;
1840 let token = self.0.request.page_token.clone();
1841 let execute = move |token: String| {
1842 let mut builder = self.clone();
1843 builder.0.request = builder.0.request.set_page_token(token);
1844 builder.send()
1845 };
1846 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1847 }
1848
1849 pub fn by_item(
1851 self,
1852 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1853 crate::model::ListWorkloadsResponse,
1854 crate::Error,
1855 > {
1856 use google_cloud_gax::paginator::Paginator;
1857 self.by_page().items()
1858 }
1859
1860 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1864 self.0.request.parent = v.into();
1865 self
1866 }
1867
1868 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1870 self.0.request.page_size = v.into();
1871 self
1872 }
1873
1874 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1876 self.0.request.page_token = v.into();
1877 self
1878 }
1879
1880 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882 self.0.request.filter = v.into();
1883 self
1884 }
1885
1886 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1888 self.0.request.order_by = v.into();
1889 self
1890 }
1891 }
1892
1893 #[doc(hidden)]
1894 impl crate::RequestBuilder for ListWorkloads {
1895 fn request_options(&mut self) -> &mut crate::RequestOptions {
1896 &mut self.0.options
1897 }
1898 }
1899
1900 #[derive(Clone, Debug)]
1918 pub struct CreateWorkload(RequestBuilder<crate::model::CreateWorkloadRequest>);
1919
1920 impl CreateWorkload {
1921 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
1922 Self(RequestBuilder::new(stub))
1923 }
1924
1925 pub fn with_request<V: Into<crate::model::CreateWorkloadRequest>>(mut self, v: V) -> Self {
1927 self.0.request = v.into();
1928 self
1929 }
1930
1931 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1933 self.0.options = v.into();
1934 self
1935 }
1936
1937 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1944 (*self.0.stub)
1945 .create_workload(self.0.request, self.0.options)
1946 .await
1947 .map(crate::Response::into_body)
1948 }
1949
1950 pub fn poller(
1952 self,
1953 ) -> impl google_cloud_lro::Poller<crate::model::Workload, crate::model::OperationMetadata>
1954 {
1955 type Operation = google_cloud_lro::internal::Operation<
1956 crate::model::Workload,
1957 crate::model::OperationMetadata,
1958 >;
1959 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1960 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1961 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1962 if let Some(ref mut details) = poller_options.tracing {
1963 details.method_name =
1964 "google_cloud_apphub_v1::client::AppHub::create_workload::until_done";
1965 }
1966
1967 let stub = self.0.stub.clone();
1968 let mut options = self.0.options.clone();
1969 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1970 let query = move |name| {
1971 let stub = stub.clone();
1972 let options = options.clone();
1973 async {
1974 let op = GetOperation::new(stub)
1975 .set_name(name)
1976 .with_options(options)
1977 .send()
1978 .await?;
1979 Ok(Operation::new(op))
1980 }
1981 };
1982
1983 let start = move || async {
1984 let op = self.send().await?;
1985 Ok(Operation::new(op))
1986 };
1987
1988 use google_cloud_lro::internal::PollerExt;
1989 {
1990 google_cloud_lro::internal::new_poller(
1991 polling_error_policy,
1992 polling_backoff_policy,
1993 start,
1994 query,
1995 )
1996 }
1997 .with_options(poller_options)
1998 }
1999
2000 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2004 self.0.request.parent = v.into();
2005 self
2006 }
2007
2008 pub fn set_workload_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2012 self.0.request.workload_id = v.into();
2013 self
2014 }
2015
2016 pub fn set_workload<T>(mut self, v: T) -> Self
2020 where
2021 T: std::convert::Into<crate::model::Workload>,
2022 {
2023 self.0.request.workload = std::option::Option::Some(v.into());
2024 self
2025 }
2026
2027 pub fn set_or_clear_workload<T>(mut self, v: std::option::Option<T>) -> Self
2031 where
2032 T: std::convert::Into<crate::model::Workload>,
2033 {
2034 self.0.request.workload = v.map(|x| x.into());
2035 self
2036 }
2037
2038 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2040 self.0.request.request_id = v.into();
2041 self
2042 }
2043 }
2044
2045 #[doc(hidden)]
2046 impl crate::RequestBuilder for CreateWorkload {
2047 fn request_options(&mut self) -> &mut crate::RequestOptions {
2048 &mut self.0.options
2049 }
2050 }
2051
2052 #[derive(Clone, Debug)]
2069 pub struct GetWorkload(RequestBuilder<crate::model::GetWorkloadRequest>);
2070
2071 impl GetWorkload {
2072 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2073 Self(RequestBuilder::new(stub))
2074 }
2075
2076 pub fn with_request<V: Into<crate::model::GetWorkloadRequest>>(mut self, v: V) -> Self {
2078 self.0.request = v.into();
2079 self
2080 }
2081
2082 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2084 self.0.options = v.into();
2085 self
2086 }
2087
2088 pub async fn send(self) -> Result<crate::model::Workload> {
2090 (*self.0.stub)
2091 .get_workload(self.0.request, self.0.options)
2092 .await
2093 .map(crate::Response::into_body)
2094 }
2095
2096 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2100 self.0.request.name = v.into();
2101 self
2102 }
2103 }
2104
2105 #[doc(hidden)]
2106 impl crate::RequestBuilder for GetWorkload {
2107 fn request_options(&mut self) -> &mut crate::RequestOptions {
2108 &mut self.0.options
2109 }
2110 }
2111
2112 #[derive(Clone, Debug)]
2130 pub struct UpdateWorkload(RequestBuilder<crate::model::UpdateWorkloadRequest>);
2131
2132 impl UpdateWorkload {
2133 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2134 Self(RequestBuilder::new(stub))
2135 }
2136
2137 pub fn with_request<V: Into<crate::model::UpdateWorkloadRequest>>(mut self, v: V) -> Self {
2139 self.0.request = v.into();
2140 self
2141 }
2142
2143 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2145 self.0.options = v.into();
2146 self
2147 }
2148
2149 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2156 (*self.0.stub)
2157 .update_workload(self.0.request, self.0.options)
2158 .await
2159 .map(crate::Response::into_body)
2160 }
2161
2162 pub fn poller(
2164 self,
2165 ) -> impl google_cloud_lro::Poller<crate::model::Workload, crate::model::OperationMetadata>
2166 {
2167 type Operation = google_cloud_lro::internal::Operation<
2168 crate::model::Workload,
2169 crate::model::OperationMetadata,
2170 >;
2171 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2172 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2173 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2174 if let Some(ref mut details) = poller_options.tracing {
2175 details.method_name =
2176 "google_cloud_apphub_v1::client::AppHub::update_workload::until_done";
2177 }
2178
2179 let stub = self.0.stub.clone();
2180 let mut options = self.0.options.clone();
2181 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2182 let query = move |name| {
2183 let stub = stub.clone();
2184 let options = options.clone();
2185 async {
2186 let op = GetOperation::new(stub)
2187 .set_name(name)
2188 .with_options(options)
2189 .send()
2190 .await?;
2191 Ok(Operation::new(op))
2192 }
2193 };
2194
2195 let start = move || async {
2196 let op = self.send().await?;
2197 Ok(Operation::new(op))
2198 };
2199
2200 use google_cloud_lro::internal::PollerExt;
2201 {
2202 google_cloud_lro::internal::new_poller(
2203 polling_error_policy,
2204 polling_backoff_policy,
2205 start,
2206 query,
2207 )
2208 }
2209 .with_options(poller_options)
2210 }
2211
2212 pub fn set_update_mask<T>(mut self, v: T) -> Self
2216 where
2217 T: std::convert::Into<wkt::FieldMask>,
2218 {
2219 self.0.request.update_mask = std::option::Option::Some(v.into());
2220 self
2221 }
2222
2223 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2227 where
2228 T: std::convert::Into<wkt::FieldMask>,
2229 {
2230 self.0.request.update_mask = v.map(|x| x.into());
2231 self
2232 }
2233
2234 pub fn set_workload<T>(mut self, v: T) -> Self
2238 where
2239 T: std::convert::Into<crate::model::Workload>,
2240 {
2241 self.0.request.workload = std::option::Option::Some(v.into());
2242 self
2243 }
2244
2245 pub fn set_or_clear_workload<T>(mut self, v: std::option::Option<T>) -> Self
2249 where
2250 T: std::convert::Into<crate::model::Workload>,
2251 {
2252 self.0.request.workload = v.map(|x| x.into());
2253 self
2254 }
2255
2256 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2258 self.0.request.request_id = v.into();
2259 self
2260 }
2261 }
2262
2263 #[doc(hidden)]
2264 impl crate::RequestBuilder for UpdateWorkload {
2265 fn request_options(&mut self) -> &mut crate::RequestOptions {
2266 &mut self.0.options
2267 }
2268 }
2269
2270 #[derive(Clone, Debug)]
2288 pub struct DeleteWorkload(RequestBuilder<crate::model::DeleteWorkloadRequest>);
2289
2290 impl DeleteWorkload {
2291 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2292 Self(RequestBuilder::new(stub))
2293 }
2294
2295 pub fn with_request<V: Into<crate::model::DeleteWorkloadRequest>>(mut self, v: V) -> Self {
2297 self.0.request = v.into();
2298 self
2299 }
2300
2301 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2303 self.0.options = v.into();
2304 self
2305 }
2306
2307 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2314 (*self.0.stub)
2315 .delete_workload(self.0.request, self.0.options)
2316 .await
2317 .map(crate::Response::into_body)
2318 }
2319
2320 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2322 type Operation =
2323 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2324 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2325 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2326 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2327 if let Some(ref mut details) = poller_options.tracing {
2328 details.method_name =
2329 "google_cloud_apphub_v1::client::AppHub::delete_workload::until_done";
2330 }
2331
2332 let stub = self.0.stub.clone();
2333 let mut options = self.0.options.clone();
2334 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2335 let query = move |name| {
2336 let stub = stub.clone();
2337 let options = options.clone();
2338 async {
2339 let op = GetOperation::new(stub)
2340 .set_name(name)
2341 .with_options(options)
2342 .send()
2343 .await?;
2344 Ok(Operation::new(op))
2345 }
2346 };
2347
2348 let start = move || async {
2349 let op = self.send().await?;
2350 Ok(Operation::new(op))
2351 };
2352
2353 use google_cloud_lro::internal::PollerExt;
2354 {
2355 google_cloud_lro::internal::new_unit_response_poller(
2356 polling_error_policy,
2357 polling_backoff_policy,
2358 start,
2359 query,
2360 )
2361 }
2362 .with_options(poller_options)
2363 }
2364
2365 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2369 self.0.request.name = v.into();
2370 self
2371 }
2372
2373 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2375 self.0.request.request_id = v.into();
2376 self
2377 }
2378 }
2379
2380 #[doc(hidden)]
2381 impl crate::RequestBuilder for DeleteWorkload {
2382 fn request_options(&mut self) -> &mut crate::RequestOptions {
2383 &mut self.0.options
2384 }
2385 }
2386
2387 #[derive(Clone, Debug)]
2408 pub struct ListApplications(RequestBuilder<crate::model::ListApplicationsRequest>);
2409
2410 impl ListApplications {
2411 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2412 Self(RequestBuilder::new(stub))
2413 }
2414
2415 pub fn with_request<V: Into<crate::model::ListApplicationsRequest>>(
2417 mut self,
2418 v: V,
2419 ) -> Self {
2420 self.0.request = v.into();
2421 self
2422 }
2423
2424 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2426 self.0.options = v.into();
2427 self
2428 }
2429
2430 pub async fn send(self) -> Result<crate::model::ListApplicationsResponse> {
2432 (*self.0.stub)
2433 .list_applications(self.0.request, self.0.options)
2434 .await
2435 .map(crate::Response::into_body)
2436 }
2437
2438 pub fn by_page(
2440 self,
2441 ) -> impl google_cloud_gax::paginator::Paginator<
2442 crate::model::ListApplicationsResponse,
2443 crate::Error,
2444 > {
2445 use std::clone::Clone;
2446 let token = self.0.request.page_token.clone();
2447 let execute = move |token: String| {
2448 let mut builder = self.clone();
2449 builder.0.request = builder.0.request.set_page_token(token);
2450 builder.send()
2451 };
2452 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2453 }
2454
2455 pub fn by_item(
2457 self,
2458 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2459 crate::model::ListApplicationsResponse,
2460 crate::Error,
2461 > {
2462 use google_cloud_gax::paginator::Paginator;
2463 self.by_page().items()
2464 }
2465
2466 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470 self.0.request.parent = v.into();
2471 self
2472 }
2473
2474 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2476 self.0.request.page_size = v.into();
2477 self
2478 }
2479
2480 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2482 self.0.request.page_token = v.into();
2483 self
2484 }
2485
2486 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2488 self.0.request.filter = v.into();
2489 self
2490 }
2491
2492 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2494 self.0.request.order_by = v.into();
2495 self
2496 }
2497 }
2498
2499 #[doc(hidden)]
2500 impl crate::RequestBuilder for ListApplications {
2501 fn request_options(&mut self) -> &mut crate::RequestOptions {
2502 &mut self.0.options
2503 }
2504 }
2505
2506 #[derive(Clone, Debug)]
2524 pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
2525
2526 impl CreateApplication {
2527 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2528 Self(RequestBuilder::new(stub))
2529 }
2530
2531 pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
2533 mut self,
2534 v: V,
2535 ) -> Self {
2536 self.0.request = v.into();
2537 self
2538 }
2539
2540 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2542 self.0.options = v.into();
2543 self
2544 }
2545
2546 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2553 (*self.0.stub)
2554 .create_application(self.0.request, self.0.options)
2555 .await
2556 .map(crate::Response::into_body)
2557 }
2558
2559 pub fn poller(
2561 self,
2562 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadata>
2563 {
2564 type Operation = google_cloud_lro::internal::Operation<
2565 crate::model::Application,
2566 crate::model::OperationMetadata,
2567 >;
2568 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2569 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2570 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2571 if let Some(ref mut details) = poller_options.tracing {
2572 details.method_name =
2573 "google_cloud_apphub_v1::client::AppHub::create_application::until_done";
2574 }
2575
2576 let stub = self.0.stub.clone();
2577 let mut options = self.0.options.clone();
2578 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2579 let query = move |name| {
2580 let stub = stub.clone();
2581 let options = options.clone();
2582 async {
2583 let op = GetOperation::new(stub)
2584 .set_name(name)
2585 .with_options(options)
2586 .send()
2587 .await?;
2588 Ok(Operation::new(op))
2589 }
2590 };
2591
2592 let start = move || async {
2593 let op = self.send().await?;
2594 Ok(Operation::new(op))
2595 };
2596
2597 use google_cloud_lro::internal::PollerExt;
2598 {
2599 google_cloud_lro::internal::new_poller(
2600 polling_error_policy,
2601 polling_backoff_policy,
2602 start,
2603 query,
2604 )
2605 }
2606 .with_options(poller_options)
2607 }
2608
2609 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2613 self.0.request.parent = v.into();
2614 self
2615 }
2616
2617 pub fn set_application_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2621 self.0.request.application_id = v.into();
2622 self
2623 }
2624
2625 pub fn set_application<T>(mut self, v: T) -> Self
2629 where
2630 T: std::convert::Into<crate::model::Application>,
2631 {
2632 self.0.request.application = std::option::Option::Some(v.into());
2633 self
2634 }
2635
2636 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
2640 where
2641 T: std::convert::Into<crate::model::Application>,
2642 {
2643 self.0.request.application = v.map(|x| x.into());
2644 self
2645 }
2646
2647 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2649 self.0.request.request_id = v.into();
2650 self
2651 }
2652 }
2653
2654 #[doc(hidden)]
2655 impl crate::RequestBuilder for CreateApplication {
2656 fn request_options(&mut self) -> &mut crate::RequestOptions {
2657 &mut self.0.options
2658 }
2659 }
2660
2661 #[derive(Clone, Debug)]
2678 pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
2679
2680 impl GetApplication {
2681 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2682 Self(RequestBuilder::new(stub))
2683 }
2684
2685 pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
2687 self.0.request = v.into();
2688 self
2689 }
2690
2691 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2693 self.0.options = v.into();
2694 self
2695 }
2696
2697 pub async fn send(self) -> Result<crate::model::Application> {
2699 (*self.0.stub)
2700 .get_application(self.0.request, self.0.options)
2701 .await
2702 .map(crate::Response::into_body)
2703 }
2704
2705 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2709 self.0.request.name = v.into();
2710 self
2711 }
2712 }
2713
2714 #[doc(hidden)]
2715 impl crate::RequestBuilder for GetApplication {
2716 fn request_options(&mut self) -> &mut crate::RequestOptions {
2717 &mut self.0.options
2718 }
2719 }
2720
2721 #[derive(Clone, Debug)]
2739 pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
2740
2741 impl UpdateApplication {
2742 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2743 Self(RequestBuilder::new(stub))
2744 }
2745
2746 pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
2748 mut self,
2749 v: V,
2750 ) -> Self {
2751 self.0.request = v.into();
2752 self
2753 }
2754
2755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2757 self.0.options = v.into();
2758 self
2759 }
2760
2761 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2768 (*self.0.stub)
2769 .update_application(self.0.request, self.0.options)
2770 .await
2771 .map(crate::Response::into_body)
2772 }
2773
2774 pub fn poller(
2776 self,
2777 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadata>
2778 {
2779 type Operation = google_cloud_lro::internal::Operation<
2780 crate::model::Application,
2781 crate::model::OperationMetadata,
2782 >;
2783 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2784 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2785 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2786 if let Some(ref mut details) = poller_options.tracing {
2787 details.method_name =
2788 "google_cloud_apphub_v1::client::AppHub::update_application::until_done";
2789 }
2790
2791 let stub = self.0.stub.clone();
2792 let mut options = self.0.options.clone();
2793 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2794 let query = move |name| {
2795 let stub = stub.clone();
2796 let options = options.clone();
2797 async {
2798 let op = GetOperation::new(stub)
2799 .set_name(name)
2800 .with_options(options)
2801 .send()
2802 .await?;
2803 Ok(Operation::new(op))
2804 }
2805 };
2806
2807 let start = move || async {
2808 let op = self.send().await?;
2809 Ok(Operation::new(op))
2810 };
2811
2812 use google_cloud_lro::internal::PollerExt;
2813 {
2814 google_cloud_lro::internal::new_poller(
2815 polling_error_policy,
2816 polling_backoff_policy,
2817 start,
2818 query,
2819 )
2820 }
2821 .with_options(poller_options)
2822 }
2823
2824 pub fn set_update_mask<T>(mut self, v: T) -> Self
2828 where
2829 T: std::convert::Into<wkt::FieldMask>,
2830 {
2831 self.0.request.update_mask = std::option::Option::Some(v.into());
2832 self
2833 }
2834
2835 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2839 where
2840 T: std::convert::Into<wkt::FieldMask>,
2841 {
2842 self.0.request.update_mask = v.map(|x| x.into());
2843 self
2844 }
2845
2846 pub fn set_application<T>(mut self, v: T) -> Self
2850 where
2851 T: std::convert::Into<crate::model::Application>,
2852 {
2853 self.0.request.application = std::option::Option::Some(v.into());
2854 self
2855 }
2856
2857 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
2861 where
2862 T: std::convert::Into<crate::model::Application>,
2863 {
2864 self.0.request.application = v.map(|x| x.into());
2865 self
2866 }
2867
2868 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2870 self.0.request.request_id = v.into();
2871 self
2872 }
2873 }
2874
2875 #[doc(hidden)]
2876 impl crate::RequestBuilder for UpdateApplication {
2877 fn request_options(&mut self) -> &mut crate::RequestOptions {
2878 &mut self.0.options
2879 }
2880 }
2881
2882 #[derive(Clone, Debug)]
2900 pub struct DeleteApplication(RequestBuilder<crate::model::DeleteApplicationRequest>);
2901
2902 impl DeleteApplication {
2903 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
2904 Self(RequestBuilder::new(stub))
2905 }
2906
2907 pub fn with_request<V: Into<crate::model::DeleteApplicationRequest>>(
2909 mut self,
2910 v: V,
2911 ) -> Self {
2912 self.0.request = v.into();
2913 self
2914 }
2915
2916 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2918 self.0.options = v.into();
2919 self
2920 }
2921
2922 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2929 (*self.0.stub)
2930 .delete_application(self.0.request, self.0.options)
2931 .await
2932 .map(crate::Response::into_body)
2933 }
2934
2935 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2937 type Operation =
2938 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2939 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2940 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2941 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2942 if let Some(ref mut details) = poller_options.tracing {
2943 details.method_name =
2944 "google_cloud_apphub_v1::client::AppHub::delete_application::until_done";
2945 }
2946
2947 let stub = self.0.stub.clone();
2948 let mut options = self.0.options.clone();
2949 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2950 let query = move |name| {
2951 let stub = stub.clone();
2952 let options = options.clone();
2953 async {
2954 let op = GetOperation::new(stub)
2955 .set_name(name)
2956 .with_options(options)
2957 .send()
2958 .await?;
2959 Ok(Operation::new(op))
2960 }
2961 };
2962
2963 let start = move || async {
2964 let op = self.send().await?;
2965 Ok(Operation::new(op))
2966 };
2967
2968 use google_cloud_lro::internal::PollerExt;
2969 {
2970 google_cloud_lro::internal::new_unit_response_poller(
2971 polling_error_policy,
2972 polling_backoff_policy,
2973 start,
2974 query,
2975 )
2976 }
2977 .with_options(poller_options)
2978 }
2979
2980 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2984 self.0.request.name = v.into();
2985 self
2986 }
2987
2988 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2990 self.0.request.request_id = v.into();
2991 self
2992 }
2993 }
2994
2995 #[doc(hidden)]
2996 impl crate::RequestBuilder for DeleteApplication {
2997 fn request_options(&mut self) -> &mut crate::RequestOptions {
2998 &mut self.0.options
2999 }
3000 }
3001
3002 #[derive(Clone, Debug)]
3023 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3024
3025 impl ListLocations {
3026 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3027 Self(RequestBuilder::new(stub))
3028 }
3029
3030 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3032 mut self,
3033 v: V,
3034 ) -> Self {
3035 self.0.request = v.into();
3036 self
3037 }
3038
3039 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3041 self.0.options = v.into();
3042 self
3043 }
3044
3045 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3047 (*self.0.stub)
3048 .list_locations(self.0.request, self.0.options)
3049 .await
3050 .map(crate::Response::into_body)
3051 }
3052
3053 pub fn by_page(
3055 self,
3056 ) -> impl google_cloud_gax::paginator::Paginator<
3057 google_cloud_location::model::ListLocationsResponse,
3058 crate::Error,
3059 > {
3060 use std::clone::Clone;
3061 let token = self.0.request.page_token.clone();
3062 let execute = move |token: String| {
3063 let mut builder = self.clone();
3064 builder.0.request = builder.0.request.set_page_token(token);
3065 builder.send()
3066 };
3067 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3068 }
3069
3070 pub fn by_item(
3072 self,
3073 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3074 google_cloud_location::model::ListLocationsResponse,
3075 crate::Error,
3076 > {
3077 use google_cloud_gax::paginator::Paginator;
3078 self.by_page().items()
3079 }
3080
3081 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3083 self.0.request.name = v.into();
3084 self
3085 }
3086
3087 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3089 self.0.request.filter = v.into();
3090 self
3091 }
3092
3093 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3095 self.0.request.page_size = v.into();
3096 self
3097 }
3098
3099 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3101 self.0.request.page_token = v.into();
3102 self
3103 }
3104 }
3105
3106 #[doc(hidden)]
3107 impl crate::RequestBuilder for ListLocations {
3108 fn request_options(&mut self) -> &mut crate::RequestOptions {
3109 &mut self.0.options
3110 }
3111 }
3112
3113 #[derive(Clone, Debug)]
3130 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3131
3132 impl GetLocation {
3133 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3134 Self(RequestBuilder::new(stub))
3135 }
3136
3137 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3139 mut self,
3140 v: V,
3141 ) -> Self {
3142 self.0.request = v.into();
3143 self
3144 }
3145
3146 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3148 self.0.options = v.into();
3149 self
3150 }
3151
3152 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3154 (*self.0.stub)
3155 .get_location(self.0.request, self.0.options)
3156 .await
3157 .map(crate::Response::into_body)
3158 }
3159
3160 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3162 self.0.request.name = v.into();
3163 self
3164 }
3165 }
3166
3167 #[doc(hidden)]
3168 impl crate::RequestBuilder for GetLocation {
3169 fn request_options(&mut self) -> &mut crate::RequestOptions {
3170 &mut self.0.options
3171 }
3172 }
3173
3174 #[derive(Clone, Debug)]
3191 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3192
3193 impl SetIamPolicy {
3194 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3195 Self(RequestBuilder::new(stub))
3196 }
3197
3198 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3200 mut self,
3201 v: V,
3202 ) -> Self {
3203 self.0.request = v.into();
3204 self
3205 }
3206
3207 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3209 self.0.options = v.into();
3210 self
3211 }
3212
3213 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3215 (*self.0.stub)
3216 .set_iam_policy(self.0.request, self.0.options)
3217 .await
3218 .map(crate::Response::into_body)
3219 }
3220
3221 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3225 self.0.request.resource = v.into();
3226 self
3227 }
3228
3229 pub fn set_policy<T>(mut self, v: T) -> Self
3233 where
3234 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3235 {
3236 self.0.request.policy = std::option::Option::Some(v.into());
3237 self
3238 }
3239
3240 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3244 where
3245 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3246 {
3247 self.0.request.policy = v.map(|x| x.into());
3248 self
3249 }
3250
3251 pub fn set_update_mask<T>(mut self, v: T) -> Self
3253 where
3254 T: std::convert::Into<wkt::FieldMask>,
3255 {
3256 self.0.request.update_mask = std::option::Option::Some(v.into());
3257 self
3258 }
3259
3260 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3262 where
3263 T: std::convert::Into<wkt::FieldMask>,
3264 {
3265 self.0.request.update_mask = v.map(|x| x.into());
3266 self
3267 }
3268 }
3269
3270 #[doc(hidden)]
3271 impl crate::RequestBuilder for SetIamPolicy {
3272 fn request_options(&mut self) -> &mut crate::RequestOptions {
3273 &mut self.0.options
3274 }
3275 }
3276
3277 #[derive(Clone, Debug)]
3294 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3295
3296 impl GetIamPolicy {
3297 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3298 Self(RequestBuilder::new(stub))
3299 }
3300
3301 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3303 mut self,
3304 v: V,
3305 ) -> Self {
3306 self.0.request = v.into();
3307 self
3308 }
3309
3310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3312 self.0.options = v.into();
3313 self
3314 }
3315
3316 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3318 (*self.0.stub)
3319 .get_iam_policy(self.0.request, self.0.options)
3320 .await
3321 .map(crate::Response::into_body)
3322 }
3323
3324 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3328 self.0.request.resource = v.into();
3329 self
3330 }
3331
3332 pub fn set_options<T>(mut self, v: T) -> Self
3334 where
3335 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3336 {
3337 self.0.request.options = std::option::Option::Some(v.into());
3338 self
3339 }
3340
3341 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3343 where
3344 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3345 {
3346 self.0.request.options = v.map(|x| x.into());
3347 self
3348 }
3349 }
3350
3351 #[doc(hidden)]
3352 impl crate::RequestBuilder for GetIamPolicy {
3353 fn request_options(&mut self) -> &mut crate::RequestOptions {
3354 &mut self.0.options
3355 }
3356 }
3357
3358 #[derive(Clone, Debug)]
3375 pub struct TestIamPermissions(
3376 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3377 );
3378
3379 impl TestIamPermissions {
3380 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3381 Self(RequestBuilder::new(stub))
3382 }
3383
3384 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3386 mut self,
3387 v: V,
3388 ) -> Self {
3389 self.0.request = v.into();
3390 self
3391 }
3392
3393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3395 self.0.options = v.into();
3396 self
3397 }
3398
3399 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3401 (*self.0.stub)
3402 .test_iam_permissions(self.0.request, self.0.options)
3403 .await
3404 .map(crate::Response::into_body)
3405 }
3406
3407 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.0.request.resource = v.into();
3412 self
3413 }
3414
3415 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3419 where
3420 T: std::iter::IntoIterator<Item = V>,
3421 V: std::convert::Into<std::string::String>,
3422 {
3423 use std::iter::Iterator;
3424 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3425 self
3426 }
3427 }
3428
3429 #[doc(hidden)]
3430 impl crate::RequestBuilder for TestIamPermissions {
3431 fn request_options(&mut self) -> &mut crate::RequestOptions {
3432 &mut self.0.options
3433 }
3434 }
3435
3436 #[derive(Clone, Debug)]
3457 pub struct ListOperations(
3458 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3459 );
3460
3461 impl ListOperations {
3462 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3463 Self(RequestBuilder::new(stub))
3464 }
3465
3466 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3468 mut self,
3469 v: V,
3470 ) -> Self {
3471 self.0.request = v.into();
3472 self
3473 }
3474
3475 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3477 self.0.options = v.into();
3478 self
3479 }
3480
3481 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3483 (*self.0.stub)
3484 .list_operations(self.0.request, self.0.options)
3485 .await
3486 .map(crate::Response::into_body)
3487 }
3488
3489 pub fn by_page(
3491 self,
3492 ) -> impl google_cloud_gax::paginator::Paginator<
3493 google_cloud_longrunning::model::ListOperationsResponse,
3494 crate::Error,
3495 > {
3496 use std::clone::Clone;
3497 let token = self.0.request.page_token.clone();
3498 let execute = move |token: String| {
3499 let mut builder = self.clone();
3500 builder.0.request = builder.0.request.set_page_token(token);
3501 builder.send()
3502 };
3503 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3504 }
3505
3506 pub fn by_item(
3508 self,
3509 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3510 google_cloud_longrunning::model::ListOperationsResponse,
3511 crate::Error,
3512 > {
3513 use google_cloud_gax::paginator::Paginator;
3514 self.by_page().items()
3515 }
3516
3517 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3519 self.0.request.name = v.into();
3520 self
3521 }
3522
3523 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3525 self.0.request.filter = v.into();
3526 self
3527 }
3528
3529 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3531 self.0.request.page_size = v.into();
3532 self
3533 }
3534
3535 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3537 self.0.request.page_token = v.into();
3538 self
3539 }
3540
3541 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3543 self.0.request.return_partial_success = v.into();
3544 self
3545 }
3546 }
3547
3548 #[doc(hidden)]
3549 impl crate::RequestBuilder for ListOperations {
3550 fn request_options(&mut self) -> &mut crate::RequestOptions {
3551 &mut self.0.options
3552 }
3553 }
3554
3555 #[derive(Clone, Debug)]
3572 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3573
3574 impl GetOperation {
3575 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3576 Self(RequestBuilder::new(stub))
3577 }
3578
3579 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3581 mut self,
3582 v: V,
3583 ) -> Self {
3584 self.0.request = v.into();
3585 self
3586 }
3587
3588 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3590 self.0.options = v.into();
3591 self
3592 }
3593
3594 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3596 (*self.0.stub)
3597 .get_operation(self.0.request, self.0.options)
3598 .await
3599 .map(crate::Response::into_body)
3600 }
3601
3602 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3604 self.0.request.name = v.into();
3605 self
3606 }
3607 }
3608
3609 #[doc(hidden)]
3610 impl crate::RequestBuilder for GetOperation {
3611 fn request_options(&mut self) -> &mut crate::RequestOptions {
3612 &mut self.0.options
3613 }
3614 }
3615
3616 #[derive(Clone, Debug)]
3633 pub struct DeleteOperation(
3634 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3635 );
3636
3637 impl DeleteOperation {
3638 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3639 Self(RequestBuilder::new(stub))
3640 }
3641
3642 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3644 mut self,
3645 v: V,
3646 ) -> Self {
3647 self.0.request = v.into();
3648 self
3649 }
3650
3651 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3653 self.0.options = v.into();
3654 self
3655 }
3656
3657 pub async fn send(self) -> Result<()> {
3659 (*self.0.stub)
3660 .delete_operation(self.0.request, self.0.options)
3661 .await
3662 .map(crate::Response::into_body)
3663 }
3664
3665 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3667 self.0.request.name = v.into();
3668 self
3669 }
3670 }
3671
3672 #[doc(hidden)]
3673 impl crate::RequestBuilder for DeleteOperation {
3674 fn request_options(&mut self) -> &mut crate::RequestOptions {
3675 &mut self.0.options
3676 }
3677 }
3678
3679 #[derive(Clone, Debug)]
3696 pub struct CancelOperation(
3697 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3698 );
3699
3700 impl CancelOperation {
3701 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::AppHub>) -> Self {
3702 Self(RequestBuilder::new(stub))
3703 }
3704
3705 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3707 mut self,
3708 v: V,
3709 ) -> Self {
3710 self.0.request = v.into();
3711 self
3712 }
3713
3714 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3716 self.0.options = v.into();
3717 self
3718 }
3719
3720 pub async fn send(self) -> Result<()> {
3722 (*self.0.stub)
3723 .cancel_operation(self.0.request, self.0.options)
3724 .await
3725 .map(crate::Response::into_body)
3726 }
3727
3728 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3730 self.0.request.name = v.into();
3731 self
3732 }
3733 }
3734
3735 #[doc(hidden)]
3736 impl crate::RequestBuilder for CancelOperation {
3737 fn request_options(&mut self) -> &mut crate::RequestOptions {
3738 &mut self.0.options
3739 }
3740 }
3741}