1pub mod applications {
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::Applications;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Applications;
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::Applications>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
92
93 impl GetApplication {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::Application> {
114 (*self.0.stub)
115 .get_application(self.0.request, self.0.options)
116 .await
117 .map(crate::Response::into_body)
118 }
119
120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
122 self.0.request.name = v.into();
123 self
124 }
125 }
126
127 #[doc(hidden)]
128 impl crate::RequestBuilder for GetApplication {
129 fn request_options(&mut self) -> &mut crate::RequestOptions {
130 &mut self.0.options
131 }
132 }
133
134 #[derive(Clone, Debug)]
152 pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
153
154 impl CreateApplication {
155 pub(crate) fn new(
156 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
157 ) -> Self {
158 Self(RequestBuilder::new(stub))
159 }
160
161 pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
163 mut self,
164 v: V,
165 ) -> Self {
166 self.0.request = v.into();
167 self
168 }
169
170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
172 self.0.options = v.into();
173 self
174 }
175
176 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
183 (*self.0.stub)
184 .create_application(self.0.request, self.0.options)
185 .await
186 .map(crate::Response::into_body)
187 }
188
189 pub fn poller(
191 self,
192 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
193 {
194 type Operation = google_cloud_lro::internal::Operation<
195 crate::model::Application,
196 crate::model::OperationMetadataV1,
197 >;
198 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
199 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
200
201 let stub = self.0.stub.clone();
202 let mut options = self.0.options.clone();
203 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
204 let query = move |name| {
205 let stub = stub.clone();
206 let options = options.clone();
207 async {
208 let op = GetOperation::new(stub)
209 .set_name(name)
210 .with_options(options)
211 .send()
212 .await?;
213 Ok(Operation::new(op))
214 }
215 };
216
217 let start = move || async {
218 let op = self.send().await?;
219 Ok(Operation::new(op))
220 };
221
222 google_cloud_lro::internal::new_poller(
223 polling_error_policy,
224 polling_backoff_policy,
225 start,
226 query,
227 )
228 }
229
230 pub fn set_application<T>(mut self, v: T) -> Self
232 where
233 T: std::convert::Into<crate::model::Application>,
234 {
235 self.0.request.application = std::option::Option::Some(v.into());
236 self
237 }
238
239 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
241 where
242 T: std::convert::Into<crate::model::Application>,
243 {
244 self.0.request.application = v.map(|x| x.into());
245 self
246 }
247 }
248
249 #[doc(hidden)]
250 impl crate::RequestBuilder for CreateApplication {
251 fn request_options(&mut self) -> &mut crate::RequestOptions {
252 &mut self.0.options
253 }
254 }
255
256 #[derive(Clone, Debug)]
274 pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
275
276 impl UpdateApplication {
277 pub(crate) fn new(
278 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
279 ) -> Self {
280 Self(RequestBuilder::new(stub))
281 }
282
283 pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
285 mut self,
286 v: V,
287 ) -> Self {
288 self.0.request = v.into();
289 self
290 }
291
292 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
294 self.0.options = v.into();
295 self
296 }
297
298 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
305 (*self.0.stub)
306 .update_application(self.0.request, self.0.options)
307 .await
308 .map(crate::Response::into_body)
309 }
310
311 pub fn poller(
313 self,
314 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
315 {
316 type Operation = google_cloud_lro::internal::Operation<
317 crate::model::Application,
318 crate::model::OperationMetadataV1,
319 >;
320 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
321 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
322
323 let stub = self.0.stub.clone();
324 let mut options = self.0.options.clone();
325 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
326 let query = move |name| {
327 let stub = stub.clone();
328 let options = options.clone();
329 async {
330 let op = GetOperation::new(stub)
331 .set_name(name)
332 .with_options(options)
333 .send()
334 .await?;
335 Ok(Operation::new(op))
336 }
337 };
338
339 let start = move || async {
340 let op = self.send().await?;
341 Ok(Operation::new(op))
342 };
343
344 google_cloud_lro::internal::new_poller(
345 polling_error_policy,
346 polling_backoff_policy,
347 start,
348 query,
349 )
350 }
351
352 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
354 self.0.request.name = v.into();
355 self
356 }
357
358 pub fn set_application<T>(mut self, v: T) -> Self
360 where
361 T: std::convert::Into<crate::model::Application>,
362 {
363 self.0.request.application = std::option::Option::Some(v.into());
364 self
365 }
366
367 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
369 where
370 T: std::convert::Into<crate::model::Application>,
371 {
372 self.0.request.application = v.map(|x| x.into());
373 self
374 }
375
376 pub fn set_update_mask<T>(mut self, v: T) -> Self
378 where
379 T: std::convert::Into<wkt::FieldMask>,
380 {
381 self.0.request.update_mask = std::option::Option::Some(v.into());
382 self
383 }
384
385 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
387 where
388 T: std::convert::Into<wkt::FieldMask>,
389 {
390 self.0.request.update_mask = v.map(|x| x.into());
391 self
392 }
393 }
394
395 #[doc(hidden)]
396 impl crate::RequestBuilder for UpdateApplication {
397 fn request_options(&mut self) -> &mut crate::RequestOptions {
398 &mut self.0.options
399 }
400 }
401
402 #[derive(Clone, Debug)]
420 pub struct RepairApplication(RequestBuilder<crate::model::RepairApplicationRequest>);
421
422 impl RepairApplication {
423 pub(crate) fn new(
424 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
425 ) -> Self {
426 Self(RequestBuilder::new(stub))
427 }
428
429 pub fn with_request<V: Into<crate::model::RepairApplicationRequest>>(
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<crate::RequestOptions>>(mut self, v: V) -> Self {
440 self.0.options = v.into();
441 self
442 }
443
444 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
451 (*self.0.stub)
452 .repair_application(self.0.request, self.0.options)
453 .await
454 .map(crate::Response::into_body)
455 }
456
457 pub fn poller(
459 self,
460 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
461 {
462 type Operation = google_cloud_lro::internal::Operation<
463 crate::model::Application,
464 crate::model::OperationMetadataV1,
465 >;
466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
468
469 let stub = self.0.stub.clone();
470 let mut options = self.0.options.clone();
471 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
472 let query = move |name| {
473 let stub = stub.clone();
474 let options = options.clone();
475 async {
476 let op = GetOperation::new(stub)
477 .set_name(name)
478 .with_options(options)
479 .send()
480 .await?;
481 Ok(Operation::new(op))
482 }
483 };
484
485 let start = move || async {
486 let op = self.send().await?;
487 Ok(Operation::new(op))
488 };
489
490 google_cloud_lro::internal::new_poller(
491 polling_error_policy,
492 polling_backoff_policy,
493 start,
494 query,
495 )
496 }
497
498 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
500 self.0.request.name = v.into();
501 self
502 }
503 }
504
505 #[doc(hidden)]
506 impl crate::RequestBuilder for RepairApplication {
507 fn request_options(&mut self) -> &mut crate::RequestOptions {
508 &mut self.0.options
509 }
510 }
511
512 #[derive(Clone, Debug)]
533 pub struct ListOperations(
534 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
535 );
536
537 impl ListOperations {
538 pub(crate) fn new(
539 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
540 ) -> Self {
541 Self(RequestBuilder::new(stub))
542 }
543
544 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
546 mut self,
547 v: V,
548 ) -> Self {
549 self.0.request = v.into();
550 self
551 }
552
553 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
555 self.0.options = v.into();
556 self
557 }
558
559 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
561 (*self.0.stub)
562 .list_operations(self.0.request, self.0.options)
563 .await
564 .map(crate::Response::into_body)
565 }
566
567 pub fn by_page(
569 self,
570 ) -> impl google_cloud_gax::paginator::Paginator<
571 google_cloud_longrunning::model::ListOperationsResponse,
572 crate::Error,
573 > {
574 use std::clone::Clone;
575 let token = self.0.request.page_token.clone();
576 let execute = move |token: String| {
577 let mut builder = self.clone();
578 builder.0.request = builder.0.request.set_page_token(token);
579 builder.send()
580 };
581 google_cloud_gax::paginator::internal::new_paginator(token, execute)
582 }
583
584 pub fn by_item(
586 self,
587 ) -> impl google_cloud_gax::paginator::ItemPaginator<
588 google_cloud_longrunning::model::ListOperationsResponse,
589 crate::Error,
590 > {
591 use google_cloud_gax::paginator::Paginator;
592 self.by_page().items()
593 }
594
595 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
597 self.0.request.name = v.into();
598 self
599 }
600
601 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
603 self.0.request.filter = v.into();
604 self
605 }
606
607 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
609 self.0.request.page_size = v.into();
610 self
611 }
612
613 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
615 self.0.request.page_token = v.into();
616 self
617 }
618
619 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
621 self.0.request.return_partial_success = v.into();
622 self
623 }
624 }
625
626 #[doc(hidden)]
627 impl crate::RequestBuilder for ListOperations {
628 fn request_options(&mut self) -> &mut crate::RequestOptions {
629 &mut self.0.options
630 }
631 }
632
633 #[derive(Clone, Debug)]
650 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
651
652 impl GetOperation {
653 pub(crate) fn new(
654 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
655 ) -> Self {
656 Self(RequestBuilder::new(stub))
657 }
658
659 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
661 mut self,
662 v: V,
663 ) -> Self {
664 self.0.request = v.into();
665 self
666 }
667
668 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
670 self.0.options = v.into();
671 self
672 }
673
674 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
676 (*self.0.stub)
677 .get_operation(self.0.request, self.0.options)
678 .await
679 .map(crate::Response::into_body)
680 }
681
682 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
684 self.0.request.name = v.into();
685 self
686 }
687 }
688
689 #[doc(hidden)]
690 impl crate::RequestBuilder for GetOperation {
691 fn request_options(&mut self) -> &mut crate::RequestOptions {
692 &mut self.0.options
693 }
694 }
695}
696
697pub mod services {
699 use crate::Result;
700
701 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
715
716 pub(crate) mod client {
717 use super::super::super::client::Services;
718 pub struct Factory;
719 impl crate::ClientFactory for Factory {
720 type Client = Services;
721 type Credentials = gaxi::options::Credentials;
722 async fn build(
723 self,
724 config: gaxi::options::ClientConfig,
725 ) -> crate::ClientBuilderResult<Self::Client> {
726 Self::Client::new(config).await
727 }
728 }
729 }
730
731 #[derive(Clone, Debug)]
733 pub(crate) struct RequestBuilder<R: std::default::Default> {
734 stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
735 request: R,
736 options: crate::RequestOptions,
737 }
738
739 impl<R> RequestBuilder<R>
740 where
741 R: std::default::Default,
742 {
743 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
744 Self {
745 stub,
746 request: R::default(),
747 options: crate::RequestOptions::default(),
748 }
749 }
750 }
751
752 #[derive(Clone, Debug)]
773 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
774
775 impl ListServices {
776 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
777 Self(RequestBuilder::new(stub))
778 }
779
780 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
782 self.0.request = v.into();
783 self
784 }
785
786 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
788 self.0.options = v.into();
789 self
790 }
791
792 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
794 (*self.0.stub)
795 .list_services(self.0.request, self.0.options)
796 .await
797 .map(crate::Response::into_body)
798 }
799
800 pub fn by_page(
802 self,
803 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListServicesResponse, crate::Error>
804 {
805 use std::clone::Clone;
806 let token = self.0.request.page_token.clone();
807 let execute = move |token: String| {
808 let mut builder = self.clone();
809 builder.0.request = builder.0.request.set_page_token(token);
810 builder.send()
811 };
812 google_cloud_gax::paginator::internal::new_paginator(token, execute)
813 }
814
815 pub fn by_item(
817 self,
818 ) -> impl google_cloud_gax::paginator::ItemPaginator<
819 crate::model::ListServicesResponse,
820 crate::Error,
821 > {
822 use google_cloud_gax::paginator::Paginator;
823 self.by_page().items()
824 }
825
826 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
828 self.0.request.parent = v.into();
829 self
830 }
831
832 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
834 self.0.request.page_size = v.into();
835 self
836 }
837
838 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
840 self.0.request.page_token = v.into();
841 self
842 }
843 }
844
845 #[doc(hidden)]
846 impl crate::RequestBuilder for ListServices {
847 fn request_options(&mut self) -> &mut crate::RequestOptions {
848 &mut self.0.options
849 }
850 }
851
852 #[derive(Clone, Debug)]
869 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
870
871 impl GetService {
872 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
873 Self(RequestBuilder::new(stub))
874 }
875
876 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
878 self.0.request = v.into();
879 self
880 }
881
882 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
884 self.0.options = v.into();
885 self
886 }
887
888 pub async fn send(self) -> Result<crate::model::Service> {
890 (*self.0.stub)
891 .get_service(self.0.request, self.0.options)
892 .await
893 .map(crate::Response::into_body)
894 }
895
896 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
898 self.0.request.name = v.into();
899 self
900 }
901 }
902
903 #[doc(hidden)]
904 impl crate::RequestBuilder for GetService {
905 fn request_options(&mut self) -> &mut crate::RequestOptions {
906 &mut self.0.options
907 }
908 }
909
910 #[derive(Clone, Debug)]
928 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
929
930 impl UpdateService {
931 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
932 Self(RequestBuilder::new(stub))
933 }
934
935 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
937 self.0.request = v.into();
938 self
939 }
940
941 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
943 self.0.options = v.into();
944 self
945 }
946
947 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
954 (*self.0.stub)
955 .update_service(self.0.request, self.0.options)
956 .await
957 .map(crate::Response::into_body)
958 }
959
960 pub fn poller(
962 self,
963 ) -> impl google_cloud_lro::Poller<crate::model::Service, crate::model::OperationMetadataV1>
964 {
965 type Operation = google_cloud_lro::internal::Operation<
966 crate::model::Service,
967 crate::model::OperationMetadataV1,
968 >;
969 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
970 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
971
972 let stub = self.0.stub.clone();
973 let mut options = self.0.options.clone();
974 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
975 let query = move |name| {
976 let stub = stub.clone();
977 let options = options.clone();
978 async {
979 let op = GetOperation::new(stub)
980 .set_name(name)
981 .with_options(options)
982 .send()
983 .await?;
984 Ok(Operation::new(op))
985 }
986 };
987
988 let start = move || async {
989 let op = self.send().await?;
990 Ok(Operation::new(op))
991 };
992
993 google_cloud_lro::internal::new_poller(
994 polling_error_policy,
995 polling_backoff_policy,
996 start,
997 query,
998 )
999 }
1000
1001 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.0.request.name = v.into();
1004 self
1005 }
1006
1007 pub fn set_service<T>(mut self, v: T) -> Self
1009 where
1010 T: std::convert::Into<crate::model::Service>,
1011 {
1012 self.0.request.service = std::option::Option::Some(v.into());
1013 self
1014 }
1015
1016 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
1018 where
1019 T: std::convert::Into<crate::model::Service>,
1020 {
1021 self.0.request.service = v.map(|x| x.into());
1022 self
1023 }
1024
1025 pub fn set_update_mask<T>(mut self, v: T) -> Self
1027 where
1028 T: std::convert::Into<wkt::FieldMask>,
1029 {
1030 self.0.request.update_mask = std::option::Option::Some(v.into());
1031 self
1032 }
1033
1034 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1036 where
1037 T: std::convert::Into<wkt::FieldMask>,
1038 {
1039 self.0.request.update_mask = v.map(|x| x.into());
1040 self
1041 }
1042
1043 pub fn set_migrate_traffic<T: Into<bool>>(mut self, v: T) -> Self {
1045 self.0.request.migrate_traffic = v.into();
1046 self
1047 }
1048 }
1049
1050 #[doc(hidden)]
1051 impl crate::RequestBuilder for UpdateService {
1052 fn request_options(&mut self) -> &mut crate::RequestOptions {
1053 &mut self.0.options
1054 }
1055 }
1056
1057 #[derive(Clone, Debug)]
1075 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1076
1077 impl DeleteService {
1078 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1079 Self(RequestBuilder::new(stub))
1080 }
1081
1082 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1084 self.0.request = v.into();
1085 self
1086 }
1087
1088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1090 self.0.options = v.into();
1091 self
1092 }
1093
1094 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1101 (*self.0.stub)
1102 .delete_service(self.0.request, self.0.options)
1103 .await
1104 .map(crate::Response::into_body)
1105 }
1106
1107 pub fn poller(
1109 self,
1110 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
1111 type Operation = google_cloud_lro::internal::Operation<
1112 wkt::Empty,
1113 crate::model::OperationMetadataV1,
1114 >;
1115 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1116 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1117
1118 let stub = self.0.stub.clone();
1119 let mut options = self.0.options.clone();
1120 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1121 let query = move |name| {
1122 let stub = stub.clone();
1123 let options = options.clone();
1124 async {
1125 let op = GetOperation::new(stub)
1126 .set_name(name)
1127 .with_options(options)
1128 .send()
1129 .await?;
1130 Ok(Operation::new(op))
1131 }
1132 };
1133
1134 let start = move || async {
1135 let op = self.send().await?;
1136 Ok(Operation::new(op))
1137 };
1138
1139 google_cloud_lro::internal::new_unit_response_poller(
1140 polling_error_policy,
1141 polling_backoff_policy,
1142 start,
1143 query,
1144 )
1145 }
1146
1147 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1149 self.0.request.name = v.into();
1150 self
1151 }
1152 }
1153
1154 #[doc(hidden)]
1155 impl crate::RequestBuilder for DeleteService {
1156 fn request_options(&mut self) -> &mut crate::RequestOptions {
1157 &mut self.0.options
1158 }
1159 }
1160
1161 #[derive(Clone, Debug)]
1182 pub struct ListOperations(
1183 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1184 );
1185
1186 impl ListOperations {
1187 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1188 Self(RequestBuilder::new(stub))
1189 }
1190
1191 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1193 mut self,
1194 v: V,
1195 ) -> Self {
1196 self.0.request = v.into();
1197 self
1198 }
1199
1200 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1202 self.0.options = v.into();
1203 self
1204 }
1205
1206 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1208 (*self.0.stub)
1209 .list_operations(self.0.request, self.0.options)
1210 .await
1211 .map(crate::Response::into_body)
1212 }
1213
1214 pub fn by_page(
1216 self,
1217 ) -> impl google_cloud_gax::paginator::Paginator<
1218 google_cloud_longrunning::model::ListOperationsResponse,
1219 crate::Error,
1220 > {
1221 use std::clone::Clone;
1222 let token = self.0.request.page_token.clone();
1223 let execute = move |token: String| {
1224 let mut builder = self.clone();
1225 builder.0.request = builder.0.request.set_page_token(token);
1226 builder.send()
1227 };
1228 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1229 }
1230
1231 pub fn by_item(
1233 self,
1234 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1235 google_cloud_longrunning::model::ListOperationsResponse,
1236 crate::Error,
1237 > {
1238 use google_cloud_gax::paginator::Paginator;
1239 self.by_page().items()
1240 }
1241
1242 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1244 self.0.request.name = v.into();
1245 self
1246 }
1247
1248 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1250 self.0.request.filter = v.into();
1251 self
1252 }
1253
1254 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1256 self.0.request.page_size = v.into();
1257 self
1258 }
1259
1260 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1262 self.0.request.page_token = v.into();
1263 self
1264 }
1265
1266 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1268 self.0.request.return_partial_success = v.into();
1269 self
1270 }
1271 }
1272
1273 #[doc(hidden)]
1274 impl crate::RequestBuilder for ListOperations {
1275 fn request_options(&mut self) -> &mut crate::RequestOptions {
1276 &mut self.0.options
1277 }
1278 }
1279
1280 #[derive(Clone, Debug)]
1297 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1298
1299 impl GetOperation {
1300 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1301 Self(RequestBuilder::new(stub))
1302 }
1303
1304 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1306 mut self,
1307 v: V,
1308 ) -> Self {
1309 self.0.request = v.into();
1310 self
1311 }
1312
1313 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1315 self.0.options = v.into();
1316 self
1317 }
1318
1319 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1321 (*self.0.stub)
1322 .get_operation(self.0.request, self.0.options)
1323 .await
1324 .map(crate::Response::into_body)
1325 }
1326
1327 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1329 self.0.request.name = v.into();
1330 self
1331 }
1332 }
1333
1334 #[doc(hidden)]
1335 impl crate::RequestBuilder for GetOperation {
1336 fn request_options(&mut self) -> &mut crate::RequestOptions {
1337 &mut self.0.options
1338 }
1339 }
1340}
1341
1342pub mod versions {
1344 use crate::Result;
1345
1346 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1360
1361 pub(crate) mod client {
1362 use super::super::super::client::Versions;
1363 pub struct Factory;
1364 impl crate::ClientFactory for Factory {
1365 type Client = Versions;
1366 type Credentials = gaxi::options::Credentials;
1367 async fn build(
1368 self,
1369 config: gaxi::options::ClientConfig,
1370 ) -> crate::ClientBuilderResult<Self::Client> {
1371 Self::Client::new(config).await
1372 }
1373 }
1374 }
1375
1376 #[derive(Clone, Debug)]
1378 pub(crate) struct RequestBuilder<R: std::default::Default> {
1379 stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
1380 request: R,
1381 options: crate::RequestOptions,
1382 }
1383
1384 impl<R> RequestBuilder<R>
1385 where
1386 R: std::default::Default,
1387 {
1388 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1389 Self {
1390 stub,
1391 request: R::default(),
1392 options: crate::RequestOptions::default(),
1393 }
1394 }
1395 }
1396
1397 #[derive(Clone, Debug)]
1418 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
1419
1420 impl ListVersions {
1421 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1422 Self(RequestBuilder::new(stub))
1423 }
1424
1425 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
1427 self.0.request = v.into();
1428 self
1429 }
1430
1431 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1433 self.0.options = v.into();
1434 self
1435 }
1436
1437 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
1439 (*self.0.stub)
1440 .list_versions(self.0.request, self.0.options)
1441 .await
1442 .map(crate::Response::into_body)
1443 }
1444
1445 pub fn by_page(
1447 self,
1448 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
1449 {
1450 use std::clone::Clone;
1451 let token = self.0.request.page_token.clone();
1452 let execute = move |token: String| {
1453 let mut builder = self.clone();
1454 builder.0.request = builder.0.request.set_page_token(token);
1455 builder.send()
1456 };
1457 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1458 }
1459
1460 pub fn by_item(
1462 self,
1463 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1464 crate::model::ListVersionsResponse,
1465 crate::Error,
1466 > {
1467 use google_cloud_gax::paginator::Paginator;
1468 self.by_page().items()
1469 }
1470
1471 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1473 self.0.request.parent = v.into();
1474 self
1475 }
1476
1477 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1479 self.0.request.view = v.into();
1480 self
1481 }
1482
1483 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1485 self.0.request.page_size = v.into();
1486 self
1487 }
1488
1489 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1491 self.0.request.page_token = v.into();
1492 self
1493 }
1494 }
1495
1496 #[doc(hidden)]
1497 impl crate::RequestBuilder for ListVersions {
1498 fn request_options(&mut self) -> &mut crate::RequestOptions {
1499 &mut self.0.options
1500 }
1501 }
1502
1503 #[derive(Clone, Debug)]
1520 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
1521
1522 impl GetVersion {
1523 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1524 Self(RequestBuilder::new(stub))
1525 }
1526
1527 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
1529 self.0.request = v.into();
1530 self
1531 }
1532
1533 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1535 self.0.options = v.into();
1536 self
1537 }
1538
1539 pub async fn send(self) -> Result<crate::model::Version> {
1541 (*self.0.stub)
1542 .get_version(self.0.request, self.0.options)
1543 .await
1544 .map(crate::Response::into_body)
1545 }
1546
1547 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1549 self.0.request.name = v.into();
1550 self
1551 }
1552
1553 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1555 self.0.request.view = v.into();
1556 self
1557 }
1558 }
1559
1560 #[doc(hidden)]
1561 impl crate::RequestBuilder for GetVersion {
1562 fn request_options(&mut self) -> &mut crate::RequestOptions {
1563 &mut self.0.options
1564 }
1565 }
1566
1567 #[derive(Clone, Debug)]
1585 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
1586
1587 impl CreateVersion {
1588 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1589 Self(RequestBuilder::new(stub))
1590 }
1591
1592 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
1594 self.0.request = v.into();
1595 self
1596 }
1597
1598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1600 self.0.options = v.into();
1601 self
1602 }
1603
1604 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1611 (*self.0.stub)
1612 .create_version(self.0.request, self.0.options)
1613 .await
1614 .map(crate::Response::into_body)
1615 }
1616
1617 pub fn poller(
1619 self,
1620 ) -> impl google_cloud_lro::Poller<crate::model::Version, crate::model::CreateVersionMetadataV1>
1621 {
1622 type Operation = google_cloud_lro::internal::Operation<
1623 crate::model::Version,
1624 crate::model::CreateVersionMetadataV1,
1625 >;
1626 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1627 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1628
1629 let stub = self.0.stub.clone();
1630 let mut options = self.0.options.clone();
1631 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1632 let query = move |name| {
1633 let stub = stub.clone();
1634 let options = options.clone();
1635 async {
1636 let op = GetOperation::new(stub)
1637 .set_name(name)
1638 .with_options(options)
1639 .send()
1640 .await?;
1641 Ok(Operation::new(op))
1642 }
1643 };
1644
1645 let start = move || async {
1646 let op = self.send().await?;
1647 Ok(Operation::new(op))
1648 };
1649
1650 google_cloud_lro::internal::new_poller(
1651 polling_error_policy,
1652 polling_backoff_policy,
1653 start,
1654 query,
1655 )
1656 }
1657
1658 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1660 self.0.request.parent = v.into();
1661 self
1662 }
1663
1664 pub fn set_version<T>(mut self, v: T) -> Self
1666 where
1667 T: std::convert::Into<crate::model::Version>,
1668 {
1669 self.0.request.version = std::option::Option::Some(v.into());
1670 self
1671 }
1672
1673 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1675 where
1676 T: std::convert::Into<crate::model::Version>,
1677 {
1678 self.0.request.version = v.map(|x| x.into());
1679 self
1680 }
1681 }
1682
1683 #[doc(hidden)]
1684 impl crate::RequestBuilder for CreateVersion {
1685 fn request_options(&mut self) -> &mut crate::RequestOptions {
1686 &mut self.0.options
1687 }
1688 }
1689
1690 #[derive(Clone, Debug)]
1708 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
1709
1710 impl UpdateVersion {
1711 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1712 Self(RequestBuilder::new(stub))
1713 }
1714
1715 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
1717 self.0.request = v.into();
1718 self
1719 }
1720
1721 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1723 self.0.options = v.into();
1724 self
1725 }
1726
1727 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1734 (*self.0.stub)
1735 .update_version(self.0.request, self.0.options)
1736 .await
1737 .map(crate::Response::into_body)
1738 }
1739
1740 pub fn poller(
1742 self,
1743 ) -> impl google_cloud_lro::Poller<crate::model::Version, crate::model::OperationMetadataV1>
1744 {
1745 type Operation = google_cloud_lro::internal::Operation<
1746 crate::model::Version,
1747 crate::model::OperationMetadataV1,
1748 >;
1749 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1750 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1751
1752 let stub = self.0.stub.clone();
1753 let mut options = self.0.options.clone();
1754 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1755 let query = move |name| {
1756 let stub = stub.clone();
1757 let options = options.clone();
1758 async {
1759 let op = GetOperation::new(stub)
1760 .set_name(name)
1761 .with_options(options)
1762 .send()
1763 .await?;
1764 Ok(Operation::new(op))
1765 }
1766 };
1767
1768 let start = move || async {
1769 let op = self.send().await?;
1770 Ok(Operation::new(op))
1771 };
1772
1773 google_cloud_lro::internal::new_poller(
1774 polling_error_policy,
1775 polling_backoff_policy,
1776 start,
1777 query,
1778 )
1779 }
1780
1781 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1783 self.0.request.name = v.into();
1784 self
1785 }
1786
1787 pub fn set_version<T>(mut self, v: T) -> Self
1789 where
1790 T: std::convert::Into<crate::model::Version>,
1791 {
1792 self.0.request.version = std::option::Option::Some(v.into());
1793 self
1794 }
1795
1796 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1798 where
1799 T: std::convert::Into<crate::model::Version>,
1800 {
1801 self.0.request.version = v.map(|x| x.into());
1802 self
1803 }
1804
1805 pub fn set_update_mask<T>(mut self, v: T) -> Self
1807 where
1808 T: std::convert::Into<wkt::FieldMask>,
1809 {
1810 self.0.request.update_mask = std::option::Option::Some(v.into());
1811 self
1812 }
1813
1814 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1816 where
1817 T: std::convert::Into<wkt::FieldMask>,
1818 {
1819 self.0.request.update_mask = v.map(|x| x.into());
1820 self
1821 }
1822 }
1823
1824 #[doc(hidden)]
1825 impl crate::RequestBuilder for UpdateVersion {
1826 fn request_options(&mut self) -> &mut crate::RequestOptions {
1827 &mut self.0.options
1828 }
1829 }
1830
1831 #[derive(Clone, Debug)]
1849 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
1850
1851 impl DeleteVersion {
1852 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1853 Self(RequestBuilder::new(stub))
1854 }
1855
1856 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
1858 self.0.request = v.into();
1859 self
1860 }
1861
1862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1864 self.0.options = v.into();
1865 self
1866 }
1867
1868 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1875 (*self.0.stub)
1876 .delete_version(self.0.request, self.0.options)
1877 .await
1878 .map(crate::Response::into_body)
1879 }
1880
1881 pub fn poller(
1883 self,
1884 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
1885 type Operation = google_cloud_lro::internal::Operation<
1886 wkt::Empty,
1887 crate::model::OperationMetadataV1,
1888 >;
1889 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1890 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1891
1892 let stub = self.0.stub.clone();
1893 let mut options = self.0.options.clone();
1894 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1895 let query = move |name| {
1896 let stub = stub.clone();
1897 let options = options.clone();
1898 async {
1899 let op = GetOperation::new(stub)
1900 .set_name(name)
1901 .with_options(options)
1902 .send()
1903 .await?;
1904 Ok(Operation::new(op))
1905 }
1906 };
1907
1908 let start = move || async {
1909 let op = self.send().await?;
1910 Ok(Operation::new(op))
1911 };
1912
1913 google_cloud_lro::internal::new_unit_response_poller(
1914 polling_error_policy,
1915 polling_backoff_policy,
1916 start,
1917 query,
1918 )
1919 }
1920
1921 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1923 self.0.request.name = v.into();
1924 self
1925 }
1926 }
1927
1928 #[doc(hidden)]
1929 impl crate::RequestBuilder for DeleteVersion {
1930 fn request_options(&mut self) -> &mut crate::RequestOptions {
1931 &mut self.0.options
1932 }
1933 }
1934
1935 #[derive(Clone, Debug)]
1956 pub struct ListOperations(
1957 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1958 );
1959
1960 impl ListOperations {
1961 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1962 Self(RequestBuilder::new(stub))
1963 }
1964
1965 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1967 mut self,
1968 v: V,
1969 ) -> Self {
1970 self.0.request = v.into();
1971 self
1972 }
1973
1974 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1976 self.0.options = v.into();
1977 self
1978 }
1979
1980 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1982 (*self.0.stub)
1983 .list_operations(self.0.request, self.0.options)
1984 .await
1985 .map(crate::Response::into_body)
1986 }
1987
1988 pub fn by_page(
1990 self,
1991 ) -> impl google_cloud_gax::paginator::Paginator<
1992 google_cloud_longrunning::model::ListOperationsResponse,
1993 crate::Error,
1994 > {
1995 use std::clone::Clone;
1996 let token = self.0.request.page_token.clone();
1997 let execute = move |token: String| {
1998 let mut builder = self.clone();
1999 builder.0.request = builder.0.request.set_page_token(token);
2000 builder.send()
2001 };
2002 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2003 }
2004
2005 pub fn by_item(
2007 self,
2008 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2009 google_cloud_longrunning::model::ListOperationsResponse,
2010 crate::Error,
2011 > {
2012 use google_cloud_gax::paginator::Paginator;
2013 self.by_page().items()
2014 }
2015
2016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.0.request.name = v.into();
2019 self
2020 }
2021
2022 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2024 self.0.request.filter = v.into();
2025 self
2026 }
2027
2028 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2030 self.0.request.page_size = v.into();
2031 self
2032 }
2033
2034 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2036 self.0.request.page_token = v.into();
2037 self
2038 }
2039
2040 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2042 self.0.request.return_partial_success = v.into();
2043 self
2044 }
2045 }
2046
2047 #[doc(hidden)]
2048 impl crate::RequestBuilder for ListOperations {
2049 fn request_options(&mut self) -> &mut crate::RequestOptions {
2050 &mut self.0.options
2051 }
2052 }
2053
2054 #[derive(Clone, Debug)]
2071 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2072
2073 impl GetOperation {
2074 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2075 Self(RequestBuilder::new(stub))
2076 }
2077
2078 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2080 mut self,
2081 v: V,
2082 ) -> Self {
2083 self.0.request = v.into();
2084 self
2085 }
2086
2087 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2089 self.0.options = v.into();
2090 self
2091 }
2092
2093 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2095 (*self.0.stub)
2096 .get_operation(self.0.request, self.0.options)
2097 .await
2098 .map(crate::Response::into_body)
2099 }
2100
2101 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2103 self.0.request.name = v.into();
2104 self
2105 }
2106 }
2107
2108 #[doc(hidden)]
2109 impl crate::RequestBuilder for GetOperation {
2110 fn request_options(&mut self) -> &mut crate::RequestOptions {
2111 &mut self.0.options
2112 }
2113 }
2114}
2115
2116pub mod instances {
2118 use crate::Result;
2119
2120 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2134
2135 pub(crate) mod client {
2136 use super::super::super::client::Instances;
2137 pub struct Factory;
2138 impl crate::ClientFactory for Factory {
2139 type Client = Instances;
2140 type Credentials = gaxi::options::Credentials;
2141 async fn build(
2142 self,
2143 config: gaxi::options::ClientConfig,
2144 ) -> crate::ClientBuilderResult<Self::Client> {
2145 Self::Client::new(config).await
2146 }
2147 }
2148 }
2149
2150 #[derive(Clone, Debug)]
2152 pub(crate) struct RequestBuilder<R: std::default::Default> {
2153 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2154 request: R,
2155 options: crate::RequestOptions,
2156 }
2157
2158 impl<R> RequestBuilder<R>
2159 where
2160 R: std::default::Default,
2161 {
2162 pub(crate) fn new(
2163 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2164 ) -> Self {
2165 Self {
2166 stub,
2167 request: R::default(),
2168 options: crate::RequestOptions::default(),
2169 }
2170 }
2171 }
2172
2173 #[derive(Clone, Debug)]
2194 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
2195
2196 impl ListInstances {
2197 pub(crate) fn new(
2198 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2199 ) -> Self {
2200 Self(RequestBuilder::new(stub))
2201 }
2202
2203 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
2205 self.0.request = v.into();
2206 self
2207 }
2208
2209 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2211 self.0.options = v.into();
2212 self
2213 }
2214
2215 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
2217 (*self.0.stub)
2218 .list_instances(self.0.request, self.0.options)
2219 .await
2220 .map(crate::Response::into_body)
2221 }
2222
2223 pub fn by_page(
2225 self,
2226 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
2227 {
2228 use std::clone::Clone;
2229 let token = self.0.request.page_token.clone();
2230 let execute = move |token: String| {
2231 let mut builder = self.clone();
2232 builder.0.request = builder.0.request.set_page_token(token);
2233 builder.send()
2234 };
2235 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2236 }
2237
2238 pub fn by_item(
2240 self,
2241 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2242 crate::model::ListInstancesResponse,
2243 crate::Error,
2244 > {
2245 use google_cloud_gax::paginator::Paginator;
2246 self.by_page().items()
2247 }
2248
2249 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2251 self.0.request.parent = v.into();
2252 self
2253 }
2254
2255 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2257 self.0.request.page_size = v.into();
2258 self
2259 }
2260
2261 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2263 self.0.request.page_token = v.into();
2264 self
2265 }
2266 }
2267
2268 #[doc(hidden)]
2269 impl crate::RequestBuilder for ListInstances {
2270 fn request_options(&mut self) -> &mut crate::RequestOptions {
2271 &mut self.0.options
2272 }
2273 }
2274
2275 #[derive(Clone, Debug)]
2292 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2293
2294 impl GetInstance {
2295 pub(crate) fn new(
2296 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2297 ) -> Self {
2298 Self(RequestBuilder::new(stub))
2299 }
2300
2301 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2303 self.0.request = v.into();
2304 self
2305 }
2306
2307 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2309 self.0.options = v.into();
2310 self
2311 }
2312
2313 pub async fn send(self) -> Result<crate::model::Instance> {
2315 (*self.0.stub)
2316 .get_instance(self.0.request, self.0.options)
2317 .await
2318 .map(crate::Response::into_body)
2319 }
2320
2321 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2323 self.0.request.name = v.into();
2324 self
2325 }
2326 }
2327
2328 #[doc(hidden)]
2329 impl crate::RequestBuilder for GetInstance {
2330 fn request_options(&mut self) -> &mut crate::RequestOptions {
2331 &mut self.0.options
2332 }
2333 }
2334
2335 #[derive(Clone, Debug)]
2353 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
2354
2355 impl DeleteInstance {
2356 pub(crate) fn new(
2357 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2358 ) -> Self {
2359 Self(RequestBuilder::new(stub))
2360 }
2361
2362 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
2364 self.0.request = v.into();
2365 self
2366 }
2367
2368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2370 self.0.options = v.into();
2371 self
2372 }
2373
2374 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2381 (*self.0.stub)
2382 .delete_instance(self.0.request, self.0.options)
2383 .await
2384 .map(crate::Response::into_body)
2385 }
2386
2387 pub fn poller(
2389 self,
2390 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
2391 type Operation = google_cloud_lro::internal::Operation<
2392 wkt::Empty,
2393 crate::model::OperationMetadataV1,
2394 >;
2395 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2396 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2397
2398 let stub = self.0.stub.clone();
2399 let mut options = self.0.options.clone();
2400 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2401 let query = move |name| {
2402 let stub = stub.clone();
2403 let options = options.clone();
2404 async {
2405 let op = GetOperation::new(stub)
2406 .set_name(name)
2407 .with_options(options)
2408 .send()
2409 .await?;
2410 Ok(Operation::new(op))
2411 }
2412 };
2413
2414 let start = move || async {
2415 let op = self.send().await?;
2416 Ok(Operation::new(op))
2417 };
2418
2419 google_cloud_lro::internal::new_unit_response_poller(
2420 polling_error_policy,
2421 polling_backoff_policy,
2422 start,
2423 query,
2424 )
2425 }
2426
2427 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2429 self.0.request.name = v.into();
2430 self
2431 }
2432 }
2433
2434 #[doc(hidden)]
2435 impl crate::RequestBuilder for DeleteInstance {
2436 fn request_options(&mut self) -> &mut crate::RequestOptions {
2437 &mut self.0.options
2438 }
2439 }
2440
2441 #[derive(Clone, Debug)]
2459 pub struct DebugInstance(RequestBuilder<crate::model::DebugInstanceRequest>);
2460
2461 impl DebugInstance {
2462 pub(crate) fn new(
2463 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2464 ) -> Self {
2465 Self(RequestBuilder::new(stub))
2466 }
2467
2468 pub fn with_request<V: Into<crate::model::DebugInstanceRequest>>(mut self, v: V) -> Self {
2470 self.0.request = v.into();
2471 self
2472 }
2473
2474 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2476 self.0.options = v.into();
2477 self
2478 }
2479
2480 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2487 (*self.0.stub)
2488 .debug_instance(self.0.request, self.0.options)
2489 .await
2490 .map(crate::Response::into_body)
2491 }
2492
2493 pub fn poller(
2495 self,
2496 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadataV1>
2497 {
2498 type Operation = google_cloud_lro::internal::Operation<
2499 crate::model::Instance,
2500 crate::model::OperationMetadataV1,
2501 >;
2502 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2503 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2504
2505 let stub = self.0.stub.clone();
2506 let mut options = self.0.options.clone();
2507 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2508 let query = move |name| {
2509 let stub = stub.clone();
2510 let options = options.clone();
2511 async {
2512 let op = GetOperation::new(stub)
2513 .set_name(name)
2514 .with_options(options)
2515 .send()
2516 .await?;
2517 Ok(Operation::new(op))
2518 }
2519 };
2520
2521 let start = move || async {
2522 let op = self.send().await?;
2523 Ok(Operation::new(op))
2524 };
2525
2526 google_cloud_lro::internal::new_poller(
2527 polling_error_policy,
2528 polling_backoff_policy,
2529 start,
2530 query,
2531 )
2532 }
2533
2534 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2536 self.0.request.name = v.into();
2537 self
2538 }
2539
2540 pub fn set_ssh_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
2542 self.0.request.ssh_key = v.into();
2543 self
2544 }
2545 }
2546
2547 #[doc(hidden)]
2548 impl crate::RequestBuilder for DebugInstance {
2549 fn request_options(&mut self) -> &mut crate::RequestOptions {
2550 &mut self.0.options
2551 }
2552 }
2553
2554 #[derive(Clone, Debug)]
2575 pub struct ListOperations(
2576 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2577 );
2578
2579 impl ListOperations {
2580 pub(crate) fn new(
2581 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2582 ) -> Self {
2583 Self(RequestBuilder::new(stub))
2584 }
2585
2586 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2588 mut self,
2589 v: V,
2590 ) -> Self {
2591 self.0.request = v.into();
2592 self
2593 }
2594
2595 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2597 self.0.options = v.into();
2598 self
2599 }
2600
2601 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2603 (*self.0.stub)
2604 .list_operations(self.0.request, self.0.options)
2605 .await
2606 .map(crate::Response::into_body)
2607 }
2608
2609 pub fn by_page(
2611 self,
2612 ) -> impl google_cloud_gax::paginator::Paginator<
2613 google_cloud_longrunning::model::ListOperationsResponse,
2614 crate::Error,
2615 > {
2616 use std::clone::Clone;
2617 let token = self.0.request.page_token.clone();
2618 let execute = move |token: String| {
2619 let mut builder = self.clone();
2620 builder.0.request = builder.0.request.set_page_token(token);
2621 builder.send()
2622 };
2623 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2624 }
2625
2626 pub fn by_item(
2628 self,
2629 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2630 google_cloud_longrunning::model::ListOperationsResponse,
2631 crate::Error,
2632 > {
2633 use google_cloud_gax::paginator::Paginator;
2634 self.by_page().items()
2635 }
2636
2637 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2639 self.0.request.name = v.into();
2640 self
2641 }
2642
2643 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2645 self.0.request.filter = v.into();
2646 self
2647 }
2648
2649 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2651 self.0.request.page_size = v.into();
2652 self
2653 }
2654
2655 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2657 self.0.request.page_token = v.into();
2658 self
2659 }
2660
2661 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2663 self.0.request.return_partial_success = v.into();
2664 self
2665 }
2666 }
2667
2668 #[doc(hidden)]
2669 impl crate::RequestBuilder for ListOperations {
2670 fn request_options(&mut self) -> &mut crate::RequestOptions {
2671 &mut self.0.options
2672 }
2673 }
2674
2675 #[derive(Clone, Debug)]
2692 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2693
2694 impl GetOperation {
2695 pub(crate) fn new(
2696 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2697 ) -> Self {
2698 Self(RequestBuilder::new(stub))
2699 }
2700
2701 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2703 mut self,
2704 v: V,
2705 ) -> Self {
2706 self.0.request = v.into();
2707 self
2708 }
2709
2710 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2712 self.0.options = v.into();
2713 self
2714 }
2715
2716 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2718 (*self.0.stub)
2719 .get_operation(self.0.request, self.0.options)
2720 .await
2721 .map(crate::Response::into_body)
2722 }
2723
2724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2726 self.0.request.name = v.into();
2727 self
2728 }
2729 }
2730
2731 #[doc(hidden)]
2732 impl crate::RequestBuilder for GetOperation {
2733 fn request_options(&mut self) -> &mut crate::RequestOptions {
2734 &mut self.0.options
2735 }
2736 }
2737}
2738
2739pub mod firewall {
2741 use crate::Result;
2742
2743 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2757
2758 pub(crate) mod client {
2759 use super::super::super::client::Firewall;
2760 pub struct Factory;
2761 impl crate::ClientFactory for Factory {
2762 type Client = Firewall;
2763 type Credentials = gaxi::options::Credentials;
2764 async fn build(
2765 self,
2766 config: gaxi::options::ClientConfig,
2767 ) -> crate::ClientBuilderResult<Self::Client> {
2768 Self::Client::new(config).await
2769 }
2770 }
2771 }
2772
2773 #[derive(Clone, Debug)]
2775 pub(crate) struct RequestBuilder<R: std::default::Default> {
2776 stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>,
2777 request: R,
2778 options: crate::RequestOptions,
2779 }
2780
2781 impl<R> RequestBuilder<R>
2782 where
2783 R: std::default::Default,
2784 {
2785 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2786 Self {
2787 stub,
2788 request: R::default(),
2789 options: crate::RequestOptions::default(),
2790 }
2791 }
2792 }
2793
2794 #[derive(Clone, Debug)]
2815 pub struct ListIngressRules(RequestBuilder<crate::model::ListIngressRulesRequest>);
2816
2817 impl ListIngressRules {
2818 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2819 Self(RequestBuilder::new(stub))
2820 }
2821
2822 pub fn with_request<V: Into<crate::model::ListIngressRulesRequest>>(
2824 mut self,
2825 v: V,
2826 ) -> Self {
2827 self.0.request = v.into();
2828 self
2829 }
2830
2831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2833 self.0.options = v.into();
2834 self
2835 }
2836
2837 pub async fn send(self) -> Result<crate::model::ListIngressRulesResponse> {
2839 (*self.0.stub)
2840 .list_ingress_rules(self.0.request, self.0.options)
2841 .await
2842 .map(crate::Response::into_body)
2843 }
2844
2845 pub fn by_page(
2847 self,
2848 ) -> impl google_cloud_gax::paginator::Paginator<
2849 crate::model::ListIngressRulesResponse,
2850 crate::Error,
2851 > {
2852 use std::clone::Clone;
2853 let token = self.0.request.page_token.clone();
2854 let execute = move |token: String| {
2855 let mut builder = self.clone();
2856 builder.0.request = builder.0.request.set_page_token(token);
2857 builder.send()
2858 };
2859 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2860 }
2861
2862 pub fn by_item(
2864 self,
2865 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2866 crate::model::ListIngressRulesResponse,
2867 crate::Error,
2868 > {
2869 use google_cloud_gax::paginator::Paginator;
2870 self.by_page().items()
2871 }
2872
2873 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2875 self.0.request.parent = v.into();
2876 self
2877 }
2878
2879 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2881 self.0.request.page_size = v.into();
2882 self
2883 }
2884
2885 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2887 self.0.request.page_token = v.into();
2888 self
2889 }
2890
2891 pub fn set_matching_address<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893 self.0.request.matching_address = v.into();
2894 self
2895 }
2896 }
2897
2898 #[doc(hidden)]
2899 impl crate::RequestBuilder for ListIngressRules {
2900 fn request_options(&mut self) -> &mut crate::RequestOptions {
2901 &mut self.0.options
2902 }
2903 }
2904
2905 #[derive(Clone, Debug)]
2922 pub struct BatchUpdateIngressRules(
2923 RequestBuilder<crate::model::BatchUpdateIngressRulesRequest>,
2924 );
2925
2926 impl BatchUpdateIngressRules {
2927 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2928 Self(RequestBuilder::new(stub))
2929 }
2930
2931 pub fn with_request<V: Into<crate::model::BatchUpdateIngressRulesRequest>>(
2933 mut self,
2934 v: V,
2935 ) -> Self {
2936 self.0.request = v.into();
2937 self
2938 }
2939
2940 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2942 self.0.options = v.into();
2943 self
2944 }
2945
2946 pub async fn send(self) -> Result<crate::model::BatchUpdateIngressRulesResponse> {
2948 (*self.0.stub)
2949 .batch_update_ingress_rules(self.0.request, self.0.options)
2950 .await
2951 .map(crate::Response::into_body)
2952 }
2953
2954 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2956 self.0.request.name = v.into();
2957 self
2958 }
2959
2960 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
2962 where
2963 T: std::iter::IntoIterator<Item = V>,
2964 V: std::convert::Into<crate::model::FirewallRule>,
2965 {
2966 use std::iter::Iterator;
2967 self.0.request.ingress_rules = v.into_iter().map(|i| i.into()).collect();
2968 self
2969 }
2970 }
2971
2972 #[doc(hidden)]
2973 impl crate::RequestBuilder for BatchUpdateIngressRules {
2974 fn request_options(&mut self) -> &mut crate::RequestOptions {
2975 &mut self.0.options
2976 }
2977 }
2978
2979 #[derive(Clone, Debug)]
2996 pub struct CreateIngressRule(RequestBuilder<crate::model::CreateIngressRuleRequest>);
2997
2998 impl CreateIngressRule {
2999 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3000 Self(RequestBuilder::new(stub))
3001 }
3002
3003 pub fn with_request<V: Into<crate::model::CreateIngressRuleRequest>>(
3005 mut self,
3006 v: V,
3007 ) -> Self {
3008 self.0.request = v.into();
3009 self
3010 }
3011
3012 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3014 self.0.options = v.into();
3015 self
3016 }
3017
3018 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3020 (*self.0.stub)
3021 .create_ingress_rule(self.0.request, self.0.options)
3022 .await
3023 .map(crate::Response::into_body)
3024 }
3025
3026 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3028 self.0.request.parent = v.into();
3029 self
3030 }
3031
3032 pub fn set_rule<T>(mut self, v: T) -> Self
3034 where
3035 T: std::convert::Into<crate::model::FirewallRule>,
3036 {
3037 self.0.request.rule = std::option::Option::Some(v.into());
3038 self
3039 }
3040
3041 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3043 where
3044 T: std::convert::Into<crate::model::FirewallRule>,
3045 {
3046 self.0.request.rule = v.map(|x| x.into());
3047 self
3048 }
3049 }
3050
3051 #[doc(hidden)]
3052 impl crate::RequestBuilder for CreateIngressRule {
3053 fn request_options(&mut self) -> &mut crate::RequestOptions {
3054 &mut self.0.options
3055 }
3056 }
3057
3058 #[derive(Clone, Debug)]
3075 pub struct GetIngressRule(RequestBuilder<crate::model::GetIngressRuleRequest>);
3076
3077 impl GetIngressRule {
3078 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3079 Self(RequestBuilder::new(stub))
3080 }
3081
3082 pub fn with_request<V: Into<crate::model::GetIngressRuleRequest>>(mut self, v: V) -> Self {
3084 self.0.request = v.into();
3085 self
3086 }
3087
3088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3090 self.0.options = v.into();
3091 self
3092 }
3093
3094 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3096 (*self.0.stub)
3097 .get_ingress_rule(self.0.request, self.0.options)
3098 .await
3099 .map(crate::Response::into_body)
3100 }
3101
3102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3104 self.0.request.name = v.into();
3105 self
3106 }
3107 }
3108
3109 #[doc(hidden)]
3110 impl crate::RequestBuilder for GetIngressRule {
3111 fn request_options(&mut self) -> &mut crate::RequestOptions {
3112 &mut self.0.options
3113 }
3114 }
3115
3116 #[derive(Clone, Debug)]
3133 pub struct UpdateIngressRule(RequestBuilder<crate::model::UpdateIngressRuleRequest>);
3134
3135 impl UpdateIngressRule {
3136 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3137 Self(RequestBuilder::new(stub))
3138 }
3139
3140 pub fn with_request<V: Into<crate::model::UpdateIngressRuleRequest>>(
3142 mut self,
3143 v: V,
3144 ) -> Self {
3145 self.0.request = v.into();
3146 self
3147 }
3148
3149 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3151 self.0.options = v.into();
3152 self
3153 }
3154
3155 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3157 (*self.0.stub)
3158 .update_ingress_rule(self.0.request, self.0.options)
3159 .await
3160 .map(crate::Response::into_body)
3161 }
3162
3163 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3165 self.0.request.name = v.into();
3166 self
3167 }
3168
3169 pub fn set_rule<T>(mut self, v: T) -> Self
3171 where
3172 T: std::convert::Into<crate::model::FirewallRule>,
3173 {
3174 self.0.request.rule = std::option::Option::Some(v.into());
3175 self
3176 }
3177
3178 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3180 where
3181 T: std::convert::Into<crate::model::FirewallRule>,
3182 {
3183 self.0.request.rule = v.map(|x| x.into());
3184 self
3185 }
3186
3187 pub fn set_update_mask<T>(mut self, v: T) -> Self
3189 where
3190 T: std::convert::Into<wkt::FieldMask>,
3191 {
3192 self.0.request.update_mask = std::option::Option::Some(v.into());
3193 self
3194 }
3195
3196 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3198 where
3199 T: std::convert::Into<wkt::FieldMask>,
3200 {
3201 self.0.request.update_mask = v.map(|x| x.into());
3202 self
3203 }
3204 }
3205
3206 #[doc(hidden)]
3207 impl crate::RequestBuilder for UpdateIngressRule {
3208 fn request_options(&mut self) -> &mut crate::RequestOptions {
3209 &mut self.0.options
3210 }
3211 }
3212
3213 #[derive(Clone, Debug)]
3230 pub struct DeleteIngressRule(RequestBuilder<crate::model::DeleteIngressRuleRequest>);
3231
3232 impl DeleteIngressRule {
3233 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3234 Self(RequestBuilder::new(stub))
3235 }
3236
3237 pub fn with_request<V: Into<crate::model::DeleteIngressRuleRequest>>(
3239 mut self,
3240 v: V,
3241 ) -> Self {
3242 self.0.request = v.into();
3243 self
3244 }
3245
3246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3248 self.0.options = v.into();
3249 self
3250 }
3251
3252 pub async fn send(self) -> Result<()> {
3254 (*self.0.stub)
3255 .delete_ingress_rule(self.0.request, self.0.options)
3256 .await
3257 .map(crate::Response::into_body)
3258 }
3259
3260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3262 self.0.request.name = v.into();
3263 self
3264 }
3265 }
3266
3267 #[doc(hidden)]
3268 impl crate::RequestBuilder for DeleteIngressRule {
3269 fn request_options(&mut self) -> &mut crate::RequestOptions {
3270 &mut self.0.options
3271 }
3272 }
3273
3274 #[derive(Clone, Debug)]
3295 pub struct ListOperations(
3296 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3297 );
3298
3299 impl ListOperations {
3300 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3301 Self(RequestBuilder::new(stub))
3302 }
3303
3304 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3306 mut self,
3307 v: V,
3308 ) -> Self {
3309 self.0.request = v.into();
3310 self
3311 }
3312
3313 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3315 self.0.options = v.into();
3316 self
3317 }
3318
3319 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3321 (*self.0.stub)
3322 .list_operations(self.0.request, self.0.options)
3323 .await
3324 .map(crate::Response::into_body)
3325 }
3326
3327 pub fn by_page(
3329 self,
3330 ) -> impl google_cloud_gax::paginator::Paginator<
3331 google_cloud_longrunning::model::ListOperationsResponse,
3332 crate::Error,
3333 > {
3334 use std::clone::Clone;
3335 let token = self.0.request.page_token.clone();
3336 let execute = move |token: String| {
3337 let mut builder = self.clone();
3338 builder.0.request = builder.0.request.set_page_token(token);
3339 builder.send()
3340 };
3341 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3342 }
3343
3344 pub fn by_item(
3346 self,
3347 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3348 google_cloud_longrunning::model::ListOperationsResponse,
3349 crate::Error,
3350 > {
3351 use google_cloud_gax::paginator::Paginator;
3352 self.by_page().items()
3353 }
3354
3355 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3357 self.0.request.name = v.into();
3358 self
3359 }
3360
3361 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3363 self.0.request.filter = v.into();
3364 self
3365 }
3366
3367 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3369 self.0.request.page_size = v.into();
3370 self
3371 }
3372
3373 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3375 self.0.request.page_token = v.into();
3376 self
3377 }
3378
3379 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3381 self.0.request.return_partial_success = v.into();
3382 self
3383 }
3384 }
3385
3386 #[doc(hidden)]
3387 impl crate::RequestBuilder for ListOperations {
3388 fn request_options(&mut self) -> &mut crate::RequestOptions {
3389 &mut self.0.options
3390 }
3391 }
3392
3393 #[derive(Clone, Debug)]
3410 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3411
3412 impl GetOperation {
3413 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3414 Self(RequestBuilder::new(stub))
3415 }
3416
3417 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3419 mut self,
3420 v: V,
3421 ) -> Self {
3422 self.0.request = v.into();
3423 self
3424 }
3425
3426 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3428 self.0.options = v.into();
3429 self
3430 }
3431
3432 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3434 (*self.0.stub)
3435 .get_operation(self.0.request, self.0.options)
3436 .await
3437 .map(crate::Response::into_body)
3438 }
3439
3440 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3442 self.0.request.name = v.into();
3443 self
3444 }
3445 }
3446
3447 #[doc(hidden)]
3448 impl crate::RequestBuilder for GetOperation {
3449 fn request_options(&mut self) -> &mut crate::RequestOptions {
3450 &mut self.0.options
3451 }
3452 }
3453}
3454
3455pub mod authorized_domains {
3457 use crate::Result;
3458
3459 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3473
3474 pub(crate) mod client {
3475 use super::super::super::client::AuthorizedDomains;
3476 pub struct Factory;
3477 impl crate::ClientFactory for Factory {
3478 type Client = AuthorizedDomains;
3479 type Credentials = gaxi::options::Credentials;
3480 async fn build(
3481 self,
3482 config: gaxi::options::ClientConfig,
3483 ) -> crate::ClientBuilderResult<Self::Client> {
3484 Self::Client::new(config).await
3485 }
3486 }
3487 }
3488
3489 #[derive(Clone, Debug)]
3491 pub(crate) struct RequestBuilder<R: std::default::Default> {
3492 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3493 request: R,
3494 options: crate::RequestOptions,
3495 }
3496
3497 impl<R> RequestBuilder<R>
3498 where
3499 R: std::default::Default,
3500 {
3501 pub(crate) fn new(
3502 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3503 ) -> Self {
3504 Self {
3505 stub,
3506 request: R::default(),
3507 options: crate::RequestOptions::default(),
3508 }
3509 }
3510 }
3511
3512 #[derive(Clone, Debug)]
3533 pub struct ListAuthorizedDomains(RequestBuilder<crate::model::ListAuthorizedDomainsRequest>);
3534
3535 impl ListAuthorizedDomains {
3536 pub(crate) fn new(
3537 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3538 ) -> Self {
3539 Self(RequestBuilder::new(stub))
3540 }
3541
3542 pub fn with_request<V: Into<crate::model::ListAuthorizedDomainsRequest>>(
3544 mut self,
3545 v: V,
3546 ) -> Self {
3547 self.0.request = v.into();
3548 self
3549 }
3550
3551 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3553 self.0.options = v.into();
3554 self
3555 }
3556
3557 pub async fn send(self) -> Result<crate::model::ListAuthorizedDomainsResponse> {
3559 (*self.0.stub)
3560 .list_authorized_domains(self.0.request, self.0.options)
3561 .await
3562 .map(crate::Response::into_body)
3563 }
3564
3565 pub fn by_page(
3567 self,
3568 ) -> impl google_cloud_gax::paginator::Paginator<
3569 crate::model::ListAuthorizedDomainsResponse,
3570 crate::Error,
3571 > {
3572 use std::clone::Clone;
3573 let token = self.0.request.page_token.clone();
3574 let execute = move |token: String| {
3575 let mut builder = self.clone();
3576 builder.0.request = builder.0.request.set_page_token(token);
3577 builder.send()
3578 };
3579 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3580 }
3581
3582 pub fn by_item(
3584 self,
3585 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3586 crate::model::ListAuthorizedDomainsResponse,
3587 crate::Error,
3588 > {
3589 use google_cloud_gax::paginator::Paginator;
3590 self.by_page().items()
3591 }
3592
3593 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3595 self.0.request.parent = v.into();
3596 self
3597 }
3598
3599 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3601 self.0.request.page_size = v.into();
3602 self
3603 }
3604
3605 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3607 self.0.request.page_token = v.into();
3608 self
3609 }
3610 }
3611
3612 #[doc(hidden)]
3613 impl crate::RequestBuilder for ListAuthorizedDomains {
3614 fn request_options(&mut self) -> &mut crate::RequestOptions {
3615 &mut self.0.options
3616 }
3617 }
3618
3619 #[derive(Clone, Debug)]
3640 pub struct ListOperations(
3641 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3642 );
3643
3644 impl ListOperations {
3645 pub(crate) fn new(
3646 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3647 ) -> Self {
3648 Self(RequestBuilder::new(stub))
3649 }
3650
3651 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3653 mut self,
3654 v: V,
3655 ) -> Self {
3656 self.0.request = v.into();
3657 self
3658 }
3659
3660 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3662 self.0.options = v.into();
3663 self
3664 }
3665
3666 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3668 (*self.0.stub)
3669 .list_operations(self.0.request, self.0.options)
3670 .await
3671 .map(crate::Response::into_body)
3672 }
3673
3674 pub fn by_page(
3676 self,
3677 ) -> impl google_cloud_gax::paginator::Paginator<
3678 google_cloud_longrunning::model::ListOperationsResponse,
3679 crate::Error,
3680 > {
3681 use std::clone::Clone;
3682 let token = self.0.request.page_token.clone();
3683 let execute = move |token: String| {
3684 let mut builder = self.clone();
3685 builder.0.request = builder.0.request.set_page_token(token);
3686 builder.send()
3687 };
3688 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3689 }
3690
3691 pub fn by_item(
3693 self,
3694 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3695 google_cloud_longrunning::model::ListOperationsResponse,
3696 crate::Error,
3697 > {
3698 use google_cloud_gax::paginator::Paginator;
3699 self.by_page().items()
3700 }
3701
3702 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3704 self.0.request.name = v.into();
3705 self
3706 }
3707
3708 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3710 self.0.request.filter = v.into();
3711 self
3712 }
3713
3714 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3716 self.0.request.page_size = v.into();
3717 self
3718 }
3719
3720 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3722 self.0.request.page_token = v.into();
3723 self
3724 }
3725
3726 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3728 self.0.request.return_partial_success = v.into();
3729 self
3730 }
3731 }
3732
3733 #[doc(hidden)]
3734 impl crate::RequestBuilder for ListOperations {
3735 fn request_options(&mut self) -> &mut crate::RequestOptions {
3736 &mut self.0.options
3737 }
3738 }
3739
3740 #[derive(Clone, Debug)]
3757 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3758
3759 impl GetOperation {
3760 pub(crate) fn new(
3761 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3762 ) -> Self {
3763 Self(RequestBuilder::new(stub))
3764 }
3765
3766 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3768 mut self,
3769 v: V,
3770 ) -> Self {
3771 self.0.request = v.into();
3772 self
3773 }
3774
3775 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3777 self.0.options = v.into();
3778 self
3779 }
3780
3781 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3783 (*self.0.stub)
3784 .get_operation(self.0.request, self.0.options)
3785 .await
3786 .map(crate::Response::into_body)
3787 }
3788
3789 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3791 self.0.request.name = v.into();
3792 self
3793 }
3794 }
3795
3796 #[doc(hidden)]
3797 impl crate::RequestBuilder for GetOperation {
3798 fn request_options(&mut self) -> &mut crate::RequestOptions {
3799 &mut self.0.options
3800 }
3801 }
3802}
3803
3804pub mod authorized_certificates {
3806 use crate::Result;
3807
3808 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3822
3823 pub(crate) mod client {
3824 use super::super::super::client::AuthorizedCertificates;
3825 pub struct Factory;
3826 impl crate::ClientFactory for Factory {
3827 type Client = AuthorizedCertificates;
3828 type Credentials = gaxi::options::Credentials;
3829 async fn build(
3830 self,
3831 config: gaxi::options::ClientConfig,
3832 ) -> crate::ClientBuilderResult<Self::Client> {
3833 Self::Client::new(config).await
3834 }
3835 }
3836 }
3837
3838 #[derive(Clone, Debug)]
3840 pub(crate) struct RequestBuilder<R: std::default::Default> {
3841 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3842 request: R,
3843 options: crate::RequestOptions,
3844 }
3845
3846 impl<R> RequestBuilder<R>
3847 where
3848 R: std::default::Default,
3849 {
3850 pub(crate) fn new(
3851 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3852 ) -> Self {
3853 Self {
3854 stub,
3855 request: R::default(),
3856 options: crate::RequestOptions::default(),
3857 }
3858 }
3859 }
3860
3861 #[derive(Clone, Debug)]
3882 pub struct ListAuthorizedCertificates(
3883 RequestBuilder<crate::model::ListAuthorizedCertificatesRequest>,
3884 );
3885
3886 impl ListAuthorizedCertificates {
3887 pub(crate) fn new(
3888 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3889 ) -> Self {
3890 Self(RequestBuilder::new(stub))
3891 }
3892
3893 pub fn with_request<V: Into<crate::model::ListAuthorizedCertificatesRequest>>(
3895 mut self,
3896 v: V,
3897 ) -> Self {
3898 self.0.request = v.into();
3899 self
3900 }
3901
3902 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3904 self.0.options = v.into();
3905 self
3906 }
3907
3908 pub async fn send(self) -> Result<crate::model::ListAuthorizedCertificatesResponse> {
3910 (*self.0.stub)
3911 .list_authorized_certificates(self.0.request, self.0.options)
3912 .await
3913 .map(crate::Response::into_body)
3914 }
3915
3916 pub fn by_page(
3918 self,
3919 ) -> impl google_cloud_gax::paginator::Paginator<
3920 crate::model::ListAuthorizedCertificatesResponse,
3921 crate::Error,
3922 > {
3923 use std::clone::Clone;
3924 let token = self.0.request.page_token.clone();
3925 let execute = move |token: String| {
3926 let mut builder = self.clone();
3927 builder.0.request = builder.0.request.set_page_token(token);
3928 builder.send()
3929 };
3930 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3931 }
3932
3933 pub fn by_item(
3935 self,
3936 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3937 crate::model::ListAuthorizedCertificatesResponse,
3938 crate::Error,
3939 > {
3940 use google_cloud_gax::paginator::Paginator;
3941 self.by_page().items()
3942 }
3943
3944 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3946 self.0.request.parent = v.into();
3947 self
3948 }
3949
3950 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
3952 self.0.request.view = v.into();
3953 self
3954 }
3955
3956 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3958 self.0.request.page_size = v.into();
3959 self
3960 }
3961
3962 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3964 self.0.request.page_token = v.into();
3965 self
3966 }
3967 }
3968
3969 #[doc(hidden)]
3970 impl crate::RequestBuilder for ListAuthorizedCertificates {
3971 fn request_options(&mut self) -> &mut crate::RequestOptions {
3972 &mut self.0.options
3973 }
3974 }
3975
3976 #[derive(Clone, Debug)]
3993 pub struct GetAuthorizedCertificate(
3994 RequestBuilder<crate::model::GetAuthorizedCertificateRequest>,
3995 );
3996
3997 impl GetAuthorizedCertificate {
3998 pub(crate) fn new(
3999 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4000 ) -> Self {
4001 Self(RequestBuilder::new(stub))
4002 }
4003
4004 pub fn with_request<V: Into<crate::model::GetAuthorizedCertificateRequest>>(
4006 mut self,
4007 v: V,
4008 ) -> Self {
4009 self.0.request = v.into();
4010 self
4011 }
4012
4013 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4015 self.0.options = v.into();
4016 self
4017 }
4018
4019 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4021 (*self.0.stub)
4022 .get_authorized_certificate(self.0.request, self.0.options)
4023 .await
4024 .map(crate::Response::into_body)
4025 }
4026
4027 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4029 self.0.request.name = v.into();
4030 self
4031 }
4032
4033 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
4035 self.0.request.view = v.into();
4036 self
4037 }
4038 }
4039
4040 #[doc(hidden)]
4041 impl crate::RequestBuilder for GetAuthorizedCertificate {
4042 fn request_options(&mut self) -> &mut crate::RequestOptions {
4043 &mut self.0.options
4044 }
4045 }
4046
4047 #[derive(Clone, Debug)]
4064 pub struct CreateAuthorizedCertificate(
4065 RequestBuilder<crate::model::CreateAuthorizedCertificateRequest>,
4066 );
4067
4068 impl CreateAuthorizedCertificate {
4069 pub(crate) fn new(
4070 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4071 ) -> Self {
4072 Self(RequestBuilder::new(stub))
4073 }
4074
4075 pub fn with_request<V: Into<crate::model::CreateAuthorizedCertificateRequest>>(
4077 mut self,
4078 v: V,
4079 ) -> Self {
4080 self.0.request = v.into();
4081 self
4082 }
4083
4084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4086 self.0.options = v.into();
4087 self
4088 }
4089
4090 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4092 (*self.0.stub)
4093 .create_authorized_certificate(self.0.request, self.0.options)
4094 .await
4095 .map(crate::Response::into_body)
4096 }
4097
4098 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4100 self.0.request.parent = v.into();
4101 self
4102 }
4103
4104 pub fn set_certificate<T>(mut self, v: T) -> Self
4106 where
4107 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4108 {
4109 self.0.request.certificate = std::option::Option::Some(v.into());
4110 self
4111 }
4112
4113 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4115 where
4116 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4117 {
4118 self.0.request.certificate = v.map(|x| x.into());
4119 self
4120 }
4121 }
4122
4123 #[doc(hidden)]
4124 impl crate::RequestBuilder for CreateAuthorizedCertificate {
4125 fn request_options(&mut self) -> &mut crate::RequestOptions {
4126 &mut self.0.options
4127 }
4128 }
4129
4130 #[derive(Clone, Debug)]
4147 pub struct UpdateAuthorizedCertificate(
4148 RequestBuilder<crate::model::UpdateAuthorizedCertificateRequest>,
4149 );
4150
4151 impl UpdateAuthorizedCertificate {
4152 pub(crate) fn new(
4153 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4154 ) -> Self {
4155 Self(RequestBuilder::new(stub))
4156 }
4157
4158 pub fn with_request<V: Into<crate::model::UpdateAuthorizedCertificateRequest>>(
4160 mut self,
4161 v: V,
4162 ) -> Self {
4163 self.0.request = v.into();
4164 self
4165 }
4166
4167 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4169 self.0.options = v.into();
4170 self
4171 }
4172
4173 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4175 (*self.0.stub)
4176 .update_authorized_certificate(self.0.request, self.0.options)
4177 .await
4178 .map(crate::Response::into_body)
4179 }
4180
4181 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4183 self.0.request.name = v.into();
4184 self
4185 }
4186
4187 pub fn set_certificate<T>(mut self, v: T) -> Self
4189 where
4190 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4191 {
4192 self.0.request.certificate = std::option::Option::Some(v.into());
4193 self
4194 }
4195
4196 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4198 where
4199 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4200 {
4201 self.0.request.certificate = v.map(|x| x.into());
4202 self
4203 }
4204
4205 pub fn set_update_mask<T>(mut self, v: T) -> Self
4207 where
4208 T: std::convert::Into<wkt::FieldMask>,
4209 {
4210 self.0.request.update_mask = std::option::Option::Some(v.into());
4211 self
4212 }
4213
4214 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4216 where
4217 T: std::convert::Into<wkt::FieldMask>,
4218 {
4219 self.0.request.update_mask = v.map(|x| x.into());
4220 self
4221 }
4222 }
4223
4224 #[doc(hidden)]
4225 impl crate::RequestBuilder for UpdateAuthorizedCertificate {
4226 fn request_options(&mut self) -> &mut crate::RequestOptions {
4227 &mut self.0.options
4228 }
4229 }
4230
4231 #[derive(Clone, Debug)]
4248 pub struct DeleteAuthorizedCertificate(
4249 RequestBuilder<crate::model::DeleteAuthorizedCertificateRequest>,
4250 );
4251
4252 impl DeleteAuthorizedCertificate {
4253 pub(crate) fn new(
4254 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4255 ) -> Self {
4256 Self(RequestBuilder::new(stub))
4257 }
4258
4259 pub fn with_request<V: Into<crate::model::DeleteAuthorizedCertificateRequest>>(
4261 mut self,
4262 v: V,
4263 ) -> Self {
4264 self.0.request = v.into();
4265 self
4266 }
4267
4268 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4270 self.0.options = v.into();
4271 self
4272 }
4273
4274 pub async fn send(self) -> Result<()> {
4276 (*self.0.stub)
4277 .delete_authorized_certificate(self.0.request, self.0.options)
4278 .await
4279 .map(crate::Response::into_body)
4280 }
4281
4282 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4284 self.0.request.name = v.into();
4285 self
4286 }
4287 }
4288
4289 #[doc(hidden)]
4290 impl crate::RequestBuilder for DeleteAuthorizedCertificate {
4291 fn request_options(&mut self) -> &mut crate::RequestOptions {
4292 &mut self.0.options
4293 }
4294 }
4295
4296 #[derive(Clone, Debug)]
4317 pub struct ListOperations(
4318 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4319 );
4320
4321 impl ListOperations {
4322 pub(crate) fn new(
4323 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4324 ) -> Self {
4325 Self(RequestBuilder::new(stub))
4326 }
4327
4328 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4330 mut self,
4331 v: V,
4332 ) -> Self {
4333 self.0.request = v.into();
4334 self
4335 }
4336
4337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4339 self.0.options = v.into();
4340 self
4341 }
4342
4343 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4345 (*self.0.stub)
4346 .list_operations(self.0.request, self.0.options)
4347 .await
4348 .map(crate::Response::into_body)
4349 }
4350
4351 pub fn by_page(
4353 self,
4354 ) -> impl google_cloud_gax::paginator::Paginator<
4355 google_cloud_longrunning::model::ListOperationsResponse,
4356 crate::Error,
4357 > {
4358 use std::clone::Clone;
4359 let token = self.0.request.page_token.clone();
4360 let execute = move |token: String| {
4361 let mut builder = self.clone();
4362 builder.0.request = builder.0.request.set_page_token(token);
4363 builder.send()
4364 };
4365 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4366 }
4367
4368 pub fn by_item(
4370 self,
4371 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4372 google_cloud_longrunning::model::ListOperationsResponse,
4373 crate::Error,
4374 > {
4375 use google_cloud_gax::paginator::Paginator;
4376 self.by_page().items()
4377 }
4378
4379 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4381 self.0.request.name = v.into();
4382 self
4383 }
4384
4385 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4387 self.0.request.filter = v.into();
4388 self
4389 }
4390
4391 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4393 self.0.request.page_size = v.into();
4394 self
4395 }
4396
4397 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4399 self.0.request.page_token = v.into();
4400 self
4401 }
4402
4403 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4405 self.0.request.return_partial_success = v.into();
4406 self
4407 }
4408 }
4409
4410 #[doc(hidden)]
4411 impl crate::RequestBuilder for ListOperations {
4412 fn request_options(&mut self) -> &mut crate::RequestOptions {
4413 &mut self.0.options
4414 }
4415 }
4416
4417 #[derive(Clone, Debug)]
4434 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4435
4436 impl GetOperation {
4437 pub(crate) fn new(
4438 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4439 ) -> Self {
4440 Self(RequestBuilder::new(stub))
4441 }
4442
4443 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4445 mut self,
4446 v: V,
4447 ) -> Self {
4448 self.0.request = v.into();
4449 self
4450 }
4451
4452 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4454 self.0.options = v.into();
4455 self
4456 }
4457
4458 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4460 (*self.0.stub)
4461 .get_operation(self.0.request, self.0.options)
4462 .await
4463 .map(crate::Response::into_body)
4464 }
4465
4466 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4468 self.0.request.name = v.into();
4469 self
4470 }
4471 }
4472
4473 #[doc(hidden)]
4474 impl crate::RequestBuilder for GetOperation {
4475 fn request_options(&mut self) -> &mut crate::RequestOptions {
4476 &mut self.0.options
4477 }
4478 }
4479}
4480
4481pub mod domain_mappings {
4483 use crate::Result;
4484
4485 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4499
4500 pub(crate) mod client {
4501 use super::super::super::client::DomainMappings;
4502 pub struct Factory;
4503 impl crate::ClientFactory for Factory {
4504 type Client = DomainMappings;
4505 type Credentials = gaxi::options::Credentials;
4506 async fn build(
4507 self,
4508 config: gaxi::options::ClientConfig,
4509 ) -> crate::ClientBuilderResult<Self::Client> {
4510 Self::Client::new(config).await
4511 }
4512 }
4513 }
4514
4515 #[derive(Clone, Debug)]
4517 pub(crate) struct RequestBuilder<R: std::default::Default> {
4518 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4519 request: R,
4520 options: crate::RequestOptions,
4521 }
4522
4523 impl<R> RequestBuilder<R>
4524 where
4525 R: std::default::Default,
4526 {
4527 pub(crate) fn new(
4528 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4529 ) -> Self {
4530 Self {
4531 stub,
4532 request: R::default(),
4533 options: crate::RequestOptions::default(),
4534 }
4535 }
4536 }
4537
4538 #[derive(Clone, Debug)]
4559 pub struct ListDomainMappings(RequestBuilder<crate::model::ListDomainMappingsRequest>);
4560
4561 impl ListDomainMappings {
4562 pub(crate) fn new(
4563 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4564 ) -> Self {
4565 Self(RequestBuilder::new(stub))
4566 }
4567
4568 pub fn with_request<V: Into<crate::model::ListDomainMappingsRequest>>(
4570 mut self,
4571 v: V,
4572 ) -> Self {
4573 self.0.request = v.into();
4574 self
4575 }
4576
4577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4579 self.0.options = v.into();
4580 self
4581 }
4582
4583 pub async fn send(self) -> Result<crate::model::ListDomainMappingsResponse> {
4585 (*self.0.stub)
4586 .list_domain_mappings(self.0.request, self.0.options)
4587 .await
4588 .map(crate::Response::into_body)
4589 }
4590
4591 pub fn by_page(
4593 self,
4594 ) -> impl google_cloud_gax::paginator::Paginator<
4595 crate::model::ListDomainMappingsResponse,
4596 crate::Error,
4597 > {
4598 use std::clone::Clone;
4599 let token = self.0.request.page_token.clone();
4600 let execute = move |token: String| {
4601 let mut builder = self.clone();
4602 builder.0.request = builder.0.request.set_page_token(token);
4603 builder.send()
4604 };
4605 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4606 }
4607
4608 pub fn by_item(
4610 self,
4611 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4612 crate::model::ListDomainMappingsResponse,
4613 crate::Error,
4614 > {
4615 use google_cloud_gax::paginator::Paginator;
4616 self.by_page().items()
4617 }
4618
4619 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4621 self.0.request.parent = v.into();
4622 self
4623 }
4624
4625 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4627 self.0.request.page_size = v.into();
4628 self
4629 }
4630
4631 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4633 self.0.request.page_token = v.into();
4634 self
4635 }
4636 }
4637
4638 #[doc(hidden)]
4639 impl crate::RequestBuilder for ListDomainMappings {
4640 fn request_options(&mut self) -> &mut crate::RequestOptions {
4641 &mut self.0.options
4642 }
4643 }
4644
4645 #[derive(Clone, Debug)]
4662 pub struct GetDomainMapping(RequestBuilder<crate::model::GetDomainMappingRequest>);
4663
4664 impl GetDomainMapping {
4665 pub(crate) fn new(
4666 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4667 ) -> Self {
4668 Self(RequestBuilder::new(stub))
4669 }
4670
4671 pub fn with_request<V: Into<crate::model::GetDomainMappingRequest>>(
4673 mut self,
4674 v: V,
4675 ) -> Self {
4676 self.0.request = v.into();
4677 self
4678 }
4679
4680 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4682 self.0.options = v.into();
4683 self
4684 }
4685
4686 pub async fn send(self) -> Result<crate::model::DomainMapping> {
4688 (*self.0.stub)
4689 .get_domain_mapping(self.0.request, self.0.options)
4690 .await
4691 .map(crate::Response::into_body)
4692 }
4693
4694 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4696 self.0.request.name = v.into();
4697 self
4698 }
4699 }
4700
4701 #[doc(hidden)]
4702 impl crate::RequestBuilder for GetDomainMapping {
4703 fn request_options(&mut self) -> &mut crate::RequestOptions {
4704 &mut self.0.options
4705 }
4706 }
4707
4708 #[derive(Clone, Debug)]
4726 pub struct CreateDomainMapping(RequestBuilder<crate::model::CreateDomainMappingRequest>);
4727
4728 impl CreateDomainMapping {
4729 pub(crate) fn new(
4730 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4731 ) -> Self {
4732 Self(RequestBuilder::new(stub))
4733 }
4734
4735 pub fn with_request<V: Into<crate::model::CreateDomainMappingRequest>>(
4737 mut self,
4738 v: V,
4739 ) -> Self {
4740 self.0.request = v.into();
4741 self
4742 }
4743
4744 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4746 self.0.options = v.into();
4747 self
4748 }
4749
4750 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4757 (*self.0.stub)
4758 .create_domain_mapping(self.0.request, self.0.options)
4759 .await
4760 .map(crate::Response::into_body)
4761 }
4762
4763 pub fn poller(
4765 self,
4766 ) -> impl google_cloud_lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4767 {
4768 type Operation = google_cloud_lro::internal::Operation<
4769 crate::model::DomainMapping,
4770 crate::model::OperationMetadataV1,
4771 >;
4772 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4773 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4774
4775 let stub = self.0.stub.clone();
4776 let mut options = self.0.options.clone();
4777 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4778 let query = move |name| {
4779 let stub = stub.clone();
4780 let options = options.clone();
4781 async {
4782 let op = GetOperation::new(stub)
4783 .set_name(name)
4784 .with_options(options)
4785 .send()
4786 .await?;
4787 Ok(Operation::new(op))
4788 }
4789 };
4790
4791 let start = move || async {
4792 let op = self.send().await?;
4793 Ok(Operation::new(op))
4794 };
4795
4796 google_cloud_lro::internal::new_poller(
4797 polling_error_policy,
4798 polling_backoff_policy,
4799 start,
4800 query,
4801 )
4802 }
4803
4804 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4806 self.0.request.parent = v.into();
4807 self
4808 }
4809
4810 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4812 where
4813 T: std::convert::Into<crate::model::DomainMapping>,
4814 {
4815 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4816 self
4817 }
4818
4819 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4821 where
4822 T: std::convert::Into<crate::model::DomainMapping>,
4823 {
4824 self.0.request.domain_mapping = v.map(|x| x.into());
4825 self
4826 }
4827
4828 pub fn set_override_strategy<T: Into<crate::model::DomainOverrideStrategy>>(
4830 mut self,
4831 v: T,
4832 ) -> Self {
4833 self.0.request.override_strategy = v.into();
4834 self
4835 }
4836 }
4837
4838 #[doc(hidden)]
4839 impl crate::RequestBuilder for CreateDomainMapping {
4840 fn request_options(&mut self) -> &mut crate::RequestOptions {
4841 &mut self.0.options
4842 }
4843 }
4844
4845 #[derive(Clone, Debug)]
4863 pub struct UpdateDomainMapping(RequestBuilder<crate::model::UpdateDomainMappingRequest>);
4864
4865 impl UpdateDomainMapping {
4866 pub(crate) fn new(
4867 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4868 ) -> Self {
4869 Self(RequestBuilder::new(stub))
4870 }
4871
4872 pub fn with_request<V: Into<crate::model::UpdateDomainMappingRequest>>(
4874 mut self,
4875 v: V,
4876 ) -> Self {
4877 self.0.request = v.into();
4878 self
4879 }
4880
4881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4883 self.0.options = v.into();
4884 self
4885 }
4886
4887 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4894 (*self.0.stub)
4895 .update_domain_mapping(self.0.request, self.0.options)
4896 .await
4897 .map(crate::Response::into_body)
4898 }
4899
4900 pub fn poller(
4902 self,
4903 ) -> impl google_cloud_lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4904 {
4905 type Operation = google_cloud_lro::internal::Operation<
4906 crate::model::DomainMapping,
4907 crate::model::OperationMetadataV1,
4908 >;
4909 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4910 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4911
4912 let stub = self.0.stub.clone();
4913 let mut options = self.0.options.clone();
4914 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4915 let query = move |name| {
4916 let stub = stub.clone();
4917 let options = options.clone();
4918 async {
4919 let op = GetOperation::new(stub)
4920 .set_name(name)
4921 .with_options(options)
4922 .send()
4923 .await?;
4924 Ok(Operation::new(op))
4925 }
4926 };
4927
4928 let start = move || async {
4929 let op = self.send().await?;
4930 Ok(Operation::new(op))
4931 };
4932
4933 google_cloud_lro::internal::new_poller(
4934 polling_error_policy,
4935 polling_backoff_policy,
4936 start,
4937 query,
4938 )
4939 }
4940
4941 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4943 self.0.request.name = v.into();
4944 self
4945 }
4946
4947 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4949 where
4950 T: std::convert::Into<crate::model::DomainMapping>,
4951 {
4952 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4953 self
4954 }
4955
4956 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4958 where
4959 T: std::convert::Into<crate::model::DomainMapping>,
4960 {
4961 self.0.request.domain_mapping = v.map(|x| x.into());
4962 self
4963 }
4964
4965 pub fn set_update_mask<T>(mut self, v: T) -> Self
4967 where
4968 T: std::convert::Into<wkt::FieldMask>,
4969 {
4970 self.0.request.update_mask = std::option::Option::Some(v.into());
4971 self
4972 }
4973
4974 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4976 where
4977 T: std::convert::Into<wkt::FieldMask>,
4978 {
4979 self.0.request.update_mask = v.map(|x| x.into());
4980 self
4981 }
4982 }
4983
4984 #[doc(hidden)]
4985 impl crate::RequestBuilder for UpdateDomainMapping {
4986 fn request_options(&mut self) -> &mut crate::RequestOptions {
4987 &mut self.0.options
4988 }
4989 }
4990
4991 #[derive(Clone, Debug)]
5009 pub struct DeleteDomainMapping(RequestBuilder<crate::model::DeleteDomainMappingRequest>);
5010
5011 impl DeleteDomainMapping {
5012 pub(crate) fn new(
5013 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5014 ) -> Self {
5015 Self(RequestBuilder::new(stub))
5016 }
5017
5018 pub fn with_request<V: Into<crate::model::DeleteDomainMappingRequest>>(
5020 mut self,
5021 v: V,
5022 ) -> Self {
5023 self.0.request = v.into();
5024 self
5025 }
5026
5027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5029 self.0.options = v.into();
5030 self
5031 }
5032
5033 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5040 (*self.0.stub)
5041 .delete_domain_mapping(self.0.request, self.0.options)
5042 .await
5043 .map(crate::Response::into_body)
5044 }
5045
5046 pub fn poller(
5048 self,
5049 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
5050 type Operation = google_cloud_lro::internal::Operation<
5051 wkt::Empty,
5052 crate::model::OperationMetadataV1,
5053 >;
5054 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5055 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5056
5057 let stub = self.0.stub.clone();
5058 let mut options = self.0.options.clone();
5059 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5060 let query = move |name| {
5061 let stub = stub.clone();
5062 let options = options.clone();
5063 async {
5064 let op = GetOperation::new(stub)
5065 .set_name(name)
5066 .with_options(options)
5067 .send()
5068 .await?;
5069 Ok(Operation::new(op))
5070 }
5071 };
5072
5073 let start = move || async {
5074 let op = self.send().await?;
5075 Ok(Operation::new(op))
5076 };
5077
5078 google_cloud_lro::internal::new_unit_response_poller(
5079 polling_error_policy,
5080 polling_backoff_policy,
5081 start,
5082 query,
5083 )
5084 }
5085
5086 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5088 self.0.request.name = v.into();
5089 self
5090 }
5091 }
5092
5093 #[doc(hidden)]
5094 impl crate::RequestBuilder for DeleteDomainMapping {
5095 fn request_options(&mut self) -> &mut crate::RequestOptions {
5096 &mut self.0.options
5097 }
5098 }
5099
5100 #[derive(Clone, Debug)]
5121 pub struct ListOperations(
5122 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5123 );
5124
5125 impl ListOperations {
5126 pub(crate) fn new(
5127 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5128 ) -> Self {
5129 Self(RequestBuilder::new(stub))
5130 }
5131
5132 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5134 mut self,
5135 v: V,
5136 ) -> Self {
5137 self.0.request = v.into();
5138 self
5139 }
5140
5141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5143 self.0.options = v.into();
5144 self
5145 }
5146
5147 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5149 (*self.0.stub)
5150 .list_operations(self.0.request, self.0.options)
5151 .await
5152 .map(crate::Response::into_body)
5153 }
5154
5155 pub fn by_page(
5157 self,
5158 ) -> impl google_cloud_gax::paginator::Paginator<
5159 google_cloud_longrunning::model::ListOperationsResponse,
5160 crate::Error,
5161 > {
5162 use std::clone::Clone;
5163 let token = self.0.request.page_token.clone();
5164 let execute = move |token: String| {
5165 let mut builder = self.clone();
5166 builder.0.request = builder.0.request.set_page_token(token);
5167 builder.send()
5168 };
5169 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5170 }
5171
5172 pub fn by_item(
5174 self,
5175 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5176 google_cloud_longrunning::model::ListOperationsResponse,
5177 crate::Error,
5178 > {
5179 use google_cloud_gax::paginator::Paginator;
5180 self.by_page().items()
5181 }
5182
5183 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5185 self.0.request.name = v.into();
5186 self
5187 }
5188
5189 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5191 self.0.request.filter = v.into();
5192 self
5193 }
5194
5195 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5197 self.0.request.page_size = v.into();
5198 self
5199 }
5200
5201 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5203 self.0.request.page_token = v.into();
5204 self
5205 }
5206
5207 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5209 self.0.request.return_partial_success = v.into();
5210 self
5211 }
5212 }
5213
5214 #[doc(hidden)]
5215 impl crate::RequestBuilder for ListOperations {
5216 fn request_options(&mut self) -> &mut crate::RequestOptions {
5217 &mut self.0.options
5218 }
5219 }
5220
5221 #[derive(Clone, Debug)]
5238 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5239
5240 impl GetOperation {
5241 pub(crate) fn new(
5242 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5243 ) -> Self {
5244 Self(RequestBuilder::new(stub))
5245 }
5246
5247 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5249 mut self,
5250 v: V,
5251 ) -> Self {
5252 self.0.request = v.into();
5253 self
5254 }
5255
5256 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5258 self.0.options = v.into();
5259 self
5260 }
5261
5262 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5264 (*self.0.stub)
5265 .get_operation(self.0.request, self.0.options)
5266 .await
5267 .map(crate::Response::into_body)
5268 }
5269
5270 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5272 self.0.request.name = v.into();
5273 self
5274 }
5275 }
5276
5277 #[doc(hidden)]
5278 impl crate::RequestBuilder for GetOperation {
5279 fn request_options(&mut self) -> &mut crate::RequestOptions {
5280 &mut self.0.options
5281 }
5282 }
5283}