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)]
91 pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
92
93 impl GetApplication {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::Application> {
114 (*self.0.stub)
115 .get_application(self.0.request, self.0.options)
116 .await
117 .map(gax::response::Response::into_body)
118 }
119
120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
122 self.0.request.name = v.into();
123 self
124 }
125 }
126
127 #[doc(hidden)]
128 impl gax::options::internal::RequestBuilder for GetApplication {
129 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
130 &mut self.0.options
131 }
132 }
133
134 #[derive(Clone, Debug)]
152 pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
153
154 impl CreateApplication {
155 pub(crate) fn new(
156 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
157 ) -> Self {
158 Self(RequestBuilder::new(stub))
159 }
160
161 pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
163 mut self,
164 v: V,
165 ) -> Self {
166 self.0.request = v.into();
167 self
168 }
169
170 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
172 self.0.options = v.into();
173 self
174 }
175
176 pub async fn send(self) -> Result<longrunning::model::Operation> {
183 (*self.0.stub)
184 .create_application(self.0.request, self.0.options)
185 .await
186 .map(gax::response::Response::into_body)
187 }
188
189 pub fn poller(
191 self,
192 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
193 {
194 type Operation = lro::internal::Operation<
195 crate::model::Application,
196 crate::model::OperationMetadataV1,
197 >;
198 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
199 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
200
201 let stub = self.0.stub.clone();
202 let mut options = self.0.options.clone();
203 options.set_retry_policy(gax::retry_policy::NeverRetry);
204 let query = move |name| {
205 let stub = stub.clone();
206 let options = options.clone();
207 async {
208 let op = GetOperation::new(stub)
209 .set_name(name)
210 .with_options(options)
211 .send()
212 .await?;
213 Ok(Operation::new(op))
214 }
215 };
216
217 let start = move || async {
218 let op = self.send().await?;
219 Ok(Operation::new(op))
220 };
221
222 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
223 }
224
225 pub fn set_application<T>(mut self, v: T) -> Self
227 where
228 T: std::convert::Into<crate::model::Application>,
229 {
230 self.0.request.application = std::option::Option::Some(v.into());
231 self
232 }
233
234 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
236 where
237 T: std::convert::Into<crate::model::Application>,
238 {
239 self.0.request.application = v.map(|x| x.into());
240 self
241 }
242 }
243
244 #[doc(hidden)]
245 impl gax::options::internal::RequestBuilder for CreateApplication {
246 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
247 &mut self.0.options
248 }
249 }
250
251 #[derive(Clone, Debug)]
269 pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
270
271 impl UpdateApplication {
272 pub(crate) fn new(
273 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
274 ) -> Self {
275 Self(RequestBuilder::new(stub))
276 }
277
278 pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
280 mut self,
281 v: V,
282 ) -> Self {
283 self.0.request = v.into();
284 self
285 }
286
287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
289 self.0.options = v.into();
290 self
291 }
292
293 pub async fn send(self) -> Result<longrunning::model::Operation> {
300 (*self.0.stub)
301 .update_application(self.0.request, self.0.options)
302 .await
303 .map(gax::response::Response::into_body)
304 }
305
306 pub fn poller(
308 self,
309 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
310 {
311 type Operation = lro::internal::Operation<
312 crate::model::Application,
313 crate::model::OperationMetadataV1,
314 >;
315 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
316 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
317
318 let stub = self.0.stub.clone();
319 let mut options = self.0.options.clone();
320 options.set_retry_policy(gax::retry_policy::NeverRetry);
321 let query = move |name| {
322 let stub = stub.clone();
323 let options = options.clone();
324 async {
325 let op = GetOperation::new(stub)
326 .set_name(name)
327 .with_options(options)
328 .send()
329 .await?;
330 Ok(Operation::new(op))
331 }
332 };
333
334 let start = move || async {
335 let op = self.send().await?;
336 Ok(Operation::new(op))
337 };
338
339 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
340 }
341
342 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
344 self.0.request.name = v.into();
345 self
346 }
347
348 pub fn set_application<T>(mut self, v: T) -> Self
350 where
351 T: std::convert::Into<crate::model::Application>,
352 {
353 self.0.request.application = std::option::Option::Some(v.into());
354 self
355 }
356
357 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
359 where
360 T: std::convert::Into<crate::model::Application>,
361 {
362 self.0.request.application = v.map(|x| x.into());
363 self
364 }
365
366 pub fn set_update_mask<T>(mut self, v: T) -> Self
368 where
369 T: std::convert::Into<wkt::FieldMask>,
370 {
371 self.0.request.update_mask = std::option::Option::Some(v.into());
372 self
373 }
374
375 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
377 where
378 T: std::convert::Into<wkt::FieldMask>,
379 {
380 self.0.request.update_mask = v.map(|x| x.into());
381 self
382 }
383 }
384
385 #[doc(hidden)]
386 impl gax::options::internal::RequestBuilder for UpdateApplication {
387 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
388 &mut self.0.options
389 }
390 }
391
392 #[derive(Clone, Debug)]
410 pub struct RepairApplication(RequestBuilder<crate::model::RepairApplicationRequest>);
411
412 impl RepairApplication {
413 pub(crate) fn new(
414 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
415 ) -> Self {
416 Self(RequestBuilder::new(stub))
417 }
418
419 pub fn with_request<V: Into<crate::model::RepairApplicationRequest>>(
421 mut self,
422 v: V,
423 ) -> Self {
424 self.0.request = v.into();
425 self
426 }
427
428 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
430 self.0.options = v.into();
431 self
432 }
433
434 pub async fn send(self) -> Result<longrunning::model::Operation> {
441 (*self.0.stub)
442 .repair_application(self.0.request, self.0.options)
443 .await
444 .map(gax::response::Response::into_body)
445 }
446
447 pub fn poller(
449 self,
450 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
451 {
452 type Operation = lro::internal::Operation<
453 crate::model::Application,
454 crate::model::OperationMetadataV1,
455 >;
456 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
457 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
458
459 let stub = self.0.stub.clone();
460 let mut options = self.0.options.clone();
461 options.set_retry_policy(gax::retry_policy::NeverRetry);
462 let query = move |name| {
463 let stub = stub.clone();
464 let options = options.clone();
465 async {
466 let op = GetOperation::new(stub)
467 .set_name(name)
468 .with_options(options)
469 .send()
470 .await?;
471 Ok(Operation::new(op))
472 }
473 };
474
475 let start = move || async {
476 let op = self.send().await?;
477 Ok(Operation::new(op))
478 };
479
480 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
481 }
482
483 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
485 self.0.request.name = v.into();
486 self
487 }
488 }
489
490 #[doc(hidden)]
491 impl gax::options::internal::RequestBuilder for RepairApplication {
492 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
493 &mut self.0.options
494 }
495 }
496
497 #[derive(Clone, Debug)]
518 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
519
520 impl ListOperations {
521 pub(crate) fn new(
522 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
523 ) -> Self {
524 Self(RequestBuilder::new(stub))
525 }
526
527 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
529 mut self,
530 v: V,
531 ) -> Self {
532 self.0.request = v.into();
533 self
534 }
535
536 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
538 self.0.options = v.into();
539 self
540 }
541
542 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
544 (*self.0.stub)
545 .list_operations(self.0.request, self.0.options)
546 .await
547 .map(gax::response::Response::into_body)
548 }
549
550 pub fn by_page(
552 self,
553 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
554 {
555 use std::clone::Clone;
556 let token = self.0.request.page_token.clone();
557 let execute = move |token: String| {
558 let mut builder = self.clone();
559 builder.0.request = builder.0.request.set_page_token(token);
560 builder.send()
561 };
562 gax::paginator::internal::new_paginator(token, execute)
563 }
564
565 pub fn by_item(
567 self,
568 ) -> impl gax::paginator::ItemPaginator<
569 longrunning::model::ListOperationsResponse,
570 gax::error::Error,
571 > {
572 use gax::paginator::Paginator;
573 self.by_page().items()
574 }
575
576 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
578 self.0.request.name = v.into();
579 self
580 }
581
582 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
584 self.0.request.filter = v.into();
585 self
586 }
587
588 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
590 self.0.request.page_size = v.into();
591 self
592 }
593
594 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
596 self.0.request.page_token = v.into();
597 self
598 }
599
600 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
602 self.0.request.return_partial_success = v.into();
603 self
604 }
605 }
606
607 #[doc(hidden)]
608 impl gax::options::internal::RequestBuilder for ListOperations {
609 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
610 &mut self.0.options
611 }
612 }
613
614 #[derive(Clone, Debug)]
631 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
632
633 impl GetOperation {
634 pub(crate) fn new(
635 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
636 ) -> Self {
637 Self(RequestBuilder::new(stub))
638 }
639
640 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
642 mut self,
643 v: V,
644 ) -> Self {
645 self.0.request = v.into();
646 self
647 }
648
649 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
651 self.0.options = v.into();
652 self
653 }
654
655 pub async fn send(self) -> Result<longrunning::model::Operation> {
657 (*self.0.stub)
658 .get_operation(self.0.request, self.0.options)
659 .await
660 .map(gax::response::Response::into_body)
661 }
662
663 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
665 self.0.request.name = v.into();
666 self
667 }
668 }
669
670 #[doc(hidden)]
671 impl gax::options::internal::RequestBuilder for GetOperation {
672 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
673 &mut self.0.options
674 }
675 }
676}
677
678pub mod services {
679 use crate::Result;
680
681 pub type ClientBuilder =
695 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
696
697 pub(crate) mod client {
698 use super::super::super::client::Services;
699 pub struct Factory;
700 impl gax::client_builder::internal::ClientFactory for Factory {
701 type Client = Services;
702 type Credentials = gaxi::options::Credentials;
703 async fn build(
704 self,
705 config: gaxi::options::ClientConfig,
706 ) -> gax::client_builder::Result<Self::Client> {
707 Self::Client::new(config).await
708 }
709 }
710 }
711
712 #[derive(Clone, Debug)]
714 pub(crate) struct RequestBuilder<R: std::default::Default> {
715 stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
716 request: R,
717 options: gax::options::RequestOptions,
718 }
719
720 impl<R> RequestBuilder<R>
721 where
722 R: std::default::Default,
723 {
724 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
725 Self {
726 stub,
727 request: R::default(),
728 options: gax::options::RequestOptions::default(),
729 }
730 }
731 }
732
733 #[derive(Clone, Debug)]
754 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
755
756 impl ListServices {
757 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
758 Self(RequestBuilder::new(stub))
759 }
760
761 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
763 self.0.request = v.into();
764 self
765 }
766
767 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
769 self.0.options = v.into();
770 self
771 }
772
773 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
775 (*self.0.stub)
776 .list_services(self.0.request, self.0.options)
777 .await
778 .map(gax::response::Response::into_body)
779 }
780
781 pub fn by_page(
783 self,
784 ) -> impl gax::paginator::Paginator<crate::model::ListServicesResponse, gax::error::Error>
785 {
786 use std::clone::Clone;
787 let token = self.0.request.page_token.clone();
788 let execute = move |token: String| {
789 let mut builder = self.clone();
790 builder.0.request = builder.0.request.set_page_token(token);
791 builder.send()
792 };
793 gax::paginator::internal::new_paginator(token, execute)
794 }
795
796 pub fn by_item(
798 self,
799 ) -> impl gax::paginator::ItemPaginator<crate::model::ListServicesResponse, gax::error::Error>
800 {
801 use gax::paginator::Paginator;
802 self.by_page().items()
803 }
804
805 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
807 self.0.request.parent = v.into();
808 self
809 }
810
811 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
813 self.0.request.page_size = v.into();
814 self
815 }
816
817 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
819 self.0.request.page_token = v.into();
820 self
821 }
822 }
823
824 #[doc(hidden)]
825 impl gax::options::internal::RequestBuilder for ListServices {
826 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
827 &mut self.0.options
828 }
829 }
830
831 #[derive(Clone, Debug)]
848 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
849
850 impl GetService {
851 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
852 Self(RequestBuilder::new(stub))
853 }
854
855 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
857 self.0.request = v.into();
858 self
859 }
860
861 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
863 self.0.options = v.into();
864 self
865 }
866
867 pub async fn send(self) -> Result<crate::model::Service> {
869 (*self.0.stub)
870 .get_service(self.0.request, self.0.options)
871 .await
872 .map(gax::response::Response::into_body)
873 }
874
875 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
877 self.0.request.name = v.into();
878 self
879 }
880 }
881
882 #[doc(hidden)]
883 impl gax::options::internal::RequestBuilder for GetService {
884 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
885 &mut self.0.options
886 }
887 }
888
889 #[derive(Clone, Debug)]
907 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
908
909 impl UpdateService {
910 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
911 Self(RequestBuilder::new(stub))
912 }
913
914 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
916 self.0.request = v.into();
917 self
918 }
919
920 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
922 self.0.options = v.into();
923 self
924 }
925
926 pub async fn send(self) -> Result<longrunning::model::Operation> {
933 (*self.0.stub)
934 .update_service(self.0.request, self.0.options)
935 .await
936 .map(gax::response::Response::into_body)
937 }
938
939 pub fn poller(
941 self,
942 ) -> impl lro::Poller<crate::model::Service, crate::model::OperationMetadataV1> {
943 type Operation =
944 lro::internal::Operation<crate::model::Service, crate::model::OperationMetadataV1>;
945 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
946 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
947
948 let stub = self.0.stub.clone();
949 let mut options = self.0.options.clone();
950 options.set_retry_policy(gax::retry_policy::NeverRetry);
951 let query = move |name| {
952 let stub = stub.clone();
953 let options = options.clone();
954 async {
955 let op = GetOperation::new(stub)
956 .set_name(name)
957 .with_options(options)
958 .send()
959 .await?;
960 Ok(Operation::new(op))
961 }
962 };
963
964 let start = move || async {
965 let op = self.send().await?;
966 Ok(Operation::new(op))
967 };
968
969 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
970 }
971
972 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
974 self.0.request.name = v.into();
975 self
976 }
977
978 pub fn set_service<T>(mut self, v: T) -> Self
980 where
981 T: std::convert::Into<crate::model::Service>,
982 {
983 self.0.request.service = std::option::Option::Some(v.into());
984 self
985 }
986
987 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
989 where
990 T: std::convert::Into<crate::model::Service>,
991 {
992 self.0.request.service = v.map(|x| x.into());
993 self
994 }
995
996 pub fn set_update_mask<T>(mut self, v: T) -> Self
998 where
999 T: std::convert::Into<wkt::FieldMask>,
1000 {
1001 self.0.request.update_mask = std::option::Option::Some(v.into());
1002 self
1003 }
1004
1005 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1007 where
1008 T: std::convert::Into<wkt::FieldMask>,
1009 {
1010 self.0.request.update_mask = v.map(|x| x.into());
1011 self
1012 }
1013
1014 pub fn set_migrate_traffic<T: Into<bool>>(mut self, v: T) -> Self {
1016 self.0.request.migrate_traffic = v.into();
1017 self
1018 }
1019 }
1020
1021 #[doc(hidden)]
1022 impl gax::options::internal::RequestBuilder for UpdateService {
1023 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1024 &mut self.0.options
1025 }
1026 }
1027
1028 #[derive(Clone, Debug)]
1046 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1047
1048 impl DeleteService {
1049 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1050 Self(RequestBuilder::new(stub))
1051 }
1052
1053 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1055 self.0.request = v.into();
1056 self
1057 }
1058
1059 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1061 self.0.options = v.into();
1062 self
1063 }
1064
1065 pub async fn send(self) -> Result<longrunning::model::Operation> {
1072 (*self.0.stub)
1073 .delete_service(self.0.request, self.0.options)
1074 .await
1075 .map(gax::response::Response::into_body)
1076 }
1077
1078 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
1080 type Operation =
1081 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
1082 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1083 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1084
1085 let stub = self.0.stub.clone();
1086 let mut options = self.0.options.clone();
1087 options.set_retry_policy(gax::retry_policy::NeverRetry);
1088 let query = move |name| {
1089 let stub = stub.clone();
1090 let options = options.clone();
1091 async {
1092 let op = GetOperation::new(stub)
1093 .set_name(name)
1094 .with_options(options)
1095 .send()
1096 .await?;
1097 Ok(Operation::new(op))
1098 }
1099 };
1100
1101 let start = move || async {
1102 let op = self.send().await?;
1103 Ok(Operation::new(op))
1104 };
1105
1106 lro::internal::new_unit_response_poller(
1107 polling_error_policy,
1108 polling_backoff_policy,
1109 start,
1110 query,
1111 )
1112 }
1113
1114 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1116 self.0.request.name = v.into();
1117 self
1118 }
1119 }
1120
1121 #[doc(hidden)]
1122 impl gax::options::internal::RequestBuilder for DeleteService {
1123 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1124 &mut self.0.options
1125 }
1126 }
1127
1128 #[derive(Clone, Debug)]
1149 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1150
1151 impl ListOperations {
1152 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1153 Self(RequestBuilder::new(stub))
1154 }
1155
1156 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1158 mut self,
1159 v: V,
1160 ) -> Self {
1161 self.0.request = v.into();
1162 self
1163 }
1164
1165 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1167 self.0.options = v.into();
1168 self
1169 }
1170
1171 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1173 (*self.0.stub)
1174 .list_operations(self.0.request, self.0.options)
1175 .await
1176 .map(gax::response::Response::into_body)
1177 }
1178
1179 pub fn by_page(
1181 self,
1182 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1183 {
1184 use std::clone::Clone;
1185 let token = self.0.request.page_token.clone();
1186 let execute = move |token: String| {
1187 let mut builder = self.clone();
1188 builder.0.request = builder.0.request.set_page_token(token);
1189 builder.send()
1190 };
1191 gax::paginator::internal::new_paginator(token, execute)
1192 }
1193
1194 pub fn by_item(
1196 self,
1197 ) -> impl gax::paginator::ItemPaginator<
1198 longrunning::model::ListOperationsResponse,
1199 gax::error::Error,
1200 > {
1201 use gax::paginator::Paginator;
1202 self.by_page().items()
1203 }
1204
1205 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1207 self.0.request.name = v.into();
1208 self
1209 }
1210
1211 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1213 self.0.request.filter = v.into();
1214 self
1215 }
1216
1217 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1219 self.0.request.page_size = v.into();
1220 self
1221 }
1222
1223 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1225 self.0.request.page_token = v.into();
1226 self
1227 }
1228
1229 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1231 self.0.request.return_partial_success = v.into();
1232 self
1233 }
1234 }
1235
1236 #[doc(hidden)]
1237 impl gax::options::internal::RequestBuilder for ListOperations {
1238 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1239 &mut self.0.options
1240 }
1241 }
1242
1243 #[derive(Clone, Debug)]
1260 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1261
1262 impl GetOperation {
1263 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1264 Self(RequestBuilder::new(stub))
1265 }
1266
1267 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1269 mut self,
1270 v: V,
1271 ) -> Self {
1272 self.0.request = v.into();
1273 self
1274 }
1275
1276 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1278 self.0.options = v.into();
1279 self
1280 }
1281
1282 pub async fn send(self) -> Result<longrunning::model::Operation> {
1284 (*self.0.stub)
1285 .get_operation(self.0.request, self.0.options)
1286 .await
1287 .map(gax::response::Response::into_body)
1288 }
1289
1290 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1292 self.0.request.name = v.into();
1293 self
1294 }
1295 }
1296
1297 #[doc(hidden)]
1298 impl gax::options::internal::RequestBuilder for GetOperation {
1299 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1300 &mut self.0.options
1301 }
1302 }
1303}
1304
1305pub mod versions {
1306 use crate::Result;
1307
1308 pub type ClientBuilder =
1322 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1323
1324 pub(crate) mod client {
1325 use super::super::super::client::Versions;
1326 pub struct Factory;
1327 impl gax::client_builder::internal::ClientFactory for Factory {
1328 type Client = Versions;
1329 type Credentials = gaxi::options::Credentials;
1330 async fn build(
1331 self,
1332 config: gaxi::options::ClientConfig,
1333 ) -> gax::client_builder::Result<Self::Client> {
1334 Self::Client::new(config).await
1335 }
1336 }
1337 }
1338
1339 #[derive(Clone, Debug)]
1341 pub(crate) struct RequestBuilder<R: std::default::Default> {
1342 stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
1343 request: R,
1344 options: gax::options::RequestOptions,
1345 }
1346
1347 impl<R> RequestBuilder<R>
1348 where
1349 R: std::default::Default,
1350 {
1351 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1352 Self {
1353 stub,
1354 request: R::default(),
1355 options: gax::options::RequestOptions::default(),
1356 }
1357 }
1358 }
1359
1360 #[derive(Clone, Debug)]
1381 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
1382
1383 impl ListVersions {
1384 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1385 Self(RequestBuilder::new(stub))
1386 }
1387
1388 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
1390 self.0.request = v.into();
1391 self
1392 }
1393
1394 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1396 self.0.options = v.into();
1397 self
1398 }
1399
1400 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
1402 (*self.0.stub)
1403 .list_versions(self.0.request, self.0.options)
1404 .await
1405 .map(gax::response::Response::into_body)
1406 }
1407
1408 pub fn by_page(
1410 self,
1411 ) -> impl gax::paginator::Paginator<crate::model::ListVersionsResponse, gax::error::Error>
1412 {
1413 use std::clone::Clone;
1414 let token = self.0.request.page_token.clone();
1415 let execute = move |token: String| {
1416 let mut builder = self.clone();
1417 builder.0.request = builder.0.request.set_page_token(token);
1418 builder.send()
1419 };
1420 gax::paginator::internal::new_paginator(token, execute)
1421 }
1422
1423 pub fn by_item(
1425 self,
1426 ) -> impl gax::paginator::ItemPaginator<crate::model::ListVersionsResponse, gax::error::Error>
1427 {
1428 use gax::paginator::Paginator;
1429 self.by_page().items()
1430 }
1431
1432 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1434 self.0.request.parent = v.into();
1435 self
1436 }
1437
1438 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1440 self.0.request.view = v.into();
1441 self
1442 }
1443
1444 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1446 self.0.request.page_size = v.into();
1447 self
1448 }
1449
1450 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1452 self.0.request.page_token = v.into();
1453 self
1454 }
1455 }
1456
1457 #[doc(hidden)]
1458 impl gax::options::internal::RequestBuilder for ListVersions {
1459 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1460 &mut self.0.options
1461 }
1462 }
1463
1464 #[derive(Clone, Debug)]
1481 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
1482
1483 impl GetVersion {
1484 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1485 Self(RequestBuilder::new(stub))
1486 }
1487
1488 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
1490 self.0.request = v.into();
1491 self
1492 }
1493
1494 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1496 self.0.options = v.into();
1497 self
1498 }
1499
1500 pub async fn send(self) -> Result<crate::model::Version> {
1502 (*self.0.stub)
1503 .get_version(self.0.request, self.0.options)
1504 .await
1505 .map(gax::response::Response::into_body)
1506 }
1507
1508 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1510 self.0.request.name = v.into();
1511 self
1512 }
1513
1514 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1516 self.0.request.view = v.into();
1517 self
1518 }
1519 }
1520
1521 #[doc(hidden)]
1522 impl gax::options::internal::RequestBuilder for GetVersion {
1523 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1524 &mut self.0.options
1525 }
1526 }
1527
1528 #[derive(Clone, Debug)]
1546 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
1547
1548 impl CreateVersion {
1549 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1550 Self(RequestBuilder::new(stub))
1551 }
1552
1553 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
1555 self.0.request = v.into();
1556 self
1557 }
1558
1559 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1561 self.0.options = v.into();
1562 self
1563 }
1564
1565 pub async fn send(self) -> Result<longrunning::model::Operation> {
1572 (*self.0.stub)
1573 .create_version(self.0.request, self.0.options)
1574 .await
1575 .map(gax::response::Response::into_body)
1576 }
1577
1578 pub fn poller(
1580 self,
1581 ) -> impl lro::Poller<crate::model::Version, crate::model::CreateVersionMetadataV1>
1582 {
1583 type Operation = lro::internal::Operation<
1584 crate::model::Version,
1585 crate::model::CreateVersionMetadataV1,
1586 >;
1587 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1588 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1589
1590 let stub = self.0.stub.clone();
1591 let mut options = self.0.options.clone();
1592 options.set_retry_policy(gax::retry_policy::NeverRetry);
1593 let query = move |name| {
1594 let stub = stub.clone();
1595 let options = options.clone();
1596 async {
1597 let op = GetOperation::new(stub)
1598 .set_name(name)
1599 .with_options(options)
1600 .send()
1601 .await?;
1602 Ok(Operation::new(op))
1603 }
1604 };
1605
1606 let start = move || async {
1607 let op = self.send().await?;
1608 Ok(Operation::new(op))
1609 };
1610
1611 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1612 }
1613
1614 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1616 self.0.request.parent = v.into();
1617 self
1618 }
1619
1620 pub fn set_version<T>(mut self, v: T) -> Self
1622 where
1623 T: std::convert::Into<crate::model::Version>,
1624 {
1625 self.0.request.version = std::option::Option::Some(v.into());
1626 self
1627 }
1628
1629 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1631 where
1632 T: std::convert::Into<crate::model::Version>,
1633 {
1634 self.0.request.version = v.map(|x| x.into());
1635 self
1636 }
1637 }
1638
1639 #[doc(hidden)]
1640 impl gax::options::internal::RequestBuilder for CreateVersion {
1641 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1642 &mut self.0.options
1643 }
1644 }
1645
1646 #[derive(Clone, Debug)]
1664 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
1665
1666 impl UpdateVersion {
1667 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1668 Self(RequestBuilder::new(stub))
1669 }
1670
1671 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
1673 self.0.request = v.into();
1674 self
1675 }
1676
1677 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1679 self.0.options = v.into();
1680 self
1681 }
1682
1683 pub async fn send(self) -> Result<longrunning::model::Operation> {
1690 (*self.0.stub)
1691 .update_version(self.0.request, self.0.options)
1692 .await
1693 .map(gax::response::Response::into_body)
1694 }
1695
1696 pub fn poller(
1698 self,
1699 ) -> impl lro::Poller<crate::model::Version, crate::model::OperationMetadataV1> {
1700 type Operation =
1701 lro::internal::Operation<crate::model::Version, crate::model::OperationMetadataV1>;
1702 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1703 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1704
1705 let stub = self.0.stub.clone();
1706 let mut options = self.0.options.clone();
1707 options.set_retry_policy(gax::retry_policy::NeverRetry);
1708 let query = move |name| {
1709 let stub = stub.clone();
1710 let options = options.clone();
1711 async {
1712 let op = GetOperation::new(stub)
1713 .set_name(name)
1714 .with_options(options)
1715 .send()
1716 .await?;
1717 Ok(Operation::new(op))
1718 }
1719 };
1720
1721 let start = move || async {
1722 let op = self.send().await?;
1723 Ok(Operation::new(op))
1724 };
1725
1726 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1727 }
1728
1729 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1731 self.0.request.name = v.into();
1732 self
1733 }
1734
1735 pub fn set_version<T>(mut self, v: T) -> Self
1737 where
1738 T: std::convert::Into<crate::model::Version>,
1739 {
1740 self.0.request.version = std::option::Option::Some(v.into());
1741 self
1742 }
1743
1744 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1746 where
1747 T: std::convert::Into<crate::model::Version>,
1748 {
1749 self.0.request.version = v.map(|x| x.into());
1750 self
1751 }
1752
1753 pub fn set_update_mask<T>(mut self, v: T) -> Self
1755 where
1756 T: std::convert::Into<wkt::FieldMask>,
1757 {
1758 self.0.request.update_mask = std::option::Option::Some(v.into());
1759 self
1760 }
1761
1762 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1764 where
1765 T: std::convert::Into<wkt::FieldMask>,
1766 {
1767 self.0.request.update_mask = v.map(|x| x.into());
1768 self
1769 }
1770 }
1771
1772 #[doc(hidden)]
1773 impl gax::options::internal::RequestBuilder for UpdateVersion {
1774 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1775 &mut self.0.options
1776 }
1777 }
1778
1779 #[derive(Clone, Debug)]
1797 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
1798
1799 impl DeleteVersion {
1800 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1801 Self(RequestBuilder::new(stub))
1802 }
1803
1804 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
1806 self.0.request = v.into();
1807 self
1808 }
1809
1810 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1812 self.0.options = v.into();
1813 self
1814 }
1815
1816 pub async fn send(self) -> Result<longrunning::model::Operation> {
1823 (*self.0.stub)
1824 .delete_version(self.0.request, self.0.options)
1825 .await
1826 .map(gax::response::Response::into_body)
1827 }
1828
1829 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
1831 type Operation =
1832 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
1833 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1834 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1835
1836 let stub = self.0.stub.clone();
1837 let mut options = self.0.options.clone();
1838 options.set_retry_policy(gax::retry_policy::NeverRetry);
1839 let query = move |name| {
1840 let stub = stub.clone();
1841 let options = options.clone();
1842 async {
1843 let op = GetOperation::new(stub)
1844 .set_name(name)
1845 .with_options(options)
1846 .send()
1847 .await?;
1848 Ok(Operation::new(op))
1849 }
1850 };
1851
1852 let start = move || async {
1853 let op = self.send().await?;
1854 Ok(Operation::new(op))
1855 };
1856
1857 lro::internal::new_unit_response_poller(
1858 polling_error_policy,
1859 polling_backoff_policy,
1860 start,
1861 query,
1862 )
1863 }
1864
1865 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1867 self.0.request.name = v.into();
1868 self
1869 }
1870 }
1871
1872 #[doc(hidden)]
1873 impl gax::options::internal::RequestBuilder for DeleteVersion {
1874 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1875 &mut self.0.options
1876 }
1877 }
1878
1879 #[derive(Clone, Debug)]
1900 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1901
1902 impl ListOperations {
1903 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1904 Self(RequestBuilder::new(stub))
1905 }
1906
1907 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1909 mut self,
1910 v: V,
1911 ) -> Self {
1912 self.0.request = v.into();
1913 self
1914 }
1915
1916 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1918 self.0.options = v.into();
1919 self
1920 }
1921
1922 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1924 (*self.0.stub)
1925 .list_operations(self.0.request, self.0.options)
1926 .await
1927 .map(gax::response::Response::into_body)
1928 }
1929
1930 pub fn by_page(
1932 self,
1933 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1934 {
1935 use std::clone::Clone;
1936 let token = self.0.request.page_token.clone();
1937 let execute = move |token: String| {
1938 let mut builder = self.clone();
1939 builder.0.request = builder.0.request.set_page_token(token);
1940 builder.send()
1941 };
1942 gax::paginator::internal::new_paginator(token, execute)
1943 }
1944
1945 pub fn by_item(
1947 self,
1948 ) -> impl gax::paginator::ItemPaginator<
1949 longrunning::model::ListOperationsResponse,
1950 gax::error::Error,
1951 > {
1952 use gax::paginator::Paginator;
1953 self.by_page().items()
1954 }
1955
1956 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1958 self.0.request.name = v.into();
1959 self
1960 }
1961
1962 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1964 self.0.request.filter = v.into();
1965 self
1966 }
1967
1968 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1970 self.0.request.page_size = v.into();
1971 self
1972 }
1973
1974 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.0.request.page_token = v.into();
1977 self
1978 }
1979
1980 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1982 self.0.request.return_partial_success = v.into();
1983 self
1984 }
1985 }
1986
1987 #[doc(hidden)]
1988 impl gax::options::internal::RequestBuilder for ListOperations {
1989 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1990 &mut self.0.options
1991 }
1992 }
1993
1994 #[derive(Clone, Debug)]
2011 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2012
2013 impl GetOperation {
2014 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2015 Self(RequestBuilder::new(stub))
2016 }
2017
2018 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2020 mut self,
2021 v: V,
2022 ) -> Self {
2023 self.0.request = v.into();
2024 self
2025 }
2026
2027 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2029 self.0.options = v.into();
2030 self
2031 }
2032
2033 pub async fn send(self) -> Result<longrunning::model::Operation> {
2035 (*self.0.stub)
2036 .get_operation(self.0.request, self.0.options)
2037 .await
2038 .map(gax::response::Response::into_body)
2039 }
2040
2041 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2043 self.0.request.name = v.into();
2044 self
2045 }
2046 }
2047
2048 #[doc(hidden)]
2049 impl gax::options::internal::RequestBuilder for GetOperation {
2050 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2051 &mut self.0.options
2052 }
2053 }
2054}
2055
2056pub mod instances {
2057 use crate::Result;
2058
2059 pub type ClientBuilder =
2073 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2074
2075 pub(crate) mod client {
2076 use super::super::super::client::Instances;
2077 pub struct Factory;
2078 impl gax::client_builder::internal::ClientFactory for Factory {
2079 type Client = Instances;
2080 type Credentials = gaxi::options::Credentials;
2081 async fn build(
2082 self,
2083 config: gaxi::options::ClientConfig,
2084 ) -> gax::client_builder::Result<Self::Client> {
2085 Self::Client::new(config).await
2086 }
2087 }
2088 }
2089
2090 #[derive(Clone, Debug)]
2092 pub(crate) struct RequestBuilder<R: std::default::Default> {
2093 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2094 request: R,
2095 options: gax::options::RequestOptions,
2096 }
2097
2098 impl<R> RequestBuilder<R>
2099 where
2100 R: std::default::Default,
2101 {
2102 pub(crate) fn new(
2103 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2104 ) -> Self {
2105 Self {
2106 stub,
2107 request: R::default(),
2108 options: gax::options::RequestOptions::default(),
2109 }
2110 }
2111 }
2112
2113 #[derive(Clone, Debug)]
2134 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
2135
2136 impl ListInstances {
2137 pub(crate) fn new(
2138 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2139 ) -> Self {
2140 Self(RequestBuilder::new(stub))
2141 }
2142
2143 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
2145 self.0.request = v.into();
2146 self
2147 }
2148
2149 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2151 self.0.options = v.into();
2152 self
2153 }
2154
2155 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
2157 (*self.0.stub)
2158 .list_instances(self.0.request, self.0.options)
2159 .await
2160 .map(gax::response::Response::into_body)
2161 }
2162
2163 pub fn by_page(
2165 self,
2166 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
2167 {
2168 use std::clone::Clone;
2169 let token = self.0.request.page_token.clone();
2170 let execute = move |token: String| {
2171 let mut builder = self.clone();
2172 builder.0.request = builder.0.request.set_page_token(token);
2173 builder.send()
2174 };
2175 gax::paginator::internal::new_paginator(token, execute)
2176 }
2177
2178 pub fn by_item(
2180 self,
2181 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
2182 {
2183 use gax::paginator::Paginator;
2184 self.by_page().items()
2185 }
2186
2187 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2189 self.0.request.parent = v.into();
2190 self
2191 }
2192
2193 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2195 self.0.request.page_size = v.into();
2196 self
2197 }
2198
2199 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2201 self.0.request.page_token = v.into();
2202 self
2203 }
2204 }
2205
2206 #[doc(hidden)]
2207 impl gax::options::internal::RequestBuilder for ListInstances {
2208 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2209 &mut self.0.options
2210 }
2211 }
2212
2213 #[derive(Clone, Debug)]
2230 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2231
2232 impl GetInstance {
2233 pub(crate) fn new(
2234 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2235 ) -> Self {
2236 Self(RequestBuilder::new(stub))
2237 }
2238
2239 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2241 self.0.request = v.into();
2242 self
2243 }
2244
2245 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2247 self.0.options = v.into();
2248 self
2249 }
2250
2251 pub async fn send(self) -> Result<crate::model::Instance> {
2253 (*self.0.stub)
2254 .get_instance(self.0.request, self.0.options)
2255 .await
2256 .map(gax::response::Response::into_body)
2257 }
2258
2259 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2261 self.0.request.name = v.into();
2262 self
2263 }
2264 }
2265
2266 #[doc(hidden)]
2267 impl gax::options::internal::RequestBuilder for GetInstance {
2268 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2269 &mut self.0.options
2270 }
2271 }
2272
2273 #[derive(Clone, Debug)]
2291 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
2292
2293 impl DeleteInstance {
2294 pub(crate) fn new(
2295 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2296 ) -> Self {
2297 Self(RequestBuilder::new(stub))
2298 }
2299
2300 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
2302 self.0.request = v.into();
2303 self
2304 }
2305
2306 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2308 self.0.options = v.into();
2309 self
2310 }
2311
2312 pub async fn send(self) -> Result<longrunning::model::Operation> {
2319 (*self.0.stub)
2320 .delete_instance(self.0.request, self.0.options)
2321 .await
2322 .map(gax::response::Response::into_body)
2323 }
2324
2325 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
2327 type Operation =
2328 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
2329 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2330 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2331
2332 let stub = self.0.stub.clone();
2333 let mut options = self.0.options.clone();
2334 options.set_retry_policy(gax::retry_policy::NeverRetry);
2335 let query = move |name| {
2336 let stub = stub.clone();
2337 let options = options.clone();
2338 async {
2339 let op = GetOperation::new(stub)
2340 .set_name(name)
2341 .with_options(options)
2342 .send()
2343 .await?;
2344 Ok(Operation::new(op))
2345 }
2346 };
2347
2348 let start = move || async {
2349 let op = self.send().await?;
2350 Ok(Operation::new(op))
2351 };
2352
2353 lro::internal::new_unit_response_poller(
2354 polling_error_policy,
2355 polling_backoff_policy,
2356 start,
2357 query,
2358 )
2359 }
2360
2361 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2363 self.0.request.name = v.into();
2364 self
2365 }
2366 }
2367
2368 #[doc(hidden)]
2369 impl gax::options::internal::RequestBuilder for DeleteInstance {
2370 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2371 &mut self.0.options
2372 }
2373 }
2374
2375 #[derive(Clone, Debug)]
2393 pub struct DebugInstance(RequestBuilder<crate::model::DebugInstanceRequest>);
2394
2395 impl DebugInstance {
2396 pub(crate) fn new(
2397 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2398 ) -> Self {
2399 Self(RequestBuilder::new(stub))
2400 }
2401
2402 pub fn with_request<V: Into<crate::model::DebugInstanceRequest>>(mut self, v: V) -> Self {
2404 self.0.request = v.into();
2405 self
2406 }
2407
2408 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2410 self.0.options = v.into();
2411 self
2412 }
2413
2414 pub async fn send(self) -> Result<longrunning::model::Operation> {
2421 (*self.0.stub)
2422 .debug_instance(self.0.request, self.0.options)
2423 .await
2424 .map(gax::response::Response::into_body)
2425 }
2426
2427 pub fn poller(
2429 self,
2430 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadataV1> {
2431 type Operation =
2432 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadataV1>;
2433 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2434 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2435
2436 let stub = self.0.stub.clone();
2437 let mut options = self.0.options.clone();
2438 options.set_retry_policy(gax::retry_policy::NeverRetry);
2439 let query = move |name| {
2440 let stub = stub.clone();
2441 let options = options.clone();
2442 async {
2443 let op = GetOperation::new(stub)
2444 .set_name(name)
2445 .with_options(options)
2446 .send()
2447 .await?;
2448 Ok(Operation::new(op))
2449 }
2450 };
2451
2452 let start = move || async {
2453 let op = self.send().await?;
2454 Ok(Operation::new(op))
2455 };
2456
2457 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2458 }
2459
2460 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2462 self.0.request.name = v.into();
2463 self
2464 }
2465
2466 pub fn set_ssh_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
2468 self.0.request.ssh_key = v.into();
2469 self
2470 }
2471 }
2472
2473 #[doc(hidden)]
2474 impl gax::options::internal::RequestBuilder for DebugInstance {
2475 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2476 &mut self.0.options
2477 }
2478 }
2479
2480 #[derive(Clone, Debug)]
2501 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2502
2503 impl ListOperations {
2504 pub(crate) fn new(
2505 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2506 ) -> Self {
2507 Self(RequestBuilder::new(stub))
2508 }
2509
2510 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2512 mut self,
2513 v: V,
2514 ) -> Self {
2515 self.0.request = v.into();
2516 self
2517 }
2518
2519 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2521 self.0.options = v.into();
2522 self
2523 }
2524
2525 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2527 (*self.0.stub)
2528 .list_operations(self.0.request, self.0.options)
2529 .await
2530 .map(gax::response::Response::into_body)
2531 }
2532
2533 pub fn by_page(
2535 self,
2536 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2537 {
2538 use std::clone::Clone;
2539 let token = self.0.request.page_token.clone();
2540 let execute = move |token: String| {
2541 let mut builder = self.clone();
2542 builder.0.request = builder.0.request.set_page_token(token);
2543 builder.send()
2544 };
2545 gax::paginator::internal::new_paginator(token, execute)
2546 }
2547
2548 pub fn by_item(
2550 self,
2551 ) -> impl gax::paginator::ItemPaginator<
2552 longrunning::model::ListOperationsResponse,
2553 gax::error::Error,
2554 > {
2555 use gax::paginator::Paginator;
2556 self.by_page().items()
2557 }
2558
2559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2561 self.0.request.name = v.into();
2562 self
2563 }
2564
2565 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2567 self.0.request.filter = v.into();
2568 self
2569 }
2570
2571 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2573 self.0.request.page_size = v.into();
2574 self
2575 }
2576
2577 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2579 self.0.request.page_token = v.into();
2580 self
2581 }
2582
2583 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2585 self.0.request.return_partial_success = v.into();
2586 self
2587 }
2588 }
2589
2590 #[doc(hidden)]
2591 impl gax::options::internal::RequestBuilder for ListOperations {
2592 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2593 &mut self.0.options
2594 }
2595 }
2596
2597 #[derive(Clone, Debug)]
2614 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2615
2616 impl GetOperation {
2617 pub(crate) fn new(
2618 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2619 ) -> Self {
2620 Self(RequestBuilder::new(stub))
2621 }
2622
2623 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2625 mut self,
2626 v: V,
2627 ) -> Self {
2628 self.0.request = v.into();
2629 self
2630 }
2631
2632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2634 self.0.options = v.into();
2635 self
2636 }
2637
2638 pub async fn send(self) -> Result<longrunning::model::Operation> {
2640 (*self.0.stub)
2641 .get_operation(self.0.request, self.0.options)
2642 .await
2643 .map(gax::response::Response::into_body)
2644 }
2645
2646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2648 self.0.request.name = v.into();
2649 self
2650 }
2651 }
2652
2653 #[doc(hidden)]
2654 impl gax::options::internal::RequestBuilder for GetOperation {
2655 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2656 &mut self.0.options
2657 }
2658 }
2659}
2660
2661pub mod firewall {
2662 use crate::Result;
2663
2664 pub type ClientBuilder =
2678 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2679
2680 pub(crate) mod client {
2681 use super::super::super::client::Firewall;
2682 pub struct Factory;
2683 impl gax::client_builder::internal::ClientFactory for Factory {
2684 type Client = Firewall;
2685 type Credentials = gaxi::options::Credentials;
2686 async fn build(
2687 self,
2688 config: gaxi::options::ClientConfig,
2689 ) -> gax::client_builder::Result<Self::Client> {
2690 Self::Client::new(config).await
2691 }
2692 }
2693 }
2694
2695 #[derive(Clone, Debug)]
2697 pub(crate) struct RequestBuilder<R: std::default::Default> {
2698 stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>,
2699 request: R,
2700 options: gax::options::RequestOptions,
2701 }
2702
2703 impl<R> RequestBuilder<R>
2704 where
2705 R: std::default::Default,
2706 {
2707 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2708 Self {
2709 stub,
2710 request: R::default(),
2711 options: gax::options::RequestOptions::default(),
2712 }
2713 }
2714 }
2715
2716 #[derive(Clone, Debug)]
2737 pub struct ListIngressRules(RequestBuilder<crate::model::ListIngressRulesRequest>);
2738
2739 impl ListIngressRules {
2740 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2741 Self(RequestBuilder::new(stub))
2742 }
2743
2744 pub fn with_request<V: Into<crate::model::ListIngressRulesRequest>>(
2746 mut self,
2747 v: V,
2748 ) -> Self {
2749 self.0.request = v.into();
2750 self
2751 }
2752
2753 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2755 self.0.options = v.into();
2756 self
2757 }
2758
2759 pub async fn send(self) -> Result<crate::model::ListIngressRulesResponse> {
2761 (*self.0.stub)
2762 .list_ingress_rules(self.0.request, self.0.options)
2763 .await
2764 .map(gax::response::Response::into_body)
2765 }
2766
2767 pub fn by_page(
2769 self,
2770 ) -> impl gax::paginator::Paginator<crate::model::ListIngressRulesResponse, gax::error::Error>
2771 {
2772 use std::clone::Clone;
2773 let token = self.0.request.page_token.clone();
2774 let execute = move |token: String| {
2775 let mut builder = self.clone();
2776 builder.0.request = builder.0.request.set_page_token(token);
2777 builder.send()
2778 };
2779 gax::paginator::internal::new_paginator(token, execute)
2780 }
2781
2782 pub fn by_item(
2784 self,
2785 ) -> impl gax::paginator::ItemPaginator<crate::model::ListIngressRulesResponse, gax::error::Error>
2786 {
2787 use gax::paginator::Paginator;
2788 self.by_page().items()
2789 }
2790
2791 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2793 self.0.request.parent = v.into();
2794 self
2795 }
2796
2797 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2799 self.0.request.page_size = v.into();
2800 self
2801 }
2802
2803 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2805 self.0.request.page_token = v.into();
2806 self
2807 }
2808
2809 pub fn set_matching_address<T: Into<std::string::String>>(mut self, v: T) -> Self {
2811 self.0.request.matching_address = v.into();
2812 self
2813 }
2814 }
2815
2816 #[doc(hidden)]
2817 impl gax::options::internal::RequestBuilder for ListIngressRules {
2818 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2819 &mut self.0.options
2820 }
2821 }
2822
2823 #[derive(Clone, Debug)]
2840 pub struct BatchUpdateIngressRules(
2841 RequestBuilder<crate::model::BatchUpdateIngressRulesRequest>,
2842 );
2843
2844 impl BatchUpdateIngressRules {
2845 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2846 Self(RequestBuilder::new(stub))
2847 }
2848
2849 pub fn with_request<V: Into<crate::model::BatchUpdateIngressRulesRequest>>(
2851 mut self,
2852 v: V,
2853 ) -> Self {
2854 self.0.request = v.into();
2855 self
2856 }
2857
2858 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2860 self.0.options = v.into();
2861 self
2862 }
2863
2864 pub async fn send(self) -> Result<crate::model::BatchUpdateIngressRulesResponse> {
2866 (*self.0.stub)
2867 .batch_update_ingress_rules(self.0.request, self.0.options)
2868 .await
2869 .map(gax::response::Response::into_body)
2870 }
2871
2872 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2874 self.0.request.name = v.into();
2875 self
2876 }
2877
2878 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
2880 where
2881 T: std::iter::IntoIterator<Item = V>,
2882 V: std::convert::Into<crate::model::FirewallRule>,
2883 {
2884 use std::iter::Iterator;
2885 self.0.request.ingress_rules = v.into_iter().map(|i| i.into()).collect();
2886 self
2887 }
2888 }
2889
2890 #[doc(hidden)]
2891 impl gax::options::internal::RequestBuilder for BatchUpdateIngressRules {
2892 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2893 &mut self.0.options
2894 }
2895 }
2896
2897 #[derive(Clone, Debug)]
2914 pub struct CreateIngressRule(RequestBuilder<crate::model::CreateIngressRuleRequest>);
2915
2916 impl CreateIngressRule {
2917 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2918 Self(RequestBuilder::new(stub))
2919 }
2920
2921 pub fn with_request<V: Into<crate::model::CreateIngressRuleRequest>>(
2923 mut self,
2924 v: V,
2925 ) -> Self {
2926 self.0.request = v.into();
2927 self
2928 }
2929
2930 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2932 self.0.options = v.into();
2933 self
2934 }
2935
2936 pub async fn send(self) -> Result<crate::model::FirewallRule> {
2938 (*self.0.stub)
2939 .create_ingress_rule(self.0.request, self.0.options)
2940 .await
2941 .map(gax::response::Response::into_body)
2942 }
2943
2944 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2946 self.0.request.parent = v.into();
2947 self
2948 }
2949
2950 pub fn set_rule<T>(mut self, v: T) -> Self
2952 where
2953 T: std::convert::Into<crate::model::FirewallRule>,
2954 {
2955 self.0.request.rule = std::option::Option::Some(v.into());
2956 self
2957 }
2958
2959 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
2961 where
2962 T: std::convert::Into<crate::model::FirewallRule>,
2963 {
2964 self.0.request.rule = v.map(|x| x.into());
2965 self
2966 }
2967 }
2968
2969 #[doc(hidden)]
2970 impl gax::options::internal::RequestBuilder for CreateIngressRule {
2971 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2972 &mut self.0.options
2973 }
2974 }
2975
2976 #[derive(Clone, Debug)]
2993 pub struct GetIngressRule(RequestBuilder<crate::model::GetIngressRuleRequest>);
2994
2995 impl GetIngressRule {
2996 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2997 Self(RequestBuilder::new(stub))
2998 }
2999
3000 pub fn with_request<V: Into<crate::model::GetIngressRuleRequest>>(mut self, v: V) -> Self {
3002 self.0.request = v.into();
3003 self
3004 }
3005
3006 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3008 self.0.options = v.into();
3009 self
3010 }
3011
3012 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3014 (*self.0.stub)
3015 .get_ingress_rule(self.0.request, self.0.options)
3016 .await
3017 .map(gax::response::Response::into_body)
3018 }
3019
3020 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3022 self.0.request.name = v.into();
3023 self
3024 }
3025 }
3026
3027 #[doc(hidden)]
3028 impl gax::options::internal::RequestBuilder for GetIngressRule {
3029 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3030 &mut self.0.options
3031 }
3032 }
3033
3034 #[derive(Clone, Debug)]
3051 pub struct UpdateIngressRule(RequestBuilder<crate::model::UpdateIngressRuleRequest>);
3052
3053 impl UpdateIngressRule {
3054 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3055 Self(RequestBuilder::new(stub))
3056 }
3057
3058 pub fn with_request<V: Into<crate::model::UpdateIngressRuleRequest>>(
3060 mut self,
3061 v: V,
3062 ) -> Self {
3063 self.0.request = v.into();
3064 self
3065 }
3066
3067 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3069 self.0.options = v.into();
3070 self
3071 }
3072
3073 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3075 (*self.0.stub)
3076 .update_ingress_rule(self.0.request, self.0.options)
3077 .await
3078 .map(gax::response::Response::into_body)
3079 }
3080
3081 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3083 self.0.request.name = v.into();
3084 self
3085 }
3086
3087 pub fn set_rule<T>(mut self, v: T) -> Self
3089 where
3090 T: std::convert::Into<crate::model::FirewallRule>,
3091 {
3092 self.0.request.rule = std::option::Option::Some(v.into());
3093 self
3094 }
3095
3096 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3098 where
3099 T: std::convert::Into<crate::model::FirewallRule>,
3100 {
3101 self.0.request.rule = v.map(|x| x.into());
3102 self
3103 }
3104
3105 pub fn set_update_mask<T>(mut self, v: T) -> Self
3107 where
3108 T: std::convert::Into<wkt::FieldMask>,
3109 {
3110 self.0.request.update_mask = std::option::Option::Some(v.into());
3111 self
3112 }
3113
3114 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3116 where
3117 T: std::convert::Into<wkt::FieldMask>,
3118 {
3119 self.0.request.update_mask = v.map(|x| x.into());
3120 self
3121 }
3122 }
3123
3124 #[doc(hidden)]
3125 impl gax::options::internal::RequestBuilder for UpdateIngressRule {
3126 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3127 &mut self.0.options
3128 }
3129 }
3130
3131 #[derive(Clone, Debug)]
3148 pub struct DeleteIngressRule(RequestBuilder<crate::model::DeleteIngressRuleRequest>);
3149
3150 impl DeleteIngressRule {
3151 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3152 Self(RequestBuilder::new(stub))
3153 }
3154
3155 pub fn with_request<V: Into<crate::model::DeleteIngressRuleRequest>>(
3157 mut self,
3158 v: V,
3159 ) -> Self {
3160 self.0.request = v.into();
3161 self
3162 }
3163
3164 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3166 self.0.options = v.into();
3167 self
3168 }
3169
3170 pub async fn send(self) -> Result<()> {
3172 (*self.0.stub)
3173 .delete_ingress_rule(self.0.request, self.0.options)
3174 .await
3175 .map(gax::response::Response::into_body)
3176 }
3177
3178 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3180 self.0.request.name = v.into();
3181 self
3182 }
3183 }
3184
3185 #[doc(hidden)]
3186 impl gax::options::internal::RequestBuilder for DeleteIngressRule {
3187 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3188 &mut self.0.options
3189 }
3190 }
3191
3192 #[derive(Clone, Debug)]
3213 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3214
3215 impl ListOperations {
3216 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3217 Self(RequestBuilder::new(stub))
3218 }
3219
3220 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3222 mut self,
3223 v: V,
3224 ) -> Self {
3225 self.0.request = v.into();
3226 self
3227 }
3228
3229 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3231 self.0.options = v.into();
3232 self
3233 }
3234
3235 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3237 (*self.0.stub)
3238 .list_operations(self.0.request, self.0.options)
3239 .await
3240 .map(gax::response::Response::into_body)
3241 }
3242
3243 pub fn by_page(
3245 self,
3246 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3247 {
3248 use std::clone::Clone;
3249 let token = self.0.request.page_token.clone();
3250 let execute = move |token: String| {
3251 let mut builder = self.clone();
3252 builder.0.request = builder.0.request.set_page_token(token);
3253 builder.send()
3254 };
3255 gax::paginator::internal::new_paginator(token, execute)
3256 }
3257
3258 pub fn by_item(
3260 self,
3261 ) -> impl gax::paginator::ItemPaginator<
3262 longrunning::model::ListOperationsResponse,
3263 gax::error::Error,
3264 > {
3265 use gax::paginator::Paginator;
3266 self.by_page().items()
3267 }
3268
3269 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3271 self.0.request.name = v.into();
3272 self
3273 }
3274
3275 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3277 self.0.request.filter = v.into();
3278 self
3279 }
3280
3281 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3283 self.0.request.page_size = v.into();
3284 self
3285 }
3286
3287 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3289 self.0.request.page_token = v.into();
3290 self
3291 }
3292
3293 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3295 self.0.request.return_partial_success = v.into();
3296 self
3297 }
3298 }
3299
3300 #[doc(hidden)]
3301 impl gax::options::internal::RequestBuilder for ListOperations {
3302 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3303 &mut self.0.options
3304 }
3305 }
3306
3307 #[derive(Clone, Debug)]
3324 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3325
3326 impl GetOperation {
3327 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3328 Self(RequestBuilder::new(stub))
3329 }
3330
3331 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3333 mut self,
3334 v: V,
3335 ) -> Self {
3336 self.0.request = v.into();
3337 self
3338 }
3339
3340 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3342 self.0.options = v.into();
3343 self
3344 }
3345
3346 pub async fn send(self) -> Result<longrunning::model::Operation> {
3348 (*self.0.stub)
3349 .get_operation(self.0.request, self.0.options)
3350 .await
3351 .map(gax::response::Response::into_body)
3352 }
3353
3354 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3356 self.0.request.name = v.into();
3357 self
3358 }
3359 }
3360
3361 #[doc(hidden)]
3362 impl gax::options::internal::RequestBuilder for GetOperation {
3363 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3364 &mut self.0.options
3365 }
3366 }
3367}
3368
3369pub mod authorized_domains {
3370 use crate::Result;
3371
3372 pub type ClientBuilder =
3386 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3387
3388 pub(crate) mod client {
3389 use super::super::super::client::AuthorizedDomains;
3390 pub struct Factory;
3391 impl gax::client_builder::internal::ClientFactory for Factory {
3392 type Client = AuthorizedDomains;
3393 type Credentials = gaxi::options::Credentials;
3394 async fn build(
3395 self,
3396 config: gaxi::options::ClientConfig,
3397 ) -> gax::client_builder::Result<Self::Client> {
3398 Self::Client::new(config).await
3399 }
3400 }
3401 }
3402
3403 #[derive(Clone, Debug)]
3405 pub(crate) struct RequestBuilder<R: std::default::Default> {
3406 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3407 request: R,
3408 options: gax::options::RequestOptions,
3409 }
3410
3411 impl<R> RequestBuilder<R>
3412 where
3413 R: std::default::Default,
3414 {
3415 pub(crate) fn new(
3416 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3417 ) -> Self {
3418 Self {
3419 stub,
3420 request: R::default(),
3421 options: gax::options::RequestOptions::default(),
3422 }
3423 }
3424 }
3425
3426 #[derive(Clone, Debug)]
3447 pub struct ListAuthorizedDomains(RequestBuilder<crate::model::ListAuthorizedDomainsRequest>);
3448
3449 impl ListAuthorizedDomains {
3450 pub(crate) fn new(
3451 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3452 ) -> Self {
3453 Self(RequestBuilder::new(stub))
3454 }
3455
3456 pub fn with_request<V: Into<crate::model::ListAuthorizedDomainsRequest>>(
3458 mut self,
3459 v: V,
3460 ) -> Self {
3461 self.0.request = v.into();
3462 self
3463 }
3464
3465 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3467 self.0.options = v.into();
3468 self
3469 }
3470
3471 pub async fn send(self) -> Result<crate::model::ListAuthorizedDomainsResponse> {
3473 (*self.0.stub)
3474 .list_authorized_domains(self.0.request, self.0.options)
3475 .await
3476 .map(gax::response::Response::into_body)
3477 }
3478
3479 pub fn by_page(
3481 self,
3482 ) -> impl gax::paginator::Paginator<crate::model::ListAuthorizedDomainsResponse, gax::error::Error>
3483 {
3484 use std::clone::Clone;
3485 let token = self.0.request.page_token.clone();
3486 let execute = move |token: String| {
3487 let mut builder = self.clone();
3488 builder.0.request = builder.0.request.set_page_token(token);
3489 builder.send()
3490 };
3491 gax::paginator::internal::new_paginator(token, execute)
3492 }
3493
3494 pub fn by_item(
3496 self,
3497 ) -> impl gax::paginator::ItemPaginator<
3498 crate::model::ListAuthorizedDomainsResponse,
3499 gax::error::Error,
3500 > {
3501 use gax::paginator::Paginator;
3502 self.by_page().items()
3503 }
3504
3505 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3507 self.0.request.parent = v.into();
3508 self
3509 }
3510
3511 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3513 self.0.request.page_size = v.into();
3514 self
3515 }
3516
3517 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3519 self.0.request.page_token = v.into();
3520 self
3521 }
3522 }
3523
3524 #[doc(hidden)]
3525 impl gax::options::internal::RequestBuilder for ListAuthorizedDomains {
3526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3527 &mut self.0.options
3528 }
3529 }
3530
3531 #[derive(Clone, Debug)]
3552 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3553
3554 impl ListOperations {
3555 pub(crate) fn new(
3556 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3557 ) -> Self {
3558 Self(RequestBuilder::new(stub))
3559 }
3560
3561 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3563 mut self,
3564 v: V,
3565 ) -> Self {
3566 self.0.request = v.into();
3567 self
3568 }
3569
3570 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3572 self.0.options = v.into();
3573 self
3574 }
3575
3576 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3578 (*self.0.stub)
3579 .list_operations(self.0.request, self.0.options)
3580 .await
3581 .map(gax::response::Response::into_body)
3582 }
3583
3584 pub fn by_page(
3586 self,
3587 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3588 {
3589 use std::clone::Clone;
3590 let token = self.0.request.page_token.clone();
3591 let execute = move |token: String| {
3592 let mut builder = self.clone();
3593 builder.0.request = builder.0.request.set_page_token(token);
3594 builder.send()
3595 };
3596 gax::paginator::internal::new_paginator(token, execute)
3597 }
3598
3599 pub fn by_item(
3601 self,
3602 ) -> impl gax::paginator::ItemPaginator<
3603 longrunning::model::ListOperationsResponse,
3604 gax::error::Error,
3605 > {
3606 use gax::paginator::Paginator;
3607 self.by_page().items()
3608 }
3609
3610 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3612 self.0.request.name = v.into();
3613 self
3614 }
3615
3616 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3618 self.0.request.filter = v.into();
3619 self
3620 }
3621
3622 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3624 self.0.request.page_size = v.into();
3625 self
3626 }
3627
3628 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3630 self.0.request.page_token = v.into();
3631 self
3632 }
3633
3634 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3636 self.0.request.return_partial_success = v.into();
3637 self
3638 }
3639 }
3640
3641 #[doc(hidden)]
3642 impl gax::options::internal::RequestBuilder for ListOperations {
3643 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3644 &mut self.0.options
3645 }
3646 }
3647
3648 #[derive(Clone, Debug)]
3665 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3666
3667 impl GetOperation {
3668 pub(crate) fn new(
3669 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3670 ) -> Self {
3671 Self(RequestBuilder::new(stub))
3672 }
3673
3674 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3676 mut self,
3677 v: V,
3678 ) -> Self {
3679 self.0.request = v.into();
3680 self
3681 }
3682
3683 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3685 self.0.options = v.into();
3686 self
3687 }
3688
3689 pub async fn send(self) -> Result<longrunning::model::Operation> {
3691 (*self.0.stub)
3692 .get_operation(self.0.request, self.0.options)
3693 .await
3694 .map(gax::response::Response::into_body)
3695 }
3696
3697 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3699 self.0.request.name = v.into();
3700 self
3701 }
3702 }
3703
3704 #[doc(hidden)]
3705 impl gax::options::internal::RequestBuilder for GetOperation {
3706 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3707 &mut self.0.options
3708 }
3709 }
3710}
3711
3712pub mod authorized_certificates {
3713 use crate::Result;
3714
3715 pub type ClientBuilder =
3729 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3730
3731 pub(crate) mod client {
3732 use super::super::super::client::AuthorizedCertificates;
3733 pub struct Factory;
3734 impl gax::client_builder::internal::ClientFactory for Factory {
3735 type Client = AuthorizedCertificates;
3736 type Credentials = gaxi::options::Credentials;
3737 async fn build(
3738 self,
3739 config: gaxi::options::ClientConfig,
3740 ) -> gax::client_builder::Result<Self::Client> {
3741 Self::Client::new(config).await
3742 }
3743 }
3744 }
3745
3746 #[derive(Clone, Debug)]
3748 pub(crate) struct RequestBuilder<R: std::default::Default> {
3749 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3750 request: R,
3751 options: gax::options::RequestOptions,
3752 }
3753
3754 impl<R> RequestBuilder<R>
3755 where
3756 R: std::default::Default,
3757 {
3758 pub(crate) fn new(
3759 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3760 ) -> Self {
3761 Self {
3762 stub,
3763 request: R::default(),
3764 options: gax::options::RequestOptions::default(),
3765 }
3766 }
3767 }
3768
3769 #[derive(Clone, Debug)]
3790 pub struct ListAuthorizedCertificates(
3791 RequestBuilder<crate::model::ListAuthorizedCertificatesRequest>,
3792 );
3793
3794 impl ListAuthorizedCertificates {
3795 pub(crate) fn new(
3796 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3797 ) -> Self {
3798 Self(RequestBuilder::new(stub))
3799 }
3800
3801 pub fn with_request<V: Into<crate::model::ListAuthorizedCertificatesRequest>>(
3803 mut self,
3804 v: V,
3805 ) -> Self {
3806 self.0.request = v.into();
3807 self
3808 }
3809
3810 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3812 self.0.options = v.into();
3813 self
3814 }
3815
3816 pub async fn send(self) -> Result<crate::model::ListAuthorizedCertificatesResponse> {
3818 (*self.0.stub)
3819 .list_authorized_certificates(self.0.request, self.0.options)
3820 .await
3821 .map(gax::response::Response::into_body)
3822 }
3823
3824 pub fn by_page(
3826 self,
3827 ) -> impl gax::paginator::Paginator<
3828 crate::model::ListAuthorizedCertificatesResponse,
3829 gax::error::Error,
3830 > {
3831 use std::clone::Clone;
3832 let token = self.0.request.page_token.clone();
3833 let execute = move |token: String| {
3834 let mut builder = self.clone();
3835 builder.0.request = builder.0.request.set_page_token(token);
3836 builder.send()
3837 };
3838 gax::paginator::internal::new_paginator(token, execute)
3839 }
3840
3841 pub fn by_item(
3843 self,
3844 ) -> impl gax::paginator::ItemPaginator<
3845 crate::model::ListAuthorizedCertificatesResponse,
3846 gax::error::Error,
3847 > {
3848 use gax::paginator::Paginator;
3849 self.by_page().items()
3850 }
3851
3852 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3854 self.0.request.parent = v.into();
3855 self
3856 }
3857
3858 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
3860 self.0.request.view = v.into();
3861 self
3862 }
3863
3864 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3866 self.0.request.page_size = v.into();
3867 self
3868 }
3869
3870 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3872 self.0.request.page_token = v.into();
3873 self
3874 }
3875 }
3876
3877 #[doc(hidden)]
3878 impl gax::options::internal::RequestBuilder for ListAuthorizedCertificates {
3879 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3880 &mut self.0.options
3881 }
3882 }
3883
3884 #[derive(Clone, Debug)]
3901 pub struct GetAuthorizedCertificate(
3902 RequestBuilder<crate::model::GetAuthorizedCertificateRequest>,
3903 );
3904
3905 impl GetAuthorizedCertificate {
3906 pub(crate) fn new(
3907 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3908 ) -> Self {
3909 Self(RequestBuilder::new(stub))
3910 }
3911
3912 pub fn with_request<V: Into<crate::model::GetAuthorizedCertificateRequest>>(
3914 mut self,
3915 v: V,
3916 ) -> Self {
3917 self.0.request = v.into();
3918 self
3919 }
3920
3921 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3923 self.0.options = v.into();
3924 self
3925 }
3926
3927 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
3929 (*self.0.stub)
3930 .get_authorized_certificate(self.0.request, self.0.options)
3931 .await
3932 .map(gax::response::Response::into_body)
3933 }
3934
3935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3937 self.0.request.name = v.into();
3938 self
3939 }
3940
3941 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
3943 self.0.request.view = v.into();
3944 self
3945 }
3946 }
3947
3948 #[doc(hidden)]
3949 impl gax::options::internal::RequestBuilder for GetAuthorizedCertificate {
3950 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3951 &mut self.0.options
3952 }
3953 }
3954
3955 #[derive(Clone, Debug)]
3972 pub struct CreateAuthorizedCertificate(
3973 RequestBuilder<crate::model::CreateAuthorizedCertificateRequest>,
3974 );
3975
3976 impl CreateAuthorizedCertificate {
3977 pub(crate) fn new(
3978 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3979 ) -> Self {
3980 Self(RequestBuilder::new(stub))
3981 }
3982
3983 pub fn with_request<V: Into<crate::model::CreateAuthorizedCertificateRequest>>(
3985 mut self,
3986 v: V,
3987 ) -> Self {
3988 self.0.request = v.into();
3989 self
3990 }
3991
3992 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3994 self.0.options = v.into();
3995 self
3996 }
3997
3998 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4000 (*self.0.stub)
4001 .create_authorized_certificate(self.0.request, self.0.options)
4002 .await
4003 .map(gax::response::Response::into_body)
4004 }
4005
4006 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4008 self.0.request.parent = v.into();
4009 self
4010 }
4011
4012 pub fn set_certificate<T>(mut self, v: T) -> Self
4014 where
4015 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4016 {
4017 self.0.request.certificate = std::option::Option::Some(v.into());
4018 self
4019 }
4020
4021 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4023 where
4024 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4025 {
4026 self.0.request.certificate = v.map(|x| x.into());
4027 self
4028 }
4029 }
4030
4031 #[doc(hidden)]
4032 impl gax::options::internal::RequestBuilder for CreateAuthorizedCertificate {
4033 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4034 &mut self.0.options
4035 }
4036 }
4037
4038 #[derive(Clone, Debug)]
4055 pub struct UpdateAuthorizedCertificate(
4056 RequestBuilder<crate::model::UpdateAuthorizedCertificateRequest>,
4057 );
4058
4059 impl UpdateAuthorizedCertificate {
4060 pub(crate) fn new(
4061 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4062 ) -> Self {
4063 Self(RequestBuilder::new(stub))
4064 }
4065
4066 pub fn with_request<V: Into<crate::model::UpdateAuthorizedCertificateRequest>>(
4068 mut self,
4069 v: V,
4070 ) -> Self {
4071 self.0.request = v.into();
4072 self
4073 }
4074
4075 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4077 self.0.options = v.into();
4078 self
4079 }
4080
4081 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4083 (*self.0.stub)
4084 .update_authorized_certificate(self.0.request, self.0.options)
4085 .await
4086 .map(gax::response::Response::into_body)
4087 }
4088
4089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4091 self.0.request.name = v.into();
4092 self
4093 }
4094
4095 pub fn set_certificate<T>(mut self, v: T) -> Self
4097 where
4098 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4099 {
4100 self.0.request.certificate = std::option::Option::Some(v.into());
4101 self
4102 }
4103
4104 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4106 where
4107 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4108 {
4109 self.0.request.certificate = v.map(|x| x.into());
4110 self
4111 }
4112
4113 pub fn set_update_mask<T>(mut self, v: T) -> Self
4115 where
4116 T: std::convert::Into<wkt::FieldMask>,
4117 {
4118 self.0.request.update_mask = std::option::Option::Some(v.into());
4119 self
4120 }
4121
4122 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4124 where
4125 T: std::convert::Into<wkt::FieldMask>,
4126 {
4127 self.0.request.update_mask = v.map(|x| x.into());
4128 self
4129 }
4130 }
4131
4132 #[doc(hidden)]
4133 impl gax::options::internal::RequestBuilder for UpdateAuthorizedCertificate {
4134 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4135 &mut self.0.options
4136 }
4137 }
4138
4139 #[derive(Clone, Debug)]
4156 pub struct DeleteAuthorizedCertificate(
4157 RequestBuilder<crate::model::DeleteAuthorizedCertificateRequest>,
4158 );
4159
4160 impl DeleteAuthorizedCertificate {
4161 pub(crate) fn new(
4162 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4163 ) -> Self {
4164 Self(RequestBuilder::new(stub))
4165 }
4166
4167 pub fn with_request<V: Into<crate::model::DeleteAuthorizedCertificateRequest>>(
4169 mut self,
4170 v: V,
4171 ) -> Self {
4172 self.0.request = v.into();
4173 self
4174 }
4175
4176 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4178 self.0.options = v.into();
4179 self
4180 }
4181
4182 pub async fn send(self) -> Result<()> {
4184 (*self.0.stub)
4185 .delete_authorized_certificate(self.0.request, self.0.options)
4186 .await
4187 .map(gax::response::Response::into_body)
4188 }
4189
4190 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4192 self.0.request.name = v.into();
4193 self
4194 }
4195 }
4196
4197 #[doc(hidden)]
4198 impl gax::options::internal::RequestBuilder for DeleteAuthorizedCertificate {
4199 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4200 &mut self.0.options
4201 }
4202 }
4203
4204 #[derive(Clone, Debug)]
4225 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4226
4227 impl ListOperations {
4228 pub(crate) fn new(
4229 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4230 ) -> Self {
4231 Self(RequestBuilder::new(stub))
4232 }
4233
4234 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4236 mut self,
4237 v: V,
4238 ) -> Self {
4239 self.0.request = v.into();
4240 self
4241 }
4242
4243 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4245 self.0.options = v.into();
4246 self
4247 }
4248
4249 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4251 (*self.0.stub)
4252 .list_operations(self.0.request, self.0.options)
4253 .await
4254 .map(gax::response::Response::into_body)
4255 }
4256
4257 pub fn by_page(
4259 self,
4260 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4261 {
4262 use std::clone::Clone;
4263 let token = self.0.request.page_token.clone();
4264 let execute = move |token: String| {
4265 let mut builder = self.clone();
4266 builder.0.request = builder.0.request.set_page_token(token);
4267 builder.send()
4268 };
4269 gax::paginator::internal::new_paginator(token, execute)
4270 }
4271
4272 pub fn by_item(
4274 self,
4275 ) -> impl gax::paginator::ItemPaginator<
4276 longrunning::model::ListOperationsResponse,
4277 gax::error::Error,
4278 > {
4279 use gax::paginator::Paginator;
4280 self.by_page().items()
4281 }
4282
4283 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4285 self.0.request.name = v.into();
4286 self
4287 }
4288
4289 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4291 self.0.request.filter = v.into();
4292 self
4293 }
4294
4295 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4297 self.0.request.page_size = v.into();
4298 self
4299 }
4300
4301 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4303 self.0.request.page_token = v.into();
4304 self
4305 }
4306
4307 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4309 self.0.request.return_partial_success = v.into();
4310 self
4311 }
4312 }
4313
4314 #[doc(hidden)]
4315 impl gax::options::internal::RequestBuilder for ListOperations {
4316 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4317 &mut self.0.options
4318 }
4319 }
4320
4321 #[derive(Clone, Debug)]
4338 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4339
4340 impl GetOperation {
4341 pub(crate) fn new(
4342 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4343 ) -> Self {
4344 Self(RequestBuilder::new(stub))
4345 }
4346
4347 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4349 mut self,
4350 v: V,
4351 ) -> Self {
4352 self.0.request = v.into();
4353 self
4354 }
4355
4356 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4358 self.0.options = v.into();
4359 self
4360 }
4361
4362 pub async fn send(self) -> Result<longrunning::model::Operation> {
4364 (*self.0.stub)
4365 .get_operation(self.0.request, self.0.options)
4366 .await
4367 .map(gax::response::Response::into_body)
4368 }
4369
4370 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4372 self.0.request.name = v.into();
4373 self
4374 }
4375 }
4376
4377 #[doc(hidden)]
4378 impl gax::options::internal::RequestBuilder for GetOperation {
4379 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4380 &mut self.0.options
4381 }
4382 }
4383}
4384
4385pub mod domain_mappings {
4386 use crate::Result;
4387
4388 pub type ClientBuilder =
4402 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4403
4404 pub(crate) mod client {
4405 use super::super::super::client::DomainMappings;
4406 pub struct Factory;
4407 impl gax::client_builder::internal::ClientFactory for Factory {
4408 type Client = DomainMappings;
4409 type Credentials = gaxi::options::Credentials;
4410 async fn build(
4411 self,
4412 config: gaxi::options::ClientConfig,
4413 ) -> gax::client_builder::Result<Self::Client> {
4414 Self::Client::new(config).await
4415 }
4416 }
4417 }
4418
4419 #[derive(Clone, Debug)]
4421 pub(crate) struct RequestBuilder<R: std::default::Default> {
4422 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4423 request: R,
4424 options: gax::options::RequestOptions,
4425 }
4426
4427 impl<R> RequestBuilder<R>
4428 where
4429 R: std::default::Default,
4430 {
4431 pub(crate) fn new(
4432 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4433 ) -> Self {
4434 Self {
4435 stub,
4436 request: R::default(),
4437 options: gax::options::RequestOptions::default(),
4438 }
4439 }
4440 }
4441
4442 #[derive(Clone, Debug)]
4463 pub struct ListDomainMappings(RequestBuilder<crate::model::ListDomainMappingsRequest>);
4464
4465 impl ListDomainMappings {
4466 pub(crate) fn new(
4467 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4468 ) -> Self {
4469 Self(RequestBuilder::new(stub))
4470 }
4471
4472 pub fn with_request<V: Into<crate::model::ListDomainMappingsRequest>>(
4474 mut self,
4475 v: V,
4476 ) -> Self {
4477 self.0.request = v.into();
4478 self
4479 }
4480
4481 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4483 self.0.options = v.into();
4484 self
4485 }
4486
4487 pub async fn send(self) -> Result<crate::model::ListDomainMappingsResponse> {
4489 (*self.0.stub)
4490 .list_domain_mappings(self.0.request, self.0.options)
4491 .await
4492 .map(gax::response::Response::into_body)
4493 }
4494
4495 pub fn by_page(
4497 self,
4498 ) -> impl gax::paginator::Paginator<crate::model::ListDomainMappingsResponse, gax::error::Error>
4499 {
4500 use std::clone::Clone;
4501 let token = self.0.request.page_token.clone();
4502 let execute = move |token: String| {
4503 let mut builder = self.clone();
4504 builder.0.request = builder.0.request.set_page_token(token);
4505 builder.send()
4506 };
4507 gax::paginator::internal::new_paginator(token, execute)
4508 }
4509
4510 pub fn by_item(
4512 self,
4513 ) -> impl gax::paginator::ItemPaginator<
4514 crate::model::ListDomainMappingsResponse,
4515 gax::error::Error,
4516 > {
4517 use gax::paginator::Paginator;
4518 self.by_page().items()
4519 }
4520
4521 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4523 self.0.request.parent = v.into();
4524 self
4525 }
4526
4527 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4529 self.0.request.page_size = v.into();
4530 self
4531 }
4532
4533 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4535 self.0.request.page_token = v.into();
4536 self
4537 }
4538 }
4539
4540 #[doc(hidden)]
4541 impl gax::options::internal::RequestBuilder for ListDomainMappings {
4542 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4543 &mut self.0.options
4544 }
4545 }
4546
4547 #[derive(Clone, Debug)]
4564 pub struct GetDomainMapping(RequestBuilder<crate::model::GetDomainMappingRequest>);
4565
4566 impl GetDomainMapping {
4567 pub(crate) fn new(
4568 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4569 ) -> Self {
4570 Self(RequestBuilder::new(stub))
4571 }
4572
4573 pub fn with_request<V: Into<crate::model::GetDomainMappingRequest>>(
4575 mut self,
4576 v: V,
4577 ) -> Self {
4578 self.0.request = v.into();
4579 self
4580 }
4581
4582 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4584 self.0.options = v.into();
4585 self
4586 }
4587
4588 pub async fn send(self) -> Result<crate::model::DomainMapping> {
4590 (*self.0.stub)
4591 .get_domain_mapping(self.0.request, self.0.options)
4592 .await
4593 .map(gax::response::Response::into_body)
4594 }
4595
4596 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4598 self.0.request.name = v.into();
4599 self
4600 }
4601 }
4602
4603 #[doc(hidden)]
4604 impl gax::options::internal::RequestBuilder for GetDomainMapping {
4605 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4606 &mut self.0.options
4607 }
4608 }
4609
4610 #[derive(Clone, Debug)]
4628 pub struct CreateDomainMapping(RequestBuilder<crate::model::CreateDomainMappingRequest>);
4629
4630 impl CreateDomainMapping {
4631 pub(crate) fn new(
4632 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4633 ) -> Self {
4634 Self(RequestBuilder::new(stub))
4635 }
4636
4637 pub fn with_request<V: Into<crate::model::CreateDomainMappingRequest>>(
4639 mut self,
4640 v: V,
4641 ) -> Self {
4642 self.0.request = v.into();
4643 self
4644 }
4645
4646 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4648 self.0.options = v.into();
4649 self
4650 }
4651
4652 pub async fn send(self) -> Result<longrunning::model::Operation> {
4659 (*self.0.stub)
4660 .create_domain_mapping(self.0.request, self.0.options)
4661 .await
4662 .map(gax::response::Response::into_body)
4663 }
4664
4665 pub fn poller(
4667 self,
4668 ) -> impl lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4669 {
4670 type Operation = lro::internal::Operation<
4671 crate::model::DomainMapping,
4672 crate::model::OperationMetadataV1,
4673 >;
4674 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4675 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4676
4677 let stub = self.0.stub.clone();
4678 let mut options = self.0.options.clone();
4679 options.set_retry_policy(gax::retry_policy::NeverRetry);
4680 let query = move |name| {
4681 let stub = stub.clone();
4682 let options = options.clone();
4683 async {
4684 let op = GetOperation::new(stub)
4685 .set_name(name)
4686 .with_options(options)
4687 .send()
4688 .await?;
4689 Ok(Operation::new(op))
4690 }
4691 };
4692
4693 let start = move || async {
4694 let op = self.send().await?;
4695 Ok(Operation::new(op))
4696 };
4697
4698 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4699 }
4700
4701 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4703 self.0.request.parent = v.into();
4704 self
4705 }
4706
4707 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4709 where
4710 T: std::convert::Into<crate::model::DomainMapping>,
4711 {
4712 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4713 self
4714 }
4715
4716 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4718 where
4719 T: std::convert::Into<crate::model::DomainMapping>,
4720 {
4721 self.0.request.domain_mapping = v.map(|x| x.into());
4722 self
4723 }
4724
4725 pub fn set_override_strategy<T: Into<crate::model::DomainOverrideStrategy>>(
4727 mut self,
4728 v: T,
4729 ) -> Self {
4730 self.0.request.override_strategy = v.into();
4731 self
4732 }
4733 }
4734
4735 #[doc(hidden)]
4736 impl gax::options::internal::RequestBuilder for CreateDomainMapping {
4737 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4738 &mut self.0.options
4739 }
4740 }
4741
4742 #[derive(Clone, Debug)]
4760 pub struct UpdateDomainMapping(RequestBuilder<crate::model::UpdateDomainMappingRequest>);
4761
4762 impl UpdateDomainMapping {
4763 pub(crate) fn new(
4764 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4765 ) -> Self {
4766 Self(RequestBuilder::new(stub))
4767 }
4768
4769 pub fn with_request<V: Into<crate::model::UpdateDomainMappingRequest>>(
4771 mut self,
4772 v: V,
4773 ) -> Self {
4774 self.0.request = v.into();
4775 self
4776 }
4777
4778 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4780 self.0.options = v.into();
4781 self
4782 }
4783
4784 pub async fn send(self) -> Result<longrunning::model::Operation> {
4791 (*self.0.stub)
4792 .update_domain_mapping(self.0.request, self.0.options)
4793 .await
4794 .map(gax::response::Response::into_body)
4795 }
4796
4797 pub fn poller(
4799 self,
4800 ) -> impl lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4801 {
4802 type Operation = lro::internal::Operation<
4803 crate::model::DomainMapping,
4804 crate::model::OperationMetadataV1,
4805 >;
4806 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4807 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4808
4809 let stub = self.0.stub.clone();
4810 let mut options = self.0.options.clone();
4811 options.set_retry_policy(gax::retry_policy::NeverRetry);
4812 let query = move |name| {
4813 let stub = stub.clone();
4814 let options = options.clone();
4815 async {
4816 let op = GetOperation::new(stub)
4817 .set_name(name)
4818 .with_options(options)
4819 .send()
4820 .await?;
4821 Ok(Operation::new(op))
4822 }
4823 };
4824
4825 let start = move || async {
4826 let op = self.send().await?;
4827 Ok(Operation::new(op))
4828 };
4829
4830 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4831 }
4832
4833 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4835 self.0.request.name = v.into();
4836 self
4837 }
4838
4839 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4841 where
4842 T: std::convert::Into<crate::model::DomainMapping>,
4843 {
4844 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4845 self
4846 }
4847
4848 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4850 where
4851 T: std::convert::Into<crate::model::DomainMapping>,
4852 {
4853 self.0.request.domain_mapping = v.map(|x| x.into());
4854 self
4855 }
4856
4857 pub fn set_update_mask<T>(mut self, v: T) -> Self
4859 where
4860 T: std::convert::Into<wkt::FieldMask>,
4861 {
4862 self.0.request.update_mask = std::option::Option::Some(v.into());
4863 self
4864 }
4865
4866 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4868 where
4869 T: std::convert::Into<wkt::FieldMask>,
4870 {
4871 self.0.request.update_mask = v.map(|x| x.into());
4872 self
4873 }
4874 }
4875
4876 #[doc(hidden)]
4877 impl gax::options::internal::RequestBuilder for UpdateDomainMapping {
4878 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4879 &mut self.0.options
4880 }
4881 }
4882
4883 #[derive(Clone, Debug)]
4901 pub struct DeleteDomainMapping(RequestBuilder<crate::model::DeleteDomainMappingRequest>);
4902
4903 impl DeleteDomainMapping {
4904 pub(crate) fn new(
4905 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4906 ) -> Self {
4907 Self(RequestBuilder::new(stub))
4908 }
4909
4910 pub fn with_request<V: Into<crate::model::DeleteDomainMappingRequest>>(
4912 mut self,
4913 v: V,
4914 ) -> Self {
4915 self.0.request = v.into();
4916 self
4917 }
4918
4919 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4921 self.0.options = v.into();
4922 self
4923 }
4924
4925 pub async fn send(self) -> Result<longrunning::model::Operation> {
4932 (*self.0.stub)
4933 .delete_domain_mapping(self.0.request, self.0.options)
4934 .await
4935 .map(gax::response::Response::into_body)
4936 }
4937
4938 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
4940 type Operation =
4941 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
4942 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4943 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4944
4945 let stub = self.0.stub.clone();
4946 let mut options = self.0.options.clone();
4947 options.set_retry_policy(gax::retry_policy::NeverRetry);
4948 let query = move |name| {
4949 let stub = stub.clone();
4950 let options = options.clone();
4951 async {
4952 let op = GetOperation::new(stub)
4953 .set_name(name)
4954 .with_options(options)
4955 .send()
4956 .await?;
4957 Ok(Operation::new(op))
4958 }
4959 };
4960
4961 let start = move || async {
4962 let op = self.send().await?;
4963 Ok(Operation::new(op))
4964 };
4965
4966 lro::internal::new_unit_response_poller(
4967 polling_error_policy,
4968 polling_backoff_policy,
4969 start,
4970 query,
4971 )
4972 }
4973
4974 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4976 self.0.request.name = v.into();
4977 self
4978 }
4979 }
4980
4981 #[doc(hidden)]
4982 impl gax::options::internal::RequestBuilder for DeleteDomainMapping {
4983 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4984 &mut self.0.options
4985 }
4986 }
4987
4988 #[derive(Clone, Debug)]
5009 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5010
5011 impl ListOperations {
5012 pub(crate) fn new(
5013 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5014 ) -> Self {
5015 Self(RequestBuilder::new(stub))
5016 }
5017
5018 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5020 mut self,
5021 v: V,
5022 ) -> Self {
5023 self.0.request = v.into();
5024 self
5025 }
5026
5027 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5029 self.0.options = v.into();
5030 self
5031 }
5032
5033 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5035 (*self.0.stub)
5036 .list_operations(self.0.request, self.0.options)
5037 .await
5038 .map(gax::response::Response::into_body)
5039 }
5040
5041 pub fn by_page(
5043 self,
5044 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5045 {
5046 use std::clone::Clone;
5047 let token = self.0.request.page_token.clone();
5048 let execute = move |token: String| {
5049 let mut builder = self.clone();
5050 builder.0.request = builder.0.request.set_page_token(token);
5051 builder.send()
5052 };
5053 gax::paginator::internal::new_paginator(token, execute)
5054 }
5055
5056 pub fn by_item(
5058 self,
5059 ) -> impl gax::paginator::ItemPaginator<
5060 longrunning::model::ListOperationsResponse,
5061 gax::error::Error,
5062 > {
5063 use gax::paginator::Paginator;
5064 self.by_page().items()
5065 }
5066
5067 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5069 self.0.request.name = v.into();
5070 self
5071 }
5072
5073 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5075 self.0.request.filter = v.into();
5076 self
5077 }
5078
5079 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5081 self.0.request.page_size = v.into();
5082 self
5083 }
5084
5085 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5087 self.0.request.page_token = v.into();
5088 self
5089 }
5090
5091 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5093 self.0.request.return_partial_success = v.into();
5094 self
5095 }
5096 }
5097
5098 #[doc(hidden)]
5099 impl gax::options::internal::RequestBuilder for ListOperations {
5100 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5101 &mut self.0.options
5102 }
5103 }
5104
5105 #[derive(Clone, Debug)]
5122 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5123
5124 impl GetOperation {
5125 pub(crate) fn new(
5126 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5127 ) -> Self {
5128 Self(RequestBuilder::new(stub))
5129 }
5130
5131 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5133 mut self,
5134 v: V,
5135 ) -> Self {
5136 self.0.request = v.into();
5137 self
5138 }
5139
5140 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5142 self.0.options = v.into();
5143 self
5144 }
5145
5146 pub async fn send(self) -> Result<longrunning::model::Operation> {
5148 (*self.0.stub)
5149 .get_operation(self.0.request, self.0.options)
5150 .await
5151 .map(gax::response::Response::into_body)
5152 }
5153
5154 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5156 self.0.request.name = v.into();
5157 self
5158 }
5159 }
5160
5161 #[doc(hidden)]
5162 impl gax::options::internal::RequestBuilder for GetOperation {
5163 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5164 &mut self.0.options
5165 }
5166 }
5167}