1pub mod applications {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Applications;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Applications;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct GetApplication(RequestBuilder<crate::model::GetApplicationRequest>);
92
93 impl GetApplication {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::GetApplicationRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::Application> {
114 (*self.0.stub)
115 .get_application(self.0.request, self.0.options)
116 .await
117 .map(crate::Response::into_body)
118 }
119
120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
122 self.0.request.name = v.into();
123 self
124 }
125 }
126
127 #[doc(hidden)]
128 impl crate::RequestBuilder for GetApplication {
129 fn request_options(&mut self) -> &mut crate::RequestOptions {
130 &mut self.0.options
131 }
132 }
133
134 #[derive(Clone, Debug)]
152 pub struct CreateApplication(RequestBuilder<crate::model::CreateApplicationRequest>);
153
154 impl CreateApplication {
155 pub(crate) fn new(
156 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
157 ) -> Self {
158 Self(RequestBuilder::new(stub))
159 }
160
161 pub fn with_request<V: Into<crate::model::CreateApplicationRequest>>(
163 mut self,
164 v: V,
165 ) -> Self {
166 self.0.request = v.into();
167 self
168 }
169
170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
172 self.0.options = v.into();
173 self
174 }
175
176 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
183 (*self.0.stub)
184 .create_application(self.0.request, self.0.options)
185 .await
186 .map(crate::Response::into_body)
187 }
188
189 pub fn poller(
191 self,
192 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
193 {
194 type Operation = google_cloud_lro::internal::Operation<
195 crate::model::Application,
196 crate::model::OperationMetadataV1,
197 >;
198 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
199 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
200 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
201 if let Some(ref mut details) = poller_options.tracing {
202 details.method_name = "google_cloud_appengine_v1::client::Applications::create_application::until_done";
203 }
204
205 let stub = self.0.stub.clone();
206 let mut options = self.0.options.clone();
207 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
208 let query = move |name| {
209 let stub = stub.clone();
210 let options = options.clone();
211 async {
212 let op = GetOperation::new(stub)
213 .set_name(name)
214 .with_options(options)
215 .send()
216 .await?;
217 Ok(Operation::new(op))
218 }
219 };
220
221 let start = move || async {
222 let op = self.send().await?;
223 Ok(Operation::new(op))
224 };
225
226 use google_cloud_lro::internal::PollerExt;
227 {
228 google_cloud_lro::internal::new_poller(
229 polling_error_policy,
230 polling_backoff_policy,
231 start,
232 query,
233 )
234 }
235 .with_options(poller_options)
236 }
237
238 pub fn set_application<T>(mut self, v: T) -> Self
240 where
241 T: std::convert::Into<crate::model::Application>,
242 {
243 self.0.request.application = std::option::Option::Some(v.into());
244 self
245 }
246
247 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
249 where
250 T: std::convert::Into<crate::model::Application>,
251 {
252 self.0.request.application = v.map(|x| x.into());
253 self
254 }
255 }
256
257 #[doc(hidden)]
258 impl crate::RequestBuilder for CreateApplication {
259 fn request_options(&mut self) -> &mut crate::RequestOptions {
260 &mut self.0.options
261 }
262 }
263
264 #[derive(Clone, Debug)]
282 pub struct UpdateApplication(RequestBuilder<crate::model::UpdateApplicationRequest>);
283
284 impl UpdateApplication {
285 pub(crate) fn new(
286 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
287 ) -> Self {
288 Self(RequestBuilder::new(stub))
289 }
290
291 pub fn with_request<V: Into<crate::model::UpdateApplicationRequest>>(
293 mut self,
294 v: V,
295 ) -> Self {
296 self.0.request = v.into();
297 self
298 }
299
300 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
302 self.0.options = v.into();
303 self
304 }
305
306 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
313 (*self.0.stub)
314 .update_application(self.0.request, self.0.options)
315 .await
316 .map(crate::Response::into_body)
317 }
318
319 pub fn poller(
321 self,
322 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
323 {
324 type Operation = google_cloud_lro::internal::Operation<
325 crate::model::Application,
326 crate::model::OperationMetadataV1,
327 >;
328 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
329 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
330 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
331 if let Some(ref mut details) = poller_options.tracing {
332 details.method_name = "google_cloud_appengine_v1::client::Applications::update_application::until_done";
333 }
334
335 let stub = self.0.stub.clone();
336 let mut options = self.0.options.clone();
337 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
338 let query = move |name| {
339 let stub = stub.clone();
340 let options = options.clone();
341 async {
342 let op = GetOperation::new(stub)
343 .set_name(name)
344 .with_options(options)
345 .send()
346 .await?;
347 Ok(Operation::new(op))
348 }
349 };
350
351 let start = move || async {
352 let op = self.send().await?;
353 Ok(Operation::new(op))
354 };
355
356 use google_cloud_lro::internal::PollerExt;
357 {
358 google_cloud_lro::internal::new_poller(
359 polling_error_policy,
360 polling_backoff_policy,
361 start,
362 query,
363 )
364 }
365 .with_options(poller_options)
366 }
367
368 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
370 self.0.request.name = v.into();
371 self
372 }
373
374 pub fn set_application<T>(mut self, v: T) -> Self
376 where
377 T: std::convert::Into<crate::model::Application>,
378 {
379 self.0.request.application = std::option::Option::Some(v.into());
380 self
381 }
382
383 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
385 where
386 T: std::convert::Into<crate::model::Application>,
387 {
388 self.0.request.application = v.map(|x| x.into());
389 self
390 }
391
392 pub fn set_update_mask<T>(mut self, v: T) -> Self
394 where
395 T: std::convert::Into<wkt::FieldMask>,
396 {
397 self.0.request.update_mask = std::option::Option::Some(v.into());
398 self
399 }
400
401 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
403 where
404 T: std::convert::Into<wkt::FieldMask>,
405 {
406 self.0.request.update_mask = v.map(|x| x.into());
407 self
408 }
409 }
410
411 #[doc(hidden)]
412 impl crate::RequestBuilder for UpdateApplication {
413 fn request_options(&mut self) -> &mut crate::RequestOptions {
414 &mut self.0.options
415 }
416 }
417
418 #[derive(Clone, Debug)]
436 pub struct RepairApplication(RequestBuilder<crate::model::RepairApplicationRequest>);
437
438 impl RepairApplication {
439 pub(crate) fn new(
440 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
441 ) -> Self {
442 Self(RequestBuilder::new(stub))
443 }
444
445 pub fn with_request<V: Into<crate::model::RepairApplicationRequest>>(
447 mut self,
448 v: V,
449 ) -> Self {
450 self.0.request = v.into();
451 self
452 }
453
454 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
456 self.0.options = v.into();
457 self
458 }
459
460 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
467 (*self.0.stub)
468 .repair_application(self.0.request, self.0.options)
469 .await
470 .map(crate::Response::into_body)
471 }
472
473 pub fn poller(
475 self,
476 ) -> impl google_cloud_lro::Poller<crate::model::Application, crate::model::OperationMetadataV1>
477 {
478 type Operation = google_cloud_lro::internal::Operation<
479 crate::model::Application,
480 crate::model::OperationMetadataV1,
481 >;
482 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
483 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
484 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
485 if let Some(ref mut details) = poller_options.tracing {
486 details.method_name = "google_cloud_appengine_v1::client::Applications::repair_application::until_done";
487 }
488
489 let stub = self.0.stub.clone();
490 let mut options = self.0.options.clone();
491 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
492 let query = move |name| {
493 let stub = stub.clone();
494 let options = options.clone();
495 async {
496 let op = GetOperation::new(stub)
497 .set_name(name)
498 .with_options(options)
499 .send()
500 .await?;
501 Ok(Operation::new(op))
502 }
503 };
504
505 let start = move || async {
506 let op = self.send().await?;
507 Ok(Operation::new(op))
508 };
509
510 use google_cloud_lro::internal::PollerExt;
511 {
512 google_cloud_lro::internal::new_poller(
513 polling_error_policy,
514 polling_backoff_policy,
515 start,
516 query,
517 )
518 }
519 .with_options(poller_options)
520 }
521
522 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
524 self.0.request.name = v.into();
525 self
526 }
527 }
528
529 #[doc(hidden)]
530 impl crate::RequestBuilder for RepairApplication {
531 fn request_options(&mut self) -> &mut crate::RequestOptions {
532 &mut self.0.options
533 }
534 }
535
536 #[derive(Clone, Debug)]
557 pub struct ListOperations(
558 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
559 );
560
561 impl ListOperations {
562 pub(crate) fn new(
563 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
564 ) -> Self {
565 Self(RequestBuilder::new(stub))
566 }
567
568 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
570 mut self,
571 v: V,
572 ) -> Self {
573 self.0.request = v.into();
574 self
575 }
576
577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
579 self.0.options = v.into();
580 self
581 }
582
583 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
585 (*self.0.stub)
586 .list_operations(self.0.request, self.0.options)
587 .await
588 .map(crate::Response::into_body)
589 }
590
591 pub fn by_page(
593 self,
594 ) -> impl google_cloud_gax::paginator::Paginator<
595 google_cloud_longrunning::model::ListOperationsResponse,
596 crate::Error,
597 > {
598 use std::clone::Clone;
599 let token = self.0.request.page_token.clone();
600 let execute = move |token: String| {
601 let mut builder = self.clone();
602 builder.0.request = builder.0.request.set_page_token(token);
603 builder.send()
604 };
605 google_cloud_gax::paginator::internal::new_paginator(token, execute)
606 }
607
608 pub fn by_item(
610 self,
611 ) -> impl google_cloud_gax::paginator::ItemPaginator<
612 google_cloud_longrunning::model::ListOperationsResponse,
613 crate::Error,
614 > {
615 use google_cloud_gax::paginator::Paginator;
616 self.by_page().items()
617 }
618
619 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
621 self.0.request.name = v.into();
622 self
623 }
624
625 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
627 self.0.request.filter = v.into();
628 self
629 }
630
631 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
633 self.0.request.page_size = v.into();
634 self
635 }
636
637 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
639 self.0.request.page_token = v.into();
640 self
641 }
642
643 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
645 self.0.request.return_partial_success = v.into();
646 self
647 }
648 }
649
650 #[doc(hidden)]
651 impl crate::RequestBuilder for ListOperations {
652 fn request_options(&mut self) -> &mut crate::RequestOptions {
653 &mut self.0.options
654 }
655 }
656
657 #[derive(Clone, Debug)]
674 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
675
676 impl GetOperation {
677 pub(crate) fn new(
678 stub: std::sync::Arc<dyn super::super::stub::dynamic::Applications>,
679 ) -> Self {
680 Self(RequestBuilder::new(stub))
681 }
682
683 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
685 mut self,
686 v: V,
687 ) -> Self {
688 self.0.request = v.into();
689 self
690 }
691
692 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
694 self.0.options = v.into();
695 self
696 }
697
698 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
700 (*self.0.stub)
701 .get_operation(self.0.request, self.0.options)
702 .await
703 .map(crate::Response::into_body)
704 }
705
706 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
708 self.0.request.name = v.into();
709 self
710 }
711 }
712
713 #[doc(hidden)]
714 impl crate::RequestBuilder for GetOperation {
715 fn request_options(&mut self) -> &mut crate::RequestOptions {
716 &mut self.0.options
717 }
718 }
719}
720
721pub mod services {
723 use crate::Result;
724
725 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
739
740 pub(crate) mod client {
741 use super::super::super::client::Services;
742 pub struct Factory;
743 impl crate::ClientFactory for Factory {
744 type Client = Services;
745 type Credentials = gaxi::options::Credentials;
746 async fn build(
747 self,
748 config: gaxi::options::ClientConfig,
749 ) -> crate::ClientBuilderResult<Self::Client> {
750 Self::Client::new(config).await
751 }
752 }
753 }
754
755 #[derive(Clone, Debug)]
757 pub(crate) struct RequestBuilder<R: std::default::Default> {
758 stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
759 request: R,
760 options: crate::RequestOptions,
761 }
762
763 impl<R> RequestBuilder<R>
764 where
765 R: std::default::Default,
766 {
767 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
768 Self {
769 stub,
770 request: R::default(),
771 options: crate::RequestOptions::default(),
772 }
773 }
774 }
775
776 #[derive(Clone, Debug)]
797 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
798
799 impl ListServices {
800 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
801 Self(RequestBuilder::new(stub))
802 }
803
804 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
806 self.0.request = v.into();
807 self
808 }
809
810 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
812 self.0.options = v.into();
813 self
814 }
815
816 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
818 (*self.0.stub)
819 .list_services(self.0.request, self.0.options)
820 .await
821 .map(crate::Response::into_body)
822 }
823
824 pub fn by_page(
826 self,
827 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListServicesResponse, crate::Error>
828 {
829 use std::clone::Clone;
830 let token = self.0.request.page_token.clone();
831 let execute = move |token: String| {
832 let mut builder = self.clone();
833 builder.0.request = builder.0.request.set_page_token(token);
834 builder.send()
835 };
836 google_cloud_gax::paginator::internal::new_paginator(token, execute)
837 }
838
839 pub fn by_item(
841 self,
842 ) -> impl google_cloud_gax::paginator::ItemPaginator<
843 crate::model::ListServicesResponse,
844 crate::Error,
845 > {
846 use google_cloud_gax::paginator::Paginator;
847 self.by_page().items()
848 }
849
850 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
852 self.0.request.parent = v.into();
853 self
854 }
855
856 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
858 self.0.request.page_size = v.into();
859 self
860 }
861
862 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
864 self.0.request.page_token = v.into();
865 self
866 }
867 }
868
869 #[doc(hidden)]
870 impl crate::RequestBuilder for ListServices {
871 fn request_options(&mut self) -> &mut crate::RequestOptions {
872 &mut self.0.options
873 }
874 }
875
876 #[derive(Clone, Debug)]
893 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
894
895 impl GetService {
896 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
897 Self(RequestBuilder::new(stub))
898 }
899
900 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
902 self.0.request = v.into();
903 self
904 }
905
906 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
908 self.0.options = v.into();
909 self
910 }
911
912 pub async fn send(self) -> Result<crate::model::Service> {
914 (*self.0.stub)
915 .get_service(self.0.request, self.0.options)
916 .await
917 .map(crate::Response::into_body)
918 }
919
920 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
922 self.0.request.name = v.into();
923 self
924 }
925 }
926
927 #[doc(hidden)]
928 impl crate::RequestBuilder for GetService {
929 fn request_options(&mut self) -> &mut crate::RequestOptions {
930 &mut self.0.options
931 }
932 }
933
934 #[derive(Clone, Debug)]
952 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
953
954 impl UpdateService {
955 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
956 Self(RequestBuilder::new(stub))
957 }
958
959 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
961 self.0.request = v.into();
962 self
963 }
964
965 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
967 self.0.options = v.into();
968 self
969 }
970
971 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
978 (*self.0.stub)
979 .update_service(self.0.request, self.0.options)
980 .await
981 .map(crate::Response::into_body)
982 }
983
984 pub fn poller(
986 self,
987 ) -> impl google_cloud_lro::Poller<crate::model::Service, crate::model::OperationMetadataV1>
988 {
989 type Operation = google_cloud_lro::internal::Operation<
990 crate::model::Service,
991 crate::model::OperationMetadataV1,
992 >;
993 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
994 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
995 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
996 if let Some(ref mut details) = poller_options.tracing {
997 details.method_name =
998 "google_cloud_appengine_v1::client::Services::update_service::until_done";
999 }
1000
1001 let stub = self.0.stub.clone();
1002 let mut options = self.0.options.clone();
1003 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1004 let query = move |name| {
1005 let stub = stub.clone();
1006 let options = options.clone();
1007 async {
1008 let op = GetOperation::new(stub)
1009 .set_name(name)
1010 .with_options(options)
1011 .send()
1012 .await?;
1013 Ok(Operation::new(op))
1014 }
1015 };
1016
1017 let start = move || async {
1018 let op = self.send().await?;
1019 Ok(Operation::new(op))
1020 };
1021
1022 use google_cloud_lro::internal::PollerExt;
1023 {
1024 google_cloud_lro::internal::new_poller(
1025 polling_error_policy,
1026 polling_backoff_policy,
1027 start,
1028 query,
1029 )
1030 }
1031 .with_options(poller_options)
1032 }
1033
1034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1036 self.0.request.name = v.into();
1037 self
1038 }
1039
1040 pub fn set_service<T>(mut self, v: T) -> Self
1042 where
1043 T: std::convert::Into<crate::model::Service>,
1044 {
1045 self.0.request.service = std::option::Option::Some(v.into());
1046 self
1047 }
1048
1049 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
1051 where
1052 T: std::convert::Into<crate::model::Service>,
1053 {
1054 self.0.request.service = v.map(|x| x.into());
1055 self
1056 }
1057
1058 pub fn set_update_mask<T>(mut self, v: T) -> Self
1060 where
1061 T: std::convert::Into<wkt::FieldMask>,
1062 {
1063 self.0.request.update_mask = std::option::Option::Some(v.into());
1064 self
1065 }
1066
1067 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1069 where
1070 T: std::convert::Into<wkt::FieldMask>,
1071 {
1072 self.0.request.update_mask = v.map(|x| x.into());
1073 self
1074 }
1075
1076 pub fn set_migrate_traffic<T: Into<bool>>(mut self, v: T) -> Self {
1078 self.0.request.migrate_traffic = v.into();
1079 self
1080 }
1081 }
1082
1083 #[doc(hidden)]
1084 impl crate::RequestBuilder for UpdateService {
1085 fn request_options(&mut self) -> &mut crate::RequestOptions {
1086 &mut self.0.options
1087 }
1088 }
1089
1090 #[derive(Clone, Debug)]
1108 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
1109
1110 impl DeleteService {
1111 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1112 Self(RequestBuilder::new(stub))
1113 }
1114
1115 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
1117 self.0.request = v.into();
1118 self
1119 }
1120
1121 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1123 self.0.options = v.into();
1124 self
1125 }
1126
1127 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1134 (*self.0.stub)
1135 .delete_service(self.0.request, self.0.options)
1136 .await
1137 .map(crate::Response::into_body)
1138 }
1139
1140 pub fn poller(
1142 self,
1143 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
1144 type Operation = google_cloud_lro::internal::Operation<
1145 wkt::Empty,
1146 crate::model::OperationMetadataV1,
1147 >;
1148 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1149 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1150 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1151 if let Some(ref mut details) = poller_options.tracing {
1152 details.method_name =
1153 "google_cloud_appengine_v1::client::Services::delete_service::until_done";
1154 }
1155
1156 let stub = self.0.stub.clone();
1157 let mut options = self.0.options.clone();
1158 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1159 let query = move |name| {
1160 let stub = stub.clone();
1161 let options = options.clone();
1162 async {
1163 let op = GetOperation::new(stub)
1164 .set_name(name)
1165 .with_options(options)
1166 .send()
1167 .await?;
1168 Ok(Operation::new(op))
1169 }
1170 };
1171
1172 let start = move || async {
1173 let op = self.send().await?;
1174 Ok(Operation::new(op))
1175 };
1176
1177 use google_cloud_lro::internal::PollerExt;
1178 {
1179 google_cloud_lro::internal::new_unit_response_poller(
1180 polling_error_policy,
1181 polling_backoff_policy,
1182 start,
1183 query,
1184 )
1185 }
1186 .with_options(poller_options)
1187 }
1188
1189 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1191 self.0.request.name = v.into();
1192 self
1193 }
1194 }
1195
1196 #[doc(hidden)]
1197 impl crate::RequestBuilder for DeleteService {
1198 fn request_options(&mut self) -> &mut crate::RequestOptions {
1199 &mut self.0.options
1200 }
1201 }
1202
1203 #[derive(Clone, Debug)]
1224 pub struct ListOperations(
1225 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1226 );
1227
1228 impl ListOperations {
1229 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1230 Self(RequestBuilder::new(stub))
1231 }
1232
1233 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1235 mut self,
1236 v: V,
1237 ) -> Self {
1238 self.0.request = v.into();
1239 self
1240 }
1241
1242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1244 self.0.options = v.into();
1245 self
1246 }
1247
1248 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1250 (*self.0.stub)
1251 .list_operations(self.0.request, self.0.options)
1252 .await
1253 .map(crate::Response::into_body)
1254 }
1255
1256 pub fn by_page(
1258 self,
1259 ) -> impl google_cloud_gax::paginator::Paginator<
1260 google_cloud_longrunning::model::ListOperationsResponse,
1261 crate::Error,
1262 > {
1263 use std::clone::Clone;
1264 let token = self.0.request.page_token.clone();
1265 let execute = move |token: String| {
1266 let mut builder = self.clone();
1267 builder.0.request = builder.0.request.set_page_token(token);
1268 builder.send()
1269 };
1270 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1271 }
1272
1273 pub fn by_item(
1275 self,
1276 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1277 google_cloud_longrunning::model::ListOperationsResponse,
1278 crate::Error,
1279 > {
1280 use google_cloud_gax::paginator::Paginator;
1281 self.by_page().items()
1282 }
1283
1284 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1286 self.0.request.name = v.into();
1287 self
1288 }
1289
1290 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1292 self.0.request.filter = v.into();
1293 self
1294 }
1295
1296 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1298 self.0.request.page_size = v.into();
1299 self
1300 }
1301
1302 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1304 self.0.request.page_token = v.into();
1305 self
1306 }
1307
1308 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1310 self.0.request.return_partial_success = v.into();
1311 self
1312 }
1313 }
1314
1315 #[doc(hidden)]
1316 impl crate::RequestBuilder for ListOperations {
1317 fn request_options(&mut self) -> &mut crate::RequestOptions {
1318 &mut self.0.options
1319 }
1320 }
1321
1322 #[derive(Clone, Debug)]
1339 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1340
1341 impl GetOperation {
1342 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
1343 Self(RequestBuilder::new(stub))
1344 }
1345
1346 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1348 mut self,
1349 v: V,
1350 ) -> Self {
1351 self.0.request = v.into();
1352 self
1353 }
1354
1355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1357 self.0.options = v.into();
1358 self
1359 }
1360
1361 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1363 (*self.0.stub)
1364 .get_operation(self.0.request, self.0.options)
1365 .await
1366 .map(crate::Response::into_body)
1367 }
1368
1369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1371 self.0.request.name = v.into();
1372 self
1373 }
1374 }
1375
1376 #[doc(hidden)]
1377 impl crate::RequestBuilder for GetOperation {
1378 fn request_options(&mut self) -> &mut crate::RequestOptions {
1379 &mut self.0.options
1380 }
1381 }
1382}
1383
1384pub mod versions {
1386 use crate::Result;
1387
1388 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1402
1403 pub(crate) mod client {
1404 use super::super::super::client::Versions;
1405 pub struct Factory;
1406 impl crate::ClientFactory for Factory {
1407 type Client = Versions;
1408 type Credentials = gaxi::options::Credentials;
1409 async fn build(
1410 self,
1411 config: gaxi::options::ClientConfig,
1412 ) -> crate::ClientBuilderResult<Self::Client> {
1413 Self::Client::new(config).await
1414 }
1415 }
1416 }
1417
1418 #[derive(Clone, Debug)]
1420 pub(crate) struct RequestBuilder<R: std::default::Default> {
1421 stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
1422 request: R,
1423 options: crate::RequestOptions,
1424 }
1425
1426 impl<R> RequestBuilder<R>
1427 where
1428 R: std::default::Default,
1429 {
1430 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1431 Self {
1432 stub,
1433 request: R::default(),
1434 options: crate::RequestOptions::default(),
1435 }
1436 }
1437 }
1438
1439 #[derive(Clone, Debug)]
1460 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
1461
1462 impl ListVersions {
1463 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1464 Self(RequestBuilder::new(stub))
1465 }
1466
1467 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
1469 self.0.request = v.into();
1470 self
1471 }
1472
1473 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1475 self.0.options = v.into();
1476 self
1477 }
1478
1479 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
1481 (*self.0.stub)
1482 .list_versions(self.0.request, self.0.options)
1483 .await
1484 .map(crate::Response::into_body)
1485 }
1486
1487 pub fn by_page(
1489 self,
1490 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
1491 {
1492 use std::clone::Clone;
1493 let token = self.0.request.page_token.clone();
1494 let execute = move |token: String| {
1495 let mut builder = self.clone();
1496 builder.0.request = builder.0.request.set_page_token(token);
1497 builder.send()
1498 };
1499 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1500 }
1501
1502 pub fn by_item(
1504 self,
1505 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1506 crate::model::ListVersionsResponse,
1507 crate::Error,
1508 > {
1509 use google_cloud_gax::paginator::Paginator;
1510 self.by_page().items()
1511 }
1512
1513 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1515 self.0.request.parent = v.into();
1516 self
1517 }
1518
1519 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1521 self.0.request.view = v.into();
1522 self
1523 }
1524
1525 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1527 self.0.request.page_size = v.into();
1528 self
1529 }
1530
1531 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1533 self.0.request.page_token = v.into();
1534 self
1535 }
1536 }
1537
1538 #[doc(hidden)]
1539 impl crate::RequestBuilder for ListVersions {
1540 fn request_options(&mut self) -> &mut crate::RequestOptions {
1541 &mut self.0.options
1542 }
1543 }
1544
1545 #[derive(Clone, Debug)]
1562 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
1563
1564 impl GetVersion {
1565 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1566 Self(RequestBuilder::new(stub))
1567 }
1568
1569 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
1571 self.0.request = v.into();
1572 self
1573 }
1574
1575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1577 self.0.options = v.into();
1578 self
1579 }
1580
1581 pub async fn send(self) -> Result<crate::model::Version> {
1583 (*self.0.stub)
1584 .get_version(self.0.request, self.0.options)
1585 .await
1586 .map(crate::Response::into_body)
1587 }
1588
1589 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1591 self.0.request.name = v.into();
1592 self
1593 }
1594
1595 pub fn set_view<T: Into<crate::model::VersionView>>(mut self, v: T) -> Self {
1597 self.0.request.view = v.into();
1598 self
1599 }
1600 }
1601
1602 #[doc(hidden)]
1603 impl crate::RequestBuilder for GetVersion {
1604 fn request_options(&mut self) -> &mut crate::RequestOptions {
1605 &mut self.0.options
1606 }
1607 }
1608
1609 #[derive(Clone, Debug)]
1627 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
1628
1629 impl CreateVersion {
1630 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1631 Self(RequestBuilder::new(stub))
1632 }
1633
1634 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
1636 self.0.request = v.into();
1637 self
1638 }
1639
1640 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1642 self.0.options = v.into();
1643 self
1644 }
1645
1646 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1653 (*self.0.stub)
1654 .create_version(self.0.request, self.0.options)
1655 .await
1656 .map(crate::Response::into_body)
1657 }
1658
1659 pub fn poller(
1661 self,
1662 ) -> impl google_cloud_lro::Poller<crate::model::Version, crate::model::CreateVersionMetadataV1>
1663 {
1664 type Operation = google_cloud_lro::internal::Operation<
1665 crate::model::Version,
1666 crate::model::CreateVersionMetadataV1,
1667 >;
1668 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1669 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1670 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1671 if let Some(ref mut details) = poller_options.tracing {
1672 details.method_name =
1673 "google_cloud_appengine_v1::client::Versions::create_version::until_done";
1674 }
1675
1676 let stub = self.0.stub.clone();
1677 let mut options = self.0.options.clone();
1678 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1679 let query = move |name| {
1680 let stub = stub.clone();
1681 let options = options.clone();
1682 async {
1683 let op = GetOperation::new(stub)
1684 .set_name(name)
1685 .with_options(options)
1686 .send()
1687 .await?;
1688 Ok(Operation::new(op))
1689 }
1690 };
1691
1692 let start = move || async {
1693 let op = self.send().await?;
1694 Ok(Operation::new(op))
1695 };
1696
1697 use google_cloud_lro::internal::PollerExt;
1698 {
1699 google_cloud_lro::internal::new_poller(
1700 polling_error_policy,
1701 polling_backoff_policy,
1702 start,
1703 query,
1704 )
1705 }
1706 .with_options(poller_options)
1707 }
1708
1709 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1711 self.0.request.parent = v.into();
1712 self
1713 }
1714
1715 pub fn set_version<T>(mut self, v: T) -> Self
1717 where
1718 T: std::convert::Into<crate::model::Version>,
1719 {
1720 self.0.request.version = std::option::Option::Some(v.into());
1721 self
1722 }
1723
1724 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1726 where
1727 T: std::convert::Into<crate::model::Version>,
1728 {
1729 self.0.request.version = v.map(|x| x.into());
1730 self
1731 }
1732 }
1733
1734 #[doc(hidden)]
1735 impl crate::RequestBuilder for CreateVersion {
1736 fn request_options(&mut self) -> &mut crate::RequestOptions {
1737 &mut self.0.options
1738 }
1739 }
1740
1741 #[derive(Clone, Debug)]
1759 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
1760
1761 impl UpdateVersion {
1762 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1763 Self(RequestBuilder::new(stub))
1764 }
1765
1766 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
1768 self.0.request = v.into();
1769 self
1770 }
1771
1772 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1774 self.0.options = v.into();
1775 self
1776 }
1777
1778 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1785 (*self.0.stub)
1786 .update_version(self.0.request, self.0.options)
1787 .await
1788 .map(crate::Response::into_body)
1789 }
1790
1791 pub fn poller(
1793 self,
1794 ) -> impl google_cloud_lro::Poller<crate::model::Version, crate::model::OperationMetadataV1>
1795 {
1796 type Operation = google_cloud_lro::internal::Operation<
1797 crate::model::Version,
1798 crate::model::OperationMetadataV1,
1799 >;
1800 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1801 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1802 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1803 if let Some(ref mut details) = poller_options.tracing {
1804 details.method_name =
1805 "google_cloud_appengine_v1::client::Versions::update_version::until_done";
1806 }
1807
1808 let stub = self.0.stub.clone();
1809 let mut options = self.0.options.clone();
1810 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1811 let query = move |name| {
1812 let stub = stub.clone();
1813 let options = options.clone();
1814 async {
1815 let op = GetOperation::new(stub)
1816 .set_name(name)
1817 .with_options(options)
1818 .send()
1819 .await?;
1820 Ok(Operation::new(op))
1821 }
1822 };
1823
1824 let start = move || async {
1825 let op = self.send().await?;
1826 Ok(Operation::new(op))
1827 };
1828
1829 use google_cloud_lro::internal::PollerExt;
1830 {
1831 google_cloud_lro::internal::new_poller(
1832 polling_error_policy,
1833 polling_backoff_policy,
1834 start,
1835 query,
1836 )
1837 }
1838 .with_options(poller_options)
1839 }
1840
1841 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1843 self.0.request.name = v.into();
1844 self
1845 }
1846
1847 pub fn set_version<T>(mut self, v: T) -> Self
1849 where
1850 T: std::convert::Into<crate::model::Version>,
1851 {
1852 self.0.request.version = std::option::Option::Some(v.into());
1853 self
1854 }
1855
1856 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
1858 where
1859 T: std::convert::Into<crate::model::Version>,
1860 {
1861 self.0.request.version = v.map(|x| x.into());
1862 self
1863 }
1864
1865 pub fn set_update_mask<T>(mut self, v: T) -> Self
1867 where
1868 T: std::convert::Into<wkt::FieldMask>,
1869 {
1870 self.0.request.update_mask = std::option::Option::Some(v.into());
1871 self
1872 }
1873
1874 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1876 where
1877 T: std::convert::Into<wkt::FieldMask>,
1878 {
1879 self.0.request.update_mask = v.map(|x| x.into());
1880 self
1881 }
1882 }
1883
1884 #[doc(hidden)]
1885 impl crate::RequestBuilder for UpdateVersion {
1886 fn request_options(&mut self) -> &mut crate::RequestOptions {
1887 &mut self.0.options
1888 }
1889 }
1890
1891 #[derive(Clone, Debug)]
1909 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
1910
1911 impl DeleteVersion {
1912 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
1913 Self(RequestBuilder::new(stub))
1914 }
1915
1916 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
1918 self.0.request = v.into();
1919 self
1920 }
1921
1922 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1924 self.0.options = v.into();
1925 self
1926 }
1927
1928 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1935 (*self.0.stub)
1936 .delete_version(self.0.request, self.0.options)
1937 .await
1938 .map(crate::Response::into_body)
1939 }
1940
1941 pub fn poller(
1943 self,
1944 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
1945 type Operation = google_cloud_lro::internal::Operation<
1946 wkt::Empty,
1947 crate::model::OperationMetadataV1,
1948 >;
1949 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1950 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1951 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1952 if let Some(ref mut details) = poller_options.tracing {
1953 details.method_name =
1954 "google_cloud_appengine_v1::client::Versions::delete_version::until_done";
1955 }
1956
1957 let stub = self.0.stub.clone();
1958 let mut options = self.0.options.clone();
1959 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1960 let query = move |name| {
1961 let stub = stub.clone();
1962 let options = options.clone();
1963 async {
1964 let op = GetOperation::new(stub)
1965 .set_name(name)
1966 .with_options(options)
1967 .send()
1968 .await?;
1969 Ok(Operation::new(op))
1970 }
1971 };
1972
1973 let start = move || async {
1974 let op = self.send().await?;
1975 Ok(Operation::new(op))
1976 };
1977
1978 use google_cloud_lro::internal::PollerExt;
1979 {
1980 google_cloud_lro::internal::new_unit_response_poller(
1981 polling_error_policy,
1982 polling_backoff_policy,
1983 start,
1984 query,
1985 )
1986 }
1987 .with_options(poller_options)
1988 }
1989
1990 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1992 self.0.request.name = v.into();
1993 self
1994 }
1995 }
1996
1997 #[doc(hidden)]
1998 impl crate::RequestBuilder for DeleteVersion {
1999 fn request_options(&mut self) -> &mut crate::RequestOptions {
2000 &mut self.0.options
2001 }
2002 }
2003
2004 #[derive(Clone, Debug)]
2025 pub struct ListOperations(
2026 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2027 );
2028
2029 impl ListOperations {
2030 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2031 Self(RequestBuilder::new(stub))
2032 }
2033
2034 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2036 mut self,
2037 v: V,
2038 ) -> Self {
2039 self.0.request = v.into();
2040 self
2041 }
2042
2043 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2045 self.0.options = v.into();
2046 self
2047 }
2048
2049 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2051 (*self.0.stub)
2052 .list_operations(self.0.request, self.0.options)
2053 .await
2054 .map(crate::Response::into_body)
2055 }
2056
2057 pub fn by_page(
2059 self,
2060 ) -> impl google_cloud_gax::paginator::Paginator<
2061 google_cloud_longrunning::model::ListOperationsResponse,
2062 crate::Error,
2063 > {
2064 use std::clone::Clone;
2065 let token = self.0.request.page_token.clone();
2066 let execute = move |token: String| {
2067 let mut builder = self.clone();
2068 builder.0.request = builder.0.request.set_page_token(token);
2069 builder.send()
2070 };
2071 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2072 }
2073
2074 pub fn by_item(
2076 self,
2077 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2078 google_cloud_longrunning::model::ListOperationsResponse,
2079 crate::Error,
2080 > {
2081 use google_cloud_gax::paginator::Paginator;
2082 self.by_page().items()
2083 }
2084
2085 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2087 self.0.request.name = v.into();
2088 self
2089 }
2090
2091 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2093 self.0.request.filter = v.into();
2094 self
2095 }
2096
2097 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2099 self.0.request.page_size = v.into();
2100 self
2101 }
2102
2103 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2105 self.0.request.page_token = v.into();
2106 self
2107 }
2108
2109 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2111 self.0.request.return_partial_success = v.into();
2112 self
2113 }
2114 }
2115
2116 #[doc(hidden)]
2117 impl crate::RequestBuilder for ListOperations {
2118 fn request_options(&mut self) -> &mut crate::RequestOptions {
2119 &mut self.0.options
2120 }
2121 }
2122
2123 #[derive(Clone, Debug)]
2140 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2141
2142 impl GetOperation {
2143 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
2144 Self(RequestBuilder::new(stub))
2145 }
2146
2147 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2149 mut self,
2150 v: V,
2151 ) -> Self {
2152 self.0.request = v.into();
2153 self
2154 }
2155
2156 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2158 self.0.options = v.into();
2159 self
2160 }
2161
2162 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2164 (*self.0.stub)
2165 .get_operation(self.0.request, self.0.options)
2166 .await
2167 .map(crate::Response::into_body)
2168 }
2169
2170 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2172 self.0.request.name = v.into();
2173 self
2174 }
2175 }
2176
2177 #[doc(hidden)]
2178 impl crate::RequestBuilder for GetOperation {
2179 fn request_options(&mut self) -> &mut crate::RequestOptions {
2180 &mut self.0.options
2181 }
2182 }
2183}
2184
2185pub mod instances {
2187 use crate::Result;
2188
2189 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2203
2204 pub(crate) mod client {
2205 use super::super::super::client::Instances;
2206 pub struct Factory;
2207 impl crate::ClientFactory for Factory {
2208 type Client = Instances;
2209 type Credentials = gaxi::options::Credentials;
2210 async fn build(
2211 self,
2212 config: gaxi::options::ClientConfig,
2213 ) -> crate::ClientBuilderResult<Self::Client> {
2214 Self::Client::new(config).await
2215 }
2216 }
2217 }
2218
2219 #[derive(Clone, Debug)]
2221 pub(crate) struct RequestBuilder<R: std::default::Default> {
2222 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2223 request: R,
2224 options: crate::RequestOptions,
2225 }
2226
2227 impl<R> RequestBuilder<R>
2228 where
2229 R: std::default::Default,
2230 {
2231 pub(crate) fn new(
2232 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2233 ) -> Self {
2234 Self {
2235 stub,
2236 request: R::default(),
2237 options: crate::RequestOptions::default(),
2238 }
2239 }
2240 }
2241
2242 #[derive(Clone, Debug)]
2263 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
2264
2265 impl ListInstances {
2266 pub(crate) fn new(
2267 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2268 ) -> Self {
2269 Self(RequestBuilder::new(stub))
2270 }
2271
2272 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
2274 self.0.request = v.into();
2275 self
2276 }
2277
2278 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2280 self.0.options = v.into();
2281 self
2282 }
2283
2284 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
2286 (*self.0.stub)
2287 .list_instances(self.0.request, self.0.options)
2288 .await
2289 .map(crate::Response::into_body)
2290 }
2291
2292 pub fn by_page(
2294 self,
2295 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
2296 {
2297 use std::clone::Clone;
2298 let token = self.0.request.page_token.clone();
2299 let execute = move |token: String| {
2300 let mut builder = self.clone();
2301 builder.0.request = builder.0.request.set_page_token(token);
2302 builder.send()
2303 };
2304 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2305 }
2306
2307 pub fn by_item(
2309 self,
2310 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2311 crate::model::ListInstancesResponse,
2312 crate::Error,
2313 > {
2314 use google_cloud_gax::paginator::Paginator;
2315 self.by_page().items()
2316 }
2317
2318 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2320 self.0.request.parent = v.into();
2321 self
2322 }
2323
2324 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2326 self.0.request.page_size = v.into();
2327 self
2328 }
2329
2330 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2332 self.0.request.page_token = v.into();
2333 self
2334 }
2335 }
2336
2337 #[doc(hidden)]
2338 impl crate::RequestBuilder for ListInstances {
2339 fn request_options(&mut self) -> &mut crate::RequestOptions {
2340 &mut self.0.options
2341 }
2342 }
2343
2344 #[derive(Clone, Debug)]
2361 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2362
2363 impl GetInstance {
2364 pub(crate) fn new(
2365 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2366 ) -> Self {
2367 Self(RequestBuilder::new(stub))
2368 }
2369
2370 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2372 self.0.request = v.into();
2373 self
2374 }
2375
2376 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2378 self.0.options = v.into();
2379 self
2380 }
2381
2382 pub async fn send(self) -> Result<crate::model::Instance> {
2384 (*self.0.stub)
2385 .get_instance(self.0.request, self.0.options)
2386 .await
2387 .map(crate::Response::into_body)
2388 }
2389
2390 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2392 self.0.request.name = v.into();
2393 self
2394 }
2395 }
2396
2397 #[doc(hidden)]
2398 impl crate::RequestBuilder for GetInstance {
2399 fn request_options(&mut self) -> &mut crate::RequestOptions {
2400 &mut self.0.options
2401 }
2402 }
2403
2404 #[derive(Clone, Debug)]
2422 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
2423
2424 impl DeleteInstance {
2425 pub(crate) fn new(
2426 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2427 ) -> Self {
2428 Self(RequestBuilder::new(stub))
2429 }
2430
2431 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
2433 self.0.request = v.into();
2434 self
2435 }
2436
2437 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2439 self.0.options = v.into();
2440 self
2441 }
2442
2443 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2450 (*self.0.stub)
2451 .delete_instance(self.0.request, self.0.options)
2452 .await
2453 .map(crate::Response::into_body)
2454 }
2455
2456 pub fn poller(
2458 self,
2459 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
2460 type Operation = google_cloud_lro::internal::Operation<
2461 wkt::Empty,
2462 crate::model::OperationMetadataV1,
2463 >;
2464 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2465 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2466 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2467 if let Some(ref mut details) = poller_options.tracing {
2468 details.method_name =
2469 "google_cloud_appengine_v1::client::Instances::delete_instance::until_done";
2470 }
2471
2472 let stub = self.0.stub.clone();
2473 let mut options = self.0.options.clone();
2474 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2475 let query = move |name| {
2476 let stub = stub.clone();
2477 let options = options.clone();
2478 async {
2479 let op = GetOperation::new(stub)
2480 .set_name(name)
2481 .with_options(options)
2482 .send()
2483 .await?;
2484 Ok(Operation::new(op))
2485 }
2486 };
2487
2488 let start = move || async {
2489 let op = self.send().await?;
2490 Ok(Operation::new(op))
2491 };
2492
2493 use google_cloud_lro::internal::PollerExt;
2494 {
2495 google_cloud_lro::internal::new_unit_response_poller(
2496 polling_error_policy,
2497 polling_backoff_policy,
2498 start,
2499 query,
2500 )
2501 }
2502 .with_options(poller_options)
2503 }
2504
2505 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2507 self.0.request.name = v.into();
2508 self
2509 }
2510 }
2511
2512 #[doc(hidden)]
2513 impl crate::RequestBuilder for DeleteInstance {
2514 fn request_options(&mut self) -> &mut crate::RequestOptions {
2515 &mut self.0.options
2516 }
2517 }
2518
2519 #[derive(Clone, Debug)]
2537 pub struct DebugInstance(RequestBuilder<crate::model::DebugInstanceRequest>);
2538
2539 impl DebugInstance {
2540 pub(crate) fn new(
2541 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2542 ) -> Self {
2543 Self(RequestBuilder::new(stub))
2544 }
2545
2546 pub fn with_request<V: Into<crate::model::DebugInstanceRequest>>(mut self, v: V) -> Self {
2548 self.0.request = v.into();
2549 self
2550 }
2551
2552 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2554 self.0.options = v.into();
2555 self
2556 }
2557
2558 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2565 (*self.0.stub)
2566 .debug_instance(self.0.request, self.0.options)
2567 .await
2568 .map(crate::Response::into_body)
2569 }
2570
2571 pub fn poller(
2573 self,
2574 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadataV1>
2575 {
2576 type Operation = google_cloud_lro::internal::Operation<
2577 crate::model::Instance,
2578 crate::model::OperationMetadataV1,
2579 >;
2580 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2581 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2582 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2583 if let Some(ref mut details) = poller_options.tracing {
2584 details.method_name =
2585 "google_cloud_appengine_v1::client::Instances::debug_instance::until_done";
2586 }
2587
2588 let stub = self.0.stub.clone();
2589 let mut options = self.0.options.clone();
2590 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2591 let query = move |name| {
2592 let stub = stub.clone();
2593 let options = options.clone();
2594 async {
2595 let op = GetOperation::new(stub)
2596 .set_name(name)
2597 .with_options(options)
2598 .send()
2599 .await?;
2600 Ok(Operation::new(op))
2601 }
2602 };
2603
2604 let start = move || async {
2605 let op = self.send().await?;
2606 Ok(Operation::new(op))
2607 };
2608
2609 use google_cloud_lro::internal::PollerExt;
2610 {
2611 google_cloud_lro::internal::new_poller(
2612 polling_error_policy,
2613 polling_backoff_policy,
2614 start,
2615 query,
2616 )
2617 }
2618 .with_options(poller_options)
2619 }
2620
2621 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2623 self.0.request.name = v.into();
2624 self
2625 }
2626
2627 pub fn set_ssh_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
2629 self.0.request.ssh_key = v.into();
2630 self
2631 }
2632 }
2633
2634 #[doc(hidden)]
2635 impl crate::RequestBuilder for DebugInstance {
2636 fn request_options(&mut self) -> &mut crate::RequestOptions {
2637 &mut self.0.options
2638 }
2639 }
2640
2641 #[derive(Clone, Debug)]
2662 pub struct ListOperations(
2663 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2664 );
2665
2666 impl ListOperations {
2667 pub(crate) fn new(
2668 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2669 ) -> Self {
2670 Self(RequestBuilder::new(stub))
2671 }
2672
2673 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2675 mut self,
2676 v: V,
2677 ) -> Self {
2678 self.0.request = v.into();
2679 self
2680 }
2681
2682 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2684 self.0.options = v.into();
2685 self
2686 }
2687
2688 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2690 (*self.0.stub)
2691 .list_operations(self.0.request, self.0.options)
2692 .await
2693 .map(crate::Response::into_body)
2694 }
2695
2696 pub fn by_page(
2698 self,
2699 ) -> impl google_cloud_gax::paginator::Paginator<
2700 google_cloud_longrunning::model::ListOperationsResponse,
2701 crate::Error,
2702 > {
2703 use std::clone::Clone;
2704 let token = self.0.request.page_token.clone();
2705 let execute = move |token: String| {
2706 let mut builder = self.clone();
2707 builder.0.request = builder.0.request.set_page_token(token);
2708 builder.send()
2709 };
2710 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2711 }
2712
2713 pub fn by_item(
2715 self,
2716 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2717 google_cloud_longrunning::model::ListOperationsResponse,
2718 crate::Error,
2719 > {
2720 use google_cloud_gax::paginator::Paginator;
2721 self.by_page().items()
2722 }
2723
2724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2726 self.0.request.name = v.into();
2727 self
2728 }
2729
2730 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2732 self.0.request.filter = v.into();
2733 self
2734 }
2735
2736 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2738 self.0.request.page_size = v.into();
2739 self
2740 }
2741
2742 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2744 self.0.request.page_token = v.into();
2745 self
2746 }
2747
2748 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2750 self.0.request.return_partial_success = v.into();
2751 self
2752 }
2753 }
2754
2755 #[doc(hidden)]
2756 impl crate::RequestBuilder for ListOperations {
2757 fn request_options(&mut self) -> &mut crate::RequestOptions {
2758 &mut self.0.options
2759 }
2760 }
2761
2762 #[derive(Clone, Debug)]
2779 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2780
2781 impl GetOperation {
2782 pub(crate) fn new(
2783 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
2784 ) -> Self {
2785 Self(RequestBuilder::new(stub))
2786 }
2787
2788 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2790 mut self,
2791 v: V,
2792 ) -> Self {
2793 self.0.request = v.into();
2794 self
2795 }
2796
2797 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2799 self.0.options = v.into();
2800 self
2801 }
2802
2803 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2805 (*self.0.stub)
2806 .get_operation(self.0.request, self.0.options)
2807 .await
2808 .map(crate::Response::into_body)
2809 }
2810
2811 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2813 self.0.request.name = v.into();
2814 self
2815 }
2816 }
2817
2818 #[doc(hidden)]
2819 impl crate::RequestBuilder for GetOperation {
2820 fn request_options(&mut self) -> &mut crate::RequestOptions {
2821 &mut self.0.options
2822 }
2823 }
2824}
2825
2826pub mod firewall {
2828 use crate::Result;
2829
2830 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2844
2845 pub(crate) mod client {
2846 use super::super::super::client::Firewall;
2847 pub struct Factory;
2848 impl crate::ClientFactory for Factory {
2849 type Client = Firewall;
2850 type Credentials = gaxi::options::Credentials;
2851 async fn build(
2852 self,
2853 config: gaxi::options::ClientConfig,
2854 ) -> crate::ClientBuilderResult<Self::Client> {
2855 Self::Client::new(config).await
2856 }
2857 }
2858 }
2859
2860 #[derive(Clone, Debug)]
2862 pub(crate) struct RequestBuilder<R: std::default::Default> {
2863 stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>,
2864 request: R,
2865 options: crate::RequestOptions,
2866 }
2867
2868 impl<R> RequestBuilder<R>
2869 where
2870 R: std::default::Default,
2871 {
2872 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2873 Self {
2874 stub,
2875 request: R::default(),
2876 options: crate::RequestOptions::default(),
2877 }
2878 }
2879 }
2880
2881 #[derive(Clone, Debug)]
2902 pub struct ListIngressRules(RequestBuilder<crate::model::ListIngressRulesRequest>);
2903
2904 impl ListIngressRules {
2905 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
2906 Self(RequestBuilder::new(stub))
2907 }
2908
2909 pub fn with_request<V: Into<crate::model::ListIngressRulesRequest>>(
2911 mut self,
2912 v: V,
2913 ) -> Self {
2914 self.0.request = v.into();
2915 self
2916 }
2917
2918 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2920 self.0.options = v.into();
2921 self
2922 }
2923
2924 pub async fn send(self) -> Result<crate::model::ListIngressRulesResponse> {
2926 (*self.0.stub)
2927 .list_ingress_rules(self.0.request, self.0.options)
2928 .await
2929 .map(crate::Response::into_body)
2930 }
2931
2932 pub fn by_page(
2934 self,
2935 ) -> impl google_cloud_gax::paginator::Paginator<
2936 crate::model::ListIngressRulesResponse,
2937 crate::Error,
2938 > {
2939 use std::clone::Clone;
2940 let token = self.0.request.page_token.clone();
2941 let execute = move |token: String| {
2942 let mut builder = self.clone();
2943 builder.0.request = builder.0.request.set_page_token(token);
2944 builder.send()
2945 };
2946 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2947 }
2948
2949 pub fn by_item(
2951 self,
2952 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2953 crate::model::ListIngressRulesResponse,
2954 crate::Error,
2955 > {
2956 use google_cloud_gax::paginator::Paginator;
2957 self.by_page().items()
2958 }
2959
2960 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2962 self.0.request.parent = v.into();
2963 self
2964 }
2965
2966 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2968 self.0.request.page_size = v.into();
2969 self
2970 }
2971
2972 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.0.request.page_token = v.into();
2975 self
2976 }
2977
2978 pub fn set_matching_address<T: Into<std::string::String>>(mut self, v: T) -> Self {
2980 self.0.request.matching_address = v.into();
2981 self
2982 }
2983 }
2984
2985 #[doc(hidden)]
2986 impl crate::RequestBuilder for ListIngressRules {
2987 fn request_options(&mut self) -> &mut crate::RequestOptions {
2988 &mut self.0.options
2989 }
2990 }
2991
2992 #[derive(Clone, Debug)]
3009 pub struct BatchUpdateIngressRules(
3010 RequestBuilder<crate::model::BatchUpdateIngressRulesRequest>,
3011 );
3012
3013 impl BatchUpdateIngressRules {
3014 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3015 Self(RequestBuilder::new(stub))
3016 }
3017
3018 pub fn with_request<V: Into<crate::model::BatchUpdateIngressRulesRequest>>(
3020 mut self,
3021 v: V,
3022 ) -> Self {
3023 self.0.request = v.into();
3024 self
3025 }
3026
3027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3029 self.0.options = v.into();
3030 self
3031 }
3032
3033 pub async fn send(self) -> Result<crate::model::BatchUpdateIngressRulesResponse> {
3035 (*self.0.stub)
3036 .batch_update_ingress_rules(self.0.request, self.0.options)
3037 .await
3038 .map(crate::Response::into_body)
3039 }
3040
3041 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3043 self.0.request.name = v.into();
3044 self
3045 }
3046
3047 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3049 where
3050 T: std::iter::IntoIterator<Item = V>,
3051 V: std::convert::Into<crate::model::FirewallRule>,
3052 {
3053 use std::iter::Iterator;
3054 self.0.request.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3055 self
3056 }
3057 }
3058
3059 #[doc(hidden)]
3060 impl crate::RequestBuilder for BatchUpdateIngressRules {
3061 fn request_options(&mut self) -> &mut crate::RequestOptions {
3062 &mut self.0.options
3063 }
3064 }
3065
3066 #[derive(Clone, Debug)]
3083 pub struct CreateIngressRule(RequestBuilder<crate::model::CreateIngressRuleRequest>);
3084
3085 impl CreateIngressRule {
3086 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3087 Self(RequestBuilder::new(stub))
3088 }
3089
3090 pub fn with_request<V: Into<crate::model::CreateIngressRuleRequest>>(
3092 mut self,
3093 v: V,
3094 ) -> Self {
3095 self.0.request = v.into();
3096 self
3097 }
3098
3099 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3101 self.0.options = v.into();
3102 self
3103 }
3104
3105 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3107 (*self.0.stub)
3108 .create_ingress_rule(self.0.request, self.0.options)
3109 .await
3110 .map(crate::Response::into_body)
3111 }
3112
3113 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3115 self.0.request.parent = v.into();
3116 self
3117 }
3118
3119 pub fn set_rule<T>(mut self, v: T) -> Self
3121 where
3122 T: std::convert::Into<crate::model::FirewallRule>,
3123 {
3124 self.0.request.rule = std::option::Option::Some(v.into());
3125 self
3126 }
3127
3128 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3130 where
3131 T: std::convert::Into<crate::model::FirewallRule>,
3132 {
3133 self.0.request.rule = v.map(|x| x.into());
3134 self
3135 }
3136 }
3137
3138 #[doc(hidden)]
3139 impl crate::RequestBuilder for CreateIngressRule {
3140 fn request_options(&mut self) -> &mut crate::RequestOptions {
3141 &mut self.0.options
3142 }
3143 }
3144
3145 #[derive(Clone, Debug)]
3162 pub struct GetIngressRule(RequestBuilder<crate::model::GetIngressRuleRequest>);
3163
3164 impl GetIngressRule {
3165 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3166 Self(RequestBuilder::new(stub))
3167 }
3168
3169 pub fn with_request<V: Into<crate::model::GetIngressRuleRequest>>(mut self, v: V) -> Self {
3171 self.0.request = v.into();
3172 self
3173 }
3174
3175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3177 self.0.options = v.into();
3178 self
3179 }
3180
3181 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3183 (*self.0.stub)
3184 .get_ingress_rule(self.0.request, self.0.options)
3185 .await
3186 .map(crate::Response::into_body)
3187 }
3188
3189 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3191 self.0.request.name = v.into();
3192 self
3193 }
3194 }
3195
3196 #[doc(hidden)]
3197 impl crate::RequestBuilder for GetIngressRule {
3198 fn request_options(&mut self) -> &mut crate::RequestOptions {
3199 &mut self.0.options
3200 }
3201 }
3202
3203 #[derive(Clone, Debug)]
3220 pub struct UpdateIngressRule(RequestBuilder<crate::model::UpdateIngressRuleRequest>);
3221
3222 impl UpdateIngressRule {
3223 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3224 Self(RequestBuilder::new(stub))
3225 }
3226
3227 pub fn with_request<V: Into<crate::model::UpdateIngressRuleRequest>>(
3229 mut self,
3230 v: V,
3231 ) -> Self {
3232 self.0.request = v.into();
3233 self
3234 }
3235
3236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3238 self.0.options = v.into();
3239 self
3240 }
3241
3242 pub async fn send(self) -> Result<crate::model::FirewallRule> {
3244 (*self.0.stub)
3245 .update_ingress_rule(self.0.request, self.0.options)
3246 .await
3247 .map(crate::Response::into_body)
3248 }
3249
3250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3252 self.0.request.name = v.into();
3253 self
3254 }
3255
3256 pub fn set_rule<T>(mut self, v: T) -> Self
3258 where
3259 T: std::convert::Into<crate::model::FirewallRule>,
3260 {
3261 self.0.request.rule = std::option::Option::Some(v.into());
3262 self
3263 }
3264
3265 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3267 where
3268 T: std::convert::Into<crate::model::FirewallRule>,
3269 {
3270 self.0.request.rule = v.map(|x| x.into());
3271 self
3272 }
3273
3274 pub fn set_update_mask<T>(mut self, v: T) -> Self
3276 where
3277 T: std::convert::Into<wkt::FieldMask>,
3278 {
3279 self.0.request.update_mask = std::option::Option::Some(v.into());
3280 self
3281 }
3282
3283 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3285 where
3286 T: std::convert::Into<wkt::FieldMask>,
3287 {
3288 self.0.request.update_mask = v.map(|x| x.into());
3289 self
3290 }
3291 }
3292
3293 #[doc(hidden)]
3294 impl crate::RequestBuilder for UpdateIngressRule {
3295 fn request_options(&mut self) -> &mut crate::RequestOptions {
3296 &mut self.0.options
3297 }
3298 }
3299
3300 #[derive(Clone, Debug)]
3317 pub struct DeleteIngressRule(RequestBuilder<crate::model::DeleteIngressRuleRequest>);
3318
3319 impl DeleteIngressRule {
3320 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3321 Self(RequestBuilder::new(stub))
3322 }
3323
3324 pub fn with_request<V: Into<crate::model::DeleteIngressRuleRequest>>(
3326 mut self,
3327 v: V,
3328 ) -> Self {
3329 self.0.request = v.into();
3330 self
3331 }
3332
3333 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3335 self.0.options = v.into();
3336 self
3337 }
3338
3339 pub async fn send(self) -> Result<()> {
3341 (*self.0.stub)
3342 .delete_ingress_rule(self.0.request, self.0.options)
3343 .await
3344 .map(crate::Response::into_body)
3345 }
3346
3347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3349 self.0.request.name = v.into();
3350 self
3351 }
3352 }
3353
3354 #[doc(hidden)]
3355 impl crate::RequestBuilder for DeleteIngressRule {
3356 fn request_options(&mut self) -> &mut crate::RequestOptions {
3357 &mut self.0.options
3358 }
3359 }
3360
3361 #[derive(Clone, Debug)]
3382 pub struct ListOperations(
3383 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3384 );
3385
3386 impl ListOperations {
3387 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3388 Self(RequestBuilder::new(stub))
3389 }
3390
3391 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3393 mut self,
3394 v: V,
3395 ) -> Self {
3396 self.0.request = v.into();
3397 self
3398 }
3399
3400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3402 self.0.options = v.into();
3403 self
3404 }
3405
3406 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3408 (*self.0.stub)
3409 .list_operations(self.0.request, self.0.options)
3410 .await
3411 .map(crate::Response::into_body)
3412 }
3413
3414 pub fn by_page(
3416 self,
3417 ) -> impl google_cloud_gax::paginator::Paginator<
3418 google_cloud_longrunning::model::ListOperationsResponse,
3419 crate::Error,
3420 > {
3421 use std::clone::Clone;
3422 let token = self.0.request.page_token.clone();
3423 let execute = move |token: String| {
3424 let mut builder = self.clone();
3425 builder.0.request = builder.0.request.set_page_token(token);
3426 builder.send()
3427 };
3428 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3429 }
3430
3431 pub fn by_item(
3433 self,
3434 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3435 google_cloud_longrunning::model::ListOperationsResponse,
3436 crate::Error,
3437 > {
3438 use google_cloud_gax::paginator::Paginator;
3439 self.by_page().items()
3440 }
3441
3442 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3444 self.0.request.name = v.into();
3445 self
3446 }
3447
3448 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3450 self.0.request.filter = v.into();
3451 self
3452 }
3453
3454 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3456 self.0.request.page_size = v.into();
3457 self
3458 }
3459
3460 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3462 self.0.request.page_token = v.into();
3463 self
3464 }
3465
3466 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3468 self.0.request.return_partial_success = v.into();
3469 self
3470 }
3471 }
3472
3473 #[doc(hidden)]
3474 impl crate::RequestBuilder for ListOperations {
3475 fn request_options(&mut self) -> &mut crate::RequestOptions {
3476 &mut self.0.options
3477 }
3478 }
3479
3480 #[derive(Clone, Debug)]
3497 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3498
3499 impl GetOperation {
3500 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Firewall>) -> Self {
3501 Self(RequestBuilder::new(stub))
3502 }
3503
3504 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3506 mut self,
3507 v: V,
3508 ) -> Self {
3509 self.0.request = v.into();
3510 self
3511 }
3512
3513 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3515 self.0.options = v.into();
3516 self
3517 }
3518
3519 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3521 (*self.0.stub)
3522 .get_operation(self.0.request, self.0.options)
3523 .await
3524 .map(crate::Response::into_body)
3525 }
3526
3527 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3529 self.0.request.name = v.into();
3530 self
3531 }
3532 }
3533
3534 #[doc(hidden)]
3535 impl crate::RequestBuilder for GetOperation {
3536 fn request_options(&mut self) -> &mut crate::RequestOptions {
3537 &mut self.0.options
3538 }
3539 }
3540}
3541
3542pub mod authorized_domains {
3544 use crate::Result;
3545
3546 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3560
3561 pub(crate) mod client {
3562 use super::super::super::client::AuthorizedDomains;
3563 pub struct Factory;
3564 impl crate::ClientFactory for Factory {
3565 type Client = AuthorizedDomains;
3566 type Credentials = gaxi::options::Credentials;
3567 async fn build(
3568 self,
3569 config: gaxi::options::ClientConfig,
3570 ) -> crate::ClientBuilderResult<Self::Client> {
3571 Self::Client::new(config).await
3572 }
3573 }
3574 }
3575
3576 #[derive(Clone, Debug)]
3578 pub(crate) struct RequestBuilder<R: std::default::Default> {
3579 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3580 request: R,
3581 options: crate::RequestOptions,
3582 }
3583
3584 impl<R> RequestBuilder<R>
3585 where
3586 R: std::default::Default,
3587 {
3588 pub(crate) fn new(
3589 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3590 ) -> Self {
3591 Self {
3592 stub,
3593 request: R::default(),
3594 options: crate::RequestOptions::default(),
3595 }
3596 }
3597 }
3598
3599 #[derive(Clone, Debug)]
3620 pub struct ListAuthorizedDomains(RequestBuilder<crate::model::ListAuthorizedDomainsRequest>);
3621
3622 impl ListAuthorizedDomains {
3623 pub(crate) fn new(
3624 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3625 ) -> Self {
3626 Self(RequestBuilder::new(stub))
3627 }
3628
3629 pub fn with_request<V: Into<crate::model::ListAuthorizedDomainsRequest>>(
3631 mut self,
3632 v: V,
3633 ) -> Self {
3634 self.0.request = v.into();
3635 self
3636 }
3637
3638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3640 self.0.options = v.into();
3641 self
3642 }
3643
3644 pub async fn send(self) -> Result<crate::model::ListAuthorizedDomainsResponse> {
3646 (*self.0.stub)
3647 .list_authorized_domains(self.0.request, self.0.options)
3648 .await
3649 .map(crate::Response::into_body)
3650 }
3651
3652 pub fn by_page(
3654 self,
3655 ) -> impl google_cloud_gax::paginator::Paginator<
3656 crate::model::ListAuthorizedDomainsResponse,
3657 crate::Error,
3658 > {
3659 use std::clone::Clone;
3660 let token = self.0.request.page_token.clone();
3661 let execute = move |token: String| {
3662 let mut builder = self.clone();
3663 builder.0.request = builder.0.request.set_page_token(token);
3664 builder.send()
3665 };
3666 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3667 }
3668
3669 pub fn by_item(
3671 self,
3672 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3673 crate::model::ListAuthorizedDomainsResponse,
3674 crate::Error,
3675 > {
3676 use google_cloud_gax::paginator::Paginator;
3677 self.by_page().items()
3678 }
3679
3680 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3682 self.0.request.parent = v.into();
3683 self
3684 }
3685
3686 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3688 self.0.request.page_size = v.into();
3689 self
3690 }
3691
3692 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3694 self.0.request.page_token = v.into();
3695 self
3696 }
3697 }
3698
3699 #[doc(hidden)]
3700 impl crate::RequestBuilder for ListAuthorizedDomains {
3701 fn request_options(&mut self) -> &mut crate::RequestOptions {
3702 &mut self.0.options
3703 }
3704 }
3705
3706 #[derive(Clone, Debug)]
3727 pub struct ListOperations(
3728 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3729 );
3730
3731 impl ListOperations {
3732 pub(crate) fn new(
3733 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3734 ) -> Self {
3735 Self(RequestBuilder::new(stub))
3736 }
3737
3738 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3740 mut self,
3741 v: V,
3742 ) -> Self {
3743 self.0.request = v.into();
3744 self
3745 }
3746
3747 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3749 self.0.options = v.into();
3750 self
3751 }
3752
3753 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3755 (*self.0.stub)
3756 .list_operations(self.0.request, self.0.options)
3757 .await
3758 .map(crate::Response::into_body)
3759 }
3760
3761 pub fn by_page(
3763 self,
3764 ) -> impl google_cloud_gax::paginator::Paginator<
3765 google_cloud_longrunning::model::ListOperationsResponse,
3766 crate::Error,
3767 > {
3768 use std::clone::Clone;
3769 let token = self.0.request.page_token.clone();
3770 let execute = move |token: String| {
3771 let mut builder = self.clone();
3772 builder.0.request = builder.0.request.set_page_token(token);
3773 builder.send()
3774 };
3775 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3776 }
3777
3778 pub fn by_item(
3780 self,
3781 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3782 google_cloud_longrunning::model::ListOperationsResponse,
3783 crate::Error,
3784 > {
3785 use google_cloud_gax::paginator::Paginator;
3786 self.by_page().items()
3787 }
3788
3789 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3791 self.0.request.name = v.into();
3792 self
3793 }
3794
3795 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3797 self.0.request.filter = v.into();
3798 self
3799 }
3800
3801 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3803 self.0.request.page_size = v.into();
3804 self
3805 }
3806
3807 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3809 self.0.request.page_token = v.into();
3810 self
3811 }
3812
3813 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3815 self.0.request.return_partial_success = v.into();
3816 self
3817 }
3818 }
3819
3820 #[doc(hidden)]
3821 impl crate::RequestBuilder for ListOperations {
3822 fn request_options(&mut self) -> &mut crate::RequestOptions {
3823 &mut self.0.options
3824 }
3825 }
3826
3827 #[derive(Clone, Debug)]
3844 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3845
3846 impl GetOperation {
3847 pub(crate) fn new(
3848 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedDomains>,
3849 ) -> Self {
3850 Self(RequestBuilder::new(stub))
3851 }
3852
3853 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3855 mut self,
3856 v: V,
3857 ) -> Self {
3858 self.0.request = v.into();
3859 self
3860 }
3861
3862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3864 self.0.options = v.into();
3865 self
3866 }
3867
3868 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3870 (*self.0.stub)
3871 .get_operation(self.0.request, self.0.options)
3872 .await
3873 .map(crate::Response::into_body)
3874 }
3875
3876 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3878 self.0.request.name = v.into();
3879 self
3880 }
3881 }
3882
3883 #[doc(hidden)]
3884 impl crate::RequestBuilder for GetOperation {
3885 fn request_options(&mut self) -> &mut crate::RequestOptions {
3886 &mut self.0.options
3887 }
3888 }
3889}
3890
3891pub mod authorized_certificates {
3893 use crate::Result;
3894
3895 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3909
3910 pub(crate) mod client {
3911 use super::super::super::client::AuthorizedCertificates;
3912 pub struct Factory;
3913 impl crate::ClientFactory for Factory {
3914 type Client = AuthorizedCertificates;
3915 type Credentials = gaxi::options::Credentials;
3916 async fn build(
3917 self,
3918 config: gaxi::options::ClientConfig,
3919 ) -> crate::ClientBuilderResult<Self::Client> {
3920 Self::Client::new(config).await
3921 }
3922 }
3923 }
3924
3925 #[derive(Clone, Debug)]
3927 pub(crate) struct RequestBuilder<R: std::default::Default> {
3928 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3929 request: R,
3930 options: crate::RequestOptions,
3931 }
3932
3933 impl<R> RequestBuilder<R>
3934 where
3935 R: std::default::Default,
3936 {
3937 pub(crate) fn new(
3938 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3939 ) -> Self {
3940 Self {
3941 stub,
3942 request: R::default(),
3943 options: crate::RequestOptions::default(),
3944 }
3945 }
3946 }
3947
3948 #[derive(Clone, Debug)]
3969 pub struct ListAuthorizedCertificates(
3970 RequestBuilder<crate::model::ListAuthorizedCertificatesRequest>,
3971 );
3972
3973 impl ListAuthorizedCertificates {
3974 pub(crate) fn new(
3975 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
3976 ) -> Self {
3977 Self(RequestBuilder::new(stub))
3978 }
3979
3980 pub fn with_request<V: Into<crate::model::ListAuthorizedCertificatesRequest>>(
3982 mut self,
3983 v: V,
3984 ) -> Self {
3985 self.0.request = v.into();
3986 self
3987 }
3988
3989 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3991 self.0.options = v.into();
3992 self
3993 }
3994
3995 pub async fn send(self) -> Result<crate::model::ListAuthorizedCertificatesResponse> {
3997 (*self.0.stub)
3998 .list_authorized_certificates(self.0.request, self.0.options)
3999 .await
4000 .map(crate::Response::into_body)
4001 }
4002
4003 pub fn by_page(
4005 self,
4006 ) -> impl google_cloud_gax::paginator::Paginator<
4007 crate::model::ListAuthorizedCertificatesResponse,
4008 crate::Error,
4009 > {
4010 use std::clone::Clone;
4011 let token = self.0.request.page_token.clone();
4012 let execute = move |token: String| {
4013 let mut builder = self.clone();
4014 builder.0.request = builder.0.request.set_page_token(token);
4015 builder.send()
4016 };
4017 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4018 }
4019
4020 pub fn by_item(
4022 self,
4023 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4024 crate::model::ListAuthorizedCertificatesResponse,
4025 crate::Error,
4026 > {
4027 use google_cloud_gax::paginator::Paginator;
4028 self.by_page().items()
4029 }
4030
4031 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4033 self.0.request.parent = v.into();
4034 self
4035 }
4036
4037 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
4039 self.0.request.view = v.into();
4040 self
4041 }
4042
4043 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4045 self.0.request.page_size = v.into();
4046 self
4047 }
4048
4049 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4051 self.0.request.page_token = v.into();
4052 self
4053 }
4054 }
4055
4056 #[doc(hidden)]
4057 impl crate::RequestBuilder for ListAuthorizedCertificates {
4058 fn request_options(&mut self) -> &mut crate::RequestOptions {
4059 &mut self.0.options
4060 }
4061 }
4062
4063 #[derive(Clone, Debug)]
4080 pub struct GetAuthorizedCertificate(
4081 RequestBuilder<crate::model::GetAuthorizedCertificateRequest>,
4082 );
4083
4084 impl GetAuthorizedCertificate {
4085 pub(crate) fn new(
4086 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4087 ) -> Self {
4088 Self(RequestBuilder::new(stub))
4089 }
4090
4091 pub fn with_request<V: Into<crate::model::GetAuthorizedCertificateRequest>>(
4093 mut self,
4094 v: V,
4095 ) -> Self {
4096 self.0.request = v.into();
4097 self
4098 }
4099
4100 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4102 self.0.options = v.into();
4103 self
4104 }
4105
4106 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4108 (*self.0.stub)
4109 .get_authorized_certificate(self.0.request, self.0.options)
4110 .await
4111 .map(crate::Response::into_body)
4112 }
4113
4114 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4116 self.0.request.name = v.into();
4117 self
4118 }
4119
4120 pub fn set_view<T: Into<crate::model::AuthorizedCertificateView>>(mut self, v: T) -> Self {
4122 self.0.request.view = v.into();
4123 self
4124 }
4125 }
4126
4127 #[doc(hidden)]
4128 impl crate::RequestBuilder for GetAuthorizedCertificate {
4129 fn request_options(&mut self) -> &mut crate::RequestOptions {
4130 &mut self.0.options
4131 }
4132 }
4133
4134 #[derive(Clone, Debug)]
4151 pub struct CreateAuthorizedCertificate(
4152 RequestBuilder<crate::model::CreateAuthorizedCertificateRequest>,
4153 );
4154
4155 impl CreateAuthorizedCertificate {
4156 pub(crate) fn new(
4157 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4158 ) -> Self {
4159 Self(RequestBuilder::new(stub))
4160 }
4161
4162 pub fn with_request<V: Into<crate::model::CreateAuthorizedCertificateRequest>>(
4164 mut self,
4165 v: V,
4166 ) -> Self {
4167 self.0.request = v.into();
4168 self
4169 }
4170
4171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4173 self.0.options = v.into();
4174 self
4175 }
4176
4177 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4179 (*self.0.stub)
4180 .create_authorized_certificate(self.0.request, self.0.options)
4181 .await
4182 .map(crate::Response::into_body)
4183 }
4184
4185 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4187 self.0.request.parent = v.into();
4188 self
4189 }
4190
4191 pub fn set_certificate<T>(mut self, v: T) -> Self
4193 where
4194 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4195 {
4196 self.0.request.certificate = std::option::Option::Some(v.into());
4197 self
4198 }
4199
4200 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4202 where
4203 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4204 {
4205 self.0.request.certificate = v.map(|x| x.into());
4206 self
4207 }
4208 }
4209
4210 #[doc(hidden)]
4211 impl crate::RequestBuilder for CreateAuthorizedCertificate {
4212 fn request_options(&mut self) -> &mut crate::RequestOptions {
4213 &mut self.0.options
4214 }
4215 }
4216
4217 #[derive(Clone, Debug)]
4234 pub struct UpdateAuthorizedCertificate(
4235 RequestBuilder<crate::model::UpdateAuthorizedCertificateRequest>,
4236 );
4237
4238 impl UpdateAuthorizedCertificate {
4239 pub(crate) fn new(
4240 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4241 ) -> Self {
4242 Self(RequestBuilder::new(stub))
4243 }
4244
4245 pub fn with_request<V: Into<crate::model::UpdateAuthorizedCertificateRequest>>(
4247 mut self,
4248 v: V,
4249 ) -> Self {
4250 self.0.request = v.into();
4251 self
4252 }
4253
4254 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4256 self.0.options = v.into();
4257 self
4258 }
4259
4260 pub async fn send(self) -> Result<crate::model::AuthorizedCertificate> {
4262 (*self.0.stub)
4263 .update_authorized_certificate(self.0.request, self.0.options)
4264 .await
4265 .map(crate::Response::into_body)
4266 }
4267
4268 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4270 self.0.request.name = v.into();
4271 self
4272 }
4273
4274 pub fn set_certificate<T>(mut self, v: T) -> Self
4276 where
4277 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4278 {
4279 self.0.request.certificate = std::option::Option::Some(v.into());
4280 self
4281 }
4282
4283 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
4285 where
4286 T: std::convert::Into<crate::model::AuthorizedCertificate>,
4287 {
4288 self.0.request.certificate = v.map(|x| x.into());
4289 self
4290 }
4291
4292 pub fn set_update_mask<T>(mut self, v: T) -> Self
4294 where
4295 T: std::convert::Into<wkt::FieldMask>,
4296 {
4297 self.0.request.update_mask = std::option::Option::Some(v.into());
4298 self
4299 }
4300
4301 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4303 where
4304 T: std::convert::Into<wkt::FieldMask>,
4305 {
4306 self.0.request.update_mask = v.map(|x| x.into());
4307 self
4308 }
4309 }
4310
4311 #[doc(hidden)]
4312 impl crate::RequestBuilder for UpdateAuthorizedCertificate {
4313 fn request_options(&mut self) -> &mut crate::RequestOptions {
4314 &mut self.0.options
4315 }
4316 }
4317
4318 #[derive(Clone, Debug)]
4335 pub struct DeleteAuthorizedCertificate(
4336 RequestBuilder<crate::model::DeleteAuthorizedCertificateRequest>,
4337 );
4338
4339 impl DeleteAuthorizedCertificate {
4340 pub(crate) fn new(
4341 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4342 ) -> Self {
4343 Self(RequestBuilder::new(stub))
4344 }
4345
4346 pub fn with_request<V: Into<crate::model::DeleteAuthorizedCertificateRequest>>(
4348 mut self,
4349 v: V,
4350 ) -> Self {
4351 self.0.request = v.into();
4352 self
4353 }
4354
4355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4357 self.0.options = v.into();
4358 self
4359 }
4360
4361 pub async fn send(self) -> Result<()> {
4363 (*self.0.stub)
4364 .delete_authorized_certificate(self.0.request, self.0.options)
4365 .await
4366 .map(crate::Response::into_body)
4367 }
4368
4369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4371 self.0.request.name = v.into();
4372 self
4373 }
4374 }
4375
4376 #[doc(hidden)]
4377 impl crate::RequestBuilder for DeleteAuthorizedCertificate {
4378 fn request_options(&mut self) -> &mut crate::RequestOptions {
4379 &mut self.0.options
4380 }
4381 }
4382
4383 #[derive(Clone, Debug)]
4404 pub struct ListOperations(
4405 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4406 );
4407
4408 impl ListOperations {
4409 pub(crate) fn new(
4410 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4411 ) -> Self {
4412 Self(RequestBuilder::new(stub))
4413 }
4414
4415 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4417 mut self,
4418 v: V,
4419 ) -> Self {
4420 self.0.request = v.into();
4421 self
4422 }
4423
4424 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4426 self.0.options = v.into();
4427 self
4428 }
4429
4430 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4432 (*self.0.stub)
4433 .list_operations(self.0.request, self.0.options)
4434 .await
4435 .map(crate::Response::into_body)
4436 }
4437
4438 pub fn by_page(
4440 self,
4441 ) -> impl google_cloud_gax::paginator::Paginator<
4442 google_cloud_longrunning::model::ListOperationsResponse,
4443 crate::Error,
4444 > {
4445 use std::clone::Clone;
4446 let token = self.0.request.page_token.clone();
4447 let execute = move |token: String| {
4448 let mut builder = self.clone();
4449 builder.0.request = builder.0.request.set_page_token(token);
4450 builder.send()
4451 };
4452 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4453 }
4454
4455 pub fn by_item(
4457 self,
4458 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4459 google_cloud_longrunning::model::ListOperationsResponse,
4460 crate::Error,
4461 > {
4462 use google_cloud_gax::paginator::Paginator;
4463 self.by_page().items()
4464 }
4465
4466 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4468 self.0.request.name = v.into();
4469 self
4470 }
4471
4472 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4474 self.0.request.filter = v.into();
4475 self
4476 }
4477
4478 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4480 self.0.request.page_size = v.into();
4481 self
4482 }
4483
4484 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4486 self.0.request.page_token = v.into();
4487 self
4488 }
4489
4490 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4492 self.0.request.return_partial_success = v.into();
4493 self
4494 }
4495 }
4496
4497 #[doc(hidden)]
4498 impl crate::RequestBuilder for ListOperations {
4499 fn request_options(&mut self) -> &mut crate::RequestOptions {
4500 &mut self.0.options
4501 }
4502 }
4503
4504 #[derive(Clone, Debug)]
4521 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4522
4523 impl GetOperation {
4524 pub(crate) fn new(
4525 stub: std::sync::Arc<dyn super::super::stub::dynamic::AuthorizedCertificates>,
4526 ) -> Self {
4527 Self(RequestBuilder::new(stub))
4528 }
4529
4530 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4532 mut self,
4533 v: V,
4534 ) -> Self {
4535 self.0.request = v.into();
4536 self
4537 }
4538
4539 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4541 self.0.options = v.into();
4542 self
4543 }
4544
4545 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4547 (*self.0.stub)
4548 .get_operation(self.0.request, self.0.options)
4549 .await
4550 .map(crate::Response::into_body)
4551 }
4552
4553 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4555 self.0.request.name = v.into();
4556 self
4557 }
4558 }
4559
4560 #[doc(hidden)]
4561 impl crate::RequestBuilder for GetOperation {
4562 fn request_options(&mut self) -> &mut crate::RequestOptions {
4563 &mut self.0.options
4564 }
4565 }
4566}
4567
4568pub mod domain_mappings {
4570 use crate::Result;
4571
4572 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4586
4587 pub(crate) mod client {
4588 use super::super::super::client::DomainMappings;
4589 pub struct Factory;
4590 impl crate::ClientFactory for Factory {
4591 type Client = DomainMappings;
4592 type Credentials = gaxi::options::Credentials;
4593 async fn build(
4594 self,
4595 config: gaxi::options::ClientConfig,
4596 ) -> crate::ClientBuilderResult<Self::Client> {
4597 Self::Client::new(config).await
4598 }
4599 }
4600 }
4601
4602 #[derive(Clone, Debug)]
4604 pub(crate) struct RequestBuilder<R: std::default::Default> {
4605 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4606 request: R,
4607 options: crate::RequestOptions,
4608 }
4609
4610 impl<R> RequestBuilder<R>
4611 where
4612 R: std::default::Default,
4613 {
4614 pub(crate) fn new(
4615 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4616 ) -> Self {
4617 Self {
4618 stub,
4619 request: R::default(),
4620 options: crate::RequestOptions::default(),
4621 }
4622 }
4623 }
4624
4625 #[derive(Clone, Debug)]
4646 pub struct ListDomainMappings(RequestBuilder<crate::model::ListDomainMappingsRequest>);
4647
4648 impl ListDomainMappings {
4649 pub(crate) fn new(
4650 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4651 ) -> Self {
4652 Self(RequestBuilder::new(stub))
4653 }
4654
4655 pub fn with_request<V: Into<crate::model::ListDomainMappingsRequest>>(
4657 mut self,
4658 v: V,
4659 ) -> Self {
4660 self.0.request = v.into();
4661 self
4662 }
4663
4664 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4666 self.0.options = v.into();
4667 self
4668 }
4669
4670 pub async fn send(self) -> Result<crate::model::ListDomainMappingsResponse> {
4672 (*self.0.stub)
4673 .list_domain_mappings(self.0.request, self.0.options)
4674 .await
4675 .map(crate::Response::into_body)
4676 }
4677
4678 pub fn by_page(
4680 self,
4681 ) -> impl google_cloud_gax::paginator::Paginator<
4682 crate::model::ListDomainMappingsResponse,
4683 crate::Error,
4684 > {
4685 use std::clone::Clone;
4686 let token = self.0.request.page_token.clone();
4687 let execute = move |token: String| {
4688 let mut builder = self.clone();
4689 builder.0.request = builder.0.request.set_page_token(token);
4690 builder.send()
4691 };
4692 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4693 }
4694
4695 pub fn by_item(
4697 self,
4698 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4699 crate::model::ListDomainMappingsResponse,
4700 crate::Error,
4701 > {
4702 use google_cloud_gax::paginator::Paginator;
4703 self.by_page().items()
4704 }
4705
4706 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4708 self.0.request.parent = v.into();
4709 self
4710 }
4711
4712 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4714 self.0.request.page_size = v.into();
4715 self
4716 }
4717
4718 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4720 self.0.request.page_token = v.into();
4721 self
4722 }
4723 }
4724
4725 #[doc(hidden)]
4726 impl crate::RequestBuilder for ListDomainMappings {
4727 fn request_options(&mut self) -> &mut crate::RequestOptions {
4728 &mut self.0.options
4729 }
4730 }
4731
4732 #[derive(Clone, Debug)]
4749 pub struct GetDomainMapping(RequestBuilder<crate::model::GetDomainMappingRequest>);
4750
4751 impl GetDomainMapping {
4752 pub(crate) fn new(
4753 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4754 ) -> Self {
4755 Self(RequestBuilder::new(stub))
4756 }
4757
4758 pub fn with_request<V: Into<crate::model::GetDomainMappingRequest>>(
4760 mut self,
4761 v: V,
4762 ) -> Self {
4763 self.0.request = v.into();
4764 self
4765 }
4766
4767 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4769 self.0.options = v.into();
4770 self
4771 }
4772
4773 pub async fn send(self) -> Result<crate::model::DomainMapping> {
4775 (*self.0.stub)
4776 .get_domain_mapping(self.0.request, self.0.options)
4777 .await
4778 .map(crate::Response::into_body)
4779 }
4780
4781 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4783 self.0.request.name = v.into();
4784 self
4785 }
4786 }
4787
4788 #[doc(hidden)]
4789 impl crate::RequestBuilder for GetDomainMapping {
4790 fn request_options(&mut self) -> &mut crate::RequestOptions {
4791 &mut self.0.options
4792 }
4793 }
4794
4795 #[derive(Clone, Debug)]
4813 pub struct CreateDomainMapping(RequestBuilder<crate::model::CreateDomainMappingRequest>);
4814
4815 impl CreateDomainMapping {
4816 pub(crate) fn new(
4817 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4818 ) -> Self {
4819 Self(RequestBuilder::new(stub))
4820 }
4821
4822 pub fn with_request<V: Into<crate::model::CreateDomainMappingRequest>>(
4824 mut self,
4825 v: V,
4826 ) -> Self {
4827 self.0.request = v.into();
4828 self
4829 }
4830
4831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4833 self.0.options = v.into();
4834 self
4835 }
4836
4837 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4844 (*self.0.stub)
4845 .create_domain_mapping(self.0.request, self.0.options)
4846 .await
4847 .map(crate::Response::into_body)
4848 }
4849
4850 pub fn poller(
4852 self,
4853 ) -> impl google_cloud_lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4854 {
4855 type Operation = google_cloud_lro::internal::Operation<
4856 crate::model::DomainMapping,
4857 crate::model::OperationMetadataV1,
4858 >;
4859 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4860 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4861 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4862 if let Some(ref mut details) = poller_options.tracing {
4863 details.method_name = "google_cloud_appengine_v1::client::DomainMappings::create_domain_mapping::until_done";
4864 }
4865
4866 let stub = self.0.stub.clone();
4867 let mut options = self.0.options.clone();
4868 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4869 let query = move |name| {
4870 let stub = stub.clone();
4871 let options = options.clone();
4872 async {
4873 let op = GetOperation::new(stub)
4874 .set_name(name)
4875 .with_options(options)
4876 .send()
4877 .await?;
4878 Ok(Operation::new(op))
4879 }
4880 };
4881
4882 let start = move || async {
4883 let op = self.send().await?;
4884 Ok(Operation::new(op))
4885 };
4886
4887 use google_cloud_lro::internal::PollerExt;
4888 {
4889 google_cloud_lro::internal::new_poller(
4890 polling_error_policy,
4891 polling_backoff_policy,
4892 start,
4893 query,
4894 )
4895 }
4896 .with_options(poller_options)
4897 }
4898
4899 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4901 self.0.request.parent = v.into();
4902 self
4903 }
4904
4905 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4907 where
4908 T: std::convert::Into<crate::model::DomainMapping>,
4909 {
4910 self.0.request.domain_mapping = std::option::Option::Some(v.into());
4911 self
4912 }
4913
4914 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4916 where
4917 T: std::convert::Into<crate::model::DomainMapping>,
4918 {
4919 self.0.request.domain_mapping = v.map(|x| x.into());
4920 self
4921 }
4922
4923 pub fn set_override_strategy<T: Into<crate::model::DomainOverrideStrategy>>(
4925 mut self,
4926 v: T,
4927 ) -> Self {
4928 self.0.request.override_strategy = v.into();
4929 self
4930 }
4931 }
4932
4933 #[doc(hidden)]
4934 impl crate::RequestBuilder for CreateDomainMapping {
4935 fn request_options(&mut self) -> &mut crate::RequestOptions {
4936 &mut self.0.options
4937 }
4938 }
4939
4940 #[derive(Clone, Debug)]
4958 pub struct UpdateDomainMapping(RequestBuilder<crate::model::UpdateDomainMappingRequest>);
4959
4960 impl UpdateDomainMapping {
4961 pub(crate) fn new(
4962 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
4963 ) -> Self {
4964 Self(RequestBuilder::new(stub))
4965 }
4966
4967 pub fn with_request<V: Into<crate::model::UpdateDomainMappingRequest>>(
4969 mut self,
4970 v: V,
4971 ) -> Self {
4972 self.0.request = v.into();
4973 self
4974 }
4975
4976 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4978 self.0.options = v.into();
4979 self
4980 }
4981
4982 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4989 (*self.0.stub)
4990 .update_domain_mapping(self.0.request, self.0.options)
4991 .await
4992 .map(crate::Response::into_body)
4993 }
4994
4995 pub fn poller(
4997 self,
4998 ) -> impl google_cloud_lro::Poller<crate::model::DomainMapping, crate::model::OperationMetadataV1>
4999 {
5000 type Operation = google_cloud_lro::internal::Operation<
5001 crate::model::DomainMapping,
5002 crate::model::OperationMetadataV1,
5003 >;
5004 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5005 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5006 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5007 if let Some(ref mut details) = poller_options.tracing {
5008 details.method_name = "google_cloud_appengine_v1::client::DomainMappings::update_domain_mapping::until_done";
5009 }
5010
5011 let stub = self.0.stub.clone();
5012 let mut options = self.0.options.clone();
5013 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5014 let query = move |name| {
5015 let stub = stub.clone();
5016 let options = options.clone();
5017 async {
5018 let op = GetOperation::new(stub)
5019 .set_name(name)
5020 .with_options(options)
5021 .send()
5022 .await?;
5023 Ok(Operation::new(op))
5024 }
5025 };
5026
5027 let start = move || async {
5028 let op = self.send().await?;
5029 Ok(Operation::new(op))
5030 };
5031
5032 use google_cloud_lro::internal::PollerExt;
5033 {
5034 google_cloud_lro::internal::new_poller(
5035 polling_error_policy,
5036 polling_backoff_policy,
5037 start,
5038 query,
5039 )
5040 }
5041 .with_options(poller_options)
5042 }
5043
5044 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5046 self.0.request.name = v.into();
5047 self
5048 }
5049
5050 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
5052 where
5053 T: std::convert::Into<crate::model::DomainMapping>,
5054 {
5055 self.0.request.domain_mapping = std::option::Option::Some(v.into());
5056 self
5057 }
5058
5059 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
5061 where
5062 T: std::convert::Into<crate::model::DomainMapping>,
5063 {
5064 self.0.request.domain_mapping = v.map(|x| x.into());
5065 self
5066 }
5067
5068 pub fn set_update_mask<T>(mut self, v: T) -> Self
5070 where
5071 T: std::convert::Into<wkt::FieldMask>,
5072 {
5073 self.0.request.update_mask = std::option::Option::Some(v.into());
5074 self
5075 }
5076
5077 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5079 where
5080 T: std::convert::Into<wkt::FieldMask>,
5081 {
5082 self.0.request.update_mask = v.map(|x| x.into());
5083 self
5084 }
5085 }
5086
5087 #[doc(hidden)]
5088 impl crate::RequestBuilder for UpdateDomainMapping {
5089 fn request_options(&mut self) -> &mut crate::RequestOptions {
5090 &mut self.0.options
5091 }
5092 }
5093
5094 #[derive(Clone, Debug)]
5112 pub struct DeleteDomainMapping(RequestBuilder<crate::model::DeleteDomainMappingRequest>);
5113
5114 impl DeleteDomainMapping {
5115 pub(crate) fn new(
5116 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5117 ) -> Self {
5118 Self(RequestBuilder::new(stub))
5119 }
5120
5121 pub fn with_request<V: Into<crate::model::DeleteDomainMappingRequest>>(
5123 mut self,
5124 v: V,
5125 ) -> Self {
5126 self.0.request = v.into();
5127 self
5128 }
5129
5130 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5132 self.0.options = v.into();
5133 self
5134 }
5135
5136 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5143 (*self.0.stub)
5144 .delete_domain_mapping(self.0.request, self.0.options)
5145 .await
5146 .map(crate::Response::into_body)
5147 }
5148
5149 pub fn poller(
5151 self,
5152 ) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadataV1> {
5153 type Operation = google_cloud_lro::internal::Operation<
5154 wkt::Empty,
5155 crate::model::OperationMetadataV1,
5156 >;
5157 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5158 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5159 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5160 if let Some(ref mut details) = poller_options.tracing {
5161 details.method_name = "google_cloud_appengine_v1::client::DomainMappings::delete_domain_mapping::until_done";
5162 }
5163
5164 let stub = self.0.stub.clone();
5165 let mut options = self.0.options.clone();
5166 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5167 let query = move |name| {
5168 let stub = stub.clone();
5169 let options = options.clone();
5170 async {
5171 let op = GetOperation::new(stub)
5172 .set_name(name)
5173 .with_options(options)
5174 .send()
5175 .await?;
5176 Ok(Operation::new(op))
5177 }
5178 };
5179
5180 let start = move || async {
5181 let op = self.send().await?;
5182 Ok(Operation::new(op))
5183 };
5184
5185 use google_cloud_lro::internal::PollerExt;
5186 {
5187 google_cloud_lro::internal::new_unit_response_poller(
5188 polling_error_policy,
5189 polling_backoff_policy,
5190 start,
5191 query,
5192 )
5193 }
5194 .with_options(poller_options)
5195 }
5196
5197 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5199 self.0.request.name = v.into();
5200 self
5201 }
5202 }
5203
5204 #[doc(hidden)]
5205 impl crate::RequestBuilder for DeleteDomainMapping {
5206 fn request_options(&mut self) -> &mut crate::RequestOptions {
5207 &mut self.0.options
5208 }
5209 }
5210
5211 #[derive(Clone, Debug)]
5232 pub struct ListOperations(
5233 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5234 );
5235
5236 impl ListOperations {
5237 pub(crate) fn new(
5238 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5239 ) -> Self {
5240 Self(RequestBuilder::new(stub))
5241 }
5242
5243 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5245 mut self,
5246 v: V,
5247 ) -> Self {
5248 self.0.request = v.into();
5249 self
5250 }
5251
5252 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5254 self.0.options = v.into();
5255 self
5256 }
5257
5258 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5260 (*self.0.stub)
5261 .list_operations(self.0.request, self.0.options)
5262 .await
5263 .map(crate::Response::into_body)
5264 }
5265
5266 pub fn by_page(
5268 self,
5269 ) -> impl google_cloud_gax::paginator::Paginator<
5270 google_cloud_longrunning::model::ListOperationsResponse,
5271 crate::Error,
5272 > {
5273 use std::clone::Clone;
5274 let token = self.0.request.page_token.clone();
5275 let execute = move |token: String| {
5276 let mut builder = self.clone();
5277 builder.0.request = builder.0.request.set_page_token(token);
5278 builder.send()
5279 };
5280 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5281 }
5282
5283 pub fn by_item(
5285 self,
5286 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5287 google_cloud_longrunning::model::ListOperationsResponse,
5288 crate::Error,
5289 > {
5290 use google_cloud_gax::paginator::Paginator;
5291 self.by_page().items()
5292 }
5293
5294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5296 self.0.request.name = v.into();
5297 self
5298 }
5299
5300 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5302 self.0.request.filter = v.into();
5303 self
5304 }
5305
5306 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5308 self.0.request.page_size = v.into();
5309 self
5310 }
5311
5312 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5314 self.0.request.page_token = v.into();
5315 self
5316 }
5317
5318 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5320 self.0.request.return_partial_success = v.into();
5321 self
5322 }
5323 }
5324
5325 #[doc(hidden)]
5326 impl crate::RequestBuilder for ListOperations {
5327 fn request_options(&mut self) -> &mut crate::RequestOptions {
5328 &mut self.0.options
5329 }
5330 }
5331
5332 #[derive(Clone, Debug)]
5349 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5350
5351 impl GetOperation {
5352 pub(crate) fn new(
5353 stub: std::sync::Arc<dyn super::super::stub::dynamic::DomainMappings>,
5354 ) -> Self {
5355 Self(RequestBuilder::new(stub))
5356 }
5357
5358 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5360 mut self,
5361 v: V,
5362 ) -> Self {
5363 self.0.request = v.into();
5364 self
5365 }
5366
5367 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5369 self.0.options = v.into();
5370 self
5371 }
5372
5373 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5375 (*self.0.stub)
5376 .get_operation(self.0.request, self.0.options)
5377 .await
5378 .map(crate::Response::into_body)
5379 }
5380
5381 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5383 self.0.request.name = v.into();
5384 self
5385 }
5386 }
5387
5388 #[doc(hidden)]
5389 impl crate::RequestBuilder for GetOperation {
5390 fn request_options(&mut self) -> &mut crate::RequestOptions {
5391 &mut self.0.options
5392 }
5393 }
5394}