1pub mod applications {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::Applications;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = Applications;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
90 pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
91
92 impl GetApplication {
93 pub(crate) fn new(
94 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
95 ) -> Self {
96 Self(RequestBuilder::new(stub))
97 }
98
99 pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
101 self.0.request = v.into();
102 self
103 }
104
105 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
107 self.0.options = v.into();
108 self
109 }
110
111 pub async fn send(self) -> Result<crate::model::Application> {
113 (*self.0.stub)
114 .get_application(self.0.request, self.0.options)
115 .await
116 .map(crate::Response::into_body)
117 }
118
119 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
121 self.0.request.name = v.into();
122 self
123 }
124 }
125
126 #[doc(hidden)]
127 impl crate::RequestBuilder for GetApplication {
128 fn request_options(&mut self) -> &mut crate::RequestOptions {
129 &mut self.0.options
130 }
131 }
132
133 #[derive(Clone, Debug)]
151 pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
152
153 impl CreateApplication {
154 pub(crate) fn new(
155 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
156 ) -> Self {
157 Self(RequestBuilder::new(stub))
158 }
159
160 pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
162 mut self,
163 v: V,
164 ) -> Self {
165 self.0.request = v.into();
166 self
167 }
168
169 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
171 self.0.options = v.into();
172 self
173 }
174
175 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
182 (*self.0.stub)
183 .create_application(self.0.request, self.0.options)
184 .await
185 .map(crate::Response::into_body)
186 }
187
188 pub fn poller(
190 self,
191 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
192 {
193 type Operation = google_cloud_lro::internal::Operation<
194 crate::model::Application,
195 crate::model::OperationMetadataV1,
196 >;
197 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
198 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
199
200 let stub = self.0.stub.clone();
201 let mut options = self.0.options.clone();
202 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
203 let query = move |name| {
204 let stub = stub.clone();
205 let options = options.clone();
206 async {
207 let op = GetOperation::new(stub)
208 .set_name(name)
209 .with_options(options)
210 .send()
211 .await?;
212 Ok(Operation::new(op))
213 }
214 };
215
216 let start = move || async {
217 let op = self.send().await?;
218 Ok(Operation::new(op))
219 };
220
221 google_cloud_lro::internal::new_poller(
222 polling_error_policy,
223 polling_backoff_policy,
224 start,
225 query,
226 )
227 }
228
229 pub fn set_application<T>(mut self, v: T) -> Self
231 where
232 T: std::convert::Into<crate::model::Application>,
233 {
234 self.0.request.application = std::option::Option::Some(v.into());
235 self
236 }
237
238 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
240 where
241 T: std::convert::Into<crate::model::Application>,
242 {
243 self.0.request.application = v.map(|x| x.into());
244 self
245 }
246 }
247
248 #[doc(hidden)]
249 impl crate::RequestBuilder for CreateApplication {
250 fn request_options(&mut self) -> &mut crate::RequestOptions {
251 &mut self.0.options
252 }
253 }
254
255 #[derive(Clone, Debug)]
273 pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
274
275 impl UpdateApplication {
276 pub(crate) fn new(
277 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
278 ) -> Self {
279 Self(RequestBuilder::new(stub))
280 }
281
282 pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
284 mut self,
285 v: V,
286 ) -> Self {
287 self.0.request = v.into();
288 self
289 }
290
291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
293 self.0.options = v.into();
294 self
295 }
296
297 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
304 (*self.0.stub)
305 .update_application(self.0.request, self.0.options)
306 .await
307 .map(crate::Response::into_body)
308 }
309
310 pub fn poller(
312 self,
313 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
314 {
315 type Operation = google_cloud_lro::internal::Operation<
316 crate::model::Application,
317 crate::model::OperationMetadataV1,
318 >;
319 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
320 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
321
322 let stub = self.0.stub.clone();
323 let mut options = self.0.options.clone();
324 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
325 let query = move |name| {
326 let stub = stub.clone();
327 let options = options.clone();
328 async {
329 let op = GetOperation::new(stub)
330 .set_name(name)
331 .with_options(options)
332 .send()
333 .await?;
334 Ok(Operation::new(op))
335 }
336 };
337
338 let start = move || async {
339 let op = self.send().await?;
340 Ok(Operation::new(op))
341 };
342
343 google_cloud_lro::internal::new_poller(
344 polling_error_policy,
345 polling_backoff_policy,
346 start,
347 query,
348 )
349 }
350
351 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
353 self.0.request.name = v.into();
354 self
355 }
356
357 pub fn set_application<T>(mut self, v: T) -> Self
359 where
360 T: std::convert::Into<crate::model::Application>,
361 {
362 self.0.request.application = std::option::Option::Some(v.into());
363 self
364 }
365
366 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
368 where
369 T: std::convert::Into<crate::model::Application>,
370 {
371 self.0.request.application = v.map(|x| x.into());
372 self
373 }
374
375 pub fn set_update_mask<T>(mut self, v: T) -> Self
377 where
378 T: std::convert::Into<wkt::FieldMask>,
379 {
380 self.0.request.update_mask = std::option::Option::Some(v.into());
381 self
382 }
383
384 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
386 where
387 T: std::convert::Into<wkt::FieldMask>,
388 {
389 self.0.request.update_mask = v.map(|x| x.into());
390 self
391 }
392 }
393
394 #[doc(hidden)]
395 impl crate::RequestBuilder for UpdateApplication {
396 fn request_options(&mut self) -> &mut crate::RequestOptions {
397 &mut self.0.options
398 }
399 }
400
401 #[derive(Clone, Debug)]
419 pub struct RepairApplication(RequestBuilder<crate::model::RepairApplicationRequest>);
420
421 impl RepairApplication {
422 pub(crate) fn new(
423 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
424 ) -> Self {
425 Self(RequestBuilder::new(stub))
426 }
427
428 pub fn with_request<V: Into<crate::model::RepairApplicationRequest>>(
430 mut self,
431 v: V,
432 ) -> Self {
433 self.0.request = v.into();
434 self
435 }
436
437 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
439 self.0.options = v.into();
440 self
441 }
442
443 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
450 (*self.0.stub)
451 .repair_application(self.0.request, self.0.options)
452 .await
453 .map(crate::Response::into_body)
454 }
455
456 pub fn poller(
458 self,
459 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
460 {
461 type Operation = google_cloud_lro::internal::Operation<
462 crate::model::Application,
463 crate::model::OperationMetadataV1,
464 >;
465 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
466 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
467
468 let stub = self.0.stub.clone();
469 let mut options = self.0.options.clone();
470 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
471 let query = move |name| {
472 let stub = stub.clone();
473 let options = options.clone();
474 async {
475 let op = GetOperation::new(stub)
476 .set_name(name)
477 .with_options(options)
478 .send()
479 .await?;
480 Ok(Operation::new(op))
481 }
482 };
483
484 let start = move || async {
485 let op = self.send().await?;
486 Ok(Operation::new(op))
487 };
488
489 google_cloud_lro::internal::new_poller(
490 polling_error_policy,
491 polling_backoff_policy,
492 start,
493 query,
494 )
495 }
496
497 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
499 self.0.request.name = v.into();
500 self
501 }
502 }
503
504 #[doc(hidden)]
505 impl crate::RequestBuilder for RepairApplication {
506 fn request_options(&mut self) -> &mut crate::RequestOptions {
507 &mut self.0.options
508 }
509 }
510
511 #[derive(Clone, Debug)]
532 pub struct ListOperations(
533 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
534 );
535
536 impl ListOperations {
537 pub(crate) fn new(
538 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
539 ) -> Self {
540 Self(RequestBuilder::new(stub))
541 }
542
543 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
545 mut self,
546 v: V,
547 ) -> Self {
548 self.0.request = v.into();
549 self
550 }
551
552 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
554 self.0.options = v.into();
555 self
556 }
557
558 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
560 (*self.0.stub)
561 .list_operations(self.0.request, self.0.options)
562 .await
563 .map(crate::Response::into_body)
564 }
565
566 pub fn by_page(
568 self,
569 ) -> impl google_cloud_gax::paginator::Paginator<
570 google_cloud_longrunning::model::ListOperationsResponse,
571 crate::Error,
572 > {
573 use std::clone::Clone;
574 let token = self.0.request.page_token.clone();
575 let execute = move |token: String| {
576 let mut builder = self.clone();
577 builder.0.request = builder.0.request.set_page_token(token);
578 builder.send()
579 };
580 google_cloud_gax::paginator::internal::new_paginator(token, execute)
581 }
582
583 pub fn by_item(
585 self,
586 ) -> impl google_cloud_gax::paginator::ItemPaginator<
587 google_cloud_longrunning::model::ListOperationsResponse,
588 crate::Error,
589 > {
590 use google_cloud_gax::paginator::Paginator;
591 self.by_page().items()
592 }
593
594 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
596 self.0.request.name = v.into();
597 self
598 }
599
600 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
602 self.0.request.filter = v.into();
603 self
604 }
605
606 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
608 self.0.request.page_size = v.into();
609 self
610 }
611
612 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
614 self.0.request.page_token = v.into();
615 self
616 }
617
618 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
620 self.0.request.return_partial_success = v.into();
621 self
622 }
623 }
624
625 #[doc(hidden)]
626 impl crate::RequestBuilder for ListOperations {
627 fn request_options(&mut self) -> &mut crate::RequestOptions {
628 &mut self.0.options
629 }
630 }
631
632 #[derive(Clone, Debug)]
649 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
650
651 impl GetOperation {
652 pub(crate) fn new(
653 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
654 ) -> Self {
655 Self(RequestBuilder::new(stub))
656 }
657
658 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
660 mut self,
661 v: V,
662 ) -> Self {
663 self.0.request = v.into();
664 self
665 }
666
667 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
669 self.0.options = v.into();
670 self
671 }
672
673 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
675 (*self.0.stub)
676 .get_operation(self.0.request, self.0.options)
677 .await
678 .map(crate::Response::into_body)
679 }
680
681 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
683 self.0.request.name = v.into();
684 self
685 }
686 }
687
688 #[doc(hidden)]
689 impl crate::RequestBuilder for GetOperation {
690 fn request_options(&mut self) -> &mut crate::RequestOptions {
691 &mut self.0.options
692 }
693 }
694}
695
696pub mod services {
697 use crate::Result;
698
699 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
713
714 pub(crate) mod client {
715 use super::super::super::client::Services;
716 pub struct Factory;
717 impl crate::ClientFactory for Factory {
718 type Client = Services;
719 type Credentials = gaxi::options::Credentials;
720 async fn build(
721 self,
722 config: gaxi::options::ClientConfig,
723 ) -> crate::ClientBuilderResult<Self::Client> {
724 Self::Client::new(config).await
725 }
726 }
727 }
728
729 #[derive(Clone, Debug)]
731 pub(crate) struct RequestBuilder<R: std::default::Default> {
732 stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
733 request: R,
734 options: crate::RequestOptions,
735 }
736
737 impl<R> RequestBuilder<R>
738 where
739 R: std::default::Default,
740 {
741 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
742 Self {
743 stub,
744 request: R::default(),
745 options: crate::RequestOptions::default(),
746 }
747 }
748 }
749
750 #[derive(Clone, Debug)]
771 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
772
773 impl ListServices {
774 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
775 Self(RequestBuilder::new(stub))
776 }
777
778 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
780 self.0.request = v.into();
781 self
782 }
783
784 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
786 self.0.options = v.into();
787 self
788 }
789
790 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
792 (*self.0.stub)
793 .list_services(self.0.request, self.0.options)
794 .await
795 .map(crate::Response::into_body)
796 }
797
798 pub fn by_page(
800 self,
801 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListServicesResponse, crate::Error>
802 {
803 use std::clone::Clone;
804 let token = self.0.request.page_token.clone();
805 let execute = move |token: String| {
806 let mut builder = self.clone();
807 builder.0.request = builder.0.request.set_page_token(token);
808 builder.send()
809 };
810 google_cloud_gax::paginator::internal::new_paginator(token, execute)
811 }
812
813 pub fn by_item(
815 self,
816 ) -> impl google_cloud_gax::paginator::ItemPaginator<
817 crate::model::ListServicesResponse,
818 crate::Error,
819 > {
820 use google_cloud_gax::paginator::Paginator;
821 self.by_page().items()
822 }
823
824 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
826 self.0.request.parent = v.into();
827 self
828 }
829
830 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
832 self.0.request.page_size = v.into();
833 self
834 }
835
836 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
838 self.0.request.page_token = v.into();
839 self
840 }
841 }
842
843 #[doc(hidden)]
844 impl crate::RequestBuilder for ListServices {
845 fn request_options(&mut self) -> &mut crate::RequestOptions {
846 &mut self.0.options
847 }
848 }
849
850 #[derive(Clone, Debug)]
867 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
868
869 impl GetService {
870 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
871 Self(RequestBuilder::new(stub))
872 }
873
874 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
876 self.0.request = v.into();
877 self
878 }
879
880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
882 self.0.options = v.into();
883 self
884 }
885
886 pub async fn send(self) -> Result<crate::model::Service> {
888 (*self.0.stub)
889 .get_service(self.0.request, self.0.options)
890 .await
891 .map(crate::Response::into_body)
892 }
893
894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
896 self.0.request.name = v.into();
897 self
898 }
899 }
900
901 #[doc(hidden)]
902 impl crate::RequestBuilder for GetService {
903 fn request_options(&mut self) -> &mut crate::RequestOptions {
904 &mut self.0.options
905 }
906 }
907
908 #[derive(Clone, Debug)]
926 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
927
928 impl UpdateService {
929 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
930 Self(RequestBuilder::new(stub))
931 }
932
933 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
935 self.0.request = v.into();
936 self
937 }
938
939 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
941 self.0.options = v.into();
942 self
943 }
944
945 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
952 (*self.0.stub)
953 .update_service(self.0.request, self.0.options)
954 .await
955 .map(crate::Response::into_body)
956 }
957
958 pub fn poller(
960 self,
961 ) -> impl google_cloud_lro::Poller<crate::model::Service, crate::model::OperationMetadataV1>
962 {
963 type Operation = google_cloud_lro::internal::Operation<
964 crate::model::Service,
965 crate::model::OperationMetadataV1,
966 >;
967 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
968 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
969
970 let stub = self.0.stub.clone();
971 let mut options = self.0.options.clone();
972 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
973 let query = move |name| {
974 let stub = stub.clone();
975 let options = options.clone();
976 async {
977 let op = GetOperation::new(stub)
978 .set_name(name)
979 .with_options(options)
980 .send()
981 .await?;
982 Ok(Operation::new(op))
983 }
984 };
985
986 let start = move || async {
987 let op = self.send().await?;
988 Ok(Operation::new(op))
989 };
990
991 google_cloud_lro::internal::new_poller(
992 polling_error_policy,
993 polling_backoff_policy,
994 start,
995 query,
996 )
997 }
998
999 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1001 self.0.request.name = v.into();
1002 self
1003 }
1004
1005 pub fn set_service<T>(mut self, v: T) -> Self
1007 where
1008 T: std::convert::Into<crate::model::Service>,
1009 {
1010 self.0.request.service = std::option::Option::Some(v.into());
1011 self
1012 }
1013
1014 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
1016 where
1017 T: std::convert::Into<crate::model::Service>,
1018 {
1019 self.0.request.service = v.map(|x| x.into());
1020 self
1021 }
1022
1023 pub fn set_update_mask<T>(mut self, v: T) -> Self
1025 where
1026 T: std::convert::Into<wkt::FieldMask>,
1027 {
1028 self.0.request.update_mask = std::option::Option::Some(v.into());
1029 self
1030 }
1031
1032 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1034 where
1035 T: std::convert::Into<wkt::FieldMask>,
1036 {
1037 self.0.request.update_mask = v.map(|x| x.into());
1038 self
1039 }
1040
1041 pub fn set_migrate_traffic<T: Into<bool>>(mut self, v: T) -> Self {
1043 self.0.request.migrate_traffic = v.into();
1044 self
1045 }
1046 }
1047
1048 #[doc(hidden)]
1049 impl crate::RequestBuilder for UpdateService {
1050 fn request_options(&mut self) -> &mut crate::RequestOptions {
1051 &mut self.0.options
1052 }
1053 }
1054
1055 #[derive(Clone, Debug)]
1073 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1074
1075 impl DeleteService {
1076 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1077 Self(RequestBuilder::new(stub))
1078 }
1079
1080 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1082 self.0.request = v.into();
1083 self
1084 }
1085
1086 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1088 self.0.options = v.into();
1089 self
1090 }
1091
1092 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1099 (*self.0.stub)
1100 .delete_service(self.0.request, self.0.options)
1101 .await
1102 .map(crate::Response::into_body)
1103 }
1104
1105 pub fn poller(
1107 self,
1108 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
1109 type Operation = google_cloud_lro::internal::Operation<
1110 wkt::Empty,
1111 crate::model::OperationMetadataV1,
1112 >;
1113 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1114 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1115
1116 let stub = self.0.stub.clone();
1117 let mut options = self.0.options.clone();
1118 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1119 let query = move |name| {
1120 let stub = stub.clone();
1121 let options = options.clone();
1122 async {
1123 let op = GetOperation::new(stub)
1124 .set_name(name)
1125 .with_options(options)
1126 .send()
1127 .await?;
1128 Ok(Operation::new(op))
1129 }
1130 };
1131
1132 let start = move || async {
1133 let op = self.send().await?;
1134 Ok(Operation::new(op))
1135 };
1136
1137 google_cloud_lro::internal::new_unit_response_poller(
1138 polling_error_policy,
1139 polling_backoff_policy,
1140 start,
1141 query,
1142 )
1143 }
1144
1145 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1147 self.0.request.name = v.into();
1148 self
1149 }
1150 }
1151
1152 #[doc(hidden)]
1153 impl crate::RequestBuilder for DeleteService {
1154 fn request_options(&mut self) -> &mut crate::RequestOptions {
1155 &mut self.0.options
1156 }
1157 }
1158
1159 #[derive(Clone, Debug)]
1180 pub struct ListOperations(
1181 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1182 );
1183
1184 impl ListOperations {
1185 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1186 Self(RequestBuilder::new(stub))
1187 }
1188
1189 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1191 mut self,
1192 v: V,
1193 ) -> Self {
1194 self.0.request = v.into();
1195 self
1196 }
1197
1198 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1200 self.0.options = v.into();
1201 self
1202 }
1203
1204 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1206 (*self.0.stub)
1207 .list_operations(self.0.request, self.0.options)
1208 .await
1209 .map(crate::Response::into_body)
1210 }
1211
1212 pub fn by_page(
1214 self,
1215 ) -> impl google_cloud_gax::paginator::Paginator<
1216 google_cloud_longrunning::model::ListOperationsResponse,
1217 crate::Error,
1218 > {
1219 use std::clone::Clone;
1220 let token = self.0.request.page_token.clone();
1221 let execute = move |token: String| {
1222 let mut builder = self.clone();
1223 builder.0.request = builder.0.request.set_page_token(token);
1224 builder.send()
1225 };
1226 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1227 }
1228
1229 pub fn by_item(
1231 self,
1232 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1233 google_cloud_longrunning::model::ListOperationsResponse,
1234 crate::Error,
1235 > {
1236 use google_cloud_gax::paginator::Paginator;
1237 self.by_page().items()
1238 }
1239
1240 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1242 self.0.request.name = v.into();
1243 self
1244 }
1245
1246 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1248 self.0.request.filter = v.into();
1249 self
1250 }
1251
1252 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1254 self.0.request.page_size = v.into();
1255 self
1256 }
1257
1258 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1260 self.0.request.page_token = v.into();
1261 self
1262 }
1263
1264 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1266 self.0.request.return_partial_success = v.into();
1267 self
1268 }
1269 }
1270
1271 #[doc(hidden)]
1272 impl crate::RequestBuilder for ListOperations {
1273 fn request_options(&mut self) -> &mut crate::RequestOptions {
1274 &mut self.0.options
1275 }
1276 }
1277
1278 #[derive(Clone, Debug)]
1295 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1296
1297 impl GetOperation {
1298 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1299 Self(RequestBuilder::new(stub))
1300 }
1301
1302 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1304 mut self,
1305 v: V,
1306 ) -> Self {
1307 self.0.request = v.into();
1308 self
1309 }
1310
1311 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1313 self.0.options = v.into();
1314 self
1315 }
1316
1317 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1319 (*self.0.stub)
1320 .get_operation(self.0.request, self.0.options)
1321 .await
1322 .map(crate::Response::into_body)
1323 }
1324
1325 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327 self.0.request.name = v.into();
1328 self
1329 }
1330 }
1331
1332 #[doc(hidden)]
1333 impl crate::RequestBuilder for GetOperation {
1334 fn request_options(&mut self) -> &mut crate::RequestOptions {
1335 &mut self.0.options
1336 }
1337 }
1338}
1339
1340pub mod versions {
1341 use crate::Result;
1342
1343 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1357
1358 pub(crate) mod client {
1359 use super::super::super::client::Versions;
1360 pub struct Factory;
1361 impl crate::ClientFactory for Factory {
1362 type Client = Versions;
1363 type Credentials = gaxi::options::Credentials;
1364 async fn build(
1365 self,
1366 config: gaxi::options::ClientConfig,
1367 ) -> crate::ClientBuilderResult<Self::Client> {
1368 Self::Client::new(config).await
1369 }
1370 }
1371 }
1372
1373 #[derive(Clone, Debug)]
1375 pub(crate) struct RequestBuilder<R: std::default::Default> {
1376 stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
1377 request: R,
1378 options: crate::RequestOptions,
1379 }
1380
1381 impl<R> RequestBuilder<R>
1382 where
1383 R: std::default::Default,
1384 {
1385 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1386 Self {
1387 stub,
1388 request: R::default(),
1389 options: crate::RequestOptions::default(),
1390 }
1391 }
1392 }
1393
1394 #[derive(Clone, Debug)]
1415 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
1416
1417 impl ListVersions {
1418 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1419 Self(RequestBuilder::new(stub))
1420 }
1421
1422 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
1424 self.0.request = v.into();
1425 self
1426 }
1427
1428 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1430 self.0.options = v.into();
1431 self
1432 }
1433
1434 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
1436 (*self.0.stub)
1437 .list_versions(self.0.request, self.0.options)
1438 .await
1439 .map(crate::Response::into_body)
1440 }
1441
1442 pub fn by_page(
1444 self,
1445 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
1446 {
1447 use std::clone::Clone;
1448 let token = self.0.request.page_token.clone();
1449 let execute = move |token: String| {
1450 let mut builder = self.clone();
1451 builder.0.request = builder.0.request.set_page_token(token);
1452 builder.send()
1453 };
1454 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1455 }
1456
1457 pub fn by_item(
1459 self,
1460 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1461 crate::model::ListVersionsResponse,
1462 crate::Error,
1463 > {
1464 use google_cloud_gax::paginator::Paginator;
1465 self.by_page().items()
1466 }
1467
1468 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470 self.0.request.parent = v.into();
1471 self
1472 }
1473
1474 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1476 self.0.request.view = v.into();
1477 self
1478 }
1479
1480 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1482 self.0.request.page_size = v.into();
1483 self
1484 }
1485
1486 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488 self.0.request.page_token = v.into();
1489 self
1490 }
1491 }
1492
1493 #[doc(hidden)]
1494 impl crate::RequestBuilder for ListVersions {
1495 fn request_options(&mut self) -> &mut crate::RequestOptions {
1496 &mut self.0.options
1497 }
1498 }
1499
1500 #[derive(Clone, Debug)]
1517 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
1518
1519 impl GetVersion {
1520 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1521 Self(RequestBuilder::new(stub))
1522 }
1523
1524 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
1526 self.0.request = v.into();
1527 self
1528 }
1529
1530 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1532 self.0.options = v.into();
1533 self
1534 }
1535
1536 pub async fn send(self) -> Result<crate::model::Version> {
1538 (*self.0.stub)
1539 .get_version(self.0.request, self.0.options)
1540 .await
1541 .map(crate::Response::into_body)
1542 }
1543
1544 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.name = v.into();
1547 self
1548 }
1549
1550 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1552 self.0.request.view = v.into();
1553 self
1554 }
1555 }
1556
1557 #[doc(hidden)]
1558 impl crate::RequestBuilder for GetVersion {
1559 fn request_options(&mut self) -> &mut crate::RequestOptions {
1560 &mut self.0.options
1561 }
1562 }
1563
1564 #[derive(Clone, Debug)]
1582 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
1583
1584 impl CreateVersion {
1585 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1586 Self(RequestBuilder::new(stub))
1587 }
1588
1589 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
1591 self.0.request = v.into();
1592 self
1593 }
1594
1595 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1597 self.0.options = v.into();
1598 self
1599 }
1600
1601 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1608 (*self.0.stub)
1609 .create_version(self.0.request, self.0.options)
1610 .await
1611 .map(crate::Response::into_body)
1612 }
1613
1614 pub fn poller(
1616 self,
1617 ) -> impl google_cloud_lro::Poller<crate::model::Version, crate::model::CreateVersionMetadataV1>
1618 {
1619 type Operation = google_cloud_lro::internal::Operation<
1620 crate::model::Version,
1621 crate::model::CreateVersionMetadataV1,
1622 >;
1623 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1624 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1625
1626 let stub = self.0.stub.clone();
1627 let mut options = self.0.options.clone();
1628 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1629 let query = move |name| {
1630 let stub = stub.clone();
1631 let options = options.clone();
1632 async {
1633 let op = GetOperation::new(stub)
1634 .set_name(name)
1635 .with_options(options)
1636 .send()
1637 .await?;
1638 Ok(Operation::new(op))
1639 }
1640 };
1641
1642 let start = move || async {
1643 let op = self.send().await?;
1644 Ok(Operation::new(op))
1645 };
1646
1647 google_cloud_lro::internal::new_poller(
1648 polling_error_policy,
1649 polling_backoff_policy,
1650 start,
1651 query,
1652 )
1653 }
1654
1655 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.0.request.parent = v.into();
1658 self
1659 }
1660
1661 pub fn set_version<T>(mut self, v: T) -> Self
1663 where
1664 T: std::convert::Into<crate::model::Version>,
1665 {
1666 self.0.request.version = std::option::Option::Some(v.into());
1667 self
1668 }
1669
1670 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1672 where
1673 T: std::convert::Into<crate::model::Version>,
1674 {
1675 self.0.request.version = v.map(|x| x.into());
1676 self
1677 }
1678 }
1679
1680 #[doc(hidden)]
1681 impl crate::RequestBuilder for CreateVersion {
1682 fn request_options(&mut self) -> &mut crate::RequestOptions {
1683 &mut self.0.options
1684 }
1685 }
1686
1687 #[derive(Clone, Debug)]
1705 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
1706
1707 impl UpdateVersion {
1708 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1709 Self(RequestBuilder::new(stub))
1710 }
1711
1712 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
1714 self.0.request = v.into();
1715 self
1716 }
1717
1718 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1720 self.0.options = v.into();
1721 self
1722 }
1723
1724 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1731 (*self.0.stub)
1732 .update_version(self.0.request, self.0.options)
1733 .await
1734 .map(crate::Response::into_body)
1735 }
1736
1737 pub fn poller(
1739 self,
1740 ) -> impl google_cloud_lro::Poller<crate::model::Version, crate::model::OperationMetadataV1>
1741 {
1742 type Operation = google_cloud_lro::internal::Operation<
1743 crate::model::Version,
1744 crate::model::OperationMetadataV1,
1745 >;
1746 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1747 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1748
1749 let stub = self.0.stub.clone();
1750 let mut options = self.0.options.clone();
1751 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1752 let query = move |name| {
1753 let stub = stub.clone();
1754 let options = options.clone();
1755 async {
1756 let op = GetOperation::new(stub)
1757 .set_name(name)
1758 .with_options(options)
1759 .send()
1760 .await?;
1761 Ok(Operation::new(op))
1762 }
1763 };
1764
1765 let start = move || async {
1766 let op = self.send().await?;
1767 Ok(Operation::new(op))
1768 };
1769
1770 google_cloud_lro::internal::new_poller(
1771 polling_error_policy,
1772 polling_backoff_policy,
1773 start,
1774 query,
1775 )
1776 }
1777
1778 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1780 self.0.request.name = v.into();
1781 self
1782 }
1783
1784 pub fn set_version<T>(mut self, v: T) -> Self
1786 where
1787 T: std::convert::Into<crate::model::Version>,
1788 {
1789 self.0.request.version = std::option::Option::Some(v.into());
1790 self
1791 }
1792
1793 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1795 where
1796 T: std::convert::Into<crate::model::Version>,
1797 {
1798 self.0.request.version = v.map(|x| x.into());
1799 self
1800 }
1801
1802 pub fn set_update_mask<T>(mut self, v: T) -> Self
1804 where
1805 T: std::convert::Into<wkt::FieldMask>,
1806 {
1807 self.0.request.update_mask = std::option::Option::Some(v.into());
1808 self
1809 }
1810
1811 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1813 where
1814 T: std::convert::Into<wkt::FieldMask>,
1815 {
1816 self.0.request.update_mask = v.map(|x| x.into());
1817 self
1818 }
1819 }
1820
1821 #[doc(hidden)]
1822 impl crate::RequestBuilder for UpdateVersion {
1823 fn request_options(&mut self) -> &mut crate::RequestOptions {
1824 &mut self.0.options
1825 }
1826 }
1827
1828 #[derive(Clone, Debug)]
1846 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
1847
1848 impl DeleteVersion {
1849 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1850 Self(RequestBuilder::new(stub))
1851 }
1852
1853 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
1855 self.0.request = v.into();
1856 self
1857 }
1858
1859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1861 self.0.options = v.into();
1862 self
1863 }
1864
1865 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1872 (*self.0.stub)
1873 .delete_version(self.0.request, self.0.options)
1874 .await
1875 .map(crate::Response::into_body)
1876 }
1877
1878 pub fn poller(
1880 self,
1881 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
1882 type Operation = google_cloud_lro::internal::Operation<
1883 wkt::Empty,
1884 crate::model::OperationMetadataV1,
1885 >;
1886 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1887 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1888
1889 let stub = self.0.stub.clone();
1890 let mut options = self.0.options.clone();
1891 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1892 let query = move |name| {
1893 let stub = stub.clone();
1894 let options = options.clone();
1895 async {
1896 let op = GetOperation::new(stub)
1897 .set_name(name)
1898 .with_options(options)
1899 .send()
1900 .await?;
1901 Ok(Operation::new(op))
1902 }
1903 };
1904
1905 let start = move || async {
1906 let op = self.send().await?;
1907 Ok(Operation::new(op))
1908 };
1909
1910 google_cloud_lro::internal::new_unit_response_poller(
1911 polling_error_policy,
1912 polling_backoff_policy,
1913 start,
1914 query,
1915 )
1916 }
1917
1918 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1920 self.0.request.name = v.into();
1921 self
1922 }
1923 }
1924
1925 #[doc(hidden)]
1926 impl crate::RequestBuilder for DeleteVersion {
1927 fn request_options(&mut self) -> &mut crate::RequestOptions {
1928 &mut self.0.options
1929 }
1930 }
1931
1932 #[derive(Clone, Debug)]
1953 pub struct ListOperations(
1954 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1955 );
1956
1957 impl ListOperations {
1958 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1959 Self(RequestBuilder::new(stub))
1960 }
1961
1962 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1964 mut self,
1965 v: V,
1966 ) -> Self {
1967 self.0.request = v.into();
1968 self
1969 }
1970
1971 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1973 self.0.options = v.into();
1974 self
1975 }
1976
1977 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1979 (*self.0.stub)
1980 .list_operations(self.0.request, self.0.options)
1981 .await
1982 .map(crate::Response::into_body)
1983 }
1984
1985 pub fn by_page(
1987 self,
1988 ) -> impl google_cloud_gax::paginator::Paginator<
1989 google_cloud_longrunning::model::ListOperationsResponse,
1990 crate::Error,
1991 > {
1992 use std::clone::Clone;
1993 let token = self.0.request.page_token.clone();
1994 let execute = move |token: String| {
1995 let mut builder = self.clone();
1996 builder.0.request = builder.0.request.set_page_token(token);
1997 builder.send()
1998 };
1999 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2000 }
2001
2002 pub fn by_item(
2004 self,
2005 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2006 google_cloud_longrunning::model::ListOperationsResponse,
2007 crate::Error,
2008 > {
2009 use google_cloud_gax::paginator::Paginator;
2010 self.by_page().items()
2011 }
2012
2013 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2015 self.0.request.name = v.into();
2016 self
2017 }
2018
2019 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2021 self.0.request.filter = v.into();
2022 self
2023 }
2024
2025 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2027 self.0.request.page_size = v.into();
2028 self
2029 }
2030
2031 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.0.request.page_token = v.into();
2034 self
2035 }
2036
2037 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2039 self.0.request.return_partial_success = v.into();
2040 self
2041 }
2042 }
2043
2044 #[doc(hidden)]
2045 impl crate::RequestBuilder for ListOperations {
2046 fn request_options(&mut self) -> &mut crate::RequestOptions {
2047 &mut self.0.options
2048 }
2049 }
2050
2051 #[derive(Clone, Debug)]
2068 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2069
2070 impl GetOperation {
2071 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2072 Self(RequestBuilder::new(stub))
2073 }
2074
2075 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2077 mut self,
2078 v: V,
2079 ) -> Self {
2080 self.0.request = v.into();
2081 self
2082 }
2083
2084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2086 self.0.options = v.into();
2087 self
2088 }
2089
2090 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2092 (*self.0.stub)
2093 .get_operation(self.0.request, self.0.options)
2094 .await
2095 .map(crate::Response::into_body)
2096 }
2097
2098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2100 self.0.request.name = v.into();
2101 self
2102 }
2103 }
2104
2105 #[doc(hidden)]
2106 impl crate::RequestBuilder for GetOperation {
2107 fn request_options(&mut self) -> &mut crate::RequestOptions {
2108 &mut self.0.options
2109 }
2110 }
2111}
2112
2113pub mod instances {
2114 use crate::Result;
2115
2116 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2130
2131 pub(crate) mod client {
2132 use super::super::super::client::Instances;
2133 pub struct Factory;
2134 impl crate::ClientFactory for Factory {
2135 type Client = Instances;
2136 type Credentials = gaxi::options::Credentials;
2137 async fn build(
2138 self,
2139 config: gaxi::options::ClientConfig,
2140 ) -> crate::ClientBuilderResult<Self::Client> {
2141 Self::Client::new(config).await
2142 }
2143 }
2144 }
2145
2146 #[derive(Clone, Debug)]
2148 pub(crate) struct RequestBuilder<R: std::default::Default> {
2149 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2150 request: R,
2151 options: crate::RequestOptions,
2152 }
2153
2154 impl<R> RequestBuilder<R>
2155 where
2156 R: std::default::Default,
2157 {
2158 pub(crate) fn new(
2159 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2160 ) -> Self {
2161 Self {
2162 stub,
2163 request: R::default(),
2164 options: crate::RequestOptions::default(),
2165 }
2166 }
2167 }
2168
2169 #[derive(Clone, Debug)]
2190 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
2191
2192 impl ListInstances {
2193 pub(crate) fn new(
2194 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2195 ) -> Self {
2196 Self(RequestBuilder::new(stub))
2197 }
2198
2199 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
2201 self.0.request = v.into();
2202 self
2203 }
2204
2205 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2207 self.0.options = v.into();
2208 self
2209 }
2210
2211 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
2213 (*self.0.stub)
2214 .list_instances(self.0.request, self.0.options)
2215 .await
2216 .map(crate::Response::into_body)
2217 }
2218
2219 pub fn by_page(
2221 self,
2222 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
2223 {
2224 use std::clone::Clone;
2225 let token = self.0.request.page_token.clone();
2226 let execute = move |token: String| {
2227 let mut builder = self.clone();
2228 builder.0.request = builder.0.request.set_page_token(token);
2229 builder.send()
2230 };
2231 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2232 }
2233
2234 pub fn by_item(
2236 self,
2237 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2238 crate::model::ListInstancesResponse,
2239 crate::Error,
2240 > {
2241 use google_cloud_gax::paginator::Paginator;
2242 self.by_page().items()
2243 }
2244
2245 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2247 self.0.request.parent = v.into();
2248 self
2249 }
2250
2251 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2253 self.0.request.page_size = v.into();
2254 self
2255 }
2256
2257 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2259 self.0.request.page_token = v.into();
2260 self
2261 }
2262 }
2263
2264 #[doc(hidden)]
2265 impl crate::RequestBuilder for ListInstances {
2266 fn request_options(&mut self) -> &mut crate::RequestOptions {
2267 &mut self.0.options
2268 }
2269 }
2270
2271 #[derive(Clone, Debug)]
2288 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2289
2290 impl GetInstance {
2291 pub(crate) fn new(
2292 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2293 ) -> Self {
2294 Self(RequestBuilder::new(stub))
2295 }
2296
2297 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2299 self.0.request = v.into();
2300 self
2301 }
2302
2303 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2305 self.0.options = v.into();
2306 self
2307 }
2308
2309 pub async fn send(self) -> Result<crate::model::Instance> {
2311 (*self.0.stub)
2312 .get_instance(self.0.request, self.0.options)
2313 .await
2314 .map(crate::Response::into_body)
2315 }
2316
2317 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2319 self.0.request.name = v.into();
2320 self
2321 }
2322 }
2323
2324 #[doc(hidden)]
2325 impl crate::RequestBuilder for GetInstance {
2326 fn request_options(&mut self) -> &mut crate::RequestOptions {
2327 &mut self.0.options
2328 }
2329 }
2330
2331 #[derive(Clone, Debug)]
2349 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
2350
2351 impl DeleteInstance {
2352 pub(crate) fn new(
2353 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2354 ) -> Self {
2355 Self(RequestBuilder::new(stub))
2356 }
2357
2358 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
2360 self.0.request = v.into();
2361 self
2362 }
2363
2364 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2366 self.0.options = v.into();
2367 self
2368 }
2369
2370 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2377 (*self.0.stub)
2378 .delete_instance(self.0.request, self.0.options)
2379 .await
2380 .map(crate::Response::into_body)
2381 }
2382
2383 pub fn poller(
2385 self,
2386 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
2387 type Operation = google_cloud_lro::internal::Operation<
2388 wkt::Empty,
2389 crate::model::OperationMetadataV1,
2390 >;
2391 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2392 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2393
2394 let stub = self.0.stub.clone();
2395 let mut options = self.0.options.clone();
2396 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2397 let query = move |name| {
2398 let stub = stub.clone();
2399 let options = options.clone();
2400 async {
2401 let op = GetOperation::new(stub)
2402 .set_name(name)
2403 .with_options(options)
2404 .send()
2405 .await?;
2406 Ok(Operation::new(op))
2407 }
2408 };
2409
2410 let start = move || async {
2411 let op = self.send().await?;
2412 Ok(Operation::new(op))
2413 };
2414
2415 google_cloud_lro::internal::new_unit_response_poller(
2416 polling_error_policy,
2417 polling_backoff_policy,
2418 start,
2419 query,
2420 )
2421 }
2422
2423 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2425 self.0.request.name = v.into();
2426 self
2427 }
2428 }
2429
2430 #[doc(hidden)]
2431 impl crate::RequestBuilder for DeleteInstance {
2432 fn request_options(&mut self) -> &mut crate::RequestOptions {
2433 &mut self.0.options
2434 }
2435 }
2436
2437 #[derive(Clone, Debug)]
2455 pub struct DebugInstance(RequestBuilder<crate::model::DebugInstanceRequest>);
2456
2457 impl DebugInstance {
2458 pub(crate) fn new(
2459 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2460 ) -> Self {
2461 Self(RequestBuilder::new(stub))
2462 }
2463
2464 pub fn with_request<V: Into<crate::model::DebugInstanceRequest>>(mut self, v: V) -> Self {
2466 self.0.request = v.into();
2467 self
2468 }
2469
2470 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2472 self.0.options = v.into();
2473 self
2474 }
2475
2476 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2483 (*self.0.stub)
2484 .debug_instance(self.0.request, self.0.options)
2485 .await
2486 .map(crate::Response::into_body)
2487 }
2488
2489 pub fn poller(
2491 self,
2492 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadataV1>
2493 {
2494 type Operation = google_cloud_lro::internal::Operation<
2495 crate::model::Instance,
2496 crate::model::OperationMetadataV1,
2497 >;
2498 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2499 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2500
2501 let stub = self.0.stub.clone();
2502 let mut options = self.0.options.clone();
2503 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2504 let query = move |name| {
2505 let stub = stub.clone();
2506 let options = options.clone();
2507 async {
2508 let op = GetOperation::new(stub)
2509 .set_name(name)
2510 .with_options(options)
2511 .send()
2512 .await?;
2513 Ok(Operation::new(op))
2514 }
2515 };
2516
2517 let start = move || async {
2518 let op = self.send().await?;
2519 Ok(Operation::new(op))
2520 };
2521
2522 google_cloud_lro::internal::new_poller(
2523 polling_error_policy,
2524 polling_backoff_policy,
2525 start,
2526 query,
2527 )
2528 }
2529
2530 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2532 self.0.request.name = v.into();
2533 self
2534 }
2535
2536 pub fn set_ssh_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
2538 self.0.request.ssh_key = v.into();
2539 self
2540 }
2541 }
2542
2543 #[doc(hidden)]
2544 impl crate::RequestBuilder for DebugInstance {
2545 fn request_options(&mut self) -> &mut crate::RequestOptions {
2546 &mut self.0.options
2547 }
2548 }
2549
2550 #[derive(Clone, Debug)]
2571 pub struct ListOperations(
2572 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2573 );
2574
2575 impl ListOperations {
2576 pub(crate) fn new(
2577 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2578 ) -> Self {
2579 Self(RequestBuilder::new(stub))
2580 }
2581
2582 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2584 mut self,
2585 v: V,
2586 ) -> Self {
2587 self.0.request = v.into();
2588 self
2589 }
2590
2591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2593 self.0.options = v.into();
2594 self
2595 }
2596
2597 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2599 (*self.0.stub)
2600 .list_operations(self.0.request, self.0.options)
2601 .await
2602 .map(crate::Response::into_body)
2603 }
2604
2605 pub fn by_page(
2607 self,
2608 ) -> impl google_cloud_gax::paginator::Paginator<
2609 google_cloud_longrunning::model::ListOperationsResponse,
2610 crate::Error,
2611 > {
2612 use std::clone::Clone;
2613 let token = self.0.request.page_token.clone();
2614 let execute = move |token: String| {
2615 let mut builder = self.clone();
2616 builder.0.request = builder.0.request.set_page_token(token);
2617 builder.send()
2618 };
2619 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2620 }
2621
2622 pub fn by_item(
2624 self,
2625 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2626 google_cloud_longrunning::model::ListOperationsResponse,
2627 crate::Error,
2628 > {
2629 use google_cloud_gax::paginator::Paginator;
2630 self.by_page().items()
2631 }
2632
2633 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2635 self.0.request.name = v.into();
2636 self
2637 }
2638
2639 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2641 self.0.request.filter = v.into();
2642 self
2643 }
2644
2645 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2647 self.0.request.page_size = v.into();
2648 self
2649 }
2650
2651 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2653 self.0.request.page_token = v.into();
2654 self
2655 }
2656
2657 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2659 self.0.request.return_partial_success = v.into();
2660 self
2661 }
2662 }
2663
2664 #[doc(hidden)]
2665 impl crate::RequestBuilder for ListOperations {
2666 fn request_options(&mut self) -> &mut crate::RequestOptions {
2667 &mut self.0.options
2668 }
2669 }
2670
2671 #[derive(Clone, Debug)]
2688 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2689
2690 impl GetOperation {
2691 pub(crate) fn new(
2692 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2693 ) -> Self {
2694 Self(RequestBuilder::new(stub))
2695 }
2696
2697 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2699 mut self,
2700 v: V,
2701 ) -> Self {
2702 self.0.request = v.into();
2703 self
2704 }
2705
2706 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2708 self.0.options = v.into();
2709 self
2710 }
2711
2712 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2714 (*self.0.stub)
2715 .get_operation(self.0.request, self.0.options)
2716 .await
2717 .map(crate::Response::into_body)
2718 }
2719
2720 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2722 self.0.request.name = v.into();
2723 self
2724 }
2725 }
2726
2727 #[doc(hidden)]
2728 impl crate::RequestBuilder for GetOperation {
2729 fn request_options(&mut self) -> &mut crate::RequestOptions {
2730 &mut self.0.options
2731 }
2732 }
2733}
2734
2735pub mod firewall {
2736 use crate::Result;
2737
2738 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2752
2753 pub(crate) mod client {
2754 use super::super::super::client::Firewall;
2755 pub struct Factory;
2756 impl crate::ClientFactory for Factory {
2757 type Client = Firewall;
2758 type Credentials = gaxi::options::Credentials;
2759 async fn build(
2760 self,
2761 config: gaxi::options::ClientConfig,
2762 ) -> crate::ClientBuilderResult<Self::Client> {
2763 Self::Client::new(config).await
2764 }
2765 }
2766 }
2767
2768 #[derive(Clone, Debug)]
2770 pub(crate) struct RequestBuilder<R: std::default::Default> {
2771 stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>,
2772 request: R,
2773 options: crate::RequestOptions,
2774 }
2775
2776 impl<R> RequestBuilder<R>
2777 where
2778 R: std::default::Default,
2779 {
2780 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2781 Self {
2782 stub,
2783 request: R::default(),
2784 options: crate::RequestOptions::default(),
2785 }
2786 }
2787 }
2788
2789 #[derive(Clone, Debug)]
2810 pub struct ListIngressRules(RequestBuilder<crate::model::ListIngressRulesRequest>);
2811
2812 impl ListIngressRules {
2813 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2814 Self(RequestBuilder::new(stub))
2815 }
2816
2817 pub fn with_request<V: Into<crate::model::ListIngressRulesRequest>>(
2819 mut self,
2820 v: V,
2821 ) -> Self {
2822 self.0.request = v.into();
2823 self
2824 }
2825
2826 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2828 self.0.options = v.into();
2829 self
2830 }
2831
2832 pub async fn send(self) -> Result<crate::model::ListIngressRulesResponse> {
2834 (*self.0.stub)
2835 .list_ingress_rules(self.0.request, self.0.options)
2836 .await
2837 .map(crate::Response::into_body)
2838 }
2839
2840 pub fn by_page(
2842 self,
2843 ) -> impl google_cloud_gax::paginator::Paginator<
2844 crate::model::ListIngressRulesResponse,
2845 crate::Error,
2846 > {
2847 use std::clone::Clone;
2848 let token = self.0.request.page_token.clone();
2849 let execute = move |token: String| {
2850 let mut builder = self.clone();
2851 builder.0.request = builder.0.request.set_page_token(token);
2852 builder.send()
2853 };
2854 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2855 }
2856
2857 pub fn by_item(
2859 self,
2860 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2861 crate::model::ListIngressRulesResponse,
2862 crate::Error,
2863 > {
2864 use google_cloud_gax::paginator::Paginator;
2865 self.by_page().items()
2866 }
2867
2868 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2870 self.0.request.parent = v.into();
2871 self
2872 }
2873
2874 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2876 self.0.request.page_size = v.into();
2877 self
2878 }
2879
2880 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2882 self.0.request.page_token = v.into();
2883 self
2884 }
2885
2886 pub fn set_matching_address<T: Into<std::string::String>>(mut self, v: T) -> Self {
2888 self.0.request.matching_address = v.into();
2889 self
2890 }
2891 }
2892
2893 #[doc(hidden)]
2894 impl crate::RequestBuilder for ListIngressRules {
2895 fn request_options(&mut self) -> &mut crate::RequestOptions {
2896 &mut self.0.options
2897 }
2898 }
2899
2900 #[derive(Clone, Debug)]
2917 pub struct BatchUpdateIngressRules(
2918 RequestBuilder<crate::model::BatchUpdateIngressRulesRequest>,
2919 );
2920
2921 impl BatchUpdateIngressRules {
2922 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2923 Self(RequestBuilder::new(stub))
2924 }
2925
2926 pub fn with_request<V: Into<crate::model::BatchUpdateIngressRulesRequest>>(
2928 mut self,
2929 v: V,
2930 ) -> Self {
2931 self.0.request = v.into();
2932 self
2933 }
2934
2935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2937 self.0.options = v.into();
2938 self
2939 }
2940
2941 pub async fn send(self) -> Result<crate::model::BatchUpdateIngressRulesResponse> {
2943 (*self.0.stub)
2944 .batch_update_ingress_rules(self.0.request, self.0.options)
2945 .await
2946 .map(crate::Response::into_body)
2947 }
2948
2949 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2951 self.0.request.name = v.into();
2952 self
2953 }
2954
2955 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
2957 where
2958 T: std::iter::IntoIterator<Item = V>,
2959 V: std::convert::Into<crate::model::FirewallRule>,
2960 {
2961 use std::iter::Iterator;
2962 self.0.request.ingress_rules = v.into_iter().map(|i| i.into()).collect();
2963 self
2964 }
2965 }
2966
2967 #[doc(hidden)]
2968 impl crate::RequestBuilder for BatchUpdateIngressRules {
2969 fn request_options(&mut self) -> &mut crate::RequestOptions {
2970 &mut self.0.options
2971 }
2972 }
2973
2974 #[derive(Clone, Debug)]
2991 pub struct CreateIngressRule(RequestBuilder<crate::model::CreateIngressRuleRequest>);
2992
2993 impl CreateIngressRule {
2994 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2995 Self(RequestBuilder::new(stub))
2996 }
2997
2998 pub fn with_request<V: Into<crate::model::CreateIngressRuleRequest>>(
3000 mut self,
3001 v: V,
3002 ) -> Self {
3003 self.0.request = v.into();
3004 self
3005 }
3006
3007 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3009 self.0.options = v.into();
3010 self
3011 }
3012
3013 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3015 (*self.0.stub)
3016 .create_ingress_rule(self.0.request, self.0.options)
3017 .await
3018 .map(crate::Response::into_body)
3019 }
3020
3021 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3023 self.0.request.parent = v.into();
3024 self
3025 }
3026
3027 pub fn set_rule<T>(mut self, v: T) -> Self
3029 where
3030 T: std::convert::Into<crate::model::FirewallRule>,
3031 {
3032 self.0.request.rule = std::option::Option::Some(v.into());
3033 self
3034 }
3035
3036 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3038 where
3039 T: std::convert::Into<crate::model::FirewallRule>,
3040 {
3041 self.0.request.rule = v.map(|x| x.into());
3042 self
3043 }
3044 }
3045
3046 #[doc(hidden)]
3047 impl crate::RequestBuilder for CreateIngressRule {
3048 fn request_options(&mut self) -> &mut crate::RequestOptions {
3049 &mut self.0.options
3050 }
3051 }
3052
3053 #[derive(Clone, Debug)]
3070 pub struct GetIngressRule(RequestBuilder<crate::model::GetIngressRuleRequest>);
3071
3072 impl GetIngressRule {
3073 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3074 Self(RequestBuilder::new(stub))
3075 }
3076
3077 pub fn with_request<V: Into<crate::model::GetIngressRuleRequest>>(mut self, v: V) -> Self {
3079 self.0.request = v.into();
3080 self
3081 }
3082
3083 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3085 self.0.options = v.into();
3086 self
3087 }
3088
3089 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3091 (*self.0.stub)
3092 .get_ingress_rule(self.0.request, self.0.options)
3093 .await
3094 .map(crate::Response::into_body)
3095 }
3096
3097 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3099 self.0.request.name = v.into();
3100 self
3101 }
3102 }
3103
3104 #[doc(hidden)]
3105 impl crate::RequestBuilder for GetIngressRule {
3106 fn request_options(&mut self) -> &mut crate::RequestOptions {
3107 &mut self.0.options
3108 }
3109 }
3110
3111 #[derive(Clone, Debug)]
3128 pub struct UpdateIngressRule(RequestBuilder<crate::model::UpdateIngressRuleRequest>);
3129
3130 impl UpdateIngressRule {
3131 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3132 Self(RequestBuilder::new(stub))
3133 }
3134
3135 pub fn with_request<V: Into<crate::model::UpdateIngressRuleRequest>>(
3137 mut self,
3138 v: V,
3139 ) -> Self {
3140 self.0.request = v.into();
3141 self
3142 }
3143
3144 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3146 self.0.options = v.into();
3147 self
3148 }
3149
3150 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3152 (*self.0.stub)
3153 .update_ingress_rule(self.0.request, self.0.options)
3154 .await
3155 .map(crate::Response::into_body)
3156 }
3157
3158 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3160 self.0.request.name = v.into();
3161 self
3162 }
3163
3164 pub fn set_rule<T>(mut self, v: T) -> Self
3166 where
3167 T: std::convert::Into<crate::model::FirewallRule>,
3168 {
3169 self.0.request.rule = std::option::Option::Some(v.into());
3170 self
3171 }
3172
3173 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3175 where
3176 T: std::convert::Into<crate::model::FirewallRule>,
3177 {
3178 self.0.request.rule = v.map(|x| x.into());
3179 self
3180 }
3181
3182 pub fn set_update_mask<T>(mut self, v: T) -> Self
3184 where
3185 T: std::convert::Into<wkt::FieldMask>,
3186 {
3187 self.0.request.update_mask = std::option::Option::Some(v.into());
3188 self
3189 }
3190
3191 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3193 where
3194 T: std::convert::Into<wkt::FieldMask>,
3195 {
3196 self.0.request.update_mask = v.map(|x| x.into());
3197 self
3198 }
3199 }
3200
3201 #[doc(hidden)]
3202 impl crate::RequestBuilder for UpdateIngressRule {
3203 fn request_options(&mut self) -> &mut crate::RequestOptions {
3204 &mut self.0.options
3205 }
3206 }
3207
3208 #[derive(Clone, Debug)]
3225 pub struct DeleteIngressRule(RequestBuilder<crate::model::DeleteIngressRuleRequest>);
3226
3227 impl DeleteIngressRule {
3228 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3229 Self(RequestBuilder::new(stub))
3230 }
3231
3232 pub fn with_request<V: Into<crate::model::DeleteIngressRuleRequest>>(
3234 mut self,
3235 v: V,
3236 ) -> Self {
3237 self.0.request = v.into();
3238 self
3239 }
3240
3241 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3243 self.0.options = v.into();
3244 self
3245 }
3246
3247 pub async fn send(self) -> Result<()> {
3249 (*self.0.stub)
3250 .delete_ingress_rule(self.0.request, self.0.options)
3251 .await
3252 .map(crate::Response::into_body)
3253 }
3254
3255 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3257 self.0.request.name = v.into();
3258 self
3259 }
3260 }
3261
3262 #[doc(hidden)]
3263 impl crate::RequestBuilder for DeleteIngressRule {
3264 fn request_options(&mut self) -> &mut crate::RequestOptions {
3265 &mut self.0.options
3266 }
3267 }
3268
3269 #[derive(Clone, Debug)]
3290 pub struct ListOperations(
3291 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3292 );
3293
3294 impl ListOperations {
3295 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3296 Self(RequestBuilder::new(stub))
3297 }
3298
3299 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3301 mut self,
3302 v: V,
3303 ) -> Self {
3304 self.0.request = v.into();
3305 self
3306 }
3307
3308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3310 self.0.options = v.into();
3311 self
3312 }
3313
3314 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3316 (*self.0.stub)
3317 .list_operations(self.0.request, self.0.options)
3318 .await
3319 .map(crate::Response::into_body)
3320 }
3321
3322 pub fn by_page(
3324 self,
3325 ) -> impl google_cloud_gax::paginator::Paginator<
3326 google_cloud_longrunning::model::ListOperationsResponse,
3327 crate::Error,
3328 > {
3329 use std::clone::Clone;
3330 let token = self.0.request.page_token.clone();
3331 let execute = move |token: String| {
3332 let mut builder = self.clone();
3333 builder.0.request = builder.0.request.set_page_token(token);
3334 builder.send()
3335 };
3336 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3337 }
3338
3339 pub fn by_item(
3341 self,
3342 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3343 google_cloud_longrunning::model::ListOperationsResponse,
3344 crate::Error,
3345 > {
3346 use google_cloud_gax::paginator::Paginator;
3347 self.by_page().items()
3348 }
3349
3350 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3352 self.0.request.name = v.into();
3353 self
3354 }
3355
3356 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3358 self.0.request.filter = v.into();
3359 self
3360 }
3361
3362 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3364 self.0.request.page_size = v.into();
3365 self
3366 }
3367
3368 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3370 self.0.request.page_token = v.into();
3371 self
3372 }
3373
3374 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3376 self.0.request.return_partial_success = v.into();
3377 self
3378 }
3379 }
3380
3381 #[doc(hidden)]
3382 impl crate::RequestBuilder for ListOperations {
3383 fn request_options(&mut self) -> &mut crate::RequestOptions {
3384 &mut self.0.options
3385 }
3386 }
3387
3388 #[derive(Clone, Debug)]
3405 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3406
3407 impl GetOperation {
3408 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3409 Self(RequestBuilder::new(stub))
3410 }
3411
3412 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3414 mut self,
3415 v: V,
3416 ) -> Self {
3417 self.0.request = v.into();
3418 self
3419 }
3420
3421 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3423 self.0.options = v.into();
3424 self
3425 }
3426
3427 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3429 (*self.0.stub)
3430 .get_operation(self.0.request, self.0.options)
3431 .await
3432 .map(crate::Response::into_body)
3433 }
3434
3435 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3437 self.0.request.name = v.into();
3438 self
3439 }
3440 }
3441
3442 #[doc(hidden)]
3443 impl crate::RequestBuilder for GetOperation {
3444 fn request_options(&mut self) -> &mut crate::RequestOptions {
3445 &mut self.0.options
3446 }
3447 }
3448}
3449
3450pub mod authorized_domains {
3451 use crate::Result;
3452
3453 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3467
3468 pub(crate) mod client {
3469 use super::super::super::client::AuthorizedDomains;
3470 pub struct Factory;
3471 impl crate::ClientFactory for Factory {
3472 type Client = AuthorizedDomains;
3473 type Credentials = gaxi::options::Credentials;
3474 async fn build(
3475 self,
3476 config: gaxi::options::ClientConfig,
3477 ) -> crate::ClientBuilderResult<Self::Client> {
3478 Self::Client::new(config).await
3479 }
3480 }
3481 }
3482
3483 #[derive(Clone, Debug)]
3485 pub(crate) struct RequestBuilder<R: std::default::Default> {
3486 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3487 request: R,
3488 options: crate::RequestOptions,
3489 }
3490
3491 impl<R> RequestBuilder<R>
3492 where
3493 R: std::default::Default,
3494 {
3495 pub(crate) fn new(
3496 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3497 ) -> Self {
3498 Self {
3499 stub,
3500 request: R::default(),
3501 options: crate::RequestOptions::default(),
3502 }
3503 }
3504 }
3505
3506 #[derive(Clone, Debug)]
3527 pub struct ListAuthorizedDomains(RequestBuilder<crate::model::ListAuthorizedDomainsRequest>);
3528
3529 impl ListAuthorizedDomains {
3530 pub(crate) fn new(
3531 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3532 ) -> Self {
3533 Self(RequestBuilder::new(stub))
3534 }
3535
3536 pub fn with_request<V: Into<crate::model::ListAuthorizedDomainsRequest>>(
3538 mut self,
3539 v: V,
3540 ) -> Self {
3541 self.0.request = v.into();
3542 self
3543 }
3544
3545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3547 self.0.options = v.into();
3548 self
3549 }
3550
3551 pub async fn send(self) -> Result<crate::model::ListAuthorizedDomainsResponse> {
3553 (*self.0.stub)
3554 .list_authorized_domains(self.0.request, self.0.options)
3555 .await
3556 .map(crate::Response::into_body)
3557 }
3558
3559 pub fn by_page(
3561 self,
3562 ) -> impl google_cloud_gax::paginator::Paginator<
3563 crate::model::ListAuthorizedDomainsResponse,
3564 crate::Error,
3565 > {
3566 use std::clone::Clone;
3567 let token = self.0.request.page_token.clone();
3568 let execute = move |token: String| {
3569 let mut builder = self.clone();
3570 builder.0.request = builder.0.request.set_page_token(token);
3571 builder.send()
3572 };
3573 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3574 }
3575
3576 pub fn by_item(
3578 self,
3579 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3580 crate::model::ListAuthorizedDomainsResponse,
3581 crate::Error,
3582 > {
3583 use google_cloud_gax::paginator::Paginator;
3584 self.by_page().items()
3585 }
3586
3587 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3589 self.0.request.parent = v.into();
3590 self
3591 }
3592
3593 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3595 self.0.request.page_size = v.into();
3596 self
3597 }
3598
3599 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3601 self.0.request.page_token = v.into();
3602 self
3603 }
3604 }
3605
3606 #[doc(hidden)]
3607 impl crate::RequestBuilder for ListAuthorizedDomains {
3608 fn request_options(&mut self) -> &mut crate::RequestOptions {
3609 &mut self.0.options
3610 }
3611 }
3612
3613 #[derive(Clone, Debug)]
3634 pub struct ListOperations(
3635 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3636 );
3637
3638 impl ListOperations {
3639 pub(crate) fn new(
3640 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3641 ) -> Self {
3642 Self(RequestBuilder::new(stub))
3643 }
3644
3645 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3647 mut self,
3648 v: V,
3649 ) -> Self {
3650 self.0.request = v.into();
3651 self
3652 }
3653
3654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3656 self.0.options = v.into();
3657 self
3658 }
3659
3660 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3662 (*self.0.stub)
3663 .list_operations(self.0.request, self.0.options)
3664 .await
3665 .map(crate::Response::into_body)
3666 }
3667
3668 pub fn by_page(
3670 self,
3671 ) -> impl google_cloud_gax::paginator::Paginator<
3672 google_cloud_longrunning::model::ListOperationsResponse,
3673 crate::Error,
3674 > {
3675 use std::clone::Clone;
3676 let token = self.0.request.page_token.clone();
3677 let execute = move |token: String| {
3678 let mut builder = self.clone();
3679 builder.0.request = builder.0.request.set_page_token(token);
3680 builder.send()
3681 };
3682 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3683 }
3684
3685 pub fn by_item(
3687 self,
3688 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3689 google_cloud_longrunning::model::ListOperationsResponse,
3690 crate::Error,
3691 > {
3692 use google_cloud_gax::paginator::Paginator;
3693 self.by_page().items()
3694 }
3695
3696 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3698 self.0.request.name = v.into();
3699 self
3700 }
3701
3702 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3704 self.0.request.filter = v.into();
3705 self
3706 }
3707
3708 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3710 self.0.request.page_size = v.into();
3711 self
3712 }
3713
3714 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3716 self.0.request.page_token = v.into();
3717 self
3718 }
3719
3720 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3722 self.0.request.return_partial_success = v.into();
3723 self
3724 }
3725 }
3726
3727 #[doc(hidden)]
3728 impl crate::RequestBuilder for ListOperations {
3729 fn request_options(&mut self) -> &mut crate::RequestOptions {
3730 &mut self.0.options
3731 }
3732 }
3733
3734 #[derive(Clone, Debug)]
3751 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3752
3753 impl GetOperation {
3754 pub(crate) fn new(
3755 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3756 ) -> Self {
3757 Self(RequestBuilder::new(stub))
3758 }
3759
3760 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3762 mut self,
3763 v: V,
3764 ) -> Self {
3765 self.0.request = v.into();
3766 self
3767 }
3768
3769 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3771 self.0.options = v.into();
3772 self
3773 }
3774
3775 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3777 (*self.0.stub)
3778 .get_operation(self.0.request, self.0.options)
3779 .await
3780 .map(crate::Response::into_body)
3781 }
3782
3783 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3785 self.0.request.name = v.into();
3786 self
3787 }
3788 }
3789
3790 #[doc(hidden)]
3791 impl crate::RequestBuilder for GetOperation {
3792 fn request_options(&mut self) -> &mut crate::RequestOptions {
3793 &mut self.0.options
3794 }
3795 }
3796}
3797
3798pub mod authorized_certificates {
3799 use crate::Result;
3800
3801 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3815
3816 pub(crate) mod client {
3817 use super::super::super::client::AuthorizedCertificates;
3818 pub struct Factory;
3819 impl crate::ClientFactory for Factory {
3820 type Client = AuthorizedCertificates;
3821 type Credentials = gaxi::options::Credentials;
3822 async fn build(
3823 self,
3824 config: gaxi::options::ClientConfig,
3825 ) -> crate::ClientBuilderResult<Self::Client> {
3826 Self::Client::new(config).await
3827 }
3828 }
3829 }
3830
3831 #[derive(Clone, Debug)]
3833 pub(crate) struct RequestBuilder<R: std::default::Default> {
3834 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3835 request: R,
3836 options: crate::RequestOptions,
3837 }
3838
3839 impl<R> RequestBuilder<R>
3840 where
3841 R: std::default::Default,
3842 {
3843 pub(crate) fn new(
3844 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3845 ) -> Self {
3846 Self {
3847 stub,
3848 request: R::default(),
3849 options: crate::RequestOptions::default(),
3850 }
3851 }
3852 }
3853
3854 #[derive(Clone, Debug)]
3875 pub struct ListAuthorizedCertificates(
3876 RequestBuilder<crate::model::ListAuthorizedCertificatesRequest>,
3877 );
3878
3879 impl ListAuthorizedCertificates {
3880 pub(crate) fn new(
3881 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3882 ) -> Self {
3883 Self(RequestBuilder::new(stub))
3884 }
3885
3886 pub fn with_request<V: Into<crate::model::ListAuthorizedCertificatesRequest>>(
3888 mut self,
3889 v: V,
3890 ) -> Self {
3891 self.0.request = v.into();
3892 self
3893 }
3894
3895 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3897 self.0.options = v.into();
3898 self
3899 }
3900
3901 pub async fn send(self) -> Result<crate::model::ListAuthorizedCertificatesResponse> {
3903 (*self.0.stub)
3904 .list_authorized_certificates(self.0.request, self.0.options)
3905 .await
3906 .map(crate::Response::into_body)
3907 }
3908
3909 pub fn by_page(
3911 self,
3912 ) -> impl google_cloud_gax::paginator::Paginator<
3913 crate::model::ListAuthorizedCertificatesResponse,
3914 crate::Error,
3915 > {
3916 use std::clone::Clone;
3917 let token = self.0.request.page_token.clone();
3918 let execute = move |token: String| {
3919 let mut builder = self.clone();
3920 builder.0.request = builder.0.request.set_page_token(token);
3921 builder.send()
3922 };
3923 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3924 }
3925
3926 pub fn by_item(
3928 self,
3929 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3930 crate::model::ListAuthorizedCertificatesResponse,
3931 crate::Error,
3932 > {
3933 use google_cloud_gax::paginator::Paginator;
3934 self.by_page().items()
3935 }
3936
3937 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3939 self.0.request.parent = v.into();
3940 self
3941 }
3942
3943 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
3945 self.0.request.view = v.into();
3946 self
3947 }
3948
3949 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3951 self.0.request.page_size = v.into();
3952 self
3953 }
3954
3955 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3957 self.0.request.page_token = v.into();
3958 self
3959 }
3960 }
3961
3962 #[doc(hidden)]
3963 impl crate::RequestBuilder for ListAuthorizedCertificates {
3964 fn request_options(&mut self) -> &mut crate::RequestOptions {
3965 &mut self.0.options
3966 }
3967 }
3968
3969 #[derive(Clone, Debug)]
3986 pub struct GetAuthorizedCertificate(
3987 RequestBuilder<crate::model::GetAuthorizedCertificateRequest>,
3988 );
3989
3990 impl GetAuthorizedCertificate {
3991 pub(crate) fn new(
3992 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3993 ) -> Self {
3994 Self(RequestBuilder::new(stub))
3995 }
3996
3997 pub fn with_request<V: Into<crate::model::GetAuthorizedCertificateRequest>>(
3999 mut self,
4000 v: V,
4001 ) -> Self {
4002 self.0.request = v.into();
4003 self
4004 }
4005
4006 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4008 self.0.options = v.into();
4009 self
4010 }
4011
4012 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4014 (*self.0.stub)
4015 .get_authorized_certificate(self.0.request, self.0.options)
4016 .await
4017 .map(crate::Response::into_body)
4018 }
4019
4020 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4022 self.0.request.name = v.into();
4023 self
4024 }
4025
4026 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
4028 self.0.request.view = v.into();
4029 self
4030 }
4031 }
4032
4033 #[doc(hidden)]
4034 impl crate::RequestBuilder for GetAuthorizedCertificate {
4035 fn request_options(&mut self) -> &mut crate::RequestOptions {
4036 &mut self.0.options
4037 }
4038 }
4039
4040 #[derive(Clone, Debug)]
4057 pub struct CreateAuthorizedCertificate(
4058 RequestBuilder<crate::model::CreateAuthorizedCertificateRequest>,
4059 );
4060
4061 impl CreateAuthorizedCertificate {
4062 pub(crate) fn new(
4063 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4064 ) -> Self {
4065 Self(RequestBuilder::new(stub))
4066 }
4067
4068 pub fn with_request<V: Into<crate::model::CreateAuthorizedCertificateRequest>>(
4070 mut self,
4071 v: V,
4072 ) -> Self {
4073 self.0.request = v.into();
4074 self
4075 }
4076
4077 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4079 self.0.options = v.into();
4080 self
4081 }
4082
4083 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4085 (*self.0.stub)
4086 .create_authorized_certificate(self.0.request, self.0.options)
4087 .await
4088 .map(crate::Response::into_body)
4089 }
4090
4091 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4093 self.0.request.parent = v.into();
4094 self
4095 }
4096
4097 pub fn set_certificate<T>(mut self, v: T) -> Self
4099 where
4100 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4101 {
4102 self.0.request.certificate = std::option::Option::Some(v.into());
4103 self
4104 }
4105
4106 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4108 where
4109 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4110 {
4111 self.0.request.certificate = v.map(|x| x.into());
4112 self
4113 }
4114 }
4115
4116 #[doc(hidden)]
4117 impl crate::RequestBuilder for CreateAuthorizedCertificate {
4118 fn request_options(&mut self) -> &mut crate::RequestOptions {
4119 &mut self.0.options
4120 }
4121 }
4122
4123 #[derive(Clone, Debug)]
4140 pub struct UpdateAuthorizedCertificate(
4141 RequestBuilder<crate::model::UpdateAuthorizedCertificateRequest>,
4142 );
4143
4144 impl UpdateAuthorizedCertificate {
4145 pub(crate) fn new(
4146 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4147 ) -> Self {
4148 Self(RequestBuilder::new(stub))
4149 }
4150
4151 pub fn with_request<V: Into<crate::model::UpdateAuthorizedCertificateRequest>>(
4153 mut self,
4154 v: V,
4155 ) -> Self {
4156 self.0.request = v.into();
4157 self
4158 }
4159
4160 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4162 self.0.options = v.into();
4163 self
4164 }
4165
4166 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4168 (*self.0.stub)
4169 .update_authorized_certificate(self.0.request, self.0.options)
4170 .await
4171 .map(crate::Response::into_body)
4172 }
4173
4174 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4176 self.0.request.name = v.into();
4177 self
4178 }
4179
4180 pub fn set_certificate<T>(mut self, v: T) -> Self
4182 where
4183 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4184 {
4185 self.0.request.certificate = std::option::Option::Some(v.into());
4186 self
4187 }
4188
4189 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4191 where
4192 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4193 {
4194 self.0.request.certificate = v.map(|x| x.into());
4195 self
4196 }
4197
4198 pub fn set_update_mask<T>(mut self, v: T) -> Self
4200 where
4201 T: std::convert::Into<wkt::FieldMask>,
4202 {
4203 self.0.request.update_mask = std::option::Option::Some(v.into());
4204 self
4205 }
4206
4207 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4209 where
4210 T: std::convert::Into<wkt::FieldMask>,
4211 {
4212 self.0.request.update_mask = v.map(|x| x.into());
4213 self
4214 }
4215 }
4216
4217 #[doc(hidden)]
4218 impl crate::RequestBuilder for UpdateAuthorizedCertificate {
4219 fn request_options(&mut self) -> &mut crate::RequestOptions {
4220 &mut self.0.options
4221 }
4222 }
4223
4224 #[derive(Clone, Debug)]
4241 pub struct DeleteAuthorizedCertificate(
4242 RequestBuilder<crate::model::DeleteAuthorizedCertificateRequest>,
4243 );
4244
4245 impl DeleteAuthorizedCertificate {
4246 pub(crate) fn new(
4247 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4248 ) -> Self {
4249 Self(RequestBuilder::new(stub))
4250 }
4251
4252 pub fn with_request<V: Into<crate::model::DeleteAuthorizedCertificateRequest>>(
4254 mut self,
4255 v: V,
4256 ) -> Self {
4257 self.0.request = v.into();
4258 self
4259 }
4260
4261 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4263 self.0.options = v.into();
4264 self
4265 }
4266
4267 pub async fn send(self) -> Result<()> {
4269 (*self.0.stub)
4270 .delete_authorized_certificate(self.0.request, self.0.options)
4271 .await
4272 .map(crate::Response::into_body)
4273 }
4274
4275 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4277 self.0.request.name = v.into();
4278 self
4279 }
4280 }
4281
4282 #[doc(hidden)]
4283 impl crate::RequestBuilder for DeleteAuthorizedCertificate {
4284 fn request_options(&mut self) -> &mut crate::RequestOptions {
4285 &mut self.0.options
4286 }
4287 }
4288
4289 #[derive(Clone, Debug)]
4310 pub struct ListOperations(
4311 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4312 );
4313
4314 impl ListOperations {
4315 pub(crate) fn new(
4316 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4317 ) -> Self {
4318 Self(RequestBuilder::new(stub))
4319 }
4320
4321 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4323 mut self,
4324 v: V,
4325 ) -> Self {
4326 self.0.request = v.into();
4327 self
4328 }
4329
4330 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4332 self.0.options = v.into();
4333 self
4334 }
4335
4336 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4338 (*self.0.stub)
4339 .list_operations(self.0.request, self.0.options)
4340 .await
4341 .map(crate::Response::into_body)
4342 }
4343
4344 pub fn by_page(
4346 self,
4347 ) -> impl google_cloud_gax::paginator::Paginator<
4348 google_cloud_longrunning::model::ListOperationsResponse,
4349 crate::Error,
4350 > {
4351 use std::clone::Clone;
4352 let token = self.0.request.page_token.clone();
4353 let execute = move |token: String| {
4354 let mut builder = self.clone();
4355 builder.0.request = builder.0.request.set_page_token(token);
4356 builder.send()
4357 };
4358 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4359 }
4360
4361 pub fn by_item(
4363 self,
4364 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4365 google_cloud_longrunning::model::ListOperationsResponse,
4366 crate::Error,
4367 > {
4368 use google_cloud_gax::paginator::Paginator;
4369 self.by_page().items()
4370 }
4371
4372 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4374 self.0.request.name = v.into();
4375 self
4376 }
4377
4378 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4380 self.0.request.filter = v.into();
4381 self
4382 }
4383
4384 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4386 self.0.request.page_size = v.into();
4387 self
4388 }
4389
4390 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4392 self.0.request.page_token = v.into();
4393 self
4394 }
4395
4396 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4398 self.0.request.return_partial_success = v.into();
4399 self
4400 }
4401 }
4402
4403 #[doc(hidden)]
4404 impl crate::RequestBuilder for ListOperations {
4405 fn request_options(&mut self) -> &mut crate::RequestOptions {
4406 &mut self.0.options
4407 }
4408 }
4409
4410 #[derive(Clone, Debug)]
4427 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4428
4429 impl GetOperation {
4430 pub(crate) fn new(
4431 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4432 ) -> Self {
4433 Self(RequestBuilder::new(stub))
4434 }
4435
4436 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4438 mut self,
4439 v: V,
4440 ) -> Self {
4441 self.0.request = v.into();
4442 self
4443 }
4444
4445 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4447 self.0.options = v.into();
4448 self
4449 }
4450
4451 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4453 (*self.0.stub)
4454 .get_operation(self.0.request, self.0.options)
4455 .await
4456 .map(crate::Response::into_body)
4457 }
4458
4459 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4461 self.0.request.name = v.into();
4462 self
4463 }
4464 }
4465
4466 #[doc(hidden)]
4467 impl crate::RequestBuilder for GetOperation {
4468 fn request_options(&mut self) -> &mut crate::RequestOptions {
4469 &mut self.0.options
4470 }
4471 }
4472}
4473
4474pub mod domain_mappings {
4475 use crate::Result;
4476
4477 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4491
4492 pub(crate) mod client {
4493 use super::super::super::client::DomainMappings;
4494 pub struct Factory;
4495 impl crate::ClientFactory for Factory {
4496 type Client = DomainMappings;
4497 type Credentials = gaxi::options::Credentials;
4498 async fn build(
4499 self,
4500 config: gaxi::options::ClientConfig,
4501 ) -> crate::ClientBuilderResult<Self::Client> {
4502 Self::Client::new(config).await
4503 }
4504 }
4505 }
4506
4507 #[derive(Clone, Debug)]
4509 pub(crate) struct RequestBuilder<R: std::default::Default> {
4510 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4511 request: R,
4512 options: crate::RequestOptions,
4513 }
4514
4515 impl<R> RequestBuilder<R>
4516 where
4517 R: std::default::Default,
4518 {
4519 pub(crate) fn new(
4520 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4521 ) -> Self {
4522 Self {
4523 stub,
4524 request: R::default(),
4525 options: crate::RequestOptions::default(),
4526 }
4527 }
4528 }
4529
4530 #[derive(Clone, Debug)]
4551 pub struct ListDomainMappings(RequestBuilder<crate::model::ListDomainMappingsRequest>);
4552
4553 impl ListDomainMappings {
4554 pub(crate) fn new(
4555 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4556 ) -> Self {
4557 Self(RequestBuilder::new(stub))
4558 }
4559
4560 pub fn with_request<V: Into<crate::model::ListDomainMappingsRequest>>(
4562 mut self,
4563 v: V,
4564 ) -> Self {
4565 self.0.request = v.into();
4566 self
4567 }
4568
4569 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4571 self.0.options = v.into();
4572 self
4573 }
4574
4575 pub async fn send(self) -> Result<crate::model::ListDomainMappingsResponse> {
4577 (*self.0.stub)
4578 .list_domain_mappings(self.0.request, self.0.options)
4579 .await
4580 .map(crate::Response::into_body)
4581 }
4582
4583 pub fn by_page(
4585 self,
4586 ) -> impl google_cloud_gax::paginator::Paginator<
4587 crate::model::ListDomainMappingsResponse,
4588 crate::Error,
4589 > {
4590 use std::clone::Clone;
4591 let token = self.0.request.page_token.clone();
4592 let execute = move |token: String| {
4593 let mut builder = self.clone();
4594 builder.0.request = builder.0.request.set_page_token(token);
4595 builder.send()
4596 };
4597 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4598 }
4599
4600 pub fn by_item(
4602 self,
4603 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4604 crate::model::ListDomainMappingsResponse,
4605 crate::Error,
4606 > {
4607 use google_cloud_gax::paginator::Paginator;
4608 self.by_page().items()
4609 }
4610
4611 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4613 self.0.request.parent = v.into();
4614 self
4615 }
4616
4617 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4619 self.0.request.page_size = v.into();
4620 self
4621 }
4622
4623 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4625 self.0.request.page_token = v.into();
4626 self
4627 }
4628 }
4629
4630 #[doc(hidden)]
4631 impl crate::RequestBuilder for ListDomainMappings {
4632 fn request_options(&mut self) -> &mut crate::RequestOptions {
4633 &mut self.0.options
4634 }
4635 }
4636
4637 #[derive(Clone, Debug)]
4654 pub struct GetDomainMapping(RequestBuilder<crate::model::GetDomainMappingRequest>);
4655
4656 impl GetDomainMapping {
4657 pub(crate) fn new(
4658 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4659 ) -> Self {
4660 Self(RequestBuilder::new(stub))
4661 }
4662
4663 pub fn with_request<V: Into<crate::model::GetDomainMappingRequest>>(
4665 mut self,
4666 v: V,
4667 ) -> Self {
4668 self.0.request = v.into();
4669 self
4670 }
4671
4672 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4674 self.0.options = v.into();
4675 self
4676 }
4677
4678 pub async fn send(self) -> Result<crate::model::DomainMapping> {
4680 (*self.0.stub)
4681 .get_domain_mapping(self.0.request, self.0.options)
4682 .await
4683 .map(crate::Response::into_body)
4684 }
4685
4686 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4688 self.0.request.name = v.into();
4689 self
4690 }
4691 }
4692
4693 #[doc(hidden)]
4694 impl crate::RequestBuilder for GetDomainMapping {
4695 fn request_options(&mut self) -> &mut crate::RequestOptions {
4696 &mut self.0.options
4697 }
4698 }
4699
4700 #[derive(Clone, Debug)]
4718 pub struct CreateDomainMapping(RequestBuilder<crate::model::CreateDomainMappingRequest>);
4719
4720 impl CreateDomainMapping {
4721 pub(crate) fn new(
4722 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4723 ) -> Self {
4724 Self(RequestBuilder::new(stub))
4725 }
4726
4727 pub fn with_request<V: Into<crate::model::CreateDomainMappingRequest>>(
4729 mut self,
4730 v: V,
4731 ) -> Self {
4732 self.0.request = v.into();
4733 self
4734 }
4735
4736 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4738 self.0.options = v.into();
4739 self
4740 }
4741
4742 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4749 (*self.0.stub)
4750 .create_domain_mapping(self.0.request, self.0.options)
4751 .await
4752 .map(crate::Response::into_body)
4753 }
4754
4755 pub fn poller(
4757 self,
4758 ) -> impl google_cloud_lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4759 {
4760 type Operation = google_cloud_lro::internal::Operation<
4761 crate::model::DomainMapping,
4762 crate::model::OperationMetadataV1,
4763 >;
4764 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4765 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4766
4767 let stub = self.0.stub.clone();
4768 let mut options = self.0.options.clone();
4769 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4770 let query = move |name| {
4771 let stub = stub.clone();
4772 let options = options.clone();
4773 async {
4774 let op = GetOperation::new(stub)
4775 .set_name(name)
4776 .with_options(options)
4777 .send()
4778 .await?;
4779 Ok(Operation::new(op))
4780 }
4781 };
4782
4783 let start = move || async {
4784 let op = self.send().await?;
4785 Ok(Operation::new(op))
4786 };
4787
4788 google_cloud_lro::internal::new_poller(
4789 polling_error_policy,
4790 polling_backoff_policy,
4791 start,
4792 query,
4793 )
4794 }
4795
4796 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4798 self.0.request.parent = v.into();
4799 self
4800 }
4801
4802 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4804 where
4805 T: std::convert::Into<crate::model::DomainMapping>,
4806 {
4807 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4808 self
4809 }
4810
4811 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4813 where
4814 T: std::convert::Into<crate::model::DomainMapping>,
4815 {
4816 self.0.request.domain_mapping = v.map(|x| x.into());
4817 self
4818 }
4819
4820 pub fn set_override_strategy<T: Into<crate::model::DomainOverrideStrategy>>(
4822 mut self,
4823 v: T,
4824 ) -> Self {
4825 self.0.request.override_strategy = v.into();
4826 self
4827 }
4828 }
4829
4830 #[doc(hidden)]
4831 impl crate::RequestBuilder for CreateDomainMapping {
4832 fn request_options(&mut self) -> &mut crate::RequestOptions {
4833 &mut self.0.options
4834 }
4835 }
4836
4837 #[derive(Clone, Debug)]
4855 pub struct UpdateDomainMapping(RequestBuilder<crate::model::UpdateDomainMappingRequest>);
4856
4857 impl UpdateDomainMapping {
4858 pub(crate) fn new(
4859 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4860 ) -> Self {
4861 Self(RequestBuilder::new(stub))
4862 }
4863
4864 pub fn with_request<V: Into<crate::model::UpdateDomainMappingRequest>>(
4866 mut self,
4867 v: V,
4868 ) -> Self {
4869 self.0.request = v.into();
4870 self
4871 }
4872
4873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4875 self.0.options = v.into();
4876 self
4877 }
4878
4879 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4886 (*self.0.stub)
4887 .update_domain_mapping(self.0.request, self.0.options)
4888 .await
4889 .map(crate::Response::into_body)
4890 }
4891
4892 pub fn poller(
4894 self,
4895 ) -> impl google_cloud_lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4896 {
4897 type Operation = google_cloud_lro::internal::Operation<
4898 crate::model::DomainMapping,
4899 crate::model::OperationMetadataV1,
4900 >;
4901 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4902 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4903
4904 let stub = self.0.stub.clone();
4905 let mut options = self.0.options.clone();
4906 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4907 let query = move |name| {
4908 let stub = stub.clone();
4909 let options = options.clone();
4910 async {
4911 let op = GetOperation::new(stub)
4912 .set_name(name)
4913 .with_options(options)
4914 .send()
4915 .await?;
4916 Ok(Operation::new(op))
4917 }
4918 };
4919
4920 let start = move || async {
4921 let op = self.send().await?;
4922 Ok(Operation::new(op))
4923 };
4924
4925 google_cloud_lro::internal::new_poller(
4926 polling_error_policy,
4927 polling_backoff_policy,
4928 start,
4929 query,
4930 )
4931 }
4932
4933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4935 self.0.request.name = v.into();
4936 self
4937 }
4938
4939 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4941 where
4942 T: std::convert::Into<crate::model::DomainMapping>,
4943 {
4944 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4945 self
4946 }
4947
4948 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4950 where
4951 T: std::convert::Into<crate::model::DomainMapping>,
4952 {
4953 self.0.request.domain_mapping = v.map(|x| x.into());
4954 self
4955 }
4956
4957 pub fn set_update_mask<T>(mut self, v: T) -> Self
4959 where
4960 T: std::convert::Into<wkt::FieldMask>,
4961 {
4962 self.0.request.update_mask = std::option::Option::Some(v.into());
4963 self
4964 }
4965
4966 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4968 where
4969 T: std::convert::Into<wkt::FieldMask>,
4970 {
4971 self.0.request.update_mask = v.map(|x| x.into());
4972 self
4973 }
4974 }
4975
4976 #[doc(hidden)]
4977 impl crate::RequestBuilder for UpdateDomainMapping {
4978 fn request_options(&mut self) -> &mut crate::RequestOptions {
4979 &mut self.0.options
4980 }
4981 }
4982
4983 #[derive(Clone, Debug)]
5001 pub struct DeleteDomainMapping(RequestBuilder<crate::model::DeleteDomainMappingRequest>);
5002
5003 impl DeleteDomainMapping {
5004 pub(crate) fn new(
5005 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5006 ) -> Self {
5007 Self(RequestBuilder::new(stub))
5008 }
5009
5010 pub fn with_request<V: Into<crate::model::DeleteDomainMappingRequest>>(
5012 mut self,
5013 v: V,
5014 ) -> Self {
5015 self.0.request = v.into();
5016 self
5017 }
5018
5019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5021 self.0.options = v.into();
5022 self
5023 }
5024
5025 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5032 (*self.0.stub)
5033 .delete_domain_mapping(self.0.request, self.0.options)
5034 .await
5035 .map(crate::Response::into_body)
5036 }
5037
5038 pub fn poller(
5040 self,
5041 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
5042 type Operation = google_cloud_lro::internal::Operation<
5043 wkt::Empty,
5044 crate::model::OperationMetadataV1,
5045 >;
5046 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5047 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5048
5049 let stub = self.0.stub.clone();
5050 let mut options = self.0.options.clone();
5051 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5052 let query = move |name| {
5053 let stub = stub.clone();
5054 let options = options.clone();
5055 async {
5056 let op = GetOperation::new(stub)
5057 .set_name(name)
5058 .with_options(options)
5059 .send()
5060 .await?;
5061 Ok(Operation::new(op))
5062 }
5063 };
5064
5065 let start = move || async {
5066 let op = self.send().await?;
5067 Ok(Operation::new(op))
5068 };
5069
5070 google_cloud_lro::internal::new_unit_response_poller(
5071 polling_error_policy,
5072 polling_backoff_policy,
5073 start,
5074 query,
5075 )
5076 }
5077
5078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5080 self.0.request.name = v.into();
5081 self
5082 }
5083 }
5084
5085 #[doc(hidden)]
5086 impl crate::RequestBuilder for DeleteDomainMapping {
5087 fn request_options(&mut self) -> &mut crate::RequestOptions {
5088 &mut self.0.options
5089 }
5090 }
5091
5092 #[derive(Clone, Debug)]
5113 pub struct ListOperations(
5114 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5115 );
5116
5117 impl ListOperations {
5118 pub(crate) fn new(
5119 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5120 ) -> Self {
5121 Self(RequestBuilder::new(stub))
5122 }
5123
5124 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5126 mut self,
5127 v: V,
5128 ) -> Self {
5129 self.0.request = v.into();
5130 self
5131 }
5132
5133 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5135 self.0.options = v.into();
5136 self
5137 }
5138
5139 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5141 (*self.0.stub)
5142 .list_operations(self.0.request, self.0.options)
5143 .await
5144 .map(crate::Response::into_body)
5145 }
5146
5147 pub fn by_page(
5149 self,
5150 ) -> impl google_cloud_gax::paginator::Paginator<
5151 google_cloud_longrunning::model::ListOperationsResponse,
5152 crate::Error,
5153 > {
5154 use std::clone::Clone;
5155 let token = self.0.request.page_token.clone();
5156 let execute = move |token: String| {
5157 let mut builder = self.clone();
5158 builder.0.request = builder.0.request.set_page_token(token);
5159 builder.send()
5160 };
5161 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5162 }
5163
5164 pub fn by_item(
5166 self,
5167 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5168 google_cloud_longrunning::model::ListOperationsResponse,
5169 crate::Error,
5170 > {
5171 use google_cloud_gax::paginator::Paginator;
5172 self.by_page().items()
5173 }
5174
5175 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5177 self.0.request.name = v.into();
5178 self
5179 }
5180
5181 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5183 self.0.request.filter = v.into();
5184 self
5185 }
5186
5187 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5189 self.0.request.page_size = v.into();
5190 self
5191 }
5192
5193 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5195 self.0.request.page_token = v.into();
5196 self
5197 }
5198
5199 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5201 self.0.request.return_partial_success = v.into();
5202 self
5203 }
5204 }
5205
5206 #[doc(hidden)]
5207 impl crate::RequestBuilder for ListOperations {
5208 fn request_options(&mut self) -> &mut crate::RequestOptions {
5209 &mut self.0.options
5210 }
5211 }
5212
5213 #[derive(Clone, Debug)]
5230 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5231
5232 impl GetOperation {
5233 pub(crate) fn new(
5234 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5235 ) -> Self {
5236 Self(RequestBuilder::new(stub))
5237 }
5238
5239 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5241 mut self,
5242 v: V,
5243 ) -> Self {
5244 self.0.request = v.into();
5245 self
5246 }
5247
5248 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5250 self.0.options = v.into();
5251 self
5252 }
5253
5254 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5256 (*self.0.stub)
5257 .get_operation(self.0.request, self.0.options)
5258 .await
5259 .map(crate::Response::into_body)
5260 }
5261
5262 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5264 self.0.request.name = v.into();
5265 self
5266 }
5267 }
5268
5269 #[doc(hidden)]
5270 impl crate::RequestBuilder for GetOperation {
5271 fn request_options(&mut self) -> &mut crate::RequestOptions {
5272 &mut self.0.options
5273 }
5274 }
5275}