1pub mod applications {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Applications;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = Applications;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
93
94 impl GetApplication {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<crate::model::Application> {
115 (*self.0.stub)
116 .get_application(self.0.request, self.0.options)
117 .await
118 .map(gax::response::Response::into_body)
119 }
120
121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
123 self.0.request.name = v.into();
124 self
125 }
126 }
127
128 #[doc(hidden)]
129 impl gax::options::internal::RequestBuilder for GetApplication {
130 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
131 &mut self.0.options
132 }
133 }
134
135 #[derive(Clone, Debug)]
154 pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
155
156 impl CreateApplication {
157 pub(crate) fn new(
158 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
159 ) -> Self {
160 Self(RequestBuilder::new(stub))
161 }
162
163 pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
165 mut self,
166 v: V,
167 ) -> Self {
168 self.0.request = v.into();
169 self
170 }
171
172 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
174 self.0.options = v.into();
175 self
176 }
177
178 pub async fn send(self) -> Result<longrunning::model::Operation> {
185 (*self.0.stub)
186 .create_application(self.0.request, self.0.options)
187 .await
188 .map(gax::response::Response::into_body)
189 }
190
191 pub fn poller(
193 self,
194 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
195 {
196 type Operation = lro::internal::Operation<
197 crate::model::Application,
198 crate::model::OperationMetadataV1,
199 >;
200 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
201 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
202
203 let stub = self.0.stub.clone();
204 let mut options = self.0.options.clone();
205 options.set_retry_policy(gax::retry_policy::NeverRetry);
206 let query = move |name| {
207 let stub = stub.clone();
208 let options = options.clone();
209 async {
210 let op = GetOperation::new(stub)
211 .set_name(name)
212 .with_options(options)
213 .send()
214 .await?;
215 Ok(Operation::new(op))
216 }
217 };
218
219 let start = move || async {
220 let op = self.send().await?;
221 Ok(Operation::new(op))
222 };
223
224 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
225 }
226
227 pub fn set_application<T>(mut self, v: T) -> Self
229 where
230 T: std::convert::Into<crate::model::Application>,
231 {
232 self.0.request.application = std::option::Option::Some(v.into());
233 self
234 }
235
236 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
238 where
239 T: std::convert::Into<crate::model::Application>,
240 {
241 self.0.request.application = v.map(|x| x.into());
242 self
243 }
244 }
245
246 #[doc(hidden)]
247 impl gax::options::internal::RequestBuilder for CreateApplication {
248 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
249 &mut self.0.options
250 }
251 }
252
253 #[derive(Clone, Debug)]
272 pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
273
274 impl UpdateApplication {
275 pub(crate) fn new(
276 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
277 ) -> Self {
278 Self(RequestBuilder::new(stub))
279 }
280
281 pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
283 mut self,
284 v: V,
285 ) -> Self {
286 self.0.request = v.into();
287 self
288 }
289
290 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
292 self.0.options = v.into();
293 self
294 }
295
296 pub async fn send(self) -> Result<longrunning::model::Operation> {
303 (*self.0.stub)
304 .update_application(self.0.request, self.0.options)
305 .await
306 .map(gax::response::Response::into_body)
307 }
308
309 pub fn poller(
311 self,
312 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
313 {
314 type Operation = lro::internal::Operation<
315 crate::model::Application,
316 crate::model::OperationMetadataV1,
317 >;
318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
320
321 let stub = self.0.stub.clone();
322 let mut options = self.0.options.clone();
323 options.set_retry_policy(gax::retry_policy::NeverRetry);
324 let query = move |name| {
325 let stub = stub.clone();
326 let options = options.clone();
327 async {
328 let op = GetOperation::new(stub)
329 .set_name(name)
330 .with_options(options)
331 .send()
332 .await?;
333 Ok(Operation::new(op))
334 }
335 };
336
337 let start = move || async {
338 let op = self.send().await?;
339 Ok(Operation::new(op))
340 };
341
342 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
343 }
344
345 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
347 self.0.request.name = v.into();
348 self
349 }
350
351 pub fn set_application<T>(mut self, v: T) -> Self
353 where
354 T: std::convert::Into<crate::model::Application>,
355 {
356 self.0.request.application = std::option::Option::Some(v.into());
357 self
358 }
359
360 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
362 where
363 T: std::convert::Into<crate::model::Application>,
364 {
365 self.0.request.application = v.map(|x| x.into());
366 self
367 }
368
369 pub fn set_update_mask<T>(mut self, v: T) -> Self
371 where
372 T: std::convert::Into<wkt::FieldMask>,
373 {
374 self.0.request.update_mask = std::option::Option::Some(v.into());
375 self
376 }
377
378 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
380 where
381 T: std::convert::Into<wkt::FieldMask>,
382 {
383 self.0.request.update_mask = v.map(|x| x.into());
384 self
385 }
386 }
387
388 #[doc(hidden)]
389 impl gax::options::internal::RequestBuilder for UpdateApplication {
390 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
391 &mut self.0.options
392 }
393 }
394
395 #[derive(Clone, Debug)]
414 pub struct RepairApplication(RequestBuilder<crate::model::RepairApplicationRequest>);
415
416 impl RepairApplication {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::RepairApplicationRequest>>(
425 mut self,
426 v: V,
427 ) -> Self {
428 self.0.request = v.into();
429 self
430 }
431
432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
434 self.0.options = v.into();
435 self
436 }
437
438 pub async fn send(self) -> Result<longrunning::model::Operation> {
445 (*self.0.stub)
446 .repair_application(self.0.request, self.0.options)
447 .await
448 .map(gax::response::Response::into_body)
449 }
450
451 pub fn poller(
453 self,
454 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
455 {
456 type Operation = lro::internal::Operation<
457 crate::model::Application,
458 crate::model::OperationMetadataV1,
459 >;
460 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
461 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
462
463 let stub = self.0.stub.clone();
464 let mut options = self.0.options.clone();
465 options.set_retry_policy(gax::retry_policy::NeverRetry);
466 let query = move |name| {
467 let stub = stub.clone();
468 let options = options.clone();
469 async {
470 let op = GetOperation::new(stub)
471 .set_name(name)
472 .with_options(options)
473 .send()
474 .await?;
475 Ok(Operation::new(op))
476 }
477 };
478
479 let start = move || async {
480 let op = self.send().await?;
481 Ok(Operation::new(op))
482 };
483
484 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
485 }
486
487 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
489 self.0.request.name = v.into();
490 self
491 }
492 }
493
494 #[doc(hidden)]
495 impl gax::options::internal::RequestBuilder for RepairApplication {
496 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
497 &mut self.0.options
498 }
499 }
500
501 #[derive(Clone, Debug)]
523 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
524
525 impl ListOperations {
526 pub(crate) fn new(
527 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
528 ) -> Self {
529 Self(RequestBuilder::new(stub))
530 }
531
532 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
534 mut self,
535 v: V,
536 ) -> Self {
537 self.0.request = v.into();
538 self
539 }
540
541 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
543 self.0.options = v.into();
544 self
545 }
546
547 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
549 (*self.0.stub)
550 .list_operations(self.0.request, self.0.options)
551 .await
552 .map(gax::response::Response::into_body)
553 }
554
555 pub fn by_page(
557 self,
558 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
559 {
560 use std::clone::Clone;
561 let token = self.0.request.page_token.clone();
562 let execute = move |token: String| {
563 let mut builder = self.clone();
564 builder.0.request = builder.0.request.set_page_token(token);
565 builder.send()
566 };
567 gax::paginator::internal::new_paginator(token, execute)
568 }
569
570 pub fn by_item(
572 self,
573 ) -> impl gax::paginator::ItemPaginator<
574 longrunning::model::ListOperationsResponse,
575 gax::error::Error,
576 > {
577 use gax::paginator::Paginator;
578 self.by_page().items()
579 }
580
581 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
583 self.0.request.name = v.into();
584 self
585 }
586
587 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
589 self.0.request.filter = v.into();
590 self
591 }
592
593 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
595 self.0.request.page_size = v.into();
596 self
597 }
598
599 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
601 self.0.request.page_token = v.into();
602 self
603 }
604
605 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
607 self.0.request.return_partial_success = v.into();
608 self
609 }
610 }
611
612 #[doc(hidden)]
613 impl gax::options::internal::RequestBuilder for ListOperations {
614 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
615 &mut self.0.options
616 }
617 }
618
619 #[derive(Clone, Debug)]
637 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
638
639 impl GetOperation {
640 pub(crate) fn new(
641 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
642 ) -> Self {
643 Self(RequestBuilder::new(stub))
644 }
645
646 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
648 mut self,
649 v: V,
650 ) -> Self {
651 self.0.request = v.into();
652 self
653 }
654
655 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
657 self.0.options = v.into();
658 self
659 }
660
661 pub async fn send(self) -> Result<longrunning::model::Operation> {
663 (*self.0.stub)
664 .get_operation(self.0.request, self.0.options)
665 .await
666 .map(gax::response::Response::into_body)
667 }
668
669 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
671 self.0.request.name = v.into();
672 self
673 }
674 }
675
676 #[doc(hidden)]
677 impl gax::options::internal::RequestBuilder for GetOperation {
678 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
679 &mut self.0.options
680 }
681 }
682}
683
684pub mod services {
685 use crate::Result;
686
687 pub type ClientBuilder =
701 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
702
703 pub(crate) mod client {
704 use super::super::super::client::Services;
705 pub struct Factory;
706 impl gax::client_builder::internal::ClientFactory for Factory {
707 type Client = Services;
708 type Credentials = gaxi::options::Credentials;
709 async fn build(
710 self,
711 config: gaxi::options::ClientConfig,
712 ) -> gax::client_builder::Result<Self::Client> {
713 Self::Client::new(config).await
714 }
715 }
716 }
717
718 #[derive(Clone, Debug)]
720 pub(crate) struct RequestBuilder<R: std::default::Default> {
721 stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
722 request: R,
723 options: gax::options::RequestOptions,
724 }
725
726 impl<R> RequestBuilder<R>
727 where
728 R: std::default::Default,
729 {
730 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
731 Self {
732 stub,
733 request: R::default(),
734 options: gax::options::RequestOptions::default(),
735 }
736 }
737 }
738
739 #[derive(Clone, Debug)]
761 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
762
763 impl ListServices {
764 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
765 Self(RequestBuilder::new(stub))
766 }
767
768 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
770 self.0.request = v.into();
771 self
772 }
773
774 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
776 self.0.options = v.into();
777 self
778 }
779
780 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
782 (*self.0.stub)
783 .list_services(self.0.request, self.0.options)
784 .await
785 .map(gax::response::Response::into_body)
786 }
787
788 pub fn by_page(
790 self,
791 ) -> impl gax::paginator::Paginator<crate::model::ListServicesResponse, gax::error::Error>
792 {
793 use std::clone::Clone;
794 let token = self.0.request.page_token.clone();
795 let execute = move |token: String| {
796 let mut builder = self.clone();
797 builder.0.request = builder.0.request.set_page_token(token);
798 builder.send()
799 };
800 gax::paginator::internal::new_paginator(token, execute)
801 }
802
803 pub fn by_item(
805 self,
806 ) -> impl gax::paginator::ItemPaginator<crate::model::ListServicesResponse, gax::error::Error>
807 {
808 use gax::paginator::Paginator;
809 self.by_page().items()
810 }
811
812 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
814 self.0.request.parent = v.into();
815 self
816 }
817
818 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
820 self.0.request.page_size = v.into();
821 self
822 }
823
824 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
826 self.0.request.page_token = v.into();
827 self
828 }
829 }
830
831 #[doc(hidden)]
832 impl gax::options::internal::RequestBuilder for ListServices {
833 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
834 &mut self.0.options
835 }
836 }
837
838 #[derive(Clone, Debug)]
856 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
857
858 impl GetService {
859 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
860 Self(RequestBuilder::new(stub))
861 }
862
863 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
865 self.0.request = v.into();
866 self
867 }
868
869 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
871 self.0.options = v.into();
872 self
873 }
874
875 pub async fn send(self) -> Result<crate::model::Service> {
877 (*self.0.stub)
878 .get_service(self.0.request, self.0.options)
879 .await
880 .map(gax::response::Response::into_body)
881 }
882
883 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
885 self.0.request.name = v.into();
886 self
887 }
888 }
889
890 #[doc(hidden)]
891 impl gax::options::internal::RequestBuilder for GetService {
892 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
893 &mut self.0.options
894 }
895 }
896
897 #[derive(Clone, Debug)]
916 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
917
918 impl UpdateService {
919 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
920 Self(RequestBuilder::new(stub))
921 }
922
923 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
925 self.0.request = v.into();
926 self
927 }
928
929 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
931 self.0.options = v.into();
932 self
933 }
934
935 pub async fn send(self) -> Result<longrunning::model::Operation> {
942 (*self.0.stub)
943 .update_service(self.0.request, self.0.options)
944 .await
945 .map(gax::response::Response::into_body)
946 }
947
948 pub fn poller(
950 self,
951 ) -> impl lro::Poller<crate::model::Service, crate::model::OperationMetadataV1> {
952 type Operation =
953 lro::internal::Operation<crate::model::Service, crate::model::OperationMetadataV1>;
954 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
955 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
956
957 let stub = self.0.stub.clone();
958 let mut options = self.0.options.clone();
959 options.set_retry_policy(gax::retry_policy::NeverRetry);
960 let query = move |name| {
961 let stub = stub.clone();
962 let options = options.clone();
963 async {
964 let op = GetOperation::new(stub)
965 .set_name(name)
966 .with_options(options)
967 .send()
968 .await?;
969 Ok(Operation::new(op))
970 }
971 };
972
973 let start = move || async {
974 let op = self.send().await?;
975 Ok(Operation::new(op))
976 };
977
978 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
979 }
980
981 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
983 self.0.request.name = v.into();
984 self
985 }
986
987 pub fn set_service<T>(mut self, v: T) -> Self
989 where
990 T: std::convert::Into<crate::model::Service>,
991 {
992 self.0.request.service = std::option::Option::Some(v.into());
993 self
994 }
995
996 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
998 where
999 T: std::convert::Into<crate::model::Service>,
1000 {
1001 self.0.request.service = v.map(|x| x.into());
1002 self
1003 }
1004
1005 pub fn set_update_mask<T>(mut self, v: T) -> Self
1007 where
1008 T: std::convert::Into<wkt::FieldMask>,
1009 {
1010 self.0.request.update_mask = std::option::Option::Some(v.into());
1011 self
1012 }
1013
1014 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1016 where
1017 T: std::convert::Into<wkt::FieldMask>,
1018 {
1019 self.0.request.update_mask = v.map(|x| x.into());
1020 self
1021 }
1022
1023 pub fn set_migrate_traffic<T: Into<bool>>(mut self, v: T) -> Self {
1025 self.0.request.migrate_traffic = v.into();
1026 self
1027 }
1028 }
1029
1030 #[doc(hidden)]
1031 impl gax::options::internal::RequestBuilder for UpdateService {
1032 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1033 &mut self.0.options
1034 }
1035 }
1036
1037 #[derive(Clone, Debug)]
1056 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1057
1058 impl DeleteService {
1059 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1060 Self(RequestBuilder::new(stub))
1061 }
1062
1063 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1065 self.0.request = v.into();
1066 self
1067 }
1068
1069 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1071 self.0.options = v.into();
1072 self
1073 }
1074
1075 pub async fn send(self) -> Result<longrunning::model::Operation> {
1082 (*self.0.stub)
1083 .delete_service(self.0.request, self.0.options)
1084 .await
1085 .map(gax::response::Response::into_body)
1086 }
1087
1088 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
1090 type Operation =
1091 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
1092 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1093 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1094
1095 let stub = self.0.stub.clone();
1096 let mut options = self.0.options.clone();
1097 options.set_retry_policy(gax::retry_policy::NeverRetry);
1098 let query = move |name| {
1099 let stub = stub.clone();
1100 let options = options.clone();
1101 async {
1102 let op = GetOperation::new(stub)
1103 .set_name(name)
1104 .with_options(options)
1105 .send()
1106 .await?;
1107 Ok(Operation::new(op))
1108 }
1109 };
1110
1111 let start = move || async {
1112 let op = self.send().await?;
1113 Ok(Operation::new(op))
1114 };
1115
1116 lro::internal::new_unit_response_poller(
1117 polling_error_policy,
1118 polling_backoff_policy,
1119 start,
1120 query,
1121 )
1122 }
1123
1124 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1126 self.0.request.name = v.into();
1127 self
1128 }
1129 }
1130
1131 #[doc(hidden)]
1132 impl gax::options::internal::RequestBuilder for DeleteService {
1133 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1134 &mut self.0.options
1135 }
1136 }
1137
1138 #[derive(Clone, Debug)]
1160 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1161
1162 impl ListOperations {
1163 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1164 Self(RequestBuilder::new(stub))
1165 }
1166
1167 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1169 mut self,
1170 v: V,
1171 ) -> Self {
1172 self.0.request = v.into();
1173 self
1174 }
1175
1176 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1178 self.0.options = v.into();
1179 self
1180 }
1181
1182 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1184 (*self.0.stub)
1185 .list_operations(self.0.request, self.0.options)
1186 .await
1187 .map(gax::response::Response::into_body)
1188 }
1189
1190 pub fn by_page(
1192 self,
1193 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1194 {
1195 use std::clone::Clone;
1196 let token = self.0.request.page_token.clone();
1197 let execute = move |token: String| {
1198 let mut builder = self.clone();
1199 builder.0.request = builder.0.request.set_page_token(token);
1200 builder.send()
1201 };
1202 gax::paginator::internal::new_paginator(token, execute)
1203 }
1204
1205 pub fn by_item(
1207 self,
1208 ) -> impl gax::paginator::ItemPaginator<
1209 longrunning::model::ListOperationsResponse,
1210 gax::error::Error,
1211 > {
1212 use gax::paginator::Paginator;
1213 self.by_page().items()
1214 }
1215
1216 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1218 self.0.request.name = v.into();
1219 self
1220 }
1221
1222 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1224 self.0.request.filter = v.into();
1225 self
1226 }
1227
1228 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1230 self.0.request.page_size = v.into();
1231 self
1232 }
1233
1234 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1236 self.0.request.page_token = v.into();
1237 self
1238 }
1239
1240 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1242 self.0.request.return_partial_success = v.into();
1243 self
1244 }
1245 }
1246
1247 #[doc(hidden)]
1248 impl gax::options::internal::RequestBuilder for ListOperations {
1249 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1250 &mut self.0.options
1251 }
1252 }
1253
1254 #[derive(Clone, Debug)]
1272 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1273
1274 impl GetOperation {
1275 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1276 Self(RequestBuilder::new(stub))
1277 }
1278
1279 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1281 mut self,
1282 v: V,
1283 ) -> Self {
1284 self.0.request = v.into();
1285 self
1286 }
1287
1288 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1290 self.0.options = v.into();
1291 self
1292 }
1293
1294 pub async fn send(self) -> Result<longrunning::model::Operation> {
1296 (*self.0.stub)
1297 .get_operation(self.0.request, self.0.options)
1298 .await
1299 .map(gax::response::Response::into_body)
1300 }
1301
1302 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1304 self.0.request.name = v.into();
1305 self
1306 }
1307 }
1308
1309 #[doc(hidden)]
1310 impl gax::options::internal::RequestBuilder for GetOperation {
1311 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1312 &mut self.0.options
1313 }
1314 }
1315}
1316
1317pub mod versions {
1318 use crate::Result;
1319
1320 pub type ClientBuilder =
1334 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1335
1336 pub(crate) mod client {
1337 use super::super::super::client::Versions;
1338 pub struct Factory;
1339 impl gax::client_builder::internal::ClientFactory for Factory {
1340 type Client = Versions;
1341 type Credentials = gaxi::options::Credentials;
1342 async fn build(
1343 self,
1344 config: gaxi::options::ClientConfig,
1345 ) -> gax::client_builder::Result<Self::Client> {
1346 Self::Client::new(config).await
1347 }
1348 }
1349 }
1350
1351 #[derive(Clone, Debug)]
1353 pub(crate) struct RequestBuilder<R: std::default::Default> {
1354 stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
1355 request: R,
1356 options: gax::options::RequestOptions,
1357 }
1358
1359 impl<R> RequestBuilder<R>
1360 where
1361 R: std::default::Default,
1362 {
1363 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1364 Self {
1365 stub,
1366 request: R::default(),
1367 options: gax::options::RequestOptions::default(),
1368 }
1369 }
1370 }
1371
1372 #[derive(Clone, Debug)]
1394 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
1395
1396 impl ListVersions {
1397 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1398 Self(RequestBuilder::new(stub))
1399 }
1400
1401 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
1403 self.0.request = v.into();
1404 self
1405 }
1406
1407 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1409 self.0.options = v.into();
1410 self
1411 }
1412
1413 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
1415 (*self.0.stub)
1416 .list_versions(self.0.request, self.0.options)
1417 .await
1418 .map(gax::response::Response::into_body)
1419 }
1420
1421 pub fn by_page(
1423 self,
1424 ) -> impl gax::paginator::Paginator<crate::model::ListVersionsResponse, gax::error::Error>
1425 {
1426 use std::clone::Clone;
1427 let token = self.0.request.page_token.clone();
1428 let execute = move |token: String| {
1429 let mut builder = self.clone();
1430 builder.0.request = builder.0.request.set_page_token(token);
1431 builder.send()
1432 };
1433 gax::paginator::internal::new_paginator(token, execute)
1434 }
1435
1436 pub fn by_item(
1438 self,
1439 ) -> impl gax::paginator::ItemPaginator<crate::model::ListVersionsResponse, gax::error::Error>
1440 {
1441 use gax::paginator::Paginator;
1442 self.by_page().items()
1443 }
1444
1445 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1447 self.0.request.parent = v.into();
1448 self
1449 }
1450
1451 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1453 self.0.request.view = v.into();
1454 self
1455 }
1456
1457 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1459 self.0.request.page_size = v.into();
1460 self
1461 }
1462
1463 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1465 self.0.request.page_token = v.into();
1466 self
1467 }
1468 }
1469
1470 #[doc(hidden)]
1471 impl gax::options::internal::RequestBuilder for ListVersions {
1472 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1473 &mut self.0.options
1474 }
1475 }
1476
1477 #[derive(Clone, Debug)]
1495 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
1496
1497 impl GetVersion {
1498 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1499 Self(RequestBuilder::new(stub))
1500 }
1501
1502 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
1504 self.0.request = v.into();
1505 self
1506 }
1507
1508 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1510 self.0.options = v.into();
1511 self
1512 }
1513
1514 pub async fn send(self) -> Result<crate::model::Version> {
1516 (*self.0.stub)
1517 .get_version(self.0.request, self.0.options)
1518 .await
1519 .map(gax::response::Response::into_body)
1520 }
1521
1522 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1524 self.0.request.name = v.into();
1525 self
1526 }
1527
1528 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1530 self.0.request.view = v.into();
1531 self
1532 }
1533 }
1534
1535 #[doc(hidden)]
1536 impl gax::options::internal::RequestBuilder for GetVersion {
1537 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1538 &mut self.0.options
1539 }
1540 }
1541
1542 #[derive(Clone, Debug)]
1561 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
1562
1563 impl CreateVersion {
1564 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1565 Self(RequestBuilder::new(stub))
1566 }
1567
1568 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
1570 self.0.request = v.into();
1571 self
1572 }
1573
1574 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1576 self.0.options = v.into();
1577 self
1578 }
1579
1580 pub async fn send(self) -> Result<longrunning::model::Operation> {
1587 (*self.0.stub)
1588 .create_version(self.0.request, self.0.options)
1589 .await
1590 .map(gax::response::Response::into_body)
1591 }
1592
1593 pub fn poller(
1595 self,
1596 ) -> impl lro::Poller<crate::model::Version, crate::model::CreateVersionMetadataV1>
1597 {
1598 type Operation = lro::internal::Operation<
1599 crate::model::Version,
1600 crate::model::CreateVersionMetadataV1,
1601 >;
1602 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1603 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1604
1605 let stub = self.0.stub.clone();
1606 let mut options = self.0.options.clone();
1607 options.set_retry_policy(gax::retry_policy::NeverRetry);
1608 let query = move |name| {
1609 let stub = stub.clone();
1610 let options = options.clone();
1611 async {
1612 let op = GetOperation::new(stub)
1613 .set_name(name)
1614 .with_options(options)
1615 .send()
1616 .await?;
1617 Ok(Operation::new(op))
1618 }
1619 };
1620
1621 let start = move || async {
1622 let op = self.send().await?;
1623 Ok(Operation::new(op))
1624 };
1625
1626 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1627 }
1628
1629 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1631 self.0.request.parent = v.into();
1632 self
1633 }
1634
1635 pub fn set_version<T>(mut self, v: T) -> Self
1637 where
1638 T: std::convert::Into<crate::model::Version>,
1639 {
1640 self.0.request.version = std::option::Option::Some(v.into());
1641 self
1642 }
1643
1644 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1646 where
1647 T: std::convert::Into<crate::model::Version>,
1648 {
1649 self.0.request.version = v.map(|x| x.into());
1650 self
1651 }
1652 }
1653
1654 #[doc(hidden)]
1655 impl gax::options::internal::RequestBuilder for CreateVersion {
1656 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1657 &mut self.0.options
1658 }
1659 }
1660
1661 #[derive(Clone, Debug)]
1680 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
1681
1682 impl UpdateVersion {
1683 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1684 Self(RequestBuilder::new(stub))
1685 }
1686
1687 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
1689 self.0.request = v.into();
1690 self
1691 }
1692
1693 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1695 self.0.options = v.into();
1696 self
1697 }
1698
1699 pub async fn send(self) -> Result<longrunning::model::Operation> {
1706 (*self.0.stub)
1707 .update_version(self.0.request, self.0.options)
1708 .await
1709 .map(gax::response::Response::into_body)
1710 }
1711
1712 pub fn poller(
1714 self,
1715 ) -> impl lro::Poller<crate::model::Version, crate::model::OperationMetadataV1> {
1716 type Operation =
1717 lro::internal::Operation<crate::model::Version, crate::model::OperationMetadataV1>;
1718 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1719 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1720
1721 let stub = self.0.stub.clone();
1722 let mut options = self.0.options.clone();
1723 options.set_retry_policy(gax::retry_policy::NeverRetry);
1724 let query = move |name| {
1725 let stub = stub.clone();
1726 let options = options.clone();
1727 async {
1728 let op = GetOperation::new(stub)
1729 .set_name(name)
1730 .with_options(options)
1731 .send()
1732 .await?;
1733 Ok(Operation::new(op))
1734 }
1735 };
1736
1737 let start = move || async {
1738 let op = self.send().await?;
1739 Ok(Operation::new(op))
1740 };
1741
1742 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1743 }
1744
1745 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1747 self.0.request.name = v.into();
1748 self
1749 }
1750
1751 pub fn set_version<T>(mut self, v: T) -> Self
1753 where
1754 T: std::convert::Into<crate::model::Version>,
1755 {
1756 self.0.request.version = std::option::Option::Some(v.into());
1757 self
1758 }
1759
1760 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1762 where
1763 T: std::convert::Into<crate::model::Version>,
1764 {
1765 self.0.request.version = v.map(|x| x.into());
1766 self
1767 }
1768
1769 pub fn set_update_mask<T>(mut self, v: T) -> Self
1771 where
1772 T: std::convert::Into<wkt::FieldMask>,
1773 {
1774 self.0.request.update_mask = std::option::Option::Some(v.into());
1775 self
1776 }
1777
1778 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1780 where
1781 T: std::convert::Into<wkt::FieldMask>,
1782 {
1783 self.0.request.update_mask = v.map(|x| x.into());
1784 self
1785 }
1786 }
1787
1788 #[doc(hidden)]
1789 impl gax::options::internal::RequestBuilder for UpdateVersion {
1790 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1791 &mut self.0.options
1792 }
1793 }
1794
1795 #[derive(Clone, Debug)]
1814 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
1815
1816 impl DeleteVersion {
1817 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1818 Self(RequestBuilder::new(stub))
1819 }
1820
1821 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
1823 self.0.request = v.into();
1824 self
1825 }
1826
1827 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1829 self.0.options = v.into();
1830 self
1831 }
1832
1833 pub async fn send(self) -> Result<longrunning::model::Operation> {
1840 (*self.0.stub)
1841 .delete_version(self.0.request, self.0.options)
1842 .await
1843 .map(gax::response::Response::into_body)
1844 }
1845
1846 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
1848 type Operation =
1849 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
1850 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1851 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1852
1853 let stub = self.0.stub.clone();
1854 let mut options = self.0.options.clone();
1855 options.set_retry_policy(gax::retry_policy::NeverRetry);
1856 let query = move |name| {
1857 let stub = stub.clone();
1858 let options = options.clone();
1859 async {
1860 let op = GetOperation::new(stub)
1861 .set_name(name)
1862 .with_options(options)
1863 .send()
1864 .await?;
1865 Ok(Operation::new(op))
1866 }
1867 };
1868
1869 let start = move || async {
1870 let op = self.send().await?;
1871 Ok(Operation::new(op))
1872 };
1873
1874 lro::internal::new_unit_response_poller(
1875 polling_error_policy,
1876 polling_backoff_policy,
1877 start,
1878 query,
1879 )
1880 }
1881
1882 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1884 self.0.request.name = v.into();
1885 self
1886 }
1887 }
1888
1889 #[doc(hidden)]
1890 impl gax::options::internal::RequestBuilder for DeleteVersion {
1891 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1892 &mut self.0.options
1893 }
1894 }
1895
1896 #[derive(Clone, Debug)]
1918 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1919
1920 impl ListOperations {
1921 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1922 Self(RequestBuilder::new(stub))
1923 }
1924
1925 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1927 mut self,
1928 v: V,
1929 ) -> Self {
1930 self.0.request = v.into();
1931 self
1932 }
1933
1934 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1936 self.0.options = v.into();
1937 self
1938 }
1939
1940 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1942 (*self.0.stub)
1943 .list_operations(self.0.request, self.0.options)
1944 .await
1945 .map(gax::response::Response::into_body)
1946 }
1947
1948 pub fn by_page(
1950 self,
1951 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1952 {
1953 use std::clone::Clone;
1954 let token = self.0.request.page_token.clone();
1955 let execute = move |token: String| {
1956 let mut builder = self.clone();
1957 builder.0.request = builder.0.request.set_page_token(token);
1958 builder.send()
1959 };
1960 gax::paginator::internal::new_paginator(token, execute)
1961 }
1962
1963 pub fn by_item(
1965 self,
1966 ) -> impl gax::paginator::ItemPaginator<
1967 longrunning::model::ListOperationsResponse,
1968 gax::error::Error,
1969 > {
1970 use gax::paginator::Paginator;
1971 self.by_page().items()
1972 }
1973
1974 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.0.request.name = v.into();
1977 self
1978 }
1979
1980 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1982 self.0.request.filter = v.into();
1983 self
1984 }
1985
1986 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1988 self.0.request.page_size = v.into();
1989 self
1990 }
1991
1992 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1994 self.0.request.page_token = v.into();
1995 self
1996 }
1997
1998 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2000 self.0.request.return_partial_success = v.into();
2001 self
2002 }
2003 }
2004
2005 #[doc(hidden)]
2006 impl gax::options::internal::RequestBuilder for ListOperations {
2007 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2008 &mut self.0.options
2009 }
2010 }
2011
2012 #[derive(Clone, Debug)]
2030 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2031
2032 impl GetOperation {
2033 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2034 Self(RequestBuilder::new(stub))
2035 }
2036
2037 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2039 mut self,
2040 v: V,
2041 ) -> Self {
2042 self.0.request = v.into();
2043 self
2044 }
2045
2046 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2048 self.0.options = v.into();
2049 self
2050 }
2051
2052 pub async fn send(self) -> Result<longrunning::model::Operation> {
2054 (*self.0.stub)
2055 .get_operation(self.0.request, self.0.options)
2056 .await
2057 .map(gax::response::Response::into_body)
2058 }
2059
2060 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2062 self.0.request.name = v.into();
2063 self
2064 }
2065 }
2066
2067 #[doc(hidden)]
2068 impl gax::options::internal::RequestBuilder for GetOperation {
2069 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2070 &mut self.0.options
2071 }
2072 }
2073}
2074
2075pub mod instances {
2076 use crate::Result;
2077
2078 pub type ClientBuilder =
2092 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2093
2094 pub(crate) mod client {
2095 use super::super::super::client::Instances;
2096 pub struct Factory;
2097 impl gax::client_builder::internal::ClientFactory for Factory {
2098 type Client = Instances;
2099 type Credentials = gaxi::options::Credentials;
2100 async fn build(
2101 self,
2102 config: gaxi::options::ClientConfig,
2103 ) -> gax::client_builder::Result<Self::Client> {
2104 Self::Client::new(config).await
2105 }
2106 }
2107 }
2108
2109 #[derive(Clone, Debug)]
2111 pub(crate) struct RequestBuilder<R: std::default::Default> {
2112 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2113 request: R,
2114 options: gax::options::RequestOptions,
2115 }
2116
2117 impl<R> RequestBuilder<R>
2118 where
2119 R: std::default::Default,
2120 {
2121 pub(crate) fn new(
2122 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2123 ) -> Self {
2124 Self {
2125 stub,
2126 request: R::default(),
2127 options: gax::options::RequestOptions::default(),
2128 }
2129 }
2130 }
2131
2132 #[derive(Clone, Debug)]
2154 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
2155
2156 impl ListInstances {
2157 pub(crate) fn new(
2158 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2159 ) -> Self {
2160 Self(RequestBuilder::new(stub))
2161 }
2162
2163 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
2165 self.0.request = v.into();
2166 self
2167 }
2168
2169 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2171 self.0.options = v.into();
2172 self
2173 }
2174
2175 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
2177 (*self.0.stub)
2178 .list_instances(self.0.request, self.0.options)
2179 .await
2180 .map(gax::response::Response::into_body)
2181 }
2182
2183 pub fn by_page(
2185 self,
2186 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
2187 {
2188 use std::clone::Clone;
2189 let token = self.0.request.page_token.clone();
2190 let execute = move |token: String| {
2191 let mut builder = self.clone();
2192 builder.0.request = builder.0.request.set_page_token(token);
2193 builder.send()
2194 };
2195 gax::paginator::internal::new_paginator(token, execute)
2196 }
2197
2198 pub fn by_item(
2200 self,
2201 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
2202 {
2203 use gax::paginator::Paginator;
2204 self.by_page().items()
2205 }
2206
2207 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209 self.0.request.parent = v.into();
2210 self
2211 }
2212
2213 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2215 self.0.request.page_size = v.into();
2216 self
2217 }
2218
2219 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221 self.0.request.page_token = v.into();
2222 self
2223 }
2224 }
2225
2226 #[doc(hidden)]
2227 impl gax::options::internal::RequestBuilder for ListInstances {
2228 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2229 &mut self.0.options
2230 }
2231 }
2232
2233 #[derive(Clone, Debug)]
2251 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2252
2253 impl GetInstance {
2254 pub(crate) fn new(
2255 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2256 ) -> Self {
2257 Self(RequestBuilder::new(stub))
2258 }
2259
2260 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2262 self.0.request = v.into();
2263 self
2264 }
2265
2266 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2268 self.0.options = v.into();
2269 self
2270 }
2271
2272 pub async fn send(self) -> Result<crate::model::Instance> {
2274 (*self.0.stub)
2275 .get_instance(self.0.request, self.0.options)
2276 .await
2277 .map(gax::response::Response::into_body)
2278 }
2279
2280 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2282 self.0.request.name = v.into();
2283 self
2284 }
2285 }
2286
2287 #[doc(hidden)]
2288 impl gax::options::internal::RequestBuilder for GetInstance {
2289 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2290 &mut self.0.options
2291 }
2292 }
2293
2294 #[derive(Clone, Debug)]
2313 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
2314
2315 impl DeleteInstance {
2316 pub(crate) fn new(
2317 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2318 ) -> Self {
2319 Self(RequestBuilder::new(stub))
2320 }
2321
2322 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
2324 self.0.request = v.into();
2325 self
2326 }
2327
2328 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2330 self.0.options = v.into();
2331 self
2332 }
2333
2334 pub async fn send(self) -> Result<longrunning::model::Operation> {
2341 (*self.0.stub)
2342 .delete_instance(self.0.request, self.0.options)
2343 .await
2344 .map(gax::response::Response::into_body)
2345 }
2346
2347 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
2349 type Operation =
2350 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
2351 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2352 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2353
2354 let stub = self.0.stub.clone();
2355 let mut options = self.0.options.clone();
2356 options.set_retry_policy(gax::retry_policy::NeverRetry);
2357 let query = move |name| {
2358 let stub = stub.clone();
2359 let options = options.clone();
2360 async {
2361 let op = GetOperation::new(stub)
2362 .set_name(name)
2363 .with_options(options)
2364 .send()
2365 .await?;
2366 Ok(Operation::new(op))
2367 }
2368 };
2369
2370 let start = move || async {
2371 let op = self.send().await?;
2372 Ok(Operation::new(op))
2373 };
2374
2375 lro::internal::new_unit_response_poller(
2376 polling_error_policy,
2377 polling_backoff_policy,
2378 start,
2379 query,
2380 )
2381 }
2382
2383 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2385 self.0.request.name = v.into();
2386 self
2387 }
2388 }
2389
2390 #[doc(hidden)]
2391 impl gax::options::internal::RequestBuilder for DeleteInstance {
2392 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2393 &mut self.0.options
2394 }
2395 }
2396
2397 #[derive(Clone, Debug)]
2416 pub struct DebugInstance(RequestBuilder<crate::model::DebugInstanceRequest>);
2417
2418 impl DebugInstance {
2419 pub(crate) fn new(
2420 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2421 ) -> Self {
2422 Self(RequestBuilder::new(stub))
2423 }
2424
2425 pub fn with_request<V: Into<crate::model::DebugInstanceRequest>>(mut self, v: V) -> Self {
2427 self.0.request = v.into();
2428 self
2429 }
2430
2431 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2433 self.0.options = v.into();
2434 self
2435 }
2436
2437 pub async fn send(self) -> Result<longrunning::model::Operation> {
2444 (*self.0.stub)
2445 .debug_instance(self.0.request, self.0.options)
2446 .await
2447 .map(gax::response::Response::into_body)
2448 }
2449
2450 pub fn poller(
2452 self,
2453 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadataV1> {
2454 type Operation =
2455 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadataV1>;
2456 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2457 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2458
2459 let stub = self.0.stub.clone();
2460 let mut options = self.0.options.clone();
2461 options.set_retry_policy(gax::retry_policy::NeverRetry);
2462 let query = move |name| {
2463 let stub = stub.clone();
2464 let options = options.clone();
2465 async {
2466 let op = GetOperation::new(stub)
2467 .set_name(name)
2468 .with_options(options)
2469 .send()
2470 .await?;
2471 Ok(Operation::new(op))
2472 }
2473 };
2474
2475 let start = move || async {
2476 let op = self.send().await?;
2477 Ok(Operation::new(op))
2478 };
2479
2480 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2481 }
2482
2483 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2485 self.0.request.name = v.into();
2486 self
2487 }
2488
2489 pub fn set_ssh_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
2491 self.0.request.ssh_key = v.into();
2492 self
2493 }
2494 }
2495
2496 #[doc(hidden)]
2497 impl gax::options::internal::RequestBuilder for DebugInstance {
2498 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2499 &mut self.0.options
2500 }
2501 }
2502
2503 #[derive(Clone, Debug)]
2525 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2526
2527 impl ListOperations {
2528 pub(crate) fn new(
2529 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2530 ) -> Self {
2531 Self(RequestBuilder::new(stub))
2532 }
2533
2534 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2536 mut self,
2537 v: V,
2538 ) -> Self {
2539 self.0.request = v.into();
2540 self
2541 }
2542
2543 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2545 self.0.options = v.into();
2546 self
2547 }
2548
2549 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2551 (*self.0.stub)
2552 .list_operations(self.0.request, self.0.options)
2553 .await
2554 .map(gax::response::Response::into_body)
2555 }
2556
2557 pub fn by_page(
2559 self,
2560 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2561 {
2562 use std::clone::Clone;
2563 let token = self.0.request.page_token.clone();
2564 let execute = move |token: String| {
2565 let mut builder = self.clone();
2566 builder.0.request = builder.0.request.set_page_token(token);
2567 builder.send()
2568 };
2569 gax::paginator::internal::new_paginator(token, execute)
2570 }
2571
2572 pub fn by_item(
2574 self,
2575 ) -> impl gax::paginator::ItemPaginator<
2576 longrunning::model::ListOperationsResponse,
2577 gax::error::Error,
2578 > {
2579 use gax::paginator::Paginator;
2580 self.by_page().items()
2581 }
2582
2583 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2585 self.0.request.name = v.into();
2586 self
2587 }
2588
2589 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2591 self.0.request.filter = v.into();
2592 self
2593 }
2594
2595 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2597 self.0.request.page_size = v.into();
2598 self
2599 }
2600
2601 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2603 self.0.request.page_token = v.into();
2604 self
2605 }
2606
2607 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2609 self.0.request.return_partial_success = v.into();
2610 self
2611 }
2612 }
2613
2614 #[doc(hidden)]
2615 impl gax::options::internal::RequestBuilder for ListOperations {
2616 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2617 &mut self.0.options
2618 }
2619 }
2620
2621 #[derive(Clone, Debug)]
2639 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2640
2641 impl GetOperation {
2642 pub(crate) fn new(
2643 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2644 ) -> Self {
2645 Self(RequestBuilder::new(stub))
2646 }
2647
2648 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2650 mut self,
2651 v: V,
2652 ) -> Self {
2653 self.0.request = v.into();
2654 self
2655 }
2656
2657 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2659 self.0.options = v.into();
2660 self
2661 }
2662
2663 pub async fn send(self) -> Result<longrunning::model::Operation> {
2665 (*self.0.stub)
2666 .get_operation(self.0.request, self.0.options)
2667 .await
2668 .map(gax::response::Response::into_body)
2669 }
2670
2671 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2673 self.0.request.name = v.into();
2674 self
2675 }
2676 }
2677
2678 #[doc(hidden)]
2679 impl gax::options::internal::RequestBuilder for GetOperation {
2680 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2681 &mut self.0.options
2682 }
2683 }
2684}
2685
2686pub mod firewall {
2687 use crate::Result;
2688
2689 pub type ClientBuilder =
2703 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2704
2705 pub(crate) mod client {
2706 use super::super::super::client::Firewall;
2707 pub struct Factory;
2708 impl gax::client_builder::internal::ClientFactory for Factory {
2709 type Client = Firewall;
2710 type Credentials = gaxi::options::Credentials;
2711 async fn build(
2712 self,
2713 config: gaxi::options::ClientConfig,
2714 ) -> gax::client_builder::Result<Self::Client> {
2715 Self::Client::new(config).await
2716 }
2717 }
2718 }
2719
2720 #[derive(Clone, Debug)]
2722 pub(crate) struct RequestBuilder<R: std::default::Default> {
2723 stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>,
2724 request: R,
2725 options: gax::options::RequestOptions,
2726 }
2727
2728 impl<R> RequestBuilder<R>
2729 where
2730 R: std::default::Default,
2731 {
2732 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2733 Self {
2734 stub,
2735 request: R::default(),
2736 options: gax::options::RequestOptions::default(),
2737 }
2738 }
2739 }
2740
2741 #[derive(Clone, Debug)]
2763 pub struct ListIngressRules(RequestBuilder<crate::model::ListIngressRulesRequest>);
2764
2765 impl ListIngressRules {
2766 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2767 Self(RequestBuilder::new(stub))
2768 }
2769
2770 pub fn with_request<V: Into<crate::model::ListIngressRulesRequest>>(
2772 mut self,
2773 v: V,
2774 ) -> Self {
2775 self.0.request = v.into();
2776 self
2777 }
2778
2779 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2781 self.0.options = v.into();
2782 self
2783 }
2784
2785 pub async fn send(self) -> Result<crate::model::ListIngressRulesResponse> {
2787 (*self.0.stub)
2788 .list_ingress_rules(self.0.request, self.0.options)
2789 .await
2790 .map(gax::response::Response::into_body)
2791 }
2792
2793 pub fn by_page(
2795 self,
2796 ) -> impl gax::paginator::Paginator<crate::model::ListIngressRulesResponse, gax::error::Error>
2797 {
2798 use std::clone::Clone;
2799 let token = self.0.request.page_token.clone();
2800 let execute = move |token: String| {
2801 let mut builder = self.clone();
2802 builder.0.request = builder.0.request.set_page_token(token);
2803 builder.send()
2804 };
2805 gax::paginator::internal::new_paginator(token, execute)
2806 }
2807
2808 pub fn by_item(
2810 self,
2811 ) -> impl gax::paginator::ItemPaginator<crate::model::ListIngressRulesResponse, gax::error::Error>
2812 {
2813 use gax::paginator::Paginator;
2814 self.by_page().items()
2815 }
2816
2817 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2819 self.0.request.parent = v.into();
2820 self
2821 }
2822
2823 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2825 self.0.request.page_size = v.into();
2826 self
2827 }
2828
2829 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2831 self.0.request.page_token = v.into();
2832 self
2833 }
2834
2835 pub fn set_matching_address<T: Into<std::string::String>>(mut self, v: T) -> Self {
2837 self.0.request.matching_address = v.into();
2838 self
2839 }
2840 }
2841
2842 #[doc(hidden)]
2843 impl gax::options::internal::RequestBuilder for ListIngressRules {
2844 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2845 &mut self.0.options
2846 }
2847 }
2848
2849 #[derive(Clone, Debug)]
2867 pub struct BatchUpdateIngressRules(
2868 RequestBuilder<crate::model::BatchUpdateIngressRulesRequest>,
2869 );
2870
2871 impl BatchUpdateIngressRules {
2872 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2873 Self(RequestBuilder::new(stub))
2874 }
2875
2876 pub fn with_request<V: Into<crate::model::BatchUpdateIngressRulesRequest>>(
2878 mut self,
2879 v: V,
2880 ) -> Self {
2881 self.0.request = v.into();
2882 self
2883 }
2884
2885 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2887 self.0.options = v.into();
2888 self
2889 }
2890
2891 pub async fn send(self) -> Result<crate::model::BatchUpdateIngressRulesResponse> {
2893 (*self.0.stub)
2894 .batch_update_ingress_rules(self.0.request, self.0.options)
2895 .await
2896 .map(gax::response::Response::into_body)
2897 }
2898
2899 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2901 self.0.request.name = v.into();
2902 self
2903 }
2904
2905 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
2907 where
2908 T: std::iter::IntoIterator<Item = V>,
2909 V: std::convert::Into<crate::model::FirewallRule>,
2910 {
2911 use std::iter::Iterator;
2912 self.0.request.ingress_rules = v.into_iter().map(|i| i.into()).collect();
2913 self
2914 }
2915 }
2916
2917 #[doc(hidden)]
2918 impl gax::options::internal::RequestBuilder for BatchUpdateIngressRules {
2919 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2920 &mut self.0.options
2921 }
2922 }
2923
2924 #[derive(Clone, Debug)]
2942 pub struct CreateIngressRule(RequestBuilder<crate::model::CreateIngressRuleRequest>);
2943
2944 impl CreateIngressRule {
2945 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2946 Self(RequestBuilder::new(stub))
2947 }
2948
2949 pub fn with_request<V: Into<crate::model::CreateIngressRuleRequest>>(
2951 mut self,
2952 v: V,
2953 ) -> Self {
2954 self.0.request = v.into();
2955 self
2956 }
2957
2958 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2960 self.0.options = v.into();
2961 self
2962 }
2963
2964 pub async fn send(self) -> Result<crate::model::FirewallRule> {
2966 (*self.0.stub)
2967 .create_ingress_rule(self.0.request, self.0.options)
2968 .await
2969 .map(gax::response::Response::into_body)
2970 }
2971
2972 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.0.request.parent = v.into();
2975 self
2976 }
2977
2978 pub fn set_rule<T>(mut self, v: T) -> Self
2980 where
2981 T: std::convert::Into<crate::model::FirewallRule>,
2982 {
2983 self.0.request.rule = std::option::Option::Some(v.into());
2984 self
2985 }
2986
2987 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
2989 where
2990 T: std::convert::Into<crate::model::FirewallRule>,
2991 {
2992 self.0.request.rule = v.map(|x| x.into());
2993 self
2994 }
2995 }
2996
2997 #[doc(hidden)]
2998 impl gax::options::internal::RequestBuilder for CreateIngressRule {
2999 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3000 &mut self.0.options
3001 }
3002 }
3003
3004 #[derive(Clone, Debug)]
3022 pub struct GetIngressRule(RequestBuilder<crate::model::GetIngressRuleRequest>);
3023
3024 impl GetIngressRule {
3025 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3026 Self(RequestBuilder::new(stub))
3027 }
3028
3029 pub fn with_request<V: Into<crate::model::GetIngressRuleRequest>>(mut self, v: V) -> Self {
3031 self.0.request = v.into();
3032 self
3033 }
3034
3035 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3037 self.0.options = v.into();
3038 self
3039 }
3040
3041 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3043 (*self.0.stub)
3044 .get_ingress_rule(self.0.request, self.0.options)
3045 .await
3046 .map(gax::response::Response::into_body)
3047 }
3048
3049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3051 self.0.request.name = v.into();
3052 self
3053 }
3054 }
3055
3056 #[doc(hidden)]
3057 impl gax::options::internal::RequestBuilder for GetIngressRule {
3058 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3059 &mut self.0.options
3060 }
3061 }
3062
3063 #[derive(Clone, Debug)]
3081 pub struct UpdateIngressRule(RequestBuilder<crate::model::UpdateIngressRuleRequest>);
3082
3083 impl UpdateIngressRule {
3084 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3085 Self(RequestBuilder::new(stub))
3086 }
3087
3088 pub fn with_request<V: Into<crate::model::UpdateIngressRuleRequest>>(
3090 mut self,
3091 v: V,
3092 ) -> Self {
3093 self.0.request = v.into();
3094 self
3095 }
3096
3097 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3099 self.0.options = v.into();
3100 self
3101 }
3102
3103 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3105 (*self.0.stub)
3106 .update_ingress_rule(self.0.request, self.0.options)
3107 .await
3108 .map(gax::response::Response::into_body)
3109 }
3110
3111 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3113 self.0.request.name = v.into();
3114 self
3115 }
3116
3117 pub fn set_rule<T>(mut self, v: T) -> Self
3119 where
3120 T: std::convert::Into<crate::model::FirewallRule>,
3121 {
3122 self.0.request.rule = std::option::Option::Some(v.into());
3123 self
3124 }
3125
3126 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3128 where
3129 T: std::convert::Into<crate::model::FirewallRule>,
3130 {
3131 self.0.request.rule = v.map(|x| x.into());
3132 self
3133 }
3134
3135 pub fn set_update_mask<T>(mut self, v: T) -> Self
3137 where
3138 T: std::convert::Into<wkt::FieldMask>,
3139 {
3140 self.0.request.update_mask = std::option::Option::Some(v.into());
3141 self
3142 }
3143
3144 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3146 where
3147 T: std::convert::Into<wkt::FieldMask>,
3148 {
3149 self.0.request.update_mask = v.map(|x| x.into());
3150 self
3151 }
3152 }
3153
3154 #[doc(hidden)]
3155 impl gax::options::internal::RequestBuilder for UpdateIngressRule {
3156 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3157 &mut self.0.options
3158 }
3159 }
3160
3161 #[derive(Clone, Debug)]
3179 pub struct DeleteIngressRule(RequestBuilder<crate::model::DeleteIngressRuleRequest>);
3180
3181 impl DeleteIngressRule {
3182 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3183 Self(RequestBuilder::new(stub))
3184 }
3185
3186 pub fn with_request<V: Into<crate::model::DeleteIngressRuleRequest>>(
3188 mut self,
3189 v: V,
3190 ) -> Self {
3191 self.0.request = v.into();
3192 self
3193 }
3194
3195 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3197 self.0.options = v.into();
3198 self
3199 }
3200
3201 pub async fn send(self) -> Result<()> {
3203 (*self.0.stub)
3204 .delete_ingress_rule(self.0.request, self.0.options)
3205 .await
3206 .map(gax::response::Response::into_body)
3207 }
3208
3209 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3211 self.0.request.name = v.into();
3212 self
3213 }
3214 }
3215
3216 #[doc(hidden)]
3217 impl gax::options::internal::RequestBuilder for DeleteIngressRule {
3218 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3219 &mut self.0.options
3220 }
3221 }
3222
3223 #[derive(Clone, Debug)]
3245 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3246
3247 impl ListOperations {
3248 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3249 Self(RequestBuilder::new(stub))
3250 }
3251
3252 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3254 mut self,
3255 v: V,
3256 ) -> Self {
3257 self.0.request = v.into();
3258 self
3259 }
3260
3261 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3263 self.0.options = v.into();
3264 self
3265 }
3266
3267 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3269 (*self.0.stub)
3270 .list_operations(self.0.request, self.0.options)
3271 .await
3272 .map(gax::response::Response::into_body)
3273 }
3274
3275 pub fn by_page(
3277 self,
3278 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3279 {
3280 use std::clone::Clone;
3281 let token = self.0.request.page_token.clone();
3282 let execute = move |token: String| {
3283 let mut builder = self.clone();
3284 builder.0.request = builder.0.request.set_page_token(token);
3285 builder.send()
3286 };
3287 gax::paginator::internal::new_paginator(token, execute)
3288 }
3289
3290 pub fn by_item(
3292 self,
3293 ) -> impl gax::paginator::ItemPaginator<
3294 longrunning::model::ListOperationsResponse,
3295 gax::error::Error,
3296 > {
3297 use gax::paginator::Paginator;
3298 self.by_page().items()
3299 }
3300
3301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3303 self.0.request.name = v.into();
3304 self
3305 }
3306
3307 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3309 self.0.request.filter = v.into();
3310 self
3311 }
3312
3313 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3315 self.0.request.page_size = v.into();
3316 self
3317 }
3318
3319 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3321 self.0.request.page_token = v.into();
3322 self
3323 }
3324
3325 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3327 self.0.request.return_partial_success = v.into();
3328 self
3329 }
3330 }
3331
3332 #[doc(hidden)]
3333 impl gax::options::internal::RequestBuilder for ListOperations {
3334 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3335 &mut self.0.options
3336 }
3337 }
3338
3339 #[derive(Clone, Debug)]
3357 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3358
3359 impl GetOperation {
3360 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3361 Self(RequestBuilder::new(stub))
3362 }
3363
3364 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3366 mut self,
3367 v: V,
3368 ) -> Self {
3369 self.0.request = v.into();
3370 self
3371 }
3372
3373 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3375 self.0.options = v.into();
3376 self
3377 }
3378
3379 pub async fn send(self) -> Result<longrunning::model::Operation> {
3381 (*self.0.stub)
3382 .get_operation(self.0.request, self.0.options)
3383 .await
3384 .map(gax::response::Response::into_body)
3385 }
3386
3387 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3389 self.0.request.name = v.into();
3390 self
3391 }
3392 }
3393
3394 #[doc(hidden)]
3395 impl gax::options::internal::RequestBuilder for GetOperation {
3396 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3397 &mut self.0.options
3398 }
3399 }
3400}
3401
3402pub mod authorized_domains {
3403 use crate::Result;
3404
3405 pub type ClientBuilder =
3419 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3420
3421 pub(crate) mod client {
3422 use super::super::super::client::AuthorizedDomains;
3423 pub struct Factory;
3424 impl gax::client_builder::internal::ClientFactory for Factory {
3425 type Client = AuthorizedDomains;
3426 type Credentials = gaxi::options::Credentials;
3427 async fn build(
3428 self,
3429 config: gaxi::options::ClientConfig,
3430 ) -> gax::client_builder::Result<Self::Client> {
3431 Self::Client::new(config).await
3432 }
3433 }
3434 }
3435
3436 #[derive(Clone, Debug)]
3438 pub(crate) struct RequestBuilder<R: std::default::Default> {
3439 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3440 request: R,
3441 options: gax::options::RequestOptions,
3442 }
3443
3444 impl<R> RequestBuilder<R>
3445 where
3446 R: std::default::Default,
3447 {
3448 pub(crate) fn new(
3449 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3450 ) -> Self {
3451 Self {
3452 stub,
3453 request: R::default(),
3454 options: gax::options::RequestOptions::default(),
3455 }
3456 }
3457 }
3458
3459 #[derive(Clone, Debug)]
3481 pub struct ListAuthorizedDomains(RequestBuilder<crate::model::ListAuthorizedDomainsRequest>);
3482
3483 impl ListAuthorizedDomains {
3484 pub(crate) fn new(
3485 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3486 ) -> Self {
3487 Self(RequestBuilder::new(stub))
3488 }
3489
3490 pub fn with_request<V: Into<crate::model::ListAuthorizedDomainsRequest>>(
3492 mut self,
3493 v: V,
3494 ) -> Self {
3495 self.0.request = v.into();
3496 self
3497 }
3498
3499 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3501 self.0.options = v.into();
3502 self
3503 }
3504
3505 pub async fn send(self) -> Result<crate::model::ListAuthorizedDomainsResponse> {
3507 (*self.0.stub)
3508 .list_authorized_domains(self.0.request, self.0.options)
3509 .await
3510 .map(gax::response::Response::into_body)
3511 }
3512
3513 pub fn by_page(
3515 self,
3516 ) -> impl gax::paginator::Paginator<crate::model::ListAuthorizedDomainsResponse, gax::error::Error>
3517 {
3518 use std::clone::Clone;
3519 let token = self.0.request.page_token.clone();
3520 let execute = move |token: String| {
3521 let mut builder = self.clone();
3522 builder.0.request = builder.0.request.set_page_token(token);
3523 builder.send()
3524 };
3525 gax::paginator::internal::new_paginator(token, execute)
3526 }
3527
3528 pub fn by_item(
3530 self,
3531 ) -> impl gax::paginator::ItemPaginator<
3532 crate::model::ListAuthorizedDomainsResponse,
3533 gax::error::Error,
3534 > {
3535 use gax::paginator::Paginator;
3536 self.by_page().items()
3537 }
3538
3539 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3541 self.0.request.parent = v.into();
3542 self
3543 }
3544
3545 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3547 self.0.request.page_size = v.into();
3548 self
3549 }
3550
3551 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3553 self.0.request.page_token = v.into();
3554 self
3555 }
3556 }
3557
3558 #[doc(hidden)]
3559 impl gax::options::internal::RequestBuilder for ListAuthorizedDomains {
3560 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3561 &mut self.0.options
3562 }
3563 }
3564
3565 #[derive(Clone, Debug)]
3587 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3588
3589 impl ListOperations {
3590 pub(crate) fn new(
3591 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3592 ) -> Self {
3593 Self(RequestBuilder::new(stub))
3594 }
3595
3596 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3598 mut self,
3599 v: V,
3600 ) -> Self {
3601 self.0.request = v.into();
3602 self
3603 }
3604
3605 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3607 self.0.options = v.into();
3608 self
3609 }
3610
3611 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3613 (*self.0.stub)
3614 .list_operations(self.0.request, self.0.options)
3615 .await
3616 .map(gax::response::Response::into_body)
3617 }
3618
3619 pub fn by_page(
3621 self,
3622 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3623 {
3624 use std::clone::Clone;
3625 let token = self.0.request.page_token.clone();
3626 let execute = move |token: String| {
3627 let mut builder = self.clone();
3628 builder.0.request = builder.0.request.set_page_token(token);
3629 builder.send()
3630 };
3631 gax::paginator::internal::new_paginator(token, execute)
3632 }
3633
3634 pub fn by_item(
3636 self,
3637 ) -> impl gax::paginator::ItemPaginator<
3638 longrunning::model::ListOperationsResponse,
3639 gax::error::Error,
3640 > {
3641 use gax::paginator::Paginator;
3642 self.by_page().items()
3643 }
3644
3645 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3647 self.0.request.name = v.into();
3648 self
3649 }
3650
3651 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3653 self.0.request.filter = v.into();
3654 self
3655 }
3656
3657 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3659 self.0.request.page_size = v.into();
3660 self
3661 }
3662
3663 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3665 self.0.request.page_token = v.into();
3666 self
3667 }
3668
3669 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3671 self.0.request.return_partial_success = v.into();
3672 self
3673 }
3674 }
3675
3676 #[doc(hidden)]
3677 impl gax::options::internal::RequestBuilder for ListOperations {
3678 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3679 &mut self.0.options
3680 }
3681 }
3682
3683 #[derive(Clone, Debug)]
3701 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3702
3703 impl GetOperation {
3704 pub(crate) fn new(
3705 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3706 ) -> Self {
3707 Self(RequestBuilder::new(stub))
3708 }
3709
3710 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3712 mut self,
3713 v: V,
3714 ) -> Self {
3715 self.0.request = v.into();
3716 self
3717 }
3718
3719 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3721 self.0.options = v.into();
3722 self
3723 }
3724
3725 pub async fn send(self) -> Result<longrunning::model::Operation> {
3727 (*self.0.stub)
3728 .get_operation(self.0.request, self.0.options)
3729 .await
3730 .map(gax::response::Response::into_body)
3731 }
3732
3733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3735 self.0.request.name = v.into();
3736 self
3737 }
3738 }
3739
3740 #[doc(hidden)]
3741 impl gax::options::internal::RequestBuilder for GetOperation {
3742 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3743 &mut self.0.options
3744 }
3745 }
3746}
3747
3748pub mod authorized_certificates {
3749 use crate::Result;
3750
3751 pub type ClientBuilder =
3765 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3766
3767 pub(crate) mod client {
3768 use super::super::super::client::AuthorizedCertificates;
3769 pub struct Factory;
3770 impl gax::client_builder::internal::ClientFactory for Factory {
3771 type Client = AuthorizedCertificates;
3772 type Credentials = gaxi::options::Credentials;
3773 async fn build(
3774 self,
3775 config: gaxi::options::ClientConfig,
3776 ) -> gax::client_builder::Result<Self::Client> {
3777 Self::Client::new(config).await
3778 }
3779 }
3780 }
3781
3782 #[derive(Clone, Debug)]
3784 pub(crate) struct RequestBuilder<R: std::default::Default> {
3785 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3786 request: R,
3787 options: gax::options::RequestOptions,
3788 }
3789
3790 impl<R> RequestBuilder<R>
3791 where
3792 R: std::default::Default,
3793 {
3794 pub(crate) fn new(
3795 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3796 ) -> Self {
3797 Self {
3798 stub,
3799 request: R::default(),
3800 options: gax::options::RequestOptions::default(),
3801 }
3802 }
3803 }
3804
3805 #[derive(Clone, Debug)]
3827 pub struct ListAuthorizedCertificates(
3828 RequestBuilder<crate::model::ListAuthorizedCertificatesRequest>,
3829 );
3830
3831 impl ListAuthorizedCertificates {
3832 pub(crate) fn new(
3833 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3834 ) -> Self {
3835 Self(RequestBuilder::new(stub))
3836 }
3837
3838 pub fn with_request<V: Into<crate::model::ListAuthorizedCertificatesRequest>>(
3840 mut self,
3841 v: V,
3842 ) -> Self {
3843 self.0.request = v.into();
3844 self
3845 }
3846
3847 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3849 self.0.options = v.into();
3850 self
3851 }
3852
3853 pub async fn send(self) -> Result<crate::model::ListAuthorizedCertificatesResponse> {
3855 (*self.0.stub)
3856 .list_authorized_certificates(self.0.request, self.0.options)
3857 .await
3858 .map(gax::response::Response::into_body)
3859 }
3860
3861 pub fn by_page(
3863 self,
3864 ) -> impl gax::paginator::Paginator<
3865 crate::model::ListAuthorizedCertificatesResponse,
3866 gax::error::Error,
3867 > {
3868 use std::clone::Clone;
3869 let token = self.0.request.page_token.clone();
3870 let execute = move |token: String| {
3871 let mut builder = self.clone();
3872 builder.0.request = builder.0.request.set_page_token(token);
3873 builder.send()
3874 };
3875 gax::paginator::internal::new_paginator(token, execute)
3876 }
3877
3878 pub fn by_item(
3880 self,
3881 ) -> impl gax::paginator::ItemPaginator<
3882 crate::model::ListAuthorizedCertificatesResponse,
3883 gax::error::Error,
3884 > {
3885 use gax::paginator::Paginator;
3886 self.by_page().items()
3887 }
3888
3889 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3891 self.0.request.parent = v.into();
3892 self
3893 }
3894
3895 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
3897 self.0.request.view = v.into();
3898 self
3899 }
3900
3901 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3903 self.0.request.page_size = v.into();
3904 self
3905 }
3906
3907 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3909 self.0.request.page_token = v.into();
3910 self
3911 }
3912 }
3913
3914 #[doc(hidden)]
3915 impl gax::options::internal::RequestBuilder for ListAuthorizedCertificates {
3916 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3917 &mut self.0.options
3918 }
3919 }
3920
3921 #[derive(Clone, Debug)]
3939 pub struct GetAuthorizedCertificate(
3940 RequestBuilder<crate::model::GetAuthorizedCertificateRequest>,
3941 );
3942
3943 impl GetAuthorizedCertificate {
3944 pub(crate) fn new(
3945 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3946 ) -> Self {
3947 Self(RequestBuilder::new(stub))
3948 }
3949
3950 pub fn with_request<V: Into<crate::model::GetAuthorizedCertificateRequest>>(
3952 mut self,
3953 v: V,
3954 ) -> Self {
3955 self.0.request = v.into();
3956 self
3957 }
3958
3959 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3961 self.0.options = v.into();
3962 self
3963 }
3964
3965 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
3967 (*self.0.stub)
3968 .get_authorized_certificate(self.0.request, self.0.options)
3969 .await
3970 .map(gax::response::Response::into_body)
3971 }
3972
3973 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3975 self.0.request.name = v.into();
3976 self
3977 }
3978
3979 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
3981 self.0.request.view = v.into();
3982 self
3983 }
3984 }
3985
3986 #[doc(hidden)]
3987 impl gax::options::internal::RequestBuilder for GetAuthorizedCertificate {
3988 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3989 &mut self.0.options
3990 }
3991 }
3992
3993 #[derive(Clone, Debug)]
4011 pub struct CreateAuthorizedCertificate(
4012 RequestBuilder<crate::model::CreateAuthorizedCertificateRequest>,
4013 );
4014
4015 impl CreateAuthorizedCertificate {
4016 pub(crate) fn new(
4017 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4018 ) -> Self {
4019 Self(RequestBuilder::new(stub))
4020 }
4021
4022 pub fn with_request<V: Into<crate::model::CreateAuthorizedCertificateRequest>>(
4024 mut self,
4025 v: V,
4026 ) -> Self {
4027 self.0.request = v.into();
4028 self
4029 }
4030
4031 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4033 self.0.options = v.into();
4034 self
4035 }
4036
4037 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4039 (*self.0.stub)
4040 .create_authorized_certificate(self.0.request, self.0.options)
4041 .await
4042 .map(gax::response::Response::into_body)
4043 }
4044
4045 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4047 self.0.request.parent = v.into();
4048 self
4049 }
4050
4051 pub fn set_certificate<T>(mut self, v: T) -> Self
4053 where
4054 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4055 {
4056 self.0.request.certificate = std::option::Option::Some(v.into());
4057 self
4058 }
4059
4060 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4062 where
4063 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4064 {
4065 self.0.request.certificate = v.map(|x| x.into());
4066 self
4067 }
4068 }
4069
4070 #[doc(hidden)]
4071 impl gax::options::internal::RequestBuilder for CreateAuthorizedCertificate {
4072 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4073 &mut self.0.options
4074 }
4075 }
4076
4077 #[derive(Clone, Debug)]
4095 pub struct UpdateAuthorizedCertificate(
4096 RequestBuilder<crate::model::UpdateAuthorizedCertificateRequest>,
4097 );
4098
4099 impl UpdateAuthorizedCertificate {
4100 pub(crate) fn new(
4101 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4102 ) -> Self {
4103 Self(RequestBuilder::new(stub))
4104 }
4105
4106 pub fn with_request<V: Into<crate::model::UpdateAuthorizedCertificateRequest>>(
4108 mut self,
4109 v: V,
4110 ) -> Self {
4111 self.0.request = v.into();
4112 self
4113 }
4114
4115 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4117 self.0.options = v.into();
4118 self
4119 }
4120
4121 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4123 (*self.0.stub)
4124 .update_authorized_certificate(self.0.request, self.0.options)
4125 .await
4126 .map(gax::response::Response::into_body)
4127 }
4128
4129 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4131 self.0.request.name = v.into();
4132 self
4133 }
4134
4135 pub fn set_certificate<T>(mut self, v: T) -> Self
4137 where
4138 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4139 {
4140 self.0.request.certificate = std::option::Option::Some(v.into());
4141 self
4142 }
4143
4144 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4146 where
4147 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4148 {
4149 self.0.request.certificate = v.map(|x| x.into());
4150 self
4151 }
4152
4153 pub fn set_update_mask<T>(mut self, v: T) -> Self
4155 where
4156 T: std::convert::Into<wkt::FieldMask>,
4157 {
4158 self.0.request.update_mask = std::option::Option::Some(v.into());
4159 self
4160 }
4161
4162 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4164 where
4165 T: std::convert::Into<wkt::FieldMask>,
4166 {
4167 self.0.request.update_mask = v.map(|x| x.into());
4168 self
4169 }
4170 }
4171
4172 #[doc(hidden)]
4173 impl gax::options::internal::RequestBuilder for UpdateAuthorizedCertificate {
4174 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4175 &mut self.0.options
4176 }
4177 }
4178
4179 #[derive(Clone, Debug)]
4197 pub struct DeleteAuthorizedCertificate(
4198 RequestBuilder<crate::model::DeleteAuthorizedCertificateRequest>,
4199 );
4200
4201 impl DeleteAuthorizedCertificate {
4202 pub(crate) fn new(
4203 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4204 ) -> Self {
4205 Self(RequestBuilder::new(stub))
4206 }
4207
4208 pub fn with_request<V: Into<crate::model::DeleteAuthorizedCertificateRequest>>(
4210 mut self,
4211 v: V,
4212 ) -> Self {
4213 self.0.request = v.into();
4214 self
4215 }
4216
4217 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4219 self.0.options = v.into();
4220 self
4221 }
4222
4223 pub async fn send(self) -> Result<()> {
4225 (*self.0.stub)
4226 .delete_authorized_certificate(self.0.request, self.0.options)
4227 .await
4228 .map(gax::response::Response::into_body)
4229 }
4230
4231 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4233 self.0.request.name = v.into();
4234 self
4235 }
4236 }
4237
4238 #[doc(hidden)]
4239 impl gax::options::internal::RequestBuilder for DeleteAuthorizedCertificate {
4240 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4241 &mut self.0.options
4242 }
4243 }
4244
4245 #[derive(Clone, Debug)]
4267 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4268
4269 impl ListOperations {
4270 pub(crate) fn new(
4271 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4272 ) -> Self {
4273 Self(RequestBuilder::new(stub))
4274 }
4275
4276 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4278 mut self,
4279 v: V,
4280 ) -> Self {
4281 self.0.request = v.into();
4282 self
4283 }
4284
4285 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4287 self.0.options = v.into();
4288 self
4289 }
4290
4291 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4293 (*self.0.stub)
4294 .list_operations(self.0.request, self.0.options)
4295 .await
4296 .map(gax::response::Response::into_body)
4297 }
4298
4299 pub fn by_page(
4301 self,
4302 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4303 {
4304 use std::clone::Clone;
4305 let token = self.0.request.page_token.clone();
4306 let execute = move |token: String| {
4307 let mut builder = self.clone();
4308 builder.0.request = builder.0.request.set_page_token(token);
4309 builder.send()
4310 };
4311 gax::paginator::internal::new_paginator(token, execute)
4312 }
4313
4314 pub fn by_item(
4316 self,
4317 ) -> impl gax::paginator::ItemPaginator<
4318 longrunning::model::ListOperationsResponse,
4319 gax::error::Error,
4320 > {
4321 use gax::paginator::Paginator;
4322 self.by_page().items()
4323 }
4324
4325 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4327 self.0.request.name = v.into();
4328 self
4329 }
4330
4331 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4333 self.0.request.filter = v.into();
4334 self
4335 }
4336
4337 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4339 self.0.request.page_size = v.into();
4340 self
4341 }
4342
4343 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4345 self.0.request.page_token = v.into();
4346 self
4347 }
4348
4349 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4351 self.0.request.return_partial_success = v.into();
4352 self
4353 }
4354 }
4355
4356 #[doc(hidden)]
4357 impl gax::options::internal::RequestBuilder for ListOperations {
4358 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4359 &mut self.0.options
4360 }
4361 }
4362
4363 #[derive(Clone, Debug)]
4381 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4382
4383 impl GetOperation {
4384 pub(crate) fn new(
4385 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4386 ) -> Self {
4387 Self(RequestBuilder::new(stub))
4388 }
4389
4390 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4392 mut self,
4393 v: V,
4394 ) -> Self {
4395 self.0.request = v.into();
4396 self
4397 }
4398
4399 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4401 self.0.options = v.into();
4402 self
4403 }
4404
4405 pub async fn send(self) -> Result<longrunning::model::Operation> {
4407 (*self.0.stub)
4408 .get_operation(self.0.request, self.0.options)
4409 .await
4410 .map(gax::response::Response::into_body)
4411 }
4412
4413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4415 self.0.request.name = v.into();
4416 self
4417 }
4418 }
4419
4420 #[doc(hidden)]
4421 impl gax::options::internal::RequestBuilder for GetOperation {
4422 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4423 &mut self.0.options
4424 }
4425 }
4426}
4427
4428pub mod domain_mappings {
4429 use crate::Result;
4430
4431 pub type ClientBuilder =
4445 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4446
4447 pub(crate) mod client {
4448 use super::super::super::client::DomainMappings;
4449 pub struct Factory;
4450 impl gax::client_builder::internal::ClientFactory for Factory {
4451 type Client = DomainMappings;
4452 type Credentials = gaxi::options::Credentials;
4453 async fn build(
4454 self,
4455 config: gaxi::options::ClientConfig,
4456 ) -> gax::client_builder::Result<Self::Client> {
4457 Self::Client::new(config).await
4458 }
4459 }
4460 }
4461
4462 #[derive(Clone, Debug)]
4464 pub(crate) struct RequestBuilder<R: std::default::Default> {
4465 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4466 request: R,
4467 options: gax::options::RequestOptions,
4468 }
4469
4470 impl<R> RequestBuilder<R>
4471 where
4472 R: std::default::Default,
4473 {
4474 pub(crate) fn new(
4475 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4476 ) -> Self {
4477 Self {
4478 stub,
4479 request: R::default(),
4480 options: gax::options::RequestOptions::default(),
4481 }
4482 }
4483 }
4484
4485 #[derive(Clone, Debug)]
4507 pub struct ListDomainMappings(RequestBuilder<crate::model::ListDomainMappingsRequest>);
4508
4509 impl ListDomainMappings {
4510 pub(crate) fn new(
4511 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4512 ) -> Self {
4513 Self(RequestBuilder::new(stub))
4514 }
4515
4516 pub fn with_request<V: Into<crate::model::ListDomainMappingsRequest>>(
4518 mut self,
4519 v: V,
4520 ) -> Self {
4521 self.0.request = v.into();
4522 self
4523 }
4524
4525 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4527 self.0.options = v.into();
4528 self
4529 }
4530
4531 pub async fn send(self) -> Result<crate::model::ListDomainMappingsResponse> {
4533 (*self.0.stub)
4534 .list_domain_mappings(self.0.request, self.0.options)
4535 .await
4536 .map(gax::response::Response::into_body)
4537 }
4538
4539 pub fn by_page(
4541 self,
4542 ) -> impl gax::paginator::Paginator<crate::model::ListDomainMappingsResponse, gax::error::Error>
4543 {
4544 use std::clone::Clone;
4545 let token = self.0.request.page_token.clone();
4546 let execute = move |token: String| {
4547 let mut builder = self.clone();
4548 builder.0.request = builder.0.request.set_page_token(token);
4549 builder.send()
4550 };
4551 gax::paginator::internal::new_paginator(token, execute)
4552 }
4553
4554 pub fn by_item(
4556 self,
4557 ) -> impl gax::paginator::ItemPaginator<
4558 crate::model::ListDomainMappingsResponse,
4559 gax::error::Error,
4560 > {
4561 use gax::paginator::Paginator;
4562 self.by_page().items()
4563 }
4564
4565 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4567 self.0.request.parent = v.into();
4568 self
4569 }
4570
4571 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4573 self.0.request.page_size = v.into();
4574 self
4575 }
4576
4577 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4579 self.0.request.page_token = v.into();
4580 self
4581 }
4582 }
4583
4584 #[doc(hidden)]
4585 impl gax::options::internal::RequestBuilder for ListDomainMappings {
4586 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4587 &mut self.0.options
4588 }
4589 }
4590
4591 #[derive(Clone, Debug)]
4609 pub struct GetDomainMapping(RequestBuilder<crate::model::GetDomainMappingRequest>);
4610
4611 impl GetDomainMapping {
4612 pub(crate) fn new(
4613 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4614 ) -> Self {
4615 Self(RequestBuilder::new(stub))
4616 }
4617
4618 pub fn with_request<V: Into<crate::model::GetDomainMappingRequest>>(
4620 mut self,
4621 v: V,
4622 ) -> Self {
4623 self.0.request = v.into();
4624 self
4625 }
4626
4627 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4629 self.0.options = v.into();
4630 self
4631 }
4632
4633 pub async fn send(self) -> Result<crate::model::DomainMapping> {
4635 (*self.0.stub)
4636 .get_domain_mapping(self.0.request, self.0.options)
4637 .await
4638 .map(gax::response::Response::into_body)
4639 }
4640
4641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4643 self.0.request.name = v.into();
4644 self
4645 }
4646 }
4647
4648 #[doc(hidden)]
4649 impl gax::options::internal::RequestBuilder for GetDomainMapping {
4650 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4651 &mut self.0.options
4652 }
4653 }
4654
4655 #[derive(Clone, Debug)]
4674 pub struct CreateDomainMapping(RequestBuilder<crate::model::CreateDomainMappingRequest>);
4675
4676 impl CreateDomainMapping {
4677 pub(crate) fn new(
4678 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4679 ) -> Self {
4680 Self(RequestBuilder::new(stub))
4681 }
4682
4683 pub fn with_request<V: Into<crate::model::CreateDomainMappingRequest>>(
4685 mut self,
4686 v: V,
4687 ) -> Self {
4688 self.0.request = v.into();
4689 self
4690 }
4691
4692 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4694 self.0.options = v.into();
4695 self
4696 }
4697
4698 pub async fn send(self) -> Result<longrunning::model::Operation> {
4705 (*self.0.stub)
4706 .create_domain_mapping(self.0.request, self.0.options)
4707 .await
4708 .map(gax::response::Response::into_body)
4709 }
4710
4711 pub fn poller(
4713 self,
4714 ) -> impl lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4715 {
4716 type Operation = lro::internal::Operation<
4717 crate::model::DomainMapping,
4718 crate::model::OperationMetadataV1,
4719 >;
4720 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4721 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4722
4723 let stub = self.0.stub.clone();
4724 let mut options = self.0.options.clone();
4725 options.set_retry_policy(gax::retry_policy::NeverRetry);
4726 let query = move |name| {
4727 let stub = stub.clone();
4728 let options = options.clone();
4729 async {
4730 let op = GetOperation::new(stub)
4731 .set_name(name)
4732 .with_options(options)
4733 .send()
4734 .await?;
4735 Ok(Operation::new(op))
4736 }
4737 };
4738
4739 let start = move || async {
4740 let op = self.send().await?;
4741 Ok(Operation::new(op))
4742 };
4743
4744 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4745 }
4746
4747 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4749 self.0.request.parent = v.into();
4750 self
4751 }
4752
4753 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4755 where
4756 T: std::convert::Into<crate::model::DomainMapping>,
4757 {
4758 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4759 self
4760 }
4761
4762 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4764 where
4765 T: std::convert::Into<crate::model::DomainMapping>,
4766 {
4767 self.0.request.domain_mapping = v.map(|x| x.into());
4768 self
4769 }
4770
4771 pub fn set_override_strategy<T: Into<crate::model::DomainOverrideStrategy>>(
4773 mut self,
4774 v: T,
4775 ) -> Self {
4776 self.0.request.override_strategy = v.into();
4777 self
4778 }
4779 }
4780
4781 #[doc(hidden)]
4782 impl gax::options::internal::RequestBuilder for CreateDomainMapping {
4783 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4784 &mut self.0.options
4785 }
4786 }
4787
4788 #[derive(Clone, Debug)]
4807 pub struct UpdateDomainMapping(RequestBuilder<crate::model::UpdateDomainMappingRequest>);
4808
4809 impl UpdateDomainMapping {
4810 pub(crate) fn new(
4811 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4812 ) -> Self {
4813 Self(RequestBuilder::new(stub))
4814 }
4815
4816 pub fn with_request<V: Into<crate::model::UpdateDomainMappingRequest>>(
4818 mut self,
4819 v: V,
4820 ) -> Self {
4821 self.0.request = v.into();
4822 self
4823 }
4824
4825 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4827 self.0.options = v.into();
4828 self
4829 }
4830
4831 pub async fn send(self) -> Result<longrunning::model::Operation> {
4838 (*self.0.stub)
4839 .update_domain_mapping(self.0.request, self.0.options)
4840 .await
4841 .map(gax::response::Response::into_body)
4842 }
4843
4844 pub fn poller(
4846 self,
4847 ) -> impl lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4848 {
4849 type Operation = lro::internal::Operation<
4850 crate::model::DomainMapping,
4851 crate::model::OperationMetadataV1,
4852 >;
4853 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4854 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4855
4856 let stub = self.0.stub.clone();
4857 let mut options = self.0.options.clone();
4858 options.set_retry_policy(gax::retry_policy::NeverRetry);
4859 let query = move |name| {
4860 let stub = stub.clone();
4861 let options = options.clone();
4862 async {
4863 let op = GetOperation::new(stub)
4864 .set_name(name)
4865 .with_options(options)
4866 .send()
4867 .await?;
4868 Ok(Operation::new(op))
4869 }
4870 };
4871
4872 let start = move || async {
4873 let op = self.send().await?;
4874 Ok(Operation::new(op))
4875 };
4876
4877 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4878 }
4879
4880 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4882 self.0.request.name = v.into();
4883 self
4884 }
4885
4886 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4888 where
4889 T: std::convert::Into<crate::model::DomainMapping>,
4890 {
4891 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4892 self
4893 }
4894
4895 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4897 where
4898 T: std::convert::Into<crate::model::DomainMapping>,
4899 {
4900 self.0.request.domain_mapping = v.map(|x| x.into());
4901 self
4902 }
4903
4904 pub fn set_update_mask<T>(mut self, v: T) -> Self
4906 where
4907 T: std::convert::Into<wkt::FieldMask>,
4908 {
4909 self.0.request.update_mask = std::option::Option::Some(v.into());
4910 self
4911 }
4912
4913 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4915 where
4916 T: std::convert::Into<wkt::FieldMask>,
4917 {
4918 self.0.request.update_mask = v.map(|x| x.into());
4919 self
4920 }
4921 }
4922
4923 #[doc(hidden)]
4924 impl gax::options::internal::RequestBuilder for UpdateDomainMapping {
4925 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4926 &mut self.0.options
4927 }
4928 }
4929
4930 #[derive(Clone, Debug)]
4949 pub struct DeleteDomainMapping(RequestBuilder<crate::model::DeleteDomainMappingRequest>);
4950
4951 impl DeleteDomainMapping {
4952 pub(crate) fn new(
4953 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4954 ) -> Self {
4955 Self(RequestBuilder::new(stub))
4956 }
4957
4958 pub fn with_request<V: Into<crate::model::DeleteDomainMappingRequest>>(
4960 mut self,
4961 v: V,
4962 ) -> Self {
4963 self.0.request = v.into();
4964 self
4965 }
4966
4967 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4969 self.0.options = v.into();
4970 self
4971 }
4972
4973 pub async fn send(self) -> Result<longrunning::model::Operation> {
4980 (*self.0.stub)
4981 .delete_domain_mapping(self.0.request, self.0.options)
4982 .await
4983 .map(gax::response::Response::into_body)
4984 }
4985
4986 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
4988 type Operation =
4989 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
4990 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4991 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4992
4993 let stub = self.0.stub.clone();
4994 let mut options = self.0.options.clone();
4995 options.set_retry_policy(gax::retry_policy::NeverRetry);
4996 let query = move |name| {
4997 let stub = stub.clone();
4998 let options = options.clone();
4999 async {
5000 let op = GetOperation::new(stub)
5001 .set_name(name)
5002 .with_options(options)
5003 .send()
5004 .await?;
5005 Ok(Operation::new(op))
5006 }
5007 };
5008
5009 let start = move || async {
5010 let op = self.send().await?;
5011 Ok(Operation::new(op))
5012 };
5013
5014 lro::internal::new_unit_response_poller(
5015 polling_error_policy,
5016 polling_backoff_policy,
5017 start,
5018 query,
5019 )
5020 }
5021
5022 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5024 self.0.request.name = v.into();
5025 self
5026 }
5027 }
5028
5029 #[doc(hidden)]
5030 impl gax::options::internal::RequestBuilder for DeleteDomainMapping {
5031 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5032 &mut self.0.options
5033 }
5034 }
5035
5036 #[derive(Clone, Debug)]
5058 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5059
5060 impl ListOperations {
5061 pub(crate) fn new(
5062 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5063 ) -> Self {
5064 Self(RequestBuilder::new(stub))
5065 }
5066
5067 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5069 mut self,
5070 v: V,
5071 ) -> Self {
5072 self.0.request = v.into();
5073 self
5074 }
5075
5076 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5078 self.0.options = v.into();
5079 self
5080 }
5081
5082 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5084 (*self.0.stub)
5085 .list_operations(self.0.request, self.0.options)
5086 .await
5087 .map(gax::response::Response::into_body)
5088 }
5089
5090 pub fn by_page(
5092 self,
5093 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5094 {
5095 use std::clone::Clone;
5096 let token = self.0.request.page_token.clone();
5097 let execute = move |token: String| {
5098 let mut builder = self.clone();
5099 builder.0.request = builder.0.request.set_page_token(token);
5100 builder.send()
5101 };
5102 gax::paginator::internal::new_paginator(token, execute)
5103 }
5104
5105 pub fn by_item(
5107 self,
5108 ) -> impl gax::paginator::ItemPaginator<
5109 longrunning::model::ListOperationsResponse,
5110 gax::error::Error,
5111 > {
5112 use gax::paginator::Paginator;
5113 self.by_page().items()
5114 }
5115
5116 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5118 self.0.request.name = v.into();
5119 self
5120 }
5121
5122 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5124 self.0.request.filter = v.into();
5125 self
5126 }
5127
5128 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5130 self.0.request.page_size = v.into();
5131 self
5132 }
5133
5134 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5136 self.0.request.page_token = v.into();
5137 self
5138 }
5139
5140 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5142 self.0.request.return_partial_success = v.into();
5143 self
5144 }
5145 }
5146
5147 #[doc(hidden)]
5148 impl gax::options::internal::RequestBuilder for ListOperations {
5149 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5150 &mut self.0.options
5151 }
5152 }
5153
5154 #[derive(Clone, Debug)]
5172 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5173
5174 impl GetOperation {
5175 pub(crate) fn new(
5176 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5177 ) -> Self {
5178 Self(RequestBuilder::new(stub))
5179 }
5180
5181 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5183 mut self,
5184 v: V,
5185 ) -> Self {
5186 self.0.request = v.into();
5187 self
5188 }
5189
5190 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5192 self.0.options = v.into();
5193 self
5194 }
5195
5196 pub async fn send(self) -> Result<longrunning::model::Operation> {
5198 (*self.0.stub)
5199 .get_operation(self.0.request, self.0.options)
5200 .await
5201 .map(gax::response::Response::into_body)
5202 }
5203
5204 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5206 self.0.request.name = v.into();
5207 self
5208 }
5209 }
5210
5211 #[doc(hidden)]
5212 impl gax::options::internal::RequestBuilder for GetOperation {
5213 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5214 &mut self.0.options
5215 }
5216 }
5217}