1pub mod address_group_service {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::AddressGroupService;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = AddressGroupService;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
95
96 impl ListAddressGroups {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
105 mut self,
106 v: V,
107 ) -> Self {
108 self.0.request = v.into();
109 self
110 }
111
112 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
114 self.0.options = v.into();
115 self
116 }
117
118 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
120 (*self.0.stub)
121 .list_address_groups(self.0.request, self.0.options)
122 .await
123 .map(crate::Response::into_body)
124 }
125
126 pub fn by_page(
128 self,
129 ) -> impl google_cloud_gax::paginator::Paginator<
130 crate::model::ListAddressGroupsResponse,
131 crate::Error,
132 > {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 google_cloud_gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl google_cloud_gax::paginator::ItemPaginator<
147 crate::model::ListAddressGroupsResponse,
148 crate::Error,
149 > {
150 use google_cloud_gax::paginator::Paginator;
151 self.by_page().items()
152 }
153
154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.parent = v.into();
159 self
160 }
161
162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164 self.0.request.page_size = v.into();
165 self
166 }
167
168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.page_token = v.into();
171 self
172 }
173
174 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
176 self.0.request.return_partial_success = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl crate::RequestBuilder for ListAddressGroups {
183 fn request_options(&mut self) -> &mut crate::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
206
207 impl GetAddressGroup {
208 pub(crate) fn new(
209 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
210 ) -> Self {
211 Self(RequestBuilder::new(stub))
212 }
213
214 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
216 self.0.request = v.into();
217 self
218 }
219
220 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
222 self.0.options = v.into();
223 self
224 }
225
226 pub async fn send(self) -> Result<crate::model::AddressGroup> {
228 (*self.0.stub)
229 .get_address_group(self.0.request, self.0.options)
230 .await
231 .map(crate::Response::into_body)
232 }
233
234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.name = v.into();
239 self
240 }
241 }
242
243 #[doc(hidden)]
244 impl crate::RequestBuilder for GetAddressGroup {
245 fn request_options(&mut self) -> &mut crate::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 #[derive(Clone, Debug)]
268 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
269
270 impl CreateAddressGroup {
271 pub(crate) fn new(
272 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
273 ) -> Self {
274 Self(RequestBuilder::new(stub))
275 }
276
277 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
279 mut self,
280 v: V,
281 ) -> Self {
282 self.0.request = v.into();
283 self
284 }
285
286 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
288 self.0.options = v.into();
289 self
290 }
291
292 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
299 (*self.0.stub)
300 .create_address_group(self.0.request, self.0.options)
301 .await
302 .map(crate::Response::into_body)
303 }
304
305 pub fn poller(
307 self,
308 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
309 {
310 type Operation = google_cloud_lro::internal::Operation<
311 crate::model::AddressGroup,
312 crate::model::OperationMetadata,
313 >;
314 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
315 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
316
317 let stub = self.0.stub.clone();
318 let mut options = self.0.options.clone();
319 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
320 let query = move |name| {
321 let stub = stub.clone();
322 let options = options.clone();
323 async {
324 let op = GetOperation::new(stub)
325 .set_name(name)
326 .with_options(options)
327 .send()
328 .await?;
329 Ok(Operation::new(op))
330 }
331 };
332
333 let start = move || async {
334 let op = self.send().await?;
335 Ok(Operation::new(op))
336 };
337
338 google_cloud_lro::internal::new_poller(
339 polling_error_policy,
340 polling_backoff_policy,
341 start,
342 query,
343 )
344 }
345
346 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
350 self.0.request.parent = v.into();
351 self
352 }
353
354 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
358 self.0.request.address_group_id = v.into();
359 self
360 }
361
362 pub fn set_address_group<T>(mut self, v: T) -> Self
366 where
367 T: std::convert::Into<crate::model::AddressGroup>,
368 {
369 self.0.request.address_group = std::option::Option::Some(v.into());
370 self
371 }
372
373 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
377 where
378 T: std::convert::Into<crate::model::AddressGroup>,
379 {
380 self.0.request.address_group = v.map(|x| x.into());
381 self
382 }
383
384 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
386 self.0.request.request_id = v.into();
387 self
388 }
389 }
390
391 #[doc(hidden)]
392 impl crate::RequestBuilder for CreateAddressGroup {
393 fn request_options(&mut self) -> &mut crate::RequestOptions {
394 &mut self.0.options
395 }
396 }
397
398 #[derive(Clone, Debug)]
416 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
417
418 impl UpdateAddressGroup {
419 pub(crate) fn new(
420 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
421 ) -> Self {
422 Self(RequestBuilder::new(stub))
423 }
424
425 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
427 mut self,
428 v: V,
429 ) -> Self {
430 self.0.request = v.into();
431 self
432 }
433
434 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
436 self.0.options = v.into();
437 self
438 }
439
440 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
447 (*self.0.stub)
448 .update_address_group(self.0.request, self.0.options)
449 .await
450 .map(crate::Response::into_body)
451 }
452
453 pub fn poller(
455 self,
456 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
457 {
458 type Operation = google_cloud_lro::internal::Operation<
459 crate::model::AddressGroup,
460 crate::model::OperationMetadata,
461 >;
462 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
463 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
464
465 let stub = self.0.stub.clone();
466 let mut options = self.0.options.clone();
467 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
468 let query = move |name| {
469 let stub = stub.clone();
470 let options = options.clone();
471 async {
472 let op = GetOperation::new(stub)
473 .set_name(name)
474 .with_options(options)
475 .send()
476 .await?;
477 Ok(Operation::new(op))
478 }
479 };
480
481 let start = move || async {
482 let op = self.send().await?;
483 Ok(Operation::new(op))
484 };
485
486 google_cloud_lro::internal::new_poller(
487 polling_error_policy,
488 polling_backoff_policy,
489 start,
490 query,
491 )
492 }
493
494 pub fn set_update_mask<T>(mut self, v: T) -> Self
496 where
497 T: std::convert::Into<wkt::FieldMask>,
498 {
499 self.0.request.update_mask = std::option::Option::Some(v.into());
500 self
501 }
502
503 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
505 where
506 T: std::convert::Into<wkt::FieldMask>,
507 {
508 self.0.request.update_mask = v.map(|x| x.into());
509 self
510 }
511
512 pub fn set_address_group<T>(mut self, v: T) -> Self
516 where
517 T: std::convert::Into<crate::model::AddressGroup>,
518 {
519 self.0.request.address_group = std::option::Option::Some(v.into());
520 self
521 }
522
523 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
527 where
528 T: std::convert::Into<crate::model::AddressGroup>,
529 {
530 self.0.request.address_group = v.map(|x| x.into());
531 self
532 }
533
534 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
536 self.0.request.request_id = v.into();
537 self
538 }
539 }
540
541 #[doc(hidden)]
542 impl crate::RequestBuilder for UpdateAddressGroup {
543 fn request_options(&mut self) -> &mut crate::RequestOptions {
544 &mut self.0.options
545 }
546 }
547
548 #[derive(Clone, Debug)]
566 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
567
568 impl AddAddressGroupItems {
569 pub(crate) fn new(
570 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
571 ) -> Self {
572 Self(RequestBuilder::new(stub))
573 }
574
575 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
577 mut self,
578 v: V,
579 ) -> Self {
580 self.0.request = v.into();
581 self
582 }
583
584 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
586 self.0.options = v.into();
587 self
588 }
589
590 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
597 (*self.0.stub)
598 .add_address_group_items(self.0.request, self.0.options)
599 .await
600 .map(crate::Response::into_body)
601 }
602
603 pub fn poller(
605 self,
606 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
607 {
608 type Operation = google_cloud_lro::internal::Operation<
609 crate::model::AddressGroup,
610 crate::model::OperationMetadata,
611 >;
612 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
613 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
614
615 let stub = self.0.stub.clone();
616 let mut options = self.0.options.clone();
617 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
618 let query = move |name| {
619 let stub = stub.clone();
620 let options = options.clone();
621 async {
622 let op = GetOperation::new(stub)
623 .set_name(name)
624 .with_options(options)
625 .send()
626 .await?;
627 Ok(Operation::new(op))
628 }
629 };
630
631 let start = move || async {
632 let op = self.send().await?;
633 Ok(Operation::new(op))
634 };
635
636 google_cloud_lro::internal::new_poller(
637 polling_error_policy,
638 polling_backoff_policy,
639 start,
640 query,
641 )
642 }
643
644 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
648 self.0.request.address_group = v.into();
649 self
650 }
651
652 pub fn set_items<T, V>(mut self, v: T) -> Self
656 where
657 T: std::iter::IntoIterator<Item = V>,
658 V: std::convert::Into<std::string::String>,
659 {
660 use std::iter::Iterator;
661 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
662 self
663 }
664
665 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
667 self.0.request.request_id = v.into();
668 self
669 }
670 }
671
672 #[doc(hidden)]
673 impl crate::RequestBuilder for AddAddressGroupItems {
674 fn request_options(&mut self) -> &mut crate::RequestOptions {
675 &mut self.0.options
676 }
677 }
678
679 #[derive(Clone, Debug)]
697 pub struct RemoveAddressGroupItems(
698 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
699 );
700
701 impl RemoveAddressGroupItems {
702 pub(crate) fn new(
703 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
704 ) -> Self {
705 Self(RequestBuilder::new(stub))
706 }
707
708 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
710 mut self,
711 v: V,
712 ) -> Self {
713 self.0.request = v.into();
714 self
715 }
716
717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
719 self.0.options = v.into();
720 self
721 }
722
723 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
730 (*self.0.stub)
731 .remove_address_group_items(self.0.request, self.0.options)
732 .await
733 .map(crate::Response::into_body)
734 }
735
736 pub fn poller(
738 self,
739 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
740 {
741 type Operation = google_cloud_lro::internal::Operation<
742 crate::model::AddressGroup,
743 crate::model::OperationMetadata,
744 >;
745 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
746 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
747
748 let stub = self.0.stub.clone();
749 let mut options = self.0.options.clone();
750 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
751 let query = move |name| {
752 let stub = stub.clone();
753 let options = options.clone();
754 async {
755 let op = GetOperation::new(stub)
756 .set_name(name)
757 .with_options(options)
758 .send()
759 .await?;
760 Ok(Operation::new(op))
761 }
762 };
763
764 let start = move || async {
765 let op = self.send().await?;
766 Ok(Operation::new(op))
767 };
768
769 google_cloud_lro::internal::new_poller(
770 polling_error_policy,
771 polling_backoff_policy,
772 start,
773 query,
774 )
775 }
776
777 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
781 self.0.request.address_group = v.into();
782 self
783 }
784
785 pub fn set_items<T, V>(mut self, v: T) -> Self
789 where
790 T: std::iter::IntoIterator<Item = V>,
791 V: std::convert::Into<std::string::String>,
792 {
793 use std::iter::Iterator;
794 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
795 self
796 }
797
798 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
800 self.0.request.request_id = v.into();
801 self
802 }
803 }
804
805 #[doc(hidden)]
806 impl crate::RequestBuilder for RemoveAddressGroupItems {
807 fn request_options(&mut self) -> &mut crate::RequestOptions {
808 &mut self.0.options
809 }
810 }
811
812 #[derive(Clone, Debug)]
830 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
831
832 impl CloneAddressGroupItems {
833 pub(crate) fn new(
834 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
835 ) -> Self {
836 Self(RequestBuilder::new(stub))
837 }
838
839 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
841 mut self,
842 v: V,
843 ) -> Self {
844 self.0.request = v.into();
845 self
846 }
847
848 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
850 self.0.options = v.into();
851 self
852 }
853
854 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
861 (*self.0.stub)
862 .clone_address_group_items(self.0.request, self.0.options)
863 .await
864 .map(crate::Response::into_body)
865 }
866
867 pub fn poller(
869 self,
870 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
871 {
872 type Operation = google_cloud_lro::internal::Operation<
873 crate::model::AddressGroup,
874 crate::model::OperationMetadata,
875 >;
876 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
877 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
878
879 let stub = self.0.stub.clone();
880 let mut options = self.0.options.clone();
881 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
882 let query = move |name| {
883 let stub = stub.clone();
884 let options = options.clone();
885 async {
886 let op = GetOperation::new(stub)
887 .set_name(name)
888 .with_options(options)
889 .send()
890 .await?;
891 Ok(Operation::new(op))
892 }
893 };
894
895 let start = move || async {
896 let op = self.send().await?;
897 Ok(Operation::new(op))
898 };
899
900 google_cloud_lro::internal::new_poller(
901 polling_error_policy,
902 polling_backoff_policy,
903 start,
904 query,
905 )
906 }
907
908 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
912 self.0.request.address_group = v.into();
913 self
914 }
915
916 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
920 self.0.request.source_address_group = v.into();
921 self
922 }
923
924 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
926 self.0.request.request_id = v.into();
927 self
928 }
929 }
930
931 #[doc(hidden)]
932 impl crate::RequestBuilder for CloneAddressGroupItems {
933 fn request_options(&mut self) -> &mut crate::RequestOptions {
934 &mut self.0.options
935 }
936 }
937
938 #[derive(Clone, Debug)]
956 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
957
958 impl DeleteAddressGroup {
959 pub(crate) fn new(
960 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
961 ) -> Self {
962 Self(RequestBuilder::new(stub))
963 }
964
965 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
967 mut self,
968 v: V,
969 ) -> Self {
970 self.0.request = v.into();
971 self
972 }
973
974 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
976 self.0.options = v.into();
977 self
978 }
979
980 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
987 (*self.0.stub)
988 .delete_address_group(self.0.request, self.0.options)
989 .await
990 .map(crate::Response::into_body)
991 }
992
993 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
995 type Operation =
996 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
997 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
998 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
999
1000 let stub = self.0.stub.clone();
1001 let mut options = self.0.options.clone();
1002 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1003 let query = move |name| {
1004 let stub = stub.clone();
1005 let options = options.clone();
1006 async {
1007 let op = GetOperation::new(stub)
1008 .set_name(name)
1009 .with_options(options)
1010 .send()
1011 .await?;
1012 Ok(Operation::new(op))
1013 }
1014 };
1015
1016 let start = move || async {
1017 let op = self.send().await?;
1018 Ok(Operation::new(op))
1019 };
1020
1021 google_cloud_lro::internal::new_unit_response_poller(
1022 polling_error_policy,
1023 polling_backoff_policy,
1024 start,
1025 query,
1026 )
1027 }
1028
1029 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1033 self.0.request.name = v.into();
1034 self
1035 }
1036
1037 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1039 self.0.request.request_id = v.into();
1040 self
1041 }
1042 }
1043
1044 #[doc(hidden)]
1045 impl crate::RequestBuilder for DeleteAddressGroup {
1046 fn request_options(&mut self) -> &mut crate::RequestOptions {
1047 &mut self.0.options
1048 }
1049 }
1050
1051 #[derive(Clone, Debug)]
1072 pub struct ListAddressGroupReferences(
1073 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1074 );
1075
1076 impl ListAddressGroupReferences {
1077 pub(crate) fn new(
1078 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1079 ) -> Self {
1080 Self(RequestBuilder::new(stub))
1081 }
1082
1083 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1085 mut self,
1086 v: V,
1087 ) -> Self {
1088 self.0.request = v.into();
1089 self
1090 }
1091
1092 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1094 self.0.options = v.into();
1095 self
1096 }
1097
1098 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1100 (*self.0.stub)
1101 .list_address_group_references(self.0.request, self.0.options)
1102 .await
1103 .map(crate::Response::into_body)
1104 }
1105
1106 pub fn by_page(
1108 self,
1109 ) -> impl google_cloud_gax::paginator::Paginator<
1110 crate::model::ListAddressGroupReferencesResponse,
1111 crate::Error,
1112 > {
1113 use std::clone::Clone;
1114 let token = self.0.request.page_token.clone();
1115 let execute = move |token: String| {
1116 let mut builder = self.clone();
1117 builder.0.request = builder.0.request.set_page_token(token);
1118 builder.send()
1119 };
1120 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1121 }
1122
1123 pub fn by_item(
1125 self,
1126 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1127 crate::model::ListAddressGroupReferencesResponse,
1128 crate::Error,
1129 > {
1130 use google_cloud_gax::paginator::Paginator;
1131 self.by_page().items()
1132 }
1133
1134 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1138 self.0.request.address_group = v.into();
1139 self
1140 }
1141
1142 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1144 self.0.request.page_size = v.into();
1145 self
1146 }
1147
1148 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1150 self.0.request.page_token = v.into();
1151 self
1152 }
1153 }
1154
1155 #[doc(hidden)]
1156 impl crate::RequestBuilder for ListAddressGroupReferences {
1157 fn request_options(&mut self) -> &mut crate::RequestOptions {
1158 &mut self.0.options
1159 }
1160 }
1161
1162 #[derive(Clone, Debug)]
1183 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1184
1185 impl ListLocations {
1186 pub(crate) fn new(
1187 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1188 ) -> Self {
1189 Self(RequestBuilder::new(stub))
1190 }
1191
1192 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1194 mut self,
1195 v: V,
1196 ) -> Self {
1197 self.0.request = v.into();
1198 self
1199 }
1200
1201 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1203 self.0.options = v.into();
1204 self
1205 }
1206
1207 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1209 (*self.0.stub)
1210 .list_locations(self.0.request, self.0.options)
1211 .await
1212 .map(crate::Response::into_body)
1213 }
1214
1215 pub fn by_page(
1217 self,
1218 ) -> impl google_cloud_gax::paginator::Paginator<
1219 google_cloud_location::model::ListLocationsResponse,
1220 crate::Error,
1221 > {
1222 use std::clone::Clone;
1223 let token = self.0.request.page_token.clone();
1224 let execute = move |token: String| {
1225 let mut builder = self.clone();
1226 builder.0.request = builder.0.request.set_page_token(token);
1227 builder.send()
1228 };
1229 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1230 }
1231
1232 pub fn by_item(
1234 self,
1235 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1236 google_cloud_location::model::ListLocationsResponse,
1237 crate::Error,
1238 > {
1239 use google_cloud_gax::paginator::Paginator;
1240 self.by_page().items()
1241 }
1242
1243 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1245 self.0.request.name = v.into();
1246 self
1247 }
1248
1249 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251 self.0.request.filter = v.into();
1252 self
1253 }
1254
1255 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1257 self.0.request.page_size = v.into();
1258 self
1259 }
1260
1261 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1263 self.0.request.page_token = v.into();
1264 self
1265 }
1266 }
1267
1268 #[doc(hidden)]
1269 impl crate::RequestBuilder for ListLocations {
1270 fn request_options(&mut self) -> &mut crate::RequestOptions {
1271 &mut self.0.options
1272 }
1273 }
1274
1275 #[derive(Clone, Debug)]
1292 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1293
1294 impl GetLocation {
1295 pub(crate) fn new(
1296 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1297 ) -> Self {
1298 Self(RequestBuilder::new(stub))
1299 }
1300
1301 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1303 mut self,
1304 v: V,
1305 ) -> Self {
1306 self.0.request = v.into();
1307 self
1308 }
1309
1310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1312 self.0.options = v.into();
1313 self
1314 }
1315
1316 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1318 (*self.0.stub)
1319 .get_location(self.0.request, self.0.options)
1320 .await
1321 .map(crate::Response::into_body)
1322 }
1323
1324 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1326 self.0.request.name = v.into();
1327 self
1328 }
1329 }
1330
1331 #[doc(hidden)]
1332 impl crate::RequestBuilder for GetLocation {
1333 fn request_options(&mut self) -> &mut crate::RequestOptions {
1334 &mut self.0.options
1335 }
1336 }
1337
1338 #[derive(Clone, Debug)]
1355 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1356
1357 impl SetIamPolicy {
1358 pub(crate) fn new(
1359 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1360 ) -> Self {
1361 Self(RequestBuilder::new(stub))
1362 }
1363
1364 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1366 mut self,
1367 v: V,
1368 ) -> Self {
1369 self.0.request = v.into();
1370 self
1371 }
1372
1373 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1375 self.0.options = v.into();
1376 self
1377 }
1378
1379 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1381 (*self.0.stub)
1382 .set_iam_policy(self.0.request, self.0.options)
1383 .await
1384 .map(crate::Response::into_body)
1385 }
1386
1387 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1391 self.0.request.resource = v.into();
1392 self
1393 }
1394
1395 pub fn set_policy<T>(mut self, v: T) -> Self
1399 where
1400 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1401 {
1402 self.0.request.policy = std::option::Option::Some(v.into());
1403 self
1404 }
1405
1406 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1410 where
1411 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1412 {
1413 self.0.request.policy = v.map(|x| x.into());
1414 self
1415 }
1416
1417 pub fn set_update_mask<T>(mut self, v: T) -> Self
1419 where
1420 T: std::convert::Into<wkt::FieldMask>,
1421 {
1422 self.0.request.update_mask = std::option::Option::Some(v.into());
1423 self
1424 }
1425
1426 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1428 where
1429 T: std::convert::Into<wkt::FieldMask>,
1430 {
1431 self.0.request.update_mask = v.map(|x| x.into());
1432 self
1433 }
1434 }
1435
1436 #[doc(hidden)]
1437 impl crate::RequestBuilder for SetIamPolicy {
1438 fn request_options(&mut self) -> &mut crate::RequestOptions {
1439 &mut self.0.options
1440 }
1441 }
1442
1443 #[derive(Clone, Debug)]
1460 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1461
1462 impl GetIamPolicy {
1463 pub(crate) fn new(
1464 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1465 ) -> Self {
1466 Self(RequestBuilder::new(stub))
1467 }
1468
1469 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1471 mut self,
1472 v: V,
1473 ) -> Self {
1474 self.0.request = v.into();
1475 self
1476 }
1477
1478 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1480 self.0.options = v.into();
1481 self
1482 }
1483
1484 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1486 (*self.0.stub)
1487 .get_iam_policy(self.0.request, self.0.options)
1488 .await
1489 .map(crate::Response::into_body)
1490 }
1491
1492 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496 self.0.request.resource = v.into();
1497 self
1498 }
1499
1500 pub fn set_options<T>(mut self, v: T) -> Self
1502 where
1503 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1504 {
1505 self.0.request.options = std::option::Option::Some(v.into());
1506 self
1507 }
1508
1509 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1511 where
1512 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1513 {
1514 self.0.request.options = v.map(|x| x.into());
1515 self
1516 }
1517 }
1518
1519 #[doc(hidden)]
1520 impl crate::RequestBuilder for GetIamPolicy {
1521 fn request_options(&mut self) -> &mut crate::RequestOptions {
1522 &mut self.0.options
1523 }
1524 }
1525
1526 #[derive(Clone, Debug)]
1543 pub struct TestIamPermissions(
1544 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1545 );
1546
1547 impl TestIamPermissions {
1548 pub(crate) fn new(
1549 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1550 ) -> Self {
1551 Self(RequestBuilder::new(stub))
1552 }
1553
1554 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1556 mut self,
1557 v: V,
1558 ) -> Self {
1559 self.0.request = v.into();
1560 self
1561 }
1562
1563 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1565 self.0.options = v.into();
1566 self
1567 }
1568
1569 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1571 (*self.0.stub)
1572 .test_iam_permissions(self.0.request, self.0.options)
1573 .await
1574 .map(crate::Response::into_body)
1575 }
1576
1577 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1581 self.0.request.resource = v.into();
1582 self
1583 }
1584
1585 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1589 where
1590 T: std::iter::IntoIterator<Item = V>,
1591 V: std::convert::Into<std::string::String>,
1592 {
1593 use std::iter::Iterator;
1594 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1595 self
1596 }
1597 }
1598
1599 #[doc(hidden)]
1600 impl crate::RequestBuilder for TestIamPermissions {
1601 fn request_options(&mut self) -> &mut crate::RequestOptions {
1602 &mut self.0.options
1603 }
1604 }
1605
1606 #[derive(Clone, Debug)]
1627 pub struct ListOperations(
1628 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1629 );
1630
1631 impl ListOperations {
1632 pub(crate) fn new(
1633 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1634 ) -> Self {
1635 Self(RequestBuilder::new(stub))
1636 }
1637
1638 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1640 mut self,
1641 v: V,
1642 ) -> Self {
1643 self.0.request = v.into();
1644 self
1645 }
1646
1647 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1649 self.0.options = v.into();
1650 self
1651 }
1652
1653 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1655 (*self.0.stub)
1656 .list_operations(self.0.request, self.0.options)
1657 .await
1658 .map(crate::Response::into_body)
1659 }
1660
1661 pub fn by_page(
1663 self,
1664 ) -> impl google_cloud_gax::paginator::Paginator<
1665 google_cloud_longrunning::model::ListOperationsResponse,
1666 crate::Error,
1667 > {
1668 use std::clone::Clone;
1669 let token = self.0.request.page_token.clone();
1670 let execute = move |token: String| {
1671 let mut builder = self.clone();
1672 builder.0.request = builder.0.request.set_page_token(token);
1673 builder.send()
1674 };
1675 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1676 }
1677
1678 pub fn by_item(
1680 self,
1681 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1682 google_cloud_longrunning::model::ListOperationsResponse,
1683 crate::Error,
1684 > {
1685 use google_cloud_gax::paginator::Paginator;
1686 self.by_page().items()
1687 }
1688
1689 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1691 self.0.request.name = v.into();
1692 self
1693 }
1694
1695 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1697 self.0.request.filter = v.into();
1698 self
1699 }
1700
1701 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1703 self.0.request.page_size = v.into();
1704 self
1705 }
1706
1707 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1709 self.0.request.page_token = v.into();
1710 self
1711 }
1712
1713 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1715 self.0.request.return_partial_success = v.into();
1716 self
1717 }
1718 }
1719
1720 #[doc(hidden)]
1721 impl crate::RequestBuilder for ListOperations {
1722 fn request_options(&mut self) -> &mut crate::RequestOptions {
1723 &mut self.0.options
1724 }
1725 }
1726
1727 #[derive(Clone, Debug)]
1744 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1745
1746 impl GetOperation {
1747 pub(crate) fn new(
1748 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1749 ) -> Self {
1750 Self(RequestBuilder::new(stub))
1751 }
1752
1753 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1755 mut self,
1756 v: V,
1757 ) -> Self {
1758 self.0.request = v.into();
1759 self
1760 }
1761
1762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1764 self.0.options = v.into();
1765 self
1766 }
1767
1768 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1770 (*self.0.stub)
1771 .get_operation(self.0.request, self.0.options)
1772 .await
1773 .map(crate::Response::into_body)
1774 }
1775
1776 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1778 self.0.request.name = v.into();
1779 self
1780 }
1781 }
1782
1783 #[doc(hidden)]
1784 impl crate::RequestBuilder for GetOperation {
1785 fn request_options(&mut self) -> &mut crate::RequestOptions {
1786 &mut self.0.options
1787 }
1788 }
1789
1790 #[derive(Clone, Debug)]
1807 pub struct DeleteOperation(
1808 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1809 );
1810
1811 impl DeleteOperation {
1812 pub(crate) fn new(
1813 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1814 ) -> Self {
1815 Self(RequestBuilder::new(stub))
1816 }
1817
1818 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1820 mut self,
1821 v: V,
1822 ) -> Self {
1823 self.0.request = v.into();
1824 self
1825 }
1826
1827 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1829 self.0.options = v.into();
1830 self
1831 }
1832
1833 pub async fn send(self) -> Result<()> {
1835 (*self.0.stub)
1836 .delete_operation(self.0.request, self.0.options)
1837 .await
1838 .map(crate::Response::into_body)
1839 }
1840
1841 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1843 self.0.request.name = v.into();
1844 self
1845 }
1846 }
1847
1848 #[doc(hidden)]
1849 impl crate::RequestBuilder for DeleteOperation {
1850 fn request_options(&mut self) -> &mut crate::RequestOptions {
1851 &mut self.0.options
1852 }
1853 }
1854
1855 #[derive(Clone, Debug)]
1872 pub struct CancelOperation(
1873 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1874 );
1875
1876 impl CancelOperation {
1877 pub(crate) fn new(
1878 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1879 ) -> Self {
1880 Self(RequestBuilder::new(stub))
1881 }
1882
1883 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1885 mut self,
1886 v: V,
1887 ) -> Self {
1888 self.0.request = v.into();
1889 self
1890 }
1891
1892 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1894 self.0.options = v.into();
1895 self
1896 }
1897
1898 pub async fn send(self) -> Result<()> {
1900 (*self.0.stub)
1901 .cancel_operation(self.0.request, self.0.options)
1902 .await
1903 .map(crate::Response::into_body)
1904 }
1905
1906 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1908 self.0.request.name = v.into();
1909 self
1910 }
1911 }
1912
1913 #[doc(hidden)]
1914 impl crate::RequestBuilder for CancelOperation {
1915 fn request_options(&mut self) -> &mut crate::RequestOptions {
1916 &mut self.0.options
1917 }
1918 }
1919}
1920
1921pub mod organization_address_group_service {
1922 use crate::Result;
1923
1924 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1938
1939 pub(crate) mod client {
1940 use super::super::super::client::OrganizationAddressGroupService;
1941 pub struct Factory;
1942 impl crate::ClientFactory for Factory {
1943 type Client = OrganizationAddressGroupService;
1944 type Credentials = gaxi::options::Credentials;
1945 async fn build(
1946 self,
1947 config: gaxi::options::ClientConfig,
1948 ) -> crate::ClientBuilderResult<Self::Client> {
1949 Self::Client::new(config).await
1950 }
1951 }
1952 }
1953
1954 #[derive(Clone, Debug)]
1956 pub(crate) struct RequestBuilder<R: std::default::Default> {
1957 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1958 request: R,
1959 options: crate::RequestOptions,
1960 }
1961
1962 impl<R> RequestBuilder<R>
1963 where
1964 R: std::default::Default,
1965 {
1966 pub(crate) fn new(
1967 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1968 ) -> Self {
1969 Self {
1970 stub,
1971 request: R::default(),
1972 options: crate::RequestOptions::default(),
1973 }
1974 }
1975 }
1976
1977 #[derive(Clone, Debug)]
1998 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
1999
2000 impl ListAddressGroups {
2001 pub(crate) fn new(
2002 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2003 ) -> Self {
2004 Self(RequestBuilder::new(stub))
2005 }
2006
2007 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
2009 mut self,
2010 v: V,
2011 ) -> Self {
2012 self.0.request = v.into();
2013 self
2014 }
2015
2016 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2018 self.0.options = v.into();
2019 self
2020 }
2021
2022 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
2024 (*self.0.stub)
2025 .list_address_groups(self.0.request, self.0.options)
2026 .await
2027 .map(crate::Response::into_body)
2028 }
2029
2030 pub fn by_page(
2032 self,
2033 ) -> impl google_cloud_gax::paginator::Paginator<
2034 crate::model::ListAddressGroupsResponse,
2035 crate::Error,
2036 > {
2037 use std::clone::Clone;
2038 let token = self.0.request.page_token.clone();
2039 let execute = move |token: String| {
2040 let mut builder = self.clone();
2041 builder.0.request = builder.0.request.set_page_token(token);
2042 builder.send()
2043 };
2044 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2045 }
2046
2047 pub fn by_item(
2049 self,
2050 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2051 crate::model::ListAddressGroupsResponse,
2052 crate::Error,
2053 > {
2054 use google_cloud_gax::paginator::Paginator;
2055 self.by_page().items()
2056 }
2057
2058 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2062 self.0.request.parent = v.into();
2063 self
2064 }
2065
2066 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2068 self.0.request.page_size = v.into();
2069 self
2070 }
2071
2072 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2074 self.0.request.page_token = v.into();
2075 self
2076 }
2077
2078 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2080 self.0.request.return_partial_success = v.into();
2081 self
2082 }
2083 }
2084
2085 #[doc(hidden)]
2086 impl crate::RequestBuilder for ListAddressGroups {
2087 fn request_options(&mut self) -> &mut crate::RequestOptions {
2088 &mut self.0.options
2089 }
2090 }
2091
2092 #[derive(Clone, Debug)]
2109 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2110
2111 impl GetAddressGroup {
2112 pub(crate) fn new(
2113 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2114 ) -> Self {
2115 Self(RequestBuilder::new(stub))
2116 }
2117
2118 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2120 self.0.request = v.into();
2121 self
2122 }
2123
2124 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2126 self.0.options = v.into();
2127 self
2128 }
2129
2130 pub async fn send(self) -> Result<crate::model::AddressGroup> {
2132 (*self.0.stub)
2133 .get_address_group(self.0.request, self.0.options)
2134 .await
2135 .map(crate::Response::into_body)
2136 }
2137
2138 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2142 self.0.request.name = v.into();
2143 self
2144 }
2145 }
2146
2147 #[doc(hidden)]
2148 impl crate::RequestBuilder for GetAddressGroup {
2149 fn request_options(&mut self) -> &mut crate::RequestOptions {
2150 &mut self.0.options
2151 }
2152 }
2153
2154 #[derive(Clone, Debug)]
2172 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2173
2174 impl CreateAddressGroup {
2175 pub(crate) fn new(
2176 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2177 ) -> Self {
2178 Self(RequestBuilder::new(stub))
2179 }
2180
2181 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2183 mut self,
2184 v: V,
2185 ) -> Self {
2186 self.0.request = v.into();
2187 self
2188 }
2189
2190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2192 self.0.options = v.into();
2193 self
2194 }
2195
2196 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2203 (*self.0.stub)
2204 .create_address_group(self.0.request, self.0.options)
2205 .await
2206 .map(crate::Response::into_body)
2207 }
2208
2209 pub fn poller(
2211 self,
2212 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2213 {
2214 type Operation = google_cloud_lro::internal::Operation<
2215 crate::model::AddressGroup,
2216 crate::model::OperationMetadata,
2217 >;
2218 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2219 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2220
2221 let stub = self.0.stub.clone();
2222 let mut options = self.0.options.clone();
2223 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2224 let query = move |name| {
2225 let stub = stub.clone();
2226 let options = options.clone();
2227 async {
2228 let op = GetOperation::new(stub)
2229 .set_name(name)
2230 .with_options(options)
2231 .send()
2232 .await?;
2233 Ok(Operation::new(op))
2234 }
2235 };
2236
2237 let start = move || async {
2238 let op = self.send().await?;
2239 Ok(Operation::new(op))
2240 };
2241
2242 google_cloud_lro::internal::new_poller(
2243 polling_error_policy,
2244 polling_backoff_policy,
2245 start,
2246 query,
2247 )
2248 }
2249
2250 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2254 self.0.request.parent = v.into();
2255 self
2256 }
2257
2258 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2262 self.0.request.address_group_id = v.into();
2263 self
2264 }
2265
2266 pub fn set_address_group<T>(mut self, v: T) -> Self
2270 where
2271 T: std::convert::Into<crate::model::AddressGroup>,
2272 {
2273 self.0.request.address_group = std::option::Option::Some(v.into());
2274 self
2275 }
2276
2277 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2281 where
2282 T: std::convert::Into<crate::model::AddressGroup>,
2283 {
2284 self.0.request.address_group = v.map(|x| x.into());
2285 self
2286 }
2287
2288 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2290 self.0.request.request_id = v.into();
2291 self
2292 }
2293 }
2294
2295 #[doc(hidden)]
2296 impl crate::RequestBuilder for CreateAddressGroup {
2297 fn request_options(&mut self) -> &mut crate::RequestOptions {
2298 &mut self.0.options
2299 }
2300 }
2301
2302 #[derive(Clone, Debug)]
2320 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2321
2322 impl UpdateAddressGroup {
2323 pub(crate) fn new(
2324 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2325 ) -> Self {
2326 Self(RequestBuilder::new(stub))
2327 }
2328
2329 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2331 mut self,
2332 v: V,
2333 ) -> Self {
2334 self.0.request = v.into();
2335 self
2336 }
2337
2338 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2340 self.0.options = v.into();
2341 self
2342 }
2343
2344 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2351 (*self.0.stub)
2352 .update_address_group(self.0.request, self.0.options)
2353 .await
2354 .map(crate::Response::into_body)
2355 }
2356
2357 pub fn poller(
2359 self,
2360 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2361 {
2362 type Operation = google_cloud_lro::internal::Operation<
2363 crate::model::AddressGroup,
2364 crate::model::OperationMetadata,
2365 >;
2366 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2367 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2368
2369 let stub = self.0.stub.clone();
2370 let mut options = self.0.options.clone();
2371 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2372 let query = move |name| {
2373 let stub = stub.clone();
2374 let options = options.clone();
2375 async {
2376 let op = GetOperation::new(stub)
2377 .set_name(name)
2378 .with_options(options)
2379 .send()
2380 .await?;
2381 Ok(Operation::new(op))
2382 }
2383 };
2384
2385 let start = move || async {
2386 let op = self.send().await?;
2387 Ok(Operation::new(op))
2388 };
2389
2390 google_cloud_lro::internal::new_poller(
2391 polling_error_policy,
2392 polling_backoff_policy,
2393 start,
2394 query,
2395 )
2396 }
2397
2398 pub fn set_update_mask<T>(mut self, v: T) -> Self
2400 where
2401 T: std::convert::Into<wkt::FieldMask>,
2402 {
2403 self.0.request.update_mask = std::option::Option::Some(v.into());
2404 self
2405 }
2406
2407 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2409 where
2410 T: std::convert::Into<wkt::FieldMask>,
2411 {
2412 self.0.request.update_mask = v.map(|x| x.into());
2413 self
2414 }
2415
2416 pub fn set_address_group<T>(mut self, v: T) -> Self
2420 where
2421 T: std::convert::Into<crate::model::AddressGroup>,
2422 {
2423 self.0.request.address_group = std::option::Option::Some(v.into());
2424 self
2425 }
2426
2427 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2431 where
2432 T: std::convert::Into<crate::model::AddressGroup>,
2433 {
2434 self.0.request.address_group = v.map(|x| x.into());
2435 self
2436 }
2437
2438 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2440 self.0.request.request_id = v.into();
2441 self
2442 }
2443 }
2444
2445 #[doc(hidden)]
2446 impl crate::RequestBuilder for UpdateAddressGroup {
2447 fn request_options(&mut self) -> &mut crate::RequestOptions {
2448 &mut self.0.options
2449 }
2450 }
2451
2452 #[derive(Clone, Debug)]
2470 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2471
2472 impl AddAddressGroupItems {
2473 pub(crate) fn new(
2474 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2475 ) -> Self {
2476 Self(RequestBuilder::new(stub))
2477 }
2478
2479 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2481 mut self,
2482 v: V,
2483 ) -> Self {
2484 self.0.request = v.into();
2485 self
2486 }
2487
2488 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2490 self.0.options = v.into();
2491 self
2492 }
2493
2494 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2501 (*self.0.stub)
2502 .add_address_group_items(self.0.request, self.0.options)
2503 .await
2504 .map(crate::Response::into_body)
2505 }
2506
2507 pub fn poller(
2509 self,
2510 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2511 {
2512 type Operation = google_cloud_lro::internal::Operation<
2513 crate::model::AddressGroup,
2514 crate::model::OperationMetadata,
2515 >;
2516 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2517 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2518
2519 let stub = self.0.stub.clone();
2520 let mut options = self.0.options.clone();
2521 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2522 let query = move |name| {
2523 let stub = stub.clone();
2524 let options = options.clone();
2525 async {
2526 let op = GetOperation::new(stub)
2527 .set_name(name)
2528 .with_options(options)
2529 .send()
2530 .await?;
2531 Ok(Operation::new(op))
2532 }
2533 };
2534
2535 let start = move || async {
2536 let op = self.send().await?;
2537 Ok(Operation::new(op))
2538 };
2539
2540 google_cloud_lro::internal::new_poller(
2541 polling_error_policy,
2542 polling_backoff_policy,
2543 start,
2544 query,
2545 )
2546 }
2547
2548 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2552 self.0.request.address_group = v.into();
2553 self
2554 }
2555
2556 pub fn set_items<T, V>(mut self, v: T) -> Self
2560 where
2561 T: std::iter::IntoIterator<Item = V>,
2562 V: std::convert::Into<std::string::String>,
2563 {
2564 use std::iter::Iterator;
2565 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2566 self
2567 }
2568
2569 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2571 self.0.request.request_id = v.into();
2572 self
2573 }
2574 }
2575
2576 #[doc(hidden)]
2577 impl crate::RequestBuilder for AddAddressGroupItems {
2578 fn request_options(&mut self) -> &mut crate::RequestOptions {
2579 &mut self.0.options
2580 }
2581 }
2582
2583 #[derive(Clone, Debug)]
2601 pub struct RemoveAddressGroupItems(
2602 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2603 );
2604
2605 impl RemoveAddressGroupItems {
2606 pub(crate) fn new(
2607 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2608 ) -> Self {
2609 Self(RequestBuilder::new(stub))
2610 }
2611
2612 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2614 mut self,
2615 v: V,
2616 ) -> Self {
2617 self.0.request = v.into();
2618 self
2619 }
2620
2621 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2623 self.0.options = v.into();
2624 self
2625 }
2626
2627 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2634 (*self.0.stub)
2635 .remove_address_group_items(self.0.request, self.0.options)
2636 .await
2637 .map(crate::Response::into_body)
2638 }
2639
2640 pub fn poller(
2642 self,
2643 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2644 {
2645 type Operation = google_cloud_lro::internal::Operation<
2646 crate::model::AddressGroup,
2647 crate::model::OperationMetadata,
2648 >;
2649 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2650 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2651
2652 let stub = self.0.stub.clone();
2653 let mut options = self.0.options.clone();
2654 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2655 let query = move |name| {
2656 let stub = stub.clone();
2657 let options = options.clone();
2658 async {
2659 let op = GetOperation::new(stub)
2660 .set_name(name)
2661 .with_options(options)
2662 .send()
2663 .await?;
2664 Ok(Operation::new(op))
2665 }
2666 };
2667
2668 let start = move || async {
2669 let op = self.send().await?;
2670 Ok(Operation::new(op))
2671 };
2672
2673 google_cloud_lro::internal::new_poller(
2674 polling_error_policy,
2675 polling_backoff_policy,
2676 start,
2677 query,
2678 )
2679 }
2680
2681 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2685 self.0.request.address_group = v.into();
2686 self
2687 }
2688
2689 pub fn set_items<T, V>(mut self, v: T) -> Self
2693 where
2694 T: std::iter::IntoIterator<Item = V>,
2695 V: std::convert::Into<std::string::String>,
2696 {
2697 use std::iter::Iterator;
2698 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2699 self
2700 }
2701
2702 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2704 self.0.request.request_id = v.into();
2705 self
2706 }
2707 }
2708
2709 #[doc(hidden)]
2710 impl crate::RequestBuilder for RemoveAddressGroupItems {
2711 fn request_options(&mut self) -> &mut crate::RequestOptions {
2712 &mut self.0.options
2713 }
2714 }
2715
2716 #[derive(Clone, Debug)]
2734 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2735
2736 impl CloneAddressGroupItems {
2737 pub(crate) fn new(
2738 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2739 ) -> Self {
2740 Self(RequestBuilder::new(stub))
2741 }
2742
2743 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2745 mut self,
2746 v: V,
2747 ) -> Self {
2748 self.0.request = v.into();
2749 self
2750 }
2751
2752 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2754 self.0.options = v.into();
2755 self
2756 }
2757
2758 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2765 (*self.0.stub)
2766 .clone_address_group_items(self.0.request, self.0.options)
2767 .await
2768 .map(crate::Response::into_body)
2769 }
2770
2771 pub fn poller(
2773 self,
2774 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2775 {
2776 type Operation = google_cloud_lro::internal::Operation<
2777 crate::model::AddressGroup,
2778 crate::model::OperationMetadata,
2779 >;
2780 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2781 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2782
2783 let stub = self.0.stub.clone();
2784 let mut options = self.0.options.clone();
2785 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2786 let query = move |name| {
2787 let stub = stub.clone();
2788 let options = options.clone();
2789 async {
2790 let op = GetOperation::new(stub)
2791 .set_name(name)
2792 .with_options(options)
2793 .send()
2794 .await?;
2795 Ok(Operation::new(op))
2796 }
2797 };
2798
2799 let start = move || async {
2800 let op = self.send().await?;
2801 Ok(Operation::new(op))
2802 };
2803
2804 google_cloud_lro::internal::new_poller(
2805 polling_error_policy,
2806 polling_backoff_policy,
2807 start,
2808 query,
2809 )
2810 }
2811
2812 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2816 self.0.request.address_group = v.into();
2817 self
2818 }
2819
2820 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2824 self.0.request.source_address_group = v.into();
2825 self
2826 }
2827
2828 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2830 self.0.request.request_id = v.into();
2831 self
2832 }
2833 }
2834
2835 #[doc(hidden)]
2836 impl crate::RequestBuilder for CloneAddressGroupItems {
2837 fn request_options(&mut self) -> &mut crate::RequestOptions {
2838 &mut self.0.options
2839 }
2840 }
2841
2842 #[derive(Clone, Debug)]
2860 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2861
2862 impl DeleteAddressGroup {
2863 pub(crate) fn new(
2864 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2865 ) -> Self {
2866 Self(RequestBuilder::new(stub))
2867 }
2868
2869 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2871 mut self,
2872 v: V,
2873 ) -> Self {
2874 self.0.request = v.into();
2875 self
2876 }
2877
2878 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2880 self.0.options = v.into();
2881 self
2882 }
2883
2884 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2891 (*self.0.stub)
2892 .delete_address_group(self.0.request, self.0.options)
2893 .await
2894 .map(crate::Response::into_body)
2895 }
2896
2897 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2899 type Operation =
2900 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2901 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2902 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2903
2904 let stub = self.0.stub.clone();
2905 let mut options = self.0.options.clone();
2906 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2907 let query = move |name| {
2908 let stub = stub.clone();
2909 let options = options.clone();
2910 async {
2911 let op = GetOperation::new(stub)
2912 .set_name(name)
2913 .with_options(options)
2914 .send()
2915 .await?;
2916 Ok(Operation::new(op))
2917 }
2918 };
2919
2920 let start = move || async {
2921 let op = self.send().await?;
2922 Ok(Operation::new(op))
2923 };
2924
2925 google_cloud_lro::internal::new_unit_response_poller(
2926 polling_error_policy,
2927 polling_backoff_policy,
2928 start,
2929 query,
2930 )
2931 }
2932
2933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2937 self.0.request.name = v.into();
2938 self
2939 }
2940
2941 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2943 self.0.request.request_id = v.into();
2944 self
2945 }
2946 }
2947
2948 #[doc(hidden)]
2949 impl crate::RequestBuilder for DeleteAddressGroup {
2950 fn request_options(&mut self) -> &mut crate::RequestOptions {
2951 &mut self.0.options
2952 }
2953 }
2954
2955 #[derive(Clone, Debug)]
2976 pub struct ListAddressGroupReferences(
2977 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2978 );
2979
2980 impl ListAddressGroupReferences {
2981 pub(crate) fn new(
2982 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2983 ) -> Self {
2984 Self(RequestBuilder::new(stub))
2985 }
2986
2987 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2989 mut self,
2990 v: V,
2991 ) -> Self {
2992 self.0.request = v.into();
2993 self
2994 }
2995
2996 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2998 self.0.options = v.into();
2999 self
3000 }
3001
3002 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
3004 (*self.0.stub)
3005 .list_address_group_references(self.0.request, self.0.options)
3006 .await
3007 .map(crate::Response::into_body)
3008 }
3009
3010 pub fn by_page(
3012 self,
3013 ) -> impl google_cloud_gax::paginator::Paginator<
3014 crate::model::ListAddressGroupReferencesResponse,
3015 crate::Error,
3016 > {
3017 use std::clone::Clone;
3018 let token = self.0.request.page_token.clone();
3019 let execute = move |token: String| {
3020 let mut builder = self.clone();
3021 builder.0.request = builder.0.request.set_page_token(token);
3022 builder.send()
3023 };
3024 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3025 }
3026
3027 pub fn by_item(
3029 self,
3030 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3031 crate::model::ListAddressGroupReferencesResponse,
3032 crate::Error,
3033 > {
3034 use google_cloud_gax::paginator::Paginator;
3035 self.by_page().items()
3036 }
3037
3038 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
3042 self.0.request.address_group = v.into();
3043 self
3044 }
3045
3046 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3048 self.0.request.page_size = v.into();
3049 self
3050 }
3051
3052 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3054 self.0.request.page_token = v.into();
3055 self
3056 }
3057 }
3058
3059 #[doc(hidden)]
3060 impl crate::RequestBuilder for ListAddressGroupReferences {
3061 fn request_options(&mut self) -> &mut crate::RequestOptions {
3062 &mut self.0.options
3063 }
3064 }
3065
3066 #[derive(Clone, Debug)]
3087 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3088
3089 impl ListLocations {
3090 pub(crate) fn new(
3091 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3092 ) -> Self {
3093 Self(RequestBuilder::new(stub))
3094 }
3095
3096 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3098 mut self,
3099 v: V,
3100 ) -> Self {
3101 self.0.request = v.into();
3102 self
3103 }
3104
3105 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3107 self.0.options = v.into();
3108 self
3109 }
3110
3111 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3113 (*self.0.stub)
3114 .list_locations(self.0.request, self.0.options)
3115 .await
3116 .map(crate::Response::into_body)
3117 }
3118
3119 pub fn by_page(
3121 self,
3122 ) -> impl google_cloud_gax::paginator::Paginator<
3123 google_cloud_location::model::ListLocationsResponse,
3124 crate::Error,
3125 > {
3126 use std::clone::Clone;
3127 let token = self.0.request.page_token.clone();
3128 let execute = move |token: String| {
3129 let mut builder = self.clone();
3130 builder.0.request = builder.0.request.set_page_token(token);
3131 builder.send()
3132 };
3133 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3134 }
3135
3136 pub fn by_item(
3138 self,
3139 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3140 google_cloud_location::model::ListLocationsResponse,
3141 crate::Error,
3142 > {
3143 use google_cloud_gax::paginator::Paginator;
3144 self.by_page().items()
3145 }
3146
3147 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3149 self.0.request.name = v.into();
3150 self
3151 }
3152
3153 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3155 self.0.request.filter = v.into();
3156 self
3157 }
3158
3159 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3161 self.0.request.page_size = v.into();
3162 self
3163 }
3164
3165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3167 self.0.request.page_token = v.into();
3168 self
3169 }
3170 }
3171
3172 #[doc(hidden)]
3173 impl crate::RequestBuilder for ListLocations {
3174 fn request_options(&mut self) -> &mut crate::RequestOptions {
3175 &mut self.0.options
3176 }
3177 }
3178
3179 #[derive(Clone, Debug)]
3196 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3197
3198 impl GetLocation {
3199 pub(crate) fn new(
3200 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3201 ) -> Self {
3202 Self(RequestBuilder::new(stub))
3203 }
3204
3205 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3207 mut self,
3208 v: V,
3209 ) -> Self {
3210 self.0.request = v.into();
3211 self
3212 }
3213
3214 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3216 self.0.options = v.into();
3217 self
3218 }
3219
3220 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3222 (*self.0.stub)
3223 .get_location(self.0.request, self.0.options)
3224 .await
3225 .map(crate::Response::into_body)
3226 }
3227
3228 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3230 self.0.request.name = v.into();
3231 self
3232 }
3233 }
3234
3235 #[doc(hidden)]
3236 impl crate::RequestBuilder for GetLocation {
3237 fn request_options(&mut self) -> &mut crate::RequestOptions {
3238 &mut self.0.options
3239 }
3240 }
3241
3242 #[derive(Clone, Debug)]
3259 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3260
3261 impl SetIamPolicy {
3262 pub(crate) fn new(
3263 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3264 ) -> Self {
3265 Self(RequestBuilder::new(stub))
3266 }
3267
3268 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3270 mut self,
3271 v: V,
3272 ) -> Self {
3273 self.0.request = v.into();
3274 self
3275 }
3276
3277 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3279 self.0.options = v.into();
3280 self
3281 }
3282
3283 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3285 (*self.0.stub)
3286 .set_iam_policy(self.0.request, self.0.options)
3287 .await
3288 .map(crate::Response::into_body)
3289 }
3290
3291 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3295 self.0.request.resource = v.into();
3296 self
3297 }
3298
3299 pub fn set_policy<T>(mut self, v: T) -> Self
3303 where
3304 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3305 {
3306 self.0.request.policy = std::option::Option::Some(v.into());
3307 self
3308 }
3309
3310 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3314 where
3315 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3316 {
3317 self.0.request.policy = v.map(|x| x.into());
3318 self
3319 }
3320
3321 pub fn set_update_mask<T>(mut self, v: T) -> Self
3323 where
3324 T: std::convert::Into<wkt::FieldMask>,
3325 {
3326 self.0.request.update_mask = std::option::Option::Some(v.into());
3327 self
3328 }
3329
3330 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3332 where
3333 T: std::convert::Into<wkt::FieldMask>,
3334 {
3335 self.0.request.update_mask = v.map(|x| x.into());
3336 self
3337 }
3338 }
3339
3340 #[doc(hidden)]
3341 impl crate::RequestBuilder for SetIamPolicy {
3342 fn request_options(&mut self) -> &mut crate::RequestOptions {
3343 &mut self.0.options
3344 }
3345 }
3346
3347 #[derive(Clone, Debug)]
3364 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3365
3366 impl GetIamPolicy {
3367 pub(crate) fn new(
3368 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3369 ) -> Self {
3370 Self(RequestBuilder::new(stub))
3371 }
3372
3373 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3375 mut self,
3376 v: V,
3377 ) -> Self {
3378 self.0.request = v.into();
3379 self
3380 }
3381
3382 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3384 self.0.options = v.into();
3385 self
3386 }
3387
3388 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3390 (*self.0.stub)
3391 .get_iam_policy(self.0.request, self.0.options)
3392 .await
3393 .map(crate::Response::into_body)
3394 }
3395
3396 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3400 self.0.request.resource = v.into();
3401 self
3402 }
3403
3404 pub fn set_options<T>(mut self, v: T) -> Self
3406 where
3407 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3408 {
3409 self.0.request.options = std::option::Option::Some(v.into());
3410 self
3411 }
3412
3413 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3415 where
3416 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3417 {
3418 self.0.request.options = v.map(|x| x.into());
3419 self
3420 }
3421 }
3422
3423 #[doc(hidden)]
3424 impl crate::RequestBuilder for GetIamPolicy {
3425 fn request_options(&mut self) -> &mut crate::RequestOptions {
3426 &mut self.0.options
3427 }
3428 }
3429
3430 #[derive(Clone, Debug)]
3447 pub struct TestIamPermissions(
3448 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3449 );
3450
3451 impl TestIamPermissions {
3452 pub(crate) fn new(
3453 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3454 ) -> Self {
3455 Self(RequestBuilder::new(stub))
3456 }
3457
3458 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3460 mut self,
3461 v: V,
3462 ) -> Self {
3463 self.0.request = v.into();
3464 self
3465 }
3466
3467 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3469 self.0.options = v.into();
3470 self
3471 }
3472
3473 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3475 (*self.0.stub)
3476 .test_iam_permissions(self.0.request, self.0.options)
3477 .await
3478 .map(crate::Response::into_body)
3479 }
3480
3481 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3485 self.0.request.resource = v.into();
3486 self
3487 }
3488
3489 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3493 where
3494 T: std::iter::IntoIterator<Item = V>,
3495 V: std::convert::Into<std::string::String>,
3496 {
3497 use std::iter::Iterator;
3498 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3499 self
3500 }
3501 }
3502
3503 #[doc(hidden)]
3504 impl crate::RequestBuilder for TestIamPermissions {
3505 fn request_options(&mut self) -> &mut crate::RequestOptions {
3506 &mut self.0.options
3507 }
3508 }
3509
3510 #[derive(Clone, Debug)]
3531 pub struct ListOperations(
3532 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3533 );
3534
3535 impl ListOperations {
3536 pub(crate) fn new(
3537 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3538 ) -> Self {
3539 Self(RequestBuilder::new(stub))
3540 }
3541
3542 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3544 mut self,
3545 v: V,
3546 ) -> Self {
3547 self.0.request = v.into();
3548 self
3549 }
3550
3551 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3553 self.0.options = v.into();
3554 self
3555 }
3556
3557 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3559 (*self.0.stub)
3560 .list_operations(self.0.request, self.0.options)
3561 .await
3562 .map(crate::Response::into_body)
3563 }
3564
3565 pub fn by_page(
3567 self,
3568 ) -> impl google_cloud_gax::paginator::Paginator<
3569 google_cloud_longrunning::model::ListOperationsResponse,
3570 crate::Error,
3571 > {
3572 use std::clone::Clone;
3573 let token = self.0.request.page_token.clone();
3574 let execute = move |token: String| {
3575 let mut builder = self.clone();
3576 builder.0.request = builder.0.request.set_page_token(token);
3577 builder.send()
3578 };
3579 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3580 }
3581
3582 pub fn by_item(
3584 self,
3585 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3586 google_cloud_longrunning::model::ListOperationsResponse,
3587 crate::Error,
3588 > {
3589 use google_cloud_gax::paginator::Paginator;
3590 self.by_page().items()
3591 }
3592
3593 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3595 self.0.request.name = v.into();
3596 self
3597 }
3598
3599 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3601 self.0.request.filter = v.into();
3602 self
3603 }
3604
3605 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3607 self.0.request.page_size = v.into();
3608 self
3609 }
3610
3611 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3613 self.0.request.page_token = v.into();
3614 self
3615 }
3616
3617 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3619 self.0.request.return_partial_success = v.into();
3620 self
3621 }
3622 }
3623
3624 #[doc(hidden)]
3625 impl crate::RequestBuilder for ListOperations {
3626 fn request_options(&mut self) -> &mut crate::RequestOptions {
3627 &mut self.0.options
3628 }
3629 }
3630
3631 #[derive(Clone, Debug)]
3648 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3649
3650 impl GetOperation {
3651 pub(crate) fn new(
3652 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3653 ) -> Self {
3654 Self(RequestBuilder::new(stub))
3655 }
3656
3657 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3659 mut self,
3660 v: V,
3661 ) -> Self {
3662 self.0.request = v.into();
3663 self
3664 }
3665
3666 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3668 self.0.options = v.into();
3669 self
3670 }
3671
3672 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3674 (*self.0.stub)
3675 .get_operation(self.0.request, self.0.options)
3676 .await
3677 .map(crate::Response::into_body)
3678 }
3679
3680 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3682 self.0.request.name = v.into();
3683 self
3684 }
3685 }
3686
3687 #[doc(hidden)]
3688 impl crate::RequestBuilder for GetOperation {
3689 fn request_options(&mut self) -> &mut crate::RequestOptions {
3690 &mut self.0.options
3691 }
3692 }
3693
3694 #[derive(Clone, Debug)]
3711 pub struct DeleteOperation(
3712 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3713 );
3714
3715 impl DeleteOperation {
3716 pub(crate) fn new(
3717 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3718 ) -> Self {
3719 Self(RequestBuilder::new(stub))
3720 }
3721
3722 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3724 mut self,
3725 v: V,
3726 ) -> Self {
3727 self.0.request = v.into();
3728 self
3729 }
3730
3731 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3733 self.0.options = v.into();
3734 self
3735 }
3736
3737 pub async fn send(self) -> Result<()> {
3739 (*self.0.stub)
3740 .delete_operation(self.0.request, self.0.options)
3741 .await
3742 .map(crate::Response::into_body)
3743 }
3744
3745 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3747 self.0.request.name = v.into();
3748 self
3749 }
3750 }
3751
3752 #[doc(hidden)]
3753 impl crate::RequestBuilder for DeleteOperation {
3754 fn request_options(&mut self) -> &mut crate::RequestOptions {
3755 &mut self.0.options
3756 }
3757 }
3758
3759 #[derive(Clone, Debug)]
3776 pub struct CancelOperation(
3777 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3778 );
3779
3780 impl CancelOperation {
3781 pub(crate) fn new(
3782 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3783 ) -> Self {
3784 Self(RequestBuilder::new(stub))
3785 }
3786
3787 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3789 mut self,
3790 v: V,
3791 ) -> Self {
3792 self.0.request = v.into();
3793 self
3794 }
3795
3796 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3798 self.0.options = v.into();
3799 self
3800 }
3801
3802 pub async fn send(self) -> Result<()> {
3804 (*self.0.stub)
3805 .cancel_operation(self.0.request, self.0.options)
3806 .await
3807 .map(crate::Response::into_body)
3808 }
3809
3810 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3812 self.0.request.name = v.into();
3813 self
3814 }
3815 }
3816
3817 #[doc(hidden)]
3818 impl crate::RequestBuilder for CancelOperation {
3819 fn request_options(&mut self) -> &mut crate::RequestOptions {
3820 &mut self.0.options
3821 }
3822 }
3823}
3824
3825pub mod network_security {
3826 use crate::Result;
3827
3828 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3842
3843 pub(crate) mod client {
3844 use super::super::super::client::NetworkSecurity;
3845 pub struct Factory;
3846 impl crate::ClientFactory for Factory {
3847 type Client = NetworkSecurity;
3848 type Credentials = gaxi::options::Credentials;
3849 async fn build(
3850 self,
3851 config: gaxi::options::ClientConfig,
3852 ) -> crate::ClientBuilderResult<Self::Client> {
3853 Self::Client::new(config).await
3854 }
3855 }
3856 }
3857
3858 #[derive(Clone, Debug)]
3860 pub(crate) struct RequestBuilder<R: std::default::Default> {
3861 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3862 request: R,
3863 options: crate::RequestOptions,
3864 }
3865
3866 impl<R> RequestBuilder<R>
3867 where
3868 R: std::default::Default,
3869 {
3870 pub(crate) fn new(
3871 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3872 ) -> Self {
3873 Self {
3874 stub,
3875 request: R::default(),
3876 options: crate::RequestOptions::default(),
3877 }
3878 }
3879 }
3880
3881 #[derive(Clone, Debug)]
3902 pub struct ListAuthorizationPolicies(
3903 RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
3904 );
3905
3906 impl ListAuthorizationPolicies {
3907 pub(crate) fn new(
3908 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3909 ) -> Self {
3910 Self(RequestBuilder::new(stub))
3911 }
3912
3913 pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
3915 mut self,
3916 v: V,
3917 ) -> Self {
3918 self.0.request = v.into();
3919 self
3920 }
3921
3922 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3924 self.0.options = v.into();
3925 self
3926 }
3927
3928 pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
3930 (*self.0.stub)
3931 .list_authorization_policies(self.0.request, self.0.options)
3932 .await
3933 .map(crate::Response::into_body)
3934 }
3935
3936 pub fn by_page(
3938 self,
3939 ) -> impl google_cloud_gax::paginator::Paginator<
3940 crate::model::ListAuthorizationPoliciesResponse,
3941 crate::Error,
3942 > {
3943 use std::clone::Clone;
3944 let token = self.0.request.page_token.clone();
3945 let execute = move |token: String| {
3946 let mut builder = self.clone();
3947 builder.0.request = builder.0.request.set_page_token(token);
3948 builder.send()
3949 };
3950 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3951 }
3952
3953 pub fn by_item(
3955 self,
3956 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3957 crate::model::ListAuthorizationPoliciesResponse,
3958 crate::Error,
3959 > {
3960 use google_cloud_gax::paginator::Paginator;
3961 self.by_page().items()
3962 }
3963
3964 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3968 self.0.request.parent = v.into();
3969 self
3970 }
3971
3972 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3974 self.0.request.page_size = v.into();
3975 self
3976 }
3977
3978 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3980 self.0.request.page_token = v.into();
3981 self
3982 }
3983 }
3984
3985 #[doc(hidden)]
3986 impl crate::RequestBuilder for ListAuthorizationPolicies {
3987 fn request_options(&mut self) -> &mut crate::RequestOptions {
3988 &mut self.0.options
3989 }
3990 }
3991
3992 #[derive(Clone, Debug)]
4009 pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
4010
4011 impl GetAuthorizationPolicy {
4012 pub(crate) fn new(
4013 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4014 ) -> Self {
4015 Self(RequestBuilder::new(stub))
4016 }
4017
4018 pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
4020 mut self,
4021 v: V,
4022 ) -> Self {
4023 self.0.request = v.into();
4024 self
4025 }
4026
4027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4029 self.0.options = v.into();
4030 self
4031 }
4032
4033 pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
4035 (*self.0.stub)
4036 .get_authorization_policy(self.0.request, self.0.options)
4037 .await
4038 .map(crate::Response::into_body)
4039 }
4040
4041 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4045 self.0.request.name = v.into();
4046 self
4047 }
4048 }
4049
4050 #[doc(hidden)]
4051 impl crate::RequestBuilder for GetAuthorizationPolicy {
4052 fn request_options(&mut self) -> &mut crate::RequestOptions {
4053 &mut self.0.options
4054 }
4055 }
4056
4057 #[derive(Clone, Debug)]
4075 pub struct CreateAuthorizationPolicy(
4076 RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
4077 );
4078
4079 impl CreateAuthorizationPolicy {
4080 pub(crate) fn new(
4081 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4082 ) -> Self {
4083 Self(RequestBuilder::new(stub))
4084 }
4085
4086 pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
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<google_cloud_longrunning::model::Operation> {
4108 (*self.0.stub)
4109 .create_authorization_policy(self.0.request, self.0.options)
4110 .await
4111 .map(crate::Response::into_body)
4112 }
4113
4114 pub fn poller(
4116 self,
4117 ) -> impl google_cloud_lro::Poller<
4118 crate::model::AuthorizationPolicy,
4119 crate::model::OperationMetadata,
4120 > {
4121 type Operation = google_cloud_lro::internal::Operation<
4122 crate::model::AuthorizationPolicy,
4123 crate::model::OperationMetadata,
4124 >;
4125 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4126 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4127
4128 let stub = self.0.stub.clone();
4129 let mut options = self.0.options.clone();
4130 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4131 let query = move |name| {
4132 let stub = stub.clone();
4133 let options = options.clone();
4134 async {
4135 let op = GetOperation::new(stub)
4136 .set_name(name)
4137 .with_options(options)
4138 .send()
4139 .await?;
4140 Ok(Operation::new(op))
4141 }
4142 };
4143
4144 let start = move || async {
4145 let op = self.send().await?;
4146 Ok(Operation::new(op))
4147 };
4148
4149 google_cloud_lro::internal::new_poller(
4150 polling_error_policy,
4151 polling_backoff_policy,
4152 start,
4153 query,
4154 )
4155 }
4156
4157 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4161 self.0.request.parent = v.into();
4162 self
4163 }
4164
4165 pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4169 self.0.request.authorization_policy_id = v.into();
4170 self
4171 }
4172
4173 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
4177 where
4178 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4179 {
4180 self.0.request.authorization_policy = std::option::Option::Some(v.into());
4181 self
4182 }
4183
4184 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
4188 where
4189 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4190 {
4191 self.0.request.authorization_policy = v.map(|x| x.into());
4192 self
4193 }
4194 }
4195
4196 #[doc(hidden)]
4197 impl crate::RequestBuilder for CreateAuthorizationPolicy {
4198 fn request_options(&mut self) -> &mut crate::RequestOptions {
4199 &mut self.0.options
4200 }
4201 }
4202
4203 #[derive(Clone, Debug)]
4221 pub struct UpdateAuthorizationPolicy(
4222 RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
4223 );
4224
4225 impl UpdateAuthorizationPolicy {
4226 pub(crate) fn new(
4227 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4228 ) -> Self {
4229 Self(RequestBuilder::new(stub))
4230 }
4231
4232 pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
4234 mut self,
4235 v: V,
4236 ) -> Self {
4237 self.0.request = v.into();
4238 self
4239 }
4240
4241 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4243 self.0.options = v.into();
4244 self
4245 }
4246
4247 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4254 (*self.0.stub)
4255 .update_authorization_policy(self.0.request, self.0.options)
4256 .await
4257 .map(crate::Response::into_body)
4258 }
4259
4260 pub fn poller(
4262 self,
4263 ) -> impl google_cloud_lro::Poller<
4264 crate::model::AuthorizationPolicy,
4265 crate::model::OperationMetadata,
4266 > {
4267 type Operation = google_cloud_lro::internal::Operation<
4268 crate::model::AuthorizationPolicy,
4269 crate::model::OperationMetadata,
4270 >;
4271 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4272 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4273
4274 let stub = self.0.stub.clone();
4275 let mut options = self.0.options.clone();
4276 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4277 let query = move |name| {
4278 let stub = stub.clone();
4279 let options = options.clone();
4280 async {
4281 let op = GetOperation::new(stub)
4282 .set_name(name)
4283 .with_options(options)
4284 .send()
4285 .await?;
4286 Ok(Operation::new(op))
4287 }
4288 };
4289
4290 let start = move || async {
4291 let op = self.send().await?;
4292 Ok(Operation::new(op))
4293 };
4294
4295 google_cloud_lro::internal::new_poller(
4296 polling_error_policy,
4297 polling_backoff_policy,
4298 start,
4299 query,
4300 )
4301 }
4302
4303 pub fn set_update_mask<T>(mut self, v: T) -> Self
4305 where
4306 T: std::convert::Into<wkt::FieldMask>,
4307 {
4308 self.0.request.update_mask = std::option::Option::Some(v.into());
4309 self
4310 }
4311
4312 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4314 where
4315 T: std::convert::Into<wkt::FieldMask>,
4316 {
4317 self.0.request.update_mask = v.map(|x| x.into());
4318 self
4319 }
4320
4321 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
4325 where
4326 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4327 {
4328 self.0.request.authorization_policy = std::option::Option::Some(v.into());
4329 self
4330 }
4331
4332 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
4336 where
4337 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4338 {
4339 self.0.request.authorization_policy = v.map(|x| x.into());
4340 self
4341 }
4342 }
4343
4344 #[doc(hidden)]
4345 impl crate::RequestBuilder for UpdateAuthorizationPolicy {
4346 fn request_options(&mut self) -> &mut crate::RequestOptions {
4347 &mut self.0.options
4348 }
4349 }
4350
4351 #[derive(Clone, Debug)]
4369 pub struct DeleteAuthorizationPolicy(
4370 RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
4371 );
4372
4373 impl DeleteAuthorizationPolicy {
4374 pub(crate) fn new(
4375 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4376 ) -> Self {
4377 Self(RequestBuilder::new(stub))
4378 }
4379
4380 pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
4382 mut self,
4383 v: V,
4384 ) -> Self {
4385 self.0.request = v.into();
4386 self
4387 }
4388
4389 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4391 self.0.options = v.into();
4392 self
4393 }
4394
4395 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4402 (*self.0.stub)
4403 .delete_authorization_policy(self.0.request, self.0.options)
4404 .await
4405 .map(crate::Response::into_body)
4406 }
4407
4408 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4410 type Operation =
4411 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4412 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4413 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4414
4415 let stub = self.0.stub.clone();
4416 let mut options = self.0.options.clone();
4417 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4418 let query = move |name| {
4419 let stub = stub.clone();
4420 let options = options.clone();
4421 async {
4422 let op = GetOperation::new(stub)
4423 .set_name(name)
4424 .with_options(options)
4425 .send()
4426 .await?;
4427 Ok(Operation::new(op))
4428 }
4429 };
4430
4431 let start = move || async {
4432 let op = self.send().await?;
4433 Ok(Operation::new(op))
4434 };
4435
4436 google_cloud_lro::internal::new_unit_response_poller(
4437 polling_error_policy,
4438 polling_backoff_policy,
4439 start,
4440 query,
4441 )
4442 }
4443
4444 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4448 self.0.request.name = v.into();
4449 self
4450 }
4451 }
4452
4453 #[doc(hidden)]
4454 impl crate::RequestBuilder for DeleteAuthorizationPolicy {
4455 fn request_options(&mut self) -> &mut crate::RequestOptions {
4456 &mut self.0.options
4457 }
4458 }
4459
4460 #[derive(Clone, Debug)]
4481 pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
4482
4483 impl ListServerTlsPolicies {
4484 pub(crate) fn new(
4485 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4486 ) -> Self {
4487 Self(RequestBuilder::new(stub))
4488 }
4489
4490 pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
4492 mut self,
4493 v: V,
4494 ) -> Self {
4495 self.0.request = v.into();
4496 self
4497 }
4498
4499 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4501 self.0.options = v.into();
4502 self
4503 }
4504
4505 pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
4507 (*self.0.stub)
4508 .list_server_tls_policies(self.0.request, self.0.options)
4509 .await
4510 .map(crate::Response::into_body)
4511 }
4512
4513 pub fn by_page(
4515 self,
4516 ) -> impl google_cloud_gax::paginator::Paginator<
4517 crate::model::ListServerTlsPoliciesResponse,
4518 crate::Error,
4519 > {
4520 use std::clone::Clone;
4521 let token = self.0.request.page_token.clone();
4522 let execute = move |token: String| {
4523 let mut builder = self.clone();
4524 builder.0.request = builder.0.request.set_page_token(token);
4525 builder.send()
4526 };
4527 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4528 }
4529
4530 pub fn by_item(
4532 self,
4533 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4534 crate::model::ListServerTlsPoliciesResponse,
4535 crate::Error,
4536 > {
4537 use google_cloud_gax::paginator::Paginator;
4538 self.by_page().items()
4539 }
4540
4541 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4545 self.0.request.parent = v.into();
4546 self
4547 }
4548
4549 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4551 self.0.request.page_size = v.into();
4552 self
4553 }
4554
4555 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4557 self.0.request.page_token = v.into();
4558 self
4559 }
4560 }
4561
4562 #[doc(hidden)]
4563 impl crate::RequestBuilder for ListServerTlsPolicies {
4564 fn request_options(&mut self) -> &mut crate::RequestOptions {
4565 &mut self.0.options
4566 }
4567 }
4568
4569 #[derive(Clone, Debug)]
4586 pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
4587
4588 impl GetServerTlsPolicy {
4589 pub(crate) fn new(
4590 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4591 ) -> Self {
4592 Self(RequestBuilder::new(stub))
4593 }
4594
4595 pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
4597 mut self,
4598 v: V,
4599 ) -> Self {
4600 self.0.request = v.into();
4601 self
4602 }
4603
4604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4606 self.0.options = v.into();
4607 self
4608 }
4609
4610 pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
4612 (*self.0.stub)
4613 .get_server_tls_policy(self.0.request, self.0.options)
4614 .await
4615 .map(crate::Response::into_body)
4616 }
4617
4618 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4622 self.0.request.name = v.into();
4623 self
4624 }
4625 }
4626
4627 #[doc(hidden)]
4628 impl crate::RequestBuilder for GetServerTlsPolicy {
4629 fn request_options(&mut self) -> &mut crate::RequestOptions {
4630 &mut self.0.options
4631 }
4632 }
4633
4634 #[derive(Clone, Debug)]
4652 pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
4653
4654 impl CreateServerTlsPolicy {
4655 pub(crate) fn new(
4656 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4657 ) -> Self {
4658 Self(RequestBuilder::new(stub))
4659 }
4660
4661 pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
4663 mut self,
4664 v: V,
4665 ) -> Self {
4666 self.0.request = v.into();
4667 self
4668 }
4669
4670 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4672 self.0.options = v.into();
4673 self
4674 }
4675
4676 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4683 (*self.0.stub)
4684 .create_server_tls_policy(self.0.request, self.0.options)
4685 .await
4686 .map(crate::Response::into_body)
4687 }
4688
4689 pub fn poller(
4691 self,
4692 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
4693 {
4694 type Operation = google_cloud_lro::internal::Operation<
4695 crate::model::ServerTlsPolicy,
4696 crate::model::OperationMetadata,
4697 >;
4698 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4699 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4700
4701 let stub = self.0.stub.clone();
4702 let mut options = self.0.options.clone();
4703 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4704 let query = move |name| {
4705 let stub = stub.clone();
4706 let options = options.clone();
4707 async {
4708 let op = GetOperation::new(stub)
4709 .set_name(name)
4710 .with_options(options)
4711 .send()
4712 .await?;
4713 Ok(Operation::new(op))
4714 }
4715 };
4716
4717 let start = move || async {
4718 let op = self.send().await?;
4719 Ok(Operation::new(op))
4720 };
4721
4722 google_cloud_lro::internal::new_poller(
4723 polling_error_policy,
4724 polling_backoff_policy,
4725 start,
4726 query,
4727 )
4728 }
4729
4730 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4734 self.0.request.parent = v.into();
4735 self
4736 }
4737
4738 pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4742 self.0.request.server_tls_policy_id = v.into();
4743 self
4744 }
4745
4746 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
4750 where
4751 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4752 {
4753 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
4754 self
4755 }
4756
4757 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
4761 where
4762 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4763 {
4764 self.0.request.server_tls_policy = v.map(|x| x.into());
4765 self
4766 }
4767 }
4768
4769 #[doc(hidden)]
4770 impl crate::RequestBuilder for CreateServerTlsPolicy {
4771 fn request_options(&mut self) -> &mut crate::RequestOptions {
4772 &mut self.0.options
4773 }
4774 }
4775
4776 #[derive(Clone, Debug)]
4794 pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
4795
4796 impl UpdateServerTlsPolicy {
4797 pub(crate) fn new(
4798 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4799 ) -> Self {
4800 Self(RequestBuilder::new(stub))
4801 }
4802
4803 pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
4805 mut self,
4806 v: V,
4807 ) -> Self {
4808 self.0.request = v.into();
4809 self
4810 }
4811
4812 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4814 self.0.options = v.into();
4815 self
4816 }
4817
4818 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4825 (*self.0.stub)
4826 .update_server_tls_policy(self.0.request, self.0.options)
4827 .await
4828 .map(crate::Response::into_body)
4829 }
4830
4831 pub fn poller(
4833 self,
4834 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
4835 {
4836 type Operation = google_cloud_lro::internal::Operation<
4837 crate::model::ServerTlsPolicy,
4838 crate::model::OperationMetadata,
4839 >;
4840 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4841 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4842
4843 let stub = self.0.stub.clone();
4844 let mut options = self.0.options.clone();
4845 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4846 let query = move |name| {
4847 let stub = stub.clone();
4848 let options = options.clone();
4849 async {
4850 let op = GetOperation::new(stub)
4851 .set_name(name)
4852 .with_options(options)
4853 .send()
4854 .await?;
4855 Ok(Operation::new(op))
4856 }
4857 };
4858
4859 let start = move || async {
4860 let op = self.send().await?;
4861 Ok(Operation::new(op))
4862 };
4863
4864 google_cloud_lro::internal::new_poller(
4865 polling_error_policy,
4866 polling_backoff_policy,
4867 start,
4868 query,
4869 )
4870 }
4871
4872 pub fn set_update_mask<T>(mut self, v: T) -> Self
4874 where
4875 T: std::convert::Into<wkt::FieldMask>,
4876 {
4877 self.0.request.update_mask = std::option::Option::Some(v.into());
4878 self
4879 }
4880
4881 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4883 where
4884 T: std::convert::Into<wkt::FieldMask>,
4885 {
4886 self.0.request.update_mask = v.map(|x| x.into());
4887 self
4888 }
4889
4890 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
4894 where
4895 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4896 {
4897 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
4898 self
4899 }
4900
4901 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
4905 where
4906 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4907 {
4908 self.0.request.server_tls_policy = v.map(|x| x.into());
4909 self
4910 }
4911 }
4912
4913 #[doc(hidden)]
4914 impl crate::RequestBuilder for UpdateServerTlsPolicy {
4915 fn request_options(&mut self) -> &mut crate::RequestOptions {
4916 &mut self.0.options
4917 }
4918 }
4919
4920 #[derive(Clone, Debug)]
4938 pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
4939
4940 impl DeleteServerTlsPolicy {
4941 pub(crate) fn new(
4942 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4943 ) -> Self {
4944 Self(RequestBuilder::new(stub))
4945 }
4946
4947 pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
4949 mut self,
4950 v: V,
4951 ) -> Self {
4952 self.0.request = v.into();
4953 self
4954 }
4955
4956 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4958 self.0.options = v.into();
4959 self
4960 }
4961
4962 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4969 (*self.0.stub)
4970 .delete_server_tls_policy(self.0.request, self.0.options)
4971 .await
4972 .map(crate::Response::into_body)
4973 }
4974
4975 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4977 type Operation =
4978 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4979 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4980 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4981
4982 let stub = self.0.stub.clone();
4983 let mut options = self.0.options.clone();
4984 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4985 let query = move |name| {
4986 let stub = stub.clone();
4987 let options = options.clone();
4988 async {
4989 let op = GetOperation::new(stub)
4990 .set_name(name)
4991 .with_options(options)
4992 .send()
4993 .await?;
4994 Ok(Operation::new(op))
4995 }
4996 };
4997
4998 let start = move || async {
4999 let op = self.send().await?;
5000 Ok(Operation::new(op))
5001 };
5002
5003 google_cloud_lro::internal::new_unit_response_poller(
5004 polling_error_policy,
5005 polling_backoff_policy,
5006 start,
5007 query,
5008 )
5009 }
5010
5011 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5015 self.0.request.name = v.into();
5016 self
5017 }
5018 }
5019
5020 #[doc(hidden)]
5021 impl crate::RequestBuilder for DeleteServerTlsPolicy {
5022 fn request_options(&mut self) -> &mut crate::RequestOptions {
5023 &mut self.0.options
5024 }
5025 }
5026
5027 #[derive(Clone, Debug)]
5048 pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
5049
5050 impl ListClientTlsPolicies {
5051 pub(crate) fn new(
5052 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5053 ) -> Self {
5054 Self(RequestBuilder::new(stub))
5055 }
5056
5057 pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
5059 mut self,
5060 v: V,
5061 ) -> Self {
5062 self.0.request = v.into();
5063 self
5064 }
5065
5066 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5068 self.0.options = v.into();
5069 self
5070 }
5071
5072 pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
5074 (*self.0.stub)
5075 .list_client_tls_policies(self.0.request, self.0.options)
5076 .await
5077 .map(crate::Response::into_body)
5078 }
5079
5080 pub fn by_page(
5082 self,
5083 ) -> impl google_cloud_gax::paginator::Paginator<
5084 crate::model::ListClientTlsPoliciesResponse,
5085 crate::Error,
5086 > {
5087 use std::clone::Clone;
5088 let token = self.0.request.page_token.clone();
5089 let execute = move |token: String| {
5090 let mut builder = self.clone();
5091 builder.0.request = builder.0.request.set_page_token(token);
5092 builder.send()
5093 };
5094 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5095 }
5096
5097 pub fn by_item(
5099 self,
5100 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5101 crate::model::ListClientTlsPoliciesResponse,
5102 crate::Error,
5103 > {
5104 use google_cloud_gax::paginator::Paginator;
5105 self.by_page().items()
5106 }
5107
5108 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5112 self.0.request.parent = v.into();
5113 self
5114 }
5115
5116 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5118 self.0.request.page_size = v.into();
5119 self
5120 }
5121
5122 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5124 self.0.request.page_token = v.into();
5125 self
5126 }
5127 }
5128
5129 #[doc(hidden)]
5130 impl crate::RequestBuilder for ListClientTlsPolicies {
5131 fn request_options(&mut self) -> &mut crate::RequestOptions {
5132 &mut self.0.options
5133 }
5134 }
5135
5136 #[derive(Clone, Debug)]
5153 pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
5154
5155 impl GetClientTlsPolicy {
5156 pub(crate) fn new(
5157 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5158 ) -> Self {
5159 Self(RequestBuilder::new(stub))
5160 }
5161
5162 pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
5164 mut self,
5165 v: V,
5166 ) -> Self {
5167 self.0.request = v.into();
5168 self
5169 }
5170
5171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5173 self.0.options = v.into();
5174 self
5175 }
5176
5177 pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
5179 (*self.0.stub)
5180 .get_client_tls_policy(self.0.request, self.0.options)
5181 .await
5182 .map(crate::Response::into_body)
5183 }
5184
5185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5189 self.0.request.name = v.into();
5190 self
5191 }
5192 }
5193
5194 #[doc(hidden)]
5195 impl crate::RequestBuilder for GetClientTlsPolicy {
5196 fn request_options(&mut self) -> &mut crate::RequestOptions {
5197 &mut self.0.options
5198 }
5199 }
5200
5201 #[derive(Clone, Debug)]
5219 pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
5220
5221 impl CreateClientTlsPolicy {
5222 pub(crate) fn new(
5223 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5224 ) -> Self {
5225 Self(RequestBuilder::new(stub))
5226 }
5227
5228 pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
5230 mut self,
5231 v: V,
5232 ) -> Self {
5233 self.0.request = v.into();
5234 self
5235 }
5236
5237 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5239 self.0.options = v.into();
5240 self
5241 }
5242
5243 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5250 (*self.0.stub)
5251 .create_client_tls_policy(self.0.request, self.0.options)
5252 .await
5253 .map(crate::Response::into_body)
5254 }
5255
5256 pub fn poller(
5258 self,
5259 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
5260 {
5261 type Operation = google_cloud_lro::internal::Operation<
5262 crate::model::ClientTlsPolicy,
5263 crate::model::OperationMetadata,
5264 >;
5265 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5266 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5267
5268 let stub = self.0.stub.clone();
5269 let mut options = self.0.options.clone();
5270 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5271 let query = move |name| {
5272 let stub = stub.clone();
5273 let options = options.clone();
5274 async {
5275 let op = GetOperation::new(stub)
5276 .set_name(name)
5277 .with_options(options)
5278 .send()
5279 .await?;
5280 Ok(Operation::new(op))
5281 }
5282 };
5283
5284 let start = move || async {
5285 let op = self.send().await?;
5286 Ok(Operation::new(op))
5287 };
5288
5289 google_cloud_lro::internal::new_poller(
5290 polling_error_policy,
5291 polling_backoff_policy,
5292 start,
5293 query,
5294 )
5295 }
5296
5297 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5301 self.0.request.parent = v.into();
5302 self
5303 }
5304
5305 pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5309 self.0.request.client_tls_policy_id = v.into();
5310 self
5311 }
5312
5313 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
5317 where
5318 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5319 {
5320 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
5321 self
5322 }
5323
5324 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
5328 where
5329 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5330 {
5331 self.0.request.client_tls_policy = v.map(|x| x.into());
5332 self
5333 }
5334 }
5335
5336 #[doc(hidden)]
5337 impl crate::RequestBuilder for CreateClientTlsPolicy {
5338 fn request_options(&mut self) -> &mut crate::RequestOptions {
5339 &mut self.0.options
5340 }
5341 }
5342
5343 #[derive(Clone, Debug)]
5361 pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
5362
5363 impl UpdateClientTlsPolicy {
5364 pub(crate) fn new(
5365 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5366 ) -> Self {
5367 Self(RequestBuilder::new(stub))
5368 }
5369
5370 pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
5372 mut self,
5373 v: V,
5374 ) -> Self {
5375 self.0.request = v.into();
5376 self
5377 }
5378
5379 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5381 self.0.options = v.into();
5382 self
5383 }
5384
5385 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5392 (*self.0.stub)
5393 .update_client_tls_policy(self.0.request, self.0.options)
5394 .await
5395 .map(crate::Response::into_body)
5396 }
5397
5398 pub fn poller(
5400 self,
5401 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
5402 {
5403 type Operation = google_cloud_lro::internal::Operation<
5404 crate::model::ClientTlsPolicy,
5405 crate::model::OperationMetadata,
5406 >;
5407 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5408 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5409
5410 let stub = self.0.stub.clone();
5411 let mut options = self.0.options.clone();
5412 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5413 let query = move |name| {
5414 let stub = stub.clone();
5415 let options = options.clone();
5416 async {
5417 let op = GetOperation::new(stub)
5418 .set_name(name)
5419 .with_options(options)
5420 .send()
5421 .await?;
5422 Ok(Operation::new(op))
5423 }
5424 };
5425
5426 let start = move || async {
5427 let op = self.send().await?;
5428 Ok(Operation::new(op))
5429 };
5430
5431 google_cloud_lro::internal::new_poller(
5432 polling_error_policy,
5433 polling_backoff_policy,
5434 start,
5435 query,
5436 )
5437 }
5438
5439 pub fn set_update_mask<T>(mut self, v: T) -> Self
5441 where
5442 T: std::convert::Into<wkt::FieldMask>,
5443 {
5444 self.0.request.update_mask = std::option::Option::Some(v.into());
5445 self
5446 }
5447
5448 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5450 where
5451 T: std::convert::Into<wkt::FieldMask>,
5452 {
5453 self.0.request.update_mask = v.map(|x| x.into());
5454 self
5455 }
5456
5457 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
5461 where
5462 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5463 {
5464 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
5465 self
5466 }
5467
5468 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
5472 where
5473 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5474 {
5475 self.0.request.client_tls_policy = v.map(|x| x.into());
5476 self
5477 }
5478 }
5479
5480 #[doc(hidden)]
5481 impl crate::RequestBuilder for UpdateClientTlsPolicy {
5482 fn request_options(&mut self) -> &mut crate::RequestOptions {
5483 &mut self.0.options
5484 }
5485 }
5486
5487 #[derive(Clone, Debug)]
5505 pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
5506
5507 impl DeleteClientTlsPolicy {
5508 pub(crate) fn new(
5509 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5510 ) -> Self {
5511 Self(RequestBuilder::new(stub))
5512 }
5513
5514 pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
5516 mut self,
5517 v: V,
5518 ) -> Self {
5519 self.0.request = v.into();
5520 self
5521 }
5522
5523 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5525 self.0.options = v.into();
5526 self
5527 }
5528
5529 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5536 (*self.0.stub)
5537 .delete_client_tls_policy(self.0.request, self.0.options)
5538 .await
5539 .map(crate::Response::into_body)
5540 }
5541
5542 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5544 type Operation =
5545 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5546 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5547 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5548
5549 let stub = self.0.stub.clone();
5550 let mut options = self.0.options.clone();
5551 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5552 let query = move |name| {
5553 let stub = stub.clone();
5554 let options = options.clone();
5555 async {
5556 let op = GetOperation::new(stub)
5557 .set_name(name)
5558 .with_options(options)
5559 .send()
5560 .await?;
5561 Ok(Operation::new(op))
5562 }
5563 };
5564
5565 let start = move || async {
5566 let op = self.send().await?;
5567 Ok(Operation::new(op))
5568 };
5569
5570 google_cloud_lro::internal::new_unit_response_poller(
5571 polling_error_policy,
5572 polling_backoff_policy,
5573 start,
5574 query,
5575 )
5576 }
5577
5578 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5582 self.0.request.name = v.into();
5583 self
5584 }
5585 }
5586
5587 #[doc(hidden)]
5588 impl crate::RequestBuilder for DeleteClientTlsPolicy {
5589 fn request_options(&mut self) -> &mut crate::RequestOptions {
5590 &mut self.0.options
5591 }
5592 }
5593
5594 #[derive(Clone, Debug)]
5615 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5616
5617 impl ListLocations {
5618 pub(crate) fn new(
5619 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5620 ) -> Self {
5621 Self(RequestBuilder::new(stub))
5622 }
5623
5624 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5626 mut self,
5627 v: V,
5628 ) -> Self {
5629 self.0.request = v.into();
5630 self
5631 }
5632
5633 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5635 self.0.options = v.into();
5636 self
5637 }
5638
5639 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5641 (*self.0.stub)
5642 .list_locations(self.0.request, self.0.options)
5643 .await
5644 .map(crate::Response::into_body)
5645 }
5646
5647 pub fn by_page(
5649 self,
5650 ) -> impl google_cloud_gax::paginator::Paginator<
5651 google_cloud_location::model::ListLocationsResponse,
5652 crate::Error,
5653 > {
5654 use std::clone::Clone;
5655 let token = self.0.request.page_token.clone();
5656 let execute = move |token: String| {
5657 let mut builder = self.clone();
5658 builder.0.request = builder.0.request.set_page_token(token);
5659 builder.send()
5660 };
5661 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5662 }
5663
5664 pub fn by_item(
5666 self,
5667 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5668 google_cloud_location::model::ListLocationsResponse,
5669 crate::Error,
5670 > {
5671 use google_cloud_gax::paginator::Paginator;
5672 self.by_page().items()
5673 }
5674
5675 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5677 self.0.request.name = v.into();
5678 self
5679 }
5680
5681 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5683 self.0.request.filter = v.into();
5684 self
5685 }
5686
5687 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5689 self.0.request.page_size = v.into();
5690 self
5691 }
5692
5693 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5695 self.0.request.page_token = v.into();
5696 self
5697 }
5698 }
5699
5700 #[doc(hidden)]
5701 impl crate::RequestBuilder for ListLocations {
5702 fn request_options(&mut self) -> &mut crate::RequestOptions {
5703 &mut self.0.options
5704 }
5705 }
5706
5707 #[derive(Clone, Debug)]
5724 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5725
5726 impl GetLocation {
5727 pub(crate) fn new(
5728 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5729 ) -> Self {
5730 Self(RequestBuilder::new(stub))
5731 }
5732
5733 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5735 mut self,
5736 v: V,
5737 ) -> Self {
5738 self.0.request = v.into();
5739 self
5740 }
5741
5742 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5744 self.0.options = v.into();
5745 self
5746 }
5747
5748 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5750 (*self.0.stub)
5751 .get_location(self.0.request, self.0.options)
5752 .await
5753 .map(crate::Response::into_body)
5754 }
5755
5756 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5758 self.0.request.name = v.into();
5759 self
5760 }
5761 }
5762
5763 #[doc(hidden)]
5764 impl crate::RequestBuilder for GetLocation {
5765 fn request_options(&mut self) -> &mut crate::RequestOptions {
5766 &mut self.0.options
5767 }
5768 }
5769
5770 #[derive(Clone, Debug)]
5787 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
5788
5789 impl SetIamPolicy {
5790 pub(crate) fn new(
5791 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5792 ) -> Self {
5793 Self(RequestBuilder::new(stub))
5794 }
5795
5796 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
5798 mut self,
5799 v: V,
5800 ) -> Self {
5801 self.0.request = v.into();
5802 self
5803 }
5804
5805 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5807 self.0.options = v.into();
5808 self
5809 }
5810
5811 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5813 (*self.0.stub)
5814 .set_iam_policy(self.0.request, self.0.options)
5815 .await
5816 .map(crate::Response::into_body)
5817 }
5818
5819 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5823 self.0.request.resource = v.into();
5824 self
5825 }
5826
5827 pub fn set_policy<T>(mut self, v: T) -> Self
5831 where
5832 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5833 {
5834 self.0.request.policy = std::option::Option::Some(v.into());
5835 self
5836 }
5837
5838 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5842 where
5843 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5844 {
5845 self.0.request.policy = v.map(|x| x.into());
5846 self
5847 }
5848
5849 pub fn set_update_mask<T>(mut self, v: T) -> Self
5851 where
5852 T: std::convert::Into<wkt::FieldMask>,
5853 {
5854 self.0.request.update_mask = std::option::Option::Some(v.into());
5855 self
5856 }
5857
5858 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5860 where
5861 T: std::convert::Into<wkt::FieldMask>,
5862 {
5863 self.0.request.update_mask = v.map(|x| x.into());
5864 self
5865 }
5866 }
5867
5868 #[doc(hidden)]
5869 impl crate::RequestBuilder for SetIamPolicy {
5870 fn request_options(&mut self) -> &mut crate::RequestOptions {
5871 &mut self.0.options
5872 }
5873 }
5874
5875 #[derive(Clone, Debug)]
5892 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
5893
5894 impl GetIamPolicy {
5895 pub(crate) fn new(
5896 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5897 ) -> Self {
5898 Self(RequestBuilder::new(stub))
5899 }
5900
5901 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
5903 mut self,
5904 v: V,
5905 ) -> Self {
5906 self.0.request = v.into();
5907 self
5908 }
5909
5910 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5912 self.0.options = v.into();
5913 self
5914 }
5915
5916 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5918 (*self.0.stub)
5919 .get_iam_policy(self.0.request, self.0.options)
5920 .await
5921 .map(crate::Response::into_body)
5922 }
5923
5924 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5928 self.0.request.resource = v.into();
5929 self
5930 }
5931
5932 pub fn set_options<T>(mut self, v: T) -> Self
5934 where
5935 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5936 {
5937 self.0.request.options = std::option::Option::Some(v.into());
5938 self
5939 }
5940
5941 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5943 where
5944 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5945 {
5946 self.0.request.options = v.map(|x| x.into());
5947 self
5948 }
5949 }
5950
5951 #[doc(hidden)]
5952 impl crate::RequestBuilder for GetIamPolicy {
5953 fn request_options(&mut self) -> &mut crate::RequestOptions {
5954 &mut self.0.options
5955 }
5956 }
5957
5958 #[derive(Clone, Debug)]
5975 pub struct TestIamPermissions(
5976 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5977 );
5978
5979 impl TestIamPermissions {
5980 pub(crate) fn new(
5981 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5982 ) -> Self {
5983 Self(RequestBuilder::new(stub))
5984 }
5985
5986 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5988 mut self,
5989 v: V,
5990 ) -> Self {
5991 self.0.request = v.into();
5992 self
5993 }
5994
5995 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5997 self.0.options = v.into();
5998 self
5999 }
6000
6001 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6003 (*self.0.stub)
6004 .test_iam_permissions(self.0.request, self.0.options)
6005 .await
6006 .map(crate::Response::into_body)
6007 }
6008
6009 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013 self.0.request.resource = v.into();
6014 self
6015 }
6016
6017 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6021 where
6022 T: std::iter::IntoIterator<Item = V>,
6023 V: std::convert::Into<std::string::String>,
6024 {
6025 use std::iter::Iterator;
6026 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6027 self
6028 }
6029 }
6030
6031 #[doc(hidden)]
6032 impl crate::RequestBuilder for TestIamPermissions {
6033 fn request_options(&mut self) -> &mut crate::RequestOptions {
6034 &mut self.0.options
6035 }
6036 }
6037
6038 #[derive(Clone, Debug)]
6059 pub struct ListOperations(
6060 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6061 );
6062
6063 impl ListOperations {
6064 pub(crate) fn new(
6065 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6066 ) -> Self {
6067 Self(RequestBuilder::new(stub))
6068 }
6069
6070 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6072 mut self,
6073 v: V,
6074 ) -> Self {
6075 self.0.request = v.into();
6076 self
6077 }
6078
6079 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6081 self.0.options = v.into();
6082 self
6083 }
6084
6085 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6087 (*self.0.stub)
6088 .list_operations(self.0.request, self.0.options)
6089 .await
6090 .map(crate::Response::into_body)
6091 }
6092
6093 pub fn by_page(
6095 self,
6096 ) -> impl google_cloud_gax::paginator::Paginator<
6097 google_cloud_longrunning::model::ListOperationsResponse,
6098 crate::Error,
6099 > {
6100 use std::clone::Clone;
6101 let token = self.0.request.page_token.clone();
6102 let execute = move |token: String| {
6103 let mut builder = self.clone();
6104 builder.0.request = builder.0.request.set_page_token(token);
6105 builder.send()
6106 };
6107 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6108 }
6109
6110 pub fn by_item(
6112 self,
6113 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6114 google_cloud_longrunning::model::ListOperationsResponse,
6115 crate::Error,
6116 > {
6117 use google_cloud_gax::paginator::Paginator;
6118 self.by_page().items()
6119 }
6120
6121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6123 self.0.request.name = v.into();
6124 self
6125 }
6126
6127 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6129 self.0.request.filter = v.into();
6130 self
6131 }
6132
6133 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6135 self.0.request.page_size = v.into();
6136 self
6137 }
6138
6139 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6141 self.0.request.page_token = v.into();
6142 self
6143 }
6144
6145 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6147 self.0.request.return_partial_success = v.into();
6148 self
6149 }
6150 }
6151
6152 #[doc(hidden)]
6153 impl crate::RequestBuilder for ListOperations {
6154 fn request_options(&mut self) -> &mut crate::RequestOptions {
6155 &mut self.0.options
6156 }
6157 }
6158
6159 #[derive(Clone, Debug)]
6176 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6177
6178 impl GetOperation {
6179 pub(crate) fn new(
6180 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6181 ) -> Self {
6182 Self(RequestBuilder::new(stub))
6183 }
6184
6185 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6187 mut self,
6188 v: V,
6189 ) -> Self {
6190 self.0.request = v.into();
6191 self
6192 }
6193
6194 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6196 self.0.options = v.into();
6197 self
6198 }
6199
6200 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6202 (*self.0.stub)
6203 .get_operation(self.0.request, self.0.options)
6204 .await
6205 .map(crate::Response::into_body)
6206 }
6207
6208 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6210 self.0.request.name = v.into();
6211 self
6212 }
6213 }
6214
6215 #[doc(hidden)]
6216 impl crate::RequestBuilder for GetOperation {
6217 fn request_options(&mut self) -> &mut crate::RequestOptions {
6218 &mut self.0.options
6219 }
6220 }
6221
6222 #[derive(Clone, Debug)]
6239 pub struct DeleteOperation(
6240 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6241 );
6242
6243 impl DeleteOperation {
6244 pub(crate) fn new(
6245 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6246 ) -> Self {
6247 Self(RequestBuilder::new(stub))
6248 }
6249
6250 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6252 mut self,
6253 v: V,
6254 ) -> Self {
6255 self.0.request = v.into();
6256 self
6257 }
6258
6259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6261 self.0.options = v.into();
6262 self
6263 }
6264
6265 pub async fn send(self) -> Result<()> {
6267 (*self.0.stub)
6268 .delete_operation(self.0.request, self.0.options)
6269 .await
6270 .map(crate::Response::into_body)
6271 }
6272
6273 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6275 self.0.request.name = v.into();
6276 self
6277 }
6278 }
6279
6280 #[doc(hidden)]
6281 impl crate::RequestBuilder for DeleteOperation {
6282 fn request_options(&mut self) -> &mut crate::RequestOptions {
6283 &mut self.0.options
6284 }
6285 }
6286
6287 #[derive(Clone, Debug)]
6304 pub struct CancelOperation(
6305 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6306 );
6307
6308 impl CancelOperation {
6309 pub(crate) fn new(
6310 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6311 ) -> Self {
6312 Self(RequestBuilder::new(stub))
6313 }
6314
6315 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6317 mut self,
6318 v: V,
6319 ) -> Self {
6320 self.0.request = v.into();
6321 self
6322 }
6323
6324 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6326 self.0.options = v.into();
6327 self
6328 }
6329
6330 pub async fn send(self) -> Result<()> {
6332 (*self.0.stub)
6333 .cancel_operation(self.0.request, self.0.options)
6334 .await
6335 .map(crate::Response::into_body)
6336 }
6337
6338 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6340 self.0.request.name = v.into();
6341 self
6342 }
6343 }
6344
6345 #[doc(hidden)]
6346 impl crate::RequestBuilder for CancelOperation {
6347 fn request_options(&mut self) -> &mut crate::RequestOptions {
6348 &mut self.0.options
6349 }
6350 }
6351}