1pub mod address_group_service {
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::AddressGroupService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = AddressGroupService;
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::AddressGroupService>,
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::AddressGroupService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
96
97 impl ListAddressGroups {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
106 mut self,
107 v: V,
108 ) -> Self {
109 self.0.request = v.into();
110 self
111 }
112
113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
115 self.0.options = v.into();
116 self
117 }
118
119 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
121 (*self.0.stub)
122 .list_address_groups(self.0.request, self.0.options)
123 .await
124 .map(crate::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl google_cloud_gax::paginator::Paginator<
131 crate::model::ListAddressGroupsResponse,
132 crate::Error,
133 > {
134 use std::clone::Clone;
135 let token = self.0.request.page_token.clone();
136 let execute = move |token: String| {
137 let mut builder = self.clone();
138 builder.0.request = builder.0.request.set_page_token(token);
139 builder.send()
140 };
141 google_cloud_gax::paginator::internal::new_paginator(token, execute)
142 }
143
144 pub fn by_item(
146 self,
147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
148 crate::model::ListAddressGroupsResponse,
149 crate::Error,
150 > {
151 use google_cloud_gax::paginator::Paginator;
152 self.by_page().items()
153 }
154
155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159 self.0.request.parent = v.into();
160 self
161 }
162
163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165 self.0.request.page_size = v.into();
166 self
167 }
168
169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.page_token = v.into();
172 self
173 }
174
175 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
177 self.0.request.return_partial_success = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl crate::RequestBuilder for ListAddressGroups {
184 fn request_options(&mut self) -> &mut crate::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
206 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
207
208 impl GetAddressGroup {
209 pub(crate) fn new(
210 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
211 ) -> Self {
212 Self(RequestBuilder::new(stub))
213 }
214
215 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
217 self.0.request = v.into();
218 self
219 }
220
221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223 self.0.options = v.into();
224 self
225 }
226
227 pub async fn send(self) -> Result<crate::model::AddressGroup> {
229 (*self.0.stub)
230 .get_address_group(self.0.request, self.0.options)
231 .await
232 .map(crate::Response::into_body)
233 }
234
235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239 self.0.request.name = v.into();
240 self
241 }
242 }
243
244 #[doc(hidden)]
245 impl crate::RequestBuilder for GetAddressGroup {
246 fn request_options(&mut self) -> &mut crate::RequestOptions {
247 &mut self.0.options
248 }
249 }
250
251 #[derive(Clone, Debug)]
269 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
270
271 impl CreateAddressGroup {
272 pub(crate) fn new(
273 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
274 ) -> Self {
275 Self(RequestBuilder::new(stub))
276 }
277
278 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
280 mut self,
281 v: V,
282 ) -> Self {
283 self.0.request = v.into();
284 self
285 }
286
287 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
289 self.0.options = v.into();
290 self
291 }
292
293 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
300 (*self.0.stub)
301 .create_address_group(self.0.request, self.0.options)
302 .await
303 .map(crate::Response::into_body)
304 }
305
306 pub fn poller(
308 self,
309 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
310 {
311 type Operation = google_cloud_lro::internal::Operation<
312 crate::model::AddressGroup,
313 crate::model::OperationMetadata,
314 >;
315 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
316 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
317
318 let stub = self.0.stub.clone();
319 let mut options = self.0.options.clone();
320 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
321 let query = move |name| {
322 let stub = stub.clone();
323 let options = options.clone();
324 async {
325 let op = GetOperation::new(stub)
326 .set_name(name)
327 .with_options(options)
328 .send()
329 .await?;
330 Ok(Operation::new(op))
331 }
332 };
333
334 let start = move || async {
335 let op = self.send().await?;
336 Ok(Operation::new(op))
337 };
338
339 google_cloud_lro::internal::new_poller(
340 polling_error_policy,
341 polling_backoff_policy,
342 start,
343 query,
344 )
345 }
346
347 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
351 self.0.request.parent = v.into();
352 self
353 }
354
355 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
359 self.0.request.address_group_id = v.into();
360 self
361 }
362
363 pub fn set_address_group<T>(mut self, v: T) -> Self
367 where
368 T: std::convert::Into<crate::model::AddressGroup>,
369 {
370 self.0.request.address_group = std::option::Option::Some(v.into());
371 self
372 }
373
374 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
378 where
379 T: std::convert::Into<crate::model::AddressGroup>,
380 {
381 self.0.request.address_group = v.map(|x| x.into());
382 self
383 }
384
385 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
387 self.0.request.request_id = v.into();
388 self
389 }
390 }
391
392 #[doc(hidden)]
393 impl crate::RequestBuilder for CreateAddressGroup {
394 fn request_options(&mut self) -> &mut crate::RequestOptions {
395 &mut self.0.options
396 }
397 }
398
399 #[derive(Clone, Debug)]
417 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
418
419 impl UpdateAddressGroup {
420 pub(crate) fn new(
421 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
422 ) -> Self {
423 Self(RequestBuilder::new(stub))
424 }
425
426 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
428 mut self,
429 v: V,
430 ) -> Self {
431 self.0.request = v.into();
432 self
433 }
434
435 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
437 self.0.options = v.into();
438 self
439 }
440
441 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
448 (*self.0.stub)
449 .update_address_group(self.0.request, self.0.options)
450 .await
451 .map(crate::Response::into_body)
452 }
453
454 pub fn poller(
456 self,
457 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
458 {
459 type Operation = google_cloud_lro::internal::Operation<
460 crate::model::AddressGroup,
461 crate::model::OperationMetadata,
462 >;
463 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
464 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
465
466 let stub = self.0.stub.clone();
467 let mut options = self.0.options.clone();
468 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
469 let query = move |name| {
470 let stub = stub.clone();
471 let options = options.clone();
472 async {
473 let op = GetOperation::new(stub)
474 .set_name(name)
475 .with_options(options)
476 .send()
477 .await?;
478 Ok(Operation::new(op))
479 }
480 };
481
482 let start = move || async {
483 let op = self.send().await?;
484 Ok(Operation::new(op))
485 };
486
487 google_cloud_lro::internal::new_poller(
488 polling_error_policy,
489 polling_backoff_policy,
490 start,
491 query,
492 )
493 }
494
495 pub fn set_update_mask<T>(mut self, v: T) -> Self
497 where
498 T: std::convert::Into<wkt::FieldMask>,
499 {
500 self.0.request.update_mask = std::option::Option::Some(v.into());
501 self
502 }
503
504 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
506 where
507 T: std::convert::Into<wkt::FieldMask>,
508 {
509 self.0.request.update_mask = v.map(|x| x.into());
510 self
511 }
512
513 pub fn set_address_group<T>(mut self, v: T) -> Self
517 where
518 T: std::convert::Into<crate::model::AddressGroup>,
519 {
520 self.0.request.address_group = std::option::Option::Some(v.into());
521 self
522 }
523
524 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
528 where
529 T: std::convert::Into<crate::model::AddressGroup>,
530 {
531 self.0.request.address_group = v.map(|x| x.into());
532 self
533 }
534
535 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
537 self.0.request.request_id = v.into();
538 self
539 }
540 }
541
542 #[doc(hidden)]
543 impl crate::RequestBuilder for UpdateAddressGroup {
544 fn request_options(&mut self) -> &mut crate::RequestOptions {
545 &mut self.0.options
546 }
547 }
548
549 #[derive(Clone, Debug)]
567 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
568
569 impl AddAddressGroupItems {
570 pub(crate) fn new(
571 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
572 ) -> Self {
573 Self(RequestBuilder::new(stub))
574 }
575
576 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
578 mut self,
579 v: V,
580 ) -> Self {
581 self.0.request = v.into();
582 self
583 }
584
585 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
587 self.0.options = v.into();
588 self
589 }
590
591 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
598 (*self.0.stub)
599 .add_address_group_items(self.0.request, self.0.options)
600 .await
601 .map(crate::Response::into_body)
602 }
603
604 pub fn poller(
606 self,
607 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
608 {
609 type Operation = google_cloud_lro::internal::Operation<
610 crate::model::AddressGroup,
611 crate::model::OperationMetadata,
612 >;
613 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
614 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
615
616 let stub = self.0.stub.clone();
617 let mut options = self.0.options.clone();
618 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
619 let query = move |name| {
620 let stub = stub.clone();
621 let options = options.clone();
622 async {
623 let op = GetOperation::new(stub)
624 .set_name(name)
625 .with_options(options)
626 .send()
627 .await?;
628 Ok(Operation::new(op))
629 }
630 };
631
632 let start = move || async {
633 let op = self.send().await?;
634 Ok(Operation::new(op))
635 };
636
637 google_cloud_lro::internal::new_poller(
638 polling_error_policy,
639 polling_backoff_policy,
640 start,
641 query,
642 )
643 }
644
645 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
649 self.0.request.address_group = v.into();
650 self
651 }
652
653 pub fn set_items<T, V>(mut self, v: T) -> Self
657 where
658 T: std::iter::IntoIterator<Item = V>,
659 V: std::convert::Into<std::string::String>,
660 {
661 use std::iter::Iterator;
662 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
663 self
664 }
665
666 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
668 self.0.request.request_id = v.into();
669 self
670 }
671 }
672
673 #[doc(hidden)]
674 impl crate::RequestBuilder for AddAddressGroupItems {
675 fn request_options(&mut self) -> &mut crate::RequestOptions {
676 &mut self.0.options
677 }
678 }
679
680 #[derive(Clone, Debug)]
698 pub struct RemoveAddressGroupItems(
699 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
700 );
701
702 impl RemoveAddressGroupItems {
703 pub(crate) fn new(
704 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
705 ) -> Self {
706 Self(RequestBuilder::new(stub))
707 }
708
709 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
711 mut self,
712 v: V,
713 ) -> Self {
714 self.0.request = v.into();
715 self
716 }
717
718 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
720 self.0.options = v.into();
721 self
722 }
723
724 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
731 (*self.0.stub)
732 .remove_address_group_items(self.0.request, self.0.options)
733 .await
734 .map(crate::Response::into_body)
735 }
736
737 pub fn poller(
739 self,
740 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
741 {
742 type Operation = google_cloud_lro::internal::Operation<
743 crate::model::AddressGroup,
744 crate::model::OperationMetadata,
745 >;
746 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
747 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
748
749 let stub = self.0.stub.clone();
750 let mut options = self.0.options.clone();
751 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
752 let query = move |name| {
753 let stub = stub.clone();
754 let options = options.clone();
755 async {
756 let op = GetOperation::new(stub)
757 .set_name(name)
758 .with_options(options)
759 .send()
760 .await?;
761 Ok(Operation::new(op))
762 }
763 };
764
765 let start = move || async {
766 let op = self.send().await?;
767 Ok(Operation::new(op))
768 };
769
770 google_cloud_lro::internal::new_poller(
771 polling_error_policy,
772 polling_backoff_policy,
773 start,
774 query,
775 )
776 }
777
778 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
782 self.0.request.address_group = v.into();
783 self
784 }
785
786 pub fn set_items<T, V>(mut self, v: T) -> Self
790 where
791 T: std::iter::IntoIterator<Item = V>,
792 V: std::convert::Into<std::string::String>,
793 {
794 use std::iter::Iterator;
795 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
796 self
797 }
798
799 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
801 self.0.request.request_id = v.into();
802 self
803 }
804 }
805
806 #[doc(hidden)]
807 impl crate::RequestBuilder for RemoveAddressGroupItems {
808 fn request_options(&mut self) -> &mut crate::RequestOptions {
809 &mut self.0.options
810 }
811 }
812
813 #[derive(Clone, Debug)]
831 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
832
833 impl CloneAddressGroupItems {
834 pub(crate) fn new(
835 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
836 ) -> Self {
837 Self(RequestBuilder::new(stub))
838 }
839
840 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
842 mut self,
843 v: V,
844 ) -> Self {
845 self.0.request = v.into();
846 self
847 }
848
849 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
851 self.0.options = v.into();
852 self
853 }
854
855 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
862 (*self.0.stub)
863 .clone_address_group_items(self.0.request, self.0.options)
864 .await
865 .map(crate::Response::into_body)
866 }
867
868 pub fn poller(
870 self,
871 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
872 {
873 type Operation = google_cloud_lro::internal::Operation<
874 crate::model::AddressGroup,
875 crate::model::OperationMetadata,
876 >;
877 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
878 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
879
880 let stub = self.0.stub.clone();
881 let mut options = self.0.options.clone();
882 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
883 let query = move |name| {
884 let stub = stub.clone();
885 let options = options.clone();
886 async {
887 let op = GetOperation::new(stub)
888 .set_name(name)
889 .with_options(options)
890 .send()
891 .await?;
892 Ok(Operation::new(op))
893 }
894 };
895
896 let start = move || async {
897 let op = self.send().await?;
898 Ok(Operation::new(op))
899 };
900
901 google_cloud_lro::internal::new_poller(
902 polling_error_policy,
903 polling_backoff_policy,
904 start,
905 query,
906 )
907 }
908
909 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
913 self.0.request.address_group = v.into();
914 self
915 }
916
917 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
921 self.0.request.source_address_group = v.into();
922 self
923 }
924
925 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
927 self.0.request.request_id = v.into();
928 self
929 }
930 }
931
932 #[doc(hidden)]
933 impl crate::RequestBuilder for CloneAddressGroupItems {
934 fn request_options(&mut self) -> &mut crate::RequestOptions {
935 &mut self.0.options
936 }
937 }
938
939 #[derive(Clone, Debug)]
957 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
958
959 impl DeleteAddressGroup {
960 pub(crate) fn new(
961 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
962 ) -> Self {
963 Self(RequestBuilder::new(stub))
964 }
965
966 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
968 mut self,
969 v: V,
970 ) -> Self {
971 self.0.request = v.into();
972 self
973 }
974
975 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
977 self.0.options = v.into();
978 self
979 }
980
981 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
988 (*self.0.stub)
989 .delete_address_group(self.0.request, self.0.options)
990 .await
991 .map(crate::Response::into_body)
992 }
993
994 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
996 type Operation =
997 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
998 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
999 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
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 google_cloud_lro::internal::new_unit_response_poller(
1023 polling_error_policy,
1024 polling_backoff_policy,
1025 start,
1026 query,
1027 )
1028 }
1029
1030 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1034 self.0.request.name = v.into();
1035 self
1036 }
1037
1038 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1040 self.0.request.request_id = v.into();
1041 self
1042 }
1043 }
1044
1045 #[doc(hidden)]
1046 impl crate::RequestBuilder for DeleteAddressGroup {
1047 fn request_options(&mut self) -> &mut crate::RequestOptions {
1048 &mut self.0.options
1049 }
1050 }
1051
1052 #[derive(Clone, Debug)]
1073 pub struct ListAddressGroupReferences(
1074 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1075 );
1076
1077 impl ListAddressGroupReferences {
1078 pub(crate) fn new(
1079 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1080 ) -> Self {
1081 Self(RequestBuilder::new(stub))
1082 }
1083
1084 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1086 mut self,
1087 v: V,
1088 ) -> Self {
1089 self.0.request = v.into();
1090 self
1091 }
1092
1093 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1095 self.0.options = v.into();
1096 self
1097 }
1098
1099 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1101 (*self.0.stub)
1102 .list_address_group_references(self.0.request, self.0.options)
1103 .await
1104 .map(crate::Response::into_body)
1105 }
1106
1107 pub fn by_page(
1109 self,
1110 ) -> impl google_cloud_gax::paginator::Paginator<
1111 crate::model::ListAddressGroupReferencesResponse,
1112 crate::Error,
1113 > {
1114 use std::clone::Clone;
1115 let token = self.0.request.page_token.clone();
1116 let execute = move |token: String| {
1117 let mut builder = self.clone();
1118 builder.0.request = builder.0.request.set_page_token(token);
1119 builder.send()
1120 };
1121 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1122 }
1123
1124 pub fn by_item(
1126 self,
1127 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1128 crate::model::ListAddressGroupReferencesResponse,
1129 crate::Error,
1130 > {
1131 use google_cloud_gax::paginator::Paginator;
1132 self.by_page().items()
1133 }
1134
1135 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139 self.0.request.address_group = v.into();
1140 self
1141 }
1142
1143 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1145 self.0.request.page_size = v.into();
1146 self
1147 }
1148
1149 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151 self.0.request.page_token = v.into();
1152 self
1153 }
1154 }
1155
1156 #[doc(hidden)]
1157 impl crate::RequestBuilder for ListAddressGroupReferences {
1158 fn request_options(&mut self) -> &mut crate::RequestOptions {
1159 &mut self.0.options
1160 }
1161 }
1162
1163 #[derive(Clone, Debug)]
1184 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1185
1186 impl ListLocations {
1187 pub(crate) fn new(
1188 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1189 ) -> Self {
1190 Self(RequestBuilder::new(stub))
1191 }
1192
1193 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1195 mut self,
1196 v: V,
1197 ) -> Self {
1198 self.0.request = v.into();
1199 self
1200 }
1201
1202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1204 self.0.options = v.into();
1205 self
1206 }
1207
1208 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1210 (*self.0.stub)
1211 .list_locations(self.0.request, self.0.options)
1212 .await
1213 .map(crate::Response::into_body)
1214 }
1215
1216 pub fn by_page(
1218 self,
1219 ) -> impl google_cloud_gax::paginator::Paginator<
1220 google_cloud_location::model::ListLocationsResponse,
1221 crate::Error,
1222 > {
1223 use std::clone::Clone;
1224 let token = self.0.request.page_token.clone();
1225 let execute = move |token: String| {
1226 let mut builder = self.clone();
1227 builder.0.request = builder.0.request.set_page_token(token);
1228 builder.send()
1229 };
1230 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1231 }
1232
1233 pub fn by_item(
1235 self,
1236 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1237 google_cloud_location::model::ListLocationsResponse,
1238 crate::Error,
1239 > {
1240 use google_cloud_gax::paginator::Paginator;
1241 self.by_page().items()
1242 }
1243
1244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1246 self.0.request.name = v.into();
1247 self
1248 }
1249
1250 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1252 self.0.request.filter = v.into();
1253 self
1254 }
1255
1256 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1258 self.0.request.page_size = v.into();
1259 self
1260 }
1261
1262 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1264 self.0.request.page_token = v.into();
1265 self
1266 }
1267 }
1268
1269 #[doc(hidden)]
1270 impl crate::RequestBuilder for ListLocations {
1271 fn request_options(&mut self) -> &mut crate::RequestOptions {
1272 &mut self.0.options
1273 }
1274 }
1275
1276 #[derive(Clone, Debug)]
1293 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1294
1295 impl GetLocation {
1296 pub(crate) fn new(
1297 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1298 ) -> Self {
1299 Self(RequestBuilder::new(stub))
1300 }
1301
1302 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1304 mut self,
1305 v: V,
1306 ) -> Self {
1307 self.0.request = v.into();
1308 self
1309 }
1310
1311 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1313 self.0.options = v.into();
1314 self
1315 }
1316
1317 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1319 (*self.0.stub)
1320 .get_location(self.0.request, self.0.options)
1321 .await
1322 .map(crate::Response::into_body)
1323 }
1324
1325 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327 self.0.request.name = v.into();
1328 self
1329 }
1330 }
1331
1332 #[doc(hidden)]
1333 impl crate::RequestBuilder for GetLocation {
1334 fn request_options(&mut self) -> &mut crate::RequestOptions {
1335 &mut self.0.options
1336 }
1337 }
1338
1339 #[derive(Clone, Debug)]
1356 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1357
1358 impl SetIamPolicy {
1359 pub(crate) fn new(
1360 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1361 ) -> Self {
1362 Self(RequestBuilder::new(stub))
1363 }
1364
1365 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1367 mut self,
1368 v: V,
1369 ) -> Self {
1370 self.0.request = v.into();
1371 self
1372 }
1373
1374 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1376 self.0.options = v.into();
1377 self
1378 }
1379
1380 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1382 (*self.0.stub)
1383 .set_iam_policy(self.0.request, self.0.options)
1384 .await
1385 .map(crate::Response::into_body)
1386 }
1387
1388 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1392 self.0.request.resource = v.into();
1393 self
1394 }
1395
1396 pub fn set_policy<T>(mut self, v: T) -> Self
1400 where
1401 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1402 {
1403 self.0.request.policy = std::option::Option::Some(v.into());
1404 self
1405 }
1406
1407 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1411 where
1412 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1413 {
1414 self.0.request.policy = v.map(|x| x.into());
1415 self
1416 }
1417
1418 pub fn set_update_mask<T>(mut self, v: T) -> Self
1420 where
1421 T: std::convert::Into<wkt::FieldMask>,
1422 {
1423 self.0.request.update_mask = std::option::Option::Some(v.into());
1424 self
1425 }
1426
1427 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1429 where
1430 T: std::convert::Into<wkt::FieldMask>,
1431 {
1432 self.0.request.update_mask = v.map(|x| x.into());
1433 self
1434 }
1435 }
1436
1437 #[doc(hidden)]
1438 impl crate::RequestBuilder for SetIamPolicy {
1439 fn request_options(&mut self) -> &mut crate::RequestOptions {
1440 &mut self.0.options
1441 }
1442 }
1443
1444 #[derive(Clone, Debug)]
1461 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1462
1463 impl GetIamPolicy {
1464 pub(crate) fn new(
1465 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1466 ) -> Self {
1467 Self(RequestBuilder::new(stub))
1468 }
1469
1470 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1472 mut self,
1473 v: V,
1474 ) -> Self {
1475 self.0.request = v.into();
1476 self
1477 }
1478
1479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1481 self.0.options = v.into();
1482 self
1483 }
1484
1485 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1487 (*self.0.stub)
1488 .get_iam_policy(self.0.request, self.0.options)
1489 .await
1490 .map(crate::Response::into_body)
1491 }
1492
1493 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1497 self.0.request.resource = v.into();
1498 self
1499 }
1500
1501 pub fn set_options<T>(mut self, v: T) -> Self
1503 where
1504 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1505 {
1506 self.0.request.options = std::option::Option::Some(v.into());
1507 self
1508 }
1509
1510 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1512 where
1513 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1514 {
1515 self.0.request.options = v.map(|x| x.into());
1516 self
1517 }
1518 }
1519
1520 #[doc(hidden)]
1521 impl crate::RequestBuilder for GetIamPolicy {
1522 fn request_options(&mut self) -> &mut crate::RequestOptions {
1523 &mut self.0.options
1524 }
1525 }
1526
1527 #[derive(Clone, Debug)]
1544 pub struct TestIamPermissions(
1545 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1546 );
1547
1548 impl TestIamPermissions {
1549 pub(crate) fn new(
1550 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1551 ) -> Self {
1552 Self(RequestBuilder::new(stub))
1553 }
1554
1555 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1557 mut self,
1558 v: V,
1559 ) -> Self {
1560 self.0.request = v.into();
1561 self
1562 }
1563
1564 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1566 self.0.options = v.into();
1567 self
1568 }
1569
1570 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1572 (*self.0.stub)
1573 .test_iam_permissions(self.0.request, self.0.options)
1574 .await
1575 .map(crate::Response::into_body)
1576 }
1577
1578 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1582 self.0.request.resource = v.into();
1583 self
1584 }
1585
1586 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1590 where
1591 T: std::iter::IntoIterator<Item = V>,
1592 V: std::convert::Into<std::string::String>,
1593 {
1594 use std::iter::Iterator;
1595 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1596 self
1597 }
1598 }
1599
1600 #[doc(hidden)]
1601 impl crate::RequestBuilder for TestIamPermissions {
1602 fn request_options(&mut self) -> &mut crate::RequestOptions {
1603 &mut self.0.options
1604 }
1605 }
1606
1607 #[derive(Clone, Debug)]
1628 pub struct ListOperations(
1629 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1630 );
1631
1632 impl ListOperations {
1633 pub(crate) fn new(
1634 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1635 ) -> Self {
1636 Self(RequestBuilder::new(stub))
1637 }
1638
1639 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1641 mut self,
1642 v: V,
1643 ) -> Self {
1644 self.0.request = v.into();
1645 self
1646 }
1647
1648 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1650 self.0.options = v.into();
1651 self
1652 }
1653
1654 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1656 (*self.0.stub)
1657 .list_operations(self.0.request, self.0.options)
1658 .await
1659 .map(crate::Response::into_body)
1660 }
1661
1662 pub fn by_page(
1664 self,
1665 ) -> impl google_cloud_gax::paginator::Paginator<
1666 google_cloud_longrunning::model::ListOperationsResponse,
1667 crate::Error,
1668 > {
1669 use std::clone::Clone;
1670 let token = self.0.request.page_token.clone();
1671 let execute = move |token: String| {
1672 let mut builder = self.clone();
1673 builder.0.request = builder.0.request.set_page_token(token);
1674 builder.send()
1675 };
1676 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1677 }
1678
1679 pub fn by_item(
1681 self,
1682 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1683 google_cloud_longrunning::model::ListOperationsResponse,
1684 crate::Error,
1685 > {
1686 use google_cloud_gax::paginator::Paginator;
1687 self.by_page().items()
1688 }
1689
1690 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1692 self.0.request.name = v.into();
1693 self
1694 }
1695
1696 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698 self.0.request.filter = v.into();
1699 self
1700 }
1701
1702 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1704 self.0.request.page_size = v.into();
1705 self
1706 }
1707
1708 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1710 self.0.request.page_token = v.into();
1711 self
1712 }
1713
1714 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1716 self.0.request.return_partial_success = v.into();
1717 self
1718 }
1719 }
1720
1721 #[doc(hidden)]
1722 impl crate::RequestBuilder for ListOperations {
1723 fn request_options(&mut self) -> &mut crate::RequestOptions {
1724 &mut self.0.options
1725 }
1726 }
1727
1728 #[derive(Clone, Debug)]
1745 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1746
1747 impl GetOperation {
1748 pub(crate) fn new(
1749 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1750 ) -> Self {
1751 Self(RequestBuilder::new(stub))
1752 }
1753
1754 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1756 mut self,
1757 v: V,
1758 ) -> Self {
1759 self.0.request = v.into();
1760 self
1761 }
1762
1763 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1765 self.0.options = v.into();
1766 self
1767 }
1768
1769 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1771 (*self.0.stub)
1772 .get_operation(self.0.request, self.0.options)
1773 .await
1774 .map(crate::Response::into_body)
1775 }
1776
1777 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1779 self.0.request.name = v.into();
1780 self
1781 }
1782 }
1783
1784 #[doc(hidden)]
1785 impl crate::RequestBuilder for GetOperation {
1786 fn request_options(&mut self) -> &mut crate::RequestOptions {
1787 &mut self.0.options
1788 }
1789 }
1790
1791 #[derive(Clone, Debug)]
1808 pub struct DeleteOperation(
1809 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1810 );
1811
1812 impl DeleteOperation {
1813 pub(crate) fn new(
1814 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1815 ) -> Self {
1816 Self(RequestBuilder::new(stub))
1817 }
1818
1819 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1821 mut self,
1822 v: V,
1823 ) -> Self {
1824 self.0.request = v.into();
1825 self
1826 }
1827
1828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1830 self.0.options = v.into();
1831 self
1832 }
1833
1834 pub async fn send(self) -> Result<()> {
1836 (*self.0.stub)
1837 .delete_operation(self.0.request, self.0.options)
1838 .await
1839 .map(crate::Response::into_body)
1840 }
1841
1842 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1844 self.0.request.name = v.into();
1845 self
1846 }
1847 }
1848
1849 #[doc(hidden)]
1850 impl crate::RequestBuilder for DeleteOperation {
1851 fn request_options(&mut self) -> &mut crate::RequestOptions {
1852 &mut self.0.options
1853 }
1854 }
1855
1856 #[derive(Clone, Debug)]
1873 pub struct CancelOperation(
1874 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1875 );
1876
1877 impl CancelOperation {
1878 pub(crate) fn new(
1879 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1880 ) -> Self {
1881 Self(RequestBuilder::new(stub))
1882 }
1883
1884 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1886 mut self,
1887 v: V,
1888 ) -> Self {
1889 self.0.request = v.into();
1890 self
1891 }
1892
1893 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1895 self.0.options = v.into();
1896 self
1897 }
1898
1899 pub async fn send(self) -> Result<()> {
1901 (*self.0.stub)
1902 .cancel_operation(self.0.request, self.0.options)
1903 .await
1904 .map(crate::Response::into_body)
1905 }
1906
1907 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1909 self.0.request.name = v.into();
1910 self
1911 }
1912 }
1913
1914 #[doc(hidden)]
1915 impl crate::RequestBuilder for CancelOperation {
1916 fn request_options(&mut self) -> &mut crate::RequestOptions {
1917 &mut self.0.options
1918 }
1919 }
1920}
1921
1922pub mod organization_address_group_service {
1924 use crate::Result;
1925
1926 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1940
1941 pub(crate) mod client {
1942 use super::super::super::client::OrganizationAddressGroupService;
1943 pub struct Factory;
1944 impl crate::ClientFactory for Factory {
1945 type Client = OrganizationAddressGroupService;
1946 type Credentials = gaxi::options::Credentials;
1947 async fn build(
1948 self,
1949 config: gaxi::options::ClientConfig,
1950 ) -> crate::ClientBuilderResult<Self::Client> {
1951 Self::Client::new(config).await
1952 }
1953 }
1954 }
1955
1956 #[derive(Clone, Debug)]
1958 pub(crate) struct RequestBuilder<R: std::default::Default> {
1959 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1960 request: R,
1961 options: crate::RequestOptions,
1962 }
1963
1964 impl<R> RequestBuilder<R>
1965 where
1966 R: std::default::Default,
1967 {
1968 pub(crate) fn new(
1969 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1970 ) -> Self {
1971 Self {
1972 stub,
1973 request: R::default(),
1974 options: crate::RequestOptions::default(),
1975 }
1976 }
1977 }
1978
1979 #[derive(Clone, Debug)]
2000 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
2001
2002 impl ListAddressGroups {
2003 pub(crate) fn new(
2004 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2005 ) -> Self {
2006 Self(RequestBuilder::new(stub))
2007 }
2008
2009 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
2011 mut self,
2012 v: V,
2013 ) -> Self {
2014 self.0.request = v.into();
2015 self
2016 }
2017
2018 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2020 self.0.options = v.into();
2021 self
2022 }
2023
2024 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
2026 (*self.0.stub)
2027 .list_address_groups(self.0.request, self.0.options)
2028 .await
2029 .map(crate::Response::into_body)
2030 }
2031
2032 pub fn by_page(
2034 self,
2035 ) -> impl google_cloud_gax::paginator::Paginator<
2036 crate::model::ListAddressGroupsResponse,
2037 crate::Error,
2038 > {
2039 use std::clone::Clone;
2040 let token = self.0.request.page_token.clone();
2041 let execute = move |token: String| {
2042 let mut builder = self.clone();
2043 builder.0.request = builder.0.request.set_page_token(token);
2044 builder.send()
2045 };
2046 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2047 }
2048
2049 pub fn by_item(
2051 self,
2052 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2053 crate::model::ListAddressGroupsResponse,
2054 crate::Error,
2055 > {
2056 use google_cloud_gax::paginator::Paginator;
2057 self.by_page().items()
2058 }
2059
2060 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2064 self.0.request.parent = v.into();
2065 self
2066 }
2067
2068 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2070 self.0.request.page_size = v.into();
2071 self
2072 }
2073
2074 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2076 self.0.request.page_token = v.into();
2077 self
2078 }
2079
2080 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2082 self.0.request.return_partial_success = v.into();
2083 self
2084 }
2085 }
2086
2087 #[doc(hidden)]
2088 impl crate::RequestBuilder for ListAddressGroups {
2089 fn request_options(&mut self) -> &mut crate::RequestOptions {
2090 &mut self.0.options
2091 }
2092 }
2093
2094 #[derive(Clone, Debug)]
2111 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2112
2113 impl GetAddressGroup {
2114 pub(crate) fn new(
2115 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2116 ) -> Self {
2117 Self(RequestBuilder::new(stub))
2118 }
2119
2120 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2122 self.0.request = v.into();
2123 self
2124 }
2125
2126 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2128 self.0.options = v.into();
2129 self
2130 }
2131
2132 pub async fn send(self) -> Result<crate::model::AddressGroup> {
2134 (*self.0.stub)
2135 .get_address_group(self.0.request, self.0.options)
2136 .await
2137 .map(crate::Response::into_body)
2138 }
2139
2140 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2144 self.0.request.name = v.into();
2145 self
2146 }
2147 }
2148
2149 #[doc(hidden)]
2150 impl crate::RequestBuilder for GetAddressGroup {
2151 fn request_options(&mut self) -> &mut crate::RequestOptions {
2152 &mut self.0.options
2153 }
2154 }
2155
2156 #[derive(Clone, Debug)]
2174 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2175
2176 impl CreateAddressGroup {
2177 pub(crate) fn new(
2178 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2179 ) -> Self {
2180 Self(RequestBuilder::new(stub))
2181 }
2182
2183 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2185 mut self,
2186 v: V,
2187 ) -> Self {
2188 self.0.request = v.into();
2189 self
2190 }
2191
2192 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2194 self.0.options = v.into();
2195 self
2196 }
2197
2198 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2205 (*self.0.stub)
2206 .create_address_group(self.0.request, self.0.options)
2207 .await
2208 .map(crate::Response::into_body)
2209 }
2210
2211 pub fn poller(
2213 self,
2214 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2215 {
2216 type Operation = google_cloud_lro::internal::Operation<
2217 crate::model::AddressGroup,
2218 crate::model::OperationMetadata,
2219 >;
2220 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2221 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2222
2223 let stub = self.0.stub.clone();
2224 let mut options = self.0.options.clone();
2225 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2226 let query = move |name| {
2227 let stub = stub.clone();
2228 let options = options.clone();
2229 async {
2230 let op = GetOperation::new(stub)
2231 .set_name(name)
2232 .with_options(options)
2233 .send()
2234 .await?;
2235 Ok(Operation::new(op))
2236 }
2237 };
2238
2239 let start = move || async {
2240 let op = self.send().await?;
2241 Ok(Operation::new(op))
2242 };
2243
2244 google_cloud_lro::internal::new_poller(
2245 polling_error_policy,
2246 polling_backoff_policy,
2247 start,
2248 query,
2249 )
2250 }
2251
2252 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2256 self.0.request.parent = v.into();
2257 self
2258 }
2259
2260 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.0.request.address_group_id = v.into();
2265 self
2266 }
2267
2268 pub fn set_address_group<T>(mut self, v: T) -> Self
2272 where
2273 T: std::convert::Into<crate::model::AddressGroup>,
2274 {
2275 self.0.request.address_group = std::option::Option::Some(v.into());
2276 self
2277 }
2278
2279 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2283 where
2284 T: std::convert::Into<crate::model::AddressGroup>,
2285 {
2286 self.0.request.address_group = v.map(|x| x.into());
2287 self
2288 }
2289
2290 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2292 self.0.request.request_id = v.into();
2293 self
2294 }
2295 }
2296
2297 #[doc(hidden)]
2298 impl crate::RequestBuilder for CreateAddressGroup {
2299 fn request_options(&mut self) -> &mut crate::RequestOptions {
2300 &mut self.0.options
2301 }
2302 }
2303
2304 #[derive(Clone, Debug)]
2322 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2323
2324 impl UpdateAddressGroup {
2325 pub(crate) fn new(
2326 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2327 ) -> Self {
2328 Self(RequestBuilder::new(stub))
2329 }
2330
2331 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2333 mut self,
2334 v: V,
2335 ) -> Self {
2336 self.0.request = v.into();
2337 self
2338 }
2339
2340 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2342 self.0.options = v.into();
2343 self
2344 }
2345
2346 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2353 (*self.0.stub)
2354 .update_address_group(self.0.request, self.0.options)
2355 .await
2356 .map(crate::Response::into_body)
2357 }
2358
2359 pub fn poller(
2361 self,
2362 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2363 {
2364 type Operation = google_cloud_lro::internal::Operation<
2365 crate::model::AddressGroup,
2366 crate::model::OperationMetadata,
2367 >;
2368 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2369 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2370
2371 let stub = self.0.stub.clone();
2372 let mut options = self.0.options.clone();
2373 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2374 let query = move |name| {
2375 let stub = stub.clone();
2376 let options = options.clone();
2377 async {
2378 let op = GetOperation::new(stub)
2379 .set_name(name)
2380 .with_options(options)
2381 .send()
2382 .await?;
2383 Ok(Operation::new(op))
2384 }
2385 };
2386
2387 let start = move || async {
2388 let op = self.send().await?;
2389 Ok(Operation::new(op))
2390 };
2391
2392 google_cloud_lro::internal::new_poller(
2393 polling_error_policy,
2394 polling_backoff_policy,
2395 start,
2396 query,
2397 )
2398 }
2399
2400 pub fn set_update_mask<T>(mut self, v: T) -> Self
2402 where
2403 T: std::convert::Into<wkt::FieldMask>,
2404 {
2405 self.0.request.update_mask = std::option::Option::Some(v.into());
2406 self
2407 }
2408
2409 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2411 where
2412 T: std::convert::Into<wkt::FieldMask>,
2413 {
2414 self.0.request.update_mask = v.map(|x| x.into());
2415 self
2416 }
2417
2418 pub fn set_address_group<T>(mut self, v: T) -> Self
2422 where
2423 T: std::convert::Into<crate::model::AddressGroup>,
2424 {
2425 self.0.request.address_group = std::option::Option::Some(v.into());
2426 self
2427 }
2428
2429 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2433 where
2434 T: std::convert::Into<crate::model::AddressGroup>,
2435 {
2436 self.0.request.address_group = v.map(|x| x.into());
2437 self
2438 }
2439
2440 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2442 self.0.request.request_id = v.into();
2443 self
2444 }
2445 }
2446
2447 #[doc(hidden)]
2448 impl crate::RequestBuilder for UpdateAddressGroup {
2449 fn request_options(&mut self) -> &mut crate::RequestOptions {
2450 &mut self.0.options
2451 }
2452 }
2453
2454 #[derive(Clone, Debug)]
2472 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2473
2474 impl AddAddressGroupItems {
2475 pub(crate) fn new(
2476 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2477 ) -> Self {
2478 Self(RequestBuilder::new(stub))
2479 }
2480
2481 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2483 mut self,
2484 v: V,
2485 ) -> Self {
2486 self.0.request = v.into();
2487 self
2488 }
2489
2490 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2492 self.0.options = v.into();
2493 self
2494 }
2495
2496 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2503 (*self.0.stub)
2504 .add_address_group_items(self.0.request, self.0.options)
2505 .await
2506 .map(crate::Response::into_body)
2507 }
2508
2509 pub fn poller(
2511 self,
2512 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2513 {
2514 type Operation = google_cloud_lro::internal::Operation<
2515 crate::model::AddressGroup,
2516 crate::model::OperationMetadata,
2517 >;
2518 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2519 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2520
2521 let stub = self.0.stub.clone();
2522 let mut options = self.0.options.clone();
2523 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2524 let query = move |name| {
2525 let stub = stub.clone();
2526 let options = options.clone();
2527 async {
2528 let op = GetOperation::new(stub)
2529 .set_name(name)
2530 .with_options(options)
2531 .send()
2532 .await?;
2533 Ok(Operation::new(op))
2534 }
2535 };
2536
2537 let start = move || async {
2538 let op = self.send().await?;
2539 Ok(Operation::new(op))
2540 };
2541
2542 google_cloud_lro::internal::new_poller(
2543 polling_error_policy,
2544 polling_backoff_policy,
2545 start,
2546 query,
2547 )
2548 }
2549
2550 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2554 self.0.request.address_group = v.into();
2555 self
2556 }
2557
2558 pub fn set_items<T, V>(mut self, v: T) -> Self
2562 where
2563 T: std::iter::IntoIterator<Item = V>,
2564 V: std::convert::Into<std::string::String>,
2565 {
2566 use std::iter::Iterator;
2567 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2568 self
2569 }
2570
2571 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573 self.0.request.request_id = v.into();
2574 self
2575 }
2576 }
2577
2578 #[doc(hidden)]
2579 impl crate::RequestBuilder for AddAddressGroupItems {
2580 fn request_options(&mut self) -> &mut crate::RequestOptions {
2581 &mut self.0.options
2582 }
2583 }
2584
2585 #[derive(Clone, Debug)]
2603 pub struct RemoveAddressGroupItems(
2604 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2605 );
2606
2607 impl RemoveAddressGroupItems {
2608 pub(crate) fn new(
2609 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2610 ) -> Self {
2611 Self(RequestBuilder::new(stub))
2612 }
2613
2614 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2616 mut self,
2617 v: V,
2618 ) -> Self {
2619 self.0.request = v.into();
2620 self
2621 }
2622
2623 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2625 self.0.options = v.into();
2626 self
2627 }
2628
2629 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2636 (*self.0.stub)
2637 .remove_address_group_items(self.0.request, self.0.options)
2638 .await
2639 .map(crate::Response::into_body)
2640 }
2641
2642 pub fn poller(
2644 self,
2645 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2646 {
2647 type Operation = google_cloud_lro::internal::Operation<
2648 crate::model::AddressGroup,
2649 crate::model::OperationMetadata,
2650 >;
2651 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2652 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2653
2654 let stub = self.0.stub.clone();
2655 let mut options = self.0.options.clone();
2656 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2657 let query = move |name| {
2658 let stub = stub.clone();
2659 let options = options.clone();
2660 async {
2661 let op = GetOperation::new(stub)
2662 .set_name(name)
2663 .with_options(options)
2664 .send()
2665 .await?;
2666 Ok(Operation::new(op))
2667 }
2668 };
2669
2670 let start = move || async {
2671 let op = self.send().await?;
2672 Ok(Operation::new(op))
2673 };
2674
2675 google_cloud_lro::internal::new_poller(
2676 polling_error_policy,
2677 polling_backoff_policy,
2678 start,
2679 query,
2680 )
2681 }
2682
2683 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2687 self.0.request.address_group = v.into();
2688 self
2689 }
2690
2691 pub fn set_items<T, V>(mut self, v: T) -> Self
2695 where
2696 T: std::iter::IntoIterator<Item = V>,
2697 V: std::convert::Into<std::string::String>,
2698 {
2699 use std::iter::Iterator;
2700 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2701 self
2702 }
2703
2704 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2706 self.0.request.request_id = v.into();
2707 self
2708 }
2709 }
2710
2711 #[doc(hidden)]
2712 impl crate::RequestBuilder for RemoveAddressGroupItems {
2713 fn request_options(&mut self) -> &mut crate::RequestOptions {
2714 &mut self.0.options
2715 }
2716 }
2717
2718 #[derive(Clone, Debug)]
2736 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2737
2738 impl CloneAddressGroupItems {
2739 pub(crate) fn new(
2740 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2741 ) -> Self {
2742 Self(RequestBuilder::new(stub))
2743 }
2744
2745 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2747 mut self,
2748 v: V,
2749 ) -> Self {
2750 self.0.request = v.into();
2751 self
2752 }
2753
2754 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2756 self.0.options = v.into();
2757 self
2758 }
2759
2760 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2767 (*self.0.stub)
2768 .clone_address_group_items(self.0.request, self.0.options)
2769 .await
2770 .map(crate::Response::into_body)
2771 }
2772
2773 pub fn poller(
2775 self,
2776 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2777 {
2778 type Operation = google_cloud_lro::internal::Operation<
2779 crate::model::AddressGroup,
2780 crate::model::OperationMetadata,
2781 >;
2782 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2783 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2784
2785 let stub = self.0.stub.clone();
2786 let mut options = self.0.options.clone();
2787 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2788 let query = move |name| {
2789 let stub = stub.clone();
2790 let options = options.clone();
2791 async {
2792 let op = GetOperation::new(stub)
2793 .set_name(name)
2794 .with_options(options)
2795 .send()
2796 .await?;
2797 Ok(Operation::new(op))
2798 }
2799 };
2800
2801 let start = move || async {
2802 let op = self.send().await?;
2803 Ok(Operation::new(op))
2804 };
2805
2806 google_cloud_lro::internal::new_poller(
2807 polling_error_policy,
2808 polling_backoff_policy,
2809 start,
2810 query,
2811 )
2812 }
2813
2814 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818 self.0.request.address_group = v.into();
2819 self
2820 }
2821
2822 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826 self.0.request.source_address_group = v.into();
2827 self
2828 }
2829
2830 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832 self.0.request.request_id = v.into();
2833 self
2834 }
2835 }
2836
2837 #[doc(hidden)]
2838 impl crate::RequestBuilder for CloneAddressGroupItems {
2839 fn request_options(&mut self) -> &mut crate::RequestOptions {
2840 &mut self.0.options
2841 }
2842 }
2843
2844 #[derive(Clone, Debug)]
2862 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2863
2864 impl DeleteAddressGroup {
2865 pub(crate) fn new(
2866 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2867 ) -> Self {
2868 Self(RequestBuilder::new(stub))
2869 }
2870
2871 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2873 mut self,
2874 v: V,
2875 ) -> Self {
2876 self.0.request = v.into();
2877 self
2878 }
2879
2880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2882 self.0.options = v.into();
2883 self
2884 }
2885
2886 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2893 (*self.0.stub)
2894 .delete_address_group(self.0.request, self.0.options)
2895 .await
2896 .map(crate::Response::into_body)
2897 }
2898
2899 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2901 type Operation =
2902 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2903 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2904 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2905
2906 let stub = self.0.stub.clone();
2907 let mut options = self.0.options.clone();
2908 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2909 let query = move |name| {
2910 let stub = stub.clone();
2911 let options = options.clone();
2912 async {
2913 let op = GetOperation::new(stub)
2914 .set_name(name)
2915 .with_options(options)
2916 .send()
2917 .await?;
2918 Ok(Operation::new(op))
2919 }
2920 };
2921
2922 let start = move || async {
2923 let op = self.send().await?;
2924 Ok(Operation::new(op))
2925 };
2926
2927 google_cloud_lro::internal::new_unit_response_poller(
2928 polling_error_policy,
2929 polling_backoff_policy,
2930 start,
2931 query,
2932 )
2933 }
2934
2935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939 self.0.request.name = v.into();
2940 self
2941 }
2942
2943 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2945 self.0.request.request_id = v.into();
2946 self
2947 }
2948 }
2949
2950 #[doc(hidden)]
2951 impl crate::RequestBuilder for DeleteAddressGroup {
2952 fn request_options(&mut self) -> &mut crate::RequestOptions {
2953 &mut self.0.options
2954 }
2955 }
2956
2957 #[derive(Clone, Debug)]
2978 pub struct ListAddressGroupReferences(
2979 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2980 );
2981
2982 impl ListAddressGroupReferences {
2983 pub(crate) fn new(
2984 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2985 ) -> Self {
2986 Self(RequestBuilder::new(stub))
2987 }
2988
2989 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2991 mut self,
2992 v: V,
2993 ) -> Self {
2994 self.0.request = v.into();
2995 self
2996 }
2997
2998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3000 self.0.options = v.into();
3001 self
3002 }
3003
3004 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
3006 (*self.0.stub)
3007 .list_address_group_references(self.0.request, self.0.options)
3008 .await
3009 .map(crate::Response::into_body)
3010 }
3011
3012 pub fn by_page(
3014 self,
3015 ) -> impl google_cloud_gax::paginator::Paginator<
3016 crate::model::ListAddressGroupReferencesResponse,
3017 crate::Error,
3018 > {
3019 use std::clone::Clone;
3020 let token = self.0.request.page_token.clone();
3021 let execute = move |token: String| {
3022 let mut builder = self.clone();
3023 builder.0.request = builder.0.request.set_page_token(token);
3024 builder.send()
3025 };
3026 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3027 }
3028
3029 pub fn by_item(
3031 self,
3032 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3033 crate::model::ListAddressGroupReferencesResponse,
3034 crate::Error,
3035 > {
3036 use google_cloud_gax::paginator::Paginator;
3037 self.by_page().items()
3038 }
3039
3040 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
3044 self.0.request.address_group = v.into();
3045 self
3046 }
3047
3048 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3050 self.0.request.page_size = v.into();
3051 self
3052 }
3053
3054 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3056 self.0.request.page_token = v.into();
3057 self
3058 }
3059 }
3060
3061 #[doc(hidden)]
3062 impl crate::RequestBuilder for ListAddressGroupReferences {
3063 fn request_options(&mut self) -> &mut crate::RequestOptions {
3064 &mut self.0.options
3065 }
3066 }
3067
3068 #[derive(Clone, Debug)]
3089 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3090
3091 impl ListLocations {
3092 pub(crate) fn new(
3093 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3094 ) -> Self {
3095 Self(RequestBuilder::new(stub))
3096 }
3097
3098 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3100 mut self,
3101 v: V,
3102 ) -> Self {
3103 self.0.request = v.into();
3104 self
3105 }
3106
3107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3109 self.0.options = v.into();
3110 self
3111 }
3112
3113 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3115 (*self.0.stub)
3116 .list_locations(self.0.request, self.0.options)
3117 .await
3118 .map(crate::Response::into_body)
3119 }
3120
3121 pub fn by_page(
3123 self,
3124 ) -> impl google_cloud_gax::paginator::Paginator<
3125 google_cloud_location::model::ListLocationsResponse,
3126 crate::Error,
3127 > {
3128 use std::clone::Clone;
3129 let token = self.0.request.page_token.clone();
3130 let execute = move |token: String| {
3131 let mut builder = self.clone();
3132 builder.0.request = builder.0.request.set_page_token(token);
3133 builder.send()
3134 };
3135 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3136 }
3137
3138 pub fn by_item(
3140 self,
3141 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3142 google_cloud_location::model::ListLocationsResponse,
3143 crate::Error,
3144 > {
3145 use google_cloud_gax::paginator::Paginator;
3146 self.by_page().items()
3147 }
3148
3149 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3151 self.0.request.name = v.into();
3152 self
3153 }
3154
3155 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3157 self.0.request.filter = v.into();
3158 self
3159 }
3160
3161 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3163 self.0.request.page_size = v.into();
3164 self
3165 }
3166
3167 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3169 self.0.request.page_token = v.into();
3170 self
3171 }
3172 }
3173
3174 #[doc(hidden)]
3175 impl crate::RequestBuilder for ListLocations {
3176 fn request_options(&mut self) -> &mut crate::RequestOptions {
3177 &mut self.0.options
3178 }
3179 }
3180
3181 #[derive(Clone, Debug)]
3198 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3199
3200 impl GetLocation {
3201 pub(crate) fn new(
3202 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3203 ) -> Self {
3204 Self(RequestBuilder::new(stub))
3205 }
3206
3207 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3209 mut self,
3210 v: V,
3211 ) -> Self {
3212 self.0.request = v.into();
3213 self
3214 }
3215
3216 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3218 self.0.options = v.into();
3219 self
3220 }
3221
3222 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3224 (*self.0.stub)
3225 .get_location(self.0.request, self.0.options)
3226 .await
3227 .map(crate::Response::into_body)
3228 }
3229
3230 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3232 self.0.request.name = v.into();
3233 self
3234 }
3235 }
3236
3237 #[doc(hidden)]
3238 impl crate::RequestBuilder for GetLocation {
3239 fn request_options(&mut self) -> &mut crate::RequestOptions {
3240 &mut self.0.options
3241 }
3242 }
3243
3244 #[derive(Clone, Debug)]
3261 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3262
3263 impl SetIamPolicy {
3264 pub(crate) fn new(
3265 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3266 ) -> Self {
3267 Self(RequestBuilder::new(stub))
3268 }
3269
3270 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3272 mut self,
3273 v: V,
3274 ) -> Self {
3275 self.0.request = v.into();
3276 self
3277 }
3278
3279 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3281 self.0.options = v.into();
3282 self
3283 }
3284
3285 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3287 (*self.0.stub)
3288 .set_iam_policy(self.0.request, self.0.options)
3289 .await
3290 .map(crate::Response::into_body)
3291 }
3292
3293 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3297 self.0.request.resource = v.into();
3298 self
3299 }
3300
3301 pub fn set_policy<T>(mut self, v: T) -> Self
3305 where
3306 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3307 {
3308 self.0.request.policy = std::option::Option::Some(v.into());
3309 self
3310 }
3311
3312 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3316 where
3317 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3318 {
3319 self.0.request.policy = v.map(|x| x.into());
3320 self
3321 }
3322
3323 pub fn set_update_mask<T>(mut self, v: T) -> Self
3325 where
3326 T: std::convert::Into<wkt::FieldMask>,
3327 {
3328 self.0.request.update_mask = std::option::Option::Some(v.into());
3329 self
3330 }
3331
3332 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3334 where
3335 T: std::convert::Into<wkt::FieldMask>,
3336 {
3337 self.0.request.update_mask = v.map(|x| x.into());
3338 self
3339 }
3340 }
3341
3342 #[doc(hidden)]
3343 impl crate::RequestBuilder for SetIamPolicy {
3344 fn request_options(&mut self) -> &mut crate::RequestOptions {
3345 &mut self.0.options
3346 }
3347 }
3348
3349 #[derive(Clone, Debug)]
3366 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3367
3368 impl GetIamPolicy {
3369 pub(crate) fn new(
3370 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3371 ) -> Self {
3372 Self(RequestBuilder::new(stub))
3373 }
3374
3375 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3377 mut self,
3378 v: V,
3379 ) -> Self {
3380 self.0.request = v.into();
3381 self
3382 }
3383
3384 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3386 self.0.options = v.into();
3387 self
3388 }
3389
3390 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3392 (*self.0.stub)
3393 .get_iam_policy(self.0.request, self.0.options)
3394 .await
3395 .map(crate::Response::into_body)
3396 }
3397
3398 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3402 self.0.request.resource = v.into();
3403 self
3404 }
3405
3406 pub fn set_options<T>(mut self, v: T) -> Self
3408 where
3409 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3410 {
3411 self.0.request.options = std::option::Option::Some(v.into());
3412 self
3413 }
3414
3415 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3417 where
3418 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3419 {
3420 self.0.request.options = v.map(|x| x.into());
3421 self
3422 }
3423 }
3424
3425 #[doc(hidden)]
3426 impl crate::RequestBuilder for GetIamPolicy {
3427 fn request_options(&mut self) -> &mut crate::RequestOptions {
3428 &mut self.0.options
3429 }
3430 }
3431
3432 #[derive(Clone, Debug)]
3449 pub struct TestIamPermissions(
3450 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3451 );
3452
3453 impl TestIamPermissions {
3454 pub(crate) fn new(
3455 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3456 ) -> Self {
3457 Self(RequestBuilder::new(stub))
3458 }
3459
3460 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3462 mut self,
3463 v: V,
3464 ) -> Self {
3465 self.0.request = v.into();
3466 self
3467 }
3468
3469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3471 self.0.options = v.into();
3472 self
3473 }
3474
3475 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3477 (*self.0.stub)
3478 .test_iam_permissions(self.0.request, self.0.options)
3479 .await
3480 .map(crate::Response::into_body)
3481 }
3482
3483 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3487 self.0.request.resource = v.into();
3488 self
3489 }
3490
3491 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3495 where
3496 T: std::iter::IntoIterator<Item = V>,
3497 V: std::convert::Into<std::string::String>,
3498 {
3499 use std::iter::Iterator;
3500 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3501 self
3502 }
3503 }
3504
3505 #[doc(hidden)]
3506 impl crate::RequestBuilder for TestIamPermissions {
3507 fn request_options(&mut self) -> &mut crate::RequestOptions {
3508 &mut self.0.options
3509 }
3510 }
3511
3512 #[derive(Clone, Debug)]
3533 pub struct ListOperations(
3534 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3535 );
3536
3537 impl ListOperations {
3538 pub(crate) fn new(
3539 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3540 ) -> Self {
3541 Self(RequestBuilder::new(stub))
3542 }
3543
3544 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3546 mut self,
3547 v: V,
3548 ) -> Self {
3549 self.0.request = v.into();
3550 self
3551 }
3552
3553 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3555 self.0.options = v.into();
3556 self
3557 }
3558
3559 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3561 (*self.0.stub)
3562 .list_operations(self.0.request, self.0.options)
3563 .await
3564 .map(crate::Response::into_body)
3565 }
3566
3567 pub fn by_page(
3569 self,
3570 ) -> impl google_cloud_gax::paginator::Paginator<
3571 google_cloud_longrunning::model::ListOperationsResponse,
3572 crate::Error,
3573 > {
3574 use std::clone::Clone;
3575 let token = self.0.request.page_token.clone();
3576 let execute = move |token: String| {
3577 let mut builder = self.clone();
3578 builder.0.request = builder.0.request.set_page_token(token);
3579 builder.send()
3580 };
3581 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3582 }
3583
3584 pub fn by_item(
3586 self,
3587 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3588 google_cloud_longrunning::model::ListOperationsResponse,
3589 crate::Error,
3590 > {
3591 use google_cloud_gax::paginator::Paginator;
3592 self.by_page().items()
3593 }
3594
3595 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3597 self.0.request.name = v.into();
3598 self
3599 }
3600
3601 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3603 self.0.request.filter = v.into();
3604 self
3605 }
3606
3607 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3609 self.0.request.page_size = v.into();
3610 self
3611 }
3612
3613 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3615 self.0.request.page_token = v.into();
3616 self
3617 }
3618
3619 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3621 self.0.request.return_partial_success = v.into();
3622 self
3623 }
3624 }
3625
3626 #[doc(hidden)]
3627 impl crate::RequestBuilder for ListOperations {
3628 fn request_options(&mut self) -> &mut crate::RequestOptions {
3629 &mut self.0.options
3630 }
3631 }
3632
3633 #[derive(Clone, Debug)]
3650 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3651
3652 impl GetOperation {
3653 pub(crate) fn new(
3654 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3655 ) -> Self {
3656 Self(RequestBuilder::new(stub))
3657 }
3658
3659 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3661 mut self,
3662 v: V,
3663 ) -> Self {
3664 self.0.request = v.into();
3665 self
3666 }
3667
3668 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3670 self.0.options = v.into();
3671 self
3672 }
3673
3674 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3676 (*self.0.stub)
3677 .get_operation(self.0.request, self.0.options)
3678 .await
3679 .map(crate::Response::into_body)
3680 }
3681
3682 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3684 self.0.request.name = v.into();
3685 self
3686 }
3687 }
3688
3689 #[doc(hidden)]
3690 impl crate::RequestBuilder for GetOperation {
3691 fn request_options(&mut self) -> &mut crate::RequestOptions {
3692 &mut self.0.options
3693 }
3694 }
3695
3696 #[derive(Clone, Debug)]
3713 pub struct DeleteOperation(
3714 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3715 );
3716
3717 impl DeleteOperation {
3718 pub(crate) fn new(
3719 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3720 ) -> Self {
3721 Self(RequestBuilder::new(stub))
3722 }
3723
3724 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3726 mut self,
3727 v: V,
3728 ) -> Self {
3729 self.0.request = v.into();
3730 self
3731 }
3732
3733 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3735 self.0.options = v.into();
3736 self
3737 }
3738
3739 pub async fn send(self) -> Result<()> {
3741 (*self.0.stub)
3742 .delete_operation(self.0.request, self.0.options)
3743 .await
3744 .map(crate::Response::into_body)
3745 }
3746
3747 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3749 self.0.request.name = v.into();
3750 self
3751 }
3752 }
3753
3754 #[doc(hidden)]
3755 impl crate::RequestBuilder for DeleteOperation {
3756 fn request_options(&mut self) -> &mut crate::RequestOptions {
3757 &mut self.0.options
3758 }
3759 }
3760
3761 #[derive(Clone, Debug)]
3778 pub struct CancelOperation(
3779 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3780 );
3781
3782 impl CancelOperation {
3783 pub(crate) fn new(
3784 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3785 ) -> Self {
3786 Self(RequestBuilder::new(stub))
3787 }
3788
3789 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3791 mut self,
3792 v: V,
3793 ) -> Self {
3794 self.0.request = v.into();
3795 self
3796 }
3797
3798 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3800 self.0.options = v.into();
3801 self
3802 }
3803
3804 pub async fn send(self) -> Result<()> {
3806 (*self.0.stub)
3807 .cancel_operation(self.0.request, self.0.options)
3808 .await
3809 .map(crate::Response::into_body)
3810 }
3811
3812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3814 self.0.request.name = v.into();
3815 self
3816 }
3817 }
3818
3819 #[doc(hidden)]
3820 impl crate::RequestBuilder for CancelOperation {
3821 fn request_options(&mut self) -> &mut crate::RequestOptions {
3822 &mut self.0.options
3823 }
3824 }
3825}
3826
3827pub mod dns_threat_detector_service {
3829 use crate::Result;
3830
3831 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3845
3846 pub(crate) mod client {
3847 use super::super::super::client::DnsThreatDetectorService;
3848 pub struct Factory;
3849 impl crate::ClientFactory for Factory {
3850 type Client = DnsThreatDetectorService;
3851 type Credentials = gaxi::options::Credentials;
3852 async fn build(
3853 self,
3854 config: gaxi::options::ClientConfig,
3855 ) -> crate::ClientBuilderResult<Self::Client> {
3856 Self::Client::new(config).await
3857 }
3858 }
3859 }
3860
3861 #[derive(Clone, Debug)]
3863 pub(crate) struct RequestBuilder<R: std::default::Default> {
3864 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3865 request: R,
3866 options: crate::RequestOptions,
3867 }
3868
3869 impl<R> RequestBuilder<R>
3870 where
3871 R: std::default::Default,
3872 {
3873 pub(crate) fn new(
3874 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3875 ) -> Self {
3876 Self {
3877 stub,
3878 request: R::default(),
3879 options: crate::RequestOptions::default(),
3880 }
3881 }
3882 }
3883
3884 #[derive(Clone, Debug)]
3905 pub struct ListDnsThreatDetectors(RequestBuilder<crate::model::ListDnsThreatDetectorsRequest>);
3906
3907 impl ListDnsThreatDetectors {
3908 pub(crate) fn new(
3909 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3910 ) -> Self {
3911 Self(RequestBuilder::new(stub))
3912 }
3913
3914 pub fn with_request<V: Into<crate::model::ListDnsThreatDetectorsRequest>>(
3916 mut self,
3917 v: V,
3918 ) -> Self {
3919 self.0.request = v.into();
3920 self
3921 }
3922
3923 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3925 self.0.options = v.into();
3926 self
3927 }
3928
3929 pub async fn send(self) -> Result<crate::model::ListDnsThreatDetectorsResponse> {
3931 (*self.0.stub)
3932 .list_dns_threat_detectors(self.0.request, self.0.options)
3933 .await
3934 .map(crate::Response::into_body)
3935 }
3936
3937 pub fn by_page(
3939 self,
3940 ) -> impl google_cloud_gax::paginator::Paginator<
3941 crate::model::ListDnsThreatDetectorsResponse,
3942 crate::Error,
3943 > {
3944 use std::clone::Clone;
3945 let token = self.0.request.page_token.clone();
3946 let execute = move |token: String| {
3947 let mut builder = self.clone();
3948 builder.0.request = builder.0.request.set_page_token(token);
3949 builder.send()
3950 };
3951 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3952 }
3953
3954 pub fn by_item(
3956 self,
3957 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3958 crate::model::ListDnsThreatDetectorsResponse,
3959 crate::Error,
3960 > {
3961 use google_cloud_gax::paginator::Paginator;
3962 self.by_page().items()
3963 }
3964
3965 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3969 self.0.request.parent = v.into();
3970 self
3971 }
3972
3973 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3975 self.0.request.page_size = v.into();
3976 self
3977 }
3978
3979 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3981 self.0.request.page_token = v.into();
3982 self
3983 }
3984 }
3985
3986 #[doc(hidden)]
3987 impl crate::RequestBuilder for ListDnsThreatDetectors {
3988 fn request_options(&mut self) -> &mut crate::RequestOptions {
3989 &mut self.0.options
3990 }
3991 }
3992
3993 #[derive(Clone, Debug)]
4010 pub struct GetDnsThreatDetector(RequestBuilder<crate::model::GetDnsThreatDetectorRequest>);
4011
4012 impl GetDnsThreatDetector {
4013 pub(crate) fn new(
4014 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4015 ) -> Self {
4016 Self(RequestBuilder::new(stub))
4017 }
4018
4019 pub fn with_request<V: Into<crate::model::GetDnsThreatDetectorRequest>>(
4021 mut self,
4022 v: V,
4023 ) -> Self {
4024 self.0.request = v.into();
4025 self
4026 }
4027
4028 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4030 self.0.options = v.into();
4031 self
4032 }
4033
4034 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4036 (*self.0.stub)
4037 .get_dns_threat_detector(self.0.request, self.0.options)
4038 .await
4039 .map(crate::Response::into_body)
4040 }
4041
4042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4046 self.0.request.name = v.into();
4047 self
4048 }
4049 }
4050
4051 #[doc(hidden)]
4052 impl crate::RequestBuilder for GetDnsThreatDetector {
4053 fn request_options(&mut self) -> &mut crate::RequestOptions {
4054 &mut self.0.options
4055 }
4056 }
4057
4058 #[derive(Clone, Debug)]
4075 pub struct CreateDnsThreatDetector(
4076 RequestBuilder<crate::model::CreateDnsThreatDetectorRequest>,
4077 );
4078
4079 impl CreateDnsThreatDetector {
4080 pub(crate) fn new(
4081 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4082 ) -> Self {
4083 Self(RequestBuilder::new(stub))
4084 }
4085
4086 pub fn with_request<V: Into<crate::model::CreateDnsThreatDetectorRequest>>(
4088 mut self,
4089 v: V,
4090 ) -> Self {
4091 self.0.request = v.into();
4092 self
4093 }
4094
4095 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4097 self.0.options = v.into();
4098 self
4099 }
4100
4101 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4103 (*self.0.stub)
4104 .create_dns_threat_detector(self.0.request, self.0.options)
4105 .await
4106 .map(crate::Response::into_body)
4107 }
4108
4109 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4113 self.0.request.parent = v.into();
4114 self
4115 }
4116
4117 pub fn set_dns_threat_detector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4119 self.0.request.dns_threat_detector_id = v.into();
4120 self
4121 }
4122
4123 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4127 where
4128 T: std::convert::Into<crate::model::DnsThreatDetector>,
4129 {
4130 self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4131 self
4132 }
4133
4134 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4138 where
4139 T: std::convert::Into<crate::model::DnsThreatDetector>,
4140 {
4141 self.0.request.dns_threat_detector = v.map(|x| x.into());
4142 self
4143 }
4144 }
4145
4146 #[doc(hidden)]
4147 impl crate::RequestBuilder for CreateDnsThreatDetector {
4148 fn request_options(&mut self) -> &mut crate::RequestOptions {
4149 &mut self.0.options
4150 }
4151 }
4152
4153 #[derive(Clone, Debug)]
4170 pub struct UpdateDnsThreatDetector(
4171 RequestBuilder<crate::model::UpdateDnsThreatDetectorRequest>,
4172 );
4173
4174 impl UpdateDnsThreatDetector {
4175 pub(crate) fn new(
4176 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4177 ) -> Self {
4178 Self(RequestBuilder::new(stub))
4179 }
4180
4181 pub fn with_request<V: Into<crate::model::UpdateDnsThreatDetectorRequest>>(
4183 mut self,
4184 v: V,
4185 ) -> Self {
4186 self.0.request = v.into();
4187 self
4188 }
4189
4190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4192 self.0.options = v.into();
4193 self
4194 }
4195
4196 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4198 (*self.0.stub)
4199 .update_dns_threat_detector(self.0.request, self.0.options)
4200 .await
4201 .map(crate::Response::into_body)
4202 }
4203
4204 pub fn set_update_mask<T>(mut self, v: T) -> Self
4206 where
4207 T: std::convert::Into<wkt::FieldMask>,
4208 {
4209 self.0.request.update_mask = std::option::Option::Some(v.into());
4210 self
4211 }
4212
4213 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4215 where
4216 T: std::convert::Into<wkt::FieldMask>,
4217 {
4218 self.0.request.update_mask = v.map(|x| x.into());
4219 self
4220 }
4221
4222 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4226 where
4227 T: std::convert::Into<crate::model::DnsThreatDetector>,
4228 {
4229 self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4230 self
4231 }
4232
4233 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4237 where
4238 T: std::convert::Into<crate::model::DnsThreatDetector>,
4239 {
4240 self.0.request.dns_threat_detector = v.map(|x| x.into());
4241 self
4242 }
4243 }
4244
4245 #[doc(hidden)]
4246 impl crate::RequestBuilder for UpdateDnsThreatDetector {
4247 fn request_options(&mut self) -> &mut crate::RequestOptions {
4248 &mut self.0.options
4249 }
4250 }
4251
4252 #[derive(Clone, Debug)]
4269 pub struct DeleteDnsThreatDetector(
4270 RequestBuilder<crate::model::DeleteDnsThreatDetectorRequest>,
4271 );
4272
4273 impl DeleteDnsThreatDetector {
4274 pub(crate) fn new(
4275 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4276 ) -> Self {
4277 Self(RequestBuilder::new(stub))
4278 }
4279
4280 pub fn with_request<V: Into<crate::model::DeleteDnsThreatDetectorRequest>>(
4282 mut self,
4283 v: V,
4284 ) -> Self {
4285 self.0.request = v.into();
4286 self
4287 }
4288
4289 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4291 self.0.options = v.into();
4292 self
4293 }
4294
4295 pub async fn send(self) -> Result<()> {
4297 (*self.0.stub)
4298 .delete_dns_threat_detector(self.0.request, self.0.options)
4299 .await
4300 .map(crate::Response::into_body)
4301 }
4302
4303 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4307 self.0.request.name = v.into();
4308 self
4309 }
4310 }
4311
4312 #[doc(hidden)]
4313 impl crate::RequestBuilder for DeleteDnsThreatDetector {
4314 fn request_options(&mut self) -> &mut crate::RequestOptions {
4315 &mut self.0.options
4316 }
4317 }
4318
4319 #[derive(Clone, Debug)]
4340 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4341
4342 impl ListLocations {
4343 pub(crate) fn new(
4344 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4345 ) -> Self {
4346 Self(RequestBuilder::new(stub))
4347 }
4348
4349 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4351 mut self,
4352 v: V,
4353 ) -> Self {
4354 self.0.request = v.into();
4355 self
4356 }
4357
4358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4360 self.0.options = v.into();
4361 self
4362 }
4363
4364 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4366 (*self.0.stub)
4367 .list_locations(self.0.request, self.0.options)
4368 .await
4369 .map(crate::Response::into_body)
4370 }
4371
4372 pub fn by_page(
4374 self,
4375 ) -> impl google_cloud_gax::paginator::Paginator<
4376 google_cloud_location::model::ListLocationsResponse,
4377 crate::Error,
4378 > {
4379 use std::clone::Clone;
4380 let token = self.0.request.page_token.clone();
4381 let execute = move |token: String| {
4382 let mut builder = self.clone();
4383 builder.0.request = builder.0.request.set_page_token(token);
4384 builder.send()
4385 };
4386 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4387 }
4388
4389 pub fn by_item(
4391 self,
4392 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4393 google_cloud_location::model::ListLocationsResponse,
4394 crate::Error,
4395 > {
4396 use google_cloud_gax::paginator::Paginator;
4397 self.by_page().items()
4398 }
4399
4400 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4402 self.0.request.name = v.into();
4403 self
4404 }
4405
4406 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4408 self.0.request.filter = v.into();
4409 self
4410 }
4411
4412 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4414 self.0.request.page_size = v.into();
4415 self
4416 }
4417
4418 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4420 self.0.request.page_token = v.into();
4421 self
4422 }
4423 }
4424
4425 #[doc(hidden)]
4426 impl crate::RequestBuilder for ListLocations {
4427 fn request_options(&mut self) -> &mut crate::RequestOptions {
4428 &mut self.0.options
4429 }
4430 }
4431
4432 #[derive(Clone, Debug)]
4449 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4450
4451 impl GetLocation {
4452 pub(crate) fn new(
4453 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4454 ) -> Self {
4455 Self(RequestBuilder::new(stub))
4456 }
4457
4458 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4460 mut self,
4461 v: V,
4462 ) -> Self {
4463 self.0.request = v.into();
4464 self
4465 }
4466
4467 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4469 self.0.options = v.into();
4470 self
4471 }
4472
4473 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4475 (*self.0.stub)
4476 .get_location(self.0.request, self.0.options)
4477 .await
4478 .map(crate::Response::into_body)
4479 }
4480
4481 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4483 self.0.request.name = v.into();
4484 self
4485 }
4486 }
4487
4488 #[doc(hidden)]
4489 impl crate::RequestBuilder for GetLocation {
4490 fn request_options(&mut self) -> &mut crate::RequestOptions {
4491 &mut self.0.options
4492 }
4493 }
4494
4495 #[derive(Clone, Debug)]
4512 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4513
4514 impl SetIamPolicy {
4515 pub(crate) fn new(
4516 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4517 ) -> Self {
4518 Self(RequestBuilder::new(stub))
4519 }
4520
4521 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4523 mut self,
4524 v: V,
4525 ) -> Self {
4526 self.0.request = v.into();
4527 self
4528 }
4529
4530 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4532 self.0.options = v.into();
4533 self
4534 }
4535
4536 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4538 (*self.0.stub)
4539 .set_iam_policy(self.0.request, self.0.options)
4540 .await
4541 .map(crate::Response::into_body)
4542 }
4543
4544 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4548 self.0.request.resource = v.into();
4549 self
4550 }
4551
4552 pub fn set_policy<T>(mut self, v: T) -> Self
4556 where
4557 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4558 {
4559 self.0.request.policy = std::option::Option::Some(v.into());
4560 self
4561 }
4562
4563 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4567 where
4568 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4569 {
4570 self.0.request.policy = v.map(|x| x.into());
4571 self
4572 }
4573
4574 pub fn set_update_mask<T>(mut self, v: T) -> Self
4576 where
4577 T: std::convert::Into<wkt::FieldMask>,
4578 {
4579 self.0.request.update_mask = std::option::Option::Some(v.into());
4580 self
4581 }
4582
4583 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4585 where
4586 T: std::convert::Into<wkt::FieldMask>,
4587 {
4588 self.0.request.update_mask = v.map(|x| x.into());
4589 self
4590 }
4591 }
4592
4593 #[doc(hidden)]
4594 impl crate::RequestBuilder for SetIamPolicy {
4595 fn request_options(&mut self) -> &mut crate::RequestOptions {
4596 &mut self.0.options
4597 }
4598 }
4599
4600 #[derive(Clone, Debug)]
4617 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4618
4619 impl GetIamPolicy {
4620 pub(crate) fn new(
4621 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4622 ) -> Self {
4623 Self(RequestBuilder::new(stub))
4624 }
4625
4626 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4628 mut self,
4629 v: V,
4630 ) -> Self {
4631 self.0.request = v.into();
4632 self
4633 }
4634
4635 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4637 self.0.options = v.into();
4638 self
4639 }
4640
4641 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4643 (*self.0.stub)
4644 .get_iam_policy(self.0.request, self.0.options)
4645 .await
4646 .map(crate::Response::into_body)
4647 }
4648
4649 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4653 self.0.request.resource = v.into();
4654 self
4655 }
4656
4657 pub fn set_options<T>(mut self, v: T) -> Self
4659 where
4660 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4661 {
4662 self.0.request.options = std::option::Option::Some(v.into());
4663 self
4664 }
4665
4666 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4668 where
4669 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4670 {
4671 self.0.request.options = v.map(|x| x.into());
4672 self
4673 }
4674 }
4675
4676 #[doc(hidden)]
4677 impl crate::RequestBuilder for GetIamPolicy {
4678 fn request_options(&mut self) -> &mut crate::RequestOptions {
4679 &mut self.0.options
4680 }
4681 }
4682
4683 #[derive(Clone, Debug)]
4700 pub struct TestIamPermissions(
4701 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4702 );
4703
4704 impl TestIamPermissions {
4705 pub(crate) fn new(
4706 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4707 ) -> Self {
4708 Self(RequestBuilder::new(stub))
4709 }
4710
4711 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4713 mut self,
4714 v: V,
4715 ) -> Self {
4716 self.0.request = v.into();
4717 self
4718 }
4719
4720 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4722 self.0.options = v.into();
4723 self
4724 }
4725
4726 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4728 (*self.0.stub)
4729 .test_iam_permissions(self.0.request, self.0.options)
4730 .await
4731 .map(crate::Response::into_body)
4732 }
4733
4734 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4738 self.0.request.resource = v.into();
4739 self
4740 }
4741
4742 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4746 where
4747 T: std::iter::IntoIterator<Item = V>,
4748 V: std::convert::Into<std::string::String>,
4749 {
4750 use std::iter::Iterator;
4751 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4752 self
4753 }
4754 }
4755
4756 #[doc(hidden)]
4757 impl crate::RequestBuilder for TestIamPermissions {
4758 fn request_options(&mut self) -> &mut crate::RequestOptions {
4759 &mut self.0.options
4760 }
4761 }
4762
4763 #[derive(Clone, Debug)]
4784 pub struct ListOperations(
4785 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4786 );
4787
4788 impl ListOperations {
4789 pub(crate) fn new(
4790 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4791 ) -> Self {
4792 Self(RequestBuilder::new(stub))
4793 }
4794
4795 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4797 mut self,
4798 v: V,
4799 ) -> Self {
4800 self.0.request = v.into();
4801 self
4802 }
4803
4804 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4806 self.0.options = v.into();
4807 self
4808 }
4809
4810 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4812 (*self.0.stub)
4813 .list_operations(self.0.request, self.0.options)
4814 .await
4815 .map(crate::Response::into_body)
4816 }
4817
4818 pub fn by_page(
4820 self,
4821 ) -> impl google_cloud_gax::paginator::Paginator<
4822 google_cloud_longrunning::model::ListOperationsResponse,
4823 crate::Error,
4824 > {
4825 use std::clone::Clone;
4826 let token = self.0.request.page_token.clone();
4827 let execute = move |token: String| {
4828 let mut builder = self.clone();
4829 builder.0.request = builder.0.request.set_page_token(token);
4830 builder.send()
4831 };
4832 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4833 }
4834
4835 pub fn by_item(
4837 self,
4838 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4839 google_cloud_longrunning::model::ListOperationsResponse,
4840 crate::Error,
4841 > {
4842 use google_cloud_gax::paginator::Paginator;
4843 self.by_page().items()
4844 }
4845
4846 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4848 self.0.request.name = v.into();
4849 self
4850 }
4851
4852 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4854 self.0.request.filter = v.into();
4855 self
4856 }
4857
4858 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4860 self.0.request.page_size = v.into();
4861 self
4862 }
4863
4864 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4866 self.0.request.page_token = v.into();
4867 self
4868 }
4869
4870 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4872 self.0.request.return_partial_success = v.into();
4873 self
4874 }
4875 }
4876
4877 #[doc(hidden)]
4878 impl crate::RequestBuilder for ListOperations {
4879 fn request_options(&mut self) -> &mut crate::RequestOptions {
4880 &mut self.0.options
4881 }
4882 }
4883
4884 #[derive(Clone, Debug)]
4901 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4902
4903 impl GetOperation {
4904 pub(crate) fn new(
4905 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4906 ) -> Self {
4907 Self(RequestBuilder::new(stub))
4908 }
4909
4910 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4912 mut self,
4913 v: V,
4914 ) -> Self {
4915 self.0.request = v.into();
4916 self
4917 }
4918
4919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4921 self.0.options = v.into();
4922 self
4923 }
4924
4925 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4927 (*self.0.stub)
4928 .get_operation(self.0.request, self.0.options)
4929 .await
4930 .map(crate::Response::into_body)
4931 }
4932
4933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4935 self.0.request.name = v.into();
4936 self
4937 }
4938 }
4939
4940 #[doc(hidden)]
4941 impl crate::RequestBuilder for GetOperation {
4942 fn request_options(&mut self) -> &mut crate::RequestOptions {
4943 &mut self.0.options
4944 }
4945 }
4946
4947 #[derive(Clone, Debug)]
4964 pub struct DeleteOperation(
4965 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4966 );
4967
4968 impl DeleteOperation {
4969 pub(crate) fn new(
4970 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4971 ) -> Self {
4972 Self(RequestBuilder::new(stub))
4973 }
4974
4975 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4977 mut self,
4978 v: V,
4979 ) -> Self {
4980 self.0.request = v.into();
4981 self
4982 }
4983
4984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4986 self.0.options = v.into();
4987 self
4988 }
4989
4990 pub async fn send(self) -> Result<()> {
4992 (*self.0.stub)
4993 .delete_operation(self.0.request, self.0.options)
4994 .await
4995 .map(crate::Response::into_body)
4996 }
4997
4998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5000 self.0.request.name = v.into();
5001 self
5002 }
5003 }
5004
5005 #[doc(hidden)]
5006 impl crate::RequestBuilder for DeleteOperation {
5007 fn request_options(&mut self) -> &mut crate::RequestOptions {
5008 &mut self.0.options
5009 }
5010 }
5011
5012 #[derive(Clone, Debug)]
5029 pub struct CancelOperation(
5030 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5031 );
5032
5033 impl CancelOperation {
5034 pub(crate) fn new(
5035 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5036 ) -> Self {
5037 Self(RequestBuilder::new(stub))
5038 }
5039
5040 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5042 mut self,
5043 v: V,
5044 ) -> Self {
5045 self.0.request = v.into();
5046 self
5047 }
5048
5049 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5051 self.0.options = v.into();
5052 self
5053 }
5054
5055 pub async fn send(self) -> Result<()> {
5057 (*self.0.stub)
5058 .cancel_operation(self.0.request, self.0.options)
5059 .await
5060 .map(crate::Response::into_body)
5061 }
5062
5063 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5065 self.0.request.name = v.into();
5066 self
5067 }
5068 }
5069
5070 #[doc(hidden)]
5071 impl crate::RequestBuilder for CancelOperation {
5072 fn request_options(&mut self) -> &mut crate::RequestOptions {
5073 &mut self.0.options
5074 }
5075 }
5076}
5077
5078pub mod firewall_activation {
5080 use crate::Result;
5081
5082 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5096
5097 pub(crate) mod client {
5098 use super::super::super::client::FirewallActivation;
5099 pub struct Factory;
5100 impl crate::ClientFactory for Factory {
5101 type Client = FirewallActivation;
5102 type Credentials = gaxi::options::Credentials;
5103 async fn build(
5104 self,
5105 config: gaxi::options::ClientConfig,
5106 ) -> crate::ClientBuilderResult<Self::Client> {
5107 Self::Client::new(config).await
5108 }
5109 }
5110 }
5111
5112 #[derive(Clone, Debug)]
5114 pub(crate) struct RequestBuilder<R: std::default::Default> {
5115 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5116 request: R,
5117 options: crate::RequestOptions,
5118 }
5119
5120 impl<R> RequestBuilder<R>
5121 where
5122 R: std::default::Default,
5123 {
5124 pub(crate) fn new(
5125 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5126 ) -> Self {
5127 Self {
5128 stub,
5129 request: R::default(),
5130 options: crate::RequestOptions::default(),
5131 }
5132 }
5133 }
5134
5135 #[derive(Clone, Debug)]
5156 pub struct ListFirewallEndpoints(RequestBuilder<crate::model::ListFirewallEndpointsRequest>);
5157
5158 impl ListFirewallEndpoints {
5159 pub(crate) fn new(
5160 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5161 ) -> Self {
5162 Self(RequestBuilder::new(stub))
5163 }
5164
5165 pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5167 mut self,
5168 v: V,
5169 ) -> Self {
5170 self.0.request = v.into();
5171 self
5172 }
5173
5174 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5176 self.0.options = v.into();
5177 self
5178 }
5179
5180 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5182 (*self.0.stub)
5183 .list_firewall_endpoints(self.0.request, self.0.options)
5184 .await
5185 .map(crate::Response::into_body)
5186 }
5187
5188 pub fn by_page(
5190 self,
5191 ) -> impl google_cloud_gax::paginator::Paginator<
5192 crate::model::ListFirewallEndpointsResponse,
5193 crate::Error,
5194 > {
5195 use std::clone::Clone;
5196 let token = self.0.request.page_token.clone();
5197 let execute = move |token: String| {
5198 let mut builder = self.clone();
5199 builder.0.request = builder.0.request.set_page_token(token);
5200 builder.send()
5201 };
5202 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5203 }
5204
5205 pub fn by_item(
5207 self,
5208 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5209 crate::model::ListFirewallEndpointsResponse,
5210 crate::Error,
5211 > {
5212 use google_cloud_gax::paginator::Paginator;
5213 self.by_page().items()
5214 }
5215
5216 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5220 self.0.request.parent = v.into();
5221 self
5222 }
5223
5224 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5226 self.0.request.page_size = v.into();
5227 self
5228 }
5229
5230 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5232 self.0.request.page_token = v.into();
5233 self
5234 }
5235
5236 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5238 self.0.request.filter = v.into();
5239 self
5240 }
5241
5242 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5244 self.0.request.order_by = v.into();
5245 self
5246 }
5247 }
5248
5249 #[doc(hidden)]
5250 impl crate::RequestBuilder for ListFirewallEndpoints {
5251 fn request_options(&mut self) -> &mut crate::RequestOptions {
5252 &mut self.0.options
5253 }
5254 }
5255
5256 #[derive(Clone, Debug)]
5273 pub struct GetFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5274
5275 impl GetFirewallEndpoint {
5276 pub(crate) fn new(
5277 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5278 ) -> Self {
5279 Self(RequestBuilder::new(stub))
5280 }
5281
5282 pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5284 mut self,
5285 v: V,
5286 ) -> Self {
5287 self.0.request = v.into();
5288 self
5289 }
5290
5291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5293 self.0.options = v.into();
5294 self
5295 }
5296
5297 pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5299 (*self.0.stub)
5300 .get_firewall_endpoint(self.0.request, self.0.options)
5301 .await
5302 .map(crate::Response::into_body)
5303 }
5304
5305 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5309 self.0.request.name = v.into();
5310 self
5311 }
5312 }
5313
5314 #[doc(hidden)]
5315 impl crate::RequestBuilder for GetFirewallEndpoint {
5316 fn request_options(&mut self) -> &mut crate::RequestOptions {
5317 &mut self.0.options
5318 }
5319 }
5320
5321 #[derive(Clone, Debug)]
5339 pub struct CreateFirewallEndpoint(RequestBuilder<crate::model::CreateFirewallEndpointRequest>);
5340
5341 impl CreateFirewallEndpoint {
5342 pub(crate) fn new(
5343 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5344 ) -> Self {
5345 Self(RequestBuilder::new(stub))
5346 }
5347
5348 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5350 mut self,
5351 v: V,
5352 ) -> Self {
5353 self.0.request = v.into();
5354 self
5355 }
5356
5357 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5359 self.0.options = v.into();
5360 self
5361 }
5362
5363 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5370 (*self.0.stub)
5371 .create_firewall_endpoint(self.0.request, self.0.options)
5372 .await
5373 .map(crate::Response::into_body)
5374 }
5375
5376 pub fn poller(
5378 self,
5379 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5380 {
5381 type Operation = google_cloud_lro::internal::Operation<
5382 crate::model::FirewallEndpoint,
5383 crate::model::OperationMetadata,
5384 >;
5385 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5386 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5387
5388 let stub = self.0.stub.clone();
5389 let mut options = self.0.options.clone();
5390 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5391 let query = move |name| {
5392 let stub = stub.clone();
5393 let options = options.clone();
5394 async {
5395 let op = GetOperation::new(stub)
5396 .set_name(name)
5397 .with_options(options)
5398 .send()
5399 .await?;
5400 Ok(Operation::new(op))
5401 }
5402 };
5403
5404 let start = move || async {
5405 let op = self.send().await?;
5406 Ok(Operation::new(op))
5407 };
5408
5409 google_cloud_lro::internal::new_poller(
5410 polling_error_policy,
5411 polling_backoff_policy,
5412 start,
5413 query,
5414 )
5415 }
5416
5417 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5421 self.0.request.parent = v.into();
5422 self
5423 }
5424
5425 pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5429 self.0.request.firewall_endpoint_id = v.into();
5430 self
5431 }
5432
5433 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5437 where
5438 T: std::convert::Into<crate::model::FirewallEndpoint>,
5439 {
5440 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5441 self
5442 }
5443
5444 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5448 where
5449 T: std::convert::Into<crate::model::FirewallEndpoint>,
5450 {
5451 self.0.request.firewall_endpoint = v.map(|x| x.into());
5452 self
5453 }
5454
5455 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5457 self.0.request.request_id = v.into();
5458 self
5459 }
5460 }
5461
5462 #[doc(hidden)]
5463 impl crate::RequestBuilder for CreateFirewallEndpoint {
5464 fn request_options(&mut self) -> &mut crate::RequestOptions {
5465 &mut self.0.options
5466 }
5467 }
5468
5469 #[derive(Clone, Debug)]
5487 pub struct DeleteFirewallEndpoint(RequestBuilder<crate::model::DeleteFirewallEndpointRequest>);
5488
5489 impl DeleteFirewallEndpoint {
5490 pub(crate) fn new(
5491 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5492 ) -> Self {
5493 Self(RequestBuilder::new(stub))
5494 }
5495
5496 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5498 mut self,
5499 v: V,
5500 ) -> Self {
5501 self.0.request = v.into();
5502 self
5503 }
5504
5505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5507 self.0.options = v.into();
5508 self
5509 }
5510
5511 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5518 (*self.0.stub)
5519 .delete_firewall_endpoint(self.0.request, self.0.options)
5520 .await
5521 .map(crate::Response::into_body)
5522 }
5523
5524 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5526 type Operation =
5527 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5528 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5529 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5530
5531 let stub = self.0.stub.clone();
5532 let mut options = self.0.options.clone();
5533 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5534 let query = move |name| {
5535 let stub = stub.clone();
5536 let options = options.clone();
5537 async {
5538 let op = GetOperation::new(stub)
5539 .set_name(name)
5540 .with_options(options)
5541 .send()
5542 .await?;
5543 Ok(Operation::new(op))
5544 }
5545 };
5546
5547 let start = move || async {
5548 let op = self.send().await?;
5549 Ok(Operation::new(op))
5550 };
5551
5552 google_cloud_lro::internal::new_unit_response_poller(
5553 polling_error_policy,
5554 polling_backoff_policy,
5555 start,
5556 query,
5557 )
5558 }
5559
5560 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5564 self.0.request.name = v.into();
5565 self
5566 }
5567
5568 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5570 self.0.request.request_id = v.into();
5571 self
5572 }
5573 }
5574
5575 #[doc(hidden)]
5576 impl crate::RequestBuilder for DeleteFirewallEndpoint {
5577 fn request_options(&mut self) -> &mut crate::RequestOptions {
5578 &mut self.0.options
5579 }
5580 }
5581
5582 #[derive(Clone, Debug)]
5600 pub struct UpdateFirewallEndpoint(RequestBuilder<crate::model::UpdateFirewallEndpointRequest>);
5601
5602 impl UpdateFirewallEndpoint {
5603 pub(crate) fn new(
5604 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5605 ) -> Self {
5606 Self(RequestBuilder::new(stub))
5607 }
5608
5609 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
5611 mut self,
5612 v: V,
5613 ) -> Self {
5614 self.0.request = v.into();
5615 self
5616 }
5617
5618 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5620 self.0.options = v.into();
5621 self
5622 }
5623
5624 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5631 (*self.0.stub)
5632 .update_firewall_endpoint(self.0.request, self.0.options)
5633 .await
5634 .map(crate::Response::into_body)
5635 }
5636
5637 pub fn poller(
5639 self,
5640 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5641 {
5642 type Operation = google_cloud_lro::internal::Operation<
5643 crate::model::FirewallEndpoint,
5644 crate::model::OperationMetadata,
5645 >;
5646 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5647 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5648
5649 let stub = self.0.stub.clone();
5650 let mut options = self.0.options.clone();
5651 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5652 let query = move |name| {
5653 let stub = stub.clone();
5654 let options = options.clone();
5655 async {
5656 let op = GetOperation::new(stub)
5657 .set_name(name)
5658 .with_options(options)
5659 .send()
5660 .await?;
5661 Ok(Operation::new(op))
5662 }
5663 };
5664
5665 let start = move || async {
5666 let op = self.send().await?;
5667 Ok(Operation::new(op))
5668 };
5669
5670 google_cloud_lro::internal::new_poller(
5671 polling_error_policy,
5672 polling_backoff_policy,
5673 start,
5674 query,
5675 )
5676 }
5677
5678 pub fn set_update_mask<T>(mut self, v: T) -> Self
5682 where
5683 T: std::convert::Into<wkt::FieldMask>,
5684 {
5685 self.0.request.update_mask = std::option::Option::Some(v.into());
5686 self
5687 }
5688
5689 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5693 where
5694 T: std::convert::Into<wkt::FieldMask>,
5695 {
5696 self.0.request.update_mask = v.map(|x| x.into());
5697 self
5698 }
5699
5700 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5704 where
5705 T: std::convert::Into<crate::model::FirewallEndpoint>,
5706 {
5707 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5708 self
5709 }
5710
5711 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5715 where
5716 T: std::convert::Into<crate::model::FirewallEndpoint>,
5717 {
5718 self.0.request.firewall_endpoint = v.map(|x| x.into());
5719 self
5720 }
5721
5722 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5724 self.0.request.request_id = v.into();
5725 self
5726 }
5727 }
5728
5729 #[doc(hidden)]
5730 impl crate::RequestBuilder for UpdateFirewallEndpoint {
5731 fn request_options(&mut self) -> &mut crate::RequestOptions {
5732 &mut self.0.options
5733 }
5734 }
5735
5736 #[derive(Clone, Debug)]
5757 pub struct ListFirewallEndpointAssociations(
5758 RequestBuilder<crate::model::ListFirewallEndpointAssociationsRequest>,
5759 );
5760
5761 impl ListFirewallEndpointAssociations {
5762 pub(crate) fn new(
5763 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5764 ) -> Self {
5765 Self(RequestBuilder::new(stub))
5766 }
5767
5768 pub fn with_request<V: Into<crate::model::ListFirewallEndpointAssociationsRequest>>(
5770 mut self,
5771 v: V,
5772 ) -> Self {
5773 self.0.request = v.into();
5774 self
5775 }
5776
5777 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5779 self.0.options = v.into();
5780 self
5781 }
5782
5783 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointAssociationsResponse> {
5785 (*self.0.stub)
5786 .list_firewall_endpoint_associations(self.0.request, self.0.options)
5787 .await
5788 .map(crate::Response::into_body)
5789 }
5790
5791 pub fn by_page(
5793 self,
5794 ) -> impl google_cloud_gax::paginator::Paginator<
5795 crate::model::ListFirewallEndpointAssociationsResponse,
5796 crate::Error,
5797 > {
5798 use std::clone::Clone;
5799 let token = self.0.request.page_token.clone();
5800 let execute = move |token: String| {
5801 let mut builder = self.clone();
5802 builder.0.request = builder.0.request.set_page_token(token);
5803 builder.send()
5804 };
5805 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5806 }
5807
5808 pub fn by_item(
5810 self,
5811 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5812 crate::model::ListFirewallEndpointAssociationsResponse,
5813 crate::Error,
5814 > {
5815 use google_cloud_gax::paginator::Paginator;
5816 self.by_page().items()
5817 }
5818
5819 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5823 self.0.request.parent = v.into();
5824 self
5825 }
5826
5827 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5829 self.0.request.page_size = v.into();
5830 self
5831 }
5832
5833 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5835 self.0.request.page_token = v.into();
5836 self
5837 }
5838
5839 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5841 self.0.request.filter = v.into();
5842 self
5843 }
5844
5845 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5847 self.0.request.order_by = v.into();
5848 self
5849 }
5850 }
5851
5852 #[doc(hidden)]
5853 impl crate::RequestBuilder for ListFirewallEndpointAssociations {
5854 fn request_options(&mut self) -> &mut crate::RequestOptions {
5855 &mut self.0.options
5856 }
5857 }
5858
5859 #[derive(Clone, Debug)]
5876 pub struct GetFirewallEndpointAssociation(
5877 RequestBuilder<crate::model::GetFirewallEndpointAssociationRequest>,
5878 );
5879
5880 impl GetFirewallEndpointAssociation {
5881 pub(crate) fn new(
5882 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5883 ) -> Self {
5884 Self(RequestBuilder::new(stub))
5885 }
5886
5887 pub fn with_request<V: Into<crate::model::GetFirewallEndpointAssociationRequest>>(
5889 mut self,
5890 v: V,
5891 ) -> Self {
5892 self.0.request = v.into();
5893 self
5894 }
5895
5896 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5898 self.0.options = v.into();
5899 self
5900 }
5901
5902 pub async fn send(self) -> Result<crate::model::FirewallEndpointAssociation> {
5904 (*self.0.stub)
5905 .get_firewall_endpoint_association(self.0.request, self.0.options)
5906 .await
5907 .map(crate::Response::into_body)
5908 }
5909
5910 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5914 self.0.request.name = v.into();
5915 self
5916 }
5917 }
5918
5919 #[doc(hidden)]
5920 impl crate::RequestBuilder for GetFirewallEndpointAssociation {
5921 fn request_options(&mut self) -> &mut crate::RequestOptions {
5922 &mut self.0.options
5923 }
5924 }
5925
5926 #[derive(Clone, Debug)]
5944 pub struct CreateFirewallEndpointAssociation(
5945 RequestBuilder<crate::model::CreateFirewallEndpointAssociationRequest>,
5946 );
5947
5948 impl CreateFirewallEndpointAssociation {
5949 pub(crate) fn new(
5950 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5951 ) -> Self {
5952 Self(RequestBuilder::new(stub))
5953 }
5954
5955 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointAssociationRequest>>(
5957 mut self,
5958 v: V,
5959 ) -> Self {
5960 self.0.request = v.into();
5961 self
5962 }
5963
5964 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5966 self.0.options = v.into();
5967 self
5968 }
5969
5970 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5977 (*self.0.stub)
5978 .create_firewall_endpoint_association(self.0.request, self.0.options)
5979 .await
5980 .map(crate::Response::into_body)
5981 }
5982
5983 pub fn poller(
5985 self,
5986 ) -> impl google_cloud_lro::Poller<
5987 crate::model::FirewallEndpointAssociation,
5988 crate::model::OperationMetadata,
5989 > {
5990 type Operation = google_cloud_lro::internal::Operation<
5991 crate::model::FirewallEndpointAssociation,
5992 crate::model::OperationMetadata,
5993 >;
5994 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5995 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5996
5997 let stub = self.0.stub.clone();
5998 let mut options = self.0.options.clone();
5999 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6000 let query = move |name| {
6001 let stub = stub.clone();
6002 let options = options.clone();
6003 async {
6004 let op = GetOperation::new(stub)
6005 .set_name(name)
6006 .with_options(options)
6007 .send()
6008 .await?;
6009 Ok(Operation::new(op))
6010 }
6011 };
6012
6013 let start = move || async {
6014 let op = self.send().await?;
6015 Ok(Operation::new(op))
6016 };
6017
6018 google_cloud_lro::internal::new_poller(
6019 polling_error_policy,
6020 polling_backoff_policy,
6021 start,
6022 query,
6023 )
6024 }
6025
6026 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6030 self.0.request.parent = v.into();
6031 self
6032 }
6033
6034 pub fn set_firewall_endpoint_association_id<T: Into<std::string::String>>(
6036 mut self,
6037 v: T,
6038 ) -> Self {
6039 self.0.request.firewall_endpoint_association_id = v.into();
6040 self
6041 }
6042
6043 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6047 where
6048 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6049 {
6050 self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6051 self
6052 }
6053
6054 pub fn set_or_clear_firewall_endpoint_association<T>(
6058 mut self,
6059 v: std::option::Option<T>,
6060 ) -> Self
6061 where
6062 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6063 {
6064 self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6065 self
6066 }
6067
6068 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6070 self.0.request.request_id = v.into();
6071 self
6072 }
6073 }
6074
6075 #[doc(hidden)]
6076 impl crate::RequestBuilder for CreateFirewallEndpointAssociation {
6077 fn request_options(&mut self) -> &mut crate::RequestOptions {
6078 &mut self.0.options
6079 }
6080 }
6081
6082 #[derive(Clone, Debug)]
6100 pub struct DeleteFirewallEndpointAssociation(
6101 RequestBuilder<crate::model::DeleteFirewallEndpointAssociationRequest>,
6102 );
6103
6104 impl DeleteFirewallEndpointAssociation {
6105 pub(crate) fn new(
6106 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6107 ) -> Self {
6108 Self(RequestBuilder::new(stub))
6109 }
6110
6111 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointAssociationRequest>>(
6113 mut self,
6114 v: V,
6115 ) -> Self {
6116 self.0.request = v.into();
6117 self
6118 }
6119
6120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6122 self.0.options = v.into();
6123 self
6124 }
6125
6126 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6133 (*self.0.stub)
6134 .delete_firewall_endpoint_association(self.0.request, self.0.options)
6135 .await
6136 .map(crate::Response::into_body)
6137 }
6138
6139 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6141 type Operation =
6142 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6143 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6144 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6145
6146 let stub = self.0.stub.clone();
6147 let mut options = self.0.options.clone();
6148 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6149 let query = move |name| {
6150 let stub = stub.clone();
6151 let options = options.clone();
6152 async {
6153 let op = GetOperation::new(stub)
6154 .set_name(name)
6155 .with_options(options)
6156 .send()
6157 .await?;
6158 Ok(Operation::new(op))
6159 }
6160 };
6161
6162 let start = move || async {
6163 let op = self.send().await?;
6164 Ok(Operation::new(op))
6165 };
6166
6167 google_cloud_lro::internal::new_unit_response_poller(
6168 polling_error_policy,
6169 polling_backoff_policy,
6170 start,
6171 query,
6172 )
6173 }
6174
6175 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6179 self.0.request.name = v.into();
6180 self
6181 }
6182
6183 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6185 self.0.request.request_id = v.into();
6186 self
6187 }
6188 }
6189
6190 #[doc(hidden)]
6191 impl crate::RequestBuilder for DeleteFirewallEndpointAssociation {
6192 fn request_options(&mut self) -> &mut crate::RequestOptions {
6193 &mut self.0.options
6194 }
6195 }
6196
6197 #[derive(Clone, Debug)]
6215 pub struct UpdateFirewallEndpointAssociation(
6216 RequestBuilder<crate::model::UpdateFirewallEndpointAssociationRequest>,
6217 );
6218
6219 impl UpdateFirewallEndpointAssociation {
6220 pub(crate) fn new(
6221 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6222 ) -> Self {
6223 Self(RequestBuilder::new(stub))
6224 }
6225
6226 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointAssociationRequest>>(
6228 mut self,
6229 v: V,
6230 ) -> Self {
6231 self.0.request = v.into();
6232 self
6233 }
6234
6235 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6237 self.0.options = v.into();
6238 self
6239 }
6240
6241 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6248 (*self.0.stub)
6249 .update_firewall_endpoint_association(self.0.request, self.0.options)
6250 .await
6251 .map(crate::Response::into_body)
6252 }
6253
6254 pub fn poller(
6256 self,
6257 ) -> impl google_cloud_lro::Poller<
6258 crate::model::FirewallEndpointAssociation,
6259 crate::model::OperationMetadata,
6260 > {
6261 type Operation = google_cloud_lro::internal::Operation<
6262 crate::model::FirewallEndpointAssociation,
6263 crate::model::OperationMetadata,
6264 >;
6265 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6266 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6267
6268 let stub = self.0.stub.clone();
6269 let mut options = self.0.options.clone();
6270 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6271 let query = move |name| {
6272 let stub = stub.clone();
6273 let options = options.clone();
6274 async {
6275 let op = GetOperation::new(stub)
6276 .set_name(name)
6277 .with_options(options)
6278 .send()
6279 .await?;
6280 Ok(Operation::new(op))
6281 }
6282 };
6283
6284 let start = move || async {
6285 let op = self.send().await?;
6286 Ok(Operation::new(op))
6287 };
6288
6289 google_cloud_lro::internal::new_poller(
6290 polling_error_policy,
6291 polling_backoff_policy,
6292 start,
6293 query,
6294 )
6295 }
6296
6297 pub fn set_update_mask<T>(mut self, v: T) -> Self
6301 where
6302 T: std::convert::Into<wkt::FieldMask>,
6303 {
6304 self.0.request.update_mask = std::option::Option::Some(v.into());
6305 self
6306 }
6307
6308 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6312 where
6313 T: std::convert::Into<wkt::FieldMask>,
6314 {
6315 self.0.request.update_mask = v.map(|x| x.into());
6316 self
6317 }
6318
6319 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6323 where
6324 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6325 {
6326 self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6327 self
6328 }
6329
6330 pub fn set_or_clear_firewall_endpoint_association<T>(
6334 mut self,
6335 v: std::option::Option<T>,
6336 ) -> Self
6337 where
6338 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6339 {
6340 self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6341 self
6342 }
6343
6344 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6346 self.0.request.request_id = v.into();
6347 self
6348 }
6349 }
6350
6351 #[doc(hidden)]
6352 impl crate::RequestBuilder for UpdateFirewallEndpointAssociation {
6353 fn request_options(&mut self) -> &mut crate::RequestOptions {
6354 &mut self.0.options
6355 }
6356 }
6357
6358 #[derive(Clone, Debug)]
6379 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6380
6381 impl ListLocations {
6382 pub(crate) fn new(
6383 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6384 ) -> Self {
6385 Self(RequestBuilder::new(stub))
6386 }
6387
6388 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6390 mut self,
6391 v: V,
6392 ) -> Self {
6393 self.0.request = v.into();
6394 self
6395 }
6396
6397 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6399 self.0.options = v.into();
6400 self
6401 }
6402
6403 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6405 (*self.0.stub)
6406 .list_locations(self.0.request, self.0.options)
6407 .await
6408 .map(crate::Response::into_body)
6409 }
6410
6411 pub fn by_page(
6413 self,
6414 ) -> impl google_cloud_gax::paginator::Paginator<
6415 google_cloud_location::model::ListLocationsResponse,
6416 crate::Error,
6417 > {
6418 use std::clone::Clone;
6419 let token = self.0.request.page_token.clone();
6420 let execute = move |token: String| {
6421 let mut builder = self.clone();
6422 builder.0.request = builder.0.request.set_page_token(token);
6423 builder.send()
6424 };
6425 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6426 }
6427
6428 pub fn by_item(
6430 self,
6431 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6432 google_cloud_location::model::ListLocationsResponse,
6433 crate::Error,
6434 > {
6435 use google_cloud_gax::paginator::Paginator;
6436 self.by_page().items()
6437 }
6438
6439 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6441 self.0.request.name = v.into();
6442 self
6443 }
6444
6445 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6447 self.0.request.filter = v.into();
6448 self
6449 }
6450
6451 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6453 self.0.request.page_size = v.into();
6454 self
6455 }
6456
6457 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6459 self.0.request.page_token = v.into();
6460 self
6461 }
6462 }
6463
6464 #[doc(hidden)]
6465 impl crate::RequestBuilder for ListLocations {
6466 fn request_options(&mut self) -> &mut crate::RequestOptions {
6467 &mut self.0.options
6468 }
6469 }
6470
6471 #[derive(Clone, Debug)]
6488 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6489
6490 impl GetLocation {
6491 pub(crate) fn new(
6492 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6493 ) -> Self {
6494 Self(RequestBuilder::new(stub))
6495 }
6496
6497 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6499 mut self,
6500 v: V,
6501 ) -> Self {
6502 self.0.request = v.into();
6503 self
6504 }
6505
6506 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6508 self.0.options = v.into();
6509 self
6510 }
6511
6512 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6514 (*self.0.stub)
6515 .get_location(self.0.request, self.0.options)
6516 .await
6517 .map(crate::Response::into_body)
6518 }
6519
6520 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6522 self.0.request.name = v.into();
6523 self
6524 }
6525 }
6526
6527 #[doc(hidden)]
6528 impl crate::RequestBuilder for GetLocation {
6529 fn request_options(&mut self) -> &mut crate::RequestOptions {
6530 &mut self.0.options
6531 }
6532 }
6533
6534 #[derive(Clone, Debug)]
6551 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6552
6553 impl SetIamPolicy {
6554 pub(crate) fn new(
6555 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6556 ) -> Self {
6557 Self(RequestBuilder::new(stub))
6558 }
6559
6560 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6562 mut self,
6563 v: V,
6564 ) -> Self {
6565 self.0.request = v.into();
6566 self
6567 }
6568
6569 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6571 self.0.options = v.into();
6572 self
6573 }
6574
6575 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6577 (*self.0.stub)
6578 .set_iam_policy(self.0.request, self.0.options)
6579 .await
6580 .map(crate::Response::into_body)
6581 }
6582
6583 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6587 self.0.request.resource = v.into();
6588 self
6589 }
6590
6591 pub fn set_policy<T>(mut self, v: T) -> Self
6595 where
6596 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6597 {
6598 self.0.request.policy = std::option::Option::Some(v.into());
6599 self
6600 }
6601
6602 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6606 where
6607 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6608 {
6609 self.0.request.policy = v.map(|x| x.into());
6610 self
6611 }
6612
6613 pub fn set_update_mask<T>(mut self, v: T) -> Self
6615 where
6616 T: std::convert::Into<wkt::FieldMask>,
6617 {
6618 self.0.request.update_mask = std::option::Option::Some(v.into());
6619 self
6620 }
6621
6622 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6624 where
6625 T: std::convert::Into<wkt::FieldMask>,
6626 {
6627 self.0.request.update_mask = v.map(|x| x.into());
6628 self
6629 }
6630 }
6631
6632 #[doc(hidden)]
6633 impl crate::RequestBuilder for SetIamPolicy {
6634 fn request_options(&mut self) -> &mut crate::RequestOptions {
6635 &mut self.0.options
6636 }
6637 }
6638
6639 #[derive(Clone, Debug)]
6656 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6657
6658 impl GetIamPolicy {
6659 pub(crate) fn new(
6660 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6661 ) -> Self {
6662 Self(RequestBuilder::new(stub))
6663 }
6664
6665 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6667 mut self,
6668 v: V,
6669 ) -> Self {
6670 self.0.request = v.into();
6671 self
6672 }
6673
6674 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6676 self.0.options = v.into();
6677 self
6678 }
6679
6680 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6682 (*self.0.stub)
6683 .get_iam_policy(self.0.request, self.0.options)
6684 .await
6685 .map(crate::Response::into_body)
6686 }
6687
6688 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6692 self.0.request.resource = v.into();
6693 self
6694 }
6695
6696 pub fn set_options<T>(mut self, v: T) -> Self
6698 where
6699 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6700 {
6701 self.0.request.options = std::option::Option::Some(v.into());
6702 self
6703 }
6704
6705 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6707 where
6708 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6709 {
6710 self.0.request.options = v.map(|x| x.into());
6711 self
6712 }
6713 }
6714
6715 #[doc(hidden)]
6716 impl crate::RequestBuilder for GetIamPolicy {
6717 fn request_options(&mut self) -> &mut crate::RequestOptions {
6718 &mut self.0.options
6719 }
6720 }
6721
6722 #[derive(Clone, Debug)]
6739 pub struct TestIamPermissions(
6740 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6741 );
6742
6743 impl TestIamPermissions {
6744 pub(crate) fn new(
6745 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6746 ) -> Self {
6747 Self(RequestBuilder::new(stub))
6748 }
6749
6750 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6752 mut self,
6753 v: V,
6754 ) -> Self {
6755 self.0.request = v.into();
6756 self
6757 }
6758
6759 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6761 self.0.options = v.into();
6762 self
6763 }
6764
6765 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6767 (*self.0.stub)
6768 .test_iam_permissions(self.0.request, self.0.options)
6769 .await
6770 .map(crate::Response::into_body)
6771 }
6772
6773 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6777 self.0.request.resource = v.into();
6778 self
6779 }
6780
6781 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6785 where
6786 T: std::iter::IntoIterator<Item = V>,
6787 V: std::convert::Into<std::string::String>,
6788 {
6789 use std::iter::Iterator;
6790 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6791 self
6792 }
6793 }
6794
6795 #[doc(hidden)]
6796 impl crate::RequestBuilder for TestIamPermissions {
6797 fn request_options(&mut self) -> &mut crate::RequestOptions {
6798 &mut self.0.options
6799 }
6800 }
6801
6802 #[derive(Clone, Debug)]
6823 pub struct ListOperations(
6824 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6825 );
6826
6827 impl ListOperations {
6828 pub(crate) fn new(
6829 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6830 ) -> Self {
6831 Self(RequestBuilder::new(stub))
6832 }
6833
6834 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6836 mut self,
6837 v: V,
6838 ) -> Self {
6839 self.0.request = v.into();
6840 self
6841 }
6842
6843 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6845 self.0.options = v.into();
6846 self
6847 }
6848
6849 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6851 (*self.0.stub)
6852 .list_operations(self.0.request, self.0.options)
6853 .await
6854 .map(crate::Response::into_body)
6855 }
6856
6857 pub fn by_page(
6859 self,
6860 ) -> impl google_cloud_gax::paginator::Paginator<
6861 google_cloud_longrunning::model::ListOperationsResponse,
6862 crate::Error,
6863 > {
6864 use std::clone::Clone;
6865 let token = self.0.request.page_token.clone();
6866 let execute = move |token: String| {
6867 let mut builder = self.clone();
6868 builder.0.request = builder.0.request.set_page_token(token);
6869 builder.send()
6870 };
6871 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6872 }
6873
6874 pub fn by_item(
6876 self,
6877 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6878 google_cloud_longrunning::model::ListOperationsResponse,
6879 crate::Error,
6880 > {
6881 use google_cloud_gax::paginator::Paginator;
6882 self.by_page().items()
6883 }
6884
6885 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6887 self.0.request.name = v.into();
6888 self
6889 }
6890
6891 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6893 self.0.request.filter = v.into();
6894 self
6895 }
6896
6897 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6899 self.0.request.page_size = v.into();
6900 self
6901 }
6902
6903 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6905 self.0.request.page_token = v.into();
6906 self
6907 }
6908
6909 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6911 self.0.request.return_partial_success = v.into();
6912 self
6913 }
6914 }
6915
6916 #[doc(hidden)]
6917 impl crate::RequestBuilder for ListOperations {
6918 fn request_options(&mut self) -> &mut crate::RequestOptions {
6919 &mut self.0.options
6920 }
6921 }
6922
6923 #[derive(Clone, Debug)]
6940 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6941
6942 impl GetOperation {
6943 pub(crate) fn new(
6944 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6945 ) -> Self {
6946 Self(RequestBuilder::new(stub))
6947 }
6948
6949 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6951 mut self,
6952 v: V,
6953 ) -> Self {
6954 self.0.request = v.into();
6955 self
6956 }
6957
6958 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6960 self.0.options = v.into();
6961 self
6962 }
6963
6964 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6966 (*self.0.stub)
6967 .get_operation(self.0.request, self.0.options)
6968 .await
6969 .map(crate::Response::into_body)
6970 }
6971
6972 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6974 self.0.request.name = v.into();
6975 self
6976 }
6977 }
6978
6979 #[doc(hidden)]
6980 impl crate::RequestBuilder for GetOperation {
6981 fn request_options(&mut self) -> &mut crate::RequestOptions {
6982 &mut self.0.options
6983 }
6984 }
6985
6986 #[derive(Clone, Debug)]
7003 pub struct DeleteOperation(
7004 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7005 );
7006
7007 impl DeleteOperation {
7008 pub(crate) fn new(
7009 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7010 ) -> Self {
7011 Self(RequestBuilder::new(stub))
7012 }
7013
7014 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7016 mut self,
7017 v: V,
7018 ) -> Self {
7019 self.0.request = v.into();
7020 self
7021 }
7022
7023 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7025 self.0.options = v.into();
7026 self
7027 }
7028
7029 pub async fn send(self) -> Result<()> {
7031 (*self.0.stub)
7032 .delete_operation(self.0.request, self.0.options)
7033 .await
7034 .map(crate::Response::into_body)
7035 }
7036
7037 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7039 self.0.request.name = v.into();
7040 self
7041 }
7042 }
7043
7044 #[doc(hidden)]
7045 impl crate::RequestBuilder for DeleteOperation {
7046 fn request_options(&mut self) -> &mut crate::RequestOptions {
7047 &mut self.0.options
7048 }
7049 }
7050
7051 #[derive(Clone, Debug)]
7068 pub struct CancelOperation(
7069 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7070 );
7071
7072 impl CancelOperation {
7073 pub(crate) fn new(
7074 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7075 ) -> Self {
7076 Self(RequestBuilder::new(stub))
7077 }
7078
7079 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7081 mut self,
7082 v: V,
7083 ) -> Self {
7084 self.0.request = v.into();
7085 self
7086 }
7087
7088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7090 self.0.options = v.into();
7091 self
7092 }
7093
7094 pub async fn send(self) -> Result<()> {
7096 (*self.0.stub)
7097 .cancel_operation(self.0.request, self.0.options)
7098 .await
7099 .map(crate::Response::into_body)
7100 }
7101
7102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7104 self.0.request.name = v.into();
7105 self
7106 }
7107 }
7108
7109 #[doc(hidden)]
7110 impl crate::RequestBuilder for CancelOperation {
7111 fn request_options(&mut self) -> &mut crate::RequestOptions {
7112 &mut self.0.options
7113 }
7114 }
7115}
7116
7117pub mod intercept {
7119 use crate::Result;
7120
7121 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7135
7136 pub(crate) mod client {
7137 use super::super::super::client::Intercept;
7138 pub struct Factory;
7139 impl crate::ClientFactory for Factory {
7140 type Client = Intercept;
7141 type Credentials = gaxi::options::Credentials;
7142 async fn build(
7143 self,
7144 config: gaxi::options::ClientConfig,
7145 ) -> crate::ClientBuilderResult<Self::Client> {
7146 Self::Client::new(config).await
7147 }
7148 }
7149 }
7150
7151 #[derive(Clone, Debug)]
7153 pub(crate) struct RequestBuilder<R: std::default::Default> {
7154 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7155 request: R,
7156 options: crate::RequestOptions,
7157 }
7158
7159 impl<R> RequestBuilder<R>
7160 where
7161 R: std::default::Default,
7162 {
7163 pub(crate) fn new(
7164 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7165 ) -> Self {
7166 Self {
7167 stub,
7168 request: R::default(),
7169 options: crate::RequestOptions::default(),
7170 }
7171 }
7172 }
7173
7174 #[derive(Clone, Debug)]
7195 pub struct ListInterceptEndpointGroups(
7196 RequestBuilder<crate::model::ListInterceptEndpointGroupsRequest>,
7197 );
7198
7199 impl ListInterceptEndpointGroups {
7200 pub(crate) fn new(
7201 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7202 ) -> Self {
7203 Self(RequestBuilder::new(stub))
7204 }
7205
7206 pub fn with_request<V: Into<crate::model::ListInterceptEndpointGroupsRequest>>(
7208 mut self,
7209 v: V,
7210 ) -> Self {
7211 self.0.request = v.into();
7212 self
7213 }
7214
7215 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7217 self.0.options = v.into();
7218 self
7219 }
7220
7221 pub async fn send(self) -> Result<crate::model::ListInterceptEndpointGroupsResponse> {
7223 (*self.0.stub)
7224 .list_intercept_endpoint_groups(self.0.request, self.0.options)
7225 .await
7226 .map(crate::Response::into_body)
7227 }
7228
7229 pub fn by_page(
7231 self,
7232 ) -> impl google_cloud_gax::paginator::Paginator<
7233 crate::model::ListInterceptEndpointGroupsResponse,
7234 crate::Error,
7235 > {
7236 use std::clone::Clone;
7237 let token = self.0.request.page_token.clone();
7238 let execute = move |token: String| {
7239 let mut builder = self.clone();
7240 builder.0.request = builder.0.request.set_page_token(token);
7241 builder.send()
7242 };
7243 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7244 }
7245
7246 pub fn by_item(
7248 self,
7249 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7250 crate::model::ListInterceptEndpointGroupsResponse,
7251 crate::Error,
7252 > {
7253 use google_cloud_gax::paginator::Paginator;
7254 self.by_page().items()
7255 }
7256
7257 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7261 self.0.request.parent = v.into();
7262 self
7263 }
7264
7265 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7267 self.0.request.page_size = v.into();
7268 self
7269 }
7270
7271 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7273 self.0.request.page_token = v.into();
7274 self
7275 }
7276
7277 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7279 self.0.request.filter = v.into();
7280 self
7281 }
7282
7283 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7285 self.0.request.order_by = v.into();
7286 self
7287 }
7288 }
7289
7290 #[doc(hidden)]
7291 impl crate::RequestBuilder for ListInterceptEndpointGroups {
7292 fn request_options(&mut self) -> &mut crate::RequestOptions {
7293 &mut self.0.options
7294 }
7295 }
7296
7297 #[derive(Clone, Debug)]
7314 pub struct GetInterceptEndpointGroup(
7315 RequestBuilder<crate::model::GetInterceptEndpointGroupRequest>,
7316 );
7317
7318 impl GetInterceptEndpointGroup {
7319 pub(crate) fn new(
7320 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7321 ) -> Self {
7322 Self(RequestBuilder::new(stub))
7323 }
7324
7325 pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupRequest>>(
7327 mut self,
7328 v: V,
7329 ) -> Self {
7330 self.0.request = v.into();
7331 self
7332 }
7333
7334 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7336 self.0.options = v.into();
7337 self
7338 }
7339
7340 pub async fn send(self) -> Result<crate::model::InterceptEndpointGroup> {
7342 (*self.0.stub)
7343 .get_intercept_endpoint_group(self.0.request, self.0.options)
7344 .await
7345 .map(crate::Response::into_body)
7346 }
7347
7348 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7352 self.0.request.name = v.into();
7353 self
7354 }
7355 }
7356
7357 #[doc(hidden)]
7358 impl crate::RequestBuilder for GetInterceptEndpointGroup {
7359 fn request_options(&mut self) -> &mut crate::RequestOptions {
7360 &mut self.0.options
7361 }
7362 }
7363
7364 #[derive(Clone, Debug)]
7382 pub struct CreateInterceptEndpointGroup(
7383 RequestBuilder<crate::model::CreateInterceptEndpointGroupRequest>,
7384 );
7385
7386 impl CreateInterceptEndpointGroup {
7387 pub(crate) fn new(
7388 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7389 ) -> Self {
7390 Self(RequestBuilder::new(stub))
7391 }
7392
7393 pub fn with_request<V: Into<crate::model::CreateInterceptEndpointGroupRequest>>(
7395 mut self,
7396 v: V,
7397 ) -> Self {
7398 self.0.request = v.into();
7399 self
7400 }
7401
7402 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7404 self.0.options = v.into();
7405 self
7406 }
7407
7408 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7415 (*self.0.stub)
7416 .create_intercept_endpoint_group(self.0.request, self.0.options)
7417 .await
7418 .map(crate::Response::into_body)
7419 }
7420
7421 pub fn poller(
7423 self,
7424 ) -> impl google_cloud_lro::Poller<
7425 crate::model::InterceptEndpointGroup,
7426 crate::model::OperationMetadata,
7427 > {
7428 type Operation = google_cloud_lro::internal::Operation<
7429 crate::model::InterceptEndpointGroup,
7430 crate::model::OperationMetadata,
7431 >;
7432 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7433 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7434
7435 let stub = self.0.stub.clone();
7436 let mut options = self.0.options.clone();
7437 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7438 let query = move |name| {
7439 let stub = stub.clone();
7440 let options = options.clone();
7441 async {
7442 let op = GetOperation::new(stub)
7443 .set_name(name)
7444 .with_options(options)
7445 .send()
7446 .await?;
7447 Ok(Operation::new(op))
7448 }
7449 };
7450
7451 let start = move || async {
7452 let op = self.send().await?;
7453 Ok(Operation::new(op))
7454 };
7455
7456 google_cloud_lro::internal::new_poller(
7457 polling_error_policy,
7458 polling_backoff_policy,
7459 start,
7460 query,
7461 )
7462 }
7463
7464 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7468 self.0.request.parent = v.into();
7469 self
7470 }
7471
7472 pub fn set_intercept_endpoint_group_id<T: Into<std::string::String>>(
7476 mut self,
7477 v: T,
7478 ) -> Self {
7479 self.0.request.intercept_endpoint_group_id = v.into();
7480 self
7481 }
7482
7483 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
7487 where
7488 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7489 {
7490 self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
7491 self
7492 }
7493
7494 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
7498 where
7499 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7500 {
7501 self.0.request.intercept_endpoint_group = v.map(|x| x.into());
7502 self
7503 }
7504
7505 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7507 self.0.request.request_id = v.into();
7508 self
7509 }
7510 }
7511
7512 #[doc(hidden)]
7513 impl crate::RequestBuilder for CreateInterceptEndpointGroup {
7514 fn request_options(&mut self) -> &mut crate::RequestOptions {
7515 &mut self.0.options
7516 }
7517 }
7518
7519 #[derive(Clone, Debug)]
7537 pub struct UpdateInterceptEndpointGroup(
7538 RequestBuilder<crate::model::UpdateInterceptEndpointGroupRequest>,
7539 );
7540
7541 impl UpdateInterceptEndpointGroup {
7542 pub(crate) fn new(
7543 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7544 ) -> Self {
7545 Self(RequestBuilder::new(stub))
7546 }
7547
7548 pub fn with_request<V: Into<crate::model::UpdateInterceptEndpointGroupRequest>>(
7550 mut self,
7551 v: V,
7552 ) -> Self {
7553 self.0.request = v.into();
7554 self
7555 }
7556
7557 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7559 self.0.options = v.into();
7560 self
7561 }
7562
7563 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7570 (*self.0.stub)
7571 .update_intercept_endpoint_group(self.0.request, self.0.options)
7572 .await
7573 .map(crate::Response::into_body)
7574 }
7575
7576 pub fn poller(
7578 self,
7579 ) -> impl google_cloud_lro::Poller<
7580 crate::model::InterceptEndpointGroup,
7581 crate::model::OperationMetadata,
7582 > {
7583 type Operation = google_cloud_lro::internal::Operation<
7584 crate::model::InterceptEndpointGroup,
7585 crate::model::OperationMetadata,
7586 >;
7587 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7588 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7589
7590 let stub = self.0.stub.clone();
7591 let mut options = self.0.options.clone();
7592 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7593 let query = move |name| {
7594 let stub = stub.clone();
7595 let options = options.clone();
7596 async {
7597 let op = GetOperation::new(stub)
7598 .set_name(name)
7599 .with_options(options)
7600 .send()
7601 .await?;
7602 Ok(Operation::new(op))
7603 }
7604 };
7605
7606 let start = move || async {
7607 let op = self.send().await?;
7608 Ok(Operation::new(op))
7609 };
7610
7611 google_cloud_lro::internal::new_poller(
7612 polling_error_policy,
7613 polling_backoff_policy,
7614 start,
7615 query,
7616 )
7617 }
7618
7619 pub fn set_update_mask<T>(mut self, v: T) -> Self
7621 where
7622 T: std::convert::Into<wkt::FieldMask>,
7623 {
7624 self.0.request.update_mask = std::option::Option::Some(v.into());
7625 self
7626 }
7627
7628 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7630 where
7631 T: std::convert::Into<wkt::FieldMask>,
7632 {
7633 self.0.request.update_mask = v.map(|x| x.into());
7634 self
7635 }
7636
7637 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
7641 where
7642 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7643 {
7644 self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
7645 self
7646 }
7647
7648 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
7652 where
7653 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7654 {
7655 self.0.request.intercept_endpoint_group = v.map(|x| x.into());
7656 self
7657 }
7658
7659 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7661 self.0.request.request_id = v.into();
7662 self
7663 }
7664 }
7665
7666 #[doc(hidden)]
7667 impl crate::RequestBuilder for UpdateInterceptEndpointGroup {
7668 fn request_options(&mut self) -> &mut crate::RequestOptions {
7669 &mut self.0.options
7670 }
7671 }
7672
7673 #[derive(Clone, Debug)]
7691 pub struct DeleteInterceptEndpointGroup(
7692 RequestBuilder<crate::model::DeleteInterceptEndpointGroupRequest>,
7693 );
7694
7695 impl DeleteInterceptEndpointGroup {
7696 pub(crate) fn new(
7697 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7698 ) -> Self {
7699 Self(RequestBuilder::new(stub))
7700 }
7701
7702 pub fn with_request<V: Into<crate::model::DeleteInterceptEndpointGroupRequest>>(
7704 mut self,
7705 v: V,
7706 ) -> Self {
7707 self.0.request = v.into();
7708 self
7709 }
7710
7711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7713 self.0.options = v.into();
7714 self
7715 }
7716
7717 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7724 (*self.0.stub)
7725 .delete_intercept_endpoint_group(self.0.request, self.0.options)
7726 .await
7727 .map(crate::Response::into_body)
7728 }
7729
7730 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7732 type Operation =
7733 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7734 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7735 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7736
7737 let stub = self.0.stub.clone();
7738 let mut options = self.0.options.clone();
7739 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7740 let query = move |name| {
7741 let stub = stub.clone();
7742 let options = options.clone();
7743 async {
7744 let op = GetOperation::new(stub)
7745 .set_name(name)
7746 .with_options(options)
7747 .send()
7748 .await?;
7749 Ok(Operation::new(op))
7750 }
7751 };
7752
7753 let start = move || async {
7754 let op = self.send().await?;
7755 Ok(Operation::new(op))
7756 };
7757
7758 google_cloud_lro::internal::new_unit_response_poller(
7759 polling_error_policy,
7760 polling_backoff_policy,
7761 start,
7762 query,
7763 )
7764 }
7765
7766 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7770 self.0.request.name = v.into();
7771 self
7772 }
7773
7774 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7776 self.0.request.request_id = v.into();
7777 self
7778 }
7779 }
7780
7781 #[doc(hidden)]
7782 impl crate::RequestBuilder for DeleteInterceptEndpointGroup {
7783 fn request_options(&mut self) -> &mut crate::RequestOptions {
7784 &mut self.0.options
7785 }
7786 }
7787
7788 #[derive(Clone, Debug)]
7809 pub struct ListInterceptEndpointGroupAssociations(
7810 RequestBuilder<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
7811 );
7812
7813 impl ListInterceptEndpointGroupAssociations {
7814 pub(crate) fn new(
7815 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7816 ) -> Self {
7817 Self(RequestBuilder::new(stub))
7818 }
7819
7820 pub fn with_request<
7822 V: Into<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
7823 >(
7824 mut self,
7825 v: V,
7826 ) -> Self {
7827 self.0.request = v.into();
7828 self
7829 }
7830
7831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7833 self.0.options = v.into();
7834 self
7835 }
7836
7837 pub async fn send(
7839 self,
7840 ) -> Result<crate::model::ListInterceptEndpointGroupAssociationsResponse> {
7841 (*self.0.stub)
7842 .list_intercept_endpoint_group_associations(self.0.request, self.0.options)
7843 .await
7844 .map(crate::Response::into_body)
7845 }
7846
7847 pub fn by_page(
7849 self,
7850 ) -> impl google_cloud_gax::paginator::Paginator<
7851 crate::model::ListInterceptEndpointGroupAssociationsResponse,
7852 crate::Error,
7853 > {
7854 use std::clone::Clone;
7855 let token = self.0.request.page_token.clone();
7856 let execute = move |token: String| {
7857 let mut builder = self.clone();
7858 builder.0.request = builder.0.request.set_page_token(token);
7859 builder.send()
7860 };
7861 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7862 }
7863
7864 pub fn by_item(
7866 self,
7867 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7868 crate::model::ListInterceptEndpointGroupAssociationsResponse,
7869 crate::Error,
7870 > {
7871 use google_cloud_gax::paginator::Paginator;
7872 self.by_page().items()
7873 }
7874
7875 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7879 self.0.request.parent = v.into();
7880 self
7881 }
7882
7883 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7885 self.0.request.page_size = v.into();
7886 self
7887 }
7888
7889 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7891 self.0.request.page_token = v.into();
7892 self
7893 }
7894
7895 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7897 self.0.request.filter = v.into();
7898 self
7899 }
7900
7901 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7903 self.0.request.order_by = v.into();
7904 self
7905 }
7906 }
7907
7908 #[doc(hidden)]
7909 impl crate::RequestBuilder for ListInterceptEndpointGroupAssociations {
7910 fn request_options(&mut self) -> &mut crate::RequestOptions {
7911 &mut self.0.options
7912 }
7913 }
7914
7915 #[derive(Clone, Debug)]
7932 pub struct GetInterceptEndpointGroupAssociation(
7933 RequestBuilder<crate::model::GetInterceptEndpointGroupAssociationRequest>,
7934 );
7935
7936 impl GetInterceptEndpointGroupAssociation {
7937 pub(crate) fn new(
7938 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7939 ) -> Self {
7940 Self(RequestBuilder::new(stub))
7941 }
7942
7943 pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupAssociationRequest>>(
7945 mut self,
7946 v: V,
7947 ) -> Self {
7948 self.0.request = v.into();
7949 self
7950 }
7951
7952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7954 self.0.options = v.into();
7955 self
7956 }
7957
7958 pub async fn send(self) -> Result<crate::model::InterceptEndpointGroupAssociation> {
7960 (*self.0.stub)
7961 .get_intercept_endpoint_group_association(self.0.request, self.0.options)
7962 .await
7963 .map(crate::Response::into_body)
7964 }
7965
7966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7970 self.0.request.name = v.into();
7971 self
7972 }
7973 }
7974
7975 #[doc(hidden)]
7976 impl crate::RequestBuilder for GetInterceptEndpointGroupAssociation {
7977 fn request_options(&mut self) -> &mut crate::RequestOptions {
7978 &mut self.0.options
7979 }
7980 }
7981
7982 #[derive(Clone, Debug)]
8000 pub struct CreateInterceptEndpointGroupAssociation(
8001 RequestBuilder<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8002 );
8003
8004 impl CreateInterceptEndpointGroupAssociation {
8005 pub(crate) fn new(
8006 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8007 ) -> Self {
8008 Self(RequestBuilder::new(stub))
8009 }
8010
8011 pub fn with_request<
8013 V: Into<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8014 >(
8015 mut self,
8016 v: V,
8017 ) -> Self {
8018 self.0.request = v.into();
8019 self
8020 }
8021
8022 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8024 self.0.options = v.into();
8025 self
8026 }
8027
8028 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8035 (*self.0.stub)
8036 .create_intercept_endpoint_group_association(self.0.request, self.0.options)
8037 .await
8038 .map(crate::Response::into_body)
8039 }
8040
8041 pub fn poller(
8043 self,
8044 ) -> impl google_cloud_lro::Poller<
8045 crate::model::InterceptEndpointGroupAssociation,
8046 crate::model::OperationMetadata,
8047 > {
8048 type Operation = google_cloud_lro::internal::Operation<
8049 crate::model::InterceptEndpointGroupAssociation,
8050 crate::model::OperationMetadata,
8051 >;
8052 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8053 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8054
8055 let stub = self.0.stub.clone();
8056 let mut options = self.0.options.clone();
8057 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8058 let query = move |name| {
8059 let stub = stub.clone();
8060 let options = options.clone();
8061 async {
8062 let op = GetOperation::new(stub)
8063 .set_name(name)
8064 .with_options(options)
8065 .send()
8066 .await?;
8067 Ok(Operation::new(op))
8068 }
8069 };
8070
8071 let start = move || async {
8072 let op = self.send().await?;
8073 Ok(Operation::new(op))
8074 };
8075
8076 google_cloud_lro::internal::new_poller(
8077 polling_error_policy,
8078 polling_backoff_policy,
8079 start,
8080 query,
8081 )
8082 }
8083
8084 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8088 self.0.request.parent = v.into();
8089 self
8090 }
8091
8092 pub fn set_intercept_endpoint_group_association_id<T: Into<std::string::String>>(
8094 mut self,
8095 v: T,
8096 ) -> Self {
8097 self.0.request.intercept_endpoint_group_association_id = v.into();
8098 self
8099 }
8100
8101 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8105 where
8106 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8107 {
8108 self.0.request.intercept_endpoint_group_association =
8109 std::option::Option::Some(v.into());
8110 self
8111 }
8112
8113 pub fn set_or_clear_intercept_endpoint_group_association<T>(
8117 mut self,
8118 v: std::option::Option<T>,
8119 ) -> Self
8120 where
8121 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8122 {
8123 self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8124 self
8125 }
8126
8127 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8129 self.0.request.request_id = v.into();
8130 self
8131 }
8132 }
8133
8134 #[doc(hidden)]
8135 impl crate::RequestBuilder for CreateInterceptEndpointGroupAssociation {
8136 fn request_options(&mut self) -> &mut crate::RequestOptions {
8137 &mut self.0.options
8138 }
8139 }
8140
8141 #[derive(Clone, Debug)]
8159 pub struct UpdateInterceptEndpointGroupAssociation(
8160 RequestBuilder<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8161 );
8162
8163 impl UpdateInterceptEndpointGroupAssociation {
8164 pub(crate) fn new(
8165 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8166 ) -> Self {
8167 Self(RequestBuilder::new(stub))
8168 }
8169
8170 pub fn with_request<
8172 V: Into<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8173 >(
8174 mut self,
8175 v: V,
8176 ) -> Self {
8177 self.0.request = v.into();
8178 self
8179 }
8180
8181 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8183 self.0.options = v.into();
8184 self
8185 }
8186
8187 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8194 (*self.0.stub)
8195 .update_intercept_endpoint_group_association(self.0.request, self.0.options)
8196 .await
8197 .map(crate::Response::into_body)
8198 }
8199
8200 pub fn poller(
8202 self,
8203 ) -> impl google_cloud_lro::Poller<
8204 crate::model::InterceptEndpointGroupAssociation,
8205 crate::model::OperationMetadata,
8206 > {
8207 type Operation = google_cloud_lro::internal::Operation<
8208 crate::model::InterceptEndpointGroupAssociation,
8209 crate::model::OperationMetadata,
8210 >;
8211 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8212 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8213
8214 let stub = self.0.stub.clone();
8215 let mut options = self.0.options.clone();
8216 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8217 let query = move |name| {
8218 let stub = stub.clone();
8219 let options = options.clone();
8220 async {
8221 let op = GetOperation::new(stub)
8222 .set_name(name)
8223 .with_options(options)
8224 .send()
8225 .await?;
8226 Ok(Operation::new(op))
8227 }
8228 };
8229
8230 let start = move || async {
8231 let op = self.send().await?;
8232 Ok(Operation::new(op))
8233 };
8234
8235 google_cloud_lro::internal::new_poller(
8236 polling_error_policy,
8237 polling_backoff_policy,
8238 start,
8239 query,
8240 )
8241 }
8242
8243 pub fn set_update_mask<T>(mut self, v: T) -> Self
8245 where
8246 T: std::convert::Into<wkt::FieldMask>,
8247 {
8248 self.0.request.update_mask = std::option::Option::Some(v.into());
8249 self
8250 }
8251
8252 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8254 where
8255 T: std::convert::Into<wkt::FieldMask>,
8256 {
8257 self.0.request.update_mask = v.map(|x| x.into());
8258 self
8259 }
8260
8261 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8265 where
8266 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8267 {
8268 self.0.request.intercept_endpoint_group_association =
8269 std::option::Option::Some(v.into());
8270 self
8271 }
8272
8273 pub fn set_or_clear_intercept_endpoint_group_association<T>(
8277 mut self,
8278 v: std::option::Option<T>,
8279 ) -> Self
8280 where
8281 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8282 {
8283 self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8284 self
8285 }
8286
8287 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8289 self.0.request.request_id = v.into();
8290 self
8291 }
8292 }
8293
8294 #[doc(hidden)]
8295 impl crate::RequestBuilder for UpdateInterceptEndpointGroupAssociation {
8296 fn request_options(&mut self) -> &mut crate::RequestOptions {
8297 &mut self.0.options
8298 }
8299 }
8300
8301 #[derive(Clone, Debug)]
8319 pub struct DeleteInterceptEndpointGroupAssociation(
8320 RequestBuilder<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8321 );
8322
8323 impl DeleteInterceptEndpointGroupAssociation {
8324 pub(crate) fn new(
8325 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8326 ) -> Self {
8327 Self(RequestBuilder::new(stub))
8328 }
8329
8330 pub fn with_request<
8332 V: Into<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8333 >(
8334 mut self,
8335 v: V,
8336 ) -> Self {
8337 self.0.request = v.into();
8338 self
8339 }
8340
8341 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8343 self.0.options = v.into();
8344 self
8345 }
8346
8347 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8354 (*self.0.stub)
8355 .delete_intercept_endpoint_group_association(self.0.request, self.0.options)
8356 .await
8357 .map(crate::Response::into_body)
8358 }
8359
8360 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8362 type Operation =
8363 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8364 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8365 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8366
8367 let stub = self.0.stub.clone();
8368 let mut options = self.0.options.clone();
8369 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8370 let query = move |name| {
8371 let stub = stub.clone();
8372 let options = options.clone();
8373 async {
8374 let op = GetOperation::new(stub)
8375 .set_name(name)
8376 .with_options(options)
8377 .send()
8378 .await?;
8379 Ok(Operation::new(op))
8380 }
8381 };
8382
8383 let start = move || async {
8384 let op = self.send().await?;
8385 Ok(Operation::new(op))
8386 };
8387
8388 google_cloud_lro::internal::new_unit_response_poller(
8389 polling_error_policy,
8390 polling_backoff_policy,
8391 start,
8392 query,
8393 )
8394 }
8395
8396 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8400 self.0.request.name = v.into();
8401 self
8402 }
8403
8404 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8406 self.0.request.request_id = v.into();
8407 self
8408 }
8409 }
8410
8411 #[doc(hidden)]
8412 impl crate::RequestBuilder for DeleteInterceptEndpointGroupAssociation {
8413 fn request_options(&mut self) -> &mut crate::RequestOptions {
8414 &mut self.0.options
8415 }
8416 }
8417
8418 #[derive(Clone, Debug)]
8439 pub struct ListInterceptDeploymentGroups(
8440 RequestBuilder<crate::model::ListInterceptDeploymentGroupsRequest>,
8441 );
8442
8443 impl ListInterceptDeploymentGroups {
8444 pub(crate) fn new(
8445 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8446 ) -> Self {
8447 Self(RequestBuilder::new(stub))
8448 }
8449
8450 pub fn with_request<V: Into<crate::model::ListInterceptDeploymentGroupsRequest>>(
8452 mut self,
8453 v: V,
8454 ) -> Self {
8455 self.0.request = v.into();
8456 self
8457 }
8458
8459 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8461 self.0.options = v.into();
8462 self
8463 }
8464
8465 pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentGroupsResponse> {
8467 (*self.0.stub)
8468 .list_intercept_deployment_groups(self.0.request, self.0.options)
8469 .await
8470 .map(crate::Response::into_body)
8471 }
8472
8473 pub fn by_page(
8475 self,
8476 ) -> impl google_cloud_gax::paginator::Paginator<
8477 crate::model::ListInterceptDeploymentGroupsResponse,
8478 crate::Error,
8479 > {
8480 use std::clone::Clone;
8481 let token = self.0.request.page_token.clone();
8482 let execute = move |token: String| {
8483 let mut builder = self.clone();
8484 builder.0.request = builder.0.request.set_page_token(token);
8485 builder.send()
8486 };
8487 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8488 }
8489
8490 pub fn by_item(
8492 self,
8493 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8494 crate::model::ListInterceptDeploymentGroupsResponse,
8495 crate::Error,
8496 > {
8497 use google_cloud_gax::paginator::Paginator;
8498 self.by_page().items()
8499 }
8500
8501 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8505 self.0.request.parent = v.into();
8506 self
8507 }
8508
8509 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8511 self.0.request.page_size = v.into();
8512 self
8513 }
8514
8515 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8517 self.0.request.page_token = v.into();
8518 self
8519 }
8520
8521 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8523 self.0.request.filter = v.into();
8524 self
8525 }
8526
8527 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8529 self.0.request.order_by = v.into();
8530 self
8531 }
8532 }
8533
8534 #[doc(hidden)]
8535 impl crate::RequestBuilder for ListInterceptDeploymentGroups {
8536 fn request_options(&mut self) -> &mut crate::RequestOptions {
8537 &mut self.0.options
8538 }
8539 }
8540
8541 #[derive(Clone, Debug)]
8558 pub struct GetInterceptDeploymentGroup(
8559 RequestBuilder<crate::model::GetInterceptDeploymentGroupRequest>,
8560 );
8561
8562 impl GetInterceptDeploymentGroup {
8563 pub(crate) fn new(
8564 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8565 ) -> Self {
8566 Self(RequestBuilder::new(stub))
8567 }
8568
8569 pub fn with_request<V: Into<crate::model::GetInterceptDeploymentGroupRequest>>(
8571 mut self,
8572 v: V,
8573 ) -> Self {
8574 self.0.request = v.into();
8575 self
8576 }
8577
8578 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8580 self.0.options = v.into();
8581 self
8582 }
8583
8584 pub async fn send(self) -> Result<crate::model::InterceptDeploymentGroup> {
8586 (*self.0.stub)
8587 .get_intercept_deployment_group(self.0.request, self.0.options)
8588 .await
8589 .map(crate::Response::into_body)
8590 }
8591
8592 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8596 self.0.request.name = v.into();
8597 self
8598 }
8599 }
8600
8601 #[doc(hidden)]
8602 impl crate::RequestBuilder for GetInterceptDeploymentGroup {
8603 fn request_options(&mut self) -> &mut crate::RequestOptions {
8604 &mut self.0.options
8605 }
8606 }
8607
8608 #[derive(Clone, Debug)]
8626 pub struct CreateInterceptDeploymentGroup(
8627 RequestBuilder<crate::model::CreateInterceptDeploymentGroupRequest>,
8628 );
8629
8630 impl CreateInterceptDeploymentGroup {
8631 pub(crate) fn new(
8632 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8633 ) -> Self {
8634 Self(RequestBuilder::new(stub))
8635 }
8636
8637 pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentGroupRequest>>(
8639 mut self,
8640 v: V,
8641 ) -> Self {
8642 self.0.request = v.into();
8643 self
8644 }
8645
8646 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8648 self.0.options = v.into();
8649 self
8650 }
8651
8652 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8659 (*self.0.stub)
8660 .create_intercept_deployment_group(self.0.request, self.0.options)
8661 .await
8662 .map(crate::Response::into_body)
8663 }
8664
8665 pub fn poller(
8667 self,
8668 ) -> impl google_cloud_lro::Poller<
8669 crate::model::InterceptDeploymentGroup,
8670 crate::model::OperationMetadata,
8671 > {
8672 type Operation = google_cloud_lro::internal::Operation<
8673 crate::model::InterceptDeploymentGroup,
8674 crate::model::OperationMetadata,
8675 >;
8676 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8677 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8678
8679 let stub = self.0.stub.clone();
8680 let mut options = self.0.options.clone();
8681 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8682 let query = move |name| {
8683 let stub = stub.clone();
8684 let options = options.clone();
8685 async {
8686 let op = GetOperation::new(stub)
8687 .set_name(name)
8688 .with_options(options)
8689 .send()
8690 .await?;
8691 Ok(Operation::new(op))
8692 }
8693 };
8694
8695 let start = move || async {
8696 let op = self.send().await?;
8697 Ok(Operation::new(op))
8698 };
8699
8700 google_cloud_lro::internal::new_poller(
8701 polling_error_policy,
8702 polling_backoff_policy,
8703 start,
8704 query,
8705 )
8706 }
8707
8708 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712 self.0.request.parent = v.into();
8713 self
8714 }
8715
8716 pub fn set_intercept_deployment_group_id<T: Into<std::string::String>>(
8720 mut self,
8721 v: T,
8722 ) -> Self {
8723 self.0.request.intercept_deployment_group_id = v.into();
8724 self
8725 }
8726
8727 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
8731 where
8732 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8733 {
8734 self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
8735 self
8736 }
8737
8738 pub fn set_or_clear_intercept_deployment_group<T>(
8742 mut self,
8743 v: std::option::Option<T>,
8744 ) -> Self
8745 where
8746 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8747 {
8748 self.0.request.intercept_deployment_group = v.map(|x| x.into());
8749 self
8750 }
8751
8752 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8754 self.0.request.request_id = v.into();
8755 self
8756 }
8757 }
8758
8759 #[doc(hidden)]
8760 impl crate::RequestBuilder for CreateInterceptDeploymentGroup {
8761 fn request_options(&mut self) -> &mut crate::RequestOptions {
8762 &mut self.0.options
8763 }
8764 }
8765
8766 #[derive(Clone, Debug)]
8784 pub struct UpdateInterceptDeploymentGroup(
8785 RequestBuilder<crate::model::UpdateInterceptDeploymentGroupRequest>,
8786 );
8787
8788 impl UpdateInterceptDeploymentGroup {
8789 pub(crate) fn new(
8790 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8791 ) -> Self {
8792 Self(RequestBuilder::new(stub))
8793 }
8794
8795 pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentGroupRequest>>(
8797 mut self,
8798 v: V,
8799 ) -> Self {
8800 self.0.request = v.into();
8801 self
8802 }
8803
8804 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8806 self.0.options = v.into();
8807 self
8808 }
8809
8810 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8817 (*self.0.stub)
8818 .update_intercept_deployment_group(self.0.request, self.0.options)
8819 .await
8820 .map(crate::Response::into_body)
8821 }
8822
8823 pub fn poller(
8825 self,
8826 ) -> impl google_cloud_lro::Poller<
8827 crate::model::InterceptDeploymentGroup,
8828 crate::model::OperationMetadata,
8829 > {
8830 type Operation = google_cloud_lro::internal::Operation<
8831 crate::model::InterceptDeploymentGroup,
8832 crate::model::OperationMetadata,
8833 >;
8834 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8835 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8836
8837 let stub = self.0.stub.clone();
8838 let mut options = self.0.options.clone();
8839 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8840 let query = move |name| {
8841 let stub = stub.clone();
8842 let options = options.clone();
8843 async {
8844 let op = GetOperation::new(stub)
8845 .set_name(name)
8846 .with_options(options)
8847 .send()
8848 .await?;
8849 Ok(Operation::new(op))
8850 }
8851 };
8852
8853 let start = move || async {
8854 let op = self.send().await?;
8855 Ok(Operation::new(op))
8856 };
8857
8858 google_cloud_lro::internal::new_poller(
8859 polling_error_policy,
8860 polling_backoff_policy,
8861 start,
8862 query,
8863 )
8864 }
8865
8866 pub fn set_update_mask<T>(mut self, v: T) -> Self
8868 where
8869 T: std::convert::Into<wkt::FieldMask>,
8870 {
8871 self.0.request.update_mask = std::option::Option::Some(v.into());
8872 self
8873 }
8874
8875 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8877 where
8878 T: std::convert::Into<wkt::FieldMask>,
8879 {
8880 self.0.request.update_mask = v.map(|x| x.into());
8881 self
8882 }
8883
8884 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
8888 where
8889 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8890 {
8891 self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
8892 self
8893 }
8894
8895 pub fn set_or_clear_intercept_deployment_group<T>(
8899 mut self,
8900 v: std::option::Option<T>,
8901 ) -> Self
8902 where
8903 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8904 {
8905 self.0.request.intercept_deployment_group = v.map(|x| x.into());
8906 self
8907 }
8908
8909 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8911 self.0.request.request_id = v.into();
8912 self
8913 }
8914 }
8915
8916 #[doc(hidden)]
8917 impl crate::RequestBuilder for UpdateInterceptDeploymentGroup {
8918 fn request_options(&mut self) -> &mut crate::RequestOptions {
8919 &mut self.0.options
8920 }
8921 }
8922
8923 #[derive(Clone, Debug)]
8941 pub struct DeleteInterceptDeploymentGroup(
8942 RequestBuilder<crate::model::DeleteInterceptDeploymentGroupRequest>,
8943 );
8944
8945 impl DeleteInterceptDeploymentGroup {
8946 pub(crate) fn new(
8947 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8948 ) -> Self {
8949 Self(RequestBuilder::new(stub))
8950 }
8951
8952 pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentGroupRequest>>(
8954 mut self,
8955 v: V,
8956 ) -> Self {
8957 self.0.request = v.into();
8958 self
8959 }
8960
8961 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8963 self.0.options = v.into();
8964 self
8965 }
8966
8967 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8974 (*self.0.stub)
8975 .delete_intercept_deployment_group(self.0.request, self.0.options)
8976 .await
8977 .map(crate::Response::into_body)
8978 }
8979
8980 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8982 type Operation =
8983 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8984 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8985 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8986
8987 let stub = self.0.stub.clone();
8988 let mut options = self.0.options.clone();
8989 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8990 let query = move |name| {
8991 let stub = stub.clone();
8992 let options = options.clone();
8993 async {
8994 let op = GetOperation::new(stub)
8995 .set_name(name)
8996 .with_options(options)
8997 .send()
8998 .await?;
8999 Ok(Operation::new(op))
9000 }
9001 };
9002
9003 let start = move || async {
9004 let op = self.send().await?;
9005 Ok(Operation::new(op))
9006 };
9007
9008 google_cloud_lro::internal::new_unit_response_poller(
9009 polling_error_policy,
9010 polling_backoff_policy,
9011 start,
9012 query,
9013 )
9014 }
9015
9016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9020 self.0.request.name = v.into();
9021 self
9022 }
9023
9024 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9026 self.0.request.request_id = v.into();
9027 self
9028 }
9029 }
9030
9031 #[doc(hidden)]
9032 impl crate::RequestBuilder for DeleteInterceptDeploymentGroup {
9033 fn request_options(&mut self) -> &mut crate::RequestOptions {
9034 &mut self.0.options
9035 }
9036 }
9037
9038 #[derive(Clone, Debug)]
9059 pub struct ListInterceptDeployments(
9060 RequestBuilder<crate::model::ListInterceptDeploymentsRequest>,
9061 );
9062
9063 impl ListInterceptDeployments {
9064 pub(crate) fn new(
9065 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9066 ) -> Self {
9067 Self(RequestBuilder::new(stub))
9068 }
9069
9070 pub fn with_request<V: Into<crate::model::ListInterceptDeploymentsRequest>>(
9072 mut self,
9073 v: V,
9074 ) -> Self {
9075 self.0.request = v.into();
9076 self
9077 }
9078
9079 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9081 self.0.options = v.into();
9082 self
9083 }
9084
9085 pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentsResponse> {
9087 (*self.0.stub)
9088 .list_intercept_deployments(self.0.request, self.0.options)
9089 .await
9090 .map(crate::Response::into_body)
9091 }
9092
9093 pub fn by_page(
9095 self,
9096 ) -> impl google_cloud_gax::paginator::Paginator<
9097 crate::model::ListInterceptDeploymentsResponse,
9098 crate::Error,
9099 > {
9100 use std::clone::Clone;
9101 let token = self.0.request.page_token.clone();
9102 let execute = move |token: String| {
9103 let mut builder = self.clone();
9104 builder.0.request = builder.0.request.set_page_token(token);
9105 builder.send()
9106 };
9107 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9108 }
9109
9110 pub fn by_item(
9112 self,
9113 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9114 crate::model::ListInterceptDeploymentsResponse,
9115 crate::Error,
9116 > {
9117 use google_cloud_gax::paginator::Paginator;
9118 self.by_page().items()
9119 }
9120
9121 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9125 self.0.request.parent = v.into();
9126 self
9127 }
9128
9129 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9131 self.0.request.page_size = v.into();
9132 self
9133 }
9134
9135 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9137 self.0.request.page_token = v.into();
9138 self
9139 }
9140
9141 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9143 self.0.request.filter = v.into();
9144 self
9145 }
9146
9147 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9149 self.0.request.order_by = v.into();
9150 self
9151 }
9152 }
9153
9154 #[doc(hidden)]
9155 impl crate::RequestBuilder for ListInterceptDeployments {
9156 fn request_options(&mut self) -> &mut crate::RequestOptions {
9157 &mut self.0.options
9158 }
9159 }
9160
9161 #[derive(Clone, Debug)]
9178 pub struct GetInterceptDeployment(RequestBuilder<crate::model::GetInterceptDeploymentRequest>);
9179
9180 impl GetInterceptDeployment {
9181 pub(crate) fn new(
9182 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9183 ) -> Self {
9184 Self(RequestBuilder::new(stub))
9185 }
9186
9187 pub fn with_request<V: Into<crate::model::GetInterceptDeploymentRequest>>(
9189 mut self,
9190 v: V,
9191 ) -> Self {
9192 self.0.request = v.into();
9193 self
9194 }
9195
9196 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9198 self.0.options = v.into();
9199 self
9200 }
9201
9202 pub async fn send(self) -> Result<crate::model::InterceptDeployment> {
9204 (*self.0.stub)
9205 .get_intercept_deployment(self.0.request, self.0.options)
9206 .await
9207 .map(crate::Response::into_body)
9208 }
9209
9210 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9214 self.0.request.name = v.into();
9215 self
9216 }
9217 }
9218
9219 #[doc(hidden)]
9220 impl crate::RequestBuilder for GetInterceptDeployment {
9221 fn request_options(&mut self) -> &mut crate::RequestOptions {
9222 &mut self.0.options
9223 }
9224 }
9225
9226 #[derive(Clone, Debug)]
9244 pub struct CreateInterceptDeployment(
9245 RequestBuilder<crate::model::CreateInterceptDeploymentRequest>,
9246 );
9247
9248 impl CreateInterceptDeployment {
9249 pub(crate) fn new(
9250 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9251 ) -> Self {
9252 Self(RequestBuilder::new(stub))
9253 }
9254
9255 pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentRequest>>(
9257 mut self,
9258 v: V,
9259 ) -> Self {
9260 self.0.request = v.into();
9261 self
9262 }
9263
9264 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9266 self.0.options = v.into();
9267 self
9268 }
9269
9270 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9277 (*self.0.stub)
9278 .create_intercept_deployment(self.0.request, self.0.options)
9279 .await
9280 .map(crate::Response::into_body)
9281 }
9282
9283 pub fn poller(
9285 self,
9286 ) -> impl google_cloud_lro::Poller<
9287 crate::model::InterceptDeployment,
9288 crate::model::OperationMetadata,
9289 > {
9290 type Operation = google_cloud_lro::internal::Operation<
9291 crate::model::InterceptDeployment,
9292 crate::model::OperationMetadata,
9293 >;
9294 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9295 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9296
9297 let stub = self.0.stub.clone();
9298 let mut options = self.0.options.clone();
9299 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9300 let query = move |name| {
9301 let stub = stub.clone();
9302 let options = options.clone();
9303 async {
9304 let op = GetOperation::new(stub)
9305 .set_name(name)
9306 .with_options(options)
9307 .send()
9308 .await?;
9309 Ok(Operation::new(op))
9310 }
9311 };
9312
9313 let start = move || async {
9314 let op = self.send().await?;
9315 Ok(Operation::new(op))
9316 };
9317
9318 google_cloud_lro::internal::new_poller(
9319 polling_error_policy,
9320 polling_backoff_policy,
9321 start,
9322 query,
9323 )
9324 }
9325
9326 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9330 self.0.request.parent = v.into();
9331 self
9332 }
9333
9334 pub fn set_intercept_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9338 self.0.request.intercept_deployment_id = v.into();
9339 self
9340 }
9341
9342 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9346 where
9347 T: std::convert::Into<crate::model::InterceptDeployment>,
9348 {
9349 self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9350 self
9351 }
9352
9353 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9357 where
9358 T: std::convert::Into<crate::model::InterceptDeployment>,
9359 {
9360 self.0.request.intercept_deployment = v.map(|x| x.into());
9361 self
9362 }
9363
9364 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9366 self.0.request.request_id = v.into();
9367 self
9368 }
9369 }
9370
9371 #[doc(hidden)]
9372 impl crate::RequestBuilder for CreateInterceptDeployment {
9373 fn request_options(&mut self) -> &mut crate::RequestOptions {
9374 &mut self.0.options
9375 }
9376 }
9377
9378 #[derive(Clone, Debug)]
9396 pub struct UpdateInterceptDeployment(
9397 RequestBuilder<crate::model::UpdateInterceptDeploymentRequest>,
9398 );
9399
9400 impl UpdateInterceptDeployment {
9401 pub(crate) fn new(
9402 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9403 ) -> Self {
9404 Self(RequestBuilder::new(stub))
9405 }
9406
9407 pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentRequest>>(
9409 mut self,
9410 v: V,
9411 ) -> Self {
9412 self.0.request = v.into();
9413 self
9414 }
9415
9416 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9418 self.0.options = v.into();
9419 self
9420 }
9421
9422 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9429 (*self.0.stub)
9430 .update_intercept_deployment(self.0.request, self.0.options)
9431 .await
9432 .map(crate::Response::into_body)
9433 }
9434
9435 pub fn poller(
9437 self,
9438 ) -> impl google_cloud_lro::Poller<
9439 crate::model::InterceptDeployment,
9440 crate::model::OperationMetadata,
9441 > {
9442 type Operation = google_cloud_lro::internal::Operation<
9443 crate::model::InterceptDeployment,
9444 crate::model::OperationMetadata,
9445 >;
9446 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9447 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9448
9449 let stub = self.0.stub.clone();
9450 let mut options = self.0.options.clone();
9451 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9452 let query = move |name| {
9453 let stub = stub.clone();
9454 let options = options.clone();
9455 async {
9456 let op = GetOperation::new(stub)
9457 .set_name(name)
9458 .with_options(options)
9459 .send()
9460 .await?;
9461 Ok(Operation::new(op))
9462 }
9463 };
9464
9465 let start = move || async {
9466 let op = self.send().await?;
9467 Ok(Operation::new(op))
9468 };
9469
9470 google_cloud_lro::internal::new_poller(
9471 polling_error_policy,
9472 polling_backoff_policy,
9473 start,
9474 query,
9475 )
9476 }
9477
9478 pub fn set_update_mask<T>(mut self, v: T) -> Self
9480 where
9481 T: std::convert::Into<wkt::FieldMask>,
9482 {
9483 self.0.request.update_mask = std::option::Option::Some(v.into());
9484 self
9485 }
9486
9487 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9489 where
9490 T: std::convert::Into<wkt::FieldMask>,
9491 {
9492 self.0.request.update_mask = v.map(|x| x.into());
9493 self
9494 }
9495
9496 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9500 where
9501 T: std::convert::Into<crate::model::InterceptDeployment>,
9502 {
9503 self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9504 self
9505 }
9506
9507 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9511 where
9512 T: std::convert::Into<crate::model::InterceptDeployment>,
9513 {
9514 self.0.request.intercept_deployment = v.map(|x| x.into());
9515 self
9516 }
9517
9518 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9520 self.0.request.request_id = v.into();
9521 self
9522 }
9523 }
9524
9525 #[doc(hidden)]
9526 impl crate::RequestBuilder for UpdateInterceptDeployment {
9527 fn request_options(&mut self) -> &mut crate::RequestOptions {
9528 &mut self.0.options
9529 }
9530 }
9531
9532 #[derive(Clone, Debug)]
9550 pub struct DeleteInterceptDeployment(
9551 RequestBuilder<crate::model::DeleteInterceptDeploymentRequest>,
9552 );
9553
9554 impl DeleteInterceptDeployment {
9555 pub(crate) fn new(
9556 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9557 ) -> Self {
9558 Self(RequestBuilder::new(stub))
9559 }
9560
9561 pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentRequest>>(
9563 mut self,
9564 v: V,
9565 ) -> Self {
9566 self.0.request = v.into();
9567 self
9568 }
9569
9570 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9572 self.0.options = v.into();
9573 self
9574 }
9575
9576 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9583 (*self.0.stub)
9584 .delete_intercept_deployment(self.0.request, self.0.options)
9585 .await
9586 .map(crate::Response::into_body)
9587 }
9588
9589 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9591 type Operation =
9592 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9593 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9594 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9595
9596 let stub = self.0.stub.clone();
9597 let mut options = self.0.options.clone();
9598 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9599 let query = move |name| {
9600 let stub = stub.clone();
9601 let options = options.clone();
9602 async {
9603 let op = GetOperation::new(stub)
9604 .set_name(name)
9605 .with_options(options)
9606 .send()
9607 .await?;
9608 Ok(Operation::new(op))
9609 }
9610 };
9611
9612 let start = move || async {
9613 let op = self.send().await?;
9614 Ok(Operation::new(op))
9615 };
9616
9617 google_cloud_lro::internal::new_unit_response_poller(
9618 polling_error_policy,
9619 polling_backoff_policy,
9620 start,
9621 query,
9622 )
9623 }
9624
9625 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9629 self.0.request.name = v.into();
9630 self
9631 }
9632
9633 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9635 self.0.request.request_id = v.into();
9636 self
9637 }
9638 }
9639
9640 #[doc(hidden)]
9641 impl crate::RequestBuilder for DeleteInterceptDeployment {
9642 fn request_options(&mut self) -> &mut crate::RequestOptions {
9643 &mut self.0.options
9644 }
9645 }
9646
9647 #[derive(Clone, Debug)]
9668 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9669
9670 impl ListLocations {
9671 pub(crate) fn new(
9672 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9673 ) -> Self {
9674 Self(RequestBuilder::new(stub))
9675 }
9676
9677 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9679 mut self,
9680 v: V,
9681 ) -> Self {
9682 self.0.request = v.into();
9683 self
9684 }
9685
9686 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9688 self.0.options = v.into();
9689 self
9690 }
9691
9692 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9694 (*self.0.stub)
9695 .list_locations(self.0.request, self.0.options)
9696 .await
9697 .map(crate::Response::into_body)
9698 }
9699
9700 pub fn by_page(
9702 self,
9703 ) -> impl google_cloud_gax::paginator::Paginator<
9704 google_cloud_location::model::ListLocationsResponse,
9705 crate::Error,
9706 > {
9707 use std::clone::Clone;
9708 let token = self.0.request.page_token.clone();
9709 let execute = move |token: String| {
9710 let mut builder = self.clone();
9711 builder.0.request = builder.0.request.set_page_token(token);
9712 builder.send()
9713 };
9714 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9715 }
9716
9717 pub fn by_item(
9719 self,
9720 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9721 google_cloud_location::model::ListLocationsResponse,
9722 crate::Error,
9723 > {
9724 use google_cloud_gax::paginator::Paginator;
9725 self.by_page().items()
9726 }
9727
9728 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9730 self.0.request.name = v.into();
9731 self
9732 }
9733
9734 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9736 self.0.request.filter = v.into();
9737 self
9738 }
9739
9740 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9742 self.0.request.page_size = v.into();
9743 self
9744 }
9745
9746 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9748 self.0.request.page_token = v.into();
9749 self
9750 }
9751 }
9752
9753 #[doc(hidden)]
9754 impl crate::RequestBuilder for ListLocations {
9755 fn request_options(&mut self) -> &mut crate::RequestOptions {
9756 &mut self.0.options
9757 }
9758 }
9759
9760 #[derive(Clone, Debug)]
9777 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9778
9779 impl GetLocation {
9780 pub(crate) fn new(
9781 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9782 ) -> Self {
9783 Self(RequestBuilder::new(stub))
9784 }
9785
9786 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9788 mut self,
9789 v: V,
9790 ) -> Self {
9791 self.0.request = v.into();
9792 self
9793 }
9794
9795 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9797 self.0.options = v.into();
9798 self
9799 }
9800
9801 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9803 (*self.0.stub)
9804 .get_location(self.0.request, self.0.options)
9805 .await
9806 .map(crate::Response::into_body)
9807 }
9808
9809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9811 self.0.request.name = v.into();
9812 self
9813 }
9814 }
9815
9816 #[doc(hidden)]
9817 impl crate::RequestBuilder for GetLocation {
9818 fn request_options(&mut self) -> &mut crate::RequestOptions {
9819 &mut self.0.options
9820 }
9821 }
9822
9823 #[derive(Clone, Debug)]
9840 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9841
9842 impl SetIamPolicy {
9843 pub(crate) fn new(
9844 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9845 ) -> Self {
9846 Self(RequestBuilder::new(stub))
9847 }
9848
9849 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9851 mut self,
9852 v: V,
9853 ) -> Self {
9854 self.0.request = v.into();
9855 self
9856 }
9857
9858 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9860 self.0.options = v.into();
9861 self
9862 }
9863
9864 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9866 (*self.0.stub)
9867 .set_iam_policy(self.0.request, self.0.options)
9868 .await
9869 .map(crate::Response::into_body)
9870 }
9871
9872 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9876 self.0.request.resource = v.into();
9877 self
9878 }
9879
9880 pub fn set_policy<T>(mut self, v: T) -> Self
9884 where
9885 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9886 {
9887 self.0.request.policy = std::option::Option::Some(v.into());
9888 self
9889 }
9890
9891 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9895 where
9896 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9897 {
9898 self.0.request.policy = v.map(|x| x.into());
9899 self
9900 }
9901
9902 pub fn set_update_mask<T>(mut self, v: T) -> Self
9904 where
9905 T: std::convert::Into<wkt::FieldMask>,
9906 {
9907 self.0.request.update_mask = std::option::Option::Some(v.into());
9908 self
9909 }
9910
9911 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9913 where
9914 T: std::convert::Into<wkt::FieldMask>,
9915 {
9916 self.0.request.update_mask = v.map(|x| x.into());
9917 self
9918 }
9919 }
9920
9921 #[doc(hidden)]
9922 impl crate::RequestBuilder for SetIamPolicy {
9923 fn request_options(&mut self) -> &mut crate::RequestOptions {
9924 &mut self.0.options
9925 }
9926 }
9927
9928 #[derive(Clone, Debug)]
9945 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9946
9947 impl GetIamPolicy {
9948 pub(crate) fn new(
9949 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9950 ) -> Self {
9951 Self(RequestBuilder::new(stub))
9952 }
9953
9954 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9956 mut self,
9957 v: V,
9958 ) -> Self {
9959 self.0.request = v.into();
9960 self
9961 }
9962
9963 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9965 self.0.options = v.into();
9966 self
9967 }
9968
9969 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9971 (*self.0.stub)
9972 .get_iam_policy(self.0.request, self.0.options)
9973 .await
9974 .map(crate::Response::into_body)
9975 }
9976
9977 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9981 self.0.request.resource = v.into();
9982 self
9983 }
9984
9985 pub fn set_options<T>(mut self, v: T) -> Self
9987 where
9988 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9989 {
9990 self.0.request.options = std::option::Option::Some(v.into());
9991 self
9992 }
9993
9994 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9996 where
9997 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9998 {
9999 self.0.request.options = v.map(|x| x.into());
10000 self
10001 }
10002 }
10003
10004 #[doc(hidden)]
10005 impl crate::RequestBuilder for GetIamPolicy {
10006 fn request_options(&mut self) -> &mut crate::RequestOptions {
10007 &mut self.0.options
10008 }
10009 }
10010
10011 #[derive(Clone, Debug)]
10028 pub struct TestIamPermissions(
10029 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10030 );
10031
10032 impl TestIamPermissions {
10033 pub(crate) fn new(
10034 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10035 ) -> Self {
10036 Self(RequestBuilder::new(stub))
10037 }
10038
10039 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10041 mut self,
10042 v: V,
10043 ) -> Self {
10044 self.0.request = v.into();
10045 self
10046 }
10047
10048 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10050 self.0.options = v.into();
10051 self
10052 }
10053
10054 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10056 (*self.0.stub)
10057 .test_iam_permissions(self.0.request, self.0.options)
10058 .await
10059 .map(crate::Response::into_body)
10060 }
10061
10062 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10066 self.0.request.resource = v.into();
10067 self
10068 }
10069
10070 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10074 where
10075 T: std::iter::IntoIterator<Item = V>,
10076 V: std::convert::Into<std::string::String>,
10077 {
10078 use std::iter::Iterator;
10079 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10080 self
10081 }
10082 }
10083
10084 #[doc(hidden)]
10085 impl crate::RequestBuilder for TestIamPermissions {
10086 fn request_options(&mut self) -> &mut crate::RequestOptions {
10087 &mut self.0.options
10088 }
10089 }
10090
10091 #[derive(Clone, Debug)]
10112 pub struct ListOperations(
10113 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10114 );
10115
10116 impl ListOperations {
10117 pub(crate) fn new(
10118 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10119 ) -> Self {
10120 Self(RequestBuilder::new(stub))
10121 }
10122
10123 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10125 mut self,
10126 v: V,
10127 ) -> Self {
10128 self.0.request = v.into();
10129 self
10130 }
10131
10132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10134 self.0.options = v.into();
10135 self
10136 }
10137
10138 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10140 (*self.0.stub)
10141 .list_operations(self.0.request, self.0.options)
10142 .await
10143 .map(crate::Response::into_body)
10144 }
10145
10146 pub fn by_page(
10148 self,
10149 ) -> impl google_cloud_gax::paginator::Paginator<
10150 google_cloud_longrunning::model::ListOperationsResponse,
10151 crate::Error,
10152 > {
10153 use std::clone::Clone;
10154 let token = self.0.request.page_token.clone();
10155 let execute = move |token: String| {
10156 let mut builder = self.clone();
10157 builder.0.request = builder.0.request.set_page_token(token);
10158 builder.send()
10159 };
10160 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10161 }
10162
10163 pub fn by_item(
10165 self,
10166 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10167 google_cloud_longrunning::model::ListOperationsResponse,
10168 crate::Error,
10169 > {
10170 use google_cloud_gax::paginator::Paginator;
10171 self.by_page().items()
10172 }
10173
10174 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10176 self.0.request.name = v.into();
10177 self
10178 }
10179
10180 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10182 self.0.request.filter = v.into();
10183 self
10184 }
10185
10186 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10188 self.0.request.page_size = v.into();
10189 self
10190 }
10191
10192 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10194 self.0.request.page_token = v.into();
10195 self
10196 }
10197
10198 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10200 self.0.request.return_partial_success = v.into();
10201 self
10202 }
10203 }
10204
10205 #[doc(hidden)]
10206 impl crate::RequestBuilder for ListOperations {
10207 fn request_options(&mut self) -> &mut crate::RequestOptions {
10208 &mut self.0.options
10209 }
10210 }
10211
10212 #[derive(Clone, Debug)]
10229 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10230
10231 impl GetOperation {
10232 pub(crate) fn new(
10233 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10234 ) -> Self {
10235 Self(RequestBuilder::new(stub))
10236 }
10237
10238 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10240 mut self,
10241 v: V,
10242 ) -> Self {
10243 self.0.request = v.into();
10244 self
10245 }
10246
10247 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10249 self.0.options = v.into();
10250 self
10251 }
10252
10253 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10255 (*self.0.stub)
10256 .get_operation(self.0.request, self.0.options)
10257 .await
10258 .map(crate::Response::into_body)
10259 }
10260
10261 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10263 self.0.request.name = v.into();
10264 self
10265 }
10266 }
10267
10268 #[doc(hidden)]
10269 impl crate::RequestBuilder for GetOperation {
10270 fn request_options(&mut self) -> &mut crate::RequestOptions {
10271 &mut self.0.options
10272 }
10273 }
10274
10275 #[derive(Clone, Debug)]
10292 pub struct DeleteOperation(
10293 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10294 );
10295
10296 impl DeleteOperation {
10297 pub(crate) fn new(
10298 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10299 ) -> Self {
10300 Self(RequestBuilder::new(stub))
10301 }
10302
10303 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10305 mut self,
10306 v: V,
10307 ) -> Self {
10308 self.0.request = v.into();
10309 self
10310 }
10311
10312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10314 self.0.options = v.into();
10315 self
10316 }
10317
10318 pub async fn send(self) -> Result<()> {
10320 (*self.0.stub)
10321 .delete_operation(self.0.request, self.0.options)
10322 .await
10323 .map(crate::Response::into_body)
10324 }
10325
10326 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10328 self.0.request.name = v.into();
10329 self
10330 }
10331 }
10332
10333 #[doc(hidden)]
10334 impl crate::RequestBuilder for DeleteOperation {
10335 fn request_options(&mut self) -> &mut crate::RequestOptions {
10336 &mut self.0.options
10337 }
10338 }
10339
10340 #[derive(Clone, Debug)]
10357 pub struct CancelOperation(
10358 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10359 );
10360
10361 impl CancelOperation {
10362 pub(crate) fn new(
10363 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10364 ) -> Self {
10365 Self(RequestBuilder::new(stub))
10366 }
10367
10368 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10370 mut self,
10371 v: V,
10372 ) -> Self {
10373 self.0.request = v.into();
10374 self
10375 }
10376
10377 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10379 self.0.options = v.into();
10380 self
10381 }
10382
10383 pub async fn send(self) -> Result<()> {
10385 (*self.0.stub)
10386 .cancel_operation(self.0.request, self.0.options)
10387 .await
10388 .map(crate::Response::into_body)
10389 }
10390
10391 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10393 self.0.request.name = v.into();
10394 self
10395 }
10396 }
10397
10398 #[doc(hidden)]
10399 impl crate::RequestBuilder for CancelOperation {
10400 fn request_options(&mut self) -> &mut crate::RequestOptions {
10401 &mut self.0.options
10402 }
10403 }
10404}
10405
10406pub mod mirroring {
10408 use crate::Result;
10409
10410 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10424
10425 pub(crate) mod client {
10426 use super::super::super::client::Mirroring;
10427 pub struct Factory;
10428 impl crate::ClientFactory for Factory {
10429 type Client = Mirroring;
10430 type Credentials = gaxi::options::Credentials;
10431 async fn build(
10432 self,
10433 config: gaxi::options::ClientConfig,
10434 ) -> crate::ClientBuilderResult<Self::Client> {
10435 Self::Client::new(config).await
10436 }
10437 }
10438 }
10439
10440 #[derive(Clone, Debug)]
10442 pub(crate) struct RequestBuilder<R: std::default::Default> {
10443 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10444 request: R,
10445 options: crate::RequestOptions,
10446 }
10447
10448 impl<R> RequestBuilder<R>
10449 where
10450 R: std::default::Default,
10451 {
10452 pub(crate) fn new(
10453 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10454 ) -> Self {
10455 Self {
10456 stub,
10457 request: R::default(),
10458 options: crate::RequestOptions::default(),
10459 }
10460 }
10461 }
10462
10463 #[derive(Clone, Debug)]
10484 pub struct ListMirroringEndpointGroups(
10485 RequestBuilder<crate::model::ListMirroringEndpointGroupsRequest>,
10486 );
10487
10488 impl ListMirroringEndpointGroups {
10489 pub(crate) fn new(
10490 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10491 ) -> Self {
10492 Self(RequestBuilder::new(stub))
10493 }
10494
10495 pub fn with_request<V: Into<crate::model::ListMirroringEndpointGroupsRequest>>(
10497 mut self,
10498 v: V,
10499 ) -> Self {
10500 self.0.request = v.into();
10501 self
10502 }
10503
10504 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10506 self.0.options = v.into();
10507 self
10508 }
10509
10510 pub async fn send(self) -> Result<crate::model::ListMirroringEndpointGroupsResponse> {
10512 (*self.0.stub)
10513 .list_mirroring_endpoint_groups(self.0.request, self.0.options)
10514 .await
10515 .map(crate::Response::into_body)
10516 }
10517
10518 pub fn by_page(
10520 self,
10521 ) -> impl google_cloud_gax::paginator::Paginator<
10522 crate::model::ListMirroringEndpointGroupsResponse,
10523 crate::Error,
10524 > {
10525 use std::clone::Clone;
10526 let token = self.0.request.page_token.clone();
10527 let execute = move |token: String| {
10528 let mut builder = self.clone();
10529 builder.0.request = builder.0.request.set_page_token(token);
10530 builder.send()
10531 };
10532 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10533 }
10534
10535 pub fn by_item(
10537 self,
10538 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10539 crate::model::ListMirroringEndpointGroupsResponse,
10540 crate::Error,
10541 > {
10542 use google_cloud_gax::paginator::Paginator;
10543 self.by_page().items()
10544 }
10545
10546 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10550 self.0.request.parent = v.into();
10551 self
10552 }
10553
10554 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10556 self.0.request.page_size = v.into();
10557 self
10558 }
10559
10560 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10562 self.0.request.page_token = v.into();
10563 self
10564 }
10565
10566 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10568 self.0.request.filter = v.into();
10569 self
10570 }
10571
10572 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10574 self.0.request.order_by = v.into();
10575 self
10576 }
10577 }
10578
10579 #[doc(hidden)]
10580 impl crate::RequestBuilder for ListMirroringEndpointGroups {
10581 fn request_options(&mut self) -> &mut crate::RequestOptions {
10582 &mut self.0.options
10583 }
10584 }
10585
10586 #[derive(Clone, Debug)]
10603 pub struct GetMirroringEndpointGroup(
10604 RequestBuilder<crate::model::GetMirroringEndpointGroupRequest>,
10605 );
10606
10607 impl GetMirroringEndpointGroup {
10608 pub(crate) fn new(
10609 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10610 ) -> Self {
10611 Self(RequestBuilder::new(stub))
10612 }
10613
10614 pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupRequest>>(
10616 mut self,
10617 v: V,
10618 ) -> Self {
10619 self.0.request = v.into();
10620 self
10621 }
10622
10623 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10625 self.0.options = v.into();
10626 self
10627 }
10628
10629 pub async fn send(self) -> Result<crate::model::MirroringEndpointGroup> {
10631 (*self.0.stub)
10632 .get_mirroring_endpoint_group(self.0.request, self.0.options)
10633 .await
10634 .map(crate::Response::into_body)
10635 }
10636
10637 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10641 self.0.request.name = v.into();
10642 self
10643 }
10644 }
10645
10646 #[doc(hidden)]
10647 impl crate::RequestBuilder for GetMirroringEndpointGroup {
10648 fn request_options(&mut self) -> &mut crate::RequestOptions {
10649 &mut self.0.options
10650 }
10651 }
10652
10653 #[derive(Clone, Debug)]
10671 pub struct CreateMirroringEndpointGroup(
10672 RequestBuilder<crate::model::CreateMirroringEndpointGroupRequest>,
10673 );
10674
10675 impl CreateMirroringEndpointGroup {
10676 pub(crate) fn new(
10677 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10678 ) -> Self {
10679 Self(RequestBuilder::new(stub))
10680 }
10681
10682 pub fn with_request<V: Into<crate::model::CreateMirroringEndpointGroupRequest>>(
10684 mut self,
10685 v: V,
10686 ) -> Self {
10687 self.0.request = v.into();
10688 self
10689 }
10690
10691 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10693 self.0.options = v.into();
10694 self
10695 }
10696
10697 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10704 (*self.0.stub)
10705 .create_mirroring_endpoint_group(self.0.request, self.0.options)
10706 .await
10707 .map(crate::Response::into_body)
10708 }
10709
10710 pub fn poller(
10712 self,
10713 ) -> impl google_cloud_lro::Poller<
10714 crate::model::MirroringEndpointGroup,
10715 crate::model::OperationMetadata,
10716 > {
10717 type Operation = google_cloud_lro::internal::Operation<
10718 crate::model::MirroringEndpointGroup,
10719 crate::model::OperationMetadata,
10720 >;
10721 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10722 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10723
10724 let stub = self.0.stub.clone();
10725 let mut options = self.0.options.clone();
10726 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10727 let query = move |name| {
10728 let stub = stub.clone();
10729 let options = options.clone();
10730 async {
10731 let op = GetOperation::new(stub)
10732 .set_name(name)
10733 .with_options(options)
10734 .send()
10735 .await?;
10736 Ok(Operation::new(op))
10737 }
10738 };
10739
10740 let start = move || async {
10741 let op = self.send().await?;
10742 Ok(Operation::new(op))
10743 };
10744
10745 google_cloud_lro::internal::new_poller(
10746 polling_error_policy,
10747 polling_backoff_policy,
10748 start,
10749 query,
10750 )
10751 }
10752
10753 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10757 self.0.request.parent = v.into();
10758 self
10759 }
10760
10761 pub fn set_mirroring_endpoint_group_id<T: Into<std::string::String>>(
10765 mut self,
10766 v: T,
10767 ) -> Self {
10768 self.0.request.mirroring_endpoint_group_id = v.into();
10769 self
10770 }
10771
10772 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
10776 where
10777 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10778 {
10779 self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
10780 self
10781 }
10782
10783 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
10787 where
10788 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10789 {
10790 self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
10791 self
10792 }
10793
10794 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10796 self.0.request.request_id = v.into();
10797 self
10798 }
10799 }
10800
10801 #[doc(hidden)]
10802 impl crate::RequestBuilder for CreateMirroringEndpointGroup {
10803 fn request_options(&mut self) -> &mut crate::RequestOptions {
10804 &mut self.0.options
10805 }
10806 }
10807
10808 #[derive(Clone, Debug)]
10826 pub struct UpdateMirroringEndpointGroup(
10827 RequestBuilder<crate::model::UpdateMirroringEndpointGroupRequest>,
10828 );
10829
10830 impl UpdateMirroringEndpointGroup {
10831 pub(crate) fn new(
10832 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10833 ) -> Self {
10834 Self(RequestBuilder::new(stub))
10835 }
10836
10837 pub fn with_request<V: Into<crate::model::UpdateMirroringEndpointGroupRequest>>(
10839 mut self,
10840 v: V,
10841 ) -> Self {
10842 self.0.request = v.into();
10843 self
10844 }
10845
10846 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10848 self.0.options = v.into();
10849 self
10850 }
10851
10852 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10859 (*self.0.stub)
10860 .update_mirroring_endpoint_group(self.0.request, self.0.options)
10861 .await
10862 .map(crate::Response::into_body)
10863 }
10864
10865 pub fn poller(
10867 self,
10868 ) -> impl google_cloud_lro::Poller<
10869 crate::model::MirroringEndpointGroup,
10870 crate::model::OperationMetadata,
10871 > {
10872 type Operation = google_cloud_lro::internal::Operation<
10873 crate::model::MirroringEndpointGroup,
10874 crate::model::OperationMetadata,
10875 >;
10876 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10877 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10878
10879 let stub = self.0.stub.clone();
10880 let mut options = self.0.options.clone();
10881 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10882 let query = move |name| {
10883 let stub = stub.clone();
10884 let options = options.clone();
10885 async {
10886 let op = GetOperation::new(stub)
10887 .set_name(name)
10888 .with_options(options)
10889 .send()
10890 .await?;
10891 Ok(Operation::new(op))
10892 }
10893 };
10894
10895 let start = move || async {
10896 let op = self.send().await?;
10897 Ok(Operation::new(op))
10898 };
10899
10900 google_cloud_lro::internal::new_poller(
10901 polling_error_policy,
10902 polling_backoff_policy,
10903 start,
10904 query,
10905 )
10906 }
10907
10908 pub fn set_update_mask<T>(mut self, v: T) -> Self
10910 where
10911 T: std::convert::Into<wkt::FieldMask>,
10912 {
10913 self.0.request.update_mask = std::option::Option::Some(v.into());
10914 self
10915 }
10916
10917 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10919 where
10920 T: std::convert::Into<wkt::FieldMask>,
10921 {
10922 self.0.request.update_mask = v.map(|x| x.into());
10923 self
10924 }
10925
10926 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
10930 where
10931 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10932 {
10933 self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
10934 self
10935 }
10936
10937 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
10941 where
10942 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10943 {
10944 self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
10945 self
10946 }
10947
10948 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10950 self.0.request.request_id = v.into();
10951 self
10952 }
10953 }
10954
10955 #[doc(hidden)]
10956 impl crate::RequestBuilder for UpdateMirroringEndpointGroup {
10957 fn request_options(&mut self) -> &mut crate::RequestOptions {
10958 &mut self.0.options
10959 }
10960 }
10961
10962 #[derive(Clone, Debug)]
10980 pub struct DeleteMirroringEndpointGroup(
10981 RequestBuilder<crate::model::DeleteMirroringEndpointGroupRequest>,
10982 );
10983
10984 impl DeleteMirroringEndpointGroup {
10985 pub(crate) fn new(
10986 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10987 ) -> Self {
10988 Self(RequestBuilder::new(stub))
10989 }
10990
10991 pub fn with_request<V: Into<crate::model::DeleteMirroringEndpointGroupRequest>>(
10993 mut self,
10994 v: V,
10995 ) -> Self {
10996 self.0.request = v.into();
10997 self
10998 }
10999
11000 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11002 self.0.options = v.into();
11003 self
11004 }
11005
11006 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11013 (*self.0.stub)
11014 .delete_mirroring_endpoint_group(self.0.request, self.0.options)
11015 .await
11016 .map(crate::Response::into_body)
11017 }
11018
11019 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11021 type Operation =
11022 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11023 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11024 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11025
11026 let stub = self.0.stub.clone();
11027 let mut options = self.0.options.clone();
11028 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11029 let query = move |name| {
11030 let stub = stub.clone();
11031 let options = options.clone();
11032 async {
11033 let op = GetOperation::new(stub)
11034 .set_name(name)
11035 .with_options(options)
11036 .send()
11037 .await?;
11038 Ok(Operation::new(op))
11039 }
11040 };
11041
11042 let start = move || async {
11043 let op = self.send().await?;
11044 Ok(Operation::new(op))
11045 };
11046
11047 google_cloud_lro::internal::new_unit_response_poller(
11048 polling_error_policy,
11049 polling_backoff_policy,
11050 start,
11051 query,
11052 )
11053 }
11054
11055 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11059 self.0.request.name = v.into();
11060 self
11061 }
11062
11063 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11065 self.0.request.request_id = v.into();
11066 self
11067 }
11068 }
11069
11070 #[doc(hidden)]
11071 impl crate::RequestBuilder for DeleteMirroringEndpointGroup {
11072 fn request_options(&mut self) -> &mut crate::RequestOptions {
11073 &mut self.0.options
11074 }
11075 }
11076
11077 #[derive(Clone, Debug)]
11098 pub struct ListMirroringEndpointGroupAssociations(
11099 RequestBuilder<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11100 );
11101
11102 impl ListMirroringEndpointGroupAssociations {
11103 pub(crate) fn new(
11104 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11105 ) -> Self {
11106 Self(RequestBuilder::new(stub))
11107 }
11108
11109 pub fn with_request<
11111 V: Into<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11112 >(
11113 mut self,
11114 v: V,
11115 ) -> Self {
11116 self.0.request = v.into();
11117 self
11118 }
11119
11120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11122 self.0.options = v.into();
11123 self
11124 }
11125
11126 pub async fn send(
11128 self,
11129 ) -> Result<crate::model::ListMirroringEndpointGroupAssociationsResponse> {
11130 (*self.0.stub)
11131 .list_mirroring_endpoint_group_associations(self.0.request, self.0.options)
11132 .await
11133 .map(crate::Response::into_body)
11134 }
11135
11136 pub fn by_page(
11138 self,
11139 ) -> impl google_cloud_gax::paginator::Paginator<
11140 crate::model::ListMirroringEndpointGroupAssociationsResponse,
11141 crate::Error,
11142 > {
11143 use std::clone::Clone;
11144 let token = self.0.request.page_token.clone();
11145 let execute = move |token: String| {
11146 let mut builder = self.clone();
11147 builder.0.request = builder.0.request.set_page_token(token);
11148 builder.send()
11149 };
11150 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11151 }
11152
11153 pub fn by_item(
11155 self,
11156 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11157 crate::model::ListMirroringEndpointGroupAssociationsResponse,
11158 crate::Error,
11159 > {
11160 use google_cloud_gax::paginator::Paginator;
11161 self.by_page().items()
11162 }
11163
11164 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11168 self.0.request.parent = v.into();
11169 self
11170 }
11171
11172 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11174 self.0.request.page_size = v.into();
11175 self
11176 }
11177
11178 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11180 self.0.request.page_token = v.into();
11181 self
11182 }
11183
11184 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11186 self.0.request.filter = v.into();
11187 self
11188 }
11189
11190 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11192 self.0.request.order_by = v.into();
11193 self
11194 }
11195 }
11196
11197 #[doc(hidden)]
11198 impl crate::RequestBuilder for ListMirroringEndpointGroupAssociations {
11199 fn request_options(&mut self) -> &mut crate::RequestOptions {
11200 &mut self.0.options
11201 }
11202 }
11203
11204 #[derive(Clone, Debug)]
11221 pub struct GetMirroringEndpointGroupAssociation(
11222 RequestBuilder<crate::model::GetMirroringEndpointGroupAssociationRequest>,
11223 );
11224
11225 impl GetMirroringEndpointGroupAssociation {
11226 pub(crate) fn new(
11227 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11228 ) -> Self {
11229 Self(RequestBuilder::new(stub))
11230 }
11231
11232 pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupAssociationRequest>>(
11234 mut self,
11235 v: V,
11236 ) -> Self {
11237 self.0.request = v.into();
11238 self
11239 }
11240
11241 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11243 self.0.options = v.into();
11244 self
11245 }
11246
11247 pub async fn send(self) -> Result<crate::model::MirroringEndpointGroupAssociation> {
11249 (*self.0.stub)
11250 .get_mirroring_endpoint_group_association(self.0.request, self.0.options)
11251 .await
11252 .map(crate::Response::into_body)
11253 }
11254
11255 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11259 self.0.request.name = v.into();
11260 self
11261 }
11262 }
11263
11264 #[doc(hidden)]
11265 impl crate::RequestBuilder for GetMirroringEndpointGroupAssociation {
11266 fn request_options(&mut self) -> &mut crate::RequestOptions {
11267 &mut self.0.options
11268 }
11269 }
11270
11271 #[derive(Clone, Debug)]
11289 pub struct CreateMirroringEndpointGroupAssociation(
11290 RequestBuilder<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11291 );
11292
11293 impl CreateMirroringEndpointGroupAssociation {
11294 pub(crate) fn new(
11295 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11296 ) -> Self {
11297 Self(RequestBuilder::new(stub))
11298 }
11299
11300 pub fn with_request<
11302 V: Into<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11303 >(
11304 mut self,
11305 v: V,
11306 ) -> Self {
11307 self.0.request = v.into();
11308 self
11309 }
11310
11311 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11313 self.0.options = v.into();
11314 self
11315 }
11316
11317 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11324 (*self.0.stub)
11325 .create_mirroring_endpoint_group_association(self.0.request, self.0.options)
11326 .await
11327 .map(crate::Response::into_body)
11328 }
11329
11330 pub fn poller(
11332 self,
11333 ) -> impl google_cloud_lro::Poller<
11334 crate::model::MirroringEndpointGroupAssociation,
11335 crate::model::OperationMetadata,
11336 > {
11337 type Operation = google_cloud_lro::internal::Operation<
11338 crate::model::MirroringEndpointGroupAssociation,
11339 crate::model::OperationMetadata,
11340 >;
11341 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11342 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11343
11344 let stub = self.0.stub.clone();
11345 let mut options = self.0.options.clone();
11346 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11347 let query = move |name| {
11348 let stub = stub.clone();
11349 let options = options.clone();
11350 async {
11351 let op = GetOperation::new(stub)
11352 .set_name(name)
11353 .with_options(options)
11354 .send()
11355 .await?;
11356 Ok(Operation::new(op))
11357 }
11358 };
11359
11360 let start = move || async {
11361 let op = self.send().await?;
11362 Ok(Operation::new(op))
11363 };
11364
11365 google_cloud_lro::internal::new_poller(
11366 polling_error_policy,
11367 polling_backoff_policy,
11368 start,
11369 query,
11370 )
11371 }
11372
11373 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11377 self.0.request.parent = v.into();
11378 self
11379 }
11380
11381 pub fn set_mirroring_endpoint_group_association_id<T: Into<std::string::String>>(
11383 mut self,
11384 v: T,
11385 ) -> Self {
11386 self.0.request.mirroring_endpoint_group_association_id = v.into();
11387 self
11388 }
11389
11390 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
11394 where
11395 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11396 {
11397 self.0.request.mirroring_endpoint_group_association =
11398 std::option::Option::Some(v.into());
11399 self
11400 }
11401
11402 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
11406 mut self,
11407 v: std::option::Option<T>,
11408 ) -> Self
11409 where
11410 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11411 {
11412 self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
11413 self
11414 }
11415
11416 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11418 self.0.request.request_id = v.into();
11419 self
11420 }
11421 }
11422
11423 #[doc(hidden)]
11424 impl crate::RequestBuilder for CreateMirroringEndpointGroupAssociation {
11425 fn request_options(&mut self) -> &mut crate::RequestOptions {
11426 &mut self.0.options
11427 }
11428 }
11429
11430 #[derive(Clone, Debug)]
11448 pub struct UpdateMirroringEndpointGroupAssociation(
11449 RequestBuilder<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
11450 );
11451
11452 impl UpdateMirroringEndpointGroupAssociation {
11453 pub(crate) fn new(
11454 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11455 ) -> Self {
11456 Self(RequestBuilder::new(stub))
11457 }
11458
11459 pub fn with_request<
11461 V: Into<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
11462 >(
11463 mut self,
11464 v: V,
11465 ) -> Self {
11466 self.0.request = v.into();
11467 self
11468 }
11469
11470 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11472 self.0.options = v.into();
11473 self
11474 }
11475
11476 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11483 (*self.0.stub)
11484 .update_mirroring_endpoint_group_association(self.0.request, self.0.options)
11485 .await
11486 .map(crate::Response::into_body)
11487 }
11488
11489 pub fn poller(
11491 self,
11492 ) -> impl google_cloud_lro::Poller<
11493 crate::model::MirroringEndpointGroupAssociation,
11494 crate::model::OperationMetadata,
11495 > {
11496 type Operation = google_cloud_lro::internal::Operation<
11497 crate::model::MirroringEndpointGroupAssociation,
11498 crate::model::OperationMetadata,
11499 >;
11500 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11501 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11502
11503 let stub = self.0.stub.clone();
11504 let mut options = self.0.options.clone();
11505 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11506 let query = move |name| {
11507 let stub = stub.clone();
11508 let options = options.clone();
11509 async {
11510 let op = GetOperation::new(stub)
11511 .set_name(name)
11512 .with_options(options)
11513 .send()
11514 .await?;
11515 Ok(Operation::new(op))
11516 }
11517 };
11518
11519 let start = move || async {
11520 let op = self.send().await?;
11521 Ok(Operation::new(op))
11522 };
11523
11524 google_cloud_lro::internal::new_poller(
11525 polling_error_policy,
11526 polling_backoff_policy,
11527 start,
11528 query,
11529 )
11530 }
11531
11532 pub fn set_update_mask<T>(mut self, v: T) -> Self
11534 where
11535 T: std::convert::Into<wkt::FieldMask>,
11536 {
11537 self.0.request.update_mask = std::option::Option::Some(v.into());
11538 self
11539 }
11540
11541 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11543 where
11544 T: std::convert::Into<wkt::FieldMask>,
11545 {
11546 self.0.request.update_mask = v.map(|x| x.into());
11547 self
11548 }
11549
11550 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
11554 where
11555 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11556 {
11557 self.0.request.mirroring_endpoint_group_association =
11558 std::option::Option::Some(v.into());
11559 self
11560 }
11561
11562 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
11566 mut self,
11567 v: std::option::Option<T>,
11568 ) -> Self
11569 where
11570 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11571 {
11572 self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
11573 self
11574 }
11575
11576 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11578 self.0.request.request_id = v.into();
11579 self
11580 }
11581 }
11582
11583 #[doc(hidden)]
11584 impl crate::RequestBuilder for UpdateMirroringEndpointGroupAssociation {
11585 fn request_options(&mut self) -> &mut crate::RequestOptions {
11586 &mut self.0.options
11587 }
11588 }
11589
11590 #[derive(Clone, Debug)]
11608 pub struct DeleteMirroringEndpointGroupAssociation(
11609 RequestBuilder<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
11610 );
11611
11612 impl DeleteMirroringEndpointGroupAssociation {
11613 pub(crate) fn new(
11614 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11615 ) -> Self {
11616 Self(RequestBuilder::new(stub))
11617 }
11618
11619 pub fn with_request<
11621 V: Into<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
11622 >(
11623 mut self,
11624 v: V,
11625 ) -> Self {
11626 self.0.request = v.into();
11627 self
11628 }
11629
11630 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11632 self.0.options = v.into();
11633 self
11634 }
11635
11636 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11643 (*self.0.stub)
11644 .delete_mirroring_endpoint_group_association(self.0.request, self.0.options)
11645 .await
11646 .map(crate::Response::into_body)
11647 }
11648
11649 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11651 type Operation =
11652 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11653 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11654 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11655
11656 let stub = self.0.stub.clone();
11657 let mut options = self.0.options.clone();
11658 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11659 let query = move |name| {
11660 let stub = stub.clone();
11661 let options = options.clone();
11662 async {
11663 let op = GetOperation::new(stub)
11664 .set_name(name)
11665 .with_options(options)
11666 .send()
11667 .await?;
11668 Ok(Operation::new(op))
11669 }
11670 };
11671
11672 let start = move || async {
11673 let op = self.send().await?;
11674 Ok(Operation::new(op))
11675 };
11676
11677 google_cloud_lro::internal::new_unit_response_poller(
11678 polling_error_policy,
11679 polling_backoff_policy,
11680 start,
11681 query,
11682 )
11683 }
11684
11685 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11689 self.0.request.name = v.into();
11690 self
11691 }
11692
11693 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11695 self.0.request.request_id = v.into();
11696 self
11697 }
11698 }
11699
11700 #[doc(hidden)]
11701 impl crate::RequestBuilder for DeleteMirroringEndpointGroupAssociation {
11702 fn request_options(&mut self) -> &mut crate::RequestOptions {
11703 &mut self.0.options
11704 }
11705 }
11706
11707 #[derive(Clone, Debug)]
11728 pub struct ListMirroringDeploymentGroups(
11729 RequestBuilder<crate::model::ListMirroringDeploymentGroupsRequest>,
11730 );
11731
11732 impl ListMirroringDeploymentGroups {
11733 pub(crate) fn new(
11734 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11735 ) -> Self {
11736 Self(RequestBuilder::new(stub))
11737 }
11738
11739 pub fn with_request<V: Into<crate::model::ListMirroringDeploymentGroupsRequest>>(
11741 mut self,
11742 v: V,
11743 ) -> Self {
11744 self.0.request = v.into();
11745 self
11746 }
11747
11748 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11750 self.0.options = v.into();
11751 self
11752 }
11753
11754 pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentGroupsResponse> {
11756 (*self.0.stub)
11757 .list_mirroring_deployment_groups(self.0.request, self.0.options)
11758 .await
11759 .map(crate::Response::into_body)
11760 }
11761
11762 pub fn by_page(
11764 self,
11765 ) -> impl google_cloud_gax::paginator::Paginator<
11766 crate::model::ListMirroringDeploymentGroupsResponse,
11767 crate::Error,
11768 > {
11769 use std::clone::Clone;
11770 let token = self.0.request.page_token.clone();
11771 let execute = move |token: String| {
11772 let mut builder = self.clone();
11773 builder.0.request = builder.0.request.set_page_token(token);
11774 builder.send()
11775 };
11776 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11777 }
11778
11779 pub fn by_item(
11781 self,
11782 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11783 crate::model::ListMirroringDeploymentGroupsResponse,
11784 crate::Error,
11785 > {
11786 use google_cloud_gax::paginator::Paginator;
11787 self.by_page().items()
11788 }
11789
11790 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11794 self.0.request.parent = v.into();
11795 self
11796 }
11797
11798 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11800 self.0.request.page_size = v.into();
11801 self
11802 }
11803
11804 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11806 self.0.request.page_token = v.into();
11807 self
11808 }
11809
11810 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11812 self.0.request.filter = v.into();
11813 self
11814 }
11815
11816 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11818 self.0.request.order_by = v.into();
11819 self
11820 }
11821 }
11822
11823 #[doc(hidden)]
11824 impl crate::RequestBuilder for ListMirroringDeploymentGroups {
11825 fn request_options(&mut self) -> &mut crate::RequestOptions {
11826 &mut self.0.options
11827 }
11828 }
11829
11830 #[derive(Clone, Debug)]
11847 pub struct GetMirroringDeploymentGroup(
11848 RequestBuilder<crate::model::GetMirroringDeploymentGroupRequest>,
11849 );
11850
11851 impl GetMirroringDeploymentGroup {
11852 pub(crate) fn new(
11853 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11854 ) -> Self {
11855 Self(RequestBuilder::new(stub))
11856 }
11857
11858 pub fn with_request<V: Into<crate::model::GetMirroringDeploymentGroupRequest>>(
11860 mut self,
11861 v: V,
11862 ) -> Self {
11863 self.0.request = v.into();
11864 self
11865 }
11866
11867 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11869 self.0.options = v.into();
11870 self
11871 }
11872
11873 pub async fn send(self) -> Result<crate::model::MirroringDeploymentGroup> {
11875 (*self.0.stub)
11876 .get_mirroring_deployment_group(self.0.request, self.0.options)
11877 .await
11878 .map(crate::Response::into_body)
11879 }
11880
11881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11885 self.0.request.name = v.into();
11886 self
11887 }
11888 }
11889
11890 #[doc(hidden)]
11891 impl crate::RequestBuilder for GetMirroringDeploymentGroup {
11892 fn request_options(&mut self) -> &mut crate::RequestOptions {
11893 &mut self.0.options
11894 }
11895 }
11896
11897 #[derive(Clone, Debug)]
11915 pub struct CreateMirroringDeploymentGroup(
11916 RequestBuilder<crate::model::CreateMirroringDeploymentGroupRequest>,
11917 );
11918
11919 impl CreateMirroringDeploymentGroup {
11920 pub(crate) fn new(
11921 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11922 ) -> Self {
11923 Self(RequestBuilder::new(stub))
11924 }
11925
11926 pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentGroupRequest>>(
11928 mut self,
11929 v: V,
11930 ) -> Self {
11931 self.0.request = v.into();
11932 self
11933 }
11934
11935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11937 self.0.options = v.into();
11938 self
11939 }
11940
11941 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11948 (*self.0.stub)
11949 .create_mirroring_deployment_group(self.0.request, self.0.options)
11950 .await
11951 .map(crate::Response::into_body)
11952 }
11953
11954 pub fn poller(
11956 self,
11957 ) -> impl google_cloud_lro::Poller<
11958 crate::model::MirroringDeploymentGroup,
11959 crate::model::OperationMetadata,
11960 > {
11961 type Operation = google_cloud_lro::internal::Operation<
11962 crate::model::MirroringDeploymentGroup,
11963 crate::model::OperationMetadata,
11964 >;
11965 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11966 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11967
11968 let stub = self.0.stub.clone();
11969 let mut options = self.0.options.clone();
11970 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11971 let query = move |name| {
11972 let stub = stub.clone();
11973 let options = options.clone();
11974 async {
11975 let op = GetOperation::new(stub)
11976 .set_name(name)
11977 .with_options(options)
11978 .send()
11979 .await?;
11980 Ok(Operation::new(op))
11981 }
11982 };
11983
11984 let start = move || async {
11985 let op = self.send().await?;
11986 Ok(Operation::new(op))
11987 };
11988
11989 google_cloud_lro::internal::new_poller(
11990 polling_error_policy,
11991 polling_backoff_policy,
11992 start,
11993 query,
11994 )
11995 }
11996
11997 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12001 self.0.request.parent = v.into();
12002 self
12003 }
12004
12005 pub fn set_mirroring_deployment_group_id<T: Into<std::string::String>>(
12009 mut self,
12010 v: T,
12011 ) -> Self {
12012 self.0.request.mirroring_deployment_group_id = v.into();
12013 self
12014 }
12015
12016 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12020 where
12021 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12022 {
12023 self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12024 self
12025 }
12026
12027 pub fn set_or_clear_mirroring_deployment_group<T>(
12031 mut self,
12032 v: std::option::Option<T>,
12033 ) -> Self
12034 where
12035 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12036 {
12037 self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12038 self
12039 }
12040
12041 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12043 self.0.request.request_id = v.into();
12044 self
12045 }
12046 }
12047
12048 #[doc(hidden)]
12049 impl crate::RequestBuilder for CreateMirroringDeploymentGroup {
12050 fn request_options(&mut self) -> &mut crate::RequestOptions {
12051 &mut self.0.options
12052 }
12053 }
12054
12055 #[derive(Clone, Debug)]
12073 pub struct UpdateMirroringDeploymentGroup(
12074 RequestBuilder<crate::model::UpdateMirroringDeploymentGroupRequest>,
12075 );
12076
12077 impl UpdateMirroringDeploymentGroup {
12078 pub(crate) fn new(
12079 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12080 ) -> Self {
12081 Self(RequestBuilder::new(stub))
12082 }
12083
12084 pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentGroupRequest>>(
12086 mut self,
12087 v: V,
12088 ) -> Self {
12089 self.0.request = v.into();
12090 self
12091 }
12092
12093 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12095 self.0.options = v.into();
12096 self
12097 }
12098
12099 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12106 (*self.0.stub)
12107 .update_mirroring_deployment_group(self.0.request, self.0.options)
12108 .await
12109 .map(crate::Response::into_body)
12110 }
12111
12112 pub fn poller(
12114 self,
12115 ) -> impl google_cloud_lro::Poller<
12116 crate::model::MirroringDeploymentGroup,
12117 crate::model::OperationMetadata,
12118 > {
12119 type Operation = google_cloud_lro::internal::Operation<
12120 crate::model::MirroringDeploymentGroup,
12121 crate::model::OperationMetadata,
12122 >;
12123 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12124 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12125
12126 let stub = self.0.stub.clone();
12127 let mut options = self.0.options.clone();
12128 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12129 let query = move |name| {
12130 let stub = stub.clone();
12131 let options = options.clone();
12132 async {
12133 let op = GetOperation::new(stub)
12134 .set_name(name)
12135 .with_options(options)
12136 .send()
12137 .await?;
12138 Ok(Operation::new(op))
12139 }
12140 };
12141
12142 let start = move || async {
12143 let op = self.send().await?;
12144 Ok(Operation::new(op))
12145 };
12146
12147 google_cloud_lro::internal::new_poller(
12148 polling_error_policy,
12149 polling_backoff_policy,
12150 start,
12151 query,
12152 )
12153 }
12154
12155 pub fn set_update_mask<T>(mut self, v: T) -> Self
12157 where
12158 T: std::convert::Into<wkt::FieldMask>,
12159 {
12160 self.0.request.update_mask = std::option::Option::Some(v.into());
12161 self
12162 }
12163
12164 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12166 where
12167 T: std::convert::Into<wkt::FieldMask>,
12168 {
12169 self.0.request.update_mask = v.map(|x| x.into());
12170 self
12171 }
12172
12173 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12177 where
12178 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12179 {
12180 self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12181 self
12182 }
12183
12184 pub fn set_or_clear_mirroring_deployment_group<T>(
12188 mut self,
12189 v: std::option::Option<T>,
12190 ) -> Self
12191 where
12192 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12193 {
12194 self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12195 self
12196 }
12197
12198 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12200 self.0.request.request_id = v.into();
12201 self
12202 }
12203 }
12204
12205 #[doc(hidden)]
12206 impl crate::RequestBuilder for UpdateMirroringDeploymentGroup {
12207 fn request_options(&mut self) -> &mut crate::RequestOptions {
12208 &mut self.0.options
12209 }
12210 }
12211
12212 #[derive(Clone, Debug)]
12230 pub struct DeleteMirroringDeploymentGroup(
12231 RequestBuilder<crate::model::DeleteMirroringDeploymentGroupRequest>,
12232 );
12233
12234 impl DeleteMirroringDeploymentGroup {
12235 pub(crate) fn new(
12236 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12237 ) -> Self {
12238 Self(RequestBuilder::new(stub))
12239 }
12240
12241 pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentGroupRequest>>(
12243 mut self,
12244 v: V,
12245 ) -> Self {
12246 self.0.request = v.into();
12247 self
12248 }
12249
12250 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12252 self.0.options = v.into();
12253 self
12254 }
12255
12256 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12263 (*self.0.stub)
12264 .delete_mirroring_deployment_group(self.0.request, self.0.options)
12265 .await
12266 .map(crate::Response::into_body)
12267 }
12268
12269 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12271 type Operation =
12272 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12273 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12274 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12275
12276 let stub = self.0.stub.clone();
12277 let mut options = self.0.options.clone();
12278 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12279 let query = move |name| {
12280 let stub = stub.clone();
12281 let options = options.clone();
12282 async {
12283 let op = GetOperation::new(stub)
12284 .set_name(name)
12285 .with_options(options)
12286 .send()
12287 .await?;
12288 Ok(Operation::new(op))
12289 }
12290 };
12291
12292 let start = move || async {
12293 let op = self.send().await?;
12294 Ok(Operation::new(op))
12295 };
12296
12297 google_cloud_lro::internal::new_unit_response_poller(
12298 polling_error_policy,
12299 polling_backoff_policy,
12300 start,
12301 query,
12302 )
12303 }
12304
12305 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12309 self.0.request.name = v.into();
12310 self
12311 }
12312
12313 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12315 self.0.request.request_id = v.into();
12316 self
12317 }
12318 }
12319
12320 #[doc(hidden)]
12321 impl crate::RequestBuilder for DeleteMirroringDeploymentGroup {
12322 fn request_options(&mut self) -> &mut crate::RequestOptions {
12323 &mut self.0.options
12324 }
12325 }
12326
12327 #[derive(Clone, Debug)]
12348 pub struct ListMirroringDeployments(
12349 RequestBuilder<crate::model::ListMirroringDeploymentsRequest>,
12350 );
12351
12352 impl ListMirroringDeployments {
12353 pub(crate) fn new(
12354 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12355 ) -> Self {
12356 Self(RequestBuilder::new(stub))
12357 }
12358
12359 pub fn with_request<V: Into<crate::model::ListMirroringDeploymentsRequest>>(
12361 mut self,
12362 v: V,
12363 ) -> Self {
12364 self.0.request = v.into();
12365 self
12366 }
12367
12368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12370 self.0.options = v.into();
12371 self
12372 }
12373
12374 pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentsResponse> {
12376 (*self.0.stub)
12377 .list_mirroring_deployments(self.0.request, self.0.options)
12378 .await
12379 .map(crate::Response::into_body)
12380 }
12381
12382 pub fn by_page(
12384 self,
12385 ) -> impl google_cloud_gax::paginator::Paginator<
12386 crate::model::ListMirroringDeploymentsResponse,
12387 crate::Error,
12388 > {
12389 use std::clone::Clone;
12390 let token = self.0.request.page_token.clone();
12391 let execute = move |token: String| {
12392 let mut builder = self.clone();
12393 builder.0.request = builder.0.request.set_page_token(token);
12394 builder.send()
12395 };
12396 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12397 }
12398
12399 pub fn by_item(
12401 self,
12402 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12403 crate::model::ListMirroringDeploymentsResponse,
12404 crate::Error,
12405 > {
12406 use google_cloud_gax::paginator::Paginator;
12407 self.by_page().items()
12408 }
12409
12410 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12414 self.0.request.parent = v.into();
12415 self
12416 }
12417
12418 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12420 self.0.request.page_size = v.into();
12421 self
12422 }
12423
12424 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12426 self.0.request.page_token = v.into();
12427 self
12428 }
12429
12430 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12432 self.0.request.filter = v.into();
12433 self
12434 }
12435
12436 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12438 self.0.request.order_by = v.into();
12439 self
12440 }
12441 }
12442
12443 #[doc(hidden)]
12444 impl crate::RequestBuilder for ListMirroringDeployments {
12445 fn request_options(&mut self) -> &mut crate::RequestOptions {
12446 &mut self.0.options
12447 }
12448 }
12449
12450 #[derive(Clone, Debug)]
12467 pub struct GetMirroringDeployment(RequestBuilder<crate::model::GetMirroringDeploymentRequest>);
12468
12469 impl GetMirroringDeployment {
12470 pub(crate) fn new(
12471 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12472 ) -> Self {
12473 Self(RequestBuilder::new(stub))
12474 }
12475
12476 pub fn with_request<V: Into<crate::model::GetMirroringDeploymentRequest>>(
12478 mut self,
12479 v: V,
12480 ) -> Self {
12481 self.0.request = v.into();
12482 self
12483 }
12484
12485 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12487 self.0.options = v.into();
12488 self
12489 }
12490
12491 pub async fn send(self) -> Result<crate::model::MirroringDeployment> {
12493 (*self.0.stub)
12494 .get_mirroring_deployment(self.0.request, self.0.options)
12495 .await
12496 .map(crate::Response::into_body)
12497 }
12498
12499 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12503 self.0.request.name = v.into();
12504 self
12505 }
12506 }
12507
12508 #[doc(hidden)]
12509 impl crate::RequestBuilder for GetMirroringDeployment {
12510 fn request_options(&mut self) -> &mut crate::RequestOptions {
12511 &mut self.0.options
12512 }
12513 }
12514
12515 #[derive(Clone, Debug)]
12533 pub struct CreateMirroringDeployment(
12534 RequestBuilder<crate::model::CreateMirroringDeploymentRequest>,
12535 );
12536
12537 impl CreateMirroringDeployment {
12538 pub(crate) fn new(
12539 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12540 ) -> Self {
12541 Self(RequestBuilder::new(stub))
12542 }
12543
12544 pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentRequest>>(
12546 mut self,
12547 v: V,
12548 ) -> Self {
12549 self.0.request = v.into();
12550 self
12551 }
12552
12553 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12555 self.0.options = v.into();
12556 self
12557 }
12558
12559 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12566 (*self.0.stub)
12567 .create_mirroring_deployment(self.0.request, self.0.options)
12568 .await
12569 .map(crate::Response::into_body)
12570 }
12571
12572 pub fn poller(
12574 self,
12575 ) -> impl google_cloud_lro::Poller<
12576 crate::model::MirroringDeployment,
12577 crate::model::OperationMetadata,
12578 > {
12579 type Operation = google_cloud_lro::internal::Operation<
12580 crate::model::MirroringDeployment,
12581 crate::model::OperationMetadata,
12582 >;
12583 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12584 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12585
12586 let stub = self.0.stub.clone();
12587 let mut options = self.0.options.clone();
12588 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12589 let query = move |name| {
12590 let stub = stub.clone();
12591 let options = options.clone();
12592 async {
12593 let op = GetOperation::new(stub)
12594 .set_name(name)
12595 .with_options(options)
12596 .send()
12597 .await?;
12598 Ok(Operation::new(op))
12599 }
12600 };
12601
12602 let start = move || async {
12603 let op = self.send().await?;
12604 Ok(Operation::new(op))
12605 };
12606
12607 google_cloud_lro::internal::new_poller(
12608 polling_error_policy,
12609 polling_backoff_policy,
12610 start,
12611 query,
12612 )
12613 }
12614
12615 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12619 self.0.request.parent = v.into();
12620 self
12621 }
12622
12623 pub fn set_mirroring_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12627 self.0.request.mirroring_deployment_id = v.into();
12628 self
12629 }
12630
12631 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
12635 where
12636 T: std::convert::Into<crate::model::MirroringDeployment>,
12637 {
12638 self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
12639 self
12640 }
12641
12642 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
12646 where
12647 T: std::convert::Into<crate::model::MirroringDeployment>,
12648 {
12649 self.0.request.mirroring_deployment = v.map(|x| x.into());
12650 self
12651 }
12652
12653 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12655 self.0.request.request_id = v.into();
12656 self
12657 }
12658 }
12659
12660 #[doc(hidden)]
12661 impl crate::RequestBuilder for CreateMirroringDeployment {
12662 fn request_options(&mut self) -> &mut crate::RequestOptions {
12663 &mut self.0.options
12664 }
12665 }
12666
12667 #[derive(Clone, Debug)]
12685 pub struct UpdateMirroringDeployment(
12686 RequestBuilder<crate::model::UpdateMirroringDeploymentRequest>,
12687 );
12688
12689 impl UpdateMirroringDeployment {
12690 pub(crate) fn new(
12691 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12692 ) -> Self {
12693 Self(RequestBuilder::new(stub))
12694 }
12695
12696 pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentRequest>>(
12698 mut self,
12699 v: V,
12700 ) -> Self {
12701 self.0.request = v.into();
12702 self
12703 }
12704
12705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12707 self.0.options = v.into();
12708 self
12709 }
12710
12711 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12718 (*self.0.stub)
12719 .update_mirroring_deployment(self.0.request, self.0.options)
12720 .await
12721 .map(crate::Response::into_body)
12722 }
12723
12724 pub fn poller(
12726 self,
12727 ) -> impl google_cloud_lro::Poller<
12728 crate::model::MirroringDeployment,
12729 crate::model::OperationMetadata,
12730 > {
12731 type Operation = google_cloud_lro::internal::Operation<
12732 crate::model::MirroringDeployment,
12733 crate::model::OperationMetadata,
12734 >;
12735 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12736 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12737
12738 let stub = self.0.stub.clone();
12739 let mut options = self.0.options.clone();
12740 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12741 let query = move |name| {
12742 let stub = stub.clone();
12743 let options = options.clone();
12744 async {
12745 let op = GetOperation::new(stub)
12746 .set_name(name)
12747 .with_options(options)
12748 .send()
12749 .await?;
12750 Ok(Operation::new(op))
12751 }
12752 };
12753
12754 let start = move || async {
12755 let op = self.send().await?;
12756 Ok(Operation::new(op))
12757 };
12758
12759 google_cloud_lro::internal::new_poller(
12760 polling_error_policy,
12761 polling_backoff_policy,
12762 start,
12763 query,
12764 )
12765 }
12766
12767 pub fn set_update_mask<T>(mut self, v: T) -> Self
12769 where
12770 T: std::convert::Into<wkt::FieldMask>,
12771 {
12772 self.0.request.update_mask = std::option::Option::Some(v.into());
12773 self
12774 }
12775
12776 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12778 where
12779 T: std::convert::Into<wkt::FieldMask>,
12780 {
12781 self.0.request.update_mask = v.map(|x| x.into());
12782 self
12783 }
12784
12785 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
12789 where
12790 T: std::convert::Into<crate::model::MirroringDeployment>,
12791 {
12792 self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
12793 self
12794 }
12795
12796 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
12800 where
12801 T: std::convert::Into<crate::model::MirroringDeployment>,
12802 {
12803 self.0.request.mirroring_deployment = v.map(|x| x.into());
12804 self
12805 }
12806
12807 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12809 self.0.request.request_id = v.into();
12810 self
12811 }
12812 }
12813
12814 #[doc(hidden)]
12815 impl crate::RequestBuilder for UpdateMirroringDeployment {
12816 fn request_options(&mut self) -> &mut crate::RequestOptions {
12817 &mut self.0.options
12818 }
12819 }
12820
12821 #[derive(Clone, Debug)]
12839 pub struct DeleteMirroringDeployment(
12840 RequestBuilder<crate::model::DeleteMirroringDeploymentRequest>,
12841 );
12842
12843 impl DeleteMirroringDeployment {
12844 pub(crate) fn new(
12845 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12846 ) -> Self {
12847 Self(RequestBuilder::new(stub))
12848 }
12849
12850 pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentRequest>>(
12852 mut self,
12853 v: V,
12854 ) -> Self {
12855 self.0.request = v.into();
12856 self
12857 }
12858
12859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12861 self.0.options = v.into();
12862 self
12863 }
12864
12865 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12872 (*self.0.stub)
12873 .delete_mirroring_deployment(self.0.request, self.0.options)
12874 .await
12875 .map(crate::Response::into_body)
12876 }
12877
12878 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12880 type Operation =
12881 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12882 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12883 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12884
12885 let stub = self.0.stub.clone();
12886 let mut options = self.0.options.clone();
12887 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12888 let query = move |name| {
12889 let stub = stub.clone();
12890 let options = options.clone();
12891 async {
12892 let op = GetOperation::new(stub)
12893 .set_name(name)
12894 .with_options(options)
12895 .send()
12896 .await?;
12897 Ok(Operation::new(op))
12898 }
12899 };
12900
12901 let start = move || async {
12902 let op = self.send().await?;
12903 Ok(Operation::new(op))
12904 };
12905
12906 google_cloud_lro::internal::new_unit_response_poller(
12907 polling_error_policy,
12908 polling_backoff_policy,
12909 start,
12910 query,
12911 )
12912 }
12913
12914 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12918 self.0.request.name = v.into();
12919 self
12920 }
12921
12922 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12924 self.0.request.request_id = v.into();
12925 self
12926 }
12927 }
12928
12929 #[doc(hidden)]
12930 impl crate::RequestBuilder for DeleteMirroringDeployment {
12931 fn request_options(&mut self) -> &mut crate::RequestOptions {
12932 &mut self.0.options
12933 }
12934 }
12935
12936 #[derive(Clone, Debug)]
12957 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12958
12959 impl ListLocations {
12960 pub(crate) fn new(
12961 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12962 ) -> Self {
12963 Self(RequestBuilder::new(stub))
12964 }
12965
12966 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12968 mut self,
12969 v: V,
12970 ) -> Self {
12971 self.0.request = v.into();
12972 self
12973 }
12974
12975 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12977 self.0.options = v.into();
12978 self
12979 }
12980
12981 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12983 (*self.0.stub)
12984 .list_locations(self.0.request, self.0.options)
12985 .await
12986 .map(crate::Response::into_body)
12987 }
12988
12989 pub fn by_page(
12991 self,
12992 ) -> impl google_cloud_gax::paginator::Paginator<
12993 google_cloud_location::model::ListLocationsResponse,
12994 crate::Error,
12995 > {
12996 use std::clone::Clone;
12997 let token = self.0.request.page_token.clone();
12998 let execute = move |token: String| {
12999 let mut builder = self.clone();
13000 builder.0.request = builder.0.request.set_page_token(token);
13001 builder.send()
13002 };
13003 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13004 }
13005
13006 pub fn by_item(
13008 self,
13009 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13010 google_cloud_location::model::ListLocationsResponse,
13011 crate::Error,
13012 > {
13013 use google_cloud_gax::paginator::Paginator;
13014 self.by_page().items()
13015 }
13016
13017 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13019 self.0.request.name = v.into();
13020 self
13021 }
13022
13023 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13025 self.0.request.filter = v.into();
13026 self
13027 }
13028
13029 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13031 self.0.request.page_size = v.into();
13032 self
13033 }
13034
13035 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13037 self.0.request.page_token = v.into();
13038 self
13039 }
13040 }
13041
13042 #[doc(hidden)]
13043 impl crate::RequestBuilder for ListLocations {
13044 fn request_options(&mut self) -> &mut crate::RequestOptions {
13045 &mut self.0.options
13046 }
13047 }
13048
13049 #[derive(Clone, Debug)]
13066 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13067
13068 impl GetLocation {
13069 pub(crate) fn new(
13070 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13071 ) -> Self {
13072 Self(RequestBuilder::new(stub))
13073 }
13074
13075 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13077 mut self,
13078 v: V,
13079 ) -> Self {
13080 self.0.request = v.into();
13081 self
13082 }
13083
13084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13086 self.0.options = v.into();
13087 self
13088 }
13089
13090 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13092 (*self.0.stub)
13093 .get_location(self.0.request, self.0.options)
13094 .await
13095 .map(crate::Response::into_body)
13096 }
13097
13098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13100 self.0.request.name = v.into();
13101 self
13102 }
13103 }
13104
13105 #[doc(hidden)]
13106 impl crate::RequestBuilder for GetLocation {
13107 fn request_options(&mut self) -> &mut crate::RequestOptions {
13108 &mut self.0.options
13109 }
13110 }
13111
13112 #[derive(Clone, Debug)]
13129 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13130
13131 impl SetIamPolicy {
13132 pub(crate) fn new(
13133 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13134 ) -> Self {
13135 Self(RequestBuilder::new(stub))
13136 }
13137
13138 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13140 mut self,
13141 v: V,
13142 ) -> Self {
13143 self.0.request = v.into();
13144 self
13145 }
13146
13147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13149 self.0.options = v.into();
13150 self
13151 }
13152
13153 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13155 (*self.0.stub)
13156 .set_iam_policy(self.0.request, self.0.options)
13157 .await
13158 .map(crate::Response::into_body)
13159 }
13160
13161 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13165 self.0.request.resource = v.into();
13166 self
13167 }
13168
13169 pub fn set_policy<T>(mut self, v: T) -> Self
13173 where
13174 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13175 {
13176 self.0.request.policy = std::option::Option::Some(v.into());
13177 self
13178 }
13179
13180 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13184 where
13185 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13186 {
13187 self.0.request.policy = v.map(|x| x.into());
13188 self
13189 }
13190
13191 pub fn set_update_mask<T>(mut self, v: T) -> Self
13193 where
13194 T: std::convert::Into<wkt::FieldMask>,
13195 {
13196 self.0.request.update_mask = std::option::Option::Some(v.into());
13197 self
13198 }
13199
13200 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13202 where
13203 T: std::convert::Into<wkt::FieldMask>,
13204 {
13205 self.0.request.update_mask = v.map(|x| x.into());
13206 self
13207 }
13208 }
13209
13210 #[doc(hidden)]
13211 impl crate::RequestBuilder for SetIamPolicy {
13212 fn request_options(&mut self) -> &mut crate::RequestOptions {
13213 &mut self.0.options
13214 }
13215 }
13216
13217 #[derive(Clone, Debug)]
13234 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13235
13236 impl GetIamPolicy {
13237 pub(crate) fn new(
13238 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13239 ) -> Self {
13240 Self(RequestBuilder::new(stub))
13241 }
13242
13243 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13245 mut self,
13246 v: V,
13247 ) -> Self {
13248 self.0.request = v.into();
13249 self
13250 }
13251
13252 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13254 self.0.options = v.into();
13255 self
13256 }
13257
13258 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13260 (*self.0.stub)
13261 .get_iam_policy(self.0.request, self.0.options)
13262 .await
13263 .map(crate::Response::into_body)
13264 }
13265
13266 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13270 self.0.request.resource = v.into();
13271 self
13272 }
13273
13274 pub fn set_options<T>(mut self, v: T) -> Self
13276 where
13277 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13278 {
13279 self.0.request.options = std::option::Option::Some(v.into());
13280 self
13281 }
13282
13283 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13285 where
13286 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13287 {
13288 self.0.request.options = v.map(|x| x.into());
13289 self
13290 }
13291 }
13292
13293 #[doc(hidden)]
13294 impl crate::RequestBuilder for GetIamPolicy {
13295 fn request_options(&mut self) -> &mut crate::RequestOptions {
13296 &mut self.0.options
13297 }
13298 }
13299
13300 #[derive(Clone, Debug)]
13317 pub struct TestIamPermissions(
13318 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13319 );
13320
13321 impl TestIamPermissions {
13322 pub(crate) fn new(
13323 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13324 ) -> Self {
13325 Self(RequestBuilder::new(stub))
13326 }
13327
13328 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13330 mut self,
13331 v: V,
13332 ) -> Self {
13333 self.0.request = v.into();
13334 self
13335 }
13336
13337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13339 self.0.options = v.into();
13340 self
13341 }
13342
13343 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13345 (*self.0.stub)
13346 .test_iam_permissions(self.0.request, self.0.options)
13347 .await
13348 .map(crate::Response::into_body)
13349 }
13350
13351 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13355 self.0.request.resource = v.into();
13356 self
13357 }
13358
13359 pub fn set_permissions<T, V>(mut self, v: T) -> Self
13363 where
13364 T: std::iter::IntoIterator<Item = V>,
13365 V: std::convert::Into<std::string::String>,
13366 {
13367 use std::iter::Iterator;
13368 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13369 self
13370 }
13371 }
13372
13373 #[doc(hidden)]
13374 impl crate::RequestBuilder for TestIamPermissions {
13375 fn request_options(&mut self) -> &mut crate::RequestOptions {
13376 &mut self.0.options
13377 }
13378 }
13379
13380 #[derive(Clone, Debug)]
13401 pub struct ListOperations(
13402 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13403 );
13404
13405 impl ListOperations {
13406 pub(crate) fn new(
13407 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13408 ) -> Self {
13409 Self(RequestBuilder::new(stub))
13410 }
13411
13412 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13414 mut self,
13415 v: V,
13416 ) -> Self {
13417 self.0.request = v.into();
13418 self
13419 }
13420
13421 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13423 self.0.options = v.into();
13424 self
13425 }
13426
13427 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13429 (*self.0.stub)
13430 .list_operations(self.0.request, self.0.options)
13431 .await
13432 .map(crate::Response::into_body)
13433 }
13434
13435 pub fn by_page(
13437 self,
13438 ) -> impl google_cloud_gax::paginator::Paginator<
13439 google_cloud_longrunning::model::ListOperationsResponse,
13440 crate::Error,
13441 > {
13442 use std::clone::Clone;
13443 let token = self.0.request.page_token.clone();
13444 let execute = move |token: String| {
13445 let mut builder = self.clone();
13446 builder.0.request = builder.0.request.set_page_token(token);
13447 builder.send()
13448 };
13449 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13450 }
13451
13452 pub fn by_item(
13454 self,
13455 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13456 google_cloud_longrunning::model::ListOperationsResponse,
13457 crate::Error,
13458 > {
13459 use google_cloud_gax::paginator::Paginator;
13460 self.by_page().items()
13461 }
13462
13463 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13465 self.0.request.name = v.into();
13466 self
13467 }
13468
13469 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13471 self.0.request.filter = v.into();
13472 self
13473 }
13474
13475 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13477 self.0.request.page_size = v.into();
13478 self
13479 }
13480
13481 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13483 self.0.request.page_token = v.into();
13484 self
13485 }
13486
13487 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13489 self.0.request.return_partial_success = v.into();
13490 self
13491 }
13492 }
13493
13494 #[doc(hidden)]
13495 impl crate::RequestBuilder for ListOperations {
13496 fn request_options(&mut self) -> &mut crate::RequestOptions {
13497 &mut self.0.options
13498 }
13499 }
13500
13501 #[derive(Clone, Debug)]
13518 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13519
13520 impl GetOperation {
13521 pub(crate) fn new(
13522 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13523 ) -> Self {
13524 Self(RequestBuilder::new(stub))
13525 }
13526
13527 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13529 mut self,
13530 v: V,
13531 ) -> Self {
13532 self.0.request = v.into();
13533 self
13534 }
13535
13536 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13538 self.0.options = v.into();
13539 self
13540 }
13541
13542 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13544 (*self.0.stub)
13545 .get_operation(self.0.request, self.0.options)
13546 .await
13547 .map(crate::Response::into_body)
13548 }
13549
13550 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13552 self.0.request.name = v.into();
13553 self
13554 }
13555 }
13556
13557 #[doc(hidden)]
13558 impl crate::RequestBuilder for GetOperation {
13559 fn request_options(&mut self) -> &mut crate::RequestOptions {
13560 &mut self.0.options
13561 }
13562 }
13563
13564 #[derive(Clone, Debug)]
13581 pub struct DeleteOperation(
13582 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
13583 );
13584
13585 impl DeleteOperation {
13586 pub(crate) fn new(
13587 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13588 ) -> Self {
13589 Self(RequestBuilder::new(stub))
13590 }
13591
13592 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
13594 mut self,
13595 v: V,
13596 ) -> Self {
13597 self.0.request = v.into();
13598 self
13599 }
13600
13601 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13603 self.0.options = v.into();
13604 self
13605 }
13606
13607 pub async fn send(self) -> Result<()> {
13609 (*self.0.stub)
13610 .delete_operation(self.0.request, self.0.options)
13611 .await
13612 .map(crate::Response::into_body)
13613 }
13614
13615 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13617 self.0.request.name = v.into();
13618 self
13619 }
13620 }
13621
13622 #[doc(hidden)]
13623 impl crate::RequestBuilder for DeleteOperation {
13624 fn request_options(&mut self) -> &mut crate::RequestOptions {
13625 &mut self.0.options
13626 }
13627 }
13628
13629 #[derive(Clone, Debug)]
13646 pub struct CancelOperation(
13647 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13648 );
13649
13650 impl CancelOperation {
13651 pub(crate) fn new(
13652 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13653 ) -> Self {
13654 Self(RequestBuilder::new(stub))
13655 }
13656
13657 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13659 mut self,
13660 v: V,
13661 ) -> Self {
13662 self.0.request = v.into();
13663 self
13664 }
13665
13666 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13668 self.0.options = v.into();
13669 self
13670 }
13671
13672 pub async fn send(self) -> Result<()> {
13674 (*self.0.stub)
13675 .cancel_operation(self.0.request, self.0.options)
13676 .await
13677 .map(crate::Response::into_body)
13678 }
13679
13680 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13682 self.0.request.name = v.into();
13683 self
13684 }
13685 }
13686
13687 #[doc(hidden)]
13688 impl crate::RequestBuilder for CancelOperation {
13689 fn request_options(&mut self) -> &mut crate::RequestOptions {
13690 &mut self.0.options
13691 }
13692 }
13693}
13694
13695pub mod network_security {
13697 use crate::Result;
13698
13699 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13713
13714 pub(crate) mod client {
13715 use super::super::super::client::NetworkSecurity;
13716 pub struct Factory;
13717 impl crate::ClientFactory for Factory {
13718 type Client = NetworkSecurity;
13719 type Credentials = gaxi::options::Credentials;
13720 async fn build(
13721 self,
13722 config: gaxi::options::ClientConfig,
13723 ) -> crate::ClientBuilderResult<Self::Client> {
13724 Self::Client::new(config).await
13725 }
13726 }
13727 }
13728
13729 #[derive(Clone, Debug)]
13731 pub(crate) struct RequestBuilder<R: std::default::Default> {
13732 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13733 request: R,
13734 options: crate::RequestOptions,
13735 }
13736
13737 impl<R> RequestBuilder<R>
13738 where
13739 R: std::default::Default,
13740 {
13741 pub(crate) fn new(
13742 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13743 ) -> Self {
13744 Self {
13745 stub,
13746 request: R::default(),
13747 options: crate::RequestOptions::default(),
13748 }
13749 }
13750 }
13751
13752 #[derive(Clone, Debug)]
13773 pub struct ListAuthorizationPolicies(
13774 RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
13775 );
13776
13777 impl ListAuthorizationPolicies {
13778 pub(crate) fn new(
13779 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13780 ) -> Self {
13781 Self(RequestBuilder::new(stub))
13782 }
13783
13784 pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
13786 mut self,
13787 v: V,
13788 ) -> Self {
13789 self.0.request = v.into();
13790 self
13791 }
13792
13793 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13795 self.0.options = v.into();
13796 self
13797 }
13798
13799 pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
13801 (*self.0.stub)
13802 .list_authorization_policies(self.0.request, self.0.options)
13803 .await
13804 .map(crate::Response::into_body)
13805 }
13806
13807 pub fn by_page(
13809 self,
13810 ) -> impl google_cloud_gax::paginator::Paginator<
13811 crate::model::ListAuthorizationPoliciesResponse,
13812 crate::Error,
13813 > {
13814 use std::clone::Clone;
13815 let token = self.0.request.page_token.clone();
13816 let execute = move |token: String| {
13817 let mut builder = self.clone();
13818 builder.0.request = builder.0.request.set_page_token(token);
13819 builder.send()
13820 };
13821 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13822 }
13823
13824 pub fn by_item(
13826 self,
13827 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13828 crate::model::ListAuthorizationPoliciesResponse,
13829 crate::Error,
13830 > {
13831 use google_cloud_gax::paginator::Paginator;
13832 self.by_page().items()
13833 }
13834
13835 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13839 self.0.request.parent = v.into();
13840 self
13841 }
13842
13843 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13845 self.0.request.page_size = v.into();
13846 self
13847 }
13848
13849 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13851 self.0.request.page_token = v.into();
13852 self
13853 }
13854 }
13855
13856 #[doc(hidden)]
13857 impl crate::RequestBuilder for ListAuthorizationPolicies {
13858 fn request_options(&mut self) -> &mut crate::RequestOptions {
13859 &mut self.0.options
13860 }
13861 }
13862
13863 #[derive(Clone, Debug)]
13880 pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
13881
13882 impl GetAuthorizationPolicy {
13883 pub(crate) fn new(
13884 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13885 ) -> Self {
13886 Self(RequestBuilder::new(stub))
13887 }
13888
13889 pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
13891 mut self,
13892 v: V,
13893 ) -> Self {
13894 self.0.request = v.into();
13895 self
13896 }
13897
13898 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13900 self.0.options = v.into();
13901 self
13902 }
13903
13904 pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
13906 (*self.0.stub)
13907 .get_authorization_policy(self.0.request, self.0.options)
13908 .await
13909 .map(crate::Response::into_body)
13910 }
13911
13912 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13916 self.0.request.name = v.into();
13917 self
13918 }
13919 }
13920
13921 #[doc(hidden)]
13922 impl crate::RequestBuilder for GetAuthorizationPolicy {
13923 fn request_options(&mut self) -> &mut crate::RequestOptions {
13924 &mut self.0.options
13925 }
13926 }
13927
13928 #[derive(Clone, Debug)]
13946 pub struct CreateAuthorizationPolicy(
13947 RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
13948 );
13949
13950 impl CreateAuthorizationPolicy {
13951 pub(crate) fn new(
13952 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13953 ) -> Self {
13954 Self(RequestBuilder::new(stub))
13955 }
13956
13957 pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
13959 mut self,
13960 v: V,
13961 ) -> Self {
13962 self.0.request = v.into();
13963 self
13964 }
13965
13966 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13968 self.0.options = v.into();
13969 self
13970 }
13971
13972 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13979 (*self.0.stub)
13980 .create_authorization_policy(self.0.request, self.0.options)
13981 .await
13982 .map(crate::Response::into_body)
13983 }
13984
13985 pub fn poller(
13987 self,
13988 ) -> impl google_cloud_lro::Poller<
13989 crate::model::AuthorizationPolicy,
13990 crate::model::OperationMetadata,
13991 > {
13992 type Operation = google_cloud_lro::internal::Operation<
13993 crate::model::AuthorizationPolicy,
13994 crate::model::OperationMetadata,
13995 >;
13996 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13997 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13998
13999 let stub = self.0.stub.clone();
14000 let mut options = self.0.options.clone();
14001 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14002 let query = move |name| {
14003 let stub = stub.clone();
14004 let options = options.clone();
14005 async {
14006 let op = GetOperation::new(stub)
14007 .set_name(name)
14008 .with_options(options)
14009 .send()
14010 .await?;
14011 Ok(Operation::new(op))
14012 }
14013 };
14014
14015 let start = move || async {
14016 let op = self.send().await?;
14017 Ok(Operation::new(op))
14018 };
14019
14020 google_cloud_lro::internal::new_poller(
14021 polling_error_policy,
14022 polling_backoff_policy,
14023 start,
14024 query,
14025 )
14026 }
14027
14028 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14032 self.0.request.parent = v.into();
14033 self
14034 }
14035
14036 pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14040 self.0.request.authorization_policy_id = v.into();
14041 self
14042 }
14043
14044 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14048 where
14049 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14050 {
14051 self.0.request.authorization_policy = std::option::Option::Some(v.into());
14052 self
14053 }
14054
14055 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14059 where
14060 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14061 {
14062 self.0.request.authorization_policy = v.map(|x| x.into());
14063 self
14064 }
14065 }
14066
14067 #[doc(hidden)]
14068 impl crate::RequestBuilder for CreateAuthorizationPolicy {
14069 fn request_options(&mut self) -> &mut crate::RequestOptions {
14070 &mut self.0.options
14071 }
14072 }
14073
14074 #[derive(Clone, Debug)]
14092 pub struct UpdateAuthorizationPolicy(
14093 RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
14094 );
14095
14096 impl UpdateAuthorizationPolicy {
14097 pub(crate) fn new(
14098 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14099 ) -> Self {
14100 Self(RequestBuilder::new(stub))
14101 }
14102
14103 pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
14105 mut self,
14106 v: V,
14107 ) -> Self {
14108 self.0.request = v.into();
14109 self
14110 }
14111
14112 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14114 self.0.options = v.into();
14115 self
14116 }
14117
14118 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14125 (*self.0.stub)
14126 .update_authorization_policy(self.0.request, self.0.options)
14127 .await
14128 .map(crate::Response::into_body)
14129 }
14130
14131 pub fn poller(
14133 self,
14134 ) -> impl google_cloud_lro::Poller<
14135 crate::model::AuthorizationPolicy,
14136 crate::model::OperationMetadata,
14137 > {
14138 type Operation = google_cloud_lro::internal::Operation<
14139 crate::model::AuthorizationPolicy,
14140 crate::model::OperationMetadata,
14141 >;
14142 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14143 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14144
14145 let stub = self.0.stub.clone();
14146 let mut options = self.0.options.clone();
14147 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14148 let query = move |name| {
14149 let stub = stub.clone();
14150 let options = options.clone();
14151 async {
14152 let op = GetOperation::new(stub)
14153 .set_name(name)
14154 .with_options(options)
14155 .send()
14156 .await?;
14157 Ok(Operation::new(op))
14158 }
14159 };
14160
14161 let start = move || async {
14162 let op = self.send().await?;
14163 Ok(Operation::new(op))
14164 };
14165
14166 google_cloud_lro::internal::new_poller(
14167 polling_error_policy,
14168 polling_backoff_policy,
14169 start,
14170 query,
14171 )
14172 }
14173
14174 pub fn set_update_mask<T>(mut self, v: T) -> Self
14176 where
14177 T: std::convert::Into<wkt::FieldMask>,
14178 {
14179 self.0.request.update_mask = std::option::Option::Some(v.into());
14180 self
14181 }
14182
14183 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14185 where
14186 T: std::convert::Into<wkt::FieldMask>,
14187 {
14188 self.0.request.update_mask = v.map(|x| x.into());
14189 self
14190 }
14191
14192 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14196 where
14197 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14198 {
14199 self.0.request.authorization_policy = std::option::Option::Some(v.into());
14200 self
14201 }
14202
14203 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14207 where
14208 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14209 {
14210 self.0.request.authorization_policy = v.map(|x| x.into());
14211 self
14212 }
14213 }
14214
14215 #[doc(hidden)]
14216 impl crate::RequestBuilder for UpdateAuthorizationPolicy {
14217 fn request_options(&mut self) -> &mut crate::RequestOptions {
14218 &mut self.0.options
14219 }
14220 }
14221
14222 #[derive(Clone, Debug)]
14240 pub struct DeleteAuthorizationPolicy(
14241 RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
14242 );
14243
14244 impl DeleteAuthorizationPolicy {
14245 pub(crate) fn new(
14246 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14247 ) -> Self {
14248 Self(RequestBuilder::new(stub))
14249 }
14250
14251 pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
14253 mut self,
14254 v: V,
14255 ) -> Self {
14256 self.0.request = v.into();
14257 self
14258 }
14259
14260 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14262 self.0.options = v.into();
14263 self
14264 }
14265
14266 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14273 (*self.0.stub)
14274 .delete_authorization_policy(self.0.request, self.0.options)
14275 .await
14276 .map(crate::Response::into_body)
14277 }
14278
14279 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14281 type Operation =
14282 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14283 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14284 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14285
14286 let stub = self.0.stub.clone();
14287 let mut options = self.0.options.clone();
14288 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14289 let query = move |name| {
14290 let stub = stub.clone();
14291 let options = options.clone();
14292 async {
14293 let op = GetOperation::new(stub)
14294 .set_name(name)
14295 .with_options(options)
14296 .send()
14297 .await?;
14298 Ok(Operation::new(op))
14299 }
14300 };
14301
14302 let start = move || async {
14303 let op = self.send().await?;
14304 Ok(Operation::new(op))
14305 };
14306
14307 google_cloud_lro::internal::new_unit_response_poller(
14308 polling_error_policy,
14309 polling_backoff_policy,
14310 start,
14311 query,
14312 )
14313 }
14314
14315 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14319 self.0.request.name = v.into();
14320 self
14321 }
14322 }
14323
14324 #[doc(hidden)]
14325 impl crate::RequestBuilder for DeleteAuthorizationPolicy {
14326 fn request_options(&mut self) -> &mut crate::RequestOptions {
14327 &mut self.0.options
14328 }
14329 }
14330
14331 #[derive(Clone, Debug)]
14352 pub struct ListBackendAuthenticationConfigs(
14353 RequestBuilder<crate::model::ListBackendAuthenticationConfigsRequest>,
14354 );
14355
14356 impl ListBackendAuthenticationConfigs {
14357 pub(crate) fn new(
14358 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14359 ) -> Self {
14360 Self(RequestBuilder::new(stub))
14361 }
14362
14363 pub fn with_request<V: Into<crate::model::ListBackendAuthenticationConfigsRequest>>(
14365 mut self,
14366 v: V,
14367 ) -> Self {
14368 self.0.request = v.into();
14369 self
14370 }
14371
14372 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14374 self.0.options = v.into();
14375 self
14376 }
14377
14378 pub async fn send(self) -> Result<crate::model::ListBackendAuthenticationConfigsResponse> {
14380 (*self.0.stub)
14381 .list_backend_authentication_configs(self.0.request, self.0.options)
14382 .await
14383 .map(crate::Response::into_body)
14384 }
14385
14386 pub fn by_page(
14388 self,
14389 ) -> impl google_cloud_gax::paginator::Paginator<
14390 crate::model::ListBackendAuthenticationConfigsResponse,
14391 crate::Error,
14392 > {
14393 use std::clone::Clone;
14394 let token = self.0.request.page_token.clone();
14395 let execute = move |token: String| {
14396 let mut builder = self.clone();
14397 builder.0.request = builder.0.request.set_page_token(token);
14398 builder.send()
14399 };
14400 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14401 }
14402
14403 pub fn by_item(
14405 self,
14406 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14407 crate::model::ListBackendAuthenticationConfigsResponse,
14408 crate::Error,
14409 > {
14410 use google_cloud_gax::paginator::Paginator;
14411 self.by_page().items()
14412 }
14413
14414 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14418 self.0.request.parent = v.into();
14419 self
14420 }
14421
14422 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14424 self.0.request.page_size = v.into();
14425 self
14426 }
14427
14428 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14430 self.0.request.page_token = v.into();
14431 self
14432 }
14433 }
14434
14435 #[doc(hidden)]
14436 impl crate::RequestBuilder for ListBackendAuthenticationConfigs {
14437 fn request_options(&mut self) -> &mut crate::RequestOptions {
14438 &mut self.0.options
14439 }
14440 }
14441
14442 #[derive(Clone, Debug)]
14459 pub struct GetBackendAuthenticationConfig(
14460 RequestBuilder<crate::model::GetBackendAuthenticationConfigRequest>,
14461 );
14462
14463 impl GetBackendAuthenticationConfig {
14464 pub(crate) fn new(
14465 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14466 ) -> Self {
14467 Self(RequestBuilder::new(stub))
14468 }
14469
14470 pub fn with_request<V: Into<crate::model::GetBackendAuthenticationConfigRequest>>(
14472 mut self,
14473 v: V,
14474 ) -> Self {
14475 self.0.request = v.into();
14476 self
14477 }
14478
14479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14481 self.0.options = v.into();
14482 self
14483 }
14484
14485 pub async fn send(self) -> Result<crate::model::BackendAuthenticationConfig> {
14487 (*self.0.stub)
14488 .get_backend_authentication_config(self.0.request, self.0.options)
14489 .await
14490 .map(crate::Response::into_body)
14491 }
14492
14493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14497 self.0.request.name = v.into();
14498 self
14499 }
14500 }
14501
14502 #[doc(hidden)]
14503 impl crate::RequestBuilder for GetBackendAuthenticationConfig {
14504 fn request_options(&mut self) -> &mut crate::RequestOptions {
14505 &mut self.0.options
14506 }
14507 }
14508
14509 #[derive(Clone, Debug)]
14527 pub struct CreateBackendAuthenticationConfig(
14528 RequestBuilder<crate::model::CreateBackendAuthenticationConfigRequest>,
14529 );
14530
14531 impl CreateBackendAuthenticationConfig {
14532 pub(crate) fn new(
14533 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14534 ) -> Self {
14535 Self(RequestBuilder::new(stub))
14536 }
14537
14538 pub fn with_request<V: Into<crate::model::CreateBackendAuthenticationConfigRequest>>(
14540 mut self,
14541 v: V,
14542 ) -> Self {
14543 self.0.request = v.into();
14544 self
14545 }
14546
14547 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14549 self.0.options = v.into();
14550 self
14551 }
14552
14553 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14560 (*self.0.stub)
14561 .create_backend_authentication_config(self.0.request, self.0.options)
14562 .await
14563 .map(crate::Response::into_body)
14564 }
14565
14566 pub fn poller(
14568 self,
14569 ) -> impl google_cloud_lro::Poller<
14570 crate::model::BackendAuthenticationConfig,
14571 crate::model::OperationMetadata,
14572 > {
14573 type Operation = google_cloud_lro::internal::Operation<
14574 crate::model::BackendAuthenticationConfig,
14575 crate::model::OperationMetadata,
14576 >;
14577 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14578 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14579
14580 let stub = self.0.stub.clone();
14581 let mut options = self.0.options.clone();
14582 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14583 let query = move |name| {
14584 let stub = stub.clone();
14585 let options = options.clone();
14586 async {
14587 let op = GetOperation::new(stub)
14588 .set_name(name)
14589 .with_options(options)
14590 .send()
14591 .await?;
14592 Ok(Operation::new(op))
14593 }
14594 };
14595
14596 let start = move || async {
14597 let op = self.send().await?;
14598 Ok(Operation::new(op))
14599 };
14600
14601 google_cloud_lro::internal::new_poller(
14602 polling_error_policy,
14603 polling_backoff_policy,
14604 start,
14605 query,
14606 )
14607 }
14608
14609 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14613 self.0.request.parent = v.into();
14614 self
14615 }
14616
14617 pub fn set_backend_authentication_config_id<T: Into<std::string::String>>(
14621 mut self,
14622 v: T,
14623 ) -> Self {
14624 self.0.request.backend_authentication_config_id = v.into();
14625 self
14626 }
14627
14628 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
14632 where
14633 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14634 {
14635 self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
14636 self
14637 }
14638
14639 pub fn set_or_clear_backend_authentication_config<T>(
14643 mut self,
14644 v: std::option::Option<T>,
14645 ) -> Self
14646 where
14647 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14648 {
14649 self.0.request.backend_authentication_config = v.map(|x| x.into());
14650 self
14651 }
14652 }
14653
14654 #[doc(hidden)]
14655 impl crate::RequestBuilder for CreateBackendAuthenticationConfig {
14656 fn request_options(&mut self) -> &mut crate::RequestOptions {
14657 &mut self.0.options
14658 }
14659 }
14660
14661 #[derive(Clone, Debug)]
14679 pub struct UpdateBackendAuthenticationConfig(
14680 RequestBuilder<crate::model::UpdateBackendAuthenticationConfigRequest>,
14681 );
14682
14683 impl UpdateBackendAuthenticationConfig {
14684 pub(crate) fn new(
14685 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14686 ) -> Self {
14687 Self(RequestBuilder::new(stub))
14688 }
14689
14690 pub fn with_request<V: Into<crate::model::UpdateBackendAuthenticationConfigRequest>>(
14692 mut self,
14693 v: V,
14694 ) -> Self {
14695 self.0.request = v.into();
14696 self
14697 }
14698
14699 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14701 self.0.options = v.into();
14702 self
14703 }
14704
14705 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14712 (*self.0.stub)
14713 .update_backend_authentication_config(self.0.request, self.0.options)
14714 .await
14715 .map(crate::Response::into_body)
14716 }
14717
14718 pub fn poller(
14720 self,
14721 ) -> impl google_cloud_lro::Poller<
14722 crate::model::BackendAuthenticationConfig,
14723 crate::model::OperationMetadata,
14724 > {
14725 type Operation = google_cloud_lro::internal::Operation<
14726 crate::model::BackendAuthenticationConfig,
14727 crate::model::OperationMetadata,
14728 >;
14729 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14730 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14731
14732 let stub = self.0.stub.clone();
14733 let mut options = self.0.options.clone();
14734 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14735 let query = move |name| {
14736 let stub = stub.clone();
14737 let options = options.clone();
14738 async {
14739 let op = GetOperation::new(stub)
14740 .set_name(name)
14741 .with_options(options)
14742 .send()
14743 .await?;
14744 Ok(Operation::new(op))
14745 }
14746 };
14747
14748 let start = move || async {
14749 let op = self.send().await?;
14750 Ok(Operation::new(op))
14751 };
14752
14753 google_cloud_lro::internal::new_poller(
14754 polling_error_policy,
14755 polling_backoff_policy,
14756 start,
14757 query,
14758 )
14759 }
14760
14761 pub fn set_update_mask<T>(mut self, v: T) -> Self
14763 where
14764 T: std::convert::Into<wkt::FieldMask>,
14765 {
14766 self.0.request.update_mask = std::option::Option::Some(v.into());
14767 self
14768 }
14769
14770 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14772 where
14773 T: std::convert::Into<wkt::FieldMask>,
14774 {
14775 self.0.request.update_mask = v.map(|x| x.into());
14776 self
14777 }
14778
14779 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
14783 where
14784 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14785 {
14786 self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
14787 self
14788 }
14789
14790 pub fn set_or_clear_backend_authentication_config<T>(
14794 mut self,
14795 v: std::option::Option<T>,
14796 ) -> Self
14797 where
14798 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14799 {
14800 self.0.request.backend_authentication_config = v.map(|x| x.into());
14801 self
14802 }
14803 }
14804
14805 #[doc(hidden)]
14806 impl crate::RequestBuilder for UpdateBackendAuthenticationConfig {
14807 fn request_options(&mut self) -> &mut crate::RequestOptions {
14808 &mut self.0.options
14809 }
14810 }
14811
14812 #[derive(Clone, Debug)]
14830 pub struct DeleteBackendAuthenticationConfig(
14831 RequestBuilder<crate::model::DeleteBackendAuthenticationConfigRequest>,
14832 );
14833
14834 impl DeleteBackendAuthenticationConfig {
14835 pub(crate) fn new(
14836 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14837 ) -> Self {
14838 Self(RequestBuilder::new(stub))
14839 }
14840
14841 pub fn with_request<V: Into<crate::model::DeleteBackendAuthenticationConfigRequest>>(
14843 mut self,
14844 v: V,
14845 ) -> Self {
14846 self.0.request = v.into();
14847 self
14848 }
14849
14850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14852 self.0.options = v.into();
14853 self
14854 }
14855
14856 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14863 (*self.0.stub)
14864 .delete_backend_authentication_config(self.0.request, self.0.options)
14865 .await
14866 .map(crate::Response::into_body)
14867 }
14868
14869 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14871 type Operation =
14872 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14873 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14874 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14875
14876 let stub = self.0.stub.clone();
14877 let mut options = self.0.options.clone();
14878 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14879 let query = move |name| {
14880 let stub = stub.clone();
14881 let options = options.clone();
14882 async {
14883 let op = GetOperation::new(stub)
14884 .set_name(name)
14885 .with_options(options)
14886 .send()
14887 .await?;
14888 Ok(Operation::new(op))
14889 }
14890 };
14891
14892 let start = move || async {
14893 let op = self.send().await?;
14894 Ok(Operation::new(op))
14895 };
14896
14897 google_cloud_lro::internal::new_unit_response_poller(
14898 polling_error_policy,
14899 polling_backoff_policy,
14900 start,
14901 query,
14902 )
14903 }
14904
14905 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14909 self.0.request.name = v.into();
14910 self
14911 }
14912
14913 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
14915 self.0.request.etag = v.into();
14916 self
14917 }
14918 }
14919
14920 #[doc(hidden)]
14921 impl crate::RequestBuilder for DeleteBackendAuthenticationConfig {
14922 fn request_options(&mut self) -> &mut crate::RequestOptions {
14923 &mut self.0.options
14924 }
14925 }
14926
14927 #[derive(Clone, Debug)]
14948 pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
14949
14950 impl ListServerTlsPolicies {
14951 pub(crate) fn new(
14952 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14953 ) -> Self {
14954 Self(RequestBuilder::new(stub))
14955 }
14956
14957 pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
14959 mut self,
14960 v: V,
14961 ) -> Self {
14962 self.0.request = v.into();
14963 self
14964 }
14965
14966 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14968 self.0.options = v.into();
14969 self
14970 }
14971
14972 pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
14974 (*self.0.stub)
14975 .list_server_tls_policies(self.0.request, self.0.options)
14976 .await
14977 .map(crate::Response::into_body)
14978 }
14979
14980 pub fn by_page(
14982 self,
14983 ) -> impl google_cloud_gax::paginator::Paginator<
14984 crate::model::ListServerTlsPoliciesResponse,
14985 crate::Error,
14986 > {
14987 use std::clone::Clone;
14988 let token = self.0.request.page_token.clone();
14989 let execute = move |token: String| {
14990 let mut builder = self.clone();
14991 builder.0.request = builder.0.request.set_page_token(token);
14992 builder.send()
14993 };
14994 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14995 }
14996
14997 pub fn by_item(
14999 self,
15000 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15001 crate::model::ListServerTlsPoliciesResponse,
15002 crate::Error,
15003 > {
15004 use google_cloud_gax::paginator::Paginator;
15005 self.by_page().items()
15006 }
15007
15008 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15012 self.0.request.parent = v.into();
15013 self
15014 }
15015
15016 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15018 self.0.request.page_size = v.into();
15019 self
15020 }
15021
15022 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15024 self.0.request.page_token = v.into();
15025 self
15026 }
15027
15028 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15030 self.0.request.return_partial_success = v.into();
15031 self
15032 }
15033 }
15034
15035 #[doc(hidden)]
15036 impl crate::RequestBuilder for ListServerTlsPolicies {
15037 fn request_options(&mut self) -> &mut crate::RequestOptions {
15038 &mut self.0.options
15039 }
15040 }
15041
15042 #[derive(Clone, Debug)]
15059 pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
15060
15061 impl GetServerTlsPolicy {
15062 pub(crate) fn new(
15063 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15064 ) -> Self {
15065 Self(RequestBuilder::new(stub))
15066 }
15067
15068 pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
15070 mut self,
15071 v: V,
15072 ) -> Self {
15073 self.0.request = v.into();
15074 self
15075 }
15076
15077 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15079 self.0.options = v.into();
15080 self
15081 }
15082
15083 pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
15085 (*self.0.stub)
15086 .get_server_tls_policy(self.0.request, self.0.options)
15087 .await
15088 .map(crate::Response::into_body)
15089 }
15090
15091 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15095 self.0.request.name = v.into();
15096 self
15097 }
15098 }
15099
15100 #[doc(hidden)]
15101 impl crate::RequestBuilder for GetServerTlsPolicy {
15102 fn request_options(&mut self) -> &mut crate::RequestOptions {
15103 &mut self.0.options
15104 }
15105 }
15106
15107 #[derive(Clone, Debug)]
15125 pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
15126
15127 impl CreateServerTlsPolicy {
15128 pub(crate) fn new(
15129 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15130 ) -> Self {
15131 Self(RequestBuilder::new(stub))
15132 }
15133
15134 pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
15136 mut self,
15137 v: V,
15138 ) -> Self {
15139 self.0.request = v.into();
15140 self
15141 }
15142
15143 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15145 self.0.options = v.into();
15146 self
15147 }
15148
15149 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15156 (*self.0.stub)
15157 .create_server_tls_policy(self.0.request, self.0.options)
15158 .await
15159 .map(crate::Response::into_body)
15160 }
15161
15162 pub fn poller(
15164 self,
15165 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15166 {
15167 type Operation = google_cloud_lro::internal::Operation<
15168 crate::model::ServerTlsPolicy,
15169 crate::model::OperationMetadata,
15170 >;
15171 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15172 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15173
15174 let stub = self.0.stub.clone();
15175 let mut options = self.0.options.clone();
15176 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15177 let query = move |name| {
15178 let stub = stub.clone();
15179 let options = options.clone();
15180 async {
15181 let op = GetOperation::new(stub)
15182 .set_name(name)
15183 .with_options(options)
15184 .send()
15185 .await?;
15186 Ok(Operation::new(op))
15187 }
15188 };
15189
15190 let start = move || async {
15191 let op = self.send().await?;
15192 Ok(Operation::new(op))
15193 };
15194
15195 google_cloud_lro::internal::new_poller(
15196 polling_error_policy,
15197 polling_backoff_policy,
15198 start,
15199 query,
15200 )
15201 }
15202
15203 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15207 self.0.request.parent = v.into();
15208 self
15209 }
15210
15211 pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15215 self.0.request.server_tls_policy_id = v.into();
15216 self
15217 }
15218
15219 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15223 where
15224 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15225 {
15226 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15227 self
15228 }
15229
15230 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15234 where
15235 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15236 {
15237 self.0.request.server_tls_policy = v.map(|x| x.into());
15238 self
15239 }
15240 }
15241
15242 #[doc(hidden)]
15243 impl crate::RequestBuilder for CreateServerTlsPolicy {
15244 fn request_options(&mut self) -> &mut crate::RequestOptions {
15245 &mut self.0.options
15246 }
15247 }
15248
15249 #[derive(Clone, Debug)]
15267 pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
15268
15269 impl UpdateServerTlsPolicy {
15270 pub(crate) fn new(
15271 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15272 ) -> Self {
15273 Self(RequestBuilder::new(stub))
15274 }
15275
15276 pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
15278 mut self,
15279 v: V,
15280 ) -> Self {
15281 self.0.request = v.into();
15282 self
15283 }
15284
15285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15287 self.0.options = v.into();
15288 self
15289 }
15290
15291 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15298 (*self.0.stub)
15299 .update_server_tls_policy(self.0.request, self.0.options)
15300 .await
15301 .map(crate::Response::into_body)
15302 }
15303
15304 pub fn poller(
15306 self,
15307 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15308 {
15309 type Operation = google_cloud_lro::internal::Operation<
15310 crate::model::ServerTlsPolicy,
15311 crate::model::OperationMetadata,
15312 >;
15313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15315
15316 let stub = self.0.stub.clone();
15317 let mut options = self.0.options.clone();
15318 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15319 let query = move |name| {
15320 let stub = stub.clone();
15321 let options = options.clone();
15322 async {
15323 let op = GetOperation::new(stub)
15324 .set_name(name)
15325 .with_options(options)
15326 .send()
15327 .await?;
15328 Ok(Operation::new(op))
15329 }
15330 };
15331
15332 let start = move || async {
15333 let op = self.send().await?;
15334 Ok(Operation::new(op))
15335 };
15336
15337 google_cloud_lro::internal::new_poller(
15338 polling_error_policy,
15339 polling_backoff_policy,
15340 start,
15341 query,
15342 )
15343 }
15344
15345 pub fn set_update_mask<T>(mut self, v: T) -> Self
15347 where
15348 T: std::convert::Into<wkt::FieldMask>,
15349 {
15350 self.0.request.update_mask = std::option::Option::Some(v.into());
15351 self
15352 }
15353
15354 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15356 where
15357 T: std::convert::Into<wkt::FieldMask>,
15358 {
15359 self.0.request.update_mask = v.map(|x| x.into());
15360 self
15361 }
15362
15363 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15367 where
15368 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15369 {
15370 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15371 self
15372 }
15373
15374 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15378 where
15379 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15380 {
15381 self.0.request.server_tls_policy = v.map(|x| x.into());
15382 self
15383 }
15384 }
15385
15386 #[doc(hidden)]
15387 impl crate::RequestBuilder for UpdateServerTlsPolicy {
15388 fn request_options(&mut self) -> &mut crate::RequestOptions {
15389 &mut self.0.options
15390 }
15391 }
15392
15393 #[derive(Clone, Debug)]
15411 pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
15412
15413 impl DeleteServerTlsPolicy {
15414 pub(crate) fn new(
15415 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15416 ) -> Self {
15417 Self(RequestBuilder::new(stub))
15418 }
15419
15420 pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
15422 mut self,
15423 v: V,
15424 ) -> Self {
15425 self.0.request = v.into();
15426 self
15427 }
15428
15429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15431 self.0.options = v.into();
15432 self
15433 }
15434
15435 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15442 (*self.0.stub)
15443 .delete_server_tls_policy(self.0.request, self.0.options)
15444 .await
15445 .map(crate::Response::into_body)
15446 }
15447
15448 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15450 type Operation =
15451 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15452 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15453 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15454
15455 let stub = self.0.stub.clone();
15456 let mut options = self.0.options.clone();
15457 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15458 let query = move |name| {
15459 let stub = stub.clone();
15460 let options = options.clone();
15461 async {
15462 let op = GetOperation::new(stub)
15463 .set_name(name)
15464 .with_options(options)
15465 .send()
15466 .await?;
15467 Ok(Operation::new(op))
15468 }
15469 };
15470
15471 let start = move || async {
15472 let op = self.send().await?;
15473 Ok(Operation::new(op))
15474 };
15475
15476 google_cloud_lro::internal::new_unit_response_poller(
15477 polling_error_policy,
15478 polling_backoff_policy,
15479 start,
15480 query,
15481 )
15482 }
15483
15484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15488 self.0.request.name = v.into();
15489 self
15490 }
15491 }
15492
15493 #[doc(hidden)]
15494 impl crate::RequestBuilder for DeleteServerTlsPolicy {
15495 fn request_options(&mut self) -> &mut crate::RequestOptions {
15496 &mut self.0.options
15497 }
15498 }
15499
15500 #[derive(Clone, Debug)]
15521 pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
15522
15523 impl ListClientTlsPolicies {
15524 pub(crate) fn new(
15525 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15526 ) -> Self {
15527 Self(RequestBuilder::new(stub))
15528 }
15529
15530 pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
15532 mut self,
15533 v: V,
15534 ) -> Self {
15535 self.0.request = v.into();
15536 self
15537 }
15538
15539 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15541 self.0.options = v.into();
15542 self
15543 }
15544
15545 pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
15547 (*self.0.stub)
15548 .list_client_tls_policies(self.0.request, self.0.options)
15549 .await
15550 .map(crate::Response::into_body)
15551 }
15552
15553 pub fn by_page(
15555 self,
15556 ) -> impl google_cloud_gax::paginator::Paginator<
15557 crate::model::ListClientTlsPoliciesResponse,
15558 crate::Error,
15559 > {
15560 use std::clone::Clone;
15561 let token = self.0.request.page_token.clone();
15562 let execute = move |token: String| {
15563 let mut builder = self.clone();
15564 builder.0.request = builder.0.request.set_page_token(token);
15565 builder.send()
15566 };
15567 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15568 }
15569
15570 pub fn by_item(
15572 self,
15573 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15574 crate::model::ListClientTlsPoliciesResponse,
15575 crate::Error,
15576 > {
15577 use google_cloud_gax::paginator::Paginator;
15578 self.by_page().items()
15579 }
15580
15581 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15585 self.0.request.parent = v.into();
15586 self
15587 }
15588
15589 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15591 self.0.request.page_size = v.into();
15592 self
15593 }
15594
15595 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15597 self.0.request.page_token = v.into();
15598 self
15599 }
15600 }
15601
15602 #[doc(hidden)]
15603 impl crate::RequestBuilder for ListClientTlsPolicies {
15604 fn request_options(&mut self) -> &mut crate::RequestOptions {
15605 &mut self.0.options
15606 }
15607 }
15608
15609 #[derive(Clone, Debug)]
15626 pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
15627
15628 impl GetClientTlsPolicy {
15629 pub(crate) fn new(
15630 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15631 ) -> Self {
15632 Self(RequestBuilder::new(stub))
15633 }
15634
15635 pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
15637 mut self,
15638 v: V,
15639 ) -> Self {
15640 self.0.request = v.into();
15641 self
15642 }
15643
15644 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15646 self.0.options = v.into();
15647 self
15648 }
15649
15650 pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
15652 (*self.0.stub)
15653 .get_client_tls_policy(self.0.request, self.0.options)
15654 .await
15655 .map(crate::Response::into_body)
15656 }
15657
15658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15662 self.0.request.name = v.into();
15663 self
15664 }
15665 }
15666
15667 #[doc(hidden)]
15668 impl crate::RequestBuilder for GetClientTlsPolicy {
15669 fn request_options(&mut self) -> &mut crate::RequestOptions {
15670 &mut self.0.options
15671 }
15672 }
15673
15674 #[derive(Clone, Debug)]
15692 pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
15693
15694 impl CreateClientTlsPolicy {
15695 pub(crate) fn new(
15696 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15697 ) -> Self {
15698 Self(RequestBuilder::new(stub))
15699 }
15700
15701 pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
15703 mut self,
15704 v: V,
15705 ) -> Self {
15706 self.0.request = v.into();
15707 self
15708 }
15709
15710 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15712 self.0.options = v.into();
15713 self
15714 }
15715
15716 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15723 (*self.0.stub)
15724 .create_client_tls_policy(self.0.request, self.0.options)
15725 .await
15726 .map(crate::Response::into_body)
15727 }
15728
15729 pub fn poller(
15731 self,
15732 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
15733 {
15734 type Operation = google_cloud_lro::internal::Operation<
15735 crate::model::ClientTlsPolicy,
15736 crate::model::OperationMetadata,
15737 >;
15738 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15739 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15740
15741 let stub = self.0.stub.clone();
15742 let mut options = self.0.options.clone();
15743 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15744 let query = move |name| {
15745 let stub = stub.clone();
15746 let options = options.clone();
15747 async {
15748 let op = GetOperation::new(stub)
15749 .set_name(name)
15750 .with_options(options)
15751 .send()
15752 .await?;
15753 Ok(Operation::new(op))
15754 }
15755 };
15756
15757 let start = move || async {
15758 let op = self.send().await?;
15759 Ok(Operation::new(op))
15760 };
15761
15762 google_cloud_lro::internal::new_poller(
15763 polling_error_policy,
15764 polling_backoff_policy,
15765 start,
15766 query,
15767 )
15768 }
15769
15770 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15774 self.0.request.parent = v.into();
15775 self
15776 }
15777
15778 pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15782 self.0.request.client_tls_policy_id = v.into();
15783 self
15784 }
15785
15786 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
15790 where
15791 T: std::convert::Into<crate::model::ClientTlsPolicy>,
15792 {
15793 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
15794 self
15795 }
15796
15797 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15801 where
15802 T: std::convert::Into<crate::model::ClientTlsPolicy>,
15803 {
15804 self.0.request.client_tls_policy = v.map(|x| x.into());
15805 self
15806 }
15807 }
15808
15809 #[doc(hidden)]
15810 impl crate::RequestBuilder for CreateClientTlsPolicy {
15811 fn request_options(&mut self) -> &mut crate::RequestOptions {
15812 &mut self.0.options
15813 }
15814 }
15815
15816 #[derive(Clone, Debug)]
15834 pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
15835
15836 impl UpdateClientTlsPolicy {
15837 pub(crate) fn new(
15838 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15839 ) -> Self {
15840 Self(RequestBuilder::new(stub))
15841 }
15842
15843 pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
15845 mut self,
15846 v: V,
15847 ) -> Self {
15848 self.0.request = v.into();
15849 self
15850 }
15851
15852 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15854 self.0.options = v.into();
15855 self
15856 }
15857
15858 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15865 (*self.0.stub)
15866 .update_client_tls_policy(self.0.request, self.0.options)
15867 .await
15868 .map(crate::Response::into_body)
15869 }
15870
15871 pub fn poller(
15873 self,
15874 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
15875 {
15876 type Operation = google_cloud_lro::internal::Operation<
15877 crate::model::ClientTlsPolicy,
15878 crate::model::OperationMetadata,
15879 >;
15880 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15881 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15882
15883 let stub = self.0.stub.clone();
15884 let mut options = self.0.options.clone();
15885 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15886 let query = move |name| {
15887 let stub = stub.clone();
15888 let options = options.clone();
15889 async {
15890 let op = GetOperation::new(stub)
15891 .set_name(name)
15892 .with_options(options)
15893 .send()
15894 .await?;
15895 Ok(Operation::new(op))
15896 }
15897 };
15898
15899 let start = move || async {
15900 let op = self.send().await?;
15901 Ok(Operation::new(op))
15902 };
15903
15904 google_cloud_lro::internal::new_poller(
15905 polling_error_policy,
15906 polling_backoff_policy,
15907 start,
15908 query,
15909 )
15910 }
15911
15912 pub fn set_update_mask<T>(mut self, v: T) -> Self
15914 where
15915 T: std::convert::Into<wkt::FieldMask>,
15916 {
15917 self.0.request.update_mask = std::option::Option::Some(v.into());
15918 self
15919 }
15920
15921 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15923 where
15924 T: std::convert::Into<wkt::FieldMask>,
15925 {
15926 self.0.request.update_mask = v.map(|x| x.into());
15927 self
15928 }
15929
15930 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
15934 where
15935 T: std::convert::Into<crate::model::ClientTlsPolicy>,
15936 {
15937 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
15938 self
15939 }
15940
15941 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15945 where
15946 T: std::convert::Into<crate::model::ClientTlsPolicy>,
15947 {
15948 self.0.request.client_tls_policy = v.map(|x| x.into());
15949 self
15950 }
15951 }
15952
15953 #[doc(hidden)]
15954 impl crate::RequestBuilder for UpdateClientTlsPolicy {
15955 fn request_options(&mut self) -> &mut crate::RequestOptions {
15956 &mut self.0.options
15957 }
15958 }
15959
15960 #[derive(Clone, Debug)]
15978 pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
15979
15980 impl DeleteClientTlsPolicy {
15981 pub(crate) fn new(
15982 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15983 ) -> Self {
15984 Self(RequestBuilder::new(stub))
15985 }
15986
15987 pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
15989 mut self,
15990 v: V,
15991 ) -> Self {
15992 self.0.request = v.into();
15993 self
15994 }
15995
15996 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15998 self.0.options = v.into();
15999 self
16000 }
16001
16002 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16009 (*self.0.stub)
16010 .delete_client_tls_policy(self.0.request, self.0.options)
16011 .await
16012 .map(crate::Response::into_body)
16013 }
16014
16015 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16017 type Operation =
16018 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16019 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16020 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16021
16022 let stub = self.0.stub.clone();
16023 let mut options = self.0.options.clone();
16024 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16025 let query = move |name| {
16026 let stub = stub.clone();
16027 let options = options.clone();
16028 async {
16029 let op = GetOperation::new(stub)
16030 .set_name(name)
16031 .with_options(options)
16032 .send()
16033 .await?;
16034 Ok(Operation::new(op))
16035 }
16036 };
16037
16038 let start = move || async {
16039 let op = self.send().await?;
16040 Ok(Operation::new(op))
16041 };
16042
16043 google_cloud_lro::internal::new_unit_response_poller(
16044 polling_error_policy,
16045 polling_backoff_policy,
16046 start,
16047 query,
16048 )
16049 }
16050
16051 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16055 self.0.request.name = v.into();
16056 self
16057 }
16058 }
16059
16060 #[doc(hidden)]
16061 impl crate::RequestBuilder for DeleteClientTlsPolicy {
16062 fn request_options(&mut self) -> &mut crate::RequestOptions {
16063 &mut self.0.options
16064 }
16065 }
16066
16067 #[derive(Clone, Debug)]
16088 pub struct ListGatewaySecurityPolicies(
16089 RequestBuilder<crate::model::ListGatewaySecurityPoliciesRequest>,
16090 );
16091
16092 impl ListGatewaySecurityPolicies {
16093 pub(crate) fn new(
16094 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16095 ) -> Self {
16096 Self(RequestBuilder::new(stub))
16097 }
16098
16099 pub fn with_request<V: Into<crate::model::ListGatewaySecurityPoliciesRequest>>(
16101 mut self,
16102 v: V,
16103 ) -> Self {
16104 self.0.request = v.into();
16105 self
16106 }
16107
16108 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16110 self.0.options = v.into();
16111 self
16112 }
16113
16114 pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPoliciesResponse> {
16116 (*self.0.stub)
16117 .list_gateway_security_policies(self.0.request, self.0.options)
16118 .await
16119 .map(crate::Response::into_body)
16120 }
16121
16122 pub fn by_page(
16124 self,
16125 ) -> impl google_cloud_gax::paginator::Paginator<
16126 crate::model::ListGatewaySecurityPoliciesResponse,
16127 crate::Error,
16128 > {
16129 use std::clone::Clone;
16130 let token = self.0.request.page_token.clone();
16131 let execute = move |token: String| {
16132 let mut builder = self.clone();
16133 builder.0.request = builder.0.request.set_page_token(token);
16134 builder.send()
16135 };
16136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16137 }
16138
16139 pub fn by_item(
16141 self,
16142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16143 crate::model::ListGatewaySecurityPoliciesResponse,
16144 crate::Error,
16145 > {
16146 use google_cloud_gax::paginator::Paginator;
16147 self.by_page().items()
16148 }
16149
16150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16154 self.0.request.parent = v.into();
16155 self
16156 }
16157
16158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16160 self.0.request.page_size = v.into();
16161 self
16162 }
16163
16164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16166 self.0.request.page_token = v.into();
16167 self
16168 }
16169 }
16170
16171 #[doc(hidden)]
16172 impl crate::RequestBuilder for ListGatewaySecurityPolicies {
16173 fn request_options(&mut self) -> &mut crate::RequestOptions {
16174 &mut self.0.options
16175 }
16176 }
16177
16178 #[derive(Clone, Debug)]
16195 pub struct GetGatewaySecurityPolicy(
16196 RequestBuilder<crate::model::GetGatewaySecurityPolicyRequest>,
16197 );
16198
16199 impl GetGatewaySecurityPolicy {
16200 pub(crate) fn new(
16201 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16202 ) -> Self {
16203 Self(RequestBuilder::new(stub))
16204 }
16205
16206 pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRequest>>(
16208 mut self,
16209 v: V,
16210 ) -> Self {
16211 self.0.request = v.into();
16212 self
16213 }
16214
16215 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16217 self.0.options = v.into();
16218 self
16219 }
16220
16221 pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicy> {
16223 (*self.0.stub)
16224 .get_gateway_security_policy(self.0.request, self.0.options)
16225 .await
16226 .map(crate::Response::into_body)
16227 }
16228
16229 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16233 self.0.request.name = v.into();
16234 self
16235 }
16236 }
16237
16238 #[doc(hidden)]
16239 impl crate::RequestBuilder for GetGatewaySecurityPolicy {
16240 fn request_options(&mut self) -> &mut crate::RequestOptions {
16241 &mut self.0.options
16242 }
16243 }
16244
16245 #[derive(Clone, Debug)]
16263 pub struct CreateGatewaySecurityPolicy(
16264 RequestBuilder<crate::model::CreateGatewaySecurityPolicyRequest>,
16265 );
16266
16267 impl CreateGatewaySecurityPolicy {
16268 pub(crate) fn new(
16269 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16270 ) -> Self {
16271 Self(RequestBuilder::new(stub))
16272 }
16273
16274 pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRequest>>(
16276 mut self,
16277 v: V,
16278 ) -> Self {
16279 self.0.request = v.into();
16280 self
16281 }
16282
16283 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16285 self.0.options = v.into();
16286 self
16287 }
16288
16289 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16296 (*self.0.stub)
16297 .create_gateway_security_policy(self.0.request, self.0.options)
16298 .await
16299 .map(crate::Response::into_body)
16300 }
16301
16302 pub fn poller(
16304 self,
16305 ) -> impl google_cloud_lro::Poller<
16306 crate::model::GatewaySecurityPolicy,
16307 crate::model::OperationMetadata,
16308 > {
16309 type Operation = google_cloud_lro::internal::Operation<
16310 crate::model::GatewaySecurityPolicy,
16311 crate::model::OperationMetadata,
16312 >;
16313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16315
16316 let stub = self.0.stub.clone();
16317 let mut options = self.0.options.clone();
16318 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16319 let query = move |name| {
16320 let stub = stub.clone();
16321 let options = options.clone();
16322 async {
16323 let op = GetOperation::new(stub)
16324 .set_name(name)
16325 .with_options(options)
16326 .send()
16327 .await?;
16328 Ok(Operation::new(op))
16329 }
16330 };
16331
16332 let start = move || async {
16333 let op = self.send().await?;
16334 Ok(Operation::new(op))
16335 };
16336
16337 google_cloud_lro::internal::new_poller(
16338 polling_error_policy,
16339 polling_backoff_policy,
16340 start,
16341 query,
16342 )
16343 }
16344
16345 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16349 self.0.request.parent = v.into();
16350 self
16351 }
16352
16353 pub fn set_gateway_security_policy_id<T: Into<std::string::String>>(
16357 mut self,
16358 v: T,
16359 ) -> Self {
16360 self.0.request.gateway_security_policy_id = v.into();
16361 self
16362 }
16363
16364 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16368 where
16369 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16370 {
16371 self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16372 self
16373 }
16374
16375 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16379 where
16380 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16381 {
16382 self.0.request.gateway_security_policy = v.map(|x| x.into());
16383 self
16384 }
16385 }
16386
16387 #[doc(hidden)]
16388 impl crate::RequestBuilder for CreateGatewaySecurityPolicy {
16389 fn request_options(&mut self) -> &mut crate::RequestOptions {
16390 &mut self.0.options
16391 }
16392 }
16393
16394 #[derive(Clone, Debug)]
16412 pub struct UpdateGatewaySecurityPolicy(
16413 RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRequest>,
16414 );
16415
16416 impl UpdateGatewaySecurityPolicy {
16417 pub(crate) fn new(
16418 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16419 ) -> Self {
16420 Self(RequestBuilder::new(stub))
16421 }
16422
16423 pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRequest>>(
16425 mut self,
16426 v: V,
16427 ) -> Self {
16428 self.0.request = v.into();
16429 self
16430 }
16431
16432 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16434 self.0.options = v.into();
16435 self
16436 }
16437
16438 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16445 (*self.0.stub)
16446 .update_gateway_security_policy(self.0.request, self.0.options)
16447 .await
16448 .map(crate::Response::into_body)
16449 }
16450
16451 pub fn poller(
16453 self,
16454 ) -> impl google_cloud_lro::Poller<
16455 crate::model::GatewaySecurityPolicy,
16456 crate::model::OperationMetadata,
16457 > {
16458 type Operation = google_cloud_lro::internal::Operation<
16459 crate::model::GatewaySecurityPolicy,
16460 crate::model::OperationMetadata,
16461 >;
16462 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16463 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16464
16465 let stub = self.0.stub.clone();
16466 let mut options = self.0.options.clone();
16467 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16468 let query = move |name| {
16469 let stub = stub.clone();
16470 let options = options.clone();
16471 async {
16472 let op = GetOperation::new(stub)
16473 .set_name(name)
16474 .with_options(options)
16475 .send()
16476 .await?;
16477 Ok(Operation::new(op))
16478 }
16479 };
16480
16481 let start = move || async {
16482 let op = self.send().await?;
16483 Ok(Operation::new(op))
16484 };
16485
16486 google_cloud_lro::internal::new_poller(
16487 polling_error_policy,
16488 polling_backoff_policy,
16489 start,
16490 query,
16491 )
16492 }
16493
16494 pub fn set_update_mask<T>(mut self, v: T) -> Self
16496 where
16497 T: std::convert::Into<wkt::FieldMask>,
16498 {
16499 self.0.request.update_mask = std::option::Option::Some(v.into());
16500 self
16501 }
16502
16503 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16505 where
16506 T: std::convert::Into<wkt::FieldMask>,
16507 {
16508 self.0.request.update_mask = v.map(|x| x.into());
16509 self
16510 }
16511
16512 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16516 where
16517 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16518 {
16519 self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16520 self
16521 }
16522
16523 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16527 where
16528 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16529 {
16530 self.0.request.gateway_security_policy = v.map(|x| x.into());
16531 self
16532 }
16533 }
16534
16535 #[doc(hidden)]
16536 impl crate::RequestBuilder for UpdateGatewaySecurityPolicy {
16537 fn request_options(&mut self) -> &mut crate::RequestOptions {
16538 &mut self.0.options
16539 }
16540 }
16541
16542 #[derive(Clone, Debug)]
16560 pub struct DeleteGatewaySecurityPolicy(
16561 RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRequest>,
16562 );
16563
16564 impl DeleteGatewaySecurityPolicy {
16565 pub(crate) fn new(
16566 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16567 ) -> Self {
16568 Self(RequestBuilder::new(stub))
16569 }
16570
16571 pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRequest>>(
16573 mut self,
16574 v: V,
16575 ) -> Self {
16576 self.0.request = v.into();
16577 self
16578 }
16579
16580 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16582 self.0.options = v.into();
16583 self
16584 }
16585
16586 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16593 (*self.0.stub)
16594 .delete_gateway_security_policy(self.0.request, self.0.options)
16595 .await
16596 .map(crate::Response::into_body)
16597 }
16598
16599 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16601 type Operation =
16602 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16603 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16604 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16605
16606 let stub = self.0.stub.clone();
16607 let mut options = self.0.options.clone();
16608 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16609 let query = move |name| {
16610 let stub = stub.clone();
16611 let options = options.clone();
16612 async {
16613 let op = GetOperation::new(stub)
16614 .set_name(name)
16615 .with_options(options)
16616 .send()
16617 .await?;
16618 Ok(Operation::new(op))
16619 }
16620 };
16621
16622 let start = move || async {
16623 let op = self.send().await?;
16624 Ok(Operation::new(op))
16625 };
16626
16627 google_cloud_lro::internal::new_unit_response_poller(
16628 polling_error_policy,
16629 polling_backoff_policy,
16630 start,
16631 query,
16632 )
16633 }
16634
16635 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16639 self.0.request.name = v.into();
16640 self
16641 }
16642 }
16643
16644 #[doc(hidden)]
16645 impl crate::RequestBuilder for DeleteGatewaySecurityPolicy {
16646 fn request_options(&mut self) -> &mut crate::RequestOptions {
16647 &mut self.0.options
16648 }
16649 }
16650
16651 #[derive(Clone, Debug)]
16672 pub struct ListGatewaySecurityPolicyRules(
16673 RequestBuilder<crate::model::ListGatewaySecurityPolicyRulesRequest>,
16674 );
16675
16676 impl ListGatewaySecurityPolicyRules {
16677 pub(crate) fn new(
16678 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16679 ) -> Self {
16680 Self(RequestBuilder::new(stub))
16681 }
16682
16683 pub fn with_request<V: Into<crate::model::ListGatewaySecurityPolicyRulesRequest>>(
16685 mut self,
16686 v: V,
16687 ) -> Self {
16688 self.0.request = v.into();
16689 self
16690 }
16691
16692 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16694 self.0.options = v.into();
16695 self
16696 }
16697
16698 pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPolicyRulesResponse> {
16700 (*self.0.stub)
16701 .list_gateway_security_policy_rules(self.0.request, self.0.options)
16702 .await
16703 .map(crate::Response::into_body)
16704 }
16705
16706 pub fn by_page(
16708 self,
16709 ) -> impl google_cloud_gax::paginator::Paginator<
16710 crate::model::ListGatewaySecurityPolicyRulesResponse,
16711 crate::Error,
16712 > {
16713 use std::clone::Clone;
16714 let token = self.0.request.page_token.clone();
16715 let execute = move |token: String| {
16716 let mut builder = self.clone();
16717 builder.0.request = builder.0.request.set_page_token(token);
16718 builder.send()
16719 };
16720 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16721 }
16722
16723 pub fn by_item(
16725 self,
16726 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16727 crate::model::ListGatewaySecurityPolicyRulesResponse,
16728 crate::Error,
16729 > {
16730 use google_cloud_gax::paginator::Paginator;
16731 self.by_page().items()
16732 }
16733
16734 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16738 self.0.request.parent = v.into();
16739 self
16740 }
16741
16742 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16744 self.0.request.page_size = v.into();
16745 self
16746 }
16747
16748 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16750 self.0.request.page_token = v.into();
16751 self
16752 }
16753 }
16754
16755 #[doc(hidden)]
16756 impl crate::RequestBuilder for ListGatewaySecurityPolicyRules {
16757 fn request_options(&mut self) -> &mut crate::RequestOptions {
16758 &mut self.0.options
16759 }
16760 }
16761
16762 #[derive(Clone, Debug)]
16779 pub struct GetGatewaySecurityPolicyRule(
16780 RequestBuilder<crate::model::GetGatewaySecurityPolicyRuleRequest>,
16781 );
16782
16783 impl GetGatewaySecurityPolicyRule {
16784 pub(crate) fn new(
16785 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16786 ) -> Self {
16787 Self(RequestBuilder::new(stub))
16788 }
16789
16790 pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRuleRequest>>(
16792 mut self,
16793 v: V,
16794 ) -> Self {
16795 self.0.request = v.into();
16796 self
16797 }
16798
16799 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16801 self.0.options = v.into();
16802 self
16803 }
16804
16805 pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicyRule> {
16807 (*self.0.stub)
16808 .get_gateway_security_policy_rule(self.0.request, self.0.options)
16809 .await
16810 .map(crate::Response::into_body)
16811 }
16812
16813 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16817 self.0.request.name = v.into();
16818 self
16819 }
16820 }
16821
16822 #[doc(hidden)]
16823 impl crate::RequestBuilder for GetGatewaySecurityPolicyRule {
16824 fn request_options(&mut self) -> &mut crate::RequestOptions {
16825 &mut self.0.options
16826 }
16827 }
16828
16829 #[derive(Clone, Debug)]
16847 pub struct CreateGatewaySecurityPolicyRule(
16848 RequestBuilder<crate::model::CreateGatewaySecurityPolicyRuleRequest>,
16849 );
16850
16851 impl CreateGatewaySecurityPolicyRule {
16852 pub(crate) fn new(
16853 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16854 ) -> Self {
16855 Self(RequestBuilder::new(stub))
16856 }
16857
16858 pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRuleRequest>>(
16860 mut self,
16861 v: V,
16862 ) -> Self {
16863 self.0.request = v.into();
16864 self
16865 }
16866
16867 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16869 self.0.options = v.into();
16870 self
16871 }
16872
16873 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16880 (*self.0.stub)
16881 .create_gateway_security_policy_rule(self.0.request, self.0.options)
16882 .await
16883 .map(crate::Response::into_body)
16884 }
16885
16886 pub fn poller(
16888 self,
16889 ) -> impl google_cloud_lro::Poller<
16890 crate::model::GatewaySecurityPolicyRule,
16891 crate::model::OperationMetadata,
16892 > {
16893 type Operation = google_cloud_lro::internal::Operation<
16894 crate::model::GatewaySecurityPolicyRule,
16895 crate::model::OperationMetadata,
16896 >;
16897 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16898 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16899
16900 let stub = self.0.stub.clone();
16901 let mut options = self.0.options.clone();
16902 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16903 let query = move |name| {
16904 let stub = stub.clone();
16905 let options = options.clone();
16906 async {
16907 let op = GetOperation::new(stub)
16908 .set_name(name)
16909 .with_options(options)
16910 .send()
16911 .await?;
16912 Ok(Operation::new(op))
16913 }
16914 };
16915
16916 let start = move || async {
16917 let op = self.send().await?;
16918 Ok(Operation::new(op))
16919 };
16920
16921 google_cloud_lro::internal::new_poller(
16922 polling_error_policy,
16923 polling_backoff_policy,
16924 start,
16925 query,
16926 )
16927 }
16928
16929 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16933 self.0.request.parent = v.into();
16934 self
16935 }
16936
16937 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
16941 where
16942 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
16943 {
16944 self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
16945 self
16946 }
16947
16948 pub fn set_or_clear_gateway_security_policy_rule<T>(
16952 mut self,
16953 v: std::option::Option<T>,
16954 ) -> Self
16955 where
16956 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
16957 {
16958 self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
16959 self
16960 }
16961
16962 pub fn set_gateway_security_policy_rule_id<T: Into<std::string::String>>(
16964 mut self,
16965 v: T,
16966 ) -> Self {
16967 self.0.request.gateway_security_policy_rule_id = v.into();
16968 self
16969 }
16970 }
16971
16972 #[doc(hidden)]
16973 impl crate::RequestBuilder for CreateGatewaySecurityPolicyRule {
16974 fn request_options(&mut self) -> &mut crate::RequestOptions {
16975 &mut self.0.options
16976 }
16977 }
16978
16979 #[derive(Clone, Debug)]
16997 pub struct UpdateGatewaySecurityPolicyRule(
16998 RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRuleRequest>,
16999 );
17000
17001 impl UpdateGatewaySecurityPolicyRule {
17002 pub(crate) fn new(
17003 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17004 ) -> Self {
17005 Self(RequestBuilder::new(stub))
17006 }
17007
17008 pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRuleRequest>>(
17010 mut self,
17011 v: V,
17012 ) -> Self {
17013 self.0.request = v.into();
17014 self
17015 }
17016
17017 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17019 self.0.options = v.into();
17020 self
17021 }
17022
17023 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17030 (*self.0.stub)
17031 .update_gateway_security_policy_rule(self.0.request, self.0.options)
17032 .await
17033 .map(crate::Response::into_body)
17034 }
17035
17036 pub fn poller(
17038 self,
17039 ) -> impl google_cloud_lro::Poller<
17040 crate::model::GatewaySecurityPolicyRule,
17041 crate::model::OperationMetadata,
17042 > {
17043 type Operation = google_cloud_lro::internal::Operation<
17044 crate::model::GatewaySecurityPolicyRule,
17045 crate::model::OperationMetadata,
17046 >;
17047 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17048 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17049
17050 let stub = self.0.stub.clone();
17051 let mut options = self.0.options.clone();
17052 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17053 let query = move |name| {
17054 let stub = stub.clone();
17055 let options = options.clone();
17056 async {
17057 let op = GetOperation::new(stub)
17058 .set_name(name)
17059 .with_options(options)
17060 .send()
17061 .await?;
17062 Ok(Operation::new(op))
17063 }
17064 };
17065
17066 let start = move || async {
17067 let op = self.send().await?;
17068 Ok(Operation::new(op))
17069 };
17070
17071 google_cloud_lro::internal::new_poller(
17072 polling_error_policy,
17073 polling_backoff_policy,
17074 start,
17075 query,
17076 )
17077 }
17078
17079 pub fn set_update_mask<T>(mut self, v: T) -> Self
17081 where
17082 T: std::convert::Into<wkt::FieldMask>,
17083 {
17084 self.0.request.update_mask = std::option::Option::Some(v.into());
17085 self
17086 }
17087
17088 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17090 where
17091 T: std::convert::Into<wkt::FieldMask>,
17092 {
17093 self.0.request.update_mask = v.map(|x| x.into());
17094 self
17095 }
17096
17097 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
17101 where
17102 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17103 {
17104 self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
17105 self
17106 }
17107
17108 pub fn set_or_clear_gateway_security_policy_rule<T>(
17112 mut self,
17113 v: std::option::Option<T>,
17114 ) -> Self
17115 where
17116 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17117 {
17118 self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
17119 self
17120 }
17121 }
17122
17123 #[doc(hidden)]
17124 impl crate::RequestBuilder for UpdateGatewaySecurityPolicyRule {
17125 fn request_options(&mut self) -> &mut crate::RequestOptions {
17126 &mut self.0.options
17127 }
17128 }
17129
17130 #[derive(Clone, Debug)]
17148 pub struct DeleteGatewaySecurityPolicyRule(
17149 RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRuleRequest>,
17150 );
17151
17152 impl DeleteGatewaySecurityPolicyRule {
17153 pub(crate) fn new(
17154 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17155 ) -> Self {
17156 Self(RequestBuilder::new(stub))
17157 }
17158
17159 pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRuleRequest>>(
17161 mut self,
17162 v: V,
17163 ) -> Self {
17164 self.0.request = v.into();
17165 self
17166 }
17167
17168 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17170 self.0.options = v.into();
17171 self
17172 }
17173
17174 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17181 (*self.0.stub)
17182 .delete_gateway_security_policy_rule(self.0.request, self.0.options)
17183 .await
17184 .map(crate::Response::into_body)
17185 }
17186
17187 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17189 type Operation =
17190 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17191 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17192 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17193
17194 let stub = self.0.stub.clone();
17195 let mut options = self.0.options.clone();
17196 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17197 let query = move |name| {
17198 let stub = stub.clone();
17199 let options = options.clone();
17200 async {
17201 let op = GetOperation::new(stub)
17202 .set_name(name)
17203 .with_options(options)
17204 .send()
17205 .await?;
17206 Ok(Operation::new(op))
17207 }
17208 };
17209
17210 let start = move || async {
17211 let op = self.send().await?;
17212 Ok(Operation::new(op))
17213 };
17214
17215 google_cloud_lro::internal::new_unit_response_poller(
17216 polling_error_policy,
17217 polling_backoff_policy,
17218 start,
17219 query,
17220 )
17221 }
17222
17223 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17227 self.0.request.name = v.into();
17228 self
17229 }
17230 }
17231
17232 #[doc(hidden)]
17233 impl crate::RequestBuilder for DeleteGatewaySecurityPolicyRule {
17234 fn request_options(&mut self) -> &mut crate::RequestOptions {
17235 &mut self.0.options
17236 }
17237 }
17238
17239 #[derive(Clone, Debug)]
17260 pub struct ListUrlLists(RequestBuilder<crate::model::ListUrlListsRequest>);
17261
17262 impl ListUrlLists {
17263 pub(crate) fn new(
17264 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17265 ) -> Self {
17266 Self(RequestBuilder::new(stub))
17267 }
17268
17269 pub fn with_request<V: Into<crate::model::ListUrlListsRequest>>(mut self, v: V) -> Self {
17271 self.0.request = v.into();
17272 self
17273 }
17274
17275 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17277 self.0.options = v.into();
17278 self
17279 }
17280
17281 pub async fn send(self) -> Result<crate::model::ListUrlListsResponse> {
17283 (*self.0.stub)
17284 .list_url_lists(self.0.request, self.0.options)
17285 .await
17286 .map(crate::Response::into_body)
17287 }
17288
17289 pub fn by_page(
17291 self,
17292 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUrlListsResponse, crate::Error>
17293 {
17294 use std::clone::Clone;
17295 let token = self.0.request.page_token.clone();
17296 let execute = move |token: String| {
17297 let mut builder = self.clone();
17298 builder.0.request = builder.0.request.set_page_token(token);
17299 builder.send()
17300 };
17301 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17302 }
17303
17304 pub fn by_item(
17306 self,
17307 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17308 crate::model::ListUrlListsResponse,
17309 crate::Error,
17310 > {
17311 use google_cloud_gax::paginator::Paginator;
17312 self.by_page().items()
17313 }
17314
17315 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17319 self.0.request.parent = v.into();
17320 self
17321 }
17322
17323 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17325 self.0.request.page_size = v.into();
17326 self
17327 }
17328
17329 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17331 self.0.request.page_token = v.into();
17332 self
17333 }
17334 }
17335
17336 #[doc(hidden)]
17337 impl crate::RequestBuilder for ListUrlLists {
17338 fn request_options(&mut self) -> &mut crate::RequestOptions {
17339 &mut self.0.options
17340 }
17341 }
17342
17343 #[derive(Clone, Debug)]
17360 pub struct GetUrlList(RequestBuilder<crate::model::GetUrlListRequest>);
17361
17362 impl GetUrlList {
17363 pub(crate) fn new(
17364 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17365 ) -> Self {
17366 Self(RequestBuilder::new(stub))
17367 }
17368
17369 pub fn with_request<V: Into<crate::model::GetUrlListRequest>>(mut self, v: V) -> Self {
17371 self.0.request = v.into();
17372 self
17373 }
17374
17375 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17377 self.0.options = v.into();
17378 self
17379 }
17380
17381 pub async fn send(self) -> Result<crate::model::UrlList> {
17383 (*self.0.stub)
17384 .get_url_list(self.0.request, self.0.options)
17385 .await
17386 .map(crate::Response::into_body)
17387 }
17388
17389 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17393 self.0.request.name = v.into();
17394 self
17395 }
17396 }
17397
17398 #[doc(hidden)]
17399 impl crate::RequestBuilder for GetUrlList {
17400 fn request_options(&mut self) -> &mut crate::RequestOptions {
17401 &mut self.0.options
17402 }
17403 }
17404
17405 #[derive(Clone, Debug)]
17423 pub struct CreateUrlList(RequestBuilder<crate::model::CreateUrlListRequest>);
17424
17425 impl CreateUrlList {
17426 pub(crate) fn new(
17427 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17428 ) -> Self {
17429 Self(RequestBuilder::new(stub))
17430 }
17431
17432 pub fn with_request<V: Into<crate::model::CreateUrlListRequest>>(mut self, v: V) -> Self {
17434 self.0.request = v.into();
17435 self
17436 }
17437
17438 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17440 self.0.options = v.into();
17441 self
17442 }
17443
17444 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17451 (*self.0.stub)
17452 .create_url_list(self.0.request, self.0.options)
17453 .await
17454 .map(crate::Response::into_body)
17455 }
17456
17457 pub fn poller(
17459 self,
17460 ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
17461 {
17462 type Operation = google_cloud_lro::internal::Operation<
17463 crate::model::UrlList,
17464 crate::model::OperationMetadata,
17465 >;
17466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17468
17469 let stub = self.0.stub.clone();
17470 let mut options = self.0.options.clone();
17471 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17472 let query = move |name| {
17473 let stub = stub.clone();
17474 let options = options.clone();
17475 async {
17476 let op = GetOperation::new(stub)
17477 .set_name(name)
17478 .with_options(options)
17479 .send()
17480 .await?;
17481 Ok(Operation::new(op))
17482 }
17483 };
17484
17485 let start = move || async {
17486 let op = self.send().await?;
17487 Ok(Operation::new(op))
17488 };
17489
17490 google_cloud_lro::internal::new_poller(
17491 polling_error_policy,
17492 polling_backoff_policy,
17493 start,
17494 query,
17495 )
17496 }
17497
17498 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17502 self.0.request.parent = v.into();
17503 self
17504 }
17505
17506 pub fn set_url_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17510 self.0.request.url_list_id = v.into();
17511 self
17512 }
17513
17514 pub fn set_url_list<T>(mut self, v: T) -> Self
17518 where
17519 T: std::convert::Into<crate::model::UrlList>,
17520 {
17521 self.0.request.url_list = std::option::Option::Some(v.into());
17522 self
17523 }
17524
17525 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
17529 where
17530 T: std::convert::Into<crate::model::UrlList>,
17531 {
17532 self.0.request.url_list = v.map(|x| x.into());
17533 self
17534 }
17535 }
17536
17537 #[doc(hidden)]
17538 impl crate::RequestBuilder for CreateUrlList {
17539 fn request_options(&mut self) -> &mut crate::RequestOptions {
17540 &mut self.0.options
17541 }
17542 }
17543
17544 #[derive(Clone, Debug)]
17562 pub struct UpdateUrlList(RequestBuilder<crate::model::UpdateUrlListRequest>);
17563
17564 impl UpdateUrlList {
17565 pub(crate) fn new(
17566 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17567 ) -> Self {
17568 Self(RequestBuilder::new(stub))
17569 }
17570
17571 pub fn with_request<V: Into<crate::model::UpdateUrlListRequest>>(mut self, v: V) -> Self {
17573 self.0.request = v.into();
17574 self
17575 }
17576
17577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17579 self.0.options = v.into();
17580 self
17581 }
17582
17583 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17590 (*self.0.stub)
17591 .update_url_list(self.0.request, self.0.options)
17592 .await
17593 .map(crate::Response::into_body)
17594 }
17595
17596 pub fn poller(
17598 self,
17599 ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
17600 {
17601 type Operation = google_cloud_lro::internal::Operation<
17602 crate::model::UrlList,
17603 crate::model::OperationMetadata,
17604 >;
17605 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17606 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17607
17608 let stub = self.0.stub.clone();
17609 let mut options = self.0.options.clone();
17610 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17611 let query = move |name| {
17612 let stub = stub.clone();
17613 let options = options.clone();
17614 async {
17615 let op = GetOperation::new(stub)
17616 .set_name(name)
17617 .with_options(options)
17618 .send()
17619 .await?;
17620 Ok(Operation::new(op))
17621 }
17622 };
17623
17624 let start = move || async {
17625 let op = self.send().await?;
17626 Ok(Operation::new(op))
17627 };
17628
17629 google_cloud_lro::internal::new_poller(
17630 polling_error_policy,
17631 polling_backoff_policy,
17632 start,
17633 query,
17634 )
17635 }
17636
17637 pub fn set_update_mask<T>(mut self, v: T) -> Self
17639 where
17640 T: std::convert::Into<wkt::FieldMask>,
17641 {
17642 self.0.request.update_mask = std::option::Option::Some(v.into());
17643 self
17644 }
17645
17646 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17648 where
17649 T: std::convert::Into<wkt::FieldMask>,
17650 {
17651 self.0.request.update_mask = v.map(|x| x.into());
17652 self
17653 }
17654
17655 pub fn set_url_list<T>(mut self, v: T) -> Self
17659 where
17660 T: std::convert::Into<crate::model::UrlList>,
17661 {
17662 self.0.request.url_list = std::option::Option::Some(v.into());
17663 self
17664 }
17665
17666 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
17670 where
17671 T: std::convert::Into<crate::model::UrlList>,
17672 {
17673 self.0.request.url_list = v.map(|x| x.into());
17674 self
17675 }
17676 }
17677
17678 #[doc(hidden)]
17679 impl crate::RequestBuilder for UpdateUrlList {
17680 fn request_options(&mut self) -> &mut crate::RequestOptions {
17681 &mut self.0.options
17682 }
17683 }
17684
17685 #[derive(Clone, Debug)]
17703 pub struct DeleteUrlList(RequestBuilder<crate::model::DeleteUrlListRequest>);
17704
17705 impl DeleteUrlList {
17706 pub(crate) fn new(
17707 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17708 ) -> Self {
17709 Self(RequestBuilder::new(stub))
17710 }
17711
17712 pub fn with_request<V: Into<crate::model::DeleteUrlListRequest>>(mut self, v: V) -> Self {
17714 self.0.request = v.into();
17715 self
17716 }
17717
17718 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17720 self.0.options = v.into();
17721 self
17722 }
17723
17724 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17731 (*self.0.stub)
17732 .delete_url_list(self.0.request, self.0.options)
17733 .await
17734 .map(crate::Response::into_body)
17735 }
17736
17737 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17739 type Operation =
17740 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17741 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17742 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17743
17744 let stub = self.0.stub.clone();
17745 let mut options = self.0.options.clone();
17746 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17747 let query = move |name| {
17748 let stub = stub.clone();
17749 let options = options.clone();
17750 async {
17751 let op = GetOperation::new(stub)
17752 .set_name(name)
17753 .with_options(options)
17754 .send()
17755 .await?;
17756 Ok(Operation::new(op))
17757 }
17758 };
17759
17760 let start = move || async {
17761 let op = self.send().await?;
17762 Ok(Operation::new(op))
17763 };
17764
17765 google_cloud_lro::internal::new_unit_response_poller(
17766 polling_error_policy,
17767 polling_backoff_policy,
17768 start,
17769 query,
17770 )
17771 }
17772
17773 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17777 self.0.request.name = v.into();
17778 self
17779 }
17780 }
17781
17782 #[doc(hidden)]
17783 impl crate::RequestBuilder for DeleteUrlList {
17784 fn request_options(&mut self) -> &mut crate::RequestOptions {
17785 &mut self.0.options
17786 }
17787 }
17788
17789 #[derive(Clone, Debug)]
17810 pub struct ListTlsInspectionPolicies(
17811 RequestBuilder<crate::model::ListTlsInspectionPoliciesRequest>,
17812 );
17813
17814 impl ListTlsInspectionPolicies {
17815 pub(crate) fn new(
17816 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17817 ) -> Self {
17818 Self(RequestBuilder::new(stub))
17819 }
17820
17821 pub fn with_request<V: Into<crate::model::ListTlsInspectionPoliciesRequest>>(
17823 mut self,
17824 v: V,
17825 ) -> Self {
17826 self.0.request = v.into();
17827 self
17828 }
17829
17830 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17832 self.0.options = v.into();
17833 self
17834 }
17835
17836 pub async fn send(self) -> Result<crate::model::ListTlsInspectionPoliciesResponse> {
17838 (*self.0.stub)
17839 .list_tls_inspection_policies(self.0.request, self.0.options)
17840 .await
17841 .map(crate::Response::into_body)
17842 }
17843
17844 pub fn by_page(
17846 self,
17847 ) -> impl google_cloud_gax::paginator::Paginator<
17848 crate::model::ListTlsInspectionPoliciesResponse,
17849 crate::Error,
17850 > {
17851 use std::clone::Clone;
17852 let token = self.0.request.page_token.clone();
17853 let execute = move |token: String| {
17854 let mut builder = self.clone();
17855 builder.0.request = builder.0.request.set_page_token(token);
17856 builder.send()
17857 };
17858 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17859 }
17860
17861 pub fn by_item(
17863 self,
17864 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17865 crate::model::ListTlsInspectionPoliciesResponse,
17866 crate::Error,
17867 > {
17868 use google_cloud_gax::paginator::Paginator;
17869 self.by_page().items()
17870 }
17871
17872 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17876 self.0.request.parent = v.into();
17877 self
17878 }
17879
17880 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17882 self.0.request.page_size = v.into();
17883 self
17884 }
17885
17886 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17888 self.0.request.page_token = v.into();
17889 self
17890 }
17891 }
17892
17893 #[doc(hidden)]
17894 impl crate::RequestBuilder for ListTlsInspectionPolicies {
17895 fn request_options(&mut self) -> &mut crate::RequestOptions {
17896 &mut self.0.options
17897 }
17898 }
17899
17900 #[derive(Clone, Debug)]
17917 pub struct GetTlsInspectionPolicy(RequestBuilder<crate::model::GetTlsInspectionPolicyRequest>);
17918
17919 impl GetTlsInspectionPolicy {
17920 pub(crate) fn new(
17921 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17922 ) -> Self {
17923 Self(RequestBuilder::new(stub))
17924 }
17925
17926 pub fn with_request<V: Into<crate::model::GetTlsInspectionPolicyRequest>>(
17928 mut self,
17929 v: V,
17930 ) -> Self {
17931 self.0.request = v.into();
17932 self
17933 }
17934
17935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17937 self.0.options = v.into();
17938 self
17939 }
17940
17941 pub async fn send(self) -> Result<crate::model::TlsInspectionPolicy> {
17943 (*self.0.stub)
17944 .get_tls_inspection_policy(self.0.request, self.0.options)
17945 .await
17946 .map(crate::Response::into_body)
17947 }
17948
17949 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17953 self.0.request.name = v.into();
17954 self
17955 }
17956 }
17957
17958 #[doc(hidden)]
17959 impl crate::RequestBuilder for GetTlsInspectionPolicy {
17960 fn request_options(&mut self) -> &mut crate::RequestOptions {
17961 &mut self.0.options
17962 }
17963 }
17964
17965 #[derive(Clone, Debug)]
17983 pub struct CreateTlsInspectionPolicy(
17984 RequestBuilder<crate::model::CreateTlsInspectionPolicyRequest>,
17985 );
17986
17987 impl CreateTlsInspectionPolicy {
17988 pub(crate) fn new(
17989 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17990 ) -> Self {
17991 Self(RequestBuilder::new(stub))
17992 }
17993
17994 pub fn with_request<V: Into<crate::model::CreateTlsInspectionPolicyRequest>>(
17996 mut self,
17997 v: V,
17998 ) -> Self {
17999 self.0.request = v.into();
18000 self
18001 }
18002
18003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18005 self.0.options = v.into();
18006 self
18007 }
18008
18009 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18016 (*self.0.stub)
18017 .create_tls_inspection_policy(self.0.request, self.0.options)
18018 .await
18019 .map(crate::Response::into_body)
18020 }
18021
18022 pub fn poller(
18024 self,
18025 ) -> impl google_cloud_lro::Poller<
18026 crate::model::TlsInspectionPolicy,
18027 crate::model::OperationMetadata,
18028 > {
18029 type Operation = google_cloud_lro::internal::Operation<
18030 crate::model::TlsInspectionPolicy,
18031 crate::model::OperationMetadata,
18032 >;
18033 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18034 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18035
18036 let stub = self.0.stub.clone();
18037 let mut options = self.0.options.clone();
18038 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18039 let query = move |name| {
18040 let stub = stub.clone();
18041 let options = options.clone();
18042 async {
18043 let op = GetOperation::new(stub)
18044 .set_name(name)
18045 .with_options(options)
18046 .send()
18047 .await?;
18048 Ok(Operation::new(op))
18049 }
18050 };
18051
18052 let start = move || async {
18053 let op = self.send().await?;
18054 Ok(Operation::new(op))
18055 };
18056
18057 google_cloud_lro::internal::new_poller(
18058 polling_error_policy,
18059 polling_backoff_policy,
18060 start,
18061 query,
18062 )
18063 }
18064
18065 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18069 self.0.request.parent = v.into();
18070 self
18071 }
18072
18073 pub fn set_tls_inspection_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18077 self.0.request.tls_inspection_policy_id = v.into();
18078 self
18079 }
18080
18081 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18085 where
18086 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18087 {
18088 self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18089 self
18090 }
18091
18092 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18096 where
18097 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18098 {
18099 self.0.request.tls_inspection_policy = v.map(|x| x.into());
18100 self
18101 }
18102 }
18103
18104 #[doc(hidden)]
18105 impl crate::RequestBuilder for CreateTlsInspectionPolicy {
18106 fn request_options(&mut self) -> &mut crate::RequestOptions {
18107 &mut self.0.options
18108 }
18109 }
18110
18111 #[derive(Clone, Debug)]
18129 pub struct UpdateTlsInspectionPolicy(
18130 RequestBuilder<crate::model::UpdateTlsInspectionPolicyRequest>,
18131 );
18132
18133 impl UpdateTlsInspectionPolicy {
18134 pub(crate) fn new(
18135 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18136 ) -> Self {
18137 Self(RequestBuilder::new(stub))
18138 }
18139
18140 pub fn with_request<V: Into<crate::model::UpdateTlsInspectionPolicyRequest>>(
18142 mut self,
18143 v: V,
18144 ) -> Self {
18145 self.0.request = v.into();
18146 self
18147 }
18148
18149 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18151 self.0.options = v.into();
18152 self
18153 }
18154
18155 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18162 (*self.0.stub)
18163 .update_tls_inspection_policy(self.0.request, self.0.options)
18164 .await
18165 .map(crate::Response::into_body)
18166 }
18167
18168 pub fn poller(
18170 self,
18171 ) -> impl google_cloud_lro::Poller<
18172 crate::model::TlsInspectionPolicy,
18173 crate::model::OperationMetadata,
18174 > {
18175 type Operation = google_cloud_lro::internal::Operation<
18176 crate::model::TlsInspectionPolicy,
18177 crate::model::OperationMetadata,
18178 >;
18179 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18180 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18181
18182 let stub = self.0.stub.clone();
18183 let mut options = self.0.options.clone();
18184 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18185 let query = move |name| {
18186 let stub = stub.clone();
18187 let options = options.clone();
18188 async {
18189 let op = GetOperation::new(stub)
18190 .set_name(name)
18191 .with_options(options)
18192 .send()
18193 .await?;
18194 Ok(Operation::new(op))
18195 }
18196 };
18197
18198 let start = move || async {
18199 let op = self.send().await?;
18200 Ok(Operation::new(op))
18201 };
18202
18203 google_cloud_lro::internal::new_poller(
18204 polling_error_policy,
18205 polling_backoff_policy,
18206 start,
18207 query,
18208 )
18209 }
18210
18211 pub fn set_update_mask<T>(mut self, v: T) -> Self
18213 where
18214 T: std::convert::Into<wkt::FieldMask>,
18215 {
18216 self.0.request.update_mask = std::option::Option::Some(v.into());
18217 self
18218 }
18219
18220 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18222 where
18223 T: std::convert::Into<wkt::FieldMask>,
18224 {
18225 self.0.request.update_mask = v.map(|x| x.into());
18226 self
18227 }
18228
18229 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18233 where
18234 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18235 {
18236 self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18237 self
18238 }
18239
18240 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18244 where
18245 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18246 {
18247 self.0.request.tls_inspection_policy = v.map(|x| x.into());
18248 self
18249 }
18250 }
18251
18252 #[doc(hidden)]
18253 impl crate::RequestBuilder for UpdateTlsInspectionPolicy {
18254 fn request_options(&mut self) -> &mut crate::RequestOptions {
18255 &mut self.0.options
18256 }
18257 }
18258
18259 #[derive(Clone, Debug)]
18277 pub struct DeleteTlsInspectionPolicy(
18278 RequestBuilder<crate::model::DeleteTlsInspectionPolicyRequest>,
18279 );
18280
18281 impl DeleteTlsInspectionPolicy {
18282 pub(crate) fn new(
18283 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18284 ) -> Self {
18285 Self(RequestBuilder::new(stub))
18286 }
18287
18288 pub fn with_request<V: Into<crate::model::DeleteTlsInspectionPolicyRequest>>(
18290 mut self,
18291 v: V,
18292 ) -> Self {
18293 self.0.request = v.into();
18294 self
18295 }
18296
18297 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18299 self.0.options = v.into();
18300 self
18301 }
18302
18303 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18310 (*self.0.stub)
18311 .delete_tls_inspection_policy(self.0.request, self.0.options)
18312 .await
18313 .map(crate::Response::into_body)
18314 }
18315
18316 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18318 type Operation =
18319 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18320 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18321 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18322
18323 let stub = self.0.stub.clone();
18324 let mut options = self.0.options.clone();
18325 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18326 let query = move |name| {
18327 let stub = stub.clone();
18328 let options = options.clone();
18329 async {
18330 let op = GetOperation::new(stub)
18331 .set_name(name)
18332 .with_options(options)
18333 .send()
18334 .await?;
18335 Ok(Operation::new(op))
18336 }
18337 };
18338
18339 let start = move || async {
18340 let op = self.send().await?;
18341 Ok(Operation::new(op))
18342 };
18343
18344 google_cloud_lro::internal::new_unit_response_poller(
18345 polling_error_policy,
18346 polling_backoff_policy,
18347 start,
18348 query,
18349 )
18350 }
18351
18352 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18356 self.0.request.name = v.into();
18357 self
18358 }
18359
18360 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18362 self.0.request.force = v.into();
18363 self
18364 }
18365 }
18366
18367 #[doc(hidden)]
18368 impl crate::RequestBuilder for DeleteTlsInspectionPolicy {
18369 fn request_options(&mut self) -> &mut crate::RequestOptions {
18370 &mut self.0.options
18371 }
18372 }
18373
18374 #[derive(Clone, Debug)]
18395 pub struct ListAuthzPolicies(RequestBuilder<crate::model::ListAuthzPoliciesRequest>);
18396
18397 impl ListAuthzPolicies {
18398 pub(crate) fn new(
18399 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18400 ) -> Self {
18401 Self(RequestBuilder::new(stub))
18402 }
18403
18404 pub fn with_request<V: Into<crate::model::ListAuthzPoliciesRequest>>(
18406 mut self,
18407 v: V,
18408 ) -> Self {
18409 self.0.request = v.into();
18410 self
18411 }
18412
18413 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18415 self.0.options = v.into();
18416 self
18417 }
18418
18419 pub async fn send(self) -> Result<crate::model::ListAuthzPoliciesResponse> {
18421 (*self.0.stub)
18422 .list_authz_policies(self.0.request, self.0.options)
18423 .await
18424 .map(crate::Response::into_body)
18425 }
18426
18427 pub fn by_page(
18429 self,
18430 ) -> impl google_cloud_gax::paginator::Paginator<
18431 crate::model::ListAuthzPoliciesResponse,
18432 crate::Error,
18433 > {
18434 use std::clone::Clone;
18435 let token = self.0.request.page_token.clone();
18436 let execute = move |token: String| {
18437 let mut builder = self.clone();
18438 builder.0.request = builder.0.request.set_page_token(token);
18439 builder.send()
18440 };
18441 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18442 }
18443
18444 pub fn by_item(
18446 self,
18447 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18448 crate::model::ListAuthzPoliciesResponse,
18449 crate::Error,
18450 > {
18451 use google_cloud_gax::paginator::Paginator;
18452 self.by_page().items()
18453 }
18454
18455 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18459 self.0.request.parent = v.into();
18460 self
18461 }
18462
18463 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18465 self.0.request.page_size = v.into();
18466 self
18467 }
18468
18469 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18471 self.0.request.page_token = v.into();
18472 self
18473 }
18474
18475 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18477 self.0.request.filter = v.into();
18478 self
18479 }
18480
18481 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18483 self.0.request.order_by = v.into();
18484 self
18485 }
18486 }
18487
18488 #[doc(hidden)]
18489 impl crate::RequestBuilder for ListAuthzPolicies {
18490 fn request_options(&mut self) -> &mut crate::RequestOptions {
18491 &mut self.0.options
18492 }
18493 }
18494
18495 #[derive(Clone, Debug)]
18512 pub struct GetAuthzPolicy(RequestBuilder<crate::model::GetAuthzPolicyRequest>);
18513
18514 impl GetAuthzPolicy {
18515 pub(crate) fn new(
18516 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18517 ) -> Self {
18518 Self(RequestBuilder::new(stub))
18519 }
18520
18521 pub fn with_request<V: Into<crate::model::GetAuthzPolicyRequest>>(mut self, v: V) -> Self {
18523 self.0.request = v.into();
18524 self
18525 }
18526
18527 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18529 self.0.options = v.into();
18530 self
18531 }
18532
18533 pub async fn send(self) -> Result<crate::model::AuthzPolicy> {
18535 (*self.0.stub)
18536 .get_authz_policy(self.0.request, self.0.options)
18537 .await
18538 .map(crate::Response::into_body)
18539 }
18540
18541 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18545 self.0.request.name = v.into();
18546 self
18547 }
18548 }
18549
18550 #[doc(hidden)]
18551 impl crate::RequestBuilder for GetAuthzPolicy {
18552 fn request_options(&mut self) -> &mut crate::RequestOptions {
18553 &mut self.0.options
18554 }
18555 }
18556
18557 #[derive(Clone, Debug)]
18575 pub struct CreateAuthzPolicy(RequestBuilder<crate::model::CreateAuthzPolicyRequest>);
18576
18577 impl CreateAuthzPolicy {
18578 pub(crate) fn new(
18579 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18580 ) -> Self {
18581 Self(RequestBuilder::new(stub))
18582 }
18583
18584 pub fn with_request<V: Into<crate::model::CreateAuthzPolicyRequest>>(
18586 mut self,
18587 v: V,
18588 ) -> Self {
18589 self.0.request = v.into();
18590 self
18591 }
18592
18593 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18595 self.0.options = v.into();
18596 self
18597 }
18598
18599 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18606 (*self.0.stub)
18607 .create_authz_policy(self.0.request, self.0.options)
18608 .await
18609 .map(crate::Response::into_body)
18610 }
18611
18612 pub fn poller(
18614 self,
18615 ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
18616 {
18617 type Operation = google_cloud_lro::internal::Operation<
18618 crate::model::AuthzPolicy,
18619 crate::model::OperationMetadata,
18620 >;
18621 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18622 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18623
18624 let stub = self.0.stub.clone();
18625 let mut options = self.0.options.clone();
18626 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18627 let query = move |name| {
18628 let stub = stub.clone();
18629 let options = options.clone();
18630 async {
18631 let op = GetOperation::new(stub)
18632 .set_name(name)
18633 .with_options(options)
18634 .send()
18635 .await?;
18636 Ok(Operation::new(op))
18637 }
18638 };
18639
18640 let start = move || async {
18641 let op = self.send().await?;
18642 Ok(Operation::new(op))
18643 };
18644
18645 google_cloud_lro::internal::new_poller(
18646 polling_error_policy,
18647 polling_backoff_policy,
18648 start,
18649 query,
18650 )
18651 }
18652
18653 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18657 self.0.request.parent = v.into();
18658 self
18659 }
18660
18661 pub fn set_authz_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18665 self.0.request.authz_policy_id = v.into();
18666 self
18667 }
18668
18669 pub fn set_authz_policy<T>(mut self, v: T) -> Self
18673 where
18674 T: std::convert::Into<crate::model::AuthzPolicy>,
18675 {
18676 self.0.request.authz_policy = std::option::Option::Some(v.into());
18677 self
18678 }
18679
18680 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
18684 where
18685 T: std::convert::Into<crate::model::AuthzPolicy>,
18686 {
18687 self.0.request.authz_policy = v.map(|x| x.into());
18688 self
18689 }
18690
18691 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18693 self.0.request.request_id = v.into();
18694 self
18695 }
18696 }
18697
18698 #[doc(hidden)]
18699 impl crate::RequestBuilder for CreateAuthzPolicy {
18700 fn request_options(&mut self) -> &mut crate::RequestOptions {
18701 &mut self.0.options
18702 }
18703 }
18704
18705 #[derive(Clone, Debug)]
18723 pub struct UpdateAuthzPolicy(RequestBuilder<crate::model::UpdateAuthzPolicyRequest>);
18724
18725 impl UpdateAuthzPolicy {
18726 pub(crate) fn new(
18727 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18728 ) -> Self {
18729 Self(RequestBuilder::new(stub))
18730 }
18731
18732 pub fn with_request<V: Into<crate::model::UpdateAuthzPolicyRequest>>(
18734 mut self,
18735 v: V,
18736 ) -> Self {
18737 self.0.request = v.into();
18738 self
18739 }
18740
18741 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18743 self.0.options = v.into();
18744 self
18745 }
18746
18747 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18754 (*self.0.stub)
18755 .update_authz_policy(self.0.request, self.0.options)
18756 .await
18757 .map(crate::Response::into_body)
18758 }
18759
18760 pub fn poller(
18762 self,
18763 ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
18764 {
18765 type Operation = google_cloud_lro::internal::Operation<
18766 crate::model::AuthzPolicy,
18767 crate::model::OperationMetadata,
18768 >;
18769 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18770 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18771
18772 let stub = self.0.stub.clone();
18773 let mut options = self.0.options.clone();
18774 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18775 let query = move |name| {
18776 let stub = stub.clone();
18777 let options = options.clone();
18778 async {
18779 let op = GetOperation::new(stub)
18780 .set_name(name)
18781 .with_options(options)
18782 .send()
18783 .await?;
18784 Ok(Operation::new(op))
18785 }
18786 };
18787
18788 let start = move || async {
18789 let op = self.send().await?;
18790 Ok(Operation::new(op))
18791 };
18792
18793 google_cloud_lro::internal::new_poller(
18794 polling_error_policy,
18795 polling_backoff_policy,
18796 start,
18797 query,
18798 )
18799 }
18800
18801 pub fn set_update_mask<T>(mut self, v: T) -> Self
18805 where
18806 T: std::convert::Into<wkt::FieldMask>,
18807 {
18808 self.0.request.update_mask = std::option::Option::Some(v.into());
18809 self
18810 }
18811
18812 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18816 where
18817 T: std::convert::Into<wkt::FieldMask>,
18818 {
18819 self.0.request.update_mask = v.map(|x| x.into());
18820 self
18821 }
18822
18823 pub fn set_authz_policy<T>(mut self, v: T) -> Self
18827 where
18828 T: std::convert::Into<crate::model::AuthzPolicy>,
18829 {
18830 self.0.request.authz_policy = std::option::Option::Some(v.into());
18831 self
18832 }
18833
18834 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
18838 where
18839 T: std::convert::Into<crate::model::AuthzPolicy>,
18840 {
18841 self.0.request.authz_policy = v.map(|x| x.into());
18842 self
18843 }
18844
18845 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18847 self.0.request.request_id = v.into();
18848 self
18849 }
18850 }
18851
18852 #[doc(hidden)]
18853 impl crate::RequestBuilder for UpdateAuthzPolicy {
18854 fn request_options(&mut self) -> &mut crate::RequestOptions {
18855 &mut self.0.options
18856 }
18857 }
18858
18859 #[derive(Clone, Debug)]
18877 pub struct DeleteAuthzPolicy(RequestBuilder<crate::model::DeleteAuthzPolicyRequest>);
18878
18879 impl DeleteAuthzPolicy {
18880 pub(crate) fn new(
18881 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18882 ) -> Self {
18883 Self(RequestBuilder::new(stub))
18884 }
18885
18886 pub fn with_request<V: Into<crate::model::DeleteAuthzPolicyRequest>>(
18888 mut self,
18889 v: V,
18890 ) -> Self {
18891 self.0.request = v.into();
18892 self
18893 }
18894
18895 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18897 self.0.options = v.into();
18898 self
18899 }
18900
18901 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18908 (*self.0.stub)
18909 .delete_authz_policy(self.0.request, self.0.options)
18910 .await
18911 .map(crate::Response::into_body)
18912 }
18913
18914 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18916 type Operation =
18917 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18918 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18919 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18920
18921 let stub = self.0.stub.clone();
18922 let mut options = self.0.options.clone();
18923 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18924 let query = move |name| {
18925 let stub = stub.clone();
18926 let options = options.clone();
18927 async {
18928 let op = GetOperation::new(stub)
18929 .set_name(name)
18930 .with_options(options)
18931 .send()
18932 .await?;
18933 Ok(Operation::new(op))
18934 }
18935 };
18936
18937 let start = move || async {
18938 let op = self.send().await?;
18939 Ok(Operation::new(op))
18940 };
18941
18942 google_cloud_lro::internal::new_unit_response_poller(
18943 polling_error_policy,
18944 polling_backoff_policy,
18945 start,
18946 query,
18947 )
18948 }
18949
18950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18954 self.0.request.name = v.into();
18955 self
18956 }
18957
18958 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18960 self.0.request.request_id = v.into();
18961 self
18962 }
18963 }
18964
18965 #[doc(hidden)]
18966 impl crate::RequestBuilder for DeleteAuthzPolicy {
18967 fn request_options(&mut self) -> &mut crate::RequestOptions {
18968 &mut self.0.options
18969 }
18970 }
18971
18972 #[derive(Clone, Debug)]
18993 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18994
18995 impl ListLocations {
18996 pub(crate) fn new(
18997 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18998 ) -> Self {
18999 Self(RequestBuilder::new(stub))
19000 }
19001
19002 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19004 mut self,
19005 v: V,
19006 ) -> Self {
19007 self.0.request = v.into();
19008 self
19009 }
19010
19011 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19013 self.0.options = v.into();
19014 self
19015 }
19016
19017 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19019 (*self.0.stub)
19020 .list_locations(self.0.request, self.0.options)
19021 .await
19022 .map(crate::Response::into_body)
19023 }
19024
19025 pub fn by_page(
19027 self,
19028 ) -> impl google_cloud_gax::paginator::Paginator<
19029 google_cloud_location::model::ListLocationsResponse,
19030 crate::Error,
19031 > {
19032 use std::clone::Clone;
19033 let token = self.0.request.page_token.clone();
19034 let execute = move |token: String| {
19035 let mut builder = self.clone();
19036 builder.0.request = builder.0.request.set_page_token(token);
19037 builder.send()
19038 };
19039 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19040 }
19041
19042 pub fn by_item(
19044 self,
19045 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19046 google_cloud_location::model::ListLocationsResponse,
19047 crate::Error,
19048 > {
19049 use google_cloud_gax::paginator::Paginator;
19050 self.by_page().items()
19051 }
19052
19053 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19055 self.0.request.name = v.into();
19056 self
19057 }
19058
19059 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19061 self.0.request.filter = v.into();
19062 self
19063 }
19064
19065 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19067 self.0.request.page_size = v.into();
19068 self
19069 }
19070
19071 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19073 self.0.request.page_token = v.into();
19074 self
19075 }
19076 }
19077
19078 #[doc(hidden)]
19079 impl crate::RequestBuilder for ListLocations {
19080 fn request_options(&mut self) -> &mut crate::RequestOptions {
19081 &mut self.0.options
19082 }
19083 }
19084
19085 #[derive(Clone, Debug)]
19102 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19103
19104 impl GetLocation {
19105 pub(crate) fn new(
19106 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19107 ) -> Self {
19108 Self(RequestBuilder::new(stub))
19109 }
19110
19111 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19113 mut self,
19114 v: V,
19115 ) -> Self {
19116 self.0.request = v.into();
19117 self
19118 }
19119
19120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19122 self.0.options = v.into();
19123 self
19124 }
19125
19126 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19128 (*self.0.stub)
19129 .get_location(self.0.request, self.0.options)
19130 .await
19131 .map(crate::Response::into_body)
19132 }
19133
19134 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19136 self.0.request.name = v.into();
19137 self
19138 }
19139 }
19140
19141 #[doc(hidden)]
19142 impl crate::RequestBuilder for GetLocation {
19143 fn request_options(&mut self) -> &mut crate::RequestOptions {
19144 &mut self.0.options
19145 }
19146 }
19147
19148 #[derive(Clone, Debug)]
19165 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
19166
19167 impl SetIamPolicy {
19168 pub(crate) fn new(
19169 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19170 ) -> Self {
19171 Self(RequestBuilder::new(stub))
19172 }
19173
19174 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
19176 mut self,
19177 v: V,
19178 ) -> Self {
19179 self.0.request = v.into();
19180 self
19181 }
19182
19183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19185 self.0.options = v.into();
19186 self
19187 }
19188
19189 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19191 (*self.0.stub)
19192 .set_iam_policy(self.0.request, self.0.options)
19193 .await
19194 .map(crate::Response::into_body)
19195 }
19196
19197 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19201 self.0.request.resource = v.into();
19202 self
19203 }
19204
19205 pub fn set_policy<T>(mut self, v: T) -> Self
19209 where
19210 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19211 {
19212 self.0.request.policy = std::option::Option::Some(v.into());
19213 self
19214 }
19215
19216 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
19220 where
19221 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19222 {
19223 self.0.request.policy = v.map(|x| x.into());
19224 self
19225 }
19226
19227 pub fn set_update_mask<T>(mut self, v: T) -> Self
19229 where
19230 T: std::convert::Into<wkt::FieldMask>,
19231 {
19232 self.0.request.update_mask = std::option::Option::Some(v.into());
19233 self
19234 }
19235
19236 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19238 where
19239 T: std::convert::Into<wkt::FieldMask>,
19240 {
19241 self.0.request.update_mask = v.map(|x| x.into());
19242 self
19243 }
19244 }
19245
19246 #[doc(hidden)]
19247 impl crate::RequestBuilder for SetIamPolicy {
19248 fn request_options(&mut self) -> &mut crate::RequestOptions {
19249 &mut self.0.options
19250 }
19251 }
19252
19253 #[derive(Clone, Debug)]
19270 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
19271
19272 impl GetIamPolicy {
19273 pub(crate) fn new(
19274 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19275 ) -> Self {
19276 Self(RequestBuilder::new(stub))
19277 }
19278
19279 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
19281 mut self,
19282 v: V,
19283 ) -> Self {
19284 self.0.request = v.into();
19285 self
19286 }
19287
19288 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19290 self.0.options = v.into();
19291 self
19292 }
19293
19294 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19296 (*self.0.stub)
19297 .get_iam_policy(self.0.request, self.0.options)
19298 .await
19299 .map(crate::Response::into_body)
19300 }
19301
19302 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19306 self.0.request.resource = v.into();
19307 self
19308 }
19309
19310 pub fn set_options<T>(mut self, v: T) -> Self
19312 where
19313 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19314 {
19315 self.0.request.options = std::option::Option::Some(v.into());
19316 self
19317 }
19318
19319 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
19321 where
19322 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19323 {
19324 self.0.request.options = v.map(|x| x.into());
19325 self
19326 }
19327 }
19328
19329 #[doc(hidden)]
19330 impl crate::RequestBuilder for GetIamPolicy {
19331 fn request_options(&mut self) -> &mut crate::RequestOptions {
19332 &mut self.0.options
19333 }
19334 }
19335
19336 #[derive(Clone, Debug)]
19353 pub struct TestIamPermissions(
19354 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
19355 );
19356
19357 impl TestIamPermissions {
19358 pub(crate) fn new(
19359 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19360 ) -> Self {
19361 Self(RequestBuilder::new(stub))
19362 }
19363
19364 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
19366 mut self,
19367 v: V,
19368 ) -> Self {
19369 self.0.request = v.into();
19370 self
19371 }
19372
19373 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19375 self.0.options = v.into();
19376 self
19377 }
19378
19379 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
19381 (*self.0.stub)
19382 .test_iam_permissions(self.0.request, self.0.options)
19383 .await
19384 .map(crate::Response::into_body)
19385 }
19386
19387 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19391 self.0.request.resource = v.into();
19392 self
19393 }
19394
19395 pub fn set_permissions<T, V>(mut self, v: T) -> Self
19399 where
19400 T: std::iter::IntoIterator<Item = V>,
19401 V: std::convert::Into<std::string::String>,
19402 {
19403 use std::iter::Iterator;
19404 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
19405 self
19406 }
19407 }
19408
19409 #[doc(hidden)]
19410 impl crate::RequestBuilder for TestIamPermissions {
19411 fn request_options(&mut self) -> &mut crate::RequestOptions {
19412 &mut self.0.options
19413 }
19414 }
19415
19416 #[derive(Clone, Debug)]
19437 pub struct ListOperations(
19438 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19439 );
19440
19441 impl ListOperations {
19442 pub(crate) fn new(
19443 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19444 ) -> Self {
19445 Self(RequestBuilder::new(stub))
19446 }
19447
19448 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19450 mut self,
19451 v: V,
19452 ) -> Self {
19453 self.0.request = v.into();
19454 self
19455 }
19456
19457 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19459 self.0.options = v.into();
19460 self
19461 }
19462
19463 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19465 (*self.0.stub)
19466 .list_operations(self.0.request, self.0.options)
19467 .await
19468 .map(crate::Response::into_body)
19469 }
19470
19471 pub fn by_page(
19473 self,
19474 ) -> impl google_cloud_gax::paginator::Paginator<
19475 google_cloud_longrunning::model::ListOperationsResponse,
19476 crate::Error,
19477 > {
19478 use std::clone::Clone;
19479 let token = self.0.request.page_token.clone();
19480 let execute = move |token: String| {
19481 let mut builder = self.clone();
19482 builder.0.request = builder.0.request.set_page_token(token);
19483 builder.send()
19484 };
19485 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19486 }
19487
19488 pub fn by_item(
19490 self,
19491 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19492 google_cloud_longrunning::model::ListOperationsResponse,
19493 crate::Error,
19494 > {
19495 use google_cloud_gax::paginator::Paginator;
19496 self.by_page().items()
19497 }
19498
19499 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19501 self.0.request.name = v.into();
19502 self
19503 }
19504
19505 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19507 self.0.request.filter = v.into();
19508 self
19509 }
19510
19511 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19513 self.0.request.page_size = v.into();
19514 self
19515 }
19516
19517 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19519 self.0.request.page_token = v.into();
19520 self
19521 }
19522
19523 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19525 self.0.request.return_partial_success = v.into();
19526 self
19527 }
19528 }
19529
19530 #[doc(hidden)]
19531 impl crate::RequestBuilder for ListOperations {
19532 fn request_options(&mut self) -> &mut crate::RequestOptions {
19533 &mut self.0.options
19534 }
19535 }
19536
19537 #[derive(Clone, Debug)]
19554 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19555
19556 impl GetOperation {
19557 pub(crate) fn new(
19558 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19559 ) -> Self {
19560 Self(RequestBuilder::new(stub))
19561 }
19562
19563 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19565 mut self,
19566 v: V,
19567 ) -> Self {
19568 self.0.request = v.into();
19569 self
19570 }
19571
19572 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19574 self.0.options = v.into();
19575 self
19576 }
19577
19578 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19580 (*self.0.stub)
19581 .get_operation(self.0.request, self.0.options)
19582 .await
19583 .map(crate::Response::into_body)
19584 }
19585
19586 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19588 self.0.request.name = v.into();
19589 self
19590 }
19591 }
19592
19593 #[doc(hidden)]
19594 impl crate::RequestBuilder for GetOperation {
19595 fn request_options(&mut self) -> &mut crate::RequestOptions {
19596 &mut self.0.options
19597 }
19598 }
19599
19600 #[derive(Clone, Debug)]
19617 pub struct DeleteOperation(
19618 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
19619 );
19620
19621 impl DeleteOperation {
19622 pub(crate) fn new(
19623 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19624 ) -> Self {
19625 Self(RequestBuilder::new(stub))
19626 }
19627
19628 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
19630 mut self,
19631 v: V,
19632 ) -> Self {
19633 self.0.request = v.into();
19634 self
19635 }
19636
19637 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19639 self.0.options = v.into();
19640 self
19641 }
19642
19643 pub async fn send(self) -> Result<()> {
19645 (*self.0.stub)
19646 .delete_operation(self.0.request, self.0.options)
19647 .await
19648 .map(crate::Response::into_body)
19649 }
19650
19651 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19653 self.0.request.name = v.into();
19654 self
19655 }
19656 }
19657
19658 #[doc(hidden)]
19659 impl crate::RequestBuilder for DeleteOperation {
19660 fn request_options(&mut self) -> &mut crate::RequestOptions {
19661 &mut self.0.options
19662 }
19663 }
19664
19665 #[derive(Clone, Debug)]
19682 pub struct CancelOperation(
19683 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19684 );
19685
19686 impl CancelOperation {
19687 pub(crate) fn new(
19688 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19689 ) -> Self {
19690 Self(RequestBuilder::new(stub))
19691 }
19692
19693 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19695 mut self,
19696 v: V,
19697 ) -> Self {
19698 self.0.request = v.into();
19699 self
19700 }
19701
19702 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19704 self.0.options = v.into();
19705 self
19706 }
19707
19708 pub async fn send(self) -> Result<()> {
19710 (*self.0.stub)
19711 .cancel_operation(self.0.request, self.0.options)
19712 .await
19713 .map(crate::Response::into_body)
19714 }
19715
19716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19718 self.0.request.name = v.into();
19719 self
19720 }
19721 }
19722
19723 #[doc(hidden)]
19724 impl crate::RequestBuilder for CancelOperation {
19725 fn request_options(&mut self) -> &mut crate::RequestOptions {
19726 &mut self.0.options
19727 }
19728 }
19729}
19730
19731pub mod organization_security_profile_group_service {
19733 use crate::Result;
19734
19735 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19749
19750 pub(crate) mod client {
19751 use super::super::super::client::OrganizationSecurityProfileGroupService;
19752 pub struct Factory;
19753 impl crate::ClientFactory for Factory {
19754 type Client = OrganizationSecurityProfileGroupService;
19755 type Credentials = gaxi::options::Credentials;
19756 async fn build(
19757 self,
19758 config: gaxi::options::ClientConfig,
19759 ) -> crate::ClientBuilderResult<Self::Client> {
19760 Self::Client::new(config).await
19761 }
19762 }
19763 }
19764
19765 #[derive(Clone, Debug)]
19767 pub(crate) struct RequestBuilder<R: std::default::Default> {
19768 stub: std::sync::Arc<
19769 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19770 >,
19771 request: R,
19772 options: crate::RequestOptions,
19773 }
19774
19775 impl<R> RequestBuilder<R>
19776 where
19777 R: std::default::Default,
19778 {
19779 pub(crate) fn new(
19780 stub: std::sync::Arc<
19781 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19782 >,
19783 ) -> Self {
19784 Self {
19785 stub,
19786 request: R::default(),
19787 options: crate::RequestOptions::default(),
19788 }
19789 }
19790 }
19791
19792 #[derive(Clone, Debug)]
19813 pub struct ListSecurityProfileGroups(
19814 RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
19815 );
19816
19817 impl ListSecurityProfileGroups {
19818 pub(crate) fn new(
19819 stub: std::sync::Arc<
19820 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19821 >,
19822 ) -> Self {
19823 Self(RequestBuilder::new(stub))
19824 }
19825
19826 pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
19828 mut self,
19829 v: V,
19830 ) -> Self {
19831 self.0.request = v.into();
19832 self
19833 }
19834
19835 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19837 self.0.options = v.into();
19838 self
19839 }
19840
19841 pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
19843 (*self.0.stub)
19844 .list_security_profile_groups(self.0.request, self.0.options)
19845 .await
19846 .map(crate::Response::into_body)
19847 }
19848
19849 pub fn by_page(
19851 self,
19852 ) -> impl google_cloud_gax::paginator::Paginator<
19853 crate::model::ListSecurityProfileGroupsResponse,
19854 crate::Error,
19855 > {
19856 use std::clone::Clone;
19857 let token = self.0.request.page_token.clone();
19858 let execute = move |token: String| {
19859 let mut builder = self.clone();
19860 builder.0.request = builder.0.request.set_page_token(token);
19861 builder.send()
19862 };
19863 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19864 }
19865
19866 pub fn by_item(
19868 self,
19869 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19870 crate::model::ListSecurityProfileGroupsResponse,
19871 crate::Error,
19872 > {
19873 use google_cloud_gax::paginator::Paginator;
19874 self.by_page().items()
19875 }
19876
19877 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19881 self.0.request.parent = v.into();
19882 self
19883 }
19884
19885 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19887 self.0.request.page_size = v.into();
19888 self
19889 }
19890
19891 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19893 self.0.request.page_token = v.into();
19894 self
19895 }
19896 }
19897
19898 #[doc(hidden)]
19899 impl crate::RequestBuilder for ListSecurityProfileGroups {
19900 fn request_options(&mut self) -> &mut crate::RequestOptions {
19901 &mut self.0.options
19902 }
19903 }
19904
19905 #[derive(Clone, Debug)]
19922 pub struct GetSecurityProfileGroup(
19923 RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
19924 );
19925
19926 impl GetSecurityProfileGroup {
19927 pub(crate) fn new(
19928 stub: std::sync::Arc<
19929 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19930 >,
19931 ) -> Self {
19932 Self(RequestBuilder::new(stub))
19933 }
19934
19935 pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
19937 mut self,
19938 v: V,
19939 ) -> Self {
19940 self.0.request = v.into();
19941 self
19942 }
19943
19944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19946 self.0.options = v.into();
19947 self
19948 }
19949
19950 pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
19952 (*self.0.stub)
19953 .get_security_profile_group(self.0.request, self.0.options)
19954 .await
19955 .map(crate::Response::into_body)
19956 }
19957
19958 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19962 self.0.request.name = v.into();
19963 self
19964 }
19965 }
19966
19967 #[doc(hidden)]
19968 impl crate::RequestBuilder for GetSecurityProfileGroup {
19969 fn request_options(&mut self) -> &mut crate::RequestOptions {
19970 &mut self.0.options
19971 }
19972 }
19973
19974 #[derive(Clone, Debug)]
19992 pub struct CreateSecurityProfileGroup(
19993 RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
19994 );
19995
19996 impl CreateSecurityProfileGroup {
19997 pub(crate) fn new(
19998 stub: std::sync::Arc<
19999 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20000 >,
20001 ) -> Self {
20002 Self(RequestBuilder::new(stub))
20003 }
20004
20005 pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
20007 mut self,
20008 v: V,
20009 ) -> Self {
20010 self.0.request = v.into();
20011 self
20012 }
20013
20014 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20016 self.0.options = v.into();
20017 self
20018 }
20019
20020 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20027 (*self.0.stub)
20028 .create_security_profile_group(self.0.request, self.0.options)
20029 .await
20030 .map(crate::Response::into_body)
20031 }
20032
20033 pub fn poller(
20035 self,
20036 ) -> impl google_cloud_lro::Poller<
20037 crate::model::SecurityProfileGroup,
20038 crate::model::OperationMetadata,
20039 > {
20040 type Operation = google_cloud_lro::internal::Operation<
20041 crate::model::SecurityProfileGroup,
20042 crate::model::OperationMetadata,
20043 >;
20044 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20045 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20046
20047 let stub = self.0.stub.clone();
20048 let mut options = self.0.options.clone();
20049 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20050 let query = move |name| {
20051 let stub = stub.clone();
20052 let options = options.clone();
20053 async {
20054 let op = GetOperation::new(stub)
20055 .set_name(name)
20056 .with_options(options)
20057 .send()
20058 .await?;
20059 Ok(Operation::new(op))
20060 }
20061 };
20062
20063 let start = move || async {
20064 let op = self.send().await?;
20065 Ok(Operation::new(op))
20066 };
20067
20068 google_cloud_lro::internal::new_poller(
20069 polling_error_policy,
20070 polling_backoff_policy,
20071 start,
20072 query,
20073 )
20074 }
20075
20076 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20080 self.0.request.parent = v.into();
20081 self
20082 }
20083
20084 pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20088 self.0.request.security_profile_group_id = v.into();
20089 self
20090 }
20091
20092 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20096 where
20097 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20098 {
20099 self.0.request.security_profile_group = std::option::Option::Some(v.into());
20100 self
20101 }
20102
20103 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20107 where
20108 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20109 {
20110 self.0.request.security_profile_group = v.map(|x| x.into());
20111 self
20112 }
20113 }
20114
20115 #[doc(hidden)]
20116 impl crate::RequestBuilder for CreateSecurityProfileGroup {
20117 fn request_options(&mut self) -> &mut crate::RequestOptions {
20118 &mut self.0.options
20119 }
20120 }
20121
20122 #[derive(Clone, Debug)]
20140 pub struct UpdateSecurityProfileGroup(
20141 RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
20142 );
20143
20144 impl UpdateSecurityProfileGroup {
20145 pub(crate) fn new(
20146 stub: std::sync::Arc<
20147 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20148 >,
20149 ) -> Self {
20150 Self(RequestBuilder::new(stub))
20151 }
20152
20153 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
20155 mut self,
20156 v: V,
20157 ) -> Self {
20158 self.0.request = v.into();
20159 self
20160 }
20161
20162 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20164 self.0.options = v.into();
20165 self
20166 }
20167
20168 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20175 (*self.0.stub)
20176 .update_security_profile_group(self.0.request, self.0.options)
20177 .await
20178 .map(crate::Response::into_body)
20179 }
20180
20181 pub fn poller(
20183 self,
20184 ) -> impl google_cloud_lro::Poller<
20185 crate::model::SecurityProfileGroup,
20186 crate::model::OperationMetadata,
20187 > {
20188 type Operation = google_cloud_lro::internal::Operation<
20189 crate::model::SecurityProfileGroup,
20190 crate::model::OperationMetadata,
20191 >;
20192 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20193 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20194
20195 let stub = self.0.stub.clone();
20196 let mut options = self.0.options.clone();
20197 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20198 let query = move |name| {
20199 let stub = stub.clone();
20200 let options = options.clone();
20201 async {
20202 let op = GetOperation::new(stub)
20203 .set_name(name)
20204 .with_options(options)
20205 .send()
20206 .await?;
20207 Ok(Operation::new(op))
20208 }
20209 };
20210
20211 let start = move || async {
20212 let op = self.send().await?;
20213 Ok(Operation::new(op))
20214 };
20215
20216 google_cloud_lro::internal::new_poller(
20217 polling_error_policy,
20218 polling_backoff_policy,
20219 start,
20220 query,
20221 )
20222 }
20223
20224 pub fn set_update_mask<T>(mut self, v: T) -> Self
20228 where
20229 T: std::convert::Into<wkt::FieldMask>,
20230 {
20231 self.0.request.update_mask = std::option::Option::Some(v.into());
20232 self
20233 }
20234
20235 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20239 where
20240 T: std::convert::Into<wkt::FieldMask>,
20241 {
20242 self.0.request.update_mask = v.map(|x| x.into());
20243 self
20244 }
20245
20246 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20250 where
20251 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20252 {
20253 self.0.request.security_profile_group = std::option::Option::Some(v.into());
20254 self
20255 }
20256
20257 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20261 where
20262 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20263 {
20264 self.0.request.security_profile_group = v.map(|x| x.into());
20265 self
20266 }
20267 }
20268
20269 #[doc(hidden)]
20270 impl crate::RequestBuilder for UpdateSecurityProfileGroup {
20271 fn request_options(&mut self) -> &mut crate::RequestOptions {
20272 &mut self.0.options
20273 }
20274 }
20275
20276 #[derive(Clone, Debug)]
20294 pub struct DeleteSecurityProfileGroup(
20295 RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
20296 );
20297
20298 impl DeleteSecurityProfileGroup {
20299 pub(crate) fn new(
20300 stub: std::sync::Arc<
20301 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20302 >,
20303 ) -> Self {
20304 Self(RequestBuilder::new(stub))
20305 }
20306
20307 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
20309 mut self,
20310 v: V,
20311 ) -> Self {
20312 self.0.request = v.into();
20313 self
20314 }
20315
20316 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20318 self.0.options = v.into();
20319 self
20320 }
20321
20322 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20329 (*self.0.stub)
20330 .delete_security_profile_group(self.0.request, self.0.options)
20331 .await
20332 .map(crate::Response::into_body)
20333 }
20334
20335 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20337 type Operation =
20338 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20339 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20340 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20341
20342 let stub = self.0.stub.clone();
20343 let mut options = self.0.options.clone();
20344 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20345 let query = move |name| {
20346 let stub = stub.clone();
20347 let options = options.clone();
20348 async {
20349 let op = GetOperation::new(stub)
20350 .set_name(name)
20351 .with_options(options)
20352 .send()
20353 .await?;
20354 Ok(Operation::new(op))
20355 }
20356 };
20357
20358 let start = move || async {
20359 let op = self.send().await?;
20360 Ok(Operation::new(op))
20361 };
20362
20363 google_cloud_lro::internal::new_unit_response_poller(
20364 polling_error_policy,
20365 polling_backoff_policy,
20366 start,
20367 query,
20368 )
20369 }
20370
20371 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20375 self.0.request.name = v.into();
20376 self
20377 }
20378
20379 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20381 self.0.request.etag = v.into();
20382 self
20383 }
20384 }
20385
20386 #[doc(hidden)]
20387 impl crate::RequestBuilder for DeleteSecurityProfileGroup {
20388 fn request_options(&mut self) -> &mut crate::RequestOptions {
20389 &mut self.0.options
20390 }
20391 }
20392
20393 #[derive(Clone, Debug)]
20414 pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
20415
20416 impl ListSecurityProfiles {
20417 pub(crate) fn new(
20418 stub: std::sync::Arc<
20419 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20420 >,
20421 ) -> Self {
20422 Self(RequestBuilder::new(stub))
20423 }
20424
20425 pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
20427 mut self,
20428 v: V,
20429 ) -> Self {
20430 self.0.request = v.into();
20431 self
20432 }
20433
20434 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20436 self.0.options = v.into();
20437 self
20438 }
20439
20440 pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
20442 (*self.0.stub)
20443 .list_security_profiles(self.0.request, self.0.options)
20444 .await
20445 .map(crate::Response::into_body)
20446 }
20447
20448 pub fn by_page(
20450 self,
20451 ) -> impl google_cloud_gax::paginator::Paginator<
20452 crate::model::ListSecurityProfilesResponse,
20453 crate::Error,
20454 > {
20455 use std::clone::Clone;
20456 let token = self.0.request.page_token.clone();
20457 let execute = move |token: String| {
20458 let mut builder = self.clone();
20459 builder.0.request = builder.0.request.set_page_token(token);
20460 builder.send()
20461 };
20462 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20463 }
20464
20465 pub fn by_item(
20467 self,
20468 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20469 crate::model::ListSecurityProfilesResponse,
20470 crate::Error,
20471 > {
20472 use google_cloud_gax::paginator::Paginator;
20473 self.by_page().items()
20474 }
20475
20476 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20480 self.0.request.parent = v.into();
20481 self
20482 }
20483
20484 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20486 self.0.request.page_size = v.into();
20487 self
20488 }
20489
20490 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20492 self.0.request.page_token = v.into();
20493 self
20494 }
20495 }
20496
20497 #[doc(hidden)]
20498 impl crate::RequestBuilder for ListSecurityProfiles {
20499 fn request_options(&mut self) -> &mut crate::RequestOptions {
20500 &mut self.0.options
20501 }
20502 }
20503
20504 #[derive(Clone, Debug)]
20521 pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
20522
20523 impl GetSecurityProfile {
20524 pub(crate) fn new(
20525 stub: std::sync::Arc<
20526 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20527 >,
20528 ) -> Self {
20529 Self(RequestBuilder::new(stub))
20530 }
20531
20532 pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
20534 mut self,
20535 v: V,
20536 ) -> Self {
20537 self.0.request = v.into();
20538 self
20539 }
20540
20541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20543 self.0.options = v.into();
20544 self
20545 }
20546
20547 pub async fn send(self) -> Result<crate::model::SecurityProfile> {
20549 (*self.0.stub)
20550 .get_security_profile(self.0.request, self.0.options)
20551 .await
20552 .map(crate::Response::into_body)
20553 }
20554
20555 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20559 self.0.request.name = v.into();
20560 self
20561 }
20562 }
20563
20564 #[doc(hidden)]
20565 impl crate::RequestBuilder for GetSecurityProfile {
20566 fn request_options(&mut self) -> &mut crate::RequestOptions {
20567 &mut self.0.options
20568 }
20569 }
20570
20571 #[derive(Clone, Debug)]
20589 pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
20590
20591 impl CreateSecurityProfile {
20592 pub(crate) fn new(
20593 stub: std::sync::Arc<
20594 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20595 >,
20596 ) -> Self {
20597 Self(RequestBuilder::new(stub))
20598 }
20599
20600 pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
20602 mut self,
20603 v: V,
20604 ) -> Self {
20605 self.0.request = v.into();
20606 self
20607 }
20608
20609 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20611 self.0.options = v.into();
20612 self
20613 }
20614
20615 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20622 (*self.0.stub)
20623 .create_security_profile(self.0.request, self.0.options)
20624 .await
20625 .map(crate::Response::into_body)
20626 }
20627
20628 pub fn poller(
20630 self,
20631 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
20632 {
20633 type Operation = google_cloud_lro::internal::Operation<
20634 crate::model::SecurityProfile,
20635 crate::model::OperationMetadata,
20636 >;
20637 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20638 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20639
20640 let stub = self.0.stub.clone();
20641 let mut options = self.0.options.clone();
20642 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20643 let query = move |name| {
20644 let stub = stub.clone();
20645 let options = options.clone();
20646 async {
20647 let op = GetOperation::new(stub)
20648 .set_name(name)
20649 .with_options(options)
20650 .send()
20651 .await?;
20652 Ok(Operation::new(op))
20653 }
20654 };
20655
20656 let start = move || async {
20657 let op = self.send().await?;
20658 Ok(Operation::new(op))
20659 };
20660
20661 google_cloud_lro::internal::new_poller(
20662 polling_error_policy,
20663 polling_backoff_policy,
20664 start,
20665 query,
20666 )
20667 }
20668
20669 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20673 self.0.request.parent = v.into();
20674 self
20675 }
20676
20677 pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20681 self.0.request.security_profile_id = v.into();
20682 self
20683 }
20684
20685 pub fn set_security_profile<T>(mut self, v: T) -> Self
20689 where
20690 T: std::convert::Into<crate::model::SecurityProfile>,
20691 {
20692 self.0.request.security_profile = std::option::Option::Some(v.into());
20693 self
20694 }
20695
20696 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
20700 where
20701 T: std::convert::Into<crate::model::SecurityProfile>,
20702 {
20703 self.0.request.security_profile = v.map(|x| x.into());
20704 self
20705 }
20706 }
20707
20708 #[doc(hidden)]
20709 impl crate::RequestBuilder for CreateSecurityProfile {
20710 fn request_options(&mut self) -> &mut crate::RequestOptions {
20711 &mut self.0.options
20712 }
20713 }
20714
20715 #[derive(Clone, Debug)]
20733 pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
20734
20735 impl UpdateSecurityProfile {
20736 pub(crate) fn new(
20737 stub: std::sync::Arc<
20738 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20739 >,
20740 ) -> Self {
20741 Self(RequestBuilder::new(stub))
20742 }
20743
20744 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
20746 mut self,
20747 v: V,
20748 ) -> Self {
20749 self.0.request = v.into();
20750 self
20751 }
20752
20753 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20755 self.0.options = v.into();
20756 self
20757 }
20758
20759 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20766 (*self.0.stub)
20767 .update_security_profile(self.0.request, self.0.options)
20768 .await
20769 .map(crate::Response::into_body)
20770 }
20771
20772 pub fn poller(
20774 self,
20775 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
20776 {
20777 type Operation = google_cloud_lro::internal::Operation<
20778 crate::model::SecurityProfile,
20779 crate::model::OperationMetadata,
20780 >;
20781 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20782 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20783
20784 let stub = self.0.stub.clone();
20785 let mut options = self.0.options.clone();
20786 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20787 let query = move |name| {
20788 let stub = stub.clone();
20789 let options = options.clone();
20790 async {
20791 let op = GetOperation::new(stub)
20792 .set_name(name)
20793 .with_options(options)
20794 .send()
20795 .await?;
20796 Ok(Operation::new(op))
20797 }
20798 };
20799
20800 let start = move || async {
20801 let op = self.send().await?;
20802 Ok(Operation::new(op))
20803 };
20804
20805 google_cloud_lro::internal::new_poller(
20806 polling_error_policy,
20807 polling_backoff_policy,
20808 start,
20809 query,
20810 )
20811 }
20812
20813 pub fn set_update_mask<T>(mut self, v: T) -> Self
20817 where
20818 T: std::convert::Into<wkt::FieldMask>,
20819 {
20820 self.0.request.update_mask = std::option::Option::Some(v.into());
20821 self
20822 }
20823
20824 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20828 where
20829 T: std::convert::Into<wkt::FieldMask>,
20830 {
20831 self.0.request.update_mask = v.map(|x| x.into());
20832 self
20833 }
20834
20835 pub fn set_security_profile<T>(mut self, v: T) -> Self
20839 where
20840 T: std::convert::Into<crate::model::SecurityProfile>,
20841 {
20842 self.0.request.security_profile = std::option::Option::Some(v.into());
20843 self
20844 }
20845
20846 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
20850 where
20851 T: std::convert::Into<crate::model::SecurityProfile>,
20852 {
20853 self.0.request.security_profile = v.map(|x| x.into());
20854 self
20855 }
20856 }
20857
20858 #[doc(hidden)]
20859 impl crate::RequestBuilder for UpdateSecurityProfile {
20860 fn request_options(&mut self) -> &mut crate::RequestOptions {
20861 &mut self.0.options
20862 }
20863 }
20864
20865 #[derive(Clone, Debug)]
20883 pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
20884
20885 impl DeleteSecurityProfile {
20886 pub(crate) fn new(
20887 stub: std::sync::Arc<
20888 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20889 >,
20890 ) -> Self {
20891 Self(RequestBuilder::new(stub))
20892 }
20893
20894 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
20896 mut self,
20897 v: V,
20898 ) -> Self {
20899 self.0.request = v.into();
20900 self
20901 }
20902
20903 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20905 self.0.options = v.into();
20906 self
20907 }
20908
20909 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20916 (*self.0.stub)
20917 .delete_security_profile(self.0.request, self.0.options)
20918 .await
20919 .map(crate::Response::into_body)
20920 }
20921
20922 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20924 type Operation =
20925 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20926 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20927 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20928
20929 let stub = self.0.stub.clone();
20930 let mut options = self.0.options.clone();
20931 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20932 let query = move |name| {
20933 let stub = stub.clone();
20934 let options = options.clone();
20935 async {
20936 let op = GetOperation::new(stub)
20937 .set_name(name)
20938 .with_options(options)
20939 .send()
20940 .await?;
20941 Ok(Operation::new(op))
20942 }
20943 };
20944
20945 let start = move || async {
20946 let op = self.send().await?;
20947 Ok(Operation::new(op))
20948 };
20949
20950 google_cloud_lro::internal::new_unit_response_poller(
20951 polling_error_policy,
20952 polling_backoff_policy,
20953 start,
20954 query,
20955 )
20956 }
20957
20958 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20962 self.0.request.name = v.into();
20963 self
20964 }
20965
20966 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20968 self.0.request.etag = v.into();
20969 self
20970 }
20971 }
20972
20973 #[doc(hidden)]
20974 impl crate::RequestBuilder for DeleteSecurityProfile {
20975 fn request_options(&mut self) -> &mut crate::RequestOptions {
20976 &mut self.0.options
20977 }
20978 }
20979
20980 #[derive(Clone, Debug)]
21001 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21002
21003 impl ListLocations {
21004 pub(crate) fn new(
21005 stub: std::sync::Arc<
21006 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21007 >,
21008 ) -> Self {
21009 Self(RequestBuilder::new(stub))
21010 }
21011
21012 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21014 mut self,
21015 v: V,
21016 ) -> Self {
21017 self.0.request = v.into();
21018 self
21019 }
21020
21021 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21023 self.0.options = v.into();
21024 self
21025 }
21026
21027 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21029 (*self.0.stub)
21030 .list_locations(self.0.request, self.0.options)
21031 .await
21032 .map(crate::Response::into_body)
21033 }
21034
21035 pub fn by_page(
21037 self,
21038 ) -> impl google_cloud_gax::paginator::Paginator<
21039 google_cloud_location::model::ListLocationsResponse,
21040 crate::Error,
21041 > {
21042 use std::clone::Clone;
21043 let token = self.0.request.page_token.clone();
21044 let execute = move |token: String| {
21045 let mut builder = self.clone();
21046 builder.0.request = builder.0.request.set_page_token(token);
21047 builder.send()
21048 };
21049 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21050 }
21051
21052 pub fn by_item(
21054 self,
21055 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21056 google_cloud_location::model::ListLocationsResponse,
21057 crate::Error,
21058 > {
21059 use google_cloud_gax::paginator::Paginator;
21060 self.by_page().items()
21061 }
21062
21063 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21065 self.0.request.name = v.into();
21066 self
21067 }
21068
21069 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21071 self.0.request.filter = v.into();
21072 self
21073 }
21074
21075 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21077 self.0.request.page_size = v.into();
21078 self
21079 }
21080
21081 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21083 self.0.request.page_token = v.into();
21084 self
21085 }
21086 }
21087
21088 #[doc(hidden)]
21089 impl crate::RequestBuilder for ListLocations {
21090 fn request_options(&mut self) -> &mut crate::RequestOptions {
21091 &mut self.0.options
21092 }
21093 }
21094
21095 #[derive(Clone, Debug)]
21112 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21113
21114 impl GetLocation {
21115 pub(crate) fn new(
21116 stub: std::sync::Arc<
21117 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21118 >,
21119 ) -> Self {
21120 Self(RequestBuilder::new(stub))
21121 }
21122
21123 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21125 mut self,
21126 v: V,
21127 ) -> Self {
21128 self.0.request = v.into();
21129 self
21130 }
21131
21132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21134 self.0.options = v.into();
21135 self
21136 }
21137
21138 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21140 (*self.0.stub)
21141 .get_location(self.0.request, self.0.options)
21142 .await
21143 .map(crate::Response::into_body)
21144 }
21145
21146 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21148 self.0.request.name = v.into();
21149 self
21150 }
21151 }
21152
21153 #[doc(hidden)]
21154 impl crate::RequestBuilder for GetLocation {
21155 fn request_options(&mut self) -> &mut crate::RequestOptions {
21156 &mut self.0.options
21157 }
21158 }
21159
21160 #[derive(Clone, Debug)]
21177 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
21178
21179 impl SetIamPolicy {
21180 pub(crate) fn new(
21181 stub: std::sync::Arc<
21182 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21183 >,
21184 ) -> Self {
21185 Self(RequestBuilder::new(stub))
21186 }
21187
21188 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
21190 mut self,
21191 v: V,
21192 ) -> Self {
21193 self.0.request = v.into();
21194 self
21195 }
21196
21197 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21199 self.0.options = v.into();
21200 self
21201 }
21202
21203 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21205 (*self.0.stub)
21206 .set_iam_policy(self.0.request, self.0.options)
21207 .await
21208 .map(crate::Response::into_body)
21209 }
21210
21211 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21215 self.0.request.resource = v.into();
21216 self
21217 }
21218
21219 pub fn set_policy<T>(mut self, v: T) -> Self
21223 where
21224 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21225 {
21226 self.0.request.policy = std::option::Option::Some(v.into());
21227 self
21228 }
21229
21230 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
21234 where
21235 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21236 {
21237 self.0.request.policy = v.map(|x| x.into());
21238 self
21239 }
21240
21241 pub fn set_update_mask<T>(mut self, v: T) -> Self
21243 where
21244 T: std::convert::Into<wkt::FieldMask>,
21245 {
21246 self.0.request.update_mask = std::option::Option::Some(v.into());
21247 self
21248 }
21249
21250 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21252 where
21253 T: std::convert::Into<wkt::FieldMask>,
21254 {
21255 self.0.request.update_mask = v.map(|x| x.into());
21256 self
21257 }
21258 }
21259
21260 #[doc(hidden)]
21261 impl crate::RequestBuilder for SetIamPolicy {
21262 fn request_options(&mut self) -> &mut crate::RequestOptions {
21263 &mut self.0.options
21264 }
21265 }
21266
21267 #[derive(Clone, Debug)]
21284 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
21285
21286 impl GetIamPolicy {
21287 pub(crate) fn new(
21288 stub: std::sync::Arc<
21289 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21290 >,
21291 ) -> Self {
21292 Self(RequestBuilder::new(stub))
21293 }
21294
21295 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
21297 mut self,
21298 v: V,
21299 ) -> Self {
21300 self.0.request = v.into();
21301 self
21302 }
21303
21304 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21306 self.0.options = v.into();
21307 self
21308 }
21309
21310 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21312 (*self.0.stub)
21313 .get_iam_policy(self.0.request, self.0.options)
21314 .await
21315 .map(crate::Response::into_body)
21316 }
21317
21318 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21322 self.0.request.resource = v.into();
21323 self
21324 }
21325
21326 pub fn set_options<T>(mut self, v: T) -> Self
21328 where
21329 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21330 {
21331 self.0.request.options = std::option::Option::Some(v.into());
21332 self
21333 }
21334
21335 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
21337 where
21338 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21339 {
21340 self.0.request.options = v.map(|x| x.into());
21341 self
21342 }
21343 }
21344
21345 #[doc(hidden)]
21346 impl crate::RequestBuilder for GetIamPolicy {
21347 fn request_options(&mut self) -> &mut crate::RequestOptions {
21348 &mut self.0.options
21349 }
21350 }
21351
21352 #[derive(Clone, Debug)]
21369 pub struct TestIamPermissions(
21370 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
21371 );
21372
21373 impl TestIamPermissions {
21374 pub(crate) fn new(
21375 stub: std::sync::Arc<
21376 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21377 >,
21378 ) -> Self {
21379 Self(RequestBuilder::new(stub))
21380 }
21381
21382 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
21384 mut self,
21385 v: V,
21386 ) -> Self {
21387 self.0.request = v.into();
21388 self
21389 }
21390
21391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21393 self.0.options = v.into();
21394 self
21395 }
21396
21397 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
21399 (*self.0.stub)
21400 .test_iam_permissions(self.0.request, self.0.options)
21401 .await
21402 .map(crate::Response::into_body)
21403 }
21404
21405 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21409 self.0.request.resource = v.into();
21410 self
21411 }
21412
21413 pub fn set_permissions<T, V>(mut self, v: T) -> Self
21417 where
21418 T: std::iter::IntoIterator<Item = V>,
21419 V: std::convert::Into<std::string::String>,
21420 {
21421 use std::iter::Iterator;
21422 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
21423 self
21424 }
21425 }
21426
21427 #[doc(hidden)]
21428 impl crate::RequestBuilder for TestIamPermissions {
21429 fn request_options(&mut self) -> &mut crate::RequestOptions {
21430 &mut self.0.options
21431 }
21432 }
21433
21434 #[derive(Clone, Debug)]
21455 pub struct ListOperations(
21456 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21457 );
21458
21459 impl ListOperations {
21460 pub(crate) fn new(
21461 stub: std::sync::Arc<
21462 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21463 >,
21464 ) -> Self {
21465 Self(RequestBuilder::new(stub))
21466 }
21467
21468 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21470 mut self,
21471 v: V,
21472 ) -> Self {
21473 self.0.request = v.into();
21474 self
21475 }
21476
21477 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21479 self.0.options = v.into();
21480 self
21481 }
21482
21483 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21485 (*self.0.stub)
21486 .list_operations(self.0.request, self.0.options)
21487 .await
21488 .map(crate::Response::into_body)
21489 }
21490
21491 pub fn by_page(
21493 self,
21494 ) -> impl google_cloud_gax::paginator::Paginator<
21495 google_cloud_longrunning::model::ListOperationsResponse,
21496 crate::Error,
21497 > {
21498 use std::clone::Clone;
21499 let token = self.0.request.page_token.clone();
21500 let execute = move |token: String| {
21501 let mut builder = self.clone();
21502 builder.0.request = builder.0.request.set_page_token(token);
21503 builder.send()
21504 };
21505 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21506 }
21507
21508 pub fn by_item(
21510 self,
21511 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21512 google_cloud_longrunning::model::ListOperationsResponse,
21513 crate::Error,
21514 > {
21515 use google_cloud_gax::paginator::Paginator;
21516 self.by_page().items()
21517 }
21518
21519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21521 self.0.request.name = v.into();
21522 self
21523 }
21524
21525 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21527 self.0.request.filter = v.into();
21528 self
21529 }
21530
21531 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21533 self.0.request.page_size = v.into();
21534 self
21535 }
21536
21537 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21539 self.0.request.page_token = v.into();
21540 self
21541 }
21542
21543 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21545 self.0.request.return_partial_success = v.into();
21546 self
21547 }
21548 }
21549
21550 #[doc(hidden)]
21551 impl crate::RequestBuilder for ListOperations {
21552 fn request_options(&mut self) -> &mut crate::RequestOptions {
21553 &mut self.0.options
21554 }
21555 }
21556
21557 #[derive(Clone, Debug)]
21574 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21575
21576 impl GetOperation {
21577 pub(crate) fn new(
21578 stub: std::sync::Arc<
21579 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21580 >,
21581 ) -> Self {
21582 Self(RequestBuilder::new(stub))
21583 }
21584
21585 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21587 mut self,
21588 v: V,
21589 ) -> Self {
21590 self.0.request = v.into();
21591 self
21592 }
21593
21594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21596 self.0.options = v.into();
21597 self
21598 }
21599
21600 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21602 (*self.0.stub)
21603 .get_operation(self.0.request, self.0.options)
21604 .await
21605 .map(crate::Response::into_body)
21606 }
21607
21608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21610 self.0.request.name = v.into();
21611 self
21612 }
21613 }
21614
21615 #[doc(hidden)]
21616 impl crate::RequestBuilder for GetOperation {
21617 fn request_options(&mut self) -> &mut crate::RequestOptions {
21618 &mut self.0.options
21619 }
21620 }
21621
21622 #[derive(Clone, Debug)]
21639 pub struct DeleteOperation(
21640 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
21641 );
21642
21643 impl DeleteOperation {
21644 pub(crate) fn new(
21645 stub: std::sync::Arc<
21646 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21647 >,
21648 ) -> Self {
21649 Self(RequestBuilder::new(stub))
21650 }
21651
21652 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
21654 mut self,
21655 v: V,
21656 ) -> Self {
21657 self.0.request = v.into();
21658 self
21659 }
21660
21661 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21663 self.0.options = v.into();
21664 self
21665 }
21666
21667 pub async fn send(self) -> Result<()> {
21669 (*self.0.stub)
21670 .delete_operation(self.0.request, self.0.options)
21671 .await
21672 .map(crate::Response::into_body)
21673 }
21674
21675 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21677 self.0.request.name = v.into();
21678 self
21679 }
21680 }
21681
21682 #[doc(hidden)]
21683 impl crate::RequestBuilder for DeleteOperation {
21684 fn request_options(&mut self) -> &mut crate::RequestOptions {
21685 &mut self.0.options
21686 }
21687 }
21688
21689 #[derive(Clone, Debug)]
21706 pub struct CancelOperation(
21707 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21708 );
21709
21710 impl CancelOperation {
21711 pub(crate) fn new(
21712 stub: std::sync::Arc<
21713 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21714 >,
21715 ) -> Self {
21716 Self(RequestBuilder::new(stub))
21717 }
21718
21719 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21721 mut self,
21722 v: V,
21723 ) -> Self {
21724 self.0.request = v.into();
21725 self
21726 }
21727
21728 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21730 self.0.options = v.into();
21731 self
21732 }
21733
21734 pub async fn send(self) -> Result<()> {
21736 (*self.0.stub)
21737 .cancel_operation(self.0.request, self.0.options)
21738 .await
21739 .map(crate::Response::into_body)
21740 }
21741
21742 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21744 self.0.request.name = v.into();
21745 self
21746 }
21747 }
21748
21749 #[doc(hidden)]
21750 impl crate::RequestBuilder for CancelOperation {
21751 fn request_options(&mut self) -> &mut crate::RequestOptions {
21752 &mut self.0.options
21753 }
21754 }
21755}