1pub mod applications {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Applications;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = Applications;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
93
94 impl GetApplication {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<crate::model::Application> {
115 (*self.0.stub)
116 .get_application(self.0.request, self.0.options)
117 .await
118 .map(gax::response::Response::into_body)
119 }
120
121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
123 self.0.request.name = v.into();
124 self
125 }
126 }
127
128 #[doc(hidden)]
129 impl gax::options::internal::RequestBuilder for GetApplication {
130 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
131 &mut self.0.options
132 }
133 }
134
135 #[derive(Clone, Debug)]
154 pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
155
156 impl CreateApplication {
157 pub(crate) fn new(
158 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
159 ) -> Self {
160 Self(RequestBuilder::new(stub))
161 }
162
163 pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
165 mut self,
166 v: V,
167 ) -> Self {
168 self.0.request = v.into();
169 self
170 }
171
172 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
174 self.0.options = v.into();
175 self
176 }
177
178 pub async fn send(self) -> Result<longrunning::model::Operation> {
185 (*self.0.stub)
186 .create_application(self.0.request, self.0.options)
187 .await
188 .map(gax::response::Response::into_body)
189 }
190
191 pub fn poller(
193 self,
194 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
195 {
196 type Operation = lro::internal::Operation<
197 crate::model::Application,
198 crate::model::OperationMetadataV1,
199 >;
200 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
201 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
202
203 let stub = self.0.stub.clone();
204 let mut options = self.0.options.clone();
205 options.set_retry_policy(gax::retry_policy::NeverRetry);
206 let query = move |name| {
207 let stub = stub.clone();
208 let options = options.clone();
209 async {
210 let op = GetOperation::new(stub)
211 .set_name(name)
212 .with_options(options)
213 .send()
214 .await?;
215 Ok(Operation::new(op))
216 }
217 };
218
219 let start = move || async {
220 let op = self.send().await?;
221 Ok(Operation::new(op))
222 };
223
224 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
225 }
226
227 pub fn set_application<T>(mut self, v: T) -> Self
229 where
230 T: std::convert::Into<crate::model::Application>,
231 {
232 self.0.request.application = std::option::Option::Some(v.into());
233 self
234 }
235
236 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
238 where
239 T: std::convert::Into<crate::model::Application>,
240 {
241 self.0.request.application = v.map(|x| x.into());
242 self
243 }
244 }
245
246 #[doc(hidden)]
247 impl gax::options::internal::RequestBuilder for CreateApplication {
248 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
249 &mut self.0.options
250 }
251 }
252
253 #[derive(Clone, Debug)]
272 pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
273
274 impl UpdateApplication {
275 pub(crate) fn new(
276 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
277 ) -> Self {
278 Self(RequestBuilder::new(stub))
279 }
280
281 pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
283 mut self,
284 v: V,
285 ) -> Self {
286 self.0.request = v.into();
287 self
288 }
289
290 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
292 self.0.options = v.into();
293 self
294 }
295
296 pub async fn send(self) -> Result<longrunning::model::Operation> {
303 (*self.0.stub)
304 .update_application(self.0.request, self.0.options)
305 .await
306 .map(gax::response::Response::into_body)
307 }
308
309 pub fn poller(
311 self,
312 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
313 {
314 type Operation = lro::internal::Operation<
315 crate::model::Application,
316 crate::model::OperationMetadataV1,
317 >;
318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
320
321 let stub = self.0.stub.clone();
322 let mut options = self.0.options.clone();
323 options.set_retry_policy(gax::retry_policy::NeverRetry);
324 let query = move |name| {
325 let stub = stub.clone();
326 let options = options.clone();
327 async {
328 let op = GetOperation::new(stub)
329 .set_name(name)
330 .with_options(options)
331 .send()
332 .await?;
333 Ok(Operation::new(op))
334 }
335 };
336
337 let start = move || async {
338 let op = self.send().await?;
339 Ok(Operation::new(op))
340 };
341
342 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
343 }
344
345 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
347 self.0.request.name = v.into();
348 self
349 }
350
351 pub fn set_application<T>(mut self, v: T) -> Self
353 where
354 T: std::convert::Into<crate::model::Application>,
355 {
356 self.0.request.application = std::option::Option::Some(v.into());
357 self
358 }
359
360 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
362 where
363 T: std::convert::Into<crate::model::Application>,
364 {
365 self.0.request.application = v.map(|x| x.into());
366 self
367 }
368
369 pub fn set_update_mask<T>(mut self, v: T) -> Self
371 where
372 T: std::convert::Into<wkt::FieldMask>,
373 {
374 self.0.request.update_mask = std::option::Option::Some(v.into());
375 self
376 }
377
378 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
380 where
381 T: std::convert::Into<wkt::FieldMask>,
382 {
383 self.0.request.update_mask = v.map(|x| x.into());
384 self
385 }
386 }
387
388 #[doc(hidden)]
389 impl gax::options::internal::RequestBuilder for UpdateApplication {
390 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
391 &mut self.0.options
392 }
393 }
394
395 #[derive(Clone, Debug)]
414 pub struct RepairApplication(RequestBuilder<crate::model::RepairApplicationRequest>);
415
416 impl RepairApplication {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::RepairApplicationRequest>>(
425 mut self,
426 v: V,
427 ) -> Self {
428 self.0.request = v.into();
429 self
430 }
431
432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
434 self.0.options = v.into();
435 self
436 }
437
438 pub async fn send(self) -> Result<longrunning::model::Operation> {
445 (*self.0.stub)
446 .repair_application(self.0.request, self.0.options)
447 .await
448 .map(gax::response::Response::into_body)
449 }
450
451 pub fn poller(
453 self,
454 ) -> impl lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
455 {
456 type Operation = lro::internal::Operation<
457 crate::model::Application,
458 crate::model::OperationMetadataV1,
459 >;
460 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
461 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
462
463 let stub = self.0.stub.clone();
464 let mut options = self.0.options.clone();
465 options.set_retry_policy(gax::retry_policy::NeverRetry);
466 let query = move |name| {
467 let stub = stub.clone();
468 let options = options.clone();
469 async {
470 let op = GetOperation::new(stub)
471 .set_name(name)
472 .with_options(options)
473 .send()
474 .await?;
475 Ok(Operation::new(op))
476 }
477 };
478
479 let start = move || async {
480 let op = self.send().await?;
481 Ok(Operation::new(op))
482 };
483
484 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
485 }
486
487 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
489 self.0.request.name = v.into();
490 self
491 }
492 }
493
494 #[doc(hidden)]
495 impl gax::options::internal::RequestBuilder for RepairApplication {
496 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
497 &mut self.0.options
498 }
499 }
500
501 #[derive(Clone, Debug)]
523 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
524
525 impl ListOperations {
526 pub(crate) fn new(
527 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
528 ) -> Self {
529 Self(RequestBuilder::new(stub))
530 }
531
532 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
534 mut self,
535 v: V,
536 ) -> Self {
537 self.0.request = v.into();
538 self
539 }
540
541 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
543 self.0.options = v.into();
544 self
545 }
546
547 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
549 (*self.0.stub)
550 .list_operations(self.0.request, self.0.options)
551 .await
552 .map(gax::response::Response::into_body)
553 }
554
555 pub fn by_page(
557 self,
558 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
559 {
560 use std::clone::Clone;
561 let token = self.0.request.page_token.clone();
562 let execute = move |token: String| {
563 let mut builder = self.clone();
564 builder.0.request = builder.0.request.set_page_token(token);
565 builder.send()
566 };
567 gax::paginator::internal::new_paginator(token, execute)
568 }
569
570 pub fn by_item(
572 self,
573 ) -> impl gax::paginator::ItemPaginator<
574 longrunning::model::ListOperationsResponse,
575 gax::error::Error,
576 > {
577 use gax::paginator::Paginator;
578 self.by_page().items()
579 }
580
581 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
583 self.0.request.name = v.into();
584 self
585 }
586
587 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
589 self.0.request.filter = v.into();
590 self
591 }
592
593 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
595 self.0.request.page_size = v.into();
596 self
597 }
598
599 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
601 self.0.request.page_token = v.into();
602 self
603 }
604 }
605
606 #[doc(hidden)]
607 impl gax::options::internal::RequestBuilder for ListOperations {
608 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
609 &mut self.0.options
610 }
611 }
612
613 #[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)]
755 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
756
757 impl ListServices {
758 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
759 Self(RequestBuilder::new(stub))
760 }
761
762 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
764 self.0.request = v.into();
765 self
766 }
767
768 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
770 self.0.options = v.into();
771 self
772 }
773
774 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
776 (*self.0.stub)
777 .list_services(self.0.request, self.0.options)
778 .await
779 .map(gax::response::Response::into_body)
780 }
781
782 pub fn by_page(
784 self,
785 ) -> impl gax::paginator::Paginator<crate::model::ListServicesResponse, gax::error::Error>
786 {
787 use std::clone::Clone;
788 let token = self.0.request.page_token.clone();
789 let execute = move |token: String| {
790 let mut builder = self.clone();
791 builder.0.request = builder.0.request.set_page_token(token);
792 builder.send()
793 };
794 gax::paginator::internal::new_paginator(token, execute)
795 }
796
797 pub fn by_item(
799 self,
800 ) -> impl gax::paginator::ItemPaginator<crate::model::ListServicesResponse, gax::error::Error>
801 {
802 use gax::paginator::Paginator;
803 self.by_page().items()
804 }
805
806 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
808 self.0.request.parent = v.into();
809 self
810 }
811
812 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
814 self.0.request.page_size = v.into();
815 self
816 }
817
818 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
820 self.0.request.page_token = v.into();
821 self
822 }
823 }
824
825 #[doc(hidden)]
826 impl gax::options::internal::RequestBuilder for ListServices {
827 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
828 &mut self.0.options
829 }
830 }
831
832 #[derive(Clone, Debug)]
850 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
851
852 impl GetService {
853 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
854 Self(RequestBuilder::new(stub))
855 }
856
857 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
859 self.0.request = v.into();
860 self
861 }
862
863 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
865 self.0.options = v.into();
866 self
867 }
868
869 pub async fn send(self) -> Result<crate::model::Service> {
871 (*self.0.stub)
872 .get_service(self.0.request, self.0.options)
873 .await
874 .map(gax::response::Response::into_body)
875 }
876
877 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
879 self.0.request.name = v.into();
880 self
881 }
882 }
883
884 #[doc(hidden)]
885 impl gax::options::internal::RequestBuilder for GetService {
886 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
887 &mut self.0.options
888 }
889 }
890
891 #[derive(Clone, Debug)]
910 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
911
912 impl UpdateService {
913 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
914 Self(RequestBuilder::new(stub))
915 }
916
917 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
919 self.0.request = v.into();
920 self
921 }
922
923 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
925 self.0.options = v.into();
926 self
927 }
928
929 pub async fn send(self) -> Result<longrunning::model::Operation> {
936 (*self.0.stub)
937 .update_service(self.0.request, self.0.options)
938 .await
939 .map(gax::response::Response::into_body)
940 }
941
942 pub fn poller(
944 self,
945 ) -> impl lro::Poller<crate::model::Service, crate::model::OperationMetadataV1> {
946 type Operation =
947 lro::internal::Operation<crate::model::Service, crate::model::OperationMetadataV1>;
948 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
949 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
950
951 let stub = self.0.stub.clone();
952 let mut options = self.0.options.clone();
953 options.set_retry_policy(gax::retry_policy::NeverRetry);
954 let query = move |name| {
955 let stub = stub.clone();
956 let options = options.clone();
957 async {
958 let op = GetOperation::new(stub)
959 .set_name(name)
960 .with_options(options)
961 .send()
962 .await?;
963 Ok(Operation::new(op))
964 }
965 };
966
967 let start = move || async {
968 let op = self.send().await?;
969 Ok(Operation::new(op))
970 };
971
972 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
973 }
974
975 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
977 self.0.request.name = v.into();
978 self
979 }
980
981 pub fn set_service<T>(mut self, v: T) -> Self
983 where
984 T: std::convert::Into<crate::model::Service>,
985 {
986 self.0.request.service = std::option::Option::Some(v.into());
987 self
988 }
989
990 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
992 where
993 T: std::convert::Into<crate::model::Service>,
994 {
995 self.0.request.service = v.map(|x| x.into());
996 self
997 }
998
999 pub fn set_update_mask<T>(mut self, v: T) -> Self
1001 where
1002 T: std::convert::Into<wkt::FieldMask>,
1003 {
1004 self.0.request.update_mask = std::option::Option::Some(v.into());
1005 self
1006 }
1007
1008 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1010 where
1011 T: std::convert::Into<wkt::FieldMask>,
1012 {
1013 self.0.request.update_mask = v.map(|x| x.into());
1014 self
1015 }
1016
1017 pub fn set_migrate_traffic<T: Into<bool>>(mut self, v: T) -> Self {
1019 self.0.request.migrate_traffic = v.into();
1020 self
1021 }
1022 }
1023
1024 #[doc(hidden)]
1025 impl gax::options::internal::RequestBuilder for UpdateService {
1026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1027 &mut self.0.options
1028 }
1029 }
1030
1031 #[derive(Clone, Debug)]
1050 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1051
1052 impl DeleteService {
1053 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1054 Self(RequestBuilder::new(stub))
1055 }
1056
1057 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1059 self.0.request = v.into();
1060 self
1061 }
1062
1063 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1065 self.0.options = v.into();
1066 self
1067 }
1068
1069 pub async fn send(self) -> Result<longrunning::model::Operation> {
1076 (*self.0.stub)
1077 .delete_service(self.0.request, self.0.options)
1078 .await
1079 .map(gax::response::Response::into_body)
1080 }
1081
1082 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
1084 type Operation =
1085 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
1086 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1087 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1088
1089 let stub = self.0.stub.clone();
1090 let mut options = self.0.options.clone();
1091 options.set_retry_policy(gax::retry_policy::NeverRetry);
1092 let query = move |name| {
1093 let stub = stub.clone();
1094 let options = options.clone();
1095 async {
1096 let op = GetOperation::new(stub)
1097 .set_name(name)
1098 .with_options(options)
1099 .send()
1100 .await?;
1101 Ok(Operation::new(op))
1102 }
1103 };
1104
1105 let start = move || async {
1106 let op = self.send().await?;
1107 Ok(Operation::new(op))
1108 };
1109
1110 lro::internal::new_unit_response_poller(
1111 polling_error_policy,
1112 polling_backoff_policy,
1113 start,
1114 query,
1115 )
1116 }
1117
1118 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.0.request.name = v.into();
1121 self
1122 }
1123 }
1124
1125 #[doc(hidden)]
1126 impl gax::options::internal::RequestBuilder for DeleteService {
1127 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1128 &mut self.0.options
1129 }
1130 }
1131
1132 #[derive(Clone, Debug)]
1154 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1155
1156 impl ListOperations {
1157 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1158 Self(RequestBuilder::new(stub))
1159 }
1160
1161 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1163 mut self,
1164 v: V,
1165 ) -> Self {
1166 self.0.request = v.into();
1167 self
1168 }
1169
1170 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1172 self.0.options = v.into();
1173 self
1174 }
1175
1176 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1178 (*self.0.stub)
1179 .list_operations(self.0.request, self.0.options)
1180 .await
1181 .map(gax::response::Response::into_body)
1182 }
1183
1184 pub fn by_page(
1186 self,
1187 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1188 {
1189 use std::clone::Clone;
1190 let token = self.0.request.page_token.clone();
1191 let execute = move |token: String| {
1192 let mut builder = self.clone();
1193 builder.0.request = builder.0.request.set_page_token(token);
1194 builder.send()
1195 };
1196 gax::paginator::internal::new_paginator(token, execute)
1197 }
1198
1199 pub fn by_item(
1201 self,
1202 ) -> impl gax::paginator::ItemPaginator<
1203 longrunning::model::ListOperationsResponse,
1204 gax::error::Error,
1205 > {
1206 use gax::paginator::Paginator;
1207 self.by_page().items()
1208 }
1209
1210 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1212 self.0.request.name = v.into();
1213 self
1214 }
1215
1216 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1218 self.0.request.filter = v.into();
1219 self
1220 }
1221
1222 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1224 self.0.request.page_size = v.into();
1225 self
1226 }
1227
1228 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1230 self.0.request.page_token = v.into();
1231 self
1232 }
1233 }
1234
1235 #[doc(hidden)]
1236 impl gax::options::internal::RequestBuilder for ListOperations {
1237 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1238 &mut self.0.options
1239 }
1240 }
1241
1242 #[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)]
1382 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
1383
1384 impl ListVersions {
1385 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1386 Self(RequestBuilder::new(stub))
1387 }
1388
1389 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
1391 self.0.request = v.into();
1392 self
1393 }
1394
1395 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1397 self.0.options = v.into();
1398 self
1399 }
1400
1401 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
1403 (*self.0.stub)
1404 .list_versions(self.0.request, self.0.options)
1405 .await
1406 .map(gax::response::Response::into_body)
1407 }
1408
1409 pub fn by_page(
1411 self,
1412 ) -> impl gax::paginator::Paginator<crate::model::ListVersionsResponse, gax::error::Error>
1413 {
1414 use std::clone::Clone;
1415 let token = self.0.request.page_token.clone();
1416 let execute = move |token: String| {
1417 let mut builder = self.clone();
1418 builder.0.request = builder.0.request.set_page_token(token);
1419 builder.send()
1420 };
1421 gax::paginator::internal::new_paginator(token, execute)
1422 }
1423
1424 pub fn by_item(
1426 self,
1427 ) -> impl gax::paginator::ItemPaginator<crate::model::ListVersionsResponse, gax::error::Error>
1428 {
1429 use gax::paginator::Paginator;
1430 self.by_page().items()
1431 }
1432
1433 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1435 self.0.request.parent = v.into();
1436 self
1437 }
1438
1439 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1441 self.0.request.view = v.into();
1442 self
1443 }
1444
1445 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1447 self.0.request.page_size = v.into();
1448 self
1449 }
1450
1451 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1453 self.0.request.page_token = v.into();
1454 self
1455 }
1456 }
1457
1458 #[doc(hidden)]
1459 impl gax::options::internal::RequestBuilder for ListVersions {
1460 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1461 &mut self.0.options
1462 }
1463 }
1464
1465 #[derive(Clone, Debug)]
1483 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
1484
1485 impl GetVersion {
1486 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1487 Self(RequestBuilder::new(stub))
1488 }
1489
1490 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
1492 self.0.request = v.into();
1493 self
1494 }
1495
1496 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1498 self.0.options = v.into();
1499 self
1500 }
1501
1502 pub async fn send(self) -> Result<crate::model::Version> {
1504 (*self.0.stub)
1505 .get_version(self.0.request, self.0.options)
1506 .await
1507 .map(gax::response::Response::into_body)
1508 }
1509
1510 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1512 self.0.request.name = v.into();
1513 self
1514 }
1515
1516 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1518 self.0.request.view = v.into();
1519 self
1520 }
1521 }
1522
1523 #[doc(hidden)]
1524 impl gax::options::internal::RequestBuilder for GetVersion {
1525 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1526 &mut self.0.options
1527 }
1528 }
1529
1530 #[derive(Clone, Debug)]
1549 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
1550
1551 impl CreateVersion {
1552 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1553 Self(RequestBuilder::new(stub))
1554 }
1555
1556 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
1558 self.0.request = v.into();
1559 self
1560 }
1561
1562 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1564 self.0.options = v.into();
1565 self
1566 }
1567
1568 pub async fn send(self) -> Result<longrunning::model::Operation> {
1575 (*self.0.stub)
1576 .create_version(self.0.request, self.0.options)
1577 .await
1578 .map(gax::response::Response::into_body)
1579 }
1580
1581 pub fn poller(
1583 self,
1584 ) -> impl lro::Poller<crate::model::Version, crate::model::CreateVersionMetadataV1>
1585 {
1586 type Operation = lro::internal::Operation<
1587 crate::model::Version,
1588 crate::model::CreateVersionMetadataV1,
1589 >;
1590 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1591 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1592
1593 let stub = self.0.stub.clone();
1594 let mut options = self.0.options.clone();
1595 options.set_retry_policy(gax::retry_policy::NeverRetry);
1596 let query = move |name| {
1597 let stub = stub.clone();
1598 let options = options.clone();
1599 async {
1600 let op = GetOperation::new(stub)
1601 .set_name(name)
1602 .with_options(options)
1603 .send()
1604 .await?;
1605 Ok(Operation::new(op))
1606 }
1607 };
1608
1609 let start = move || async {
1610 let op = self.send().await?;
1611 Ok(Operation::new(op))
1612 };
1613
1614 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1615 }
1616
1617 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1619 self.0.request.parent = v.into();
1620 self
1621 }
1622
1623 pub fn set_version<T>(mut self, v: T) -> Self
1625 where
1626 T: std::convert::Into<crate::model::Version>,
1627 {
1628 self.0.request.version = std::option::Option::Some(v.into());
1629 self
1630 }
1631
1632 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1634 where
1635 T: std::convert::Into<crate::model::Version>,
1636 {
1637 self.0.request.version = v.map(|x| x.into());
1638 self
1639 }
1640 }
1641
1642 #[doc(hidden)]
1643 impl gax::options::internal::RequestBuilder for CreateVersion {
1644 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1645 &mut self.0.options
1646 }
1647 }
1648
1649 #[derive(Clone, Debug)]
1668 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
1669
1670 impl UpdateVersion {
1671 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1672 Self(RequestBuilder::new(stub))
1673 }
1674
1675 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
1677 self.0.request = v.into();
1678 self
1679 }
1680
1681 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1683 self.0.options = v.into();
1684 self
1685 }
1686
1687 pub async fn send(self) -> Result<longrunning::model::Operation> {
1694 (*self.0.stub)
1695 .update_version(self.0.request, self.0.options)
1696 .await
1697 .map(gax::response::Response::into_body)
1698 }
1699
1700 pub fn poller(
1702 self,
1703 ) -> impl lro::Poller<crate::model::Version, crate::model::OperationMetadataV1> {
1704 type Operation =
1705 lro::internal::Operation<crate::model::Version, crate::model::OperationMetadataV1>;
1706 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1707 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1708
1709 let stub = self.0.stub.clone();
1710 let mut options = self.0.options.clone();
1711 options.set_retry_policy(gax::retry_policy::NeverRetry);
1712 let query = move |name| {
1713 let stub = stub.clone();
1714 let options = options.clone();
1715 async {
1716 let op = GetOperation::new(stub)
1717 .set_name(name)
1718 .with_options(options)
1719 .send()
1720 .await?;
1721 Ok(Operation::new(op))
1722 }
1723 };
1724
1725 let start = move || async {
1726 let op = self.send().await?;
1727 Ok(Operation::new(op))
1728 };
1729
1730 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1731 }
1732
1733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1735 self.0.request.name = v.into();
1736 self
1737 }
1738
1739 pub fn set_version<T>(mut self, v: T) -> Self
1741 where
1742 T: std::convert::Into<crate::model::Version>,
1743 {
1744 self.0.request.version = std::option::Option::Some(v.into());
1745 self
1746 }
1747
1748 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1750 where
1751 T: std::convert::Into<crate::model::Version>,
1752 {
1753 self.0.request.version = v.map(|x| x.into());
1754 self
1755 }
1756
1757 pub fn set_update_mask<T>(mut self, v: T) -> Self
1759 where
1760 T: std::convert::Into<wkt::FieldMask>,
1761 {
1762 self.0.request.update_mask = std::option::Option::Some(v.into());
1763 self
1764 }
1765
1766 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1768 where
1769 T: std::convert::Into<wkt::FieldMask>,
1770 {
1771 self.0.request.update_mask = v.map(|x| x.into());
1772 self
1773 }
1774 }
1775
1776 #[doc(hidden)]
1777 impl gax::options::internal::RequestBuilder for UpdateVersion {
1778 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1779 &mut self.0.options
1780 }
1781 }
1782
1783 #[derive(Clone, Debug)]
1802 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
1803
1804 impl DeleteVersion {
1805 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1806 Self(RequestBuilder::new(stub))
1807 }
1808
1809 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
1811 self.0.request = v.into();
1812 self
1813 }
1814
1815 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1817 self.0.options = v.into();
1818 self
1819 }
1820
1821 pub async fn send(self) -> Result<longrunning::model::Operation> {
1828 (*self.0.stub)
1829 .delete_version(self.0.request, self.0.options)
1830 .await
1831 .map(gax::response::Response::into_body)
1832 }
1833
1834 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
1836 type Operation =
1837 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
1838 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1839 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1840
1841 let stub = self.0.stub.clone();
1842 let mut options = self.0.options.clone();
1843 options.set_retry_policy(gax::retry_policy::NeverRetry);
1844 let query = move |name| {
1845 let stub = stub.clone();
1846 let options = options.clone();
1847 async {
1848 let op = GetOperation::new(stub)
1849 .set_name(name)
1850 .with_options(options)
1851 .send()
1852 .await?;
1853 Ok(Operation::new(op))
1854 }
1855 };
1856
1857 let start = move || async {
1858 let op = self.send().await?;
1859 Ok(Operation::new(op))
1860 };
1861
1862 lro::internal::new_unit_response_poller(
1863 polling_error_policy,
1864 polling_backoff_policy,
1865 start,
1866 query,
1867 )
1868 }
1869
1870 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1872 self.0.request.name = v.into();
1873 self
1874 }
1875 }
1876
1877 #[doc(hidden)]
1878 impl gax::options::internal::RequestBuilder for DeleteVersion {
1879 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1880 &mut self.0.options
1881 }
1882 }
1883
1884 #[derive(Clone, Debug)]
1906 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1907
1908 impl ListOperations {
1909 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1910 Self(RequestBuilder::new(stub))
1911 }
1912
1913 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1915 mut self,
1916 v: V,
1917 ) -> Self {
1918 self.0.request = v.into();
1919 self
1920 }
1921
1922 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1924 self.0.options = v.into();
1925 self
1926 }
1927
1928 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1930 (*self.0.stub)
1931 .list_operations(self.0.request, self.0.options)
1932 .await
1933 .map(gax::response::Response::into_body)
1934 }
1935
1936 pub fn by_page(
1938 self,
1939 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1940 {
1941 use std::clone::Clone;
1942 let token = self.0.request.page_token.clone();
1943 let execute = move |token: String| {
1944 let mut builder = self.clone();
1945 builder.0.request = builder.0.request.set_page_token(token);
1946 builder.send()
1947 };
1948 gax::paginator::internal::new_paginator(token, execute)
1949 }
1950
1951 pub fn by_item(
1953 self,
1954 ) -> impl gax::paginator::ItemPaginator<
1955 longrunning::model::ListOperationsResponse,
1956 gax::error::Error,
1957 > {
1958 use gax::paginator::Paginator;
1959 self.by_page().items()
1960 }
1961
1962 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1964 self.0.request.name = v.into();
1965 self
1966 }
1967
1968 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1970 self.0.request.filter = v.into();
1971 self
1972 }
1973
1974 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1976 self.0.request.page_size = v.into();
1977 self
1978 }
1979
1980 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1982 self.0.request.page_token = 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)]
2012 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2013
2014 impl GetOperation {
2015 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2016 Self(RequestBuilder::new(stub))
2017 }
2018
2019 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2021 mut self,
2022 v: V,
2023 ) -> Self {
2024 self.0.request = v.into();
2025 self
2026 }
2027
2028 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2030 self.0.options = v.into();
2031 self
2032 }
2033
2034 pub async fn send(self) -> Result<longrunning::model::Operation> {
2036 (*self.0.stub)
2037 .get_operation(self.0.request, self.0.options)
2038 .await
2039 .map(gax::response::Response::into_body)
2040 }
2041
2042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2044 self.0.request.name = v.into();
2045 self
2046 }
2047 }
2048
2049 #[doc(hidden)]
2050 impl gax::options::internal::RequestBuilder for GetOperation {
2051 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2052 &mut self.0.options
2053 }
2054 }
2055}
2056
2057pub mod instances {
2058 use crate::Result;
2059
2060 pub type ClientBuilder =
2074 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2075
2076 pub(crate) mod client {
2077 use super::super::super::client::Instances;
2078 pub struct Factory;
2079 impl gax::client_builder::internal::ClientFactory for Factory {
2080 type Client = Instances;
2081 type Credentials = gaxi::options::Credentials;
2082 async fn build(
2083 self,
2084 config: gaxi::options::ClientConfig,
2085 ) -> gax::client_builder::Result<Self::Client> {
2086 Self::Client::new(config).await
2087 }
2088 }
2089 }
2090
2091 #[derive(Clone, Debug)]
2093 pub(crate) struct RequestBuilder<R: std::default::Default> {
2094 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2095 request: R,
2096 options: gax::options::RequestOptions,
2097 }
2098
2099 impl<R> RequestBuilder<R>
2100 where
2101 R: std::default::Default,
2102 {
2103 pub(crate) fn new(
2104 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2105 ) -> Self {
2106 Self {
2107 stub,
2108 request: R::default(),
2109 options: gax::options::RequestOptions::default(),
2110 }
2111 }
2112 }
2113
2114 #[derive(Clone, Debug)]
2136 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
2137
2138 impl ListInstances {
2139 pub(crate) fn new(
2140 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2141 ) -> Self {
2142 Self(RequestBuilder::new(stub))
2143 }
2144
2145 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
2147 self.0.request = v.into();
2148 self
2149 }
2150
2151 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2153 self.0.options = v.into();
2154 self
2155 }
2156
2157 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
2159 (*self.0.stub)
2160 .list_instances(self.0.request, self.0.options)
2161 .await
2162 .map(gax::response::Response::into_body)
2163 }
2164
2165 pub fn by_page(
2167 self,
2168 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
2169 {
2170 use std::clone::Clone;
2171 let token = self.0.request.page_token.clone();
2172 let execute = move |token: String| {
2173 let mut builder = self.clone();
2174 builder.0.request = builder.0.request.set_page_token(token);
2175 builder.send()
2176 };
2177 gax::paginator::internal::new_paginator(token, execute)
2178 }
2179
2180 pub fn by_item(
2182 self,
2183 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
2184 {
2185 use gax::paginator::Paginator;
2186 self.by_page().items()
2187 }
2188
2189 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2191 self.0.request.parent = v.into();
2192 self
2193 }
2194
2195 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2197 self.0.request.page_size = v.into();
2198 self
2199 }
2200
2201 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2203 self.0.request.page_token = v.into();
2204 self
2205 }
2206 }
2207
2208 #[doc(hidden)]
2209 impl gax::options::internal::RequestBuilder for ListInstances {
2210 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2211 &mut self.0.options
2212 }
2213 }
2214
2215 #[derive(Clone, Debug)]
2233 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2234
2235 impl GetInstance {
2236 pub(crate) fn new(
2237 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2238 ) -> Self {
2239 Self(RequestBuilder::new(stub))
2240 }
2241
2242 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2244 self.0.request = v.into();
2245 self
2246 }
2247
2248 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2250 self.0.options = v.into();
2251 self
2252 }
2253
2254 pub async fn send(self) -> Result<crate::model::Instance> {
2256 (*self.0.stub)
2257 .get_instance(self.0.request, self.0.options)
2258 .await
2259 .map(gax::response::Response::into_body)
2260 }
2261
2262 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.0.request.name = v.into();
2265 self
2266 }
2267 }
2268
2269 #[doc(hidden)]
2270 impl gax::options::internal::RequestBuilder for GetInstance {
2271 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2272 &mut self.0.options
2273 }
2274 }
2275
2276 #[derive(Clone, Debug)]
2295 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
2296
2297 impl DeleteInstance {
2298 pub(crate) fn new(
2299 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2300 ) -> Self {
2301 Self(RequestBuilder::new(stub))
2302 }
2303
2304 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
2306 self.0.request = v.into();
2307 self
2308 }
2309
2310 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2312 self.0.options = v.into();
2313 self
2314 }
2315
2316 pub async fn send(self) -> Result<longrunning::model::Operation> {
2323 (*self.0.stub)
2324 .delete_instance(self.0.request, self.0.options)
2325 .await
2326 .map(gax::response::Response::into_body)
2327 }
2328
2329 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
2331 type Operation =
2332 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
2333 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2334 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2335
2336 let stub = self.0.stub.clone();
2337 let mut options = self.0.options.clone();
2338 options.set_retry_policy(gax::retry_policy::NeverRetry);
2339 let query = move |name| {
2340 let stub = stub.clone();
2341 let options = options.clone();
2342 async {
2343 let op = GetOperation::new(stub)
2344 .set_name(name)
2345 .with_options(options)
2346 .send()
2347 .await?;
2348 Ok(Operation::new(op))
2349 }
2350 };
2351
2352 let start = move || async {
2353 let op = self.send().await?;
2354 Ok(Operation::new(op))
2355 };
2356
2357 lro::internal::new_unit_response_poller(
2358 polling_error_policy,
2359 polling_backoff_policy,
2360 start,
2361 query,
2362 )
2363 }
2364
2365 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2367 self.0.request.name = v.into();
2368 self
2369 }
2370 }
2371
2372 #[doc(hidden)]
2373 impl gax::options::internal::RequestBuilder for DeleteInstance {
2374 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2375 &mut self.0.options
2376 }
2377 }
2378
2379 #[derive(Clone, Debug)]
2398 pub struct DebugInstance(RequestBuilder<crate::model::DebugInstanceRequest>);
2399
2400 impl DebugInstance {
2401 pub(crate) fn new(
2402 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2403 ) -> Self {
2404 Self(RequestBuilder::new(stub))
2405 }
2406
2407 pub fn with_request<V: Into<crate::model::DebugInstanceRequest>>(mut self, v: V) -> Self {
2409 self.0.request = v.into();
2410 self
2411 }
2412
2413 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2415 self.0.options = v.into();
2416 self
2417 }
2418
2419 pub async fn send(self) -> Result<longrunning::model::Operation> {
2426 (*self.0.stub)
2427 .debug_instance(self.0.request, self.0.options)
2428 .await
2429 .map(gax::response::Response::into_body)
2430 }
2431
2432 pub fn poller(
2434 self,
2435 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadataV1> {
2436 type Operation =
2437 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadataV1>;
2438 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2439 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2440
2441 let stub = self.0.stub.clone();
2442 let mut options = self.0.options.clone();
2443 options.set_retry_policy(gax::retry_policy::NeverRetry);
2444 let query = move |name| {
2445 let stub = stub.clone();
2446 let options = options.clone();
2447 async {
2448 let op = GetOperation::new(stub)
2449 .set_name(name)
2450 .with_options(options)
2451 .send()
2452 .await?;
2453 Ok(Operation::new(op))
2454 }
2455 };
2456
2457 let start = move || async {
2458 let op = self.send().await?;
2459 Ok(Operation::new(op))
2460 };
2461
2462 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2463 }
2464
2465 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2467 self.0.request.name = v.into();
2468 self
2469 }
2470
2471 pub fn set_ssh_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
2473 self.0.request.ssh_key = v.into();
2474 self
2475 }
2476 }
2477
2478 #[doc(hidden)]
2479 impl gax::options::internal::RequestBuilder for DebugInstance {
2480 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2481 &mut self.0.options
2482 }
2483 }
2484
2485 #[derive(Clone, Debug)]
2507 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2508
2509 impl ListOperations {
2510 pub(crate) fn new(
2511 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2512 ) -> Self {
2513 Self(RequestBuilder::new(stub))
2514 }
2515
2516 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2518 mut self,
2519 v: V,
2520 ) -> Self {
2521 self.0.request = v.into();
2522 self
2523 }
2524
2525 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2527 self.0.options = v.into();
2528 self
2529 }
2530
2531 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2533 (*self.0.stub)
2534 .list_operations(self.0.request, self.0.options)
2535 .await
2536 .map(gax::response::Response::into_body)
2537 }
2538
2539 pub fn by_page(
2541 self,
2542 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2543 {
2544 use std::clone::Clone;
2545 let token = self.0.request.page_token.clone();
2546 let execute = move |token: String| {
2547 let mut builder = self.clone();
2548 builder.0.request = builder.0.request.set_page_token(token);
2549 builder.send()
2550 };
2551 gax::paginator::internal::new_paginator(token, execute)
2552 }
2553
2554 pub fn by_item(
2556 self,
2557 ) -> impl gax::paginator::ItemPaginator<
2558 longrunning::model::ListOperationsResponse,
2559 gax::error::Error,
2560 > {
2561 use gax::paginator::Paginator;
2562 self.by_page().items()
2563 }
2564
2565 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2567 self.0.request.name = v.into();
2568 self
2569 }
2570
2571 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573 self.0.request.filter = v.into();
2574 self
2575 }
2576
2577 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2579 self.0.request.page_size = v.into();
2580 self
2581 }
2582
2583 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2585 self.0.request.page_token = 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)]
2615 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2616
2617 impl GetOperation {
2618 pub(crate) fn new(
2619 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2620 ) -> Self {
2621 Self(RequestBuilder::new(stub))
2622 }
2623
2624 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2626 mut self,
2627 v: V,
2628 ) -> Self {
2629 self.0.request = v.into();
2630 self
2631 }
2632
2633 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2635 self.0.options = v.into();
2636 self
2637 }
2638
2639 pub async fn send(self) -> Result<longrunning::model::Operation> {
2641 (*self.0.stub)
2642 .get_operation(self.0.request, self.0.options)
2643 .await
2644 .map(gax::response::Response::into_body)
2645 }
2646
2647 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2649 self.0.request.name = v.into();
2650 self
2651 }
2652 }
2653
2654 #[doc(hidden)]
2655 impl gax::options::internal::RequestBuilder for GetOperation {
2656 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2657 &mut self.0.options
2658 }
2659 }
2660}
2661
2662pub mod firewall {
2663 use crate::Result;
2664
2665 pub type ClientBuilder =
2679 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2680
2681 pub(crate) mod client {
2682 use super::super::super::client::Firewall;
2683 pub struct Factory;
2684 impl gax::client_builder::internal::ClientFactory for Factory {
2685 type Client = Firewall;
2686 type Credentials = gaxi::options::Credentials;
2687 async fn build(
2688 self,
2689 config: gaxi::options::ClientConfig,
2690 ) -> gax::client_builder::Result<Self::Client> {
2691 Self::Client::new(config).await
2692 }
2693 }
2694 }
2695
2696 #[derive(Clone, Debug)]
2698 pub(crate) struct RequestBuilder<R: std::default::Default> {
2699 stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>,
2700 request: R,
2701 options: gax::options::RequestOptions,
2702 }
2703
2704 impl<R> RequestBuilder<R>
2705 where
2706 R: std::default::Default,
2707 {
2708 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2709 Self {
2710 stub,
2711 request: R::default(),
2712 options: gax::options::RequestOptions::default(),
2713 }
2714 }
2715 }
2716
2717 #[derive(Clone, Debug)]
2739 pub struct ListIngressRules(RequestBuilder<crate::model::ListIngressRulesRequest>);
2740
2741 impl ListIngressRules {
2742 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2743 Self(RequestBuilder::new(stub))
2744 }
2745
2746 pub fn with_request<V: Into<crate::model::ListIngressRulesRequest>>(
2748 mut self,
2749 v: V,
2750 ) -> Self {
2751 self.0.request = v.into();
2752 self
2753 }
2754
2755 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2757 self.0.options = v.into();
2758 self
2759 }
2760
2761 pub async fn send(self) -> Result<crate::model::ListIngressRulesResponse> {
2763 (*self.0.stub)
2764 .list_ingress_rules(self.0.request, self.0.options)
2765 .await
2766 .map(gax::response::Response::into_body)
2767 }
2768
2769 pub fn by_page(
2771 self,
2772 ) -> impl gax::paginator::Paginator<crate::model::ListIngressRulesResponse, gax::error::Error>
2773 {
2774 use std::clone::Clone;
2775 let token = self.0.request.page_token.clone();
2776 let execute = move |token: String| {
2777 let mut builder = self.clone();
2778 builder.0.request = builder.0.request.set_page_token(token);
2779 builder.send()
2780 };
2781 gax::paginator::internal::new_paginator(token, execute)
2782 }
2783
2784 pub fn by_item(
2786 self,
2787 ) -> impl gax::paginator::ItemPaginator<crate::model::ListIngressRulesResponse, gax::error::Error>
2788 {
2789 use gax::paginator::Paginator;
2790 self.by_page().items()
2791 }
2792
2793 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2795 self.0.request.parent = v.into();
2796 self
2797 }
2798
2799 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2801 self.0.request.page_size = v.into();
2802 self
2803 }
2804
2805 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2807 self.0.request.page_token = v.into();
2808 self
2809 }
2810
2811 pub fn set_matching_address<T: Into<std::string::String>>(mut self, v: T) -> Self {
2813 self.0.request.matching_address = v.into();
2814 self
2815 }
2816 }
2817
2818 #[doc(hidden)]
2819 impl gax::options::internal::RequestBuilder for ListIngressRules {
2820 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2821 &mut self.0.options
2822 }
2823 }
2824
2825 #[derive(Clone, Debug)]
2843 pub struct BatchUpdateIngressRules(
2844 RequestBuilder<crate::model::BatchUpdateIngressRulesRequest>,
2845 );
2846
2847 impl BatchUpdateIngressRules {
2848 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2849 Self(RequestBuilder::new(stub))
2850 }
2851
2852 pub fn with_request<V: Into<crate::model::BatchUpdateIngressRulesRequest>>(
2854 mut self,
2855 v: V,
2856 ) -> Self {
2857 self.0.request = v.into();
2858 self
2859 }
2860
2861 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2863 self.0.options = v.into();
2864 self
2865 }
2866
2867 pub async fn send(self) -> Result<crate::model::BatchUpdateIngressRulesResponse> {
2869 (*self.0.stub)
2870 .batch_update_ingress_rules(self.0.request, self.0.options)
2871 .await
2872 .map(gax::response::Response::into_body)
2873 }
2874
2875 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2877 self.0.request.name = v.into();
2878 self
2879 }
2880
2881 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
2883 where
2884 T: std::iter::IntoIterator<Item = V>,
2885 V: std::convert::Into<crate::model::FirewallRule>,
2886 {
2887 use std::iter::Iterator;
2888 self.0.request.ingress_rules = v.into_iter().map(|i| i.into()).collect();
2889 self
2890 }
2891 }
2892
2893 #[doc(hidden)]
2894 impl gax::options::internal::RequestBuilder for BatchUpdateIngressRules {
2895 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2896 &mut self.0.options
2897 }
2898 }
2899
2900 #[derive(Clone, Debug)]
2918 pub struct CreateIngressRule(RequestBuilder<crate::model::CreateIngressRuleRequest>);
2919
2920 impl CreateIngressRule {
2921 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2922 Self(RequestBuilder::new(stub))
2923 }
2924
2925 pub fn with_request<V: Into<crate::model::CreateIngressRuleRequest>>(
2927 mut self,
2928 v: V,
2929 ) -> Self {
2930 self.0.request = v.into();
2931 self
2932 }
2933
2934 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2936 self.0.options = v.into();
2937 self
2938 }
2939
2940 pub async fn send(self) -> Result<crate::model::FirewallRule> {
2942 (*self.0.stub)
2943 .create_ingress_rule(self.0.request, self.0.options)
2944 .await
2945 .map(gax::response::Response::into_body)
2946 }
2947
2948 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2950 self.0.request.parent = v.into();
2951 self
2952 }
2953
2954 pub fn set_rule<T>(mut self, v: T) -> Self
2956 where
2957 T: std::convert::Into<crate::model::FirewallRule>,
2958 {
2959 self.0.request.rule = std::option::Option::Some(v.into());
2960 self
2961 }
2962
2963 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
2965 where
2966 T: std::convert::Into<crate::model::FirewallRule>,
2967 {
2968 self.0.request.rule = v.map(|x| x.into());
2969 self
2970 }
2971 }
2972
2973 #[doc(hidden)]
2974 impl gax::options::internal::RequestBuilder for CreateIngressRule {
2975 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2976 &mut self.0.options
2977 }
2978 }
2979
2980 #[derive(Clone, Debug)]
2998 pub struct GetIngressRule(RequestBuilder<crate::model::GetIngressRuleRequest>);
2999
3000 impl GetIngressRule {
3001 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3002 Self(RequestBuilder::new(stub))
3003 }
3004
3005 pub fn with_request<V: Into<crate::model::GetIngressRuleRequest>>(mut self, v: V) -> Self {
3007 self.0.request = v.into();
3008 self
3009 }
3010
3011 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3013 self.0.options = v.into();
3014 self
3015 }
3016
3017 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3019 (*self.0.stub)
3020 .get_ingress_rule(self.0.request, self.0.options)
3021 .await
3022 .map(gax::response::Response::into_body)
3023 }
3024
3025 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3027 self.0.request.name = v.into();
3028 self
3029 }
3030 }
3031
3032 #[doc(hidden)]
3033 impl gax::options::internal::RequestBuilder for GetIngressRule {
3034 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3035 &mut self.0.options
3036 }
3037 }
3038
3039 #[derive(Clone, Debug)]
3057 pub struct UpdateIngressRule(RequestBuilder<crate::model::UpdateIngressRuleRequest>);
3058
3059 impl UpdateIngressRule {
3060 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3061 Self(RequestBuilder::new(stub))
3062 }
3063
3064 pub fn with_request<V: Into<crate::model::UpdateIngressRuleRequest>>(
3066 mut self,
3067 v: V,
3068 ) -> Self {
3069 self.0.request = v.into();
3070 self
3071 }
3072
3073 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3075 self.0.options = v.into();
3076 self
3077 }
3078
3079 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3081 (*self.0.stub)
3082 .update_ingress_rule(self.0.request, self.0.options)
3083 .await
3084 .map(gax::response::Response::into_body)
3085 }
3086
3087 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3089 self.0.request.name = v.into();
3090 self
3091 }
3092
3093 pub fn set_rule<T>(mut self, v: T) -> Self
3095 where
3096 T: std::convert::Into<crate::model::FirewallRule>,
3097 {
3098 self.0.request.rule = std::option::Option::Some(v.into());
3099 self
3100 }
3101
3102 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3104 where
3105 T: std::convert::Into<crate::model::FirewallRule>,
3106 {
3107 self.0.request.rule = v.map(|x| x.into());
3108 self
3109 }
3110
3111 pub fn set_update_mask<T>(mut self, v: T) -> Self
3113 where
3114 T: std::convert::Into<wkt::FieldMask>,
3115 {
3116 self.0.request.update_mask = std::option::Option::Some(v.into());
3117 self
3118 }
3119
3120 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3122 where
3123 T: std::convert::Into<wkt::FieldMask>,
3124 {
3125 self.0.request.update_mask = v.map(|x| x.into());
3126 self
3127 }
3128 }
3129
3130 #[doc(hidden)]
3131 impl gax::options::internal::RequestBuilder for UpdateIngressRule {
3132 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3133 &mut self.0.options
3134 }
3135 }
3136
3137 #[derive(Clone, Debug)]
3155 pub struct DeleteIngressRule(RequestBuilder<crate::model::DeleteIngressRuleRequest>);
3156
3157 impl DeleteIngressRule {
3158 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3159 Self(RequestBuilder::new(stub))
3160 }
3161
3162 pub fn with_request<V: Into<crate::model::DeleteIngressRuleRequest>>(
3164 mut self,
3165 v: V,
3166 ) -> Self {
3167 self.0.request = v.into();
3168 self
3169 }
3170
3171 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3173 self.0.options = v.into();
3174 self
3175 }
3176
3177 pub async fn send(self) -> Result<()> {
3179 (*self.0.stub)
3180 .delete_ingress_rule(self.0.request, self.0.options)
3181 .await
3182 .map(gax::response::Response::into_body)
3183 }
3184
3185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3187 self.0.request.name = v.into();
3188 self
3189 }
3190 }
3191
3192 #[doc(hidden)]
3193 impl gax::options::internal::RequestBuilder for DeleteIngressRule {
3194 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3195 &mut self.0.options
3196 }
3197 }
3198
3199 #[derive(Clone, Debug)]
3221 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3222
3223 impl ListOperations {
3224 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3225 Self(RequestBuilder::new(stub))
3226 }
3227
3228 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3230 mut self,
3231 v: V,
3232 ) -> Self {
3233 self.0.request = v.into();
3234 self
3235 }
3236
3237 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3239 self.0.options = v.into();
3240 self
3241 }
3242
3243 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3245 (*self.0.stub)
3246 .list_operations(self.0.request, self.0.options)
3247 .await
3248 .map(gax::response::Response::into_body)
3249 }
3250
3251 pub fn by_page(
3253 self,
3254 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3255 {
3256 use std::clone::Clone;
3257 let token = self.0.request.page_token.clone();
3258 let execute = move |token: String| {
3259 let mut builder = self.clone();
3260 builder.0.request = builder.0.request.set_page_token(token);
3261 builder.send()
3262 };
3263 gax::paginator::internal::new_paginator(token, execute)
3264 }
3265
3266 pub fn by_item(
3268 self,
3269 ) -> impl gax::paginator::ItemPaginator<
3270 longrunning::model::ListOperationsResponse,
3271 gax::error::Error,
3272 > {
3273 use gax::paginator::Paginator;
3274 self.by_page().items()
3275 }
3276
3277 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3279 self.0.request.name = v.into();
3280 self
3281 }
3282
3283 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3285 self.0.request.filter = v.into();
3286 self
3287 }
3288
3289 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3291 self.0.request.page_size = v.into();
3292 self
3293 }
3294
3295 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3297 self.0.request.page_token = v.into();
3298 self
3299 }
3300 }
3301
3302 #[doc(hidden)]
3303 impl gax::options::internal::RequestBuilder for ListOperations {
3304 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3305 &mut self.0.options
3306 }
3307 }
3308
3309 #[derive(Clone, Debug)]
3327 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3328
3329 impl GetOperation {
3330 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3331 Self(RequestBuilder::new(stub))
3332 }
3333
3334 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3336 mut self,
3337 v: V,
3338 ) -> Self {
3339 self.0.request = v.into();
3340 self
3341 }
3342
3343 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3345 self.0.options = v.into();
3346 self
3347 }
3348
3349 pub async fn send(self) -> Result<longrunning::model::Operation> {
3351 (*self.0.stub)
3352 .get_operation(self.0.request, self.0.options)
3353 .await
3354 .map(gax::response::Response::into_body)
3355 }
3356
3357 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3359 self.0.request.name = v.into();
3360 self
3361 }
3362 }
3363
3364 #[doc(hidden)]
3365 impl gax::options::internal::RequestBuilder for GetOperation {
3366 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3367 &mut self.0.options
3368 }
3369 }
3370}
3371
3372pub mod authorized_domains {
3373 use crate::Result;
3374
3375 pub type ClientBuilder =
3389 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3390
3391 pub(crate) mod client {
3392 use super::super::super::client::AuthorizedDomains;
3393 pub struct Factory;
3394 impl gax::client_builder::internal::ClientFactory for Factory {
3395 type Client = AuthorizedDomains;
3396 type Credentials = gaxi::options::Credentials;
3397 async fn build(
3398 self,
3399 config: gaxi::options::ClientConfig,
3400 ) -> gax::client_builder::Result<Self::Client> {
3401 Self::Client::new(config).await
3402 }
3403 }
3404 }
3405
3406 #[derive(Clone, Debug)]
3408 pub(crate) struct RequestBuilder<R: std::default::Default> {
3409 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3410 request: R,
3411 options: gax::options::RequestOptions,
3412 }
3413
3414 impl<R> RequestBuilder<R>
3415 where
3416 R: std::default::Default,
3417 {
3418 pub(crate) fn new(
3419 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3420 ) -> Self {
3421 Self {
3422 stub,
3423 request: R::default(),
3424 options: gax::options::RequestOptions::default(),
3425 }
3426 }
3427 }
3428
3429 #[derive(Clone, Debug)]
3451 pub struct ListAuthorizedDomains(RequestBuilder<crate::model::ListAuthorizedDomainsRequest>);
3452
3453 impl ListAuthorizedDomains {
3454 pub(crate) fn new(
3455 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3456 ) -> Self {
3457 Self(RequestBuilder::new(stub))
3458 }
3459
3460 pub fn with_request<V: Into<crate::model::ListAuthorizedDomainsRequest>>(
3462 mut self,
3463 v: V,
3464 ) -> Self {
3465 self.0.request = v.into();
3466 self
3467 }
3468
3469 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3471 self.0.options = v.into();
3472 self
3473 }
3474
3475 pub async fn send(self) -> Result<crate::model::ListAuthorizedDomainsResponse> {
3477 (*self.0.stub)
3478 .list_authorized_domains(self.0.request, self.0.options)
3479 .await
3480 .map(gax::response::Response::into_body)
3481 }
3482
3483 pub fn by_page(
3485 self,
3486 ) -> impl gax::paginator::Paginator<crate::model::ListAuthorizedDomainsResponse, gax::error::Error>
3487 {
3488 use std::clone::Clone;
3489 let token = self.0.request.page_token.clone();
3490 let execute = move |token: String| {
3491 let mut builder = self.clone();
3492 builder.0.request = builder.0.request.set_page_token(token);
3493 builder.send()
3494 };
3495 gax::paginator::internal::new_paginator(token, execute)
3496 }
3497
3498 pub fn by_item(
3500 self,
3501 ) -> impl gax::paginator::ItemPaginator<
3502 crate::model::ListAuthorizedDomainsResponse,
3503 gax::error::Error,
3504 > {
3505 use gax::paginator::Paginator;
3506 self.by_page().items()
3507 }
3508
3509 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3511 self.0.request.parent = v.into();
3512 self
3513 }
3514
3515 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3517 self.0.request.page_size = v.into();
3518 self
3519 }
3520
3521 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3523 self.0.request.page_token = v.into();
3524 self
3525 }
3526 }
3527
3528 #[doc(hidden)]
3529 impl gax::options::internal::RequestBuilder for ListAuthorizedDomains {
3530 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3531 &mut self.0.options
3532 }
3533 }
3534
3535 #[derive(Clone, Debug)]
3557 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3558
3559 impl ListOperations {
3560 pub(crate) fn new(
3561 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3562 ) -> Self {
3563 Self(RequestBuilder::new(stub))
3564 }
3565
3566 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3568 mut self,
3569 v: V,
3570 ) -> Self {
3571 self.0.request = v.into();
3572 self
3573 }
3574
3575 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3577 self.0.options = v.into();
3578 self
3579 }
3580
3581 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3583 (*self.0.stub)
3584 .list_operations(self.0.request, self.0.options)
3585 .await
3586 .map(gax::response::Response::into_body)
3587 }
3588
3589 pub fn by_page(
3591 self,
3592 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3593 {
3594 use std::clone::Clone;
3595 let token = self.0.request.page_token.clone();
3596 let execute = move |token: String| {
3597 let mut builder = self.clone();
3598 builder.0.request = builder.0.request.set_page_token(token);
3599 builder.send()
3600 };
3601 gax::paginator::internal::new_paginator(token, execute)
3602 }
3603
3604 pub fn by_item(
3606 self,
3607 ) -> impl gax::paginator::ItemPaginator<
3608 longrunning::model::ListOperationsResponse,
3609 gax::error::Error,
3610 > {
3611 use gax::paginator::Paginator;
3612 self.by_page().items()
3613 }
3614
3615 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3617 self.0.request.name = v.into();
3618 self
3619 }
3620
3621 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3623 self.0.request.filter = v.into();
3624 self
3625 }
3626
3627 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3629 self.0.request.page_size = v.into();
3630 self
3631 }
3632
3633 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3635 self.0.request.page_token = v.into();
3636 self
3637 }
3638 }
3639
3640 #[doc(hidden)]
3641 impl gax::options::internal::RequestBuilder for ListOperations {
3642 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3643 &mut self.0.options
3644 }
3645 }
3646
3647 #[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)]
3791 pub struct ListAuthorizedCertificates(
3792 RequestBuilder<crate::model::ListAuthorizedCertificatesRequest>,
3793 );
3794
3795 impl ListAuthorizedCertificates {
3796 pub(crate) fn new(
3797 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3798 ) -> Self {
3799 Self(RequestBuilder::new(stub))
3800 }
3801
3802 pub fn with_request<V: Into<crate::model::ListAuthorizedCertificatesRequest>>(
3804 mut self,
3805 v: V,
3806 ) -> Self {
3807 self.0.request = v.into();
3808 self
3809 }
3810
3811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3813 self.0.options = v.into();
3814 self
3815 }
3816
3817 pub async fn send(self) -> Result<crate::model::ListAuthorizedCertificatesResponse> {
3819 (*self.0.stub)
3820 .list_authorized_certificates(self.0.request, self.0.options)
3821 .await
3822 .map(gax::response::Response::into_body)
3823 }
3824
3825 pub fn by_page(
3827 self,
3828 ) -> impl gax::paginator::Paginator<
3829 crate::model::ListAuthorizedCertificatesResponse,
3830 gax::error::Error,
3831 > {
3832 use std::clone::Clone;
3833 let token = self.0.request.page_token.clone();
3834 let execute = move |token: String| {
3835 let mut builder = self.clone();
3836 builder.0.request = builder.0.request.set_page_token(token);
3837 builder.send()
3838 };
3839 gax::paginator::internal::new_paginator(token, execute)
3840 }
3841
3842 pub fn by_item(
3844 self,
3845 ) -> impl gax::paginator::ItemPaginator<
3846 crate::model::ListAuthorizedCertificatesResponse,
3847 gax::error::Error,
3848 > {
3849 use gax::paginator::Paginator;
3850 self.by_page().items()
3851 }
3852
3853 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3855 self.0.request.parent = v.into();
3856 self
3857 }
3858
3859 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
3861 self.0.request.view = v.into();
3862 self
3863 }
3864
3865 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3867 self.0.request.page_size = v.into();
3868 self
3869 }
3870
3871 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3873 self.0.request.page_token = v.into();
3874 self
3875 }
3876 }
3877
3878 #[doc(hidden)]
3879 impl gax::options::internal::RequestBuilder for ListAuthorizedCertificates {
3880 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3881 &mut self.0.options
3882 }
3883 }
3884
3885 #[derive(Clone, Debug)]
3903 pub struct GetAuthorizedCertificate(
3904 RequestBuilder<crate::model::GetAuthorizedCertificateRequest>,
3905 );
3906
3907 impl GetAuthorizedCertificate {
3908 pub(crate) fn new(
3909 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3910 ) -> Self {
3911 Self(RequestBuilder::new(stub))
3912 }
3913
3914 pub fn with_request<V: Into<crate::model::GetAuthorizedCertificateRequest>>(
3916 mut self,
3917 v: V,
3918 ) -> Self {
3919 self.0.request = v.into();
3920 self
3921 }
3922
3923 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3925 self.0.options = v.into();
3926 self
3927 }
3928
3929 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
3931 (*self.0.stub)
3932 .get_authorized_certificate(self.0.request, self.0.options)
3933 .await
3934 .map(gax::response::Response::into_body)
3935 }
3936
3937 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3939 self.0.request.name = v.into();
3940 self
3941 }
3942
3943 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
3945 self.0.request.view = v.into();
3946 self
3947 }
3948 }
3949
3950 #[doc(hidden)]
3951 impl gax::options::internal::RequestBuilder for GetAuthorizedCertificate {
3952 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3953 &mut self.0.options
3954 }
3955 }
3956
3957 #[derive(Clone, Debug)]
3975 pub struct CreateAuthorizedCertificate(
3976 RequestBuilder<crate::model::CreateAuthorizedCertificateRequest>,
3977 );
3978
3979 impl CreateAuthorizedCertificate {
3980 pub(crate) fn new(
3981 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3982 ) -> Self {
3983 Self(RequestBuilder::new(stub))
3984 }
3985
3986 pub fn with_request<V: Into<crate::model::CreateAuthorizedCertificateRequest>>(
3988 mut self,
3989 v: V,
3990 ) -> Self {
3991 self.0.request = v.into();
3992 self
3993 }
3994
3995 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3997 self.0.options = v.into();
3998 self
3999 }
4000
4001 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4003 (*self.0.stub)
4004 .create_authorized_certificate(self.0.request, self.0.options)
4005 .await
4006 .map(gax::response::Response::into_body)
4007 }
4008
4009 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4011 self.0.request.parent = v.into();
4012 self
4013 }
4014
4015 pub fn set_certificate<T>(mut self, v: T) -> Self
4017 where
4018 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4019 {
4020 self.0.request.certificate = std::option::Option::Some(v.into());
4021 self
4022 }
4023
4024 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4026 where
4027 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4028 {
4029 self.0.request.certificate = v.map(|x| x.into());
4030 self
4031 }
4032 }
4033
4034 #[doc(hidden)]
4035 impl gax::options::internal::RequestBuilder for CreateAuthorizedCertificate {
4036 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4037 &mut self.0.options
4038 }
4039 }
4040
4041 #[derive(Clone, Debug)]
4059 pub struct UpdateAuthorizedCertificate(
4060 RequestBuilder<crate::model::UpdateAuthorizedCertificateRequest>,
4061 );
4062
4063 impl UpdateAuthorizedCertificate {
4064 pub(crate) fn new(
4065 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4066 ) -> Self {
4067 Self(RequestBuilder::new(stub))
4068 }
4069
4070 pub fn with_request<V: Into<crate::model::UpdateAuthorizedCertificateRequest>>(
4072 mut self,
4073 v: V,
4074 ) -> Self {
4075 self.0.request = v.into();
4076 self
4077 }
4078
4079 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4081 self.0.options = v.into();
4082 self
4083 }
4084
4085 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4087 (*self.0.stub)
4088 .update_authorized_certificate(self.0.request, self.0.options)
4089 .await
4090 .map(gax::response::Response::into_body)
4091 }
4092
4093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4095 self.0.request.name = v.into();
4096 self
4097 }
4098
4099 pub fn set_certificate<T>(mut self, v: T) -> Self
4101 where
4102 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4103 {
4104 self.0.request.certificate = std::option::Option::Some(v.into());
4105 self
4106 }
4107
4108 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4110 where
4111 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4112 {
4113 self.0.request.certificate = v.map(|x| x.into());
4114 self
4115 }
4116
4117 pub fn set_update_mask<T>(mut self, v: T) -> Self
4119 where
4120 T: std::convert::Into<wkt::FieldMask>,
4121 {
4122 self.0.request.update_mask = std::option::Option::Some(v.into());
4123 self
4124 }
4125
4126 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4128 where
4129 T: std::convert::Into<wkt::FieldMask>,
4130 {
4131 self.0.request.update_mask = v.map(|x| x.into());
4132 self
4133 }
4134 }
4135
4136 #[doc(hidden)]
4137 impl gax::options::internal::RequestBuilder for UpdateAuthorizedCertificate {
4138 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4139 &mut self.0.options
4140 }
4141 }
4142
4143 #[derive(Clone, Debug)]
4161 pub struct DeleteAuthorizedCertificate(
4162 RequestBuilder<crate::model::DeleteAuthorizedCertificateRequest>,
4163 );
4164
4165 impl DeleteAuthorizedCertificate {
4166 pub(crate) fn new(
4167 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4168 ) -> Self {
4169 Self(RequestBuilder::new(stub))
4170 }
4171
4172 pub fn with_request<V: Into<crate::model::DeleteAuthorizedCertificateRequest>>(
4174 mut self,
4175 v: V,
4176 ) -> Self {
4177 self.0.request = v.into();
4178 self
4179 }
4180
4181 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4183 self.0.options = v.into();
4184 self
4185 }
4186
4187 pub async fn send(self) -> Result<()> {
4189 (*self.0.stub)
4190 .delete_authorized_certificate(self.0.request, self.0.options)
4191 .await
4192 .map(gax::response::Response::into_body)
4193 }
4194
4195 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4197 self.0.request.name = v.into();
4198 self
4199 }
4200 }
4201
4202 #[doc(hidden)]
4203 impl gax::options::internal::RequestBuilder for DeleteAuthorizedCertificate {
4204 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4205 &mut self.0.options
4206 }
4207 }
4208
4209 #[derive(Clone, Debug)]
4231 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4232
4233 impl ListOperations {
4234 pub(crate) fn new(
4235 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4236 ) -> Self {
4237 Self(RequestBuilder::new(stub))
4238 }
4239
4240 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4242 mut self,
4243 v: V,
4244 ) -> Self {
4245 self.0.request = v.into();
4246 self
4247 }
4248
4249 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4251 self.0.options = v.into();
4252 self
4253 }
4254
4255 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4257 (*self.0.stub)
4258 .list_operations(self.0.request, self.0.options)
4259 .await
4260 .map(gax::response::Response::into_body)
4261 }
4262
4263 pub fn by_page(
4265 self,
4266 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4267 {
4268 use std::clone::Clone;
4269 let token = self.0.request.page_token.clone();
4270 let execute = move |token: String| {
4271 let mut builder = self.clone();
4272 builder.0.request = builder.0.request.set_page_token(token);
4273 builder.send()
4274 };
4275 gax::paginator::internal::new_paginator(token, execute)
4276 }
4277
4278 pub fn by_item(
4280 self,
4281 ) -> impl gax::paginator::ItemPaginator<
4282 longrunning::model::ListOperationsResponse,
4283 gax::error::Error,
4284 > {
4285 use gax::paginator::Paginator;
4286 self.by_page().items()
4287 }
4288
4289 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4291 self.0.request.name = v.into();
4292 self
4293 }
4294
4295 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4297 self.0.request.filter = v.into();
4298 self
4299 }
4300
4301 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4303 self.0.request.page_size = v.into();
4304 self
4305 }
4306
4307 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4309 self.0.request.page_token = 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)]
4339 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4340
4341 impl GetOperation {
4342 pub(crate) fn new(
4343 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4344 ) -> Self {
4345 Self(RequestBuilder::new(stub))
4346 }
4347
4348 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4350 mut self,
4351 v: V,
4352 ) -> Self {
4353 self.0.request = v.into();
4354 self
4355 }
4356
4357 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4359 self.0.options = v.into();
4360 self
4361 }
4362
4363 pub async fn send(self) -> Result<longrunning::model::Operation> {
4365 (*self.0.stub)
4366 .get_operation(self.0.request, self.0.options)
4367 .await
4368 .map(gax::response::Response::into_body)
4369 }
4370
4371 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4373 self.0.request.name = v.into();
4374 self
4375 }
4376 }
4377
4378 #[doc(hidden)]
4379 impl gax::options::internal::RequestBuilder for GetOperation {
4380 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4381 &mut self.0.options
4382 }
4383 }
4384}
4385
4386pub mod domain_mappings {
4387 use crate::Result;
4388
4389 pub type ClientBuilder =
4403 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4404
4405 pub(crate) mod client {
4406 use super::super::super::client::DomainMappings;
4407 pub struct Factory;
4408 impl gax::client_builder::internal::ClientFactory for Factory {
4409 type Client = DomainMappings;
4410 type Credentials = gaxi::options::Credentials;
4411 async fn build(
4412 self,
4413 config: gaxi::options::ClientConfig,
4414 ) -> gax::client_builder::Result<Self::Client> {
4415 Self::Client::new(config).await
4416 }
4417 }
4418 }
4419
4420 #[derive(Clone, Debug)]
4422 pub(crate) struct RequestBuilder<R: std::default::Default> {
4423 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4424 request: R,
4425 options: gax::options::RequestOptions,
4426 }
4427
4428 impl<R> RequestBuilder<R>
4429 where
4430 R: std::default::Default,
4431 {
4432 pub(crate) fn new(
4433 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4434 ) -> Self {
4435 Self {
4436 stub,
4437 request: R::default(),
4438 options: gax::options::RequestOptions::default(),
4439 }
4440 }
4441 }
4442
4443 #[derive(Clone, Debug)]
4465 pub struct ListDomainMappings(RequestBuilder<crate::model::ListDomainMappingsRequest>);
4466
4467 impl ListDomainMappings {
4468 pub(crate) fn new(
4469 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4470 ) -> Self {
4471 Self(RequestBuilder::new(stub))
4472 }
4473
4474 pub fn with_request<V: Into<crate::model::ListDomainMappingsRequest>>(
4476 mut self,
4477 v: V,
4478 ) -> Self {
4479 self.0.request = v.into();
4480 self
4481 }
4482
4483 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4485 self.0.options = v.into();
4486 self
4487 }
4488
4489 pub async fn send(self) -> Result<crate::model::ListDomainMappingsResponse> {
4491 (*self.0.stub)
4492 .list_domain_mappings(self.0.request, self.0.options)
4493 .await
4494 .map(gax::response::Response::into_body)
4495 }
4496
4497 pub fn by_page(
4499 self,
4500 ) -> impl gax::paginator::Paginator<crate::model::ListDomainMappingsResponse, gax::error::Error>
4501 {
4502 use std::clone::Clone;
4503 let token = self.0.request.page_token.clone();
4504 let execute = move |token: String| {
4505 let mut builder = self.clone();
4506 builder.0.request = builder.0.request.set_page_token(token);
4507 builder.send()
4508 };
4509 gax::paginator::internal::new_paginator(token, execute)
4510 }
4511
4512 pub fn by_item(
4514 self,
4515 ) -> impl gax::paginator::ItemPaginator<
4516 crate::model::ListDomainMappingsResponse,
4517 gax::error::Error,
4518 > {
4519 use gax::paginator::Paginator;
4520 self.by_page().items()
4521 }
4522
4523 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4525 self.0.request.parent = v.into();
4526 self
4527 }
4528
4529 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4531 self.0.request.page_size = v.into();
4532 self
4533 }
4534
4535 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4537 self.0.request.page_token = v.into();
4538 self
4539 }
4540 }
4541
4542 #[doc(hidden)]
4543 impl gax::options::internal::RequestBuilder for ListDomainMappings {
4544 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4545 &mut self.0.options
4546 }
4547 }
4548
4549 #[derive(Clone, Debug)]
4567 pub struct GetDomainMapping(RequestBuilder<crate::model::GetDomainMappingRequest>);
4568
4569 impl GetDomainMapping {
4570 pub(crate) fn new(
4571 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4572 ) -> Self {
4573 Self(RequestBuilder::new(stub))
4574 }
4575
4576 pub fn with_request<V: Into<crate::model::GetDomainMappingRequest>>(
4578 mut self,
4579 v: V,
4580 ) -> Self {
4581 self.0.request = v.into();
4582 self
4583 }
4584
4585 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4587 self.0.options = v.into();
4588 self
4589 }
4590
4591 pub async fn send(self) -> Result<crate::model::DomainMapping> {
4593 (*self.0.stub)
4594 .get_domain_mapping(self.0.request, self.0.options)
4595 .await
4596 .map(gax::response::Response::into_body)
4597 }
4598
4599 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4601 self.0.request.name = v.into();
4602 self
4603 }
4604 }
4605
4606 #[doc(hidden)]
4607 impl gax::options::internal::RequestBuilder for GetDomainMapping {
4608 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4609 &mut self.0.options
4610 }
4611 }
4612
4613 #[derive(Clone, Debug)]
4632 pub struct CreateDomainMapping(RequestBuilder<crate::model::CreateDomainMappingRequest>);
4633
4634 impl CreateDomainMapping {
4635 pub(crate) fn new(
4636 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4637 ) -> Self {
4638 Self(RequestBuilder::new(stub))
4639 }
4640
4641 pub fn with_request<V: Into<crate::model::CreateDomainMappingRequest>>(
4643 mut self,
4644 v: V,
4645 ) -> Self {
4646 self.0.request = v.into();
4647 self
4648 }
4649
4650 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4652 self.0.options = v.into();
4653 self
4654 }
4655
4656 pub async fn send(self) -> Result<longrunning::model::Operation> {
4663 (*self.0.stub)
4664 .create_domain_mapping(self.0.request, self.0.options)
4665 .await
4666 .map(gax::response::Response::into_body)
4667 }
4668
4669 pub fn poller(
4671 self,
4672 ) -> impl lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4673 {
4674 type Operation = lro::internal::Operation<
4675 crate::model::DomainMapping,
4676 crate::model::OperationMetadataV1,
4677 >;
4678 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4679 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4680
4681 let stub = self.0.stub.clone();
4682 let mut options = self.0.options.clone();
4683 options.set_retry_policy(gax::retry_policy::NeverRetry);
4684 let query = move |name| {
4685 let stub = stub.clone();
4686 let options = options.clone();
4687 async {
4688 let op = GetOperation::new(stub)
4689 .set_name(name)
4690 .with_options(options)
4691 .send()
4692 .await?;
4693 Ok(Operation::new(op))
4694 }
4695 };
4696
4697 let start = move || async {
4698 let op = self.send().await?;
4699 Ok(Operation::new(op))
4700 };
4701
4702 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4703 }
4704
4705 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4707 self.0.request.parent = v.into();
4708 self
4709 }
4710
4711 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4713 where
4714 T: std::convert::Into<crate::model::DomainMapping>,
4715 {
4716 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4717 self
4718 }
4719
4720 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4722 where
4723 T: std::convert::Into<crate::model::DomainMapping>,
4724 {
4725 self.0.request.domain_mapping = v.map(|x| x.into());
4726 self
4727 }
4728
4729 pub fn set_override_strategy<T: Into<crate::model::DomainOverrideStrategy>>(
4731 mut self,
4732 v: T,
4733 ) -> Self {
4734 self.0.request.override_strategy = v.into();
4735 self
4736 }
4737 }
4738
4739 #[doc(hidden)]
4740 impl gax::options::internal::RequestBuilder for CreateDomainMapping {
4741 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4742 &mut self.0.options
4743 }
4744 }
4745
4746 #[derive(Clone, Debug)]
4765 pub struct UpdateDomainMapping(RequestBuilder<crate::model::UpdateDomainMappingRequest>);
4766
4767 impl UpdateDomainMapping {
4768 pub(crate) fn new(
4769 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4770 ) -> Self {
4771 Self(RequestBuilder::new(stub))
4772 }
4773
4774 pub fn with_request<V: Into<crate::model::UpdateDomainMappingRequest>>(
4776 mut self,
4777 v: V,
4778 ) -> Self {
4779 self.0.request = v.into();
4780 self
4781 }
4782
4783 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4785 self.0.options = v.into();
4786 self
4787 }
4788
4789 pub async fn send(self) -> Result<longrunning::model::Operation> {
4796 (*self.0.stub)
4797 .update_domain_mapping(self.0.request, self.0.options)
4798 .await
4799 .map(gax::response::Response::into_body)
4800 }
4801
4802 pub fn poller(
4804 self,
4805 ) -> impl lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4806 {
4807 type Operation = lro::internal::Operation<
4808 crate::model::DomainMapping,
4809 crate::model::OperationMetadataV1,
4810 >;
4811 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4812 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4813
4814 let stub = self.0.stub.clone();
4815 let mut options = self.0.options.clone();
4816 options.set_retry_policy(gax::retry_policy::NeverRetry);
4817 let query = move |name| {
4818 let stub = stub.clone();
4819 let options = options.clone();
4820 async {
4821 let op = GetOperation::new(stub)
4822 .set_name(name)
4823 .with_options(options)
4824 .send()
4825 .await?;
4826 Ok(Operation::new(op))
4827 }
4828 };
4829
4830 let start = move || async {
4831 let op = self.send().await?;
4832 Ok(Operation::new(op))
4833 };
4834
4835 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4836 }
4837
4838 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4840 self.0.request.name = v.into();
4841 self
4842 }
4843
4844 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4846 where
4847 T: std::convert::Into<crate::model::DomainMapping>,
4848 {
4849 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4850 self
4851 }
4852
4853 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4855 where
4856 T: std::convert::Into<crate::model::DomainMapping>,
4857 {
4858 self.0.request.domain_mapping = v.map(|x| x.into());
4859 self
4860 }
4861
4862 pub fn set_update_mask<T>(mut self, v: T) -> Self
4864 where
4865 T: std::convert::Into<wkt::FieldMask>,
4866 {
4867 self.0.request.update_mask = std::option::Option::Some(v.into());
4868 self
4869 }
4870
4871 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4873 where
4874 T: std::convert::Into<wkt::FieldMask>,
4875 {
4876 self.0.request.update_mask = v.map(|x| x.into());
4877 self
4878 }
4879 }
4880
4881 #[doc(hidden)]
4882 impl gax::options::internal::RequestBuilder for UpdateDomainMapping {
4883 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4884 &mut self.0.options
4885 }
4886 }
4887
4888 #[derive(Clone, Debug)]
4907 pub struct DeleteDomainMapping(RequestBuilder<crate::model::DeleteDomainMappingRequest>);
4908
4909 impl DeleteDomainMapping {
4910 pub(crate) fn new(
4911 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4912 ) -> Self {
4913 Self(RequestBuilder::new(stub))
4914 }
4915
4916 pub fn with_request<V: Into<crate::model::DeleteDomainMappingRequest>>(
4918 mut self,
4919 v: V,
4920 ) -> Self {
4921 self.0.request = v.into();
4922 self
4923 }
4924
4925 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4927 self.0.options = v.into();
4928 self
4929 }
4930
4931 pub async fn send(self) -> Result<longrunning::model::Operation> {
4938 (*self.0.stub)
4939 .delete_domain_mapping(self.0.request, self.0.options)
4940 .await
4941 .map(gax::response::Response::into_body)
4942 }
4943
4944 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadataV1> {
4946 type Operation =
4947 lro::internal::Operation<wkt::Empty, crate::model::OperationMetadataV1>;
4948 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4949 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4950
4951 let stub = self.0.stub.clone();
4952 let mut options = self.0.options.clone();
4953 options.set_retry_policy(gax::retry_policy::NeverRetry);
4954 let query = move |name| {
4955 let stub = stub.clone();
4956 let options = options.clone();
4957 async {
4958 let op = GetOperation::new(stub)
4959 .set_name(name)
4960 .with_options(options)
4961 .send()
4962 .await?;
4963 Ok(Operation::new(op))
4964 }
4965 };
4966
4967 let start = move || async {
4968 let op = self.send().await?;
4969 Ok(Operation::new(op))
4970 };
4971
4972 lro::internal::new_unit_response_poller(
4973 polling_error_policy,
4974 polling_backoff_policy,
4975 start,
4976 query,
4977 )
4978 }
4979
4980 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4982 self.0.request.name = v.into();
4983 self
4984 }
4985 }
4986
4987 #[doc(hidden)]
4988 impl gax::options::internal::RequestBuilder for DeleteDomainMapping {
4989 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4990 &mut self.0.options
4991 }
4992 }
4993
4994 #[derive(Clone, Debug)]
5016 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5017
5018 impl ListOperations {
5019 pub(crate) fn new(
5020 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5021 ) -> Self {
5022 Self(RequestBuilder::new(stub))
5023 }
5024
5025 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5027 mut self,
5028 v: V,
5029 ) -> Self {
5030 self.0.request = v.into();
5031 self
5032 }
5033
5034 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5036 self.0.options = v.into();
5037 self
5038 }
5039
5040 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5042 (*self.0.stub)
5043 .list_operations(self.0.request, self.0.options)
5044 .await
5045 .map(gax::response::Response::into_body)
5046 }
5047
5048 pub fn by_page(
5050 self,
5051 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5052 {
5053 use std::clone::Clone;
5054 let token = self.0.request.page_token.clone();
5055 let execute = move |token: String| {
5056 let mut builder = self.clone();
5057 builder.0.request = builder.0.request.set_page_token(token);
5058 builder.send()
5059 };
5060 gax::paginator::internal::new_paginator(token, execute)
5061 }
5062
5063 pub fn by_item(
5065 self,
5066 ) -> impl gax::paginator::ItemPaginator<
5067 longrunning::model::ListOperationsResponse,
5068 gax::error::Error,
5069 > {
5070 use gax::paginator::Paginator;
5071 self.by_page().items()
5072 }
5073
5074 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5076 self.0.request.name = v.into();
5077 self
5078 }
5079
5080 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5082 self.0.request.filter = v.into();
5083 self
5084 }
5085
5086 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5088 self.0.request.page_size = v.into();
5089 self
5090 }
5091
5092 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5094 self.0.request.page_token = v.into();
5095 self
5096 }
5097 }
5098
5099 #[doc(hidden)]
5100 impl gax::options::internal::RequestBuilder for ListOperations {
5101 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5102 &mut self.0.options
5103 }
5104 }
5105
5106 #[derive(Clone, Debug)]
5124 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5125
5126 impl GetOperation {
5127 pub(crate) fn new(
5128 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5129 ) -> Self {
5130 Self(RequestBuilder::new(stub))
5131 }
5132
5133 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5135 mut self,
5136 v: V,
5137 ) -> Self {
5138 self.0.request = v.into();
5139 self
5140 }
5141
5142 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5144 self.0.options = v.into();
5145 self
5146 }
5147
5148 pub async fn send(self) -> Result<longrunning::model::Operation> {
5150 (*self.0.stub)
5151 .get_operation(self.0.request, self.0.options)
5152 .await
5153 .map(gax::response::Response::into_body)
5154 }
5155
5156 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5158 self.0.request.name = v.into();
5159 self
5160 }
5161 }
5162
5163 #[doc(hidden)]
5164 impl gax::options::internal::RequestBuilder for GetOperation {
5165 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5166 &mut self.0.options
5167 }
5168 }
5169}