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 dns_threat_detector_service {
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::DnsThreatDetectorService;
3845 pub struct Factory;
3846 impl crate::ClientFactory for Factory {
3847 type Client = DnsThreatDetectorService;
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::DnsThreatDetectorService>,
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::DnsThreatDetectorService>,
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 ListDnsThreatDetectors(RequestBuilder<crate::model::ListDnsThreatDetectorsRequest>);
3903
3904 impl ListDnsThreatDetectors {
3905 pub(crate) fn new(
3906 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3907 ) -> Self {
3908 Self(RequestBuilder::new(stub))
3909 }
3910
3911 pub fn with_request<V: Into<crate::model::ListDnsThreatDetectorsRequest>>(
3913 mut self,
3914 v: V,
3915 ) -> Self {
3916 self.0.request = v.into();
3917 self
3918 }
3919
3920 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3922 self.0.options = v.into();
3923 self
3924 }
3925
3926 pub async fn send(self) -> Result<crate::model::ListDnsThreatDetectorsResponse> {
3928 (*self.0.stub)
3929 .list_dns_threat_detectors(self.0.request, self.0.options)
3930 .await
3931 .map(crate::Response::into_body)
3932 }
3933
3934 pub fn by_page(
3936 self,
3937 ) -> impl google_cloud_gax::paginator::Paginator<
3938 crate::model::ListDnsThreatDetectorsResponse,
3939 crate::Error,
3940 > {
3941 use std::clone::Clone;
3942 let token = self.0.request.page_token.clone();
3943 let execute = move |token: String| {
3944 let mut builder = self.clone();
3945 builder.0.request = builder.0.request.set_page_token(token);
3946 builder.send()
3947 };
3948 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3949 }
3950
3951 pub fn by_item(
3953 self,
3954 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3955 crate::model::ListDnsThreatDetectorsResponse,
3956 crate::Error,
3957 > {
3958 use google_cloud_gax::paginator::Paginator;
3959 self.by_page().items()
3960 }
3961
3962 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3966 self.0.request.parent = v.into();
3967 self
3968 }
3969
3970 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3972 self.0.request.page_size = v.into();
3973 self
3974 }
3975
3976 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3978 self.0.request.page_token = v.into();
3979 self
3980 }
3981 }
3982
3983 #[doc(hidden)]
3984 impl crate::RequestBuilder for ListDnsThreatDetectors {
3985 fn request_options(&mut self) -> &mut crate::RequestOptions {
3986 &mut self.0.options
3987 }
3988 }
3989
3990 #[derive(Clone, Debug)]
4007 pub struct GetDnsThreatDetector(RequestBuilder<crate::model::GetDnsThreatDetectorRequest>);
4008
4009 impl GetDnsThreatDetector {
4010 pub(crate) fn new(
4011 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4012 ) -> Self {
4013 Self(RequestBuilder::new(stub))
4014 }
4015
4016 pub fn with_request<V: Into<crate::model::GetDnsThreatDetectorRequest>>(
4018 mut self,
4019 v: V,
4020 ) -> Self {
4021 self.0.request = v.into();
4022 self
4023 }
4024
4025 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4027 self.0.options = v.into();
4028 self
4029 }
4030
4031 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4033 (*self.0.stub)
4034 .get_dns_threat_detector(self.0.request, self.0.options)
4035 .await
4036 .map(crate::Response::into_body)
4037 }
4038
4039 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4043 self.0.request.name = v.into();
4044 self
4045 }
4046 }
4047
4048 #[doc(hidden)]
4049 impl crate::RequestBuilder for GetDnsThreatDetector {
4050 fn request_options(&mut self) -> &mut crate::RequestOptions {
4051 &mut self.0.options
4052 }
4053 }
4054
4055 #[derive(Clone, Debug)]
4072 pub struct CreateDnsThreatDetector(
4073 RequestBuilder<crate::model::CreateDnsThreatDetectorRequest>,
4074 );
4075
4076 impl CreateDnsThreatDetector {
4077 pub(crate) fn new(
4078 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4079 ) -> Self {
4080 Self(RequestBuilder::new(stub))
4081 }
4082
4083 pub fn with_request<V: Into<crate::model::CreateDnsThreatDetectorRequest>>(
4085 mut self,
4086 v: V,
4087 ) -> Self {
4088 self.0.request = v.into();
4089 self
4090 }
4091
4092 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4094 self.0.options = v.into();
4095 self
4096 }
4097
4098 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4100 (*self.0.stub)
4101 .create_dns_threat_detector(self.0.request, self.0.options)
4102 .await
4103 .map(crate::Response::into_body)
4104 }
4105
4106 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110 self.0.request.parent = v.into();
4111 self
4112 }
4113
4114 pub fn set_dns_threat_detector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4116 self.0.request.dns_threat_detector_id = v.into();
4117 self
4118 }
4119
4120 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4124 where
4125 T: std::convert::Into<crate::model::DnsThreatDetector>,
4126 {
4127 self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4128 self
4129 }
4130
4131 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4135 where
4136 T: std::convert::Into<crate::model::DnsThreatDetector>,
4137 {
4138 self.0.request.dns_threat_detector = v.map(|x| x.into());
4139 self
4140 }
4141 }
4142
4143 #[doc(hidden)]
4144 impl crate::RequestBuilder for CreateDnsThreatDetector {
4145 fn request_options(&mut self) -> &mut crate::RequestOptions {
4146 &mut self.0.options
4147 }
4148 }
4149
4150 #[derive(Clone, Debug)]
4167 pub struct UpdateDnsThreatDetector(
4168 RequestBuilder<crate::model::UpdateDnsThreatDetectorRequest>,
4169 );
4170
4171 impl UpdateDnsThreatDetector {
4172 pub(crate) fn new(
4173 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4174 ) -> Self {
4175 Self(RequestBuilder::new(stub))
4176 }
4177
4178 pub fn with_request<V: Into<crate::model::UpdateDnsThreatDetectorRequest>>(
4180 mut self,
4181 v: V,
4182 ) -> Self {
4183 self.0.request = v.into();
4184 self
4185 }
4186
4187 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4189 self.0.options = v.into();
4190 self
4191 }
4192
4193 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4195 (*self.0.stub)
4196 .update_dns_threat_detector(self.0.request, self.0.options)
4197 .await
4198 .map(crate::Response::into_body)
4199 }
4200
4201 pub fn set_update_mask<T>(mut self, v: T) -> Self
4203 where
4204 T: std::convert::Into<wkt::FieldMask>,
4205 {
4206 self.0.request.update_mask = std::option::Option::Some(v.into());
4207 self
4208 }
4209
4210 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4212 where
4213 T: std::convert::Into<wkt::FieldMask>,
4214 {
4215 self.0.request.update_mask = v.map(|x| x.into());
4216 self
4217 }
4218
4219 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4223 where
4224 T: std::convert::Into<crate::model::DnsThreatDetector>,
4225 {
4226 self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4227 self
4228 }
4229
4230 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4234 where
4235 T: std::convert::Into<crate::model::DnsThreatDetector>,
4236 {
4237 self.0.request.dns_threat_detector = v.map(|x| x.into());
4238 self
4239 }
4240 }
4241
4242 #[doc(hidden)]
4243 impl crate::RequestBuilder for UpdateDnsThreatDetector {
4244 fn request_options(&mut self) -> &mut crate::RequestOptions {
4245 &mut self.0.options
4246 }
4247 }
4248
4249 #[derive(Clone, Debug)]
4266 pub struct DeleteDnsThreatDetector(
4267 RequestBuilder<crate::model::DeleteDnsThreatDetectorRequest>,
4268 );
4269
4270 impl DeleteDnsThreatDetector {
4271 pub(crate) fn new(
4272 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4273 ) -> Self {
4274 Self(RequestBuilder::new(stub))
4275 }
4276
4277 pub fn with_request<V: Into<crate::model::DeleteDnsThreatDetectorRequest>>(
4279 mut self,
4280 v: V,
4281 ) -> Self {
4282 self.0.request = v.into();
4283 self
4284 }
4285
4286 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4288 self.0.options = v.into();
4289 self
4290 }
4291
4292 pub async fn send(self) -> Result<()> {
4294 (*self.0.stub)
4295 .delete_dns_threat_detector(self.0.request, self.0.options)
4296 .await
4297 .map(crate::Response::into_body)
4298 }
4299
4300 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4304 self.0.request.name = v.into();
4305 self
4306 }
4307 }
4308
4309 #[doc(hidden)]
4310 impl crate::RequestBuilder for DeleteDnsThreatDetector {
4311 fn request_options(&mut self) -> &mut crate::RequestOptions {
4312 &mut self.0.options
4313 }
4314 }
4315
4316 #[derive(Clone, Debug)]
4337 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4338
4339 impl ListLocations {
4340 pub(crate) fn new(
4341 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4342 ) -> Self {
4343 Self(RequestBuilder::new(stub))
4344 }
4345
4346 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4348 mut self,
4349 v: V,
4350 ) -> Self {
4351 self.0.request = v.into();
4352 self
4353 }
4354
4355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4357 self.0.options = v.into();
4358 self
4359 }
4360
4361 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4363 (*self.0.stub)
4364 .list_locations(self.0.request, self.0.options)
4365 .await
4366 .map(crate::Response::into_body)
4367 }
4368
4369 pub fn by_page(
4371 self,
4372 ) -> impl google_cloud_gax::paginator::Paginator<
4373 google_cloud_location::model::ListLocationsResponse,
4374 crate::Error,
4375 > {
4376 use std::clone::Clone;
4377 let token = self.0.request.page_token.clone();
4378 let execute = move |token: String| {
4379 let mut builder = self.clone();
4380 builder.0.request = builder.0.request.set_page_token(token);
4381 builder.send()
4382 };
4383 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4384 }
4385
4386 pub fn by_item(
4388 self,
4389 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4390 google_cloud_location::model::ListLocationsResponse,
4391 crate::Error,
4392 > {
4393 use google_cloud_gax::paginator::Paginator;
4394 self.by_page().items()
4395 }
4396
4397 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4399 self.0.request.name = v.into();
4400 self
4401 }
4402
4403 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4405 self.0.request.filter = v.into();
4406 self
4407 }
4408
4409 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4411 self.0.request.page_size = v.into();
4412 self
4413 }
4414
4415 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4417 self.0.request.page_token = v.into();
4418 self
4419 }
4420 }
4421
4422 #[doc(hidden)]
4423 impl crate::RequestBuilder for ListLocations {
4424 fn request_options(&mut self) -> &mut crate::RequestOptions {
4425 &mut self.0.options
4426 }
4427 }
4428
4429 #[derive(Clone, Debug)]
4446 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4447
4448 impl GetLocation {
4449 pub(crate) fn new(
4450 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4451 ) -> Self {
4452 Self(RequestBuilder::new(stub))
4453 }
4454
4455 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4457 mut self,
4458 v: V,
4459 ) -> Self {
4460 self.0.request = v.into();
4461 self
4462 }
4463
4464 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4466 self.0.options = v.into();
4467 self
4468 }
4469
4470 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4472 (*self.0.stub)
4473 .get_location(self.0.request, self.0.options)
4474 .await
4475 .map(crate::Response::into_body)
4476 }
4477
4478 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4480 self.0.request.name = v.into();
4481 self
4482 }
4483 }
4484
4485 #[doc(hidden)]
4486 impl crate::RequestBuilder for GetLocation {
4487 fn request_options(&mut self) -> &mut crate::RequestOptions {
4488 &mut self.0.options
4489 }
4490 }
4491
4492 #[derive(Clone, Debug)]
4509 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4510
4511 impl SetIamPolicy {
4512 pub(crate) fn new(
4513 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4514 ) -> Self {
4515 Self(RequestBuilder::new(stub))
4516 }
4517
4518 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4520 mut self,
4521 v: V,
4522 ) -> Self {
4523 self.0.request = v.into();
4524 self
4525 }
4526
4527 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4529 self.0.options = v.into();
4530 self
4531 }
4532
4533 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4535 (*self.0.stub)
4536 .set_iam_policy(self.0.request, self.0.options)
4537 .await
4538 .map(crate::Response::into_body)
4539 }
4540
4541 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4545 self.0.request.resource = v.into();
4546 self
4547 }
4548
4549 pub fn set_policy<T>(mut self, v: T) -> Self
4553 where
4554 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4555 {
4556 self.0.request.policy = std::option::Option::Some(v.into());
4557 self
4558 }
4559
4560 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4564 where
4565 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4566 {
4567 self.0.request.policy = v.map(|x| x.into());
4568 self
4569 }
4570
4571 pub fn set_update_mask<T>(mut self, v: T) -> Self
4573 where
4574 T: std::convert::Into<wkt::FieldMask>,
4575 {
4576 self.0.request.update_mask = std::option::Option::Some(v.into());
4577 self
4578 }
4579
4580 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4582 where
4583 T: std::convert::Into<wkt::FieldMask>,
4584 {
4585 self.0.request.update_mask = v.map(|x| x.into());
4586 self
4587 }
4588 }
4589
4590 #[doc(hidden)]
4591 impl crate::RequestBuilder for SetIamPolicy {
4592 fn request_options(&mut self) -> &mut crate::RequestOptions {
4593 &mut self.0.options
4594 }
4595 }
4596
4597 #[derive(Clone, Debug)]
4614 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4615
4616 impl GetIamPolicy {
4617 pub(crate) fn new(
4618 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4619 ) -> Self {
4620 Self(RequestBuilder::new(stub))
4621 }
4622
4623 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4625 mut self,
4626 v: V,
4627 ) -> Self {
4628 self.0.request = v.into();
4629 self
4630 }
4631
4632 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4634 self.0.options = v.into();
4635 self
4636 }
4637
4638 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4640 (*self.0.stub)
4641 .get_iam_policy(self.0.request, self.0.options)
4642 .await
4643 .map(crate::Response::into_body)
4644 }
4645
4646 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4650 self.0.request.resource = v.into();
4651 self
4652 }
4653
4654 pub fn set_options<T>(mut self, v: T) -> Self
4656 where
4657 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4658 {
4659 self.0.request.options = std::option::Option::Some(v.into());
4660 self
4661 }
4662
4663 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4665 where
4666 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4667 {
4668 self.0.request.options = v.map(|x| x.into());
4669 self
4670 }
4671 }
4672
4673 #[doc(hidden)]
4674 impl crate::RequestBuilder for GetIamPolicy {
4675 fn request_options(&mut self) -> &mut crate::RequestOptions {
4676 &mut self.0.options
4677 }
4678 }
4679
4680 #[derive(Clone, Debug)]
4697 pub struct TestIamPermissions(
4698 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4699 );
4700
4701 impl TestIamPermissions {
4702 pub(crate) fn new(
4703 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4704 ) -> Self {
4705 Self(RequestBuilder::new(stub))
4706 }
4707
4708 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4710 mut self,
4711 v: V,
4712 ) -> Self {
4713 self.0.request = v.into();
4714 self
4715 }
4716
4717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4719 self.0.options = v.into();
4720 self
4721 }
4722
4723 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4725 (*self.0.stub)
4726 .test_iam_permissions(self.0.request, self.0.options)
4727 .await
4728 .map(crate::Response::into_body)
4729 }
4730
4731 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4735 self.0.request.resource = v.into();
4736 self
4737 }
4738
4739 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4743 where
4744 T: std::iter::IntoIterator<Item = V>,
4745 V: std::convert::Into<std::string::String>,
4746 {
4747 use std::iter::Iterator;
4748 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4749 self
4750 }
4751 }
4752
4753 #[doc(hidden)]
4754 impl crate::RequestBuilder for TestIamPermissions {
4755 fn request_options(&mut self) -> &mut crate::RequestOptions {
4756 &mut self.0.options
4757 }
4758 }
4759
4760 #[derive(Clone, Debug)]
4781 pub struct ListOperations(
4782 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4783 );
4784
4785 impl ListOperations {
4786 pub(crate) fn new(
4787 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4788 ) -> Self {
4789 Self(RequestBuilder::new(stub))
4790 }
4791
4792 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4794 mut self,
4795 v: V,
4796 ) -> Self {
4797 self.0.request = v.into();
4798 self
4799 }
4800
4801 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4803 self.0.options = v.into();
4804 self
4805 }
4806
4807 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4809 (*self.0.stub)
4810 .list_operations(self.0.request, self.0.options)
4811 .await
4812 .map(crate::Response::into_body)
4813 }
4814
4815 pub fn by_page(
4817 self,
4818 ) -> impl google_cloud_gax::paginator::Paginator<
4819 google_cloud_longrunning::model::ListOperationsResponse,
4820 crate::Error,
4821 > {
4822 use std::clone::Clone;
4823 let token = self.0.request.page_token.clone();
4824 let execute = move |token: String| {
4825 let mut builder = self.clone();
4826 builder.0.request = builder.0.request.set_page_token(token);
4827 builder.send()
4828 };
4829 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4830 }
4831
4832 pub fn by_item(
4834 self,
4835 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4836 google_cloud_longrunning::model::ListOperationsResponse,
4837 crate::Error,
4838 > {
4839 use google_cloud_gax::paginator::Paginator;
4840 self.by_page().items()
4841 }
4842
4843 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4845 self.0.request.name = v.into();
4846 self
4847 }
4848
4849 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4851 self.0.request.filter = v.into();
4852 self
4853 }
4854
4855 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4857 self.0.request.page_size = v.into();
4858 self
4859 }
4860
4861 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4863 self.0.request.page_token = v.into();
4864 self
4865 }
4866
4867 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4869 self.0.request.return_partial_success = v.into();
4870 self
4871 }
4872 }
4873
4874 #[doc(hidden)]
4875 impl crate::RequestBuilder for ListOperations {
4876 fn request_options(&mut self) -> &mut crate::RequestOptions {
4877 &mut self.0.options
4878 }
4879 }
4880
4881 #[derive(Clone, Debug)]
4898 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4899
4900 impl GetOperation {
4901 pub(crate) fn new(
4902 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4903 ) -> Self {
4904 Self(RequestBuilder::new(stub))
4905 }
4906
4907 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4909 mut self,
4910 v: V,
4911 ) -> Self {
4912 self.0.request = v.into();
4913 self
4914 }
4915
4916 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4918 self.0.options = v.into();
4919 self
4920 }
4921
4922 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4924 (*self.0.stub)
4925 .get_operation(self.0.request, self.0.options)
4926 .await
4927 .map(crate::Response::into_body)
4928 }
4929
4930 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4932 self.0.request.name = v.into();
4933 self
4934 }
4935 }
4936
4937 #[doc(hidden)]
4938 impl crate::RequestBuilder for GetOperation {
4939 fn request_options(&mut self) -> &mut crate::RequestOptions {
4940 &mut self.0.options
4941 }
4942 }
4943
4944 #[derive(Clone, Debug)]
4961 pub struct DeleteOperation(
4962 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4963 );
4964
4965 impl DeleteOperation {
4966 pub(crate) fn new(
4967 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4968 ) -> Self {
4969 Self(RequestBuilder::new(stub))
4970 }
4971
4972 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4974 mut self,
4975 v: V,
4976 ) -> Self {
4977 self.0.request = v.into();
4978 self
4979 }
4980
4981 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4983 self.0.options = v.into();
4984 self
4985 }
4986
4987 pub async fn send(self) -> Result<()> {
4989 (*self.0.stub)
4990 .delete_operation(self.0.request, self.0.options)
4991 .await
4992 .map(crate::Response::into_body)
4993 }
4994
4995 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4997 self.0.request.name = v.into();
4998 self
4999 }
5000 }
5001
5002 #[doc(hidden)]
5003 impl crate::RequestBuilder for DeleteOperation {
5004 fn request_options(&mut self) -> &mut crate::RequestOptions {
5005 &mut self.0.options
5006 }
5007 }
5008
5009 #[derive(Clone, Debug)]
5026 pub struct CancelOperation(
5027 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5028 );
5029
5030 impl CancelOperation {
5031 pub(crate) fn new(
5032 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5033 ) -> Self {
5034 Self(RequestBuilder::new(stub))
5035 }
5036
5037 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5039 mut self,
5040 v: V,
5041 ) -> Self {
5042 self.0.request = v.into();
5043 self
5044 }
5045
5046 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5048 self.0.options = v.into();
5049 self
5050 }
5051
5052 pub async fn send(self) -> Result<()> {
5054 (*self.0.stub)
5055 .cancel_operation(self.0.request, self.0.options)
5056 .await
5057 .map(crate::Response::into_body)
5058 }
5059
5060 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5062 self.0.request.name = v.into();
5063 self
5064 }
5065 }
5066
5067 #[doc(hidden)]
5068 impl crate::RequestBuilder for CancelOperation {
5069 fn request_options(&mut self) -> &mut crate::RequestOptions {
5070 &mut self.0.options
5071 }
5072 }
5073}
5074
5075pub mod firewall_activation {
5076 use crate::Result;
5077
5078 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5092
5093 pub(crate) mod client {
5094 use super::super::super::client::FirewallActivation;
5095 pub struct Factory;
5096 impl crate::ClientFactory for Factory {
5097 type Client = FirewallActivation;
5098 type Credentials = gaxi::options::Credentials;
5099 async fn build(
5100 self,
5101 config: gaxi::options::ClientConfig,
5102 ) -> crate::ClientBuilderResult<Self::Client> {
5103 Self::Client::new(config).await
5104 }
5105 }
5106 }
5107
5108 #[derive(Clone, Debug)]
5110 pub(crate) struct RequestBuilder<R: std::default::Default> {
5111 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5112 request: R,
5113 options: crate::RequestOptions,
5114 }
5115
5116 impl<R> RequestBuilder<R>
5117 where
5118 R: std::default::Default,
5119 {
5120 pub(crate) fn new(
5121 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5122 ) -> Self {
5123 Self {
5124 stub,
5125 request: R::default(),
5126 options: crate::RequestOptions::default(),
5127 }
5128 }
5129 }
5130
5131 #[derive(Clone, Debug)]
5152 pub struct ListFirewallEndpoints(RequestBuilder<crate::model::ListFirewallEndpointsRequest>);
5153
5154 impl ListFirewallEndpoints {
5155 pub(crate) fn new(
5156 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5157 ) -> Self {
5158 Self(RequestBuilder::new(stub))
5159 }
5160
5161 pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5163 mut self,
5164 v: V,
5165 ) -> Self {
5166 self.0.request = v.into();
5167 self
5168 }
5169
5170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5172 self.0.options = v.into();
5173 self
5174 }
5175
5176 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5178 (*self.0.stub)
5179 .list_firewall_endpoints(self.0.request, self.0.options)
5180 .await
5181 .map(crate::Response::into_body)
5182 }
5183
5184 pub fn by_page(
5186 self,
5187 ) -> impl google_cloud_gax::paginator::Paginator<
5188 crate::model::ListFirewallEndpointsResponse,
5189 crate::Error,
5190 > {
5191 use std::clone::Clone;
5192 let token = self.0.request.page_token.clone();
5193 let execute = move |token: String| {
5194 let mut builder = self.clone();
5195 builder.0.request = builder.0.request.set_page_token(token);
5196 builder.send()
5197 };
5198 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5199 }
5200
5201 pub fn by_item(
5203 self,
5204 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5205 crate::model::ListFirewallEndpointsResponse,
5206 crate::Error,
5207 > {
5208 use google_cloud_gax::paginator::Paginator;
5209 self.by_page().items()
5210 }
5211
5212 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5216 self.0.request.parent = v.into();
5217 self
5218 }
5219
5220 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5222 self.0.request.page_size = v.into();
5223 self
5224 }
5225
5226 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5228 self.0.request.page_token = v.into();
5229 self
5230 }
5231
5232 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5234 self.0.request.filter = v.into();
5235 self
5236 }
5237
5238 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5240 self.0.request.order_by = v.into();
5241 self
5242 }
5243 }
5244
5245 #[doc(hidden)]
5246 impl crate::RequestBuilder for ListFirewallEndpoints {
5247 fn request_options(&mut self) -> &mut crate::RequestOptions {
5248 &mut self.0.options
5249 }
5250 }
5251
5252 #[derive(Clone, Debug)]
5269 pub struct GetFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5270
5271 impl GetFirewallEndpoint {
5272 pub(crate) fn new(
5273 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5274 ) -> Self {
5275 Self(RequestBuilder::new(stub))
5276 }
5277
5278 pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5280 mut self,
5281 v: V,
5282 ) -> Self {
5283 self.0.request = v.into();
5284 self
5285 }
5286
5287 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5289 self.0.options = v.into();
5290 self
5291 }
5292
5293 pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5295 (*self.0.stub)
5296 .get_firewall_endpoint(self.0.request, self.0.options)
5297 .await
5298 .map(crate::Response::into_body)
5299 }
5300
5301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5305 self.0.request.name = v.into();
5306 self
5307 }
5308 }
5309
5310 #[doc(hidden)]
5311 impl crate::RequestBuilder for GetFirewallEndpoint {
5312 fn request_options(&mut self) -> &mut crate::RequestOptions {
5313 &mut self.0.options
5314 }
5315 }
5316
5317 #[derive(Clone, Debug)]
5335 pub struct CreateFirewallEndpoint(RequestBuilder<crate::model::CreateFirewallEndpointRequest>);
5336
5337 impl CreateFirewallEndpoint {
5338 pub(crate) fn new(
5339 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5340 ) -> Self {
5341 Self(RequestBuilder::new(stub))
5342 }
5343
5344 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5346 mut self,
5347 v: V,
5348 ) -> Self {
5349 self.0.request = v.into();
5350 self
5351 }
5352
5353 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5355 self.0.options = v.into();
5356 self
5357 }
5358
5359 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5366 (*self.0.stub)
5367 .create_firewall_endpoint(self.0.request, self.0.options)
5368 .await
5369 .map(crate::Response::into_body)
5370 }
5371
5372 pub fn poller(
5374 self,
5375 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5376 {
5377 type Operation = google_cloud_lro::internal::Operation<
5378 crate::model::FirewallEndpoint,
5379 crate::model::OperationMetadata,
5380 >;
5381 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5382 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5383
5384 let stub = self.0.stub.clone();
5385 let mut options = self.0.options.clone();
5386 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5387 let query = move |name| {
5388 let stub = stub.clone();
5389 let options = options.clone();
5390 async {
5391 let op = GetOperation::new(stub)
5392 .set_name(name)
5393 .with_options(options)
5394 .send()
5395 .await?;
5396 Ok(Operation::new(op))
5397 }
5398 };
5399
5400 let start = move || async {
5401 let op = self.send().await?;
5402 Ok(Operation::new(op))
5403 };
5404
5405 google_cloud_lro::internal::new_poller(
5406 polling_error_policy,
5407 polling_backoff_policy,
5408 start,
5409 query,
5410 )
5411 }
5412
5413 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5417 self.0.request.parent = v.into();
5418 self
5419 }
5420
5421 pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5425 self.0.request.firewall_endpoint_id = v.into();
5426 self
5427 }
5428
5429 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5433 where
5434 T: std::convert::Into<crate::model::FirewallEndpoint>,
5435 {
5436 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5437 self
5438 }
5439
5440 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5444 where
5445 T: std::convert::Into<crate::model::FirewallEndpoint>,
5446 {
5447 self.0.request.firewall_endpoint = v.map(|x| x.into());
5448 self
5449 }
5450
5451 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5453 self.0.request.request_id = v.into();
5454 self
5455 }
5456 }
5457
5458 #[doc(hidden)]
5459 impl crate::RequestBuilder for CreateFirewallEndpoint {
5460 fn request_options(&mut self) -> &mut crate::RequestOptions {
5461 &mut self.0.options
5462 }
5463 }
5464
5465 #[derive(Clone, Debug)]
5483 pub struct DeleteFirewallEndpoint(RequestBuilder<crate::model::DeleteFirewallEndpointRequest>);
5484
5485 impl DeleteFirewallEndpoint {
5486 pub(crate) fn new(
5487 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5488 ) -> Self {
5489 Self(RequestBuilder::new(stub))
5490 }
5491
5492 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5494 mut self,
5495 v: V,
5496 ) -> Self {
5497 self.0.request = v.into();
5498 self
5499 }
5500
5501 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5503 self.0.options = v.into();
5504 self
5505 }
5506
5507 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5514 (*self.0.stub)
5515 .delete_firewall_endpoint(self.0.request, self.0.options)
5516 .await
5517 .map(crate::Response::into_body)
5518 }
5519
5520 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5522 type Operation =
5523 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5524 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5525 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5526
5527 let stub = self.0.stub.clone();
5528 let mut options = self.0.options.clone();
5529 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5530 let query = move |name| {
5531 let stub = stub.clone();
5532 let options = options.clone();
5533 async {
5534 let op = GetOperation::new(stub)
5535 .set_name(name)
5536 .with_options(options)
5537 .send()
5538 .await?;
5539 Ok(Operation::new(op))
5540 }
5541 };
5542
5543 let start = move || async {
5544 let op = self.send().await?;
5545 Ok(Operation::new(op))
5546 };
5547
5548 google_cloud_lro::internal::new_unit_response_poller(
5549 polling_error_policy,
5550 polling_backoff_policy,
5551 start,
5552 query,
5553 )
5554 }
5555
5556 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5560 self.0.request.name = v.into();
5561 self
5562 }
5563
5564 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5566 self.0.request.request_id = v.into();
5567 self
5568 }
5569 }
5570
5571 #[doc(hidden)]
5572 impl crate::RequestBuilder for DeleteFirewallEndpoint {
5573 fn request_options(&mut self) -> &mut crate::RequestOptions {
5574 &mut self.0.options
5575 }
5576 }
5577
5578 #[derive(Clone, Debug)]
5596 pub struct UpdateFirewallEndpoint(RequestBuilder<crate::model::UpdateFirewallEndpointRequest>);
5597
5598 impl UpdateFirewallEndpoint {
5599 pub(crate) fn new(
5600 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5601 ) -> Self {
5602 Self(RequestBuilder::new(stub))
5603 }
5604
5605 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
5607 mut self,
5608 v: V,
5609 ) -> Self {
5610 self.0.request = v.into();
5611 self
5612 }
5613
5614 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5616 self.0.options = v.into();
5617 self
5618 }
5619
5620 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5627 (*self.0.stub)
5628 .update_firewall_endpoint(self.0.request, self.0.options)
5629 .await
5630 .map(crate::Response::into_body)
5631 }
5632
5633 pub fn poller(
5635 self,
5636 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5637 {
5638 type Operation = google_cloud_lro::internal::Operation<
5639 crate::model::FirewallEndpoint,
5640 crate::model::OperationMetadata,
5641 >;
5642 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5643 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5644
5645 let stub = self.0.stub.clone();
5646 let mut options = self.0.options.clone();
5647 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5648 let query = move |name| {
5649 let stub = stub.clone();
5650 let options = options.clone();
5651 async {
5652 let op = GetOperation::new(stub)
5653 .set_name(name)
5654 .with_options(options)
5655 .send()
5656 .await?;
5657 Ok(Operation::new(op))
5658 }
5659 };
5660
5661 let start = move || async {
5662 let op = self.send().await?;
5663 Ok(Operation::new(op))
5664 };
5665
5666 google_cloud_lro::internal::new_poller(
5667 polling_error_policy,
5668 polling_backoff_policy,
5669 start,
5670 query,
5671 )
5672 }
5673
5674 pub fn set_update_mask<T>(mut self, v: T) -> Self
5678 where
5679 T: std::convert::Into<wkt::FieldMask>,
5680 {
5681 self.0.request.update_mask = std::option::Option::Some(v.into());
5682 self
5683 }
5684
5685 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5689 where
5690 T: std::convert::Into<wkt::FieldMask>,
5691 {
5692 self.0.request.update_mask = v.map(|x| x.into());
5693 self
5694 }
5695
5696 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5700 where
5701 T: std::convert::Into<crate::model::FirewallEndpoint>,
5702 {
5703 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5704 self
5705 }
5706
5707 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5711 where
5712 T: std::convert::Into<crate::model::FirewallEndpoint>,
5713 {
5714 self.0.request.firewall_endpoint = v.map(|x| x.into());
5715 self
5716 }
5717
5718 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5720 self.0.request.request_id = v.into();
5721 self
5722 }
5723 }
5724
5725 #[doc(hidden)]
5726 impl crate::RequestBuilder for UpdateFirewallEndpoint {
5727 fn request_options(&mut self) -> &mut crate::RequestOptions {
5728 &mut self.0.options
5729 }
5730 }
5731
5732 #[derive(Clone, Debug)]
5753 pub struct ListFirewallEndpointAssociations(
5754 RequestBuilder<crate::model::ListFirewallEndpointAssociationsRequest>,
5755 );
5756
5757 impl ListFirewallEndpointAssociations {
5758 pub(crate) fn new(
5759 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5760 ) -> Self {
5761 Self(RequestBuilder::new(stub))
5762 }
5763
5764 pub fn with_request<V: Into<crate::model::ListFirewallEndpointAssociationsRequest>>(
5766 mut self,
5767 v: V,
5768 ) -> Self {
5769 self.0.request = v.into();
5770 self
5771 }
5772
5773 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5775 self.0.options = v.into();
5776 self
5777 }
5778
5779 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointAssociationsResponse> {
5781 (*self.0.stub)
5782 .list_firewall_endpoint_associations(self.0.request, self.0.options)
5783 .await
5784 .map(crate::Response::into_body)
5785 }
5786
5787 pub fn by_page(
5789 self,
5790 ) -> impl google_cloud_gax::paginator::Paginator<
5791 crate::model::ListFirewallEndpointAssociationsResponse,
5792 crate::Error,
5793 > {
5794 use std::clone::Clone;
5795 let token = self.0.request.page_token.clone();
5796 let execute = move |token: String| {
5797 let mut builder = self.clone();
5798 builder.0.request = builder.0.request.set_page_token(token);
5799 builder.send()
5800 };
5801 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5802 }
5803
5804 pub fn by_item(
5806 self,
5807 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5808 crate::model::ListFirewallEndpointAssociationsResponse,
5809 crate::Error,
5810 > {
5811 use google_cloud_gax::paginator::Paginator;
5812 self.by_page().items()
5813 }
5814
5815 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5819 self.0.request.parent = v.into();
5820 self
5821 }
5822
5823 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5825 self.0.request.page_size = v.into();
5826 self
5827 }
5828
5829 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5831 self.0.request.page_token = v.into();
5832 self
5833 }
5834
5835 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5837 self.0.request.filter = v.into();
5838 self
5839 }
5840
5841 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5843 self.0.request.order_by = v.into();
5844 self
5845 }
5846 }
5847
5848 #[doc(hidden)]
5849 impl crate::RequestBuilder for ListFirewallEndpointAssociations {
5850 fn request_options(&mut self) -> &mut crate::RequestOptions {
5851 &mut self.0.options
5852 }
5853 }
5854
5855 #[derive(Clone, Debug)]
5872 pub struct GetFirewallEndpointAssociation(
5873 RequestBuilder<crate::model::GetFirewallEndpointAssociationRequest>,
5874 );
5875
5876 impl GetFirewallEndpointAssociation {
5877 pub(crate) fn new(
5878 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5879 ) -> Self {
5880 Self(RequestBuilder::new(stub))
5881 }
5882
5883 pub fn with_request<V: Into<crate::model::GetFirewallEndpointAssociationRequest>>(
5885 mut self,
5886 v: V,
5887 ) -> Self {
5888 self.0.request = v.into();
5889 self
5890 }
5891
5892 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5894 self.0.options = v.into();
5895 self
5896 }
5897
5898 pub async fn send(self) -> Result<crate::model::FirewallEndpointAssociation> {
5900 (*self.0.stub)
5901 .get_firewall_endpoint_association(self.0.request, self.0.options)
5902 .await
5903 .map(crate::Response::into_body)
5904 }
5905
5906 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5910 self.0.request.name = v.into();
5911 self
5912 }
5913 }
5914
5915 #[doc(hidden)]
5916 impl crate::RequestBuilder for GetFirewallEndpointAssociation {
5917 fn request_options(&mut self) -> &mut crate::RequestOptions {
5918 &mut self.0.options
5919 }
5920 }
5921
5922 #[derive(Clone, Debug)]
5940 pub struct CreateFirewallEndpointAssociation(
5941 RequestBuilder<crate::model::CreateFirewallEndpointAssociationRequest>,
5942 );
5943
5944 impl CreateFirewallEndpointAssociation {
5945 pub(crate) fn new(
5946 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5947 ) -> Self {
5948 Self(RequestBuilder::new(stub))
5949 }
5950
5951 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointAssociationRequest>>(
5953 mut self,
5954 v: V,
5955 ) -> Self {
5956 self.0.request = v.into();
5957 self
5958 }
5959
5960 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5962 self.0.options = v.into();
5963 self
5964 }
5965
5966 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5973 (*self.0.stub)
5974 .create_firewall_endpoint_association(self.0.request, self.0.options)
5975 .await
5976 .map(crate::Response::into_body)
5977 }
5978
5979 pub fn poller(
5981 self,
5982 ) -> impl google_cloud_lro::Poller<
5983 crate::model::FirewallEndpointAssociation,
5984 crate::model::OperationMetadata,
5985 > {
5986 type Operation = google_cloud_lro::internal::Operation<
5987 crate::model::FirewallEndpointAssociation,
5988 crate::model::OperationMetadata,
5989 >;
5990 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5991 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5992
5993 let stub = self.0.stub.clone();
5994 let mut options = self.0.options.clone();
5995 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5996 let query = move |name| {
5997 let stub = stub.clone();
5998 let options = options.clone();
5999 async {
6000 let op = GetOperation::new(stub)
6001 .set_name(name)
6002 .with_options(options)
6003 .send()
6004 .await?;
6005 Ok(Operation::new(op))
6006 }
6007 };
6008
6009 let start = move || async {
6010 let op = self.send().await?;
6011 Ok(Operation::new(op))
6012 };
6013
6014 google_cloud_lro::internal::new_poller(
6015 polling_error_policy,
6016 polling_backoff_policy,
6017 start,
6018 query,
6019 )
6020 }
6021
6022 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6026 self.0.request.parent = v.into();
6027 self
6028 }
6029
6030 pub fn set_firewall_endpoint_association_id<T: Into<std::string::String>>(
6032 mut self,
6033 v: T,
6034 ) -> Self {
6035 self.0.request.firewall_endpoint_association_id = v.into();
6036 self
6037 }
6038
6039 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6043 where
6044 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6045 {
6046 self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6047 self
6048 }
6049
6050 pub fn set_or_clear_firewall_endpoint_association<T>(
6054 mut self,
6055 v: std::option::Option<T>,
6056 ) -> Self
6057 where
6058 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6059 {
6060 self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6061 self
6062 }
6063
6064 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6066 self.0.request.request_id = v.into();
6067 self
6068 }
6069 }
6070
6071 #[doc(hidden)]
6072 impl crate::RequestBuilder for CreateFirewallEndpointAssociation {
6073 fn request_options(&mut self) -> &mut crate::RequestOptions {
6074 &mut self.0.options
6075 }
6076 }
6077
6078 #[derive(Clone, Debug)]
6096 pub struct DeleteFirewallEndpointAssociation(
6097 RequestBuilder<crate::model::DeleteFirewallEndpointAssociationRequest>,
6098 );
6099
6100 impl DeleteFirewallEndpointAssociation {
6101 pub(crate) fn new(
6102 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6103 ) -> Self {
6104 Self(RequestBuilder::new(stub))
6105 }
6106
6107 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointAssociationRequest>>(
6109 mut self,
6110 v: V,
6111 ) -> Self {
6112 self.0.request = v.into();
6113 self
6114 }
6115
6116 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6118 self.0.options = v.into();
6119 self
6120 }
6121
6122 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6129 (*self.0.stub)
6130 .delete_firewall_endpoint_association(self.0.request, self.0.options)
6131 .await
6132 .map(crate::Response::into_body)
6133 }
6134
6135 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6137 type Operation =
6138 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6139 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6140 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6141
6142 let stub = self.0.stub.clone();
6143 let mut options = self.0.options.clone();
6144 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6145 let query = move |name| {
6146 let stub = stub.clone();
6147 let options = options.clone();
6148 async {
6149 let op = GetOperation::new(stub)
6150 .set_name(name)
6151 .with_options(options)
6152 .send()
6153 .await?;
6154 Ok(Operation::new(op))
6155 }
6156 };
6157
6158 let start = move || async {
6159 let op = self.send().await?;
6160 Ok(Operation::new(op))
6161 };
6162
6163 google_cloud_lro::internal::new_unit_response_poller(
6164 polling_error_policy,
6165 polling_backoff_policy,
6166 start,
6167 query,
6168 )
6169 }
6170
6171 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6175 self.0.request.name = v.into();
6176 self
6177 }
6178
6179 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6181 self.0.request.request_id = v.into();
6182 self
6183 }
6184 }
6185
6186 #[doc(hidden)]
6187 impl crate::RequestBuilder for DeleteFirewallEndpointAssociation {
6188 fn request_options(&mut self) -> &mut crate::RequestOptions {
6189 &mut self.0.options
6190 }
6191 }
6192
6193 #[derive(Clone, Debug)]
6211 pub struct UpdateFirewallEndpointAssociation(
6212 RequestBuilder<crate::model::UpdateFirewallEndpointAssociationRequest>,
6213 );
6214
6215 impl UpdateFirewallEndpointAssociation {
6216 pub(crate) fn new(
6217 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6218 ) -> Self {
6219 Self(RequestBuilder::new(stub))
6220 }
6221
6222 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointAssociationRequest>>(
6224 mut self,
6225 v: V,
6226 ) -> Self {
6227 self.0.request = v.into();
6228 self
6229 }
6230
6231 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6233 self.0.options = v.into();
6234 self
6235 }
6236
6237 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6244 (*self.0.stub)
6245 .update_firewall_endpoint_association(self.0.request, self.0.options)
6246 .await
6247 .map(crate::Response::into_body)
6248 }
6249
6250 pub fn poller(
6252 self,
6253 ) -> impl google_cloud_lro::Poller<
6254 crate::model::FirewallEndpointAssociation,
6255 crate::model::OperationMetadata,
6256 > {
6257 type Operation = google_cloud_lro::internal::Operation<
6258 crate::model::FirewallEndpointAssociation,
6259 crate::model::OperationMetadata,
6260 >;
6261 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6262 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6263
6264 let stub = self.0.stub.clone();
6265 let mut options = self.0.options.clone();
6266 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6267 let query = move |name| {
6268 let stub = stub.clone();
6269 let options = options.clone();
6270 async {
6271 let op = GetOperation::new(stub)
6272 .set_name(name)
6273 .with_options(options)
6274 .send()
6275 .await?;
6276 Ok(Operation::new(op))
6277 }
6278 };
6279
6280 let start = move || async {
6281 let op = self.send().await?;
6282 Ok(Operation::new(op))
6283 };
6284
6285 google_cloud_lro::internal::new_poller(
6286 polling_error_policy,
6287 polling_backoff_policy,
6288 start,
6289 query,
6290 )
6291 }
6292
6293 pub fn set_update_mask<T>(mut self, v: T) -> Self
6297 where
6298 T: std::convert::Into<wkt::FieldMask>,
6299 {
6300 self.0.request.update_mask = std::option::Option::Some(v.into());
6301 self
6302 }
6303
6304 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6308 where
6309 T: std::convert::Into<wkt::FieldMask>,
6310 {
6311 self.0.request.update_mask = v.map(|x| x.into());
6312 self
6313 }
6314
6315 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6319 where
6320 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6321 {
6322 self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6323 self
6324 }
6325
6326 pub fn set_or_clear_firewall_endpoint_association<T>(
6330 mut self,
6331 v: std::option::Option<T>,
6332 ) -> Self
6333 where
6334 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6335 {
6336 self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6337 self
6338 }
6339
6340 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6342 self.0.request.request_id = v.into();
6343 self
6344 }
6345 }
6346
6347 #[doc(hidden)]
6348 impl crate::RequestBuilder for UpdateFirewallEndpointAssociation {
6349 fn request_options(&mut self) -> &mut crate::RequestOptions {
6350 &mut self.0.options
6351 }
6352 }
6353
6354 #[derive(Clone, Debug)]
6375 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6376
6377 impl ListLocations {
6378 pub(crate) fn new(
6379 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6380 ) -> Self {
6381 Self(RequestBuilder::new(stub))
6382 }
6383
6384 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6386 mut self,
6387 v: V,
6388 ) -> Self {
6389 self.0.request = v.into();
6390 self
6391 }
6392
6393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6395 self.0.options = v.into();
6396 self
6397 }
6398
6399 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6401 (*self.0.stub)
6402 .list_locations(self.0.request, self.0.options)
6403 .await
6404 .map(crate::Response::into_body)
6405 }
6406
6407 pub fn by_page(
6409 self,
6410 ) -> impl google_cloud_gax::paginator::Paginator<
6411 google_cloud_location::model::ListLocationsResponse,
6412 crate::Error,
6413 > {
6414 use std::clone::Clone;
6415 let token = self.0.request.page_token.clone();
6416 let execute = move |token: String| {
6417 let mut builder = self.clone();
6418 builder.0.request = builder.0.request.set_page_token(token);
6419 builder.send()
6420 };
6421 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6422 }
6423
6424 pub fn by_item(
6426 self,
6427 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6428 google_cloud_location::model::ListLocationsResponse,
6429 crate::Error,
6430 > {
6431 use google_cloud_gax::paginator::Paginator;
6432 self.by_page().items()
6433 }
6434
6435 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6437 self.0.request.name = v.into();
6438 self
6439 }
6440
6441 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6443 self.0.request.filter = v.into();
6444 self
6445 }
6446
6447 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6449 self.0.request.page_size = v.into();
6450 self
6451 }
6452
6453 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6455 self.0.request.page_token = v.into();
6456 self
6457 }
6458 }
6459
6460 #[doc(hidden)]
6461 impl crate::RequestBuilder for ListLocations {
6462 fn request_options(&mut self) -> &mut crate::RequestOptions {
6463 &mut self.0.options
6464 }
6465 }
6466
6467 #[derive(Clone, Debug)]
6484 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6485
6486 impl GetLocation {
6487 pub(crate) fn new(
6488 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6489 ) -> Self {
6490 Self(RequestBuilder::new(stub))
6491 }
6492
6493 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6495 mut self,
6496 v: V,
6497 ) -> Self {
6498 self.0.request = v.into();
6499 self
6500 }
6501
6502 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6504 self.0.options = v.into();
6505 self
6506 }
6507
6508 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6510 (*self.0.stub)
6511 .get_location(self.0.request, self.0.options)
6512 .await
6513 .map(crate::Response::into_body)
6514 }
6515
6516 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6518 self.0.request.name = v.into();
6519 self
6520 }
6521 }
6522
6523 #[doc(hidden)]
6524 impl crate::RequestBuilder for GetLocation {
6525 fn request_options(&mut self) -> &mut crate::RequestOptions {
6526 &mut self.0.options
6527 }
6528 }
6529
6530 #[derive(Clone, Debug)]
6547 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6548
6549 impl SetIamPolicy {
6550 pub(crate) fn new(
6551 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6552 ) -> Self {
6553 Self(RequestBuilder::new(stub))
6554 }
6555
6556 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6558 mut self,
6559 v: V,
6560 ) -> Self {
6561 self.0.request = v.into();
6562 self
6563 }
6564
6565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6567 self.0.options = v.into();
6568 self
6569 }
6570
6571 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6573 (*self.0.stub)
6574 .set_iam_policy(self.0.request, self.0.options)
6575 .await
6576 .map(crate::Response::into_body)
6577 }
6578
6579 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6583 self.0.request.resource = v.into();
6584 self
6585 }
6586
6587 pub fn set_policy<T>(mut self, v: T) -> Self
6591 where
6592 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6593 {
6594 self.0.request.policy = std::option::Option::Some(v.into());
6595 self
6596 }
6597
6598 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6602 where
6603 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6604 {
6605 self.0.request.policy = v.map(|x| x.into());
6606 self
6607 }
6608
6609 pub fn set_update_mask<T>(mut self, v: T) -> Self
6611 where
6612 T: std::convert::Into<wkt::FieldMask>,
6613 {
6614 self.0.request.update_mask = std::option::Option::Some(v.into());
6615 self
6616 }
6617
6618 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6620 where
6621 T: std::convert::Into<wkt::FieldMask>,
6622 {
6623 self.0.request.update_mask = v.map(|x| x.into());
6624 self
6625 }
6626 }
6627
6628 #[doc(hidden)]
6629 impl crate::RequestBuilder for SetIamPolicy {
6630 fn request_options(&mut self) -> &mut crate::RequestOptions {
6631 &mut self.0.options
6632 }
6633 }
6634
6635 #[derive(Clone, Debug)]
6652 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6653
6654 impl GetIamPolicy {
6655 pub(crate) fn new(
6656 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6657 ) -> Self {
6658 Self(RequestBuilder::new(stub))
6659 }
6660
6661 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6663 mut self,
6664 v: V,
6665 ) -> Self {
6666 self.0.request = v.into();
6667 self
6668 }
6669
6670 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6672 self.0.options = v.into();
6673 self
6674 }
6675
6676 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6678 (*self.0.stub)
6679 .get_iam_policy(self.0.request, self.0.options)
6680 .await
6681 .map(crate::Response::into_body)
6682 }
6683
6684 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6688 self.0.request.resource = v.into();
6689 self
6690 }
6691
6692 pub fn set_options<T>(mut self, v: T) -> Self
6694 where
6695 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6696 {
6697 self.0.request.options = std::option::Option::Some(v.into());
6698 self
6699 }
6700
6701 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6703 where
6704 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6705 {
6706 self.0.request.options = v.map(|x| x.into());
6707 self
6708 }
6709 }
6710
6711 #[doc(hidden)]
6712 impl crate::RequestBuilder for GetIamPolicy {
6713 fn request_options(&mut self) -> &mut crate::RequestOptions {
6714 &mut self.0.options
6715 }
6716 }
6717
6718 #[derive(Clone, Debug)]
6735 pub struct TestIamPermissions(
6736 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6737 );
6738
6739 impl TestIamPermissions {
6740 pub(crate) fn new(
6741 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6742 ) -> Self {
6743 Self(RequestBuilder::new(stub))
6744 }
6745
6746 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6748 mut self,
6749 v: V,
6750 ) -> Self {
6751 self.0.request = v.into();
6752 self
6753 }
6754
6755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6757 self.0.options = v.into();
6758 self
6759 }
6760
6761 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6763 (*self.0.stub)
6764 .test_iam_permissions(self.0.request, self.0.options)
6765 .await
6766 .map(crate::Response::into_body)
6767 }
6768
6769 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6773 self.0.request.resource = v.into();
6774 self
6775 }
6776
6777 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6781 where
6782 T: std::iter::IntoIterator<Item = V>,
6783 V: std::convert::Into<std::string::String>,
6784 {
6785 use std::iter::Iterator;
6786 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6787 self
6788 }
6789 }
6790
6791 #[doc(hidden)]
6792 impl crate::RequestBuilder for TestIamPermissions {
6793 fn request_options(&mut self) -> &mut crate::RequestOptions {
6794 &mut self.0.options
6795 }
6796 }
6797
6798 #[derive(Clone, Debug)]
6819 pub struct ListOperations(
6820 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6821 );
6822
6823 impl ListOperations {
6824 pub(crate) fn new(
6825 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6826 ) -> Self {
6827 Self(RequestBuilder::new(stub))
6828 }
6829
6830 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6832 mut self,
6833 v: V,
6834 ) -> Self {
6835 self.0.request = v.into();
6836 self
6837 }
6838
6839 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6841 self.0.options = v.into();
6842 self
6843 }
6844
6845 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6847 (*self.0.stub)
6848 .list_operations(self.0.request, self.0.options)
6849 .await
6850 .map(crate::Response::into_body)
6851 }
6852
6853 pub fn by_page(
6855 self,
6856 ) -> impl google_cloud_gax::paginator::Paginator<
6857 google_cloud_longrunning::model::ListOperationsResponse,
6858 crate::Error,
6859 > {
6860 use std::clone::Clone;
6861 let token = self.0.request.page_token.clone();
6862 let execute = move |token: String| {
6863 let mut builder = self.clone();
6864 builder.0.request = builder.0.request.set_page_token(token);
6865 builder.send()
6866 };
6867 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6868 }
6869
6870 pub fn by_item(
6872 self,
6873 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6874 google_cloud_longrunning::model::ListOperationsResponse,
6875 crate::Error,
6876 > {
6877 use google_cloud_gax::paginator::Paginator;
6878 self.by_page().items()
6879 }
6880
6881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6883 self.0.request.name = v.into();
6884 self
6885 }
6886
6887 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6889 self.0.request.filter = v.into();
6890 self
6891 }
6892
6893 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6895 self.0.request.page_size = v.into();
6896 self
6897 }
6898
6899 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6901 self.0.request.page_token = v.into();
6902 self
6903 }
6904
6905 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6907 self.0.request.return_partial_success = v.into();
6908 self
6909 }
6910 }
6911
6912 #[doc(hidden)]
6913 impl crate::RequestBuilder for ListOperations {
6914 fn request_options(&mut self) -> &mut crate::RequestOptions {
6915 &mut self.0.options
6916 }
6917 }
6918
6919 #[derive(Clone, Debug)]
6936 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6937
6938 impl GetOperation {
6939 pub(crate) fn new(
6940 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6941 ) -> Self {
6942 Self(RequestBuilder::new(stub))
6943 }
6944
6945 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6947 mut self,
6948 v: V,
6949 ) -> Self {
6950 self.0.request = v.into();
6951 self
6952 }
6953
6954 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6956 self.0.options = v.into();
6957 self
6958 }
6959
6960 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6962 (*self.0.stub)
6963 .get_operation(self.0.request, self.0.options)
6964 .await
6965 .map(crate::Response::into_body)
6966 }
6967
6968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6970 self.0.request.name = v.into();
6971 self
6972 }
6973 }
6974
6975 #[doc(hidden)]
6976 impl crate::RequestBuilder for GetOperation {
6977 fn request_options(&mut self) -> &mut crate::RequestOptions {
6978 &mut self.0.options
6979 }
6980 }
6981
6982 #[derive(Clone, Debug)]
6999 pub struct DeleteOperation(
7000 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7001 );
7002
7003 impl DeleteOperation {
7004 pub(crate) fn new(
7005 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7006 ) -> Self {
7007 Self(RequestBuilder::new(stub))
7008 }
7009
7010 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7012 mut self,
7013 v: V,
7014 ) -> Self {
7015 self.0.request = v.into();
7016 self
7017 }
7018
7019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7021 self.0.options = v.into();
7022 self
7023 }
7024
7025 pub async fn send(self) -> Result<()> {
7027 (*self.0.stub)
7028 .delete_operation(self.0.request, self.0.options)
7029 .await
7030 .map(crate::Response::into_body)
7031 }
7032
7033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7035 self.0.request.name = v.into();
7036 self
7037 }
7038 }
7039
7040 #[doc(hidden)]
7041 impl crate::RequestBuilder for DeleteOperation {
7042 fn request_options(&mut self) -> &mut crate::RequestOptions {
7043 &mut self.0.options
7044 }
7045 }
7046
7047 #[derive(Clone, Debug)]
7064 pub struct CancelOperation(
7065 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7066 );
7067
7068 impl CancelOperation {
7069 pub(crate) fn new(
7070 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7071 ) -> Self {
7072 Self(RequestBuilder::new(stub))
7073 }
7074
7075 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7077 mut self,
7078 v: V,
7079 ) -> Self {
7080 self.0.request = v.into();
7081 self
7082 }
7083
7084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7086 self.0.options = v.into();
7087 self
7088 }
7089
7090 pub async fn send(self) -> Result<()> {
7092 (*self.0.stub)
7093 .cancel_operation(self.0.request, self.0.options)
7094 .await
7095 .map(crate::Response::into_body)
7096 }
7097
7098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7100 self.0.request.name = v.into();
7101 self
7102 }
7103 }
7104
7105 #[doc(hidden)]
7106 impl crate::RequestBuilder for CancelOperation {
7107 fn request_options(&mut self) -> &mut crate::RequestOptions {
7108 &mut self.0.options
7109 }
7110 }
7111}
7112
7113pub mod intercept {
7114 use crate::Result;
7115
7116 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7130
7131 pub(crate) mod client {
7132 use super::super::super::client::Intercept;
7133 pub struct Factory;
7134 impl crate::ClientFactory for Factory {
7135 type Client = Intercept;
7136 type Credentials = gaxi::options::Credentials;
7137 async fn build(
7138 self,
7139 config: gaxi::options::ClientConfig,
7140 ) -> crate::ClientBuilderResult<Self::Client> {
7141 Self::Client::new(config).await
7142 }
7143 }
7144 }
7145
7146 #[derive(Clone, Debug)]
7148 pub(crate) struct RequestBuilder<R: std::default::Default> {
7149 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7150 request: R,
7151 options: crate::RequestOptions,
7152 }
7153
7154 impl<R> RequestBuilder<R>
7155 where
7156 R: std::default::Default,
7157 {
7158 pub(crate) fn new(
7159 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7160 ) -> Self {
7161 Self {
7162 stub,
7163 request: R::default(),
7164 options: crate::RequestOptions::default(),
7165 }
7166 }
7167 }
7168
7169 #[derive(Clone, Debug)]
7190 pub struct ListInterceptEndpointGroups(
7191 RequestBuilder<crate::model::ListInterceptEndpointGroupsRequest>,
7192 );
7193
7194 impl ListInterceptEndpointGroups {
7195 pub(crate) fn new(
7196 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7197 ) -> Self {
7198 Self(RequestBuilder::new(stub))
7199 }
7200
7201 pub fn with_request<V: Into<crate::model::ListInterceptEndpointGroupsRequest>>(
7203 mut self,
7204 v: V,
7205 ) -> Self {
7206 self.0.request = v.into();
7207 self
7208 }
7209
7210 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7212 self.0.options = v.into();
7213 self
7214 }
7215
7216 pub async fn send(self) -> Result<crate::model::ListInterceptEndpointGroupsResponse> {
7218 (*self.0.stub)
7219 .list_intercept_endpoint_groups(self.0.request, self.0.options)
7220 .await
7221 .map(crate::Response::into_body)
7222 }
7223
7224 pub fn by_page(
7226 self,
7227 ) -> impl google_cloud_gax::paginator::Paginator<
7228 crate::model::ListInterceptEndpointGroupsResponse,
7229 crate::Error,
7230 > {
7231 use std::clone::Clone;
7232 let token = self.0.request.page_token.clone();
7233 let execute = move |token: String| {
7234 let mut builder = self.clone();
7235 builder.0.request = builder.0.request.set_page_token(token);
7236 builder.send()
7237 };
7238 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7239 }
7240
7241 pub fn by_item(
7243 self,
7244 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7245 crate::model::ListInterceptEndpointGroupsResponse,
7246 crate::Error,
7247 > {
7248 use google_cloud_gax::paginator::Paginator;
7249 self.by_page().items()
7250 }
7251
7252 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7256 self.0.request.parent = v.into();
7257 self
7258 }
7259
7260 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7262 self.0.request.page_size = v.into();
7263 self
7264 }
7265
7266 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7268 self.0.request.page_token = v.into();
7269 self
7270 }
7271
7272 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7274 self.0.request.filter = v.into();
7275 self
7276 }
7277
7278 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7280 self.0.request.order_by = v.into();
7281 self
7282 }
7283 }
7284
7285 #[doc(hidden)]
7286 impl crate::RequestBuilder for ListInterceptEndpointGroups {
7287 fn request_options(&mut self) -> &mut crate::RequestOptions {
7288 &mut self.0.options
7289 }
7290 }
7291
7292 #[derive(Clone, Debug)]
7309 pub struct GetInterceptEndpointGroup(
7310 RequestBuilder<crate::model::GetInterceptEndpointGroupRequest>,
7311 );
7312
7313 impl GetInterceptEndpointGroup {
7314 pub(crate) fn new(
7315 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7316 ) -> Self {
7317 Self(RequestBuilder::new(stub))
7318 }
7319
7320 pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupRequest>>(
7322 mut self,
7323 v: V,
7324 ) -> Self {
7325 self.0.request = v.into();
7326 self
7327 }
7328
7329 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7331 self.0.options = v.into();
7332 self
7333 }
7334
7335 pub async fn send(self) -> Result<crate::model::InterceptEndpointGroup> {
7337 (*self.0.stub)
7338 .get_intercept_endpoint_group(self.0.request, self.0.options)
7339 .await
7340 .map(crate::Response::into_body)
7341 }
7342
7343 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7347 self.0.request.name = v.into();
7348 self
7349 }
7350 }
7351
7352 #[doc(hidden)]
7353 impl crate::RequestBuilder for GetInterceptEndpointGroup {
7354 fn request_options(&mut self) -> &mut crate::RequestOptions {
7355 &mut self.0.options
7356 }
7357 }
7358
7359 #[derive(Clone, Debug)]
7377 pub struct CreateInterceptEndpointGroup(
7378 RequestBuilder<crate::model::CreateInterceptEndpointGroupRequest>,
7379 );
7380
7381 impl CreateInterceptEndpointGroup {
7382 pub(crate) fn new(
7383 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7384 ) -> Self {
7385 Self(RequestBuilder::new(stub))
7386 }
7387
7388 pub fn with_request<V: Into<crate::model::CreateInterceptEndpointGroupRequest>>(
7390 mut self,
7391 v: V,
7392 ) -> Self {
7393 self.0.request = v.into();
7394 self
7395 }
7396
7397 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7399 self.0.options = v.into();
7400 self
7401 }
7402
7403 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7410 (*self.0.stub)
7411 .create_intercept_endpoint_group(self.0.request, self.0.options)
7412 .await
7413 .map(crate::Response::into_body)
7414 }
7415
7416 pub fn poller(
7418 self,
7419 ) -> impl google_cloud_lro::Poller<
7420 crate::model::InterceptEndpointGroup,
7421 crate::model::OperationMetadata,
7422 > {
7423 type Operation = google_cloud_lro::internal::Operation<
7424 crate::model::InterceptEndpointGroup,
7425 crate::model::OperationMetadata,
7426 >;
7427 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7428 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7429
7430 let stub = self.0.stub.clone();
7431 let mut options = self.0.options.clone();
7432 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7433 let query = move |name| {
7434 let stub = stub.clone();
7435 let options = options.clone();
7436 async {
7437 let op = GetOperation::new(stub)
7438 .set_name(name)
7439 .with_options(options)
7440 .send()
7441 .await?;
7442 Ok(Operation::new(op))
7443 }
7444 };
7445
7446 let start = move || async {
7447 let op = self.send().await?;
7448 Ok(Operation::new(op))
7449 };
7450
7451 google_cloud_lro::internal::new_poller(
7452 polling_error_policy,
7453 polling_backoff_policy,
7454 start,
7455 query,
7456 )
7457 }
7458
7459 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7463 self.0.request.parent = v.into();
7464 self
7465 }
7466
7467 pub fn set_intercept_endpoint_group_id<T: Into<std::string::String>>(
7471 mut self,
7472 v: T,
7473 ) -> Self {
7474 self.0.request.intercept_endpoint_group_id = v.into();
7475 self
7476 }
7477
7478 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
7482 where
7483 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7484 {
7485 self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
7486 self
7487 }
7488
7489 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
7493 where
7494 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7495 {
7496 self.0.request.intercept_endpoint_group = v.map(|x| x.into());
7497 self
7498 }
7499
7500 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7502 self.0.request.request_id = v.into();
7503 self
7504 }
7505 }
7506
7507 #[doc(hidden)]
7508 impl crate::RequestBuilder for CreateInterceptEndpointGroup {
7509 fn request_options(&mut self) -> &mut crate::RequestOptions {
7510 &mut self.0.options
7511 }
7512 }
7513
7514 #[derive(Clone, Debug)]
7532 pub struct UpdateInterceptEndpointGroup(
7533 RequestBuilder<crate::model::UpdateInterceptEndpointGroupRequest>,
7534 );
7535
7536 impl UpdateInterceptEndpointGroup {
7537 pub(crate) fn new(
7538 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7539 ) -> Self {
7540 Self(RequestBuilder::new(stub))
7541 }
7542
7543 pub fn with_request<V: Into<crate::model::UpdateInterceptEndpointGroupRequest>>(
7545 mut self,
7546 v: V,
7547 ) -> Self {
7548 self.0.request = v.into();
7549 self
7550 }
7551
7552 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7554 self.0.options = v.into();
7555 self
7556 }
7557
7558 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7565 (*self.0.stub)
7566 .update_intercept_endpoint_group(self.0.request, self.0.options)
7567 .await
7568 .map(crate::Response::into_body)
7569 }
7570
7571 pub fn poller(
7573 self,
7574 ) -> impl google_cloud_lro::Poller<
7575 crate::model::InterceptEndpointGroup,
7576 crate::model::OperationMetadata,
7577 > {
7578 type Operation = google_cloud_lro::internal::Operation<
7579 crate::model::InterceptEndpointGroup,
7580 crate::model::OperationMetadata,
7581 >;
7582 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7583 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7584
7585 let stub = self.0.stub.clone();
7586 let mut options = self.0.options.clone();
7587 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7588 let query = move |name| {
7589 let stub = stub.clone();
7590 let options = options.clone();
7591 async {
7592 let op = GetOperation::new(stub)
7593 .set_name(name)
7594 .with_options(options)
7595 .send()
7596 .await?;
7597 Ok(Operation::new(op))
7598 }
7599 };
7600
7601 let start = move || async {
7602 let op = self.send().await?;
7603 Ok(Operation::new(op))
7604 };
7605
7606 google_cloud_lro::internal::new_poller(
7607 polling_error_policy,
7608 polling_backoff_policy,
7609 start,
7610 query,
7611 )
7612 }
7613
7614 pub fn set_update_mask<T>(mut self, v: T) -> Self
7616 where
7617 T: std::convert::Into<wkt::FieldMask>,
7618 {
7619 self.0.request.update_mask = std::option::Option::Some(v.into());
7620 self
7621 }
7622
7623 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7625 where
7626 T: std::convert::Into<wkt::FieldMask>,
7627 {
7628 self.0.request.update_mask = v.map(|x| x.into());
7629 self
7630 }
7631
7632 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
7636 where
7637 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7638 {
7639 self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
7640 self
7641 }
7642
7643 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
7647 where
7648 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7649 {
7650 self.0.request.intercept_endpoint_group = v.map(|x| x.into());
7651 self
7652 }
7653
7654 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7656 self.0.request.request_id = v.into();
7657 self
7658 }
7659 }
7660
7661 #[doc(hidden)]
7662 impl crate::RequestBuilder for UpdateInterceptEndpointGroup {
7663 fn request_options(&mut self) -> &mut crate::RequestOptions {
7664 &mut self.0.options
7665 }
7666 }
7667
7668 #[derive(Clone, Debug)]
7686 pub struct DeleteInterceptEndpointGroup(
7687 RequestBuilder<crate::model::DeleteInterceptEndpointGroupRequest>,
7688 );
7689
7690 impl DeleteInterceptEndpointGroup {
7691 pub(crate) fn new(
7692 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7693 ) -> Self {
7694 Self(RequestBuilder::new(stub))
7695 }
7696
7697 pub fn with_request<V: Into<crate::model::DeleteInterceptEndpointGroupRequest>>(
7699 mut self,
7700 v: V,
7701 ) -> Self {
7702 self.0.request = v.into();
7703 self
7704 }
7705
7706 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7708 self.0.options = v.into();
7709 self
7710 }
7711
7712 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7719 (*self.0.stub)
7720 .delete_intercept_endpoint_group(self.0.request, self.0.options)
7721 .await
7722 .map(crate::Response::into_body)
7723 }
7724
7725 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7727 type Operation =
7728 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7729 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7730 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7731
7732 let stub = self.0.stub.clone();
7733 let mut options = self.0.options.clone();
7734 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7735 let query = move |name| {
7736 let stub = stub.clone();
7737 let options = options.clone();
7738 async {
7739 let op = GetOperation::new(stub)
7740 .set_name(name)
7741 .with_options(options)
7742 .send()
7743 .await?;
7744 Ok(Operation::new(op))
7745 }
7746 };
7747
7748 let start = move || async {
7749 let op = self.send().await?;
7750 Ok(Operation::new(op))
7751 };
7752
7753 google_cloud_lro::internal::new_unit_response_poller(
7754 polling_error_policy,
7755 polling_backoff_policy,
7756 start,
7757 query,
7758 )
7759 }
7760
7761 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7765 self.0.request.name = v.into();
7766 self
7767 }
7768
7769 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7771 self.0.request.request_id = v.into();
7772 self
7773 }
7774 }
7775
7776 #[doc(hidden)]
7777 impl crate::RequestBuilder for DeleteInterceptEndpointGroup {
7778 fn request_options(&mut self) -> &mut crate::RequestOptions {
7779 &mut self.0.options
7780 }
7781 }
7782
7783 #[derive(Clone, Debug)]
7804 pub struct ListInterceptEndpointGroupAssociations(
7805 RequestBuilder<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
7806 );
7807
7808 impl ListInterceptEndpointGroupAssociations {
7809 pub(crate) fn new(
7810 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7811 ) -> Self {
7812 Self(RequestBuilder::new(stub))
7813 }
7814
7815 pub fn with_request<
7817 V: Into<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
7818 >(
7819 mut self,
7820 v: V,
7821 ) -> Self {
7822 self.0.request = v.into();
7823 self
7824 }
7825
7826 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7828 self.0.options = v.into();
7829 self
7830 }
7831
7832 pub async fn send(
7834 self,
7835 ) -> Result<crate::model::ListInterceptEndpointGroupAssociationsResponse> {
7836 (*self.0.stub)
7837 .list_intercept_endpoint_group_associations(self.0.request, self.0.options)
7838 .await
7839 .map(crate::Response::into_body)
7840 }
7841
7842 pub fn by_page(
7844 self,
7845 ) -> impl google_cloud_gax::paginator::Paginator<
7846 crate::model::ListInterceptEndpointGroupAssociationsResponse,
7847 crate::Error,
7848 > {
7849 use std::clone::Clone;
7850 let token = self.0.request.page_token.clone();
7851 let execute = move |token: String| {
7852 let mut builder = self.clone();
7853 builder.0.request = builder.0.request.set_page_token(token);
7854 builder.send()
7855 };
7856 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7857 }
7858
7859 pub fn by_item(
7861 self,
7862 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7863 crate::model::ListInterceptEndpointGroupAssociationsResponse,
7864 crate::Error,
7865 > {
7866 use google_cloud_gax::paginator::Paginator;
7867 self.by_page().items()
7868 }
7869
7870 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7874 self.0.request.parent = v.into();
7875 self
7876 }
7877
7878 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7880 self.0.request.page_size = v.into();
7881 self
7882 }
7883
7884 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7886 self.0.request.page_token = v.into();
7887 self
7888 }
7889
7890 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7892 self.0.request.filter = v.into();
7893 self
7894 }
7895
7896 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7898 self.0.request.order_by = v.into();
7899 self
7900 }
7901 }
7902
7903 #[doc(hidden)]
7904 impl crate::RequestBuilder for ListInterceptEndpointGroupAssociations {
7905 fn request_options(&mut self) -> &mut crate::RequestOptions {
7906 &mut self.0.options
7907 }
7908 }
7909
7910 #[derive(Clone, Debug)]
7927 pub struct GetInterceptEndpointGroupAssociation(
7928 RequestBuilder<crate::model::GetInterceptEndpointGroupAssociationRequest>,
7929 );
7930
7931 impl GetInterceptEndpointGroupAssociation {
7932 pub(crate) fn new(
7933 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7934 ) -> Self {
7935 Self(RequestBuilder::new(stub))
7936 }
7937
7938 pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupAssociationRequest>>(
7940 mut self,
7941 v: V,
7942 ) -> Self {
7943 self.0.request = v.into();
7944 self
7945 }
7946
7947 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7949 self.0.options = v.into();
7950 self
7951 }
7952
7953 pub async fn send(self) -> Result<crate::model::InterceptEndpointGroupAssociation> {
7955 (*self.0.stub)
7956 .get_intercept_endpoint_group_association(self.0.request, self.0.options)
7957 .await
7958 .map(crate::Response::into_body)
7959 }
7960
7961 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7965 self.0.request.name = v.into();
7966 self
7967 }
7968 }
7969
7970 #[doc(hidden)]
7971 impl crate::RequestBuilder for GetInterceptEndpointGroupAssociation {
7972 fn request_options(&mut self) -> &mut crate::RequestOptions {
7973 &mut self.0.options
7974 }
7975 }
7976
7977 #[derive(Clone, Debug)]
7995 pub struct CreateInterceptEndpointGroupAssociation(
7996 RequestBuilder<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
7997 );
7998
7999 impl CreateInterceptEndpointGroupAssociation {
8000 pub(crate) fn new(
8001 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8002 ) -> Self {
8003 Self(RequestBuilder::new(stub))
8004 }
8005
8006 pub fn with_request<
8008 V: Into<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8009 >(
8010 mut self,
8011 v: V,
8012 ) -> Self {
8013 self.0.request = v.into();
8014 self
8015 }
8016
8017 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8019 self.0.options = v.into();
8020 self
8021 }
8022
8023 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8030 (*self.0.stub)
8031 .create_intercept_endpoint_group_association(self.0.request, self.0.options)
8032 .await
8033 .map(crate::Response::into_body)
8034 }
8035
8036 pub fn poller(
8038 self,
8039 ) -> impl google_cloud_lro::Poller<
8040 crate::model::InterceptEndpointGroupAssociation,
8041 crate::model::OperationMetadata,
8042 > {
8043 type Operation = google_cloud_lro::internal::Operation<
8044 crate::model::InterceptEndpointGroupAssociation,
8045 crate::model::OperationMetadata,
8046 >;
8047 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8048 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8049
8050 let stub = self.0.stub.clone();
8051 let mut options = self.0.options.clone();
8052 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8053 let query = move |name| {
8054 let stub = stub.clone();
8055 let options = options.clone();
8056 async {
8057 let op = GetOperation::new(stub)
8058 .set_name(name)
8059 .with_options(options)
8060 .send()
8061 .await?;
8062 Ok(Operation::new(op))
8063 }
8064 };
8065
8066 let start = move || async {
8067 let op = self.send().await?;
8068 Ok(Operation::new(op))
8069 };
8070
8071 google_cloud_lro::internal::new_poller(
8072 polling_error_policy,
8073 polling_backoff_policy,
8074 start,
8075 query,
8076 )
8077 }
8078
8079 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8083 self.0.request.parent = v.into();
8084 self
8085 }
8086
8087 pub fn set_intercept_endpoint_group_association_id<T: Into<std::string::String>>(
8089 mut self,
8090 v: T,
8091 ) -> Self {
8092 self.0.request.intercept_endpoint_group_association_id = v.into();
8093 self
8094 }
8095
8096 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8100 where
8101 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8102 {
8103 self.0.request.intercept_endpoint_group_association =
8104 std::option::Option::Some(v.into());
8105 self
8106 }
8107
8108 pub fn set_or_clear_intercept_endpoint_group_association<T>(
8112 mut self,
8113 v: std::option::Option<T>,
8114 ) -> Self
8115 where
8116 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8117 {
8118 self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8119 self
8120 }
8121
8122 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8124 self.0.request.request_id = v.into();
8125 self
8126 }
8127 }
8128
8129 #[doc(hidden)]
8130 impl crate::RequestBuilder for CreateInterceptEndpointGroupAssociation {
8131 fn request_options(&mut self) -> &mut crate::RequestOptions {
8132 &mut self.0.options
8133 }
8134 }
8135
8136 #[derive(Clone, Debug)]
8154 pub struct UpdateInterceptEndpointGroupAssociation(
8155 RequestBuilder<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8156 );
8157
8158 impl UpdateInterceptEndpointGroupAssociation {
8159 pub(crate) fn new(
8160 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8161 ) -> Self {
8162 Self(RequestBuilder::new(stub))
8163 }
8164
8165 pub fn with_request<
8167 V: Into<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8168 >(
8169 mut self,
8170 v: V,
8171 ) -> Self {
8172 self.0.request = v.into();
8173 self
8174 }
8175
8176 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8178 self.0.options = v.into();
8179 self
8180 }
8181
8182 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8189 (*self.0.stub)
8190 .update_intercept_endpoint_group_association(self.0.request, self.0.options)
8191 .await
8192 .map(crate::Response::into_body)
8193 }
8194
8195 pub fn poller(
8197 self,
8198 ) -> impl google_cloud_lro::Poller<
8199 crate::model::InterceptEndpointGroupAssociation,
8200 crate::model::OperationMetadata,
8201 > {
8202 type Operation = google_cloud_lro::internal::Operation<
8203 crate::model::InterceptEndpointGroupAssociation,
8204 crate::model::OperationMetadata,
8205 >;
8206 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8207 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8208
8209 let stub = self.0.stub.clone();
8210 let mut options = self.0.options.clone();
8211 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8212 let query = move |name| {
8213 let stub = stub.clone();
8214 let options = options.clone();
8215 async {
8216 let op = GetOperation::new(stub)
8217 .set_name(name)
8218 .with_options(options)
8219 .send()
8220 .await?;
8221 Ok(Operation::new(op))
8222 }
8223 };
8224
8225 let start = move || async {
8226 let op = self.send().await?;
8227 Ok(Operation::new(op))
8228 };
8229
8230 google_cloud_lro::internal::new_poller(
8231 polling_error_policy,
8232 polling_backoff_policy,
8233 start,
8234 query,
8235 )
8236 }
8237
8238 pub fn set_update_mask<T>(mut self, v: T) -> Self
8240 where
8241 T: std::convert::Into<wkt::FieldMask>,
8242 {
8243 self.0.request.update_mask = std::option::Option::Some(v.into());
8244 self
8245 }
8246
8247 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8249 where
8250 T: std::convert::Into<wkt::FieldMask>,
8251 {
8252 self.0.request.update_mask = v.map(|x| x.into());
8253 self
8254 }
8255
8256 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8260 where
8261 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8262 {
8263 self.0.request.intercept_endpoint_group_association =
8264 std::option::Option::Some(v.into());
8265 self
8266 }
8267
8268 pub fn set_or_clear_intercept_endpoint_group_association<T>(
8272 mut self,
8273 v: std::option::Option<T>,
8274 ) -> Self
8275 where
8276 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8277 {
8278 self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8279 self
8280 }
8281
8282 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8284 self.0.request.request_id = v.into();
8285 self
8286 }
8287 }
8288
8289 #[doc(hidden)]
8290 impl crate::RequestBuilder for UpdateInterceptEndpointGroupAssociation {
8291 fn request_options(&mut self) -> &mut crate::RequestOptions {
8292 &mut self.0.options
8293 }
8294 }
8295
8296 #[derive(Clone, Debug)]
8314 pub struct DeleteInterceptEndpointGroupAssociation(
8315 RequestBuilder<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8316 );
8317
8318 impl DeleteInterceptEndpointGroupAssociation {
8319 pub(crate) fn new(
8320 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8321 ) -> Self {
8322 Self(RequestBuilder::new(stub))
8323 }
8324
8325 pub fn with_request<
8327 V: Into<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8328 >(
8329 mut self,
8330 v: V,
8331 ) -> Self {
8332 self.0.request = v.into();
8333 self
8334 }
8335
8336 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8338 self.0.options = v.into();
8339 self
8340 }
8341
8342 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8349 (*self.0.stub)
8350 .delete_intercept_endpoint_group_association(self.0.request, self.0.options)
8351 .await
8352 .map(crate::Response::into_body)
8353 }
8354
8355 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8357 type Operation =
8358 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8359 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8360 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8361
8362 let stub = self.0.stub.clone();
8363 let mut options = self.0.options.clone();
8364 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8365 let query = move |name| {
8366 let stub = stub.clone();
8367 let options = options.clone();
8368 async {
8369 let op = GetOperation::new(stub)
8370 .set_name(name)
8371 .with_options(options)
8372 .send()
8373 .await?;
8374 Ok(Operation::new(op))
8375 }
8376 };
8377
8378 let start = move || async {
8379 let op = self.send().await?;
8380 Ok(Operation::new(op))
8381 };
8382
8383 google_cloud_lro::internal::new_unit_response_poller(
8384 polling_error_policy,
8385 polling_backoff_policy,
8386 start,
8387 query,
8388 )
8389 }
8390
8391 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8395 self.0.request.name = v.into();
8396 self
8397 }
8398
8399 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8401 self.0.request.request_id = v.into();
8402 self
8403 }
8404 }
8405
8406 #[doc(hidden)]
8407 impl crate::RequestBuilder for DeleteInterceptEndpointGroupAssociation {
8408 fn request_options(&mut self) -> &mut crate::RequestOptions {
8409 &mut self.0.options
8410 }
8411 }
8412
8413 #[derive(Clone, Debug)]
8434 pub struct ListInterceptDeploymentGroups(
8435 RequestBuilder<crate::model::ListInterceptDeploymentGroupsRequest>,
8436 );
8437
8438 impl ListInterceptDeploymentGroups {
8439 pub(crate) fn new(
8440 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8441 ) -> Self {
8442 Self(RequestBuilder::new(stub))
8443 }
8444
8445 pub fn with_request<V: Into<crate::model::ListInterceptDeploymentGroupsRequest>>(
8447 mut self,
8448 v: V,
8449 ) -> Self {
8450 self.0.request = v.into();
8451 self
8452 }
8453
8454 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8456 self.0.options = v.into();
8457 self
8458 }
8459
8460 pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentGroupsResponse> {
8462 (*self.0.stub)
8463 .list_intercept_deployment_groups(self.0.request, self.0.options)
8464 .await
8465 .map(crate::Response::into_body)
8466 }
8467
8468 pub fn by_page(
8470 self,
8471 ) -> impl google_cloud_gax::paginator::Paginator<
8472 crate::model::ListInterceptDeploymentGroupsResponse,
8473 crate::Error,
8474 > {
8475 use std::clone::Clone;
8476 let token = self.0.request.page_token.clone();
8477 let execute = move |token: String| {
8478 let mut builder = self.clone();
8479 builder.0.request = builder.0.request.set_page_token(token);
8480 builder.send()
8481 };
8482 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8483 }
8484
8485 pub fn by_item(
8487 self,
8488 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8489 crate::model::ListInterceptDeploymentGroupsResponse,
8490 crate::Error,
8491 > {
8492 use google_cloud_gax::paginator::Paginator;
8493 self.by_page().items()
8494 }
8495
8496 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8500 self.0.request.parent = v.into();
8501 self
8502 }
8503
8504 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8506 self.0.request.page_size = v.into();
8507 self
8508 }
8509
8510 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8512 self.0.request.page_token = v.into();
8513 self
8514 }
8515
8516 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8518 self.0.request.filter = v.into();
8519 self
8520 }
8521
8522 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8524 self.0.request.order_by = v.into();
8525 self
8526 }
8527 }
8528
8529 #[doc(hidden)]
8530 impl crate::RequestBuilder for ListInterceptDeploymentGroups {
8531 fn request_options(&mut self) -> &mut crate::RequestOptions {
8532 &mut self.0.options
8533 }
8534 }
8535
8536 #[derive(Clone, Debug)]
8553 pub struct GetInterceptDeploymentGroup(
8554 RequestBuilder<crate::model::GetInterceptDeploymentGroupRequest>,
8555 );
8556
8557 impl GetInterceptDeploymentGroup {
8558 pub(crate) fn new(
8559 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8560 ) -> Self {
8561 Self(RequestBuilder::new(stub))
8562 }
8563
8564 pub fn with_request<V: Into<crate::model::GetInterceptDeploymentGroupRequest>>(
8566 mut self,
8567 v: V,
8568 ) -> Self {
8569 self.0.request = v.into();
8570 self
8571 }
8572
8573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8575 self.0.options = v.into();
8576 self
8577 }
8578
8579 pub async fn send(self) -> Result<crate::model::InterceptDeploymentGroup> {
8581 (*self.0.stub)
8582 .get_intercept_deployment_group(self.0.request, self.0.options)
8583 .await
8584 .map(crate::Response::into_body)
8585 }
8586
8587 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8591 self.0.request.name = v.into();
8592 self
8593 }
8594 }
8595
8596 #[doc(hidden)]
8597 impl crate::RequestBuilder for GetInterceptDeploymentGroup {
8598 fn request_options(&mut self) -> &mut crate::RequestOptions {
8599 &mut self.0.options
8600 }
8601 }
8602
8603 #[derive(Clone, Debug)]
8621 pub struct CreateInterceptDeploymentGroup(
8622 RequestBuilder<crate::model::CreateInterceptDeploymentGroupRequest>,
8623 );
8624
8625 impl CreateInterceptDeploymentGroup {
8626 pub(crate) fn new(
8627 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8628 ) -> Self {
8629 Self(RequestBuilder::new(stub))
8630 }
8631
8632 pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentGroupRequest>>(
8634 mut self,
8635 v: V,
8636 ) -> Self {
8637 self.0.request = v.into();
8638 self
8639 }
8640
8641 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8643 self.0.options = v.into();
8644 self
8645 }
8646
8647 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8654 (*self.0.stub)
8655 .create_intercept_deployment_group(self.0.request, self.0.options)
8656 .await
8657 .map(crate::Response::into_body)
8658 }
8659
8660 pub fn poller(
8662 self,
8663 ) -> impl google_cloud_lro::Poller<
8664 crate::model::InterceptDeploymentGroup,
8665 crate::model::OperationMetadata,
8666 > {
8667 type Operation = google_cloud_lro::internal::Operation<
8668 crate::model::InterceptDeploymentGroup,
8669 crate::model::OperationMetadata,
8670 >;
8671 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8672 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8673
8674 let stub = self.0.stub.clone();
8675 let mut options = self.0.options.clone();
8676 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8677 let query = move |name| {
8678 let stub = stub.clone();
8679 let options = options.clone();
8680 async {
8681 let op = GetOperation::new(stub)
8682 .set_name(name)
8683 .with_options(options)
8684 .send()
8685 .await?;
8686 Ok(Operation::new(op))
8687 }
8688 };
8689
8690 let start = move || async {
8691 let op = self.send().await?;
8692 Ok(Operation::new(op))
8693 };
8694
8695 google_cloud_lro::internal::new_poller(
8696 polling_error_policy,
8697 polling_backoff_policy,
8698 start,
8699 query,
8700 )
8701 }
8702
8703 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8707 self.0.request.parent = v.into();
8708 self
8709 }
8710
8711 pub fn set_intercept_deployment_group_id<T: Into<std::string::String>>(
8715 mut self,
8716 v: T,
8717 ) -> Self {
8718 self.0.request.intercept_deployment_group_id = v.into();
8719 self
8720 }
8721
8722 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
8726 where
8727 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8728 {
8729 self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
8730 self
8731 }
8732
8733 pub fn set_or_clear_intercept_deployment_group<T>(
8737 mut self,
8738 v: std::option::Option<T>,
8739 ) -> Self
8740 where
8741 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8742 {
8743 self.0.request.intercept_deployment_group = v.map(|x| x.into());
8744 self
8745 }
8746
8747 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8749 self.0.request.request_id = v.into();
8750 self
8751 }
8752 }
8753
8754 #[doc(hidden)]
8755 impl crate::RequestBuilder for CreateInterceptDeploymentGroup {
8756 fn request_options(&mut self) -> &mut crate::RequestOptions {
8757 &mut self.0.options
8758 }
8759 }
8760
8761 #[derive(Clone, Debug)]
8779 pub struct UpdateInterceptDeploymentGroup(
8780 RequestBuilder<crate::model::UpdateInterceptDeploymentGroupRequest>,
8781 );
8782
8783 impl UpdateInterceptDeploymentGroup {
8784 pub(crate) fn new(
8785 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8786 ) -> Self {
8787 Self(RequestBuilder::new(stub))
8788 }
8789
8790 pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentGroupRequest>>(
8792 mut self,
8793 v: V,
8794 ) -> Self {
8795 self.0.request = v.into();
8796 self
8797 }
8798
8799 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8801 self.0.options = v.into();
8802 self
8803 }
8804
8805 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8812 (*self.0.stub)
8813 .update_intercept_deployment_group(self.0.request, self.0.options)
8814 .await
8815 .map(crate::Response::into_body)
8816 }
8817
8818 pub fn poller(
8820 self,
8821 ) -> impl google_cloud_lro::Poller<
8822 crate::model::InterceptDeploymentGroup,
8823 crate::model::OperationMetadata,
8824 > {
8825 type Operation = google_cloud_lro::internal::Operation<
8826 crate::model::InterceptDeploymentGroup,
8827 crate::model::OperationMetadata,
8828 >;
8829 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8830 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8831
8832 let stub = self.0.stub.clone();
8833 let mut options = self.0.options.clone();
8834 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8835 let query = move |name| {
8836 let stub = stub.clone();
8837 let options = options.clone();
8838 async {
8839 let op = GetOperation::new(stub)
8840 .set_name(name)
8841 .with_options(options)
8842 .send()
8843 .await?;
8844 Ok(Operation::new(op))
8845 }
8846 };
8847
8848 let start = move || async {
8849 let op = self.send().await?;
8850 Ok(Operation::new(op))
8851 };
8852
8853 google_cloud_lro::internal::new_poller(
8854 polling_error_policy,
8855 polling_backoff_policy,
8856 start,
8857 query,
8858 )
8859 }
8860
8861 pub fn set_update_mask<T>(mut self, v: T) -> Self
8863 where
8864 T: std::convert::Into<wkt::FieldMask>,
8865 {
8866 self.0.request.update_mask = std::option::Option::Some(v.into());
8867 self
8868 }
8869
8870 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8872 where
8873 T: std::convert::Into<wkt::FieldMask>,
8874 {
8875 self.0.request.update_mask = v.map(|x| x.into());
8876 self
8877 }
8878
8879 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
8883 where
8884 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8885 {
8886 self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
8887 self
8888 }
8889
8890 pub fn set_or_clear_intercept_deployment_group<T>(
8894 mut self,
8895 v: std::option::Option<T>,
8896 ) -> Self
8897 where
8898 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8899 {
8900 self.0.request.intercept_deployment_group = v.map(|x| x.into());
8901 self
8902 }
8903
8904 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8906 self.0.request.request_id = v.into();
8907 self
8908 }
8909 }
8910
8911 #[doc(hidden)]
8912 impl crate::RequestBuilder for UpdateInterceptDeploymentGroup {
8913 fn request_options(&mut self) -> &mut crate::RequestOptions {
8914 &mut self.0.options
8915 }
8916 }
8917
8918 #[derive(Clone, Debug)]
8936 pub struct DeleteInterceptDeploymentGroup(
8937 RequestBuilder<crate::model::DeleteInterceptDeploymentGroupRequest>,
8938 );
8939
8940 impl DeleteInterceptDeploymentGroup {
8941 pub(crate) fn new(
8942 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8943 ) -> Self {
8944 Self(RequestBuilder::new(stub))
8945 }
8946
8947 pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentGroupRequest>>(
8949 mut self,
8950 v: V,
8951 ) -> Self {
8952 self.0.request = v.into();
8953 self
8954 }
8955
8956 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8958 self.0.options = v.into();
8959 self
8960 }
8961
8962 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8969 (*self.0.stub)
8970 .delete_intercept_deployment_group(self.0.request, self.0.options)
8971 .await
8972 .map(crate::Response::into_body)
8973 }
8974
8975 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8977 type Operation =
8978 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8979 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8980 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8981
8982 let stub = self.0.stub.clone();
8983 let mut options = self.0.options.clone();
8984 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8985 let query = move |name| {
8986 let stub = stub.clone();
8987 let options = options.clone();
8988 async {
8989 let op = GetOperation::new(stub)
8990 .set_name(name)
8991 .with_options(options)
8992 .send()
8993 .await?;
8994 Ok(Operation::new(op))
8995 }
8996 };
8997
8998 let start = move || async {
8999 let op = self.send().await?;
9000 Ok(Operation::new(op))
9001 };
9002
9003 google_cloud_lro::internal::new_unit_response_poller(
9004 polling_error_policy,
9005 polling_backoff_policy,
9006 start,
9007 query,
9008 )
9009 }
9010
9011 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9015 self.0.request.name = v.into();
9016 self
9017 }
9018
9019 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9021 self.0.request.request_id = v.into();
9022 self
9023 }
9024 }
9025
9026 #[doc(hidden)]
9027 impl crate::RequestBuilder for DeleteInterceptDeploymentGroup {
9028 fn request_options(&mut self) -> &mut crate::RequestOptions {
9029 &mut self.0.options
9030 }
9031 }
9032
9033 #[derive(Clone, Debug)]
9054 pub struct ListInterceptDeployments(
9055 RequestBuilder<crate::model::ListInterceptDeploymentsRequest>,
9056 );
9057
9058 impl ListInterceptDeployments {
9059 pub(crate) fn new(
9060 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9061 ) -> Self {
9062 Self(RequestBuilder::new(stub))
9063 }
9064
9065 pub fn with_request<V: Into<crate::model::ListInterceptDeploymentsRequest>>(
9067 mut self,
9068 v: V,
9069 ) -> Self {
9070 self.0.request = v.into();
9071 self
9072 }
9073
9074 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9076 self.0.options = v.into();
9077 self
9078 }
9079
9080 pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentsResponse> {
9082 (*self.0.stub)
9083 .list_intercept_deployments(self.0.request, self.0.options)
9084 .await
9085 .map(crate::Response::into_body)
9086 }
9087
9088 pub fn by_page(
9090 self,
9091 ) -> impl google_cloud_gax::paginator::Paginator<
9092 crate::model::ListInterceptDeploymentsResponse,
9093 crate::Error,
9094 > {
9095 use std::clone::Clone;
9096 let token = self.0.request.page_token.clone();
9097 let execute = move |token: String| {
9098 let mut builder = self.clone();
9099 builder.0.request = builder.0.request.set_page_token(token);
9100 builder.send()
9101 };
9102 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9103 }
9104
9105 pub fn by_item(
9107 self,
9108 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9109 crate::model::ListInterceptDeploymentsResponse,
9110 crate::Error,
9111 > {
9112 use google_cloud_gax::paginator::Paginator;
9113 self.by_page().items()
9114 }
9115
9116 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9120 self.0.request.parent = v.into();
9121 self
9122 }
9123
9124 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9126 self.0.request.page_size = v.into();
9127 self
9128 }
9129
9130 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9132 self.0.request.page_token = v.into();
9133 self
9134 }
9135
9136 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9138 self.0.request.filter = v.into();
9139 self
9140 }
9141
9142 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9144 self.0.request.order_by = v.into();
9145 self
9146 }
9147 }
9148
9149 #[doc(hidden)]
9150 impl crate::RequestBuilder for ListInterceptDeployments {
9151 fn request_options(&mut self) -> &mut crate::RequestOptions {
9152 &mut self.0.options
9153 }
9154 }
9155
9156 #[derive(Clone, Debug)]
9173 pub struct GetInterceptDeployment(RequestBuilder<crate::model::GetInterceptDeploymentRequest>);
9174
9175 impl GetInterceptDeployment {
9176 pub(crate) fn new(
9177 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9178 ) -> Self {
9179 Self(RequestBuilder::new(stub))
9180 }
9181
9182 pub fn with_request<V: Into<crate::model::GetInterceptDeploymentRequest>>(
9184 mut self,
9185 v: V,
9186 ) -> Self {
9187 self.0.request = v.into();
9188 self
9189 }
9190
9191 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9193 self.0.options = v.into();
9194 self
9195 }
9196
9197 pub async fn send(self) -> Result<crate::model::InterceptDeployment> {
9199 (*self.0.stub)
9200 .get_intercept_deployment(self.0.request, self.0.options)
9201 .await
9202 .map(crate::Response::into_body)
9203 }
9204
9205 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9209 self.0.request.name = v.into();
9210 self
9211 }
9212 }
9213
9214 #[doc(hidden)]
9215 impl crate::RequestBuilder for GetInterceptDeployment {
9216 fn request_options(&mut self) -> &mut crate::RequestOptions {
9217 &mut self.0.options
9218 }
9219 }
9220
9221 #[derive(Clone, Debug)]
9239 pub struct CreateInterceptDeployment(
9240 RequestBuilder<crate::model::CreateInterceptDeploymentRequest>,
9241 );
9242
9243 impl CreateInterceptDeployment {
9244 pub(crate) fn new(
9245 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9246 ) -> Self {
9247 Self(RequestBuilder::new(stub))
9248 }
9249
9250 pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentRequest>>(
9252 mut self,
9253 v: V,
9254 ) -> Self {
9255 self.0.request = v.into();
9256 self
9257 }
9258
9259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9261 self.0.options = v.into();
9262 self
9263 }
9264
9265 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9272 (*self.0.stub)
9273 .create_intercept_deployment(self.0.request, self.0.options)
9274 .await
9275 .map(crate::Response::into_body)
9276 }
9277
9278 pub fn poller(
9280 self,
9281 ) -> impl google_cloud_lro::Poller<
9282 crate::model::InterceptDeployment,
9283 crate::model::OperationMetadata,
9284 > {
9285 type Operation = google_cloud_lro::internal::Operation<
9286 crate::model::InterceptDeployment,
9287 crate::model::OperationMetadata,
9288 >;
9289 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9290 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9291
9292 let stub = self.0.stub.clone();
9293 let mut options = self.0.options.clone();
9294 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9295 let query = move |name| {
9296 let stub = stub.clone();
9297 let options = options.clone();
9298 async {
9299 let op = GetOperation::new(stub)
9300 .set_name(name)
9301 .with_options(options)
9302 .send()
9303 .await?;
9304 Ok(Operation::new(op))
9305 }
9306 };
9307
9308 let start = move || async {
9309 let op = self.send().await?;
9310 Ok(Operation::new(op))
9311 };
9312
9313 google_cloud_lro::internal::new_poller(
9314 polling_error_policy,
9315 polling_backoff_policy,
9316 start,
9317 query,
9318 )
9319 }
9320
9321 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9325 self.0.request.parent = v.into();
9326 self
9327 }
9328
9329 pub fn set_intercept_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9333 self.0.request.intercept_deployment_id = v.into();
9334 self
9335 }
9336
9337 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9341 where
9342 T: std::convert::Into<crate::model::InterceptDeployment>,
9343 {
9344 self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9345 self
9346 }
9347
9348 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9352 where
9353 T: std::convert::Into<crate::model::InterceptDeployment>,
9354 {
9355 self.0.request.intercept_deployment = v.map(|x| x.into());
9356 self
9357 }
9358
9359 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9361 self.0.request.request_id = v.into();
9362 self
9363 }
9364 }
9365
9366 #[doc(hidden)]
9367 impl crate::RequestBuilder for CreateInterceptDeployment {
9368 fn request_options(&mut self) -> &mut crate::RequestOptions {
9369 &mut self.0.options
9370 }
9371 }
9372
9373 #[derive(Clone, Debug)]
9391 pub struct UpdateInterceptDeployment(
9392 RequestBuilder<crate::model::UpdateInterceptDeploymentRequest>,
9393 );
9394
9395 impl UpdateInterceptDeployment {
9396 pub(crate) fn new(
9397 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9398 ) -> Self {
9399 Self(RequestBuilder::new(stub))
9400 }
9401
9402 pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentRequest>>(
9404 mut self,
9405 v: V,
9406 ) -> Self {
9407 self.0.request = v.into();
9408 self
9409 }
9410
9411 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9413 self.0.options = v.into();
9414 self
9415 }
9416
9417 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9424 (*self.0.stub)
9425 .update_intercept_deployment(self.0.request, self.0.options)
9426 .await
9427 .map(crate::Response::into_body)
9428 }
9429
9430 pub fn poller(
9432 self,
9433 ) -> impl google_cloud_lro::Poller<
9434 crate::model::InterceptDeployment,
9435 crate::model::OperationMetadata,
9436 > {
9437 type Operation = google_cloud_lro::internal::Operation<
9438 crate::model::InterceptDeployment,
9439 crate::model::OperationMetadata,
9440 >;
9441 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9442 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9443
9444 let stub = self.0.stub.clone();
9445 let mut options = self.0.options.clone();
9446 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9447 let query = move |name| {
9448 let stub = stub.clone();
9449 let options = options.clone();
9450 async {
9451 let op = GetOperation::new(stub)
9452 .set_name(name)
9453 .with_options(options)
9454 .send()
9455 .await?;
9456 Ok(Operation::new(op))
9457 }
9458 };
9459
9460 let start = move || async {
9461 let op = self.send().await?;
9462 Ok(Operation::new(op))
9463 };
9464
9465 google_cloud_lro::internal::new_poller(
9466 polling_error_policy,
9467 polling_backoff_policy,
9468 start,
9469 query,
9470 )
9471 }
9472
9473 pub fn set_update_mask<T>(mut self, v: T) -> Self
9475 where
9476 T: std::convert::Into<wkt::FieldMask>,
9477 {
9478 self.0.request.update_mask = std::option::Option::Some(v.into());
9479 self
9480 }
9481
9482 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9484 where
9485 T: std::convert::Into<wkt::FieldMask>,
9486 {
9487 self.0.request.update_mask = v.map(|x| x.into());
9488 self
9489 }
9490
9491 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9495 where
9496 T: std::convert::Into<crate::model::InterceptDeployment>,
9497 {
9498 self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9499 self
9500 }
9501
9502 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9506 where
9507 T: std::convert::Into<crate::model::InterceptDeployment>,
9508 {
9509 self.0.request.intercept_deployment = v.map(|x| x.into());
9510 self
9511 }
9512
9513 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9515 self.0.request.request_id = v.into();
9516 self
9517 }
9518 }
9519
9520 #[doc(hidden)]
9521 impl crate::RequestBuilder for UpdateInterceptDeployment {
9522 fn request_options(&mut self) -> &mut crate::RequestOptions {
9523 &mut self.0.options
9524 }
9525 }
9526
9527 #[derive(Clone, Debug)]
9545 pub struct DeleteInterceptDeployment(
9546 RequestBuilder<crate::model::DeleteInterceptDeploymentRequest>,
9547 );
9548
9549 impl DeleteInterceptDeployment {
9550 pub(crate) fn new(
9551 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9552 ) -> Self {
9553 Self(RequestBuilder::new(stub))
9554 }
9555
9556 pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentRequest>>(
9558 mut self,
9559 v: V,
9560 ) -> Self {
9561 self.0.request = v.into();
9562 self
9563 }
9564
9565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9567 self.0.options = v.into();
9568 self
9569 }
9570
9571 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9578 (*self.0.stub)
9579 .delete_intercept_deployment(self.0.request, self.0.options)
9580 .await
9581 .map(crate::Response::into_body)
9582 }
9583
9584 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9586 type Operation =
9587 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9588 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9589 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9590
9591 let stub = self.0.stub.clone();
9592 let mut options = self.0.options.clone();
9593 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9594 let query = move |name| {
9595 let stub = stub.clone();
9596 let options = options.clone();
9597 async {
9598 let op = GetOperation::new(stub)
9599 .set_name(name)
9600 .with_options(options)
9601 .send()
9602 .await?;
9603 Ok(Operation::new(op))
9604 }
9605 };
9606
9607 let start = move || async {
9608 let op = self.send().await?;
9609 Ok(Operation::new(op))
9610 };
9611
9612 google_cloud_lro::internal::new_unit_response_poller(
9613 polling_error_policy,
9614 polling_backoff_policy,
9615 start,
9616 query,
9617 )
9618 }
9619
9620 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9624 self.0.request.name = v.into();
9625 self
9626 }
9627
9628 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9630 self.0.request.request_id = v.into();
9631 self
9632 }
9633 }
9634
9635 #[doc(hidden)]
9636 impl crate::RequestBuilder for DeleteInterceptDeployment {
9637 fn request_options(&mut self) -> &mut crate::RequestOptions {
9638 &mut self.0.options
9639 }
9640 }
9641
9642 #[derive(Clone, Debug)]
9663 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9664
9665 impl ListLocations {
9666 pub(crate) fn new(
9667 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9668 ) -> Self {
9669 Self(RequestBuilder::new(stub))
9670 }
9671
9672 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9674 mut self,
9675 v: V,
9676 ) -> Self {
9677 self.0.request = v.into();
9678 self
9679 }
9680
9681 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9683 self.0.options = v.into();
9684 self
9685 }
9686
9687 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9689 (*self.0.stub)
9690 .list_locations(self.0.request, self.0.options)
9691 .await
9692 .map(crate::Response::into_body)
9693 }
9694
9695 pub fn by_page(
9697 self,
9698 ) -> impl google_cloud_gax::paginator::Paginator<
9699 google_cloud_location::model::ListLocationsResponse,
9700 crate::Error,
9701 > {
9702 use std::clone::Clone;
9703 let token = self.0.request.page_token.clone();
9704 let execute = move |token: String| {
9705 let mut builder = self.clone();
9706 builder.0.request = builder.0.request.set_page_token(token);
9707 builder.send()
9708 };
9709 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9710 }
9711
9712 pub fn by_item(
9714 self,
9715 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9716 google_cloud_location::model::ListLocationsResponse,
9717 crate::Error,
9718 > {
9719 use google_cloud_gax::paginator::Paginator;
9720 self.by_page().items()
9721 }
9722
9723 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9725 self.0.request.name = v.into();
9726 self
9727 }
9728
9729 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9731 self.0.request.filter = v.into();
9732 self
9733 }
9734
9735 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9737 self.0.request.page_size = v.into();
9738 self
9739 }
9740
9741 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9743 self.0.request.page_token = v.into();
9744 self
9745 }
9746 }
9747
9748 #[doc(hidden)]
9749 impl crate::RequestBuilder for ListLocations {
9750 fn request_options(&mut self) -> &mut crate::RequestOptions {
9751 &mut self.0.options
9752 }
9753 }
9754
9755 #[derive(Clone, Debug)]
9772 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9773
9774 impl GetLocation {
9775 pub(crate) fn new(
9776 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9777 ) -> Self {
9778 Self(RequestBuilder::new(stub))
9779 }
9780
9781 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9783 mut self,
9784 v: V,
9785 ) -> Self {
9786 self.0.request = v.into();
9787 self
9788 }
9789
9790 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9792 self.0.options = v.into();
9793 self
9794 }
9795
9796 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9798 (*self.0.stub)
9799 .get_location(self.0.request, self.0.options)
9800 .await
9801 .map(crate::Response::into_body)
9802 }
9803
9804 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9806 self.0.request.name = v.into();
9807 self
9808 }
9809 }
9810
9811 #[doc(hidden)]
9812 impl crate::RequestBuilder for GetLocation {
9813 fn request_options(&mut self) -> &mut crate::RequestOptions {
9814 &mut self.0.options
9815 }
9816 }
9817
9818 #[derive(Clone, Debug)]
9835 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9836
9837 impl SetIamPolicy {
9838 pub(crate) fn new(
9839 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9840 ) -> Self {
9841 Self(RequestBuilder::new(stub))
9842 }
9843
9844 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9846 mut self,
9847 v: V,
9848 ) -> Self {
9849 self.0.request = v.into();
9850 self
9851 }
9852
9853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9855 self.0.options = v.into();
9856 self
9857 }
9858
9859 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9861 (*self.0.stub)
9862 .set_iam_policy(self.0.request, self.0.options)
9863 .await
9864 .map(crate::Response::into_body)
9865 }
9866
9867 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9871 self.0.request.resource = v.into();
9872 self
9873 }
9874
9875 pub fn set_policy<T>(mut self, v: T) -> Self
9879 where
9880 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9881 {
9882 self.0.request.policy = std::option::Option::Some(v.into());
9883 self
9884 }
9885
9886 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9890 where
9891 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9892 {
9893 self.0.request.policy = v.map(|x| x.into());
9894 self
9895 }
9896
9897 pub fn set_update_mask<T>(mut self, v: T) -> Self
9899 where
9900 T: std::convert::Into<wkt::FieldMask>,
9901 {
9902 self.0.request.update_mask = std::option::Option::Some(v.into());
9903 self
9904 }
9905
9906 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9908 where
9909 T: std::convert::Into<wkt::FieldMask>,
9910 {
9911 self.0.request.update_mask = v.map(|x| x.into());
9912 self
9913 }
9914 }
9915
9916 #[doc(hidden)]
9917 impl crate::RequestBuilder for SetIamPolicy {
9918 fn request_options(&mut self) -> &mut crate::RequestOptions {
9919 &mut self.0.options
9920 }
9921 }
9922
9923 #[derive(Clone, Debug)]
9940 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9941
9942 impl GetIamPolicy {
9943 pub(crate) fn new(
9944 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9945 ) -> Self {
9946 Self(RequestBuilder::new(stub))
9947 }
9948
9949 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9951 mut self,
9952 v: V,
9953 ) -> Self {
9954 self.0.request = v.into();
9955 self
9956 }
9957
9958 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9960 self.0.options = v.into();
9961 self
9962 }
9963
9964 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9966 (*self.0.stub)
9967 .get_iam_policy(self.0.request, self.0.options)
9968 .await
9969 .map(crate::Response::into_body)
9970 }
9971
9972 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9976 self.0.request.resource = v.into();
9977 self
9978 }
9979
9980 pub fn set_options<T>(mut self, v: T) -> Self
9982 where
9983 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9984 {
9985 self.0.request.options = std::option::Option::Some(v.into());
9986 self
9987 }
9988
9989 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9991 where
9992 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9993 {
9994 self.0.request.options = v.map(|x| x.into());
9995 self
9996 }
9997 }
9998
9999 #[doc(hidden)]
10000 impl crate::RequestBuilder for GetIamPolicy {
10001 fn request_options(&mut self) -> &mut crate::RequestOptions {
10002 &mut self.0.options
10003 }
10004 }
10005
10006 #[derive(Clone, Debug)]
10023 pub struct TestIamPermissions(
10024 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10025 );
10026
10027 impl TestIamPermissions {
10028 pub(crate) fn new(
10029 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10030 ) -> Self {
10031 Self(RequestBuilder::new(stub))
10032 }
10033
10034 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10036 mut self,
10037 v: V,
10038 ) -> Self {
10039 self.0.request = v.into();
10040 self
10041 }
10042
10043 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10045 self.0.options = v.into();
10046 self
10047 }
10048
10049 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10051 (*self.0.stub)
10052 .test_iam_permissions(self.0.request, self.0.options)
10053 .await
10054 .map(crate::Response::into_body)
10055 }
10056
10057 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10061 self.0.request.resource = v.into();
10062 self
10063 }
10064
10065 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10069 where
10070 T: std::iter::IntoIterator<Item = V>,
10071 V: std::convert::Into<std::string::String>,
10072 {
10073 use std::iter::Iterator;
10074 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10075 self
10076 }
10077 }
10078
10079 #[doc(hidden)]
10080 impl crate::RequestBuilder for TestIamPermissions {
10081 fn request_options(&mut self) -> &mut crate::RequestOptions {
10082 &mut self.0.options
10083 }
10084 }
10085
10086 #[derive(Clone, Debug)]
10107 pub struct ListOperations(
10108 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10109 );
10110
10111 impl ListOperations {
10112 pub(crate) fn new(
10113 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10114 ) -> Self {
10115 Self(RequestBuilder::new(stub))
10116 }
10117
10118 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10120 mut self,
10121 v: V,
10122 ) -> Self {
10123 self.0.request = v.into();
10124 self
10125 }
10126
10127 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10129 self.0.options = v.into();
10130 self
10131 }
10132
10133 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10135 (*self.0.stub)
10136 .list_operations(self.0.request, self.0.options)
10137 .await
10138 .map(crate::Response::into_body)
10139 }
10140
10141 pub fn by_page(
10143 self,
10144 ) -> impl google_cloud_gax::paginator::Paginator<
10145 google_cloud_longrunning::model::ListOperationsResponse,
10146 crate::Error,
10147 > {
10148 use std::clone::Clone;
10149 let token = self.0.request.page_token.clone();
10150 let execute = move |token: String| {
10151 let mut builder = self.clone();
10152 builder.0.request = builder.0.request.set_page_token(token);
10153 builder.send()
10154 };
10155 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10156 }
10157
10158 pub fn by_item(
10160 self,
10161 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10162 google_cloud_longrunning::model::ListOperationsResponse,
10163 crate::Error,
10164 > {
10165 use google_cloud_gax::paginator::Paginator;
10166 self.by_page().items()
10167 }
10168
10169 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10171 self.0.request.name = v.into();
10172 self
10173 }
10174
10175 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10177 self.0.request.filter = v.into();
10178 self
10179 }
10180
10181 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10183 self.0.request.page_size = v.into();
10184 self
10185 }
10186
10187 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10189 self.0.request.page_token = v.into();
10190 self
10191 }
10192
10193 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10195 self.0.request.return_partial_success = v.into();
10196 self
10197 }
10198 }
10199
10200 #[doc(hidden)]
10201 impl crate::RequestBuilder for ListOperations {
10202 fn request_options(&mut self) -> &mut crate::RequestOptions {
10203 &mut self.0.options
10204 }
10205 }
10206
10207 #[derive(Clone, Debug)]
10224 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10225
10226 impl GetOperation {
10227 pub(crate) fn new(
10228 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10229 ) -> Self {
10230 Self(RequestBuilder::new(stub))
10231 }
10232
10233 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10235 mut self,
10236 v: V,
10237 ) -> Self {
10238 self.0.request = v.into();
10239 self
10240 }
10241
10242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10244 self.0.options = v.into();
10245 self
10246 }
10247
10248 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10250 (*self.0.stub)
10251 .get_operation(self.0.request, self.0.options)
10252 .await
10253 .map(crate::Response::into_body)
10254 }
10255
10256 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10258 self.0.request.name = v.into();
10259 self
10260 }
10261 }
10262
10263 #[doc(hidden)]
10264 impl crate::RequestBuilder for GetOperation {
10265 fn request_options(&mut self) -> &mut crate::RequestOptions {
10266 &mut self.0.options
10267 }
10268 }
10269
10270 #[derive(Clone, Debug)]
10287 pub struct DeleteOperation(
10288 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10289 );
10290
10291 impl DeleteOperation {
10292 pub(crate) fn new(
10293 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10294 ) -> Self {
10295 Self(RequestBuilder::new(stub))
10296 }
10297
10298 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10300 mut self,
10301 v: V,
10302 ) -> Self {
10303 self.0.request = v.into();
10304 self
10305 }
10306
10307 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10309 self.0.options = v.into();
10310 self
10311 }
10312
10313 pub async fn send(self) -> Result<()> {
10315 (*self.0.stub)
10316 .delete_operation(self.0.request, self.0.options)
10317 .await
10318 .map(crate::Response::into_body)
10319 }
10320
10321 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10323 self.0.request.name = v.into();
10324 self
10325 }
10326 }
10327
10328 #[doc(hidden)]
10329 impl crate::RequestBuilder for DeleteOperation {
10330 fn request_options(&mut self) -> &mut crate::RequestOptions {
10331 &mut self.0.options
10332 }
10333 }
10334
10335 #[derive(Clone, Debug)]
10352 pub struct CancelOperation(
10353 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10354 );
10355
10356 impl CancelOperation {
10357 pub(crate) fn new(
10358 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10359 ) -> Self {
10360 Self(RequestBuilder::new(stub))
10361 }
10362
10363 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10365 mut self,
10366 v: V,
10367 ) -> Self {
10368 self.0.request = v.into();
10369 self
10370 }
10371
10372 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10374 self.0.options = v.into();
10375 self
10376 }
10377
10378 pub async fn send(self) -> Result<()> {
10380 (*self.0.stub)
10381 .cancel_operation(self.0.request, self.0.options)
10382 .await
10383 .map(crate::Response::into_body)
10384 }
10385
10386 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10388 self.0.request.name = v.into();
10389 self
10390 }
10391 }
10392
10393 #[doc(hidden)]
10394 impl crate::RequestBuilder for CancelOperation {
10395 fn request_options(&mut self) -> &mut crate::RequestOptions {
10396 &mut self.0.options
10397 }
10398 }
10399}
10400
10401pub mod mirroring {
10402 use crate::Result;
10403
10404 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10418
10419 pub(crate) mod client {
10420 use super::super::super::client::Mirroring;
10421 pub struct Factory;
10422 impl crate::ClientFactory for Factory {
10423 type Client = Mirroring;
10424 type Credentials = gaxi::options::Credentials;
10425 async fn build(
10426 self,
10427 config: gaxi::options::ClientConfig,
10428 ) -> crate::ClientBuilderResult<Self::Client> {
10429 Self::Client::new(config).await
10430 }
10431 }
10432 }
10433
10434 #[derive(Clone, Debug)]
10436 pub(crate) struct RequestBuilder<R: std::default::Default> {
10437 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10438 request: R,
10439 options: crate::RequestOptions,
10440 }
10441
10442 impl<R> RequestBuilder<R>
10443 where
10444 R: std::default::Default,
10445 {
10446 pub(crate) fn new(
10447 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10448 ) -> Self {
10449 Self {
10450 stub,
10451 request: R::default(),
10452 options: crate::RequestOptions::default(),
10453 }
10454 }
10455 }
10456
10457 #[derive(Clone, Debug)]
10478 pub struct ListMirroringEndpointGroups(
10479 RequestBuilder<crate::model::ListMirroringEndpointGroupsRequest>,
10480 );
10481
10482 impl ListMirroringEndpointGroups {
10483 pub(crate) fn new(
10484 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10485 ) -> Self {
10486 Self(RequestBuilder::new(stub))
10487 }
10488
10489 pub fn with_request<V: Into<crate::model::ListMirroringEndpointGroupsRequest>>(
10491 mut self,
10492 v: V,
10493 ) -> Self {
10494 self.0.request = v.into();
10495 self
10496 }
10497
10498 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10500 self.0.options = v.into();
10501 self
10502 }
10503
10504 pub async fn send(self) -> Result<crate::model::ListMirroringEndpointGroupsResponse> {
10506 (*self.0.stub)
10507 .list_mirroring_endpoint_groups(self.0.request, self.0.options)
10508 .await
10509 .map(crate::Response::into_body)
10510 }
10511
10512 pub fn by_page(
10514 self,
10515 ) -> impl google_cloud_gax::paginator::Paginator<
10516 crate::model::ListMirroringEndpointGroupsResponse,
10517 crate::Error,
10518 > {
10519 use std::clone::Clone;
10520 let token = self.0.request.page_token.clone();
10521 let execute = move |token: String| {
10522 let mut builder = self.clone();
10523 builder.0.request = builder.0.request.set_page_token(token);
10524 builder.send()
10525 };
10526 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10527 }
10528
10529 pub fn by_item(
10531 self,
10532 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10533 crate::model::ListMirroringEndpointGroupsResponse,
10534 crate::Error,
10535 > {
10536 use google_cloud_gax::paginator::Paginator;
10537 self.by_page().items()
10538 }
10539
10540 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10544 self.0.request.parent = v.into();
10545 self
10546 }
10547
10548 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10550 self.0.request.page_size = v.into();
10551 self
10552 }
10553
10554 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10556 self.0.request.page_token = v.into();
10557 self
10558 }
10559
10560 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10562 self.0.request.filter = v.into();
10563 self
10564 }
10565
10566 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10568 self.0.request.order_by = v.into();
10569 self
10570 }
10571 }
10572
10573 #[doc(hidden)]
10574 impl crate::RequestBuilder for ListMirroringEndpointGroups {
10575 fn request_options(&mut self) -> &mut crate::RequestOptions {
10576 &mut self.0.options
10577 }
10578 }
10579
10580 #[derive(Clone, Debug)]
10597 pub struct GetMirroringEndpointGroup(
10598 RequestBuilder<crate::model::GetMirroringEndpointGroupRequest>,
10599 );
10600
10601 impl GetMirroringEndpointGroup {
10602 pub(crate) fn new(
10603 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10604 ) -> Self {
10605 Self(RequestBuilder::new(stub))
10606 }
10607
10608 pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupRequest>>(
10610 mut self,
10611 v: V,
10612 ) -> Self {
10613 self.0.request = v.into();
10614 self
10615 }
10616
10617 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10619 self.0.options = v.into();
10620 self
10621 }
10622
10623 pub async fn send(self) -> Result<crate::model::MirroringEndpointGroup> {
10625 (*self.0.stub)
10626 .get_mirroring_endpoint_group(self.0.request, self.0.options)
10627 .await
10628 .map(crate::Response::into_body)
10629 }
10630
10631 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10635 self.0.request.name = v.into();
10636 self
10637 }
10638 }
10639
10640 #[doc(hidden)]
10641 impl crate::RequestBuilder for GetMirroringEndpointGroup {
10642 fn request_options(&mut self) -> &mut crate::RequestOptions {
10643 &mut self.0.options
10644 }
10645 }
10646
10647 #[derive(Clone, Debug)]
10665 pub struct CreateMirroringEndpointGroup(
10666 RequestBuilder<crate::model::CreateMirroringEndpointGroupRequest>,
10667 );
10668
10669 impl CreateMirroringEndpointGroup {
10670 pub(crate) fn new(
10671 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10672 ) -> Self {
10673 Self(RequestBuilder::new(stub))
10674 }
10675
10676 pub fn with_request<V: Into<crate::model::CreateMirroringEndpointGroupRequest>>(
10678 mut self,
10679 v: V,
10680 ) -> Self {
10681 self.0.request = v.into();
10682 self
10683 }
10684
10685 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10687 self.0.options = v.into();
10688 self
10689 }
10690
10691 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10698 (*self.0.stub)
10699 .create_mirroring_endpoint_group(self.0.request, self.0.options)
10700 .await
10701 .map(crate::Response::into_body)
10702 }
10703
10704 pub fn poller(
10706 self,
10707 ) -> impl google_cloud_lro::Poller<
10708 crate::model::MirroringEndpointGroup,
10709 crate::model::OperationMetadata,
10710 > {
10711 type Operation = google_cloud_lro::internal::Operation<
10712 crate::model::MirroringEndpointGroup,
10713 crate::model::OperationMetadata,
10714 >;
10715 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10716 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10717
10718 let stub = self.0.stub.clone();
10719 let mut options = self.0.options.clone();
10720 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10721 let query = move |name| {
10722 let stub = stub.clone();
10723 let options = options.clone();
10724 async {
10725 let op = GetOperation::new(stub)
10726 .set_name(name)
10727 .with_options(options)
10728 .send()
10729 .await?;
10730 Ok(Operation::new(op))
10731 }
10732 };
10733
10734 let start = move || async {
10735 let op = self.send().await?;
10736 Ok(Operation::new(op))
10737 };
10738
10739 google_cloud_lro::internal::new_poller(
10740 polling_error_policy,
10741 polling_backoff_policy,
10742 start,
10743 query,
10744 )
10745 }
10746
10747 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10751 self.0.request.parent = v.into();
10752 self
10753 }
10754
10755 pub fn set_mirroring_endpoint_group_id<T: Into<std::string::String>>(
10759 mut self,
10760 v: T,
10761 ) -> Self {
10762 self.0.request.mirroring_endpoint_group_id = v.into();
10763 self
10764 }
10765
10766 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
10770 where
10771 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10772 {
10773 self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
10774 self
10775 }
10776
10777 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
10781 where
10782 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10783 {
10784 self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
10785 self
10786 }
10787
10788 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10790 self.0.request.request_id = v.into();
10791 self
10792 }
10793 }
10794
10795 #[doc(hidden)]
10796 impl crate::RequestBuilder for CreateMirroringEndpointGroup {
10797 fn request_options(&mut self) -> &mut crate::RequestOptions {
10798 &mut self.0.options
10799 }
10800 }
10801
10802 #[derive(Clone, Debug)]
10820 pub struct UpdateMirroringEndpointGroup(
10821 RequestBuilder<crate::model::UpdateMirroringEndpointGroupRequest>,
10822 );
10823
10824 impl UpdateMirroringEndpointGroup {
10825 pub(crate) fn new(
10826 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10827 ) -> Self {
10828 Self(RequestBuilder::new(stub))
10829 }
10830
10831 pub fn with_request<V: Into<crate::model::UpdateMirroringEndpointGroupRequest>>(
10833 mut self,
10834 v: V,
10835 ) -> Self {
10836 self.0.request = v.into();
10837 self
10838 }
10839
10840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10842 self.0.options = v.into();
10843 self
10844 }
10845
10846 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10853 (*self.0.stub)
10854 .update_mirroring_endpoint_group(self.0.request, self.0.options)
10855 .await
10856 .map(crate::Response::into_body)
10857 }
10858
10859 pub fn poller(
10861 self,
10862 ) -> impl google_cloud_lro::Poller<
10863 crate::model::MirroringEndpointGroup,
10864 crate::model::OperationMetadata,
10865 > {
10866 type Operation = google_cloud_lro::internal::Operation<
10867 crate::model::MirroringEndpointGroup,
10868 crate::model::OperationMetadata,
10869 >;
10870 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10871 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10872
10873 let stub = self.0.stub.clone();
10874 let mut options = self.0.options.clone();
10875 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10876 let query = move |name| {
10877 let stub = stub.clone();
10878 let options = options.clone();
10879 async {
10880 let op = GetOperation::new(stub)
10881 .set_name(name)
10882 .with_options(options)
10883 .send()
10884 .await?;
10885 Ok(Operation::new(op))
10886 }
10887 };
10888
10889 let start = move || async {
10890 let op = self.send().await?;
10891 Ok(Operation::new(op))
10892 };
10893
10894 google_cloud_lro::internal::new_poller(
10895 polling_error_policy,
10896 polling_backoff_policy,
10897 start,
10898 query,
10899 )
10900 }
10901
10902 pub fn set_update_mask<T>(mut self, v: T) -> Self
10904 where
10905 T: std::convert::Into<wkt::FieldMask>,
10906 {
10907 self.0.request.update_mask = std::option::Option::Some(v.into());
10908 self
10909 }
10910
10911 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10913 where
10914 T: std::convert::Into<wkt::FieldMask>,
10915 {
10916 self.0.request.update_mask = v.map(|x| x.into());
10917 self
10918 }
10919
10920 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
10924 where
10925 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10926 {
10927 self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
10928 self
10929 }
10930
10931 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
10935 where
10936 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10937 {
10938 self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
10939 self
10940 }
10941
10942 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10944 self.0.request.request_id = v.into();
10945 self
10946 }
10947 }
10948
10949 #[doc(hidden)]
10950 impl crate::RequestBuilder for UpdateMirroringEndpointGroup {
10951 fn request_options(&mut self) -> &mut crate::RequestOptions {
10952 &mut self.0.options
10953 }
10954 }
10955
10956 #[derive(Clone, Debug)]
10974 pub struct DeleteMirroringEndpointGroup(
10975 RequestBuilder<crate::model::DeleteMirroringEndpointGroupRequest>,
10976 );
10977
10978 impl DeleteMirroringEndpointGroup {
10979 pub(crate) fn new(
10980 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10981 ) -> Self {
10982 Self(RequestBuilder::new(stub))
10983 }
10984
10985 pub fn with_request<V: Into<crate::model::DeleteMirroringEndpointGroupRequest>>(
10987 mut self,
10988 v: V,
10989 ) -> Self {
10990 self.0.request = v.into();
10991 self
10992 }
10993
10994 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10996 self.0.options = v.into();
10997 self
10998 }
10999
11000 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11007 (*self.0.stub)
11008 .delete_mirroring_endpoint_group(self.0.request, self.0.options)
11009 .await
11010 .map(crate::Response::into_body)
11011 }
11012
11013 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11015 type Operation =
11016 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11017 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11018 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11019
11020 let stub = self.0.stub.clone();
11021 let mut options = self.0.options.clone();
11022 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11023 let query = move |name| {
11024 let stub = stub.clone();
11025 let options = options.clone();
11026 async {
11027 let op = GetOperation::new(stub)
11028 .set_name(name)
11029 .with_options(options)
11030 .send()
11031 .await?;
11032 Ok(Operation::new(op))
11033 }
11034 };
11035
11036 let start = move || async {
11037 let op = self.send().await?;
11038 Ok(Operation::new(op))
11039 };
11040
11041 google_cloud_lro::internal::new_unit_response_poller(
11042 polling_error_policy,
11043 polling_backoff_policy,
11044 start,
11045 query,
11046 )
11047 }
11048
11049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11053 self.0.request.name = v.into();
11054 self
11055 }
11056
11057 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11059 self.0.request.request_id = v.into();
11060 self
11061 }
11062 }
11063
11064 #[doc(hidden)]
11065 impl crate::RequestBuilder for DeleteMirroringEndpointGroup {
11066 fn request_options(&mut self) -> &mut crate::RequestOptions {
11067 &mut self.0.options
11068 }
11069 }
11070
11071 #[derive(Clone, Debug)]
11092 pub struct ListMirroringEndpointGroupAssociations(
11093 RequestBuilder<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11094 );
11095
11096 impl ListMirroringEndpointGroupAssociations {
11097 pub(crate) fn new(
11098 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11099 ) -> Self {
11100 Self(RequestBuilder::new(stub))
11101 }
11102
11103 pub fn with_request<
11105 V: Into<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11106 >(
11107 mut self,
11108 v: V,
11109 ) -> Self {
11110 self.0.request = v.into();
11111 self
11112 }
11113
11114 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11116 self.0.options = v.into();
11117 self
11118 }
11119
11120 pub async fn send(
11122 self,
11123 ) -> Result<crate::model::ListMirroringEndpointGroupAssociationsResponse> {
11124 (*self.0.stub)
11125 .list_mirroring_endpoint_group_associations(self.0.request, self.0.options)
11126 .await
11127 .map(crate::Response::into_body)
11128 }
11129
11130 pub fn by_page(
11132 self,
11133 ) -> impl google_cloud_gax::paginator::Paginator<
11134 crate::model::ListMirroringEndpointGroupAssociationsResponse,
11135 crate::Error,
11136 > {
11137 use std::clone::Clone;
11138 let token = self.0.request.page_token.clone();
11139 let execute = move |token: String| {
11140 let mut builder = self.clone();
11141 builder.0.request = builder.0.request.set_page_token(token);
11142 builder.send()
11143 };
11144 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11145 }
11146
11147 pub fn by_item(
11149 self,
11150 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11151 crate::model::ListMirroringEndpointGroupAssociationsResponse,
11152 crate::Error,
11153 > {
11154 use google_cloud_gax::paginator::Paginator;
11155 self.by_page().items()
11156 }
11157
11158 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11162 self.0.request.parent = v.into();
11163 self
11164 }
11165
11166 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11168 self.0.request.page_size = v.into();
11169 self
11170 }
11171
11172 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11174 self.0.request.page_token = v.into();
11175 self
11176 }
11177
11178 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11180 self.0.request.filter = v.into();
11181 self
11182 }
11183
11184 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11186 self.0.request.order_by = v.into();
11187 self
11188 }
11189 }
11190
11191 #[doc(hidden)]
11192 impl crate::RequestBuilder for ListMirroringEndpointGroupAssociations {
11193 fn request_options(&mut self) -> &mut crate::RequestOptions {
11194 &mut self.0.options
11195 }
11196 }
11197
11198 #[derive(Clone, Debug)]
11215 pub struct GetMirroringEndpointGroupAssociation(
11216 RequestBuilder<crate::model::GetMirroringEndpointGroupAssociationRequest>,
11217 );
11218
11219 impl GetMirroringEndpointGroupAssociation {
11220 pub(crate) fn new(
11221 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11222 ) -> Self {
11223 Self(RequestBuilder::new(stub))
11224 }
11225
11226 pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupAssociationRequest>>(
11228 mut self,
11229 v: V,
11230 ) -> Self {
11231 self.0.request = v.into();
11232 self
11233 }
11234
11235 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11237 self.0.options = v.into();
11238 self
11239 }
11240
11241 pub async fn send(self) -> Result<crate::model::MirroringEndpointGroupAssociation> {
11243 (*self.0.stub)
11244 .get_mirroring_endpoint_group_association(self.0.request, self.0.options)
11245 .await
11246 .map(crate::Response::into_body)
11247 }
11248
11249 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11253 self.0.request.name = v.into();
11254 self
11255 }
11256 }
11257
11258 #[doc(hidden)]
11259 impl crate::RequestBuilder for GetMirroringEndpointGroupAssociation {
11260 fn request_options(&mut self) -> &mut crate::RequestOptions {
11261 &mut self.0.options
11262 }
11263 }
11264
11265 #[derive(Clone, Debug)]
11283 pub struct CreateMirroringEndpointGroupAssociation(
11284 RequestBuilder<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11285 );
11286
11287 impl CreateMirroringEndpointGroupAssociation {
11288 pub(crate) fn new(
11289 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11290 ) -> Self {
11291 Self(RequestBuilder::new(stub))
11292 }
11293
11294 pub fn with_request<
11296 V: Into<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11297 >(
11298 mut self,
11299 v: V,
11300 ) -> Self {
11301 self.0.request = v.into();
11302 self
11303 }
11304
11305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11307 self.0.options = v.into();
11308 self
11309 }
11310
11311 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11318 (*self.0.stub)
11319 .create_mirroring_endpoint_group_association(self.0.request, self.0.options)
11320 .await
11321 .map(crate::Response::into_body)
11322 }
11323
11324 pub fn poller(
11326 self,
11327 ) -> impl google_cloud_lro::Poller<
11328 crate::model::MirroringEndpointGroupAssociation,
11329 crate::model::OperationMetadata,
11330 > {
11331 type Operation = google_cloud_lro::internal::Operation<
11332 crate::model::MirroringEndpointGroupAssociation,
11333 crate::model::OperationMetadata,
11334 >;
11335 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11336 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11337
11338 let stub = self.0.stub.clone();
11339 let mut options = self.0.options.clone();
11340 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11341 let query = move |name| {
11342 let stub = stub.clone();
11343 let options = options.clone();
11344 async {
11345 let op = GetOperation::new(stub)
11346 .set_name(name)
11347 .with_options(options)
11348 .send()
11349 .await?;
11350 Ok(Operation::new(op))
11351 }
11352 };
11353
11354 let start = move || async {
11355 let op = self.send().await?;
11356 Ok(Operation::new(op))
11357 };
11358
11359 google_cloud_lro::internal::new_poller(
11360 polling_error_policy,
11361 polling_backoff_policy,
11362 start,
11363 query,
11364 )
11365 }
11366
11367 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11371 self.0.request.parent = v.into();
11372 self
11373 }
11374
11375 pub fn set_mirroring_endpoint_group_association_id<T: Into<std::string::String>>(
11377 mut self,
11378 v: T,
11379 ) -> Self {
11380 self.0.request.mirroring_endpoint_group_association_id = v.into();
11381 self
11382 }
11383
11384 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
11388 where
11389 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11390 {
11391 self.0.request.mirroring_endpoint_group_association =
11392 std::option::Option::Some(v.into());
11393 self
11394 }
11395
11396 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
11400 mut self,
11401 v: std::option::Option<T>,
11402 ) -> Self
11403 where
11404 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11405 {
11406 self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
11407 self
11408 }
11409
11410 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11412 self.0.request.request_id = v.into();
11413 self
11414 }
11415 }
11416
11417 #[doc(hidden)]
11418 impl crate::RequestBuilder for CreateMirroringEndpointGroupAssociation {
11419 fn request_options(&mut self) -> &mut crate::RequestOptions {
11420 &mut self.0.options
11421 }
11422 }
11423
11424 #[derive(Clone, Debug)]
11442 pub struct UpdateMirroringEndpointGroupAssociation(
11443 RequestBuilder<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
11444 );
11445
11446 impl UpdateMirroringEndpointGroupAssociation {
11447 pub(crate) fn new(
11448 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11449 ) -> Self {
11450 Self(RequestBuilder::new(stub))
11451 }
11452
11453 pub fn with_request<
11455 V: Into<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
11456 >(
11457 mut self,
11458 v: V,
11459 ) -> Self {
11460 self.0.request = v.into();
11461 self
11462 }
11463
11464 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11466 self.0.options = v.into();
11467 self
11468 }
11469
11470 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11477 (*self.0.stub)
11478 .update_mirroring_endpoint_group_association(self.0.request, self.0.options)
11479 .await
11480 .map(crate::Response::into_body)
11481 }
11482
11483 pub fn poller(
11485 self,
11486 ) -> impl google_cloud_lro::Poller<
11487 crate::model::MirroringEndpointGroupAssociation,
11488 crate::model::OperationMetadata,
11489 > {
11490 type Operation = google_cloud_lro::internal::Operation<
11491 crate::model::MirroringEndpointGroupAssociation,
11492 crate::model::OperationMetadata,
11493 >;
11494 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11495 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11496
11497 let stub = self.0.stub.clone();
11498 let mut options = self.0.options.clone();
11499 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11500 let query = move |name| {
11501 let stub = stub.clone();
11502 let options = options.clone();
11503 async {
11504 let op = GetOperation::new(stub)
11505 .set_name(name)
11506 .with_options(options)
11507 .send()
11508 .await?;
11509 Ok(Operation::new(op))
11510 }
11511 };
11512
11513 let start = move || async {
11514 let op = self.send().await?;
11515 Ok(Operation::new(op))
11516 };
11517
11518 google_cloud_lro::internal::new_poller(
11519 polling_error_policy,
11520 polling_backoff_policy,
11521 start,
11522 query,
11523 )
11524 }
11525
11526 pub fn set_update_mask<T>(mut self, v: T) -> Self
11528 where
11529 T: std::convert::Into<wkt::FieldMask>,
11530 {
11531 self.0.request.update_mask = std::option::Option::Some(v.into());
11532 self
11533 }
11534
11535 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11537 where
11538 T: std::convert::Into<wkt::FieldMask>,
11539 {
11540 self.0.request.update_mask = v.map(|x| x.into());
11541 self
11542 }
11543
11544 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
11548 where
11549 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11550 {
11551 self.0.request.mirroring_endpoint_group_association =
11552 std::option::Option::Some(v.into());
11553 self
11554 }
11555
11556 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
11560 mut self,
11561 v: std::option::Option<T>,
11562 ) -> Self
11563 where
11564 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11565 {
11566 self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
11567 self
11568 }
11569
11570 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11572 self.0.request.request_id = v.into();
11573 self
11574 }
11575 }
11576
11577 #[doc(hidden)]
11578 impl crate::RequestBuilder for UpdateMirroringEndpointGroupAssociation {
11579 fn request_options(&mut self) -> &mut crate::RequestOptions {
11580 &mut self.0.options
11581 }
11582 }
11583
11584 #[derive(Clone, Debug)]
11602 pub struct DeleteMirroringEndpointGroupAssociation(
11603 RequestBuilder<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
11604 );
11605
11606 impl DeleteMirroringEndpointGroupAssociation {
11607 pub(crate) fn new(
11608 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11609 ) -> Self {
11610 Self(RequestBuilder::new(stub))
11611 }
11612
11613 pub fn with_request<
11615 V: Into<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
11616 >(
11617 mut self,
11618 v: V,
11619 ) -> Self {
11620 self.0.request = v.into();
11621 self
11622 }
11623
11624 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11626 self.0.options = v.into();
11627 self
11628 }
11629
11630 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11637 (*self.0.stub)
11638 .delete_mirroring_endpoint_group_association(self.0.request, self.0.options)
11639 .await
11640 .map(crate::Response::into_body)
11641 }
11642
11643 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11645 type Operation =
11646 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11647 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11648 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11649
11650 let stub = self.0.stub.clone();
11651 let mut options = self.0.options.clone();
11652 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11653 let query = move |name| {
11654 let stub = stub.clone();
11655 let options = options.clone();
11656 async {
11657 let op = GetOperation::new(stub)
11658 .set_name(name)
11659 .with_options(options)
11660 .send()
11661 .await?;
11662 Ok(Operation::new(op))
11663 }
11664 };
11665
11666 let start = move || async {
11667 let op = self.send().await?;
11668 Ok(Operation::new(op))
11669 };
11670
11671 google_cloud_lro::internal::new_unit_response_poller(
11672 polling_error_policy,
11673 polling_backoff_policy,
11674 start,
11675 query,
11676 )
11677 }
11678
11679 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11683 self.0.request.name = v.into();
11684 self
11685 }
11686
11687 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11689 self.0.request.request_id = v.into();
11690 self
11691 }
11692 }
11693
11694 #[doc(hidden)]
11695 impl crate::RequestBuilder for DeleteMirroringEndpointGroupAssociation {
11696 fn request_options(&mut self) -> &mut crate::RequestOptions {
11697 &mut self.0.options
11698 }
11699 }
11700
11701 #[derive(Clone, Debug)]
11722 pub struct ListMirroringDeploymentGroups(
11723 RequestBuilder<crate::model::ListMirroringDeploymentGroupsRequest>,
11724 );
11725
11726 impl ListMirroringDeploymentGroups {
11727 pub(crate) fn new(
11728 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11729 ) -> Self {
11730 Self(RequestBuilder::new(stub))
11731 }
11732
11733 pub fn with_request<V: Into<crate::model::ListMirroringDeploymentGroupsRequest>>(
11735 mut self,
11736 v: V,
11737 ) -> Self {
11738 self.0.request = v.into();
11739 self
11740 }
11741
11742 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11744 self.0.options = v.into();
11745 self
11746 }
11747
11748 pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentGroupsResponse> {
11750 (*self.0.stub)
11751 .list_mirroring_deployment_groups(self.0.request, self.0.options)
11752 .await
11753 .map(crate::Response::into_body)
11754 }
11755
11756 pub fn by_page(
11758 self,
11759 ) -> impl google_cloud_gax::paginator::Paginator<
11760 crate::model::ListMirroringDeploymentGroupsResponse,
11761 crate::Error,
11762 > {
11763 use std::clone::Clone;
11764 let token = self.0.request.page_token.clone();
11765 let execute = move |token: String| {
11766 let mut builder = self.clone();
11767 builder.0.request = builder.0.request.set_page_token(token);
11768 builder.send()
11769 };
11770 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11771 }
11772
11773 pub fn by_item(
11775 self,
11776 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11777 crate::model::ListMirroringDeploymentGroupsResponse,
11778 crate::Error,
11779 > {
11780 use google_cloud_gax::paginator::Paginator;
11781 self.by_page().items()
11782 }
11783
11784 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11788 self.0.request.parent = v.into();
11789 self
11790 }
11791
11792 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11794 self.0.request.page_size = v.into();
11795 self
11796 }
11797
11798 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11800 self.0.request.page_token = v.into();
11801 self
11802 }
11803
11804 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11806 self.0.request.filter = v.into();
11807 self
11808 }
11809
11810 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11812 self.0.request.order_by = v.into();
11813 self
11814 }
11815 }
11816
11817 #[doc(hidden)]
11818 impl crate::RequestBuilder for ListMirroringDeploymentGroups {
11819 fn request_options(&mut self) -> &mut crate::RequestOptions {
11820 &mut self.0.options
11821 }
11822 }
11823
11824 #[derive(Clone, Debug)]
11841 pub struct GetMirroringDeploymentGroup(
11842 RequestBuilder<crate::model::GetMirroringDeploymentGroupRequest>,
11843 );
11844
11845 impl GetMirroringDeploymentGroup {
11846 pub(crate) fn new(
11847 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11848 ) -> Self {
11849 Self(RequestBuilder::new(stub))
11850 }
11851
11852 pub fn with_request<V: Into<crate::model::GetMirroringDeploymentGroupRequest>>(
11854 mut self,
11855 v: V,
11856 ) -> Self {
11857 self.0.request = v.into();
11858 self
11859 }
11860
11861 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11863 self.0.options = v.into();
11864 self
11865 }
11866
11867 pub async fn send(self) -> Result<crate::model::MirroringDeploymentGroup> {
11869 (*self.0.stub)
11870 .get_mirroring_deployment_group(self.0.request, self.0.options)
11871 .await
11872 .map(crate::Response::into_body)
11873 }
11874
11875 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11879 self.0.request.name = v.into();
11880 self
11881 }
11882 }
11883
11884 #[doc(hidden)]
11885 impl crate::RequestBuilder for GetMirroringDeploymentGroup {
11886 fn request_options(&mut self) -> &mut crate::RequestOptions {
11887 &mut self.0.options
11888 }
11889 }
11890
11891 #[derive(Clone, Debug)]
11909 pub struct CreateMirroringDeploymentGroup(
11910 RequestBuilder<crate::model::CreateMirroringDeploymentGroupRequest>,
11911 );
11912
11913 impl CreateMirroringDeploymentGroup {
11914 pub(crate) fn new(
11915 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11916 ) -> Self {
11917 Self(RequestBuilder::new(stub))
11918 }
11919
11920 pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentGroupRequest>>(
11922 mut self,
11923 v: V,
11924 ) -> Self {
11925 self.0.request = v.into();
11926 self
11927 }
11928
11929 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11931 self.0.options = v.into();
11932 self
11933 }
11934
11935 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11942 (*self.0.stub)
11943 .create_mirroring_deployment_group(self.0.request, self.0.options)
11944 .await
11945 .map(crate::Response::into_body)
11946 }
11947
11948 pub fn poller(
11950 self,
11951 ) -> impl google_cloud_lro::Poller<
11952 crate::model::MirroringDeploymentGroup,
11953 crate::model::OperationMetadata,
11954 > {
11955 type Operation = google_cloud_lro::internal::Operation<
11956 crate::model::MirroringDeploymentGroup,
11957 crate::model::OperationMetadata,
11958 >;
11959 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11960 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11961
11962 let stub = self.0.stub.clone();
11963 let mut options = self.0.options.clone();
11964 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11965 let query = move |name| {
11966 let stub = stub.clone();
11967 let options = options.clone();
11968 async {
11969 let op = GetOperation::new(stub)
11970 .set_name(name)
11971 .with_options(options)
11972 .send()
11973 .await?;
11974 Ok(Operation::new(op))
11975 }
11976 };
11977
11978 let start = move || async {
11979 let op = self.send().await?;
11980 Ok(Operation::new(op))
11981 };
11982
11983 google_cloud_lro::internal::new_poller(
11984 polling_error_policy,
11985 polling_backoff_policy,
11986 start,
11987 query,
11988 )
11989 }
11990
11991 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11995 self.0.request.parent = v.into();
11996 self
11997 }
11998
11999 pub fn set_mirroring_deployment_group_id<T: Into<std::string::String>>(
12003 mut self,
12004 v: T,
12005 ) -> Self {
12006 self.0.request.mirroring_deployment_group_id = v.into();
12007 self
12008 }
12009
12010 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12014 where
12015 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12016 {
12017 self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12018 self
12019 }
12020
12021 pub fn set_or_clear_mirroring_deployment_group<T>(
12025 mut self,
12026 v: std::option::Option<T>,
12027 ) -> Self
12028 where
12029 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12030 {
12031 self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12032 self
12033 }
12034
12035 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12037 self.0.request.request_id = v.into();
12038 self
12039 }
12040 }
12041
12042 #[doc(hidden)]
12043 impl crate::RequestBuilder for CreateMirroringDeploymentGroup {
12044 fn request_options(&mut self) -> &mut crate::RequestOptions {
12045 &mut self.0.options
12046 }
12047 }
12048
12049 #[derive(Clone, Debug)]
12067 pub struct UpdateMirroringDeploymentGroup(
12068 RequestBuilder<crate::model::UpdateMirroringDeploymentGroupRequest>,
12069 );
12070
12071 impl UpdateMirroringDeploymentGroup {
12072 pub(crate) fn new(
12073 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12074 ) -> Self {
12075 Self(RequestBuilder::new(stub))
12076 }
12077
12078 pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentGroupRequest>>(
12080 mut self,
12081 v: V,
12082 ) -> Self {
12083 self.0.request = v.into();
12084 self
12085 }
12086
12087 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12089 self.0.options = v.into();
12090 self
12091 }
12092
12093 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12100 (*self.0.stub)
12101 .update_mirroring_deployment_group(self.0.request, self.0.options)
12102 .await
12103 .map(crate::Response::into_body)
12104 }
12105
12106 pub fn poller(
12108 self,
12109 ) -> impl google_cloud_lro::Poller<
12110 crate::model::MirroringDeploymentGroup,
12111 crate::model::OperationMetadata,
12112 > {
12113 type Operation = google_cloud_lro::internal::Operation<
12114 crate::model::MirroringDeploymentGroup,
12115 crate::model::OperationMetadata,
12116 >;
12117 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12118 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12119
12120 let stub = self.0.stub.clone();
12121 let mut options = self.0.options.clone();
12122 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12123 let query = move |name| {
12124 let stub = stub.clone();
12125 let options = options.clone();
12126 async {
12127 let op = GetOperation::new(stub)
12128 .set_name(name)
12129 .with_options(options)
12130 .send()
12131 .await?;
12132 Ok(Operation::new(op))
12133 }
12134 };
12135
12136 let start = move || async {
12137 let op = self.send().await?;
12138 Ok(Operation::new(op))
12139 };
12140
12141 google_cloud_lro::internal::new_poller(
12142 polling_error_policy,
12143 polling_backoff_policy,
12144 start,
12145 query,
12146 )
12147 }
12148
12149 pub fn set_update_mask<T>(mut self, v: T) -> Self
12151 where
12152 T: std::convert::Into<wkt::FieldMask>,
12153 {
12154 self.0.request.update_mask = std::option::Option::Some(v.into());
12155 self
12156 }
12157
12158 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12160 where
12161 T: std::convert::Into<wkt::FieldMask>,
12162 {
12163 self.0.request.update_mask = v.map(|x| x.into());
12164 self
12165 }
12166
12167 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12171 where
12172 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12173 {
12174 self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12175 self
12176 }
12177
12178 pub fn set_or_clear_mirroring_deployment_group<T>(
12182 mut self,
12183 v: std::option::Option<T>,
12184 ) -> Self
12185 where
12186 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12187 {
12188 self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12189 self
12190 }
12191
12192 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12194 self.0.request.request_id = v.into();
12195 self
12196 }
12197 }
12198
12199 #[doc(hidden)]
12200 impl crate::RequestBuilder for UpdateMirroringDeploymentGroup {
12201 fn request_options(&mut self) -> &mut crate::RequestOptions {
12202 &mut self.0.options
12203 }
12204 }
12205
12206 #[derive(Clone, Debug)]
12224 pub struct DeleteMirroringDeploymentGroup(
12225 RequestBuilder<crate::model::DeleteMirroringDeploymentGroupRequest>,
12226 );
12227
12228 impl DeleteMirroringDeploymentGroup {
12229 pub(crate) fn new(
12230 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12231 ) -> Self {
12232 Self(RequestBuilder::new(stub))
12233 }
12234
12235 pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentGroupRequest>>(
12237 mut self,
12238 v: V,
12239 ) -> Self {
12240 self.0.request = v.into();
12241 self
12242 }
12243
12244 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12246 self.0.options = v.into();
12247 self
12248 }
12249
12250 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12257 (*self.0.stub)
12258 .delete_mirroring_deployment_group(self.0.request, self.0.options)
12259 .await
12260 .map(crate::Response::into_body)
12261 }
12262
12263 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12265 type Operation =
12266 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12267 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12268 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12269
12270 let stub = self.0.stub.clone();
12271 let mut options = self.0.options.clone();
12272 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12273 let query = move |name| {
12274 let stub = stub.clone();
12275 let options = options.clone();
12276 async {
12277 let op = GetOperation::new(stub)
12278 .set_name(name)
12279 .with_options(options)
12280 .send()
12281 .await?;
12282 Ok(Operation::new(op))
12283 }
12284 };
12285
12286 let start = move || async {
12287 let op = self.send().await?;
12288 Ok(Operation::new(op))
12289 };
12290
12291 google_cloud_lro::internal::new_unit_response_poller(
12292 polling_error_policy,
12293 polling_backoff_policy,
12294 start,
12295 query,
12296 )
12297 }
12298
12299 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12303 self.0.request.name = v.into();
12304 self
12305 }
12306
12307 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12309 self.0.request.request_id = v.into();
12310 self
12311 }
12312 }
12313
12314 #[doc(hidden)]
12315 impl crate::RequestBuilder for DeleteMirroringDeploymentGroup {
12316 fn request_options(&mut self) -> &mut crate::RequestOptions {
12317 &mut self.0.options
12318 }
12319 }
12320
12321 #[derive(Clone, Debug)]
12342 pub struct ListMirroringDeployments(
12343 RequestBuilder<crate::model::ListMirroringDeploymentsRequest>,
12344 );
12345
12346 impl ListMirroringDeployments {
12347 pub(crate) fn new(
12348 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12349 ) -> Self {
12350 Self(RequestBuilder::new(stub))
12351 }
12352
12353 pub fn with_request<V: Into<crate::model::ListMirroringDeploymentsRequest>>(
12355 mut self,
12356 v: V,
12357 ) -> Self {
12358 self.0.request = v.into();
12359 self
12360 }
12361
12362 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12364 self.0.options = v.into();
12365 self
12366 }
12367
12368 pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentsResponse> {
12370 (*self.0.stub)
12371 .list_mirroring_deployments(self.0.request, self.0.options)
12372 .await
12373 .map(crate::Response::into_body)
12374 }
12375
12376 pub fn by_page(
12378 self,
12379 ) -> impl google_cloud_gax::paginator::Paginator<
12380 crate::model::ListMirroringDeploymentsResponse,
12381 crate::Error,
12382 > {
12383 use std::clone::Clone;
12384 let token = self.0.request.page_token.clone();
12385 let execute = move |token: String| {
12386 let mut builder = self.clone();
12387 builder.0.request = builder.0.request.set_page_token(token);
12388 builder.send()
12389 };
12390 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12391 }
12392
12393 pub fn by_item(
12395 self,
12396 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12397 crate::model::ListMirroringDeploymentsResponse,
12398 crate::Error,
12399 > {
12400 use google_cloud_gax::paginator::Paginator;
12401 self.by_page().items()
12402 }
12403
12404 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12408 self.0.request.parent = v.into();
12409 self
12410 }
12411
12412 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12414 self.0.request.page_size = v.into();
12415 self
12416 }
12417
12418 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12420 self.0.request.page_token = v.into();
12421 self
12422 }
12423
12424 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12426 self.0.request.filter = v.into();
12427 self
12428 }
12429
12430 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12432 self.0.request.order_by = v.into();
12433 self
12434 }
12435 }
12436
12437 #[doc(hidden)]
12438 impl crate::RequestBuilder for ListMirroringDeployments {
12439 fn request_options(&mut self) -> &mut crate::RequestOptions {
12440 &mut self.0.options
12441 }
12442 }
12443
12444 #[derive(Clone, Debug)]
12461 pub struct GetMirroringDeployment(RequestBuilder<crate::model::GetMirroringDeploymentRequest>);
12462
12463 impl GetMirroringDeployment {
12464 pub(crate) fn new(
12465 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12466 ) -> Self {
12467 Self(RequestBuilder::new(stub))
12468 }
12469
12470 pub fn with_request<V: Into<crate::model::GetMirroringDeploymentRequest>>(
12472 mut self,
12473 v: V,
12474 ) -> Self {
12475 self.0.request = v.into();
12476 self
12477 }
12478
12479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12481 self.0.options = v.into();
12482 self
12483 }
12484
12485 pub async fn send(self) -> Result<crate::model::MirroringDeployment> {
12487 (*self.0.stub)
12488 .get_mirroring_deployment(self.0.request, self.0.options)
12489 .await
12490 .map(crate::Response::into_body)
12491 }
12492
12493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12497 self.0.request.name = v.into();
12498 self
12499 }
12500 }
12501
12502 #[doc(hidden)]
12503 impl crate::RequestBuilder for GetMirroringDeployment {
12504 fn request_options(&mut self) -> &mut crate::RequestOptions {
12505 &mut self.0.options
12506 }
12507 }
12508
12509 #[derive(Clone, Debug)]
12527 pub struct CreateMirroringDeployment(
12528 RequestBuilder<crate::model::CreateMirroringDeploymentRequest>,
12529 );
12530
12531 impl CreateMirroringDeployment {
12532 pub(crate) fn new(
12533 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12534 ) -> Self {
12535 Self(RequestBuilder::new(stub))
12536 }
12537
12538 pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentRequest>>(
12540 mut self,
12541 v: V,
12542 ) -> Self {
12543 self.0.request = v.into();
12544 self
12545 }
12546
12547 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12549 self.0.options = v.into();
12550 self
12551 }
12552
12553 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12560 (*self.0.stub)
12561 .create_mirroring_deployment(self.0.request, self.0.options)
12562 .await
12563 .map(crate::Response::into_body)
12564 }
12565
12566 pub fn poller(
12568 self,
12569 ) -> impl google_cloud_lro::Poller<
12570 crate::model::MirroringDeployment,
12571 crate::model::OperationMetadata,
12572 > {
12573 type Operation = google_cloud_lro::internal::Operation<
12574 crate::model::MirroringDeployment,
12575 crate::model::OperationMetadata,
12576 >;
12577 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12578 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12579
12580 let stub = self.0.stub.clone();
12581 let mut options = self.0.options.clone();
12582 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12583 let query = move |name| {
12584 let stub = stub.clone();
12585 let options = options.clone();
12586 async {
12587 let op = GetOperation::new(stub)
12588 .set_name(name)
12589 .with_options(options)
12590 .send()
12591 .await?;
12592 Ok(Operation::new(op))
12593 }
12594 };
12595
12596 let start = move || async {
12597 let op = self.send().await?;
12598 Ok(Operation::new(op))
12599 };
12600
12601 google_cloud_lro::internal::new_poller(
12602 polling_error_policy,
12603 polling_backoff_policy,
12604 start,
12605 query,
12606 )
12607 }
12608
12609 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12613 self.0.request.parent = v.into();
12614 self
12615 }
12616
12617 pub fn set_mirroring_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12621 self.0.request.mirroring_deployment_id = v.into();
12622 self
12623 }
12624
12625 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
12629 where
12630 T: std::convert::Into<crate::model::MirroringDeployment>,
12631 {
12632 self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
12633 self
12634 }
12635
12636 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
12640 where
12641 T: std::convert::Into<crate::model::MirroringDeployment>,
12642 {
12643 self.0.request.mirroring_deployment = v.map(|x| x.into());
12644 self
12645 }
12646
12647 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12649 self.0.request.request_id = v.into();
12650 self
12651 }
12652 }
12653
12654 #[doc(hidden)]
12655 impl crate::RequestBuilder for CreateMirroringDeployment {
12656 fn request_options(&mut self) -> &mut crate::RequestOptions {
12657 &mut self.0.options
12658 }
12659 }
12660
12661 #[derive(Clone, Debug)]
12679 pub struct UpdateMirroringDeployment(
12680 RequestBuilder<crate::model::UpdateMirroringDeploymentRequest>,
12681 );
12682
12683 impl UpdateMirroringDeployment {
12684 pub(crate) fn new(
12685 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12686 ) -> Self {
12687 Self(RequestBuilder::new(stub))
12688 }
12689
12690 pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentRequest>>(
12692 mut self,
12693 v: V,
12694 ) -> Self {
12695 self.0.request = v.into();
12696 self
12697 }
12698
12699 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12701 self.0.options = v.into();
12702 self
12703 }
12704
12705 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12712 (*self.0.stub)
12713 .update_mirroring_deployment(self.0.request, self.0.options)
12714 .await
12715 .map(crate::Response::into_body)
12716 }
12717
12718 pub fn poller(
12720 self,
12721 ) -> impl google_cloud_lro::Poller<
12722 crate::model::MirroringDeployment,
12723 crate::model::OperationMetadata,
12724 > {
12725 type Operation = google_cloud_lro::internal::Operation<
12726 crate::model::MirroringDeployment,
12727 crate::model::OperationMetadata,
12728 >;
12729 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12730 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12731
12732 let stub = self.0.stub.clone();
12733 let mut options = self.0.options.clone();
12734 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12735 let query = move |name| {
12736 let stub = stub.clone();
12737 let options = options.clone();
12738 async {
12739 let op = GetOperation::new(stub)
12740 .set_name(name)
12741 .with_options(options)
12742 .send()
12743 .await?;
12744 Ok(Operation::new(op))
12745 }
12746 };
12747
12748 let start = move || async {
12749 let op = self.send().await?;
12750 Ok(Operation::new(op))
12751 };
12752
12753 google_cloud_lro::internal::new_poller(
12754 polling_error_policy,
12755 polling_backoff_policy,
12756 start,
12757 query,
12758 )
12759 }
12760
12761 pub fn set_update_mask<T>(mut self, v: T) -> Self
12763 where
12764 T: std::convert::Into<wkt::FieldMask>,
12765 {
12766 self.0.request.update_mask = std::option::Option::Some(v.into());
12767 self
12768 }
12769
12770 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12772 where
12773 T: std::convert::Into<wkt::FieldMask>,
12774 {
12775 self.0.request.update_mask = v.map(|x| x.into());
12776 self
12777 }
12778
12779 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
12783 where
12784 T: std::convert::Into<crate::model::MirroringDeployment>,
12785 {
12786 self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
12787 self
12788 }
12789
12790 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
12794 where
12795 T: std::convert::Into<crate::model::MirroringDeployment>,
12796 {
12797 self.0.request.mirroring_deployment = v.map(|x| x.into());
12798 self
12799 }
12800
12801 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12803 self.0.request.request_id = v.into();
12804 self
12805 }
12806 }
12807
12808 #[doc(hidden)]
12809 impl crate::RequestBuilder for UpdateMirroringDeployment {
12810 fn request_options(&mut self) -> &mut crate::RequestOptions {
12811 &mut self.0.options
12812 }
12813 }
12814
12815 #[derive(Clone, Debug)]
12833 pub struct DeleteMirroringDeployment(
12834 RequestBuilder<crate::model::DeleteMirroringDeploymentRequest>,
12835 );
12836
12837 impl DeleteMirroringDeployment {
12838 pub(crate) fn new(
12839 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12840 ) -> Self {
12841 Self(RequestBuilder::new(stub))
12842 }
12843
12844 pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentRequest>>(
12846 mut self,
12847 v: V,
12848 ) -> Self {
12849 self.0.request = v.into();
12850 self
12851 }
12852
12853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12855 self.0.options = v.into();
12856 self
12857 }
12858
12859 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12866 (*self.0.stub)
12867 .delete_mirroring_deployment(self.0.request, self.0.options)
12868 .await
12869 .map(crate::Response::into_body)
12870 }
12871
12872 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12874 type Operation =
12875 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12876 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12877 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12878
12879 let stub = self.0.stub.clone();
12880 let mut options = self.0.options.clone();
12881 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12882 let query = move |name| {
12883 let stub = stub.clone();
12884 let options = options.clone();
12885 async {
12886 let op = GetOperation::new(stub)
12887 .set_name(name)
12888 .with_options(options)
12889 .send()
12890 .await?;
12891 Ok(Operation::new(op))
12892 }
12893 };
12894
12895 let start = move || async {
12896 let op = self.send().await?;
12897 Ok(Operation::new(op))
12898 };
12899
12900 google_cloud_lro::internal::new_unit_response_poller(
12901 polling_error_policy,
12902 polling_backoff_policy,
12903 start,
12904 query,
12905 )
12906 }
12907
12908 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12912 self.0.request.name = v.into();
12913 self
12914 }
12915
12916 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12918 self.0.request.request_id = v.into();
12919 self
12920 }
12921 }
12922
12923 #[doc(hidden)]
12924 impl crate::RequestBuilder for DeleteMirroringDeployment {
12925 fn request_options(&mut self) -> &mut crate::RequestOptions {
12926 &mut self.0.options
12927 }
12928 }
12929
12930 #[derive(Clone, Debug)]
12951 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12952
12953 impl ListLocations {
12954 pub(crate) fn new(
12955 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12956 ) -> Self {
12957 Self(RequestBuilder::new(stub))
12958 }
12959
12960 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12962 mut self,
12963 v: V,
12964 ) -> Self {
12965 self.0.request = v.into();
12966 self
12967 }
12968
12969 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12971 self.0.options = v.into();
12972 self
12973 }
12974
12975 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12977 (*self.0.stub)
12978 .list_locations(self.0.request, self.0.options)
12979 .await
12980 .map(crate::Response::into_body)
12981 }
12982
12983 pub fn by_page(
12985 self,
12986 ) -> impl google_cloud_gax::paginator::Paginator<
12987 google_cloud_location::model::ListLocationsResponse,
12988 crate::Error,
12989 > {
12990 use std::clone::Clone;
12991 let token = self.0.request.page_token.clone();
12992 let execute = move |token: String| {
12993 let mut builder = self.clone();
12994 builder.0.request = builder.0.request.set_page_token(token);
12995 builder.send()
12996 };
12997 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12998 }
12999
13000 pub fn by_item(
13002 self,
13003 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13004 google_cloud_location::model::ListLocationsResponse,
13005 crate::Error,
13006 > {
13007 use google_cloud_gax::paginator::Paginator;
13008 self.by_page().items()
13009 }
13010
13011 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13013 self.0.request.name = v.into();
13014 self
13015 }
13016
13017 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13019 self.0.request.filter = v.into();
13020 self
13021 }
13022
13023 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13025 self.0.request.page_size = v.into();
13026 self
13027 }
13028
13029 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13031 self.0.request.page_token = v.into();
13032 self
13033 }
13034 }
13035
13036 #[doc(hidden)]
13037 impl crate::RequestBuilder for ListLocations {
13038 fn request_options(&mut self) -> &mut crate::RequestOptions {
13039 &mut self.0.options
13040 }
13041 }
13042
13043 #[derive(Clone, Debug)]
13060 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13061
13062 impl GetLocation {
13063 pub(crate) fn new(
13064 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13065 ) -> Self {
13066 Self(RequestBuilder::new(stub))
13067 }
13068
13069 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13071 mut self,
13072 v: V,
13073 ) -> Self {
13074 self.0.request = v.into();
13075 self
13076 }
13077
13078 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13080 self.0.options = v.into();
13081 self
13082 }
13083
13084 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13086 (*self.0.stub)
13087 .get_location(self.0.request, self.0.options)
13088 .await
13089 .map(crate::Response::into_body)
13090 }
13091
13092 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13094 self.0.request.name = v.into();
13095 self
13096 }
13097 }
13098
13099 #[doc(hidden)]
13100 impl crate::RequestBuilder for GetLocation {
13101 fn request_options(&mut self) -> &mut crate::RequestOptions {
13102 &mut self.0.options
13103 }
13104 }
13105
13106 #[derive(Clone, Debug)]
13123 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13124
13125 impl SetIamPolicy {
13126 pub(crate) fn new(
13127 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13128 ) -> Self {
13129 Self(RequestBuilder::new(stub))
13130 }
13131
13132 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13134 mut self,
13135 v: V,
13136 ) -> Self {
13137 self.0.request = v.into();
13138 self
13139 }
13140
13141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13143 self.0.options = v.into();
13144 self
13145 }
13146
13147 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13149 (*self.0.stub)
13150 .set_iam_policy(self.0.request, self.0.options)
13151 .await
13152 .map(crate::Response::into_body)
13153 }
13154
13155 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13159 self.0.request.resource = v.into();
13160 self
13161 }
13162
13163 pub fn set_policy<T>(mut self, v: T) -> Self
13167 where
13168 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13169 {
13170 self.0.request.policy = std::option::Option::Some(v.into());
13171 self
13172 }
13173
13174 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13178 where
13179 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13180 {
13181 self.0.request.policy = v.map(|x| x.into());
13182 self
13183 }
13184
13185 pub fn set_update_mask<T>(mut self, v: T) -> Self
13187 where
13188 T: std::convert::Into<wkt::FieldMask>,
13189 {
13190 self.0.request.update_mask = std::option::Option::Some(v.into());
13191 self
13192 }
13193
13194 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13196 where
13197 T: std::convert::Into<wkt::FieldMask>,
13198 {
13199 self.0.request.update_mask = v.map(|x| x.into());
13200 self
13201 }
13202 }
13203
13204 #[doc(hidden)]
13205 impl crate::RequestBuilder for SetIamPolicy {
13206 fn request_options(&mut self) -> &mut crate::RequestOptions {
13207 &mut self.0.options
13208 }
13209 }
13210
13211 #[derive(Clone, Debug)]
13228 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13229
13230 impl GetIamPolicy {
13231 pub(crate) fn new(
13232 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13233 ) -> Self {
13234 Self(RequestBuilder::new(stub))
13235 }
13236
13237 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13239 mut self,
13240 v: V,
13241 ) -> Self {
13242 self.0.request = v.into();
13243 self
13244 }
13245
13246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13248 self.0.options = v.into();
13249 self
13250 }
13251
13252 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13254 (*self.0.stub)
13255 .get_iam_policy(self.0.request, self.0.options)
13256 .await
13257 .map(crate::Response::into_body)
13258 }
13259
13260 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13264 self.0.request.resource = v.into();
13265 self
13266 }
13267
13268 pub fn set_options<T>(mut self, v: T) -> Self
13270 where
13271 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13272 {
13273 self.0.request.options = std::option::Option::Some(v.into());
13274 self
13275 }
13276
13277 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13279 where
13280 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13281 {
13282 self.0.request.options = v.map(|x| x.into());
13283 self
13284 }
13285 }
13286
13287 #[doc(hidden)]
13288 impl crate::RequestBuilder for GetIamPolicy {
13289 fn request_options(&mut self) -> &mut crate::RequestOptions {
13290 &mut self.0.options
13291 }
13292 }
13293
13294 #[derive(Clone, Debug)]
13311 pub struct TestIamPermissions(
13312 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13313 );
13314
13315 impl TestIamPermissions {
13316 pub(crate) fn new(
13317 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13318 ) -> Self {
13319 Self(RequestBuilder::new(stub))
13320 }
13321
13322 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13324 mut self,
13325 v: V,
13326 ) -> Self {
13327 self.0.request = v.into();
13328 self
13329 }
13330
13331 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13333 self.0.options = v.into();
13334 self
13335 }
13336
13337 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13339 (*self.0.stub)
13340 .test_iam_permissions(self.0.request, self.0.options)
13341 .await
13342 .map(crate::Response::into_body)
13343 }
13344
13345 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13349 self.0.request.resource = v.into();
13350 self
13351 }
13352
13353 pub fn set_permissions<T, V>(mut self, v: T) -> Self
13357 where
13358 T: std::iter::IntoIterator<Item = V>,
13359 V: std::convert::Into<std::string::String>,
13360 {
13361 use std::iter::Iterator;
13362 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13363 self
13364 }
13365 }
13366
13367 #[doc(hidden)]
13368 impl crate::RequestBuilder for TestIamPermissions {
13369 fn request_options(&mut self) -> &mut crate::RequestOptions {
13370 &mut self.0.options
13371 }
13372 }
13373
13374 #[derive(Clone, Debug)]
13395 pub struct ListOperations(
13396 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13397 );
13398
13399 impl ListOperations {
13400 pub(crate) fn new(
13401 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13402 ) -> Self {
13403 Self(RequestBuilder::new(stub))
13404 }
13405
13406 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13408 mut self,
13409 v: V,
13410 ) -> Self {
13411 self.0.request = v.into();
13412 self
13413 }
13414
13415 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13417 self.0.options = v.into();
13418 self
13419 }
13420
13421 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13423 (*self.0.stub)
13424 .list_operations(self.0.request, self.0.options)
13425 .await
13426 .map(crate::Response::into_body)
13427 }
13428
13429 pub fn by_page(
13431 self,
13432 ) -> impl google_cloud_gax::paginator::Paginator<
13433 google_cloud_longrunning::model::ListOperationsResponse,
13434 crate::Error,
13435 > {
13436 use std::clone::Clone;
13437 let token = self.0.request.page_token.clone();
13438 let execute = move |token: String| {
13439 let mut builder = self.clone();
13440 builder.0.request = builder.0.request.set_page_token(token);
13441 builder.send()
13442 };
13443 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13444 }
13445
13446 pub fn by_item(
13448 self,
13449 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13450 google_cloud_longrunning::model::ListOperationsResponse,
13451 crate::Error,
13452 > {
13453 use google_cloud_gax::paginator::Paginator;
13454 self.by_page().items()
13455 }
13456
13457 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13459 self.0.request.name = v.into();
13460 self
13461 }
13462
13463 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13465 self.0.request.filter = v.into();
13466 self
13467 }
13468
13469 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13471 self.0.request.page_size = v.into();
13472 self
13473 }
13474
13475 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13477 self.0.request.page_token = v.into();
13478 self
13479 }
13480
13481 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13483 self.0.request.return_partial_success = v.into();
13484 self
13485 }
13486 }
13487
13488 #[doc(hidden)]
13489 impl crate::RequestBuilder for ListOperations {
13490 fn request_options(&mut self) -> &mut crate::RequestOptions {
13491 &mut self.0.options
13492 }
13493 }
13494
13495 #[derive(Clone, Debug)]
13512 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13513
13514 impl GetOperation {
13515 pub(crate) fn new(
13516 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13517 ) -> Self {
13518 Self(RequestBuilder::new(stub))
13519 }
13520
13521 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13523 mut self,
13524 v: V,
13525 ) -> Self {
13526 self.0.request = v.into();
13527 self
13528 }
13529
13530 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13532 self.0.options = v.into();
13533 self
13534 }
13535
13536 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13538 (*self.0.stub)
13539 .get_operation(self.0.request, self.0.options)
13540 .await
13541 .map(crate::Response::into_body)
13542 }
13543
13544 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13546 self.0.request.name = v.into();
13547 self
13548 }
13549 }
13550
13551 #[doc(hidden)]
13552 impl crate::RequestBuilder for GetOperation {
13553 fn request_options(&mut self) -> &mut crate::RequestOptions {
13554 &mut self.0.options
13555 }
13556 }
13557
13558 #[derive(Clone, Debug)]
13575 pub struct DeleteOperation(
13576 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
13577 );
13578
13579 impl DeleteOperation {
13580 pub(crate) fn new(
13581 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13582 ) -> Self {
13583 Self(RequestBuilder::new(stub))
13584 }
13585
13586 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
13588 mut self,
13589 v: V,
13590 ) -> Self {
13591 self.0.request = v.into();
13592 self
13593 }
13594
13595 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13597 self.0.options = v.into();
13598 self
13599 }
13600
13601 pub async fn send(self) -> Result<()> {
13603 (*self.0.stub)
13604 .delete_operation(self.0.request, self.0.options)
13605 .await
13606 .map(crate::Response::into_body)
13607 }
13608
13609 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13611 self.0.request.name = v.into();
13612 self
13613 }
13614 }
13615
13616 #[doc(hidden)]
13617 impl crate::RequestBuilder for DeleteOperation {
13618 fn request_options(&mut self) -> &mut crate::RequestOptions {
13619 &mut self.0.options
13620 }
13621 }
13622
13623 #[derive(Clone, Debug)]
13640 pub struct CancelOperation(
13641 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13642 );
13643
13644 impl CancelOperation {
13645 pub(crate) fn new(
13646 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13647 ) -> Self {
13648 Self(RequestBuilder::new(stub))
13649 }
13650
13651 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13653 mut self,
13654 v: V,
13655 ) -> Self {
13656 self.0.request = v.into();
13657 self
13658 }
13659
13660 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13662 self.0.options = v.into();
13663 self
13664 }
13665
13666 pub async fn send(self) -> Result<()> {
13668 (*self.0.stub)
13669 .cancel_operation(self.0.request, self.0.options)
13670 .await
13671 .map(crate::Response::into_body)
13672 }
13673
13674 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13676 self.0.request.name = v.into();
13677 self
13678 }
13679 }
13680
13681 #[doc(hidden)]
13682 impl crate::RequestBuilder for CancelOperation {
13683 fn request_options(&mut self) -> &mut crate::RequestOptions {
13684 &mut self.0.options
13685 }
13686 }
13687}
13688
13689pub mod network_security {
13690 use crate::Result;
13691
13692 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13706
13707 pub(crate) mod client {
13708 use super::super::super::client::NetworkSecurity;
13709 pub struct Factory;
13710 impl crate::ClientFactory for Factory {
13711 type Client = NetworkSecurity;
13712 type Credentials = gaxi::options::Credentials;
13713 async fn build(
13714 self,
13715 config: gaxi::options::ClientConfig,
13716 ) -> crate::ClientBuilderResult<Self::Client> {
13717 Self::Client::new(config).await
13718 }
13719 }
13720 }
13721
13722 #[derive(Clone, Debug)]
13724 pub(crate) struct RequestBuilder<R: std::default::Default> {
13725 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13726 request: R,
13727 options: crate::RequestOptions,
13728 }
13729
13730 impl<R> RequestBuilder<R>
13731 where
13732 R: std::default::Default,
13733 {
13734 pub(crate) fn new(
13735 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13736 ) -> Self {
13737 Self {
13738 stub,
13739 request: R::default(),
13740 options: crate::RequestOptions::default(),
13741 }
13742 }
13743 }
13744
13745 #[derive(Clone, Debug)]
13766 pub struct ListAuthorizationPolicies(
13767 RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
13768 );
13769
13770 impl ListAuthorizationPolicies {
13771 pub(crate) fn new(
13772 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13773 ) -> Self {
13774 Self(RequestBuilder::new(stub))
13775 }
13776
13777 pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
13779 mut self,
13780 v: V,
13781 ) -> Self {
13782 self.0.request = v.into();
13783 self
13784 }
13785
13786 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13788 self.0.options = v.into();
13789 self
13790 }
13791
13792 pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
13794 (*self.0.stub)
13795 .list_authorization_policies(self.0.request, self.0.options)
13796 .await
13797 .map(crate::Response::into_body)
13798 }
13799
13800 pub fn by_page(
13802 self,
13803 ) -> impl google_cloud_gax::paginator::Paginator<
13804 crate::model::ListAuthorizationPoliciesResponse,
13805 crate::Error,
13806 > {
13807 use std::clone::Clone;
13808 let token = self.0.request.page_token.clone();
13809 let execute = move |token: String| {
13810 let mut builder = self.clone();
13811 builder.0.request = builder.0.request.set_page_token(token);
13812 builder.send()
13813 };
13814 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13815 }
13816
13817 pub fn by_item(
13819 self,
13820 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13821 crate::model::ListAuthorizationPoliciesResponse,
13822 crate::Error,
13823 > {
13824 use google_cloud_gax::paginator::Paginator;
13825 self.by_page().items()
13826 }
13827
13828 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13832 self.0.request.parent = v.into();
13833 self
13834 }
13835
13836 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13838 self.0.request.page_size = v.into();
13839 self
13840 }
13841
13842 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13844 self.0.request.page_token = v.into();
13845 self
13846 }
13847 }
13848
13849 #[doc(hidden)]
13850 impl crate::RequestBuilder for ListAuthorizationPolicies {
13851 fn request_options(&mut self) -> &mut crate::RequestOptions {
13852 &mut self.0.options
13853 }
13854 }
13855
13856 #[derive(Clone, Debug)]
13873 pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
13874
13875 impl GetAuthorizationPolicy {
13876 pub(crate) fn new(
13877 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13878 ) -> Self {
13879 Self(RequestBuilder::new(stub))
13880 }
13881
13882 pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
13884 mut self,
13885 v: V,
13886 ) -> Self {
13887 self.0.request = v.into();
13888 self
13889 }
13890
13891 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13893 self.0.options = v.into();
13894 self
13895 }
13896
13897 pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
13899 (*self.0.stub)
13900 .get_authorization_policy(self.0.request, self.0.options)
13901 .await
13902 .map(crate::Response::into_body)
13903 }
13904
13905 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13909 self.0.request.name = v.into();
13910 self
13911 }
13912 }
13913
13914 #[doc(hidden)]
13915 impl crate::RequestBuilder for GetAuthorizationPolicy {
13916 fn request_options(&mut self) -> &mut crate::RequestOptions {
13917 &mut self.0.options
13918 }
13919 }
13920
13921 #[derive(Clone, Debug)]
13939 pub struct CreateAuthorizationPolicy(
13940 RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
13941 );
13942
13943 impl CreateAuthorizationPolicy {
13944 pub(crate) fn new(
13945 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13946 ) -> Self {
13947 Self(RequestBuilder::new(stub))
13948 }
13949
13950 pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
13952 mut self,
13953 v: V,
13954 ) -> Self {
13955 self.0.request = v.into();
13956 self
13957 }
13958
13959 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13961 self.0.options = v.into();
13962 self
13963 }
13964
13965 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13972 (*self.0.stub)
13973 .create_authorization_policy(self.0.request, self.0.options)
13974 .await
13975 .map(crate::Response::into_body)
13976 }
13977
13978 pub fn poller(
13980 self,
13981 ) -> impl google_cloud_lro::Poller<
13982 crate::model::AuthorizationPolicy,
13983 crate::model::OperationMetadata,
13984 > {
13985 type Operation = google_cloud_lro::internal::Operation<
13986 crate::model::AuthorizationPolicy,
13987 crate::model::OperationMetadata,
13988 >;
13989 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13990 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13991
13992 let stub = self.0.stub.clone();
13993 let mut options = self.0.options.clone();
13994 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13995 let query = move |name| {
13996 let stub = stub.clone();
13997 let options = options.clone();
13998 async {
13999 let op = GetOperation::new(stub)
14000 .set_name(name)
14001 .with_options(options)
14002 .send()
14003 .await?;
14004 Ok(Operation::new(op))
14005 }
14006 };
14007
14008 let start = move || async {
14009 let op = self.send().await?;
14010 Ok(Operation::new(op))
14011 };
14012
14013 google_cloud_lro::internal::new_poller(
14014 polling_error_policy,
14015 polling_backoff_policy,
14016 start,
14017 query,
14018 )
14019 }
14020
14021 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14025 self.0.request.parent = v.into();
14026 self
14027 }
14028
14029 pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14033 self.0.request.authorization_policy_id = v.into();
14034 self
14035 }
14036
14037 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14041 where
14042 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14043 {
14044 self.0.request.authorization_policy = std::option::Option::Some(v.into());
14045 self
14046 }
14047
14048 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14052 where
14053 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14054 {
14055 self.0.request.authorization_policy = v.map(|x| x.into());
14056 self
14057 }
14058 }
14059
14060 #[doc(hidden)]
14061 impl crate::RequestBuilder for CreateAuthorizationPolicy {
14062 fn request_options(&mut self) -> &mut crate::RequestOptions {
14063 &mut self.0.options
14064 }
14065 }
14066
14067 #[derive(Clone, Debug)]
14085 pub struct UpdateAuthorizationPolicy(
14086 RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
14087 );
14088
14089 impl UpdateAuthorizationPolicy {
14090 pub(crate) fn new(
14091 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14092 ) -> Self {
14093 Self(RequestBuilder::new(stub))
14094 }
14095
14096 pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
14098 mut self,
14099 v: V,
14100 ) -> Self {
14101 self.0.request = v.into();
14102 self
14103 }
14104
14105 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14107 self.0.options = v.into();
14108 self
14109 }
14110
14111 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14118 (*self.0.stub)
14119 .update_authorization_policy(self.0.request, self.0.options)
14120 .await
14121 .map(crate::Response::into_body)
14122 }
14123
14124 pub fn poller(
14126 self,
14127 ) -> impl google_cloud_lro::Poller<
14128 crate::model::AuthorizationPolicy,
14129 crate::model::OperationMetadata,
14130 > {
14131 type Operation = google_cloud_lro::internal::Operation<
14132 crate::model::AuthorizationPolicy,
14133 crate::model::OperationMetadata,
14134 >;
14135 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14136 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14137
14138 let stub = self.0.stub.clone();
14139 let mut options = self.0.options.clone();
14140 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14141 let query = move |name| {
14142 let stub = stub.clone();
14143 let options = options.clone();
14144 async {
14145 let op = GetOperation::new(stub)
14146 .set_name(name)
14147 .with_options(options)
14148 .send()
14149 .await?;
14150 Ok(Operation::new(op))
14151 }
14152 };
14153
14154 let start = move || async {
14155 let op = self.send().await?;
14156 Ok(Operation::new(op))
14157 };
14158
14159 google_cloud_lro::internal::new_poller(
14160 polling_error_policy,
14161 polling_backoff_policy,
14162 start,
14163 query,
14164 )
14165 }
14166
14167 pub fn set_update_mask<T>(mut self, v: T) -> Self
14169 where
14170 T: std::convert::Into<wkt::FieldMask>,
14171 {
14172 self.0.request.update_mask = std::option::Option::Some(v.into());
14173 self
14174 }
14175
14176 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14178 where
14179 T: std::convert::Into<wkt::FieldMask>,
14180 {
14181 self.0.request.update_mask = v.map(|x| x.into());
14182 self
14183 }
14184
14185 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14189 where
14190 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14191 {
14192 self.0.request.authorization_policy = std::option::Option::Some(v.into());
14193 self
14194 }
14195
14196 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14200 where
14201 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14202 {
14203 self.0.request.authorization_policy = v.map(|x| x.into());
14204 self
14205 }
14206 }
14207
14208 #[doc(hidden)]
14209 impl crate::RequestBuilder for UpdateAuthorizationPolicy {
14210 fn request_options(&mut self) -> &mut crate::RequestOptions {
14211 &mut self.0.options
14212 }
14213 }
14214
14215 #[derive(Clone, Debug)]
14233 pub struct DeleteAuthorizationPolicy(
14234 RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
14235 );
14236
14237 impl DeleteAuthorizationPolicy {
14238 pub(crate) fn new(
14239 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14240 ) -> Self {
14241 Self(RequestBuilder::new(stub))
14242 }
14243
14244 pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
14246 mut self,
14247 v: V,
14248 ) -> Self {
14249 self.0.request = v.into();
14250 self
14251 }
14252
14253 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14255 self.0.options = v.into();
14256 self
14257 }
14258
14259 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14266 (*self.0.stub)
14267 .delete_authorization_policy(self.0.request, self.0.options)
14268 .await
14269 .map(crate::Response::into_body)
14270 }
14271
14272 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14274 type Operation =
14275 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14276 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14277 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14278
14279 let stub = self.0.stub.clone();
14280 let mut options = self.0.options.clone();
14281 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14282 let query = move |name| {
14283 let stub = stub.clone();
14284 let options = options.clone();
14285 async {
14286 let op = GetOperation::new(stub)
14287 .set_name(name)
14288 .with_options(options)
14289 .send()
14290 .await?;
14291 Ok(Operation::new(op))
14292 }
14293 };
14294
14295 let start = move || async {
14296 let op = self.send().await?;
14297 Ok(Operation::new(op))
14298 };
14299
14300 google_cloud_lro::internal::new_unit_response_poller(
14301 polling_error_policy,
14302 polling_backoff_policy,
14303 start,
14304 query,
14305 )
14306 }
14307
14308 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14312 self.0.request.name = v.into();
14313 self
14314 }
14315 }
14316
14317 #[doc(hidden)]
14318 impl crate::RequestBuilder for DeleteAuthorizationPolicy {
14319 fn request_options(&mut self) -> &mut crate::RequestOptions {
14320 &mut self.0.options
14321 }
14322 }
14323
14324 #[derive(Clone, Debug)]
14345 pub struct ListBackendAuthenticationConfigs(
14346 RequestBuilder<crate::model::ListBackendAuthenticationConfigsRequest>,
14347 );
14348
14349 impl ListBackendAuthenticationConfigs {
14350 pub(crate) fn new(
14351 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14352 ) -> Self {
14353 Self(RequestBuilder::new(stub))
14354 }
14355
14356 pub fn with_request<V: Into<crate::model::ListBackendAuthenticationConfigsRequest>>(
14358 mut self,
14359 v: V,
14360 ) -> Self {
14361 self.0.request = v.into();
14362 self
14363 }
14364
14365 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14367 self.0.options = v.into();
14368 self
14369 }
14370
14371 pub async fn send(self) -> Result<crate::model::ListBackendAuthenticationConfigsResponse> {
14373 (*self.0.stub)
14374 .list_backend_authentication_configs(self.0.request, self.0.options)
14375 .await
14376 .map(crate::Response::into_body)
14377 }
14378
14379 pub fn by_page(
14381 self,
14382 ) -> impl google_cloud_gax::paginator::Paginator<
14383 crate::model::ListBackendAuthenticationConfigsResponse,
14384 crate::Error,
14385 > {
14386 use std::clone::Clone;
14387 let token = self.0.request.page_token.clone();
14388 let execute = move |token: String| {
14389 let mut builder = self.clone();
14390 builder.0.request = builder.0.request.set_page_token(token);
14391 builder.send()
14392 };
14393 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14394 }
14395
14396 pub fn by_item(
14398 self,
14399 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14400 crate::model::ListBackendAuthenticationConfigsResponse,
14401 crate::Error,
14402 > {
14403 use google_cloud_gax::paginator::Paginator;
14404 self.by_page().items()
14405 }
14406
14407 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14411 self.0.request.parent = v.into();
14412 self
14413 }
14414
14415 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14417 self.0.request.page_size = v.into();
14418 self
14419 }
14420
14421 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14423 self.0.request.page_token = v.into();
14424 self
14425 }
14426 }
14427
14428 #[doc(hidden)]
14429 impl crate::RequestBuilder for ListBackendAuthenticationConfigs {
14430 fn request_options(&mut self) -> &mut crate::RequestOptions {
14431 &mut self.0.options
14432 }
14433 }
14434
14435 #[derive(Clone, Debug)]
14452 pub struct GetBackendAuthenticationConfig(
14453 RequestBuilder<crate::model::GetBackendAuthenticationConfigRequest>,
14454 );
14455
14456 impl GetBackendAuthenticationConfig {
14457 pub(crate) fn new(
14458 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14459 ) -> Self {
14460 Self(RequestBuilder::new(stub))
14461 }
14462
14463 pub fn with_request<V: Into<crate::model::GetBackendAuthenticationConfigRequest>>(
14465 mut self,
14466 v: V,
14467 ) -> Self {
14468 self.0.request = v.into();
14469 self
14470 }
14471
14472 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14474 self.0.options = v.into();
14475 self
14476 }
14477
14478 pub async fn send(self) -> Result<crate::model::BackendAuthenticationConfig> {
14480 (*self.0.stub)
14481 .get_backend_authentication_config(self.0.request, self.0.options)
14482 .await
14483 .map(crate::Response::into_body)
14484 }
14485
14486 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14490 self.0.request.name = v.into();
14491 self
14492 }
14493 }
14494
14495 #[doc(hidden)]
14496 impl crate::RequestBuilder for GetBackendAuthenticationConfig {
14497 fn request_options(&mut self) -> &mut crate::RequestOptions {
14498 &mut self.0.options
14499 }
14500 }
14501
14502 #[derive(Clone, Debug)]
14520 pub struct CreateBackendAuthenticationConfig(
14521 RequestBuilder<crate::model::CreateBackendAuthenticationConfigRequest>,
14522 );
14523
14524 impl CreateBackendAuthenticationConfig {
14525 pub(crate) fn new(
14526 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14527 ) -> Self {
14528 Self(RequestBuilder::new(stub))
14529 }
14530
14531 pub fn with_request<V: Into<crate::model::CreateBackendAuthenticationConfigRequest>>(
14533 mut self,
14534 v: V,
14535 ) -> Self {
14536 self.0.request = v.into();
14537 self
14538 }
14539
14540 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14542 self.0.options = v.into();
14543 self
14544 }
14545
14546 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14553 (*self.0.stub)
14554 .create_backend_authentication_config(self.0.request, self.0.options)
14555 .await
14556 .map(crate::Response::into_body)
14557 }
14558
14559 pub fn poller(
14561 self,
14562 ) -> impl google_cloud_lro::Poller<
14563 crate::model::BackendAuthenticationConfig,
14564 crate::model::OperationMetadata,
14565 > {
14566 type Operation = google_cloud_lro::internal::Operation<
14567 crate::model::BackendAuthenticationConfig,
14568 crate::model::OperationMetadata,
14569 >;
14570 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14571 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14572
14573 let stub = self.0.stub.clone();
14574 let mut options = self.0.options.clone();
14575 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14576 let query = move |name| {
14577 let stub = stub.clone();
14578 let options = options.clone();
14579 async {
14580 let op = GetOperation::new(stub)
14581 .set_name(name)
14582 .with_options(options)
14583 .send()
14584 .await?;
14585 Ok(Operation::new(op))
14586 }
14587 };
14588
14589 let start = move || async {
14590 let op = self.send().await?;
14591 Ok(Operation::new(op))
14592 };
14593
14594 google_cloud_lro::internal::new_poller(
14595 polling_error_policy,
14596 polling_backoff_policy,
14597 start,
14598 query,
14599 )
14600 }
14601
14602 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14606 self.0.request.parent = v.into();
14607 self
14608 }
14609
14610 pub fn set_backend_authentication_config_id<T: Into<std::string::String>>(
14614 mut self,
14615 v: T,
14616 ) -> Self {
14617 self.0.request.backend_authentication_config_id = v.into();
14618 self
14619 }
14620
14621 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
14625 where
14626 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14627 {
14628 self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
14629 self
14630 }
14631
14632 pub fn set_or_clear_backend_authentication_config<T>(
14636 mut self,
14637 v: std::option::Option<T>,
14638 ) -> Self
14639 where
14640 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14641 {
14642 self.0.request.backend_authentication_config = v.map(|x| x.into());
14643 self
14644 }
14645 }
14646
14647 #[doc(hidden)]
14648 impl crate::RequestBuilder for CreateBackendAuthenticationConfig {
14649 fn request_options(&mut self) -> &mut crate::RequestOptions {
14650 &mut self.0.options
14651 }
14652 }
14653
14654 #[derive(Clone, Debug)]
14672 pub struct UpdateBackendAuthenticationConfig(
14673 RequestBuilder<crate::model::UpdateBackendAuthenticationConfigRequest>,
14674 );
14675
14676 impl UpdateBackendAuthenticationConfig {
14677 pub(crate) fn new(
14678 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14679 ) -> Self {
14680 Self(RequestBuilder::new(stub))
14681 }
14682
14683 pub fn with_request<V: Into<crate::model::UpdateBackendAuthenticationConfigRequest>>(
14685 mut self,
14686 v: V,
14687 ) -> Self {
14688 self.0.request = v.into();
14689 self
14690 }
14691
14692 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14694 self.0.options = v.into();
14695 self
14696 }
14697
14698 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14705 (*self.0.stub)
14706 .update_backend_authentication_config(self.0.request, self.0.options)
14707 .await
14708 .map(crate::Response::into_body)
14709 }
14710
14711 pub fn poller(
14713 self,
14714 ) -> impl google_cloud_lro::Poller<
14715 crate::model::BackendAuthenticationConfig,
14716 crate::model::OperationMetadata,
14717 > {
14718 type Operation = google_cloud_lro::internal::Operation<
14719 crate::model::BackendAuthenticationConfig,
14720 crate::model::OperationMetadata,
14721 >;
14722 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14723 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14724
14725 let stub = self.0.stub.clone();
14726 let mut options = self.0.options.clone();
14727 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14728 let query = move |name| {
14729 let stub = stub.clone();
14730 let options = options.clone();
14731 async {
14732 let op = GetOperation::new(stub)
14733 .set_name(name)
14734 .with_options(options)
14735 .send()
14736 .await?;
14737 Ok(Operation::new(op))
14738 }
14739 };
14740
14741 let start = move || async {
14742 let op = self.send().await?;
14743 Ok(Operation::new(op))
14744 };
14745
14746 google_cloud_lro::internal::new_poller(
14747 polling_error_policy,
14748 polling_backoff_policy,
14749 start,
14750 query,
14751 )
14752 }
14753
14754 pub fn set_update_mask<T>(mut self, v: T) -> Self
14756 where
14757 T: std::convert::Into<wkt::FieldMask>,
14758 {
14759 self.0.request.update_mask = std::option::Option::Some(v.into());
14760 self
14761 }
14762
14763 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14765 where
14766 T: std::convert::Into<wkt::FieldMask>,
14767 {
14768 self.0.request.update_mask = v.map(|x| x.into());
14769 self
14770 }
14771
14772 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
14776 where
14777 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14778 {
14779 self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
14780 self
14781 }
14782
14783 pub fn set_or_clear_backend_authentication_config<T>(
14787 mut self,
14788 v: std::option::Option<T>,
14789 ) -> Self
14790 where
14791 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14792 {
14793 self.0.request.backend_authentication_config = v.map(|x| x.into());
14794 self
14795 }
14796 }
14797
14798 #[doc(hidden)]
14799 impl crate::RequestBuilder for UpdateBackendAuthenticationConfig {
14800 fn request_options(&mut self) -> &mut crate::RequestOptions {
14801 &mut self.0.options
14802 }
14803 }
14804
14805 #[derive(Clone, Debug)]
14823 pub struct DeleteBackendAuthenticationConfig(
14824 RequestBuilder<crate::model::DeleteBackendAuthenticationConfigRequest>,
14825 );
14826
14827 impl DeleteBackendAuthenticationConfig {
14828 pub(crate) fn new(
14829 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14830 ) -> Self {
14831 Self(RequestBuilder::new(stub))
14832 }
14833
14834 pub fn with_request<V: Into<crate::model::DeleteBackendAuthenticationConfigRequest>>(
14836 mut self,
14837 v: V,
14838 ) -> Self {
14839 self.0.request = v.into();
14840 self
14841 }
14842
14843 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14845 self.0.options = v.into();
14846 self
14847 }
14848
14849 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14856 (*self.0.stub)
14857 .delete_backend_authentication_config(self.0.request, self.0.options)
14858 .await
14859 .map(crate::Response::into_body)
14860 }
14861
14862 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14864 type Operation =
14865 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14866 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14867 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14868
14869 let stub = self.0.stub.clone();
14870 let mut options = self.0.options.clone();
14871 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14872 let query = move |name| {
14873 let stub = stub.clone();
14874 let options = options.clone();
14875 async {
14876 let op = GetOperation::new(stub)
14877 .set_name(name)
14878 .with_options(options)
14879 .send()
14880 .await?;
14881 Ok(Operation::new(op))
14882 }
14883 };
14884
14885 let start = move || async {
14886 let op = self.send().await?;
14887 Ok(Operation::new(op))
14888 };
14889
14890 google_cloud_lro::internal::new_unit_response_poller(
14891 polling_error_policy,
14892 polling_backoff_policy,
14893 start,
14894 query,
14895 )
14896 }
14897
14898 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14902 self.0.request.name = v.into();
14903 self
14904 }
14905
14906 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
14908 self.0.request.etag = v.into();
14909 self
14910 }
14911 }
14912
14913 #[doc(hidden)]
14914 impl crate::RequestBuilder for DeleteBackendAuthenticationConfig {
14915 fn request_options(&mut self) -> &mut crate::RequestOptions {
14916 &mut self.0.options
14917 }
14918 }
14919
14920 #[derive(Clone, Debug)]
14941 pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
14942
14943 impl ListServerTlsPolicies {
14944 pub(crate) fn new(
14945 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14946 ) -> Self {
14947 Self(RequestBuilder::new(stub))
14948 }
14949
14950 pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
14952 mut self,
14953 v: V,
14954 ) -> Self {
14955 self.0.request = v.into();
14956 self
14957 }
14958
14959 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14961 self.0.options = v.into();
14962 self
14963 }
14964
14965 pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
14967 (*self.0.stub)
14968 .list_server_tls_policies(self.0.request, self.0.options)
14969 .await
14970 .map(crate::Response::into_body)
14971 }
14972
14973 pub fn by_page(
14975 self,
14976 ) -> impl google_cloud_gax::paginator::Paginator<
14977 crate::model::ListServerTlsPoliciesResponse,
14978 crate::Error,
14979 > {
14980 use std::clone::Clone;
14981 let token = self.0.request.page_token.clone();
14982 let execute = move |token: String| {
14983 let mut builder = self.clone();
14984 builder.0.request = builder.0.request.set_page_token(token);
14985 builder.send()
14986 };
14987 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14988 }
14989
14990 pub fn by_item(
14992 self,
14993 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14994 crate::model::ListServerTlsPoliciesResponse,
14995 crate::Error,
14996 > {
14997 use google_cloud_gax::paginator::Paginator;
14998 self.by_page().items()
14999 }
15000
15001 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15005 self.0.request.parent = v.into();
15006 self
15007 }
15008
15009 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15011 self.0.request.page_size = v.into();
15012 self
15013 }
15014
15015 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15017 self.0.request.page_token = v.into();
15018 self
15019 }
15020
15021 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15023 self.0.request.return_partial_success = v.into();
15024 self
15025 }
15026 }
15027
15028 #[doc(hidden)]
15029 impl crate::RequestBuilder for ListServerTlsPolicies {
15030 fn request_options(&mut self) -> &mut crate::RequestOptions {
15031 &mut self.0.options
15032 }
15033 }
15034
15035 #[derive(Clone, Debug)]
15052 pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
15053
15054 impl GetServerTlsPolicy {
15055 pub(crate) fn new(
15056 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15057 ) -> Self {
15058 Self(RequestBuilder::new(stub))
15059 }
15060
15061 pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
15063 mut self,
15064 v: V,
15065 ) -> Self {
15066 self.0.request = v.into();
15067 self
15068 }
15069
15070 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15072 self.0.options = v.into();
15073 self
15074 }
15075
15076 pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
15078 (*self.0.stub)
15079 .get_server_tls_policy(self.0.request, self.0.options)
15080 .await
15081 .map(crate::Response::into_body)
15082 }
15083
15084 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15088 self.0.request.name = v.into();
15089 self
15090 }
15091 }
15092
15093 #[doc(hidden)]
15094 impl crate::RequestBuilder for GetServerTlsPolicy {
15095 fn request_options(&mut self) -> &mut crate::RequestOptions {
15096 &mut self.0.options
15097 }
15098 }
15099
15100 #[derive(Clone, Debug)]
15118 pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
15119
15120 impl CreateServerTlsPolicy {
15121 pub(crate) fn new(
15122 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15123 ) -> Self {
15124 Self(RequestBuilder::new(stub))
15125 }
15126
15127 pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
15129 mut self,
15130 v: V,
15131 ) -> Self {
15132 self.0.request = v.into();
15133 self
15134 }
15135
15136 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15138 self.0.options = v.into();
15139 self
15140 }
15141
15142 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15149 (*self.0.stub)
15150 .create_server_tls_policy(self.0.request, self.0.options)
15151 .await
15152 .map(crate::Response::into_body)
15153 }
15154
15155 pub fn poller(
15157 self,
15158 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15159 {
15160 type Operation = google_cloud_lro::internal::Operation<
15161 crate::model::ServerTlsPolicy,
15162 crate::model::OperationMetadata,
15163 >;
15164 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15165 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15166
15167 let stub = self.0.stub.clone();
15168 let mut options = self.0.options.clone();
15169 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15170 let query = move |name| {
15171 let stub = stub.clone();
15172 let options = options.clone();
15173 async {
15174 let op = GetOperation::new(stub)
15175 .set_name(name)
15176 .with_options(options)
15177 .send()
15178 .await?;
15179 Ok(Operation::new(op))
15180 }
15181 };
15182
15183 let start = move || async {
15184 let op = self.send().await?;
15185 Ok(Operation::new(op))
15186 };
15187
15188 google_cloud_lro::internal::new_poller(
15189 polling_error_policy,
15190 polling_backoff_policy,
15191 start,
15192 query,
15193 )
15194 }
15195
15196 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15200 self.0.request.parent = v.into();
15201 self
15202 }
15203
15204 pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15208 self.0.request.server_tls_policy_id = v.into();
15209 self
15210 }
15211
15212 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15216 where
15217 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15218 {
15219 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15220 self
15221 }
15222
15223 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15227 where
15228 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15229 {
15230 self.0.request.server_tls_policy = v.map(|x| x.into());
15231 self
15232 }
15233 }
15234
15235 #[doc(hidden)]
15236 impl crate::RequestBuilder for CreateServerTlsPolicy {
15237 fn request_options(&mut self) -> &mut crate::RequestOptions {
15238 &mut self.0.options
15239 }
15240 }
15241
15242 #[derive(Clone, Debug)]
15260 pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
15261
15262 impl UpdateServerTlsPolicy {
15263 pub(crate) fn new(
15264 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15265 ) -> Self {
15266 Self(RequestBuilder::new(stub))
15267 }
15268
15269 pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
15271 mut self,
15272 v: V,
15273 ) -> Self {
15274 self.0.request = v.into();
15275 self
15276 }
15277
15278 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15280 self.0.options = v.into();
15281 self
15282 }
15283
15284 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15291 (*self.0.stub)
15292 .update_server_tls_policy(self.0.request, self.0.options)
15293 .await
15294 .map(crate::Response::into_body)
15295 }
15296
15297 pub fn poller(
15299 self,
15300 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15301 {
15302 type Operation = google_cloud_lro::internal::Operation<
15303 crate::model::ServerTlsPolicy,
15304 crate::model::OperationMetadata,
15305 >;
15306 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15307 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15308
15309 let stub = self.0.stub.clone();
15310 let mut options = self.0.options.clone();
15311 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15312 let query = move |name| {
15313 let stub = stub.clone();
15314 let options = options.clone();
15315 async {
15316 let op = GetOperation::new(stub)
15317 .set_name(name)
15318 .with_options(options)
15319 .send()
15320 .await?;
15321 Ok(Operation::new(op))
15322 }
15323 };
15324
15325 let start = move || async {
15326 let op = self.send().await?;
15327 Ok(Operation::new(op))
15328 };
15329
15330 google_cloud_lro::internal::new_poller(
15331 polling_error_policy,
15332 polling_backoff_policy,
15333 start,
15334 query,
15335 )
15336 }
15337
15338 pub fn set_update_mask<T>(mut self, v: T) -> Self
15340 where
15341 T: std::convert::Into<wkt::FieldMask>,
15342 {
15343 self.0.request.update_mask = std::option::Option::Some(v.into());
15344 self
15345 }
15346
15347 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15349 where
15350 T: std::convert::Into<wkt::FieldMask>,
15351 {
15352 self.0.request.update_mask = v.map(|x| x.into());
15353 self
15354 }
15355
15356 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15360 where
15361 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15362 {
15363 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15364 self
15365 }
15366
15367 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15371 where
15372 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15373 {
15374 self.0.request.server_tls_policy = v.map(|x| x.into());
15375 self
15376 }
15377 }
15378
15379 #[doc(hidden)]
15380 impl crate::RequestBuilder for UpdateServerTlsPolicy {
15381 fn request_options(&mut self) -> &mut crate::RequestOptions {
15382 &mut self.0.options
15383 }
15384 }
15385
15386 #[derive(Clone, Debug)]
15404 pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
15405
15406 impl DeleteServerTlsPolicy {
15407 pub(crate) fn new(
15408 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15409 ) -> Self {
15410 Self(RequestBuilder::new(stub))
15411 }
15412
15413 pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
15415 mut self,
15416 v: V,
15417 ) -> Self {
15418 self.0.request = v.into();
15419 self
15420 }
15421
15422 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15424 self.0.options = v.into();
15425 self
15426 }
15427
15428 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15435 (*self.0.stub)
15436 .delete_server_tls_policy(self.0.request, self.0.options)
15437 .await
15438 .map(crate::Response::into_body)
15439 }
15440
15441 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15443 type Operation =
15444 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15445 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15446 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15447
15448 let stub = self.0.stub.clone();
15449 let mut options = self.0.options.clone();
15450 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15451 let query = move |name| {
15452 let stub = stub.clone();
15453 let options = options.clone();
15454 async {
15455 let op = GetOperation::new(stub)
15456 .set_name(name)
15457 .with_options(options)
15458 .send()
15459 .await?;
15460 Ok(Operation::new(op))
15461 }
15462 };
15463
15464 let start = move || async {
15465 let op = self.send().await?;
15466 Ok(Operation::new(op))
15467 };
15468
15469 google_cloud_lro::internal::new_unit_response_poller(
15470 polling_error_policy,
15471 polling_backoff_policy,
15472 start,
15473 query,
15474 )
15475 }
15476
15477 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15481 self.0.request.name = v.into();
15482 self
15483 }
15484 }
15485
15486 #[doc(hidden)]
15487 impl crate::RequestBuilder for DeleteServerTlsPolicy {
15488 fn request_options(&mut self) -> &mut crate::RequestOptions {
15489 &mut self.0.options
15490 }
15491 }
15492
15493 #[derive(Clone, Debug)]
15514 pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
15515
15516 impl ListClientTlsPolicies {
15517 pub(crate) fn new(
15518 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15519 ) -> Self {
15520 Self(RequestBuilder::new(stub))
15521 }
15522
15523 pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
15525 mut self,
15526 v: V,
15527 ) -> Self {
15528 self.0.request = v.into();
15529 self
15530 }
15531
15532 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15534 self.0.options = v.into();
15535 self
15536 }
15537
15538 pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
15540 (*self.0.stub)
15541 .list_client_tls_policies(self.0.request, self.0.options)
15542 .await
15543 .map(crate::Response::into_body)
15544 }
15545
15546 pub fn by_page(
15548 self,
15549 ) -> impl google_cloud_gax::paginator::Paginator<
15550 crate::model::ListClientTlsPoliciesResponse,
15551 crate::Error,
15552 > {
15553 use std::clone::Clone;
15554 let token = self.0.request.page_token.clone();
15555 let execute = move |token: String| {
15556 let mut builder = self.clone();
15557 builder.0.request = builder.0.request.set_page_token(token);
15558 builder.send()
15559 };
15560 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15561 }
15562
15563 pub fn by_item(
15565 self,
15566 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15567 crate::model::ListClientTlsPoliciesResponse,
15568 crate::Error,
15569 > {
15570 use google_cloud_gax::paginator::Paginator;
15571 self.by_page().items()
15572 }
15573
15574 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15578 self.0.request.parent = v.into();
15579 self
15580 }
15581
15582 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15584 self.0.request.page_size = v.into();
15585 self
15586 }
15587
15588 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15590 self.0.request.page_token = v.into();
15591 self
15592 }
15593 }
15594
15595 #[doc(hidden)]
15596 impl crate::RequestBuilder for ListClientTlsPolicies {
15597 fn request_options(&mut self) -> &mut crate::RequestOptions {
15598 &mut self.0.options
15599 }
15600 }
15601
15602 #[derive(Clone, Debug)]
15619 pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
15620
15621 impl GetClientTlsPolicy {
15622 pub(crate) fn new(
15623 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15624 ) -> Self {
15625 Self(RequestBuilder::new(stub))
15626 }
15627
15628 pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
15630 mut self,
15631 v: V,
15632 ) -> Self {
15633 self.0.request = v.into();
15634 self
15635 }
15636
15637 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15639 self.0.options = v.into();
15640 self
15641 }
15642
15643 pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
15645 (*self.0.stub)
15646 .get_client_tls_policy(self.0.request, self.0.options)
15647 .await
15648 .map(crate::Response::into_body)
15649 }
15650
15651 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15655 self.0.request.name = v.into();
15656 self
15657 }
15658 }
15659
15660 #[doc(hidden)]
15661 impl crate::RequestBuilder for GetClientTlsPolicy {
15662 fn request_options(&mut self) -> &mut crate::RequestOptions {
15663 &mut self.0.options
15664 }
15665 }
15666
15667 #[derive(Clone, Debug)]
15685 pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
15686
15687 impl CreateClientTlsPolicy {
15688 pub(crate) fn new(
15689 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15690 ) -> Self {
15691 Self(RequestBuilder::new(stub))
15692 }
15693
15694 pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
15696 mut self,
15697 v: V,
15698 ) -> Self {
15699 self.0.request = v.into();
15700 self
15701 }
15702
15703 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15705 self.0.options = v.into();
15706 self
15707 }
15708
15709 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15716 (*self.0.stub)
15717 .create_client_tls_policy(self.0.request, self.0.options)
15718 .await
15719 .map(crate::Response::into_body)
15720 }
15721
15722 pub fn poller(
15724 self,
15725 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
15726 {
15727 type Operation = google_cloud_lro::internal::Operation<
15728 crate::model::ClientTlsPolicy,
15729 crate::model::OperationMetadata,
15730 >;
15731 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15732 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15733
15734 let stub = self.0.stub.clone();
15735 let mut options = self.0.options.clone();
15736 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15737 let query = move |name| {
15738 let stub = stub.clone();
15739 let options = options.clone();
15740 async {
15741 let op = GetOperation::new(stub)
15742 .set_name(name)
15743 .with_options(options)
15744 .send()
15745 .await?;
15746 Ok(Operation::new(op))
15747 }
15748 };
15749
15750 let start = move || async {
15751 let op = self.send().await?;
15752 Ok(Operation::new(op))
15753 };
15754
15755 google_cloud_lro::internal::new_poller(
15756 polling_error_policy,
15757 polling_backoff_policy,
15758 start,
15759 query,
15760 )
15761 }
15762
15763 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15767 self.0.request.parent = v.into();
15768 self
15769 }
15770
15771 pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15775 self.0.request.client_tls_policy_id = v.into();
15776 self
15777 }
15778
15779 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
15783 where
15784 T: std::convert::Into<crate::model::ClientTlsPolicy>,
15785 {
15786 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
15787 self
15788 }
15789
15790 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15794 where
15795 T: std::convert::Into<crate::model::ClientTlsPolicy>,
15796 {
15797 self.0.request.client_tls_policy = v.map(|x| x.into());
15798 self
15799 }
15800 }
15801
15802 #[doc(hidden)]
15803 impl crate::RequestBuilder for CreateClientTlsPolicy {
15804 fn request_options(&mut self) -> &mut crate::RequestOptions {
15805 &mut self.0.options
15806 }
15807 }
15808
15809 #[derive(Clone, Debug)]
15827 pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
15828
15829 impl UpdateClientTlsPolicy {
15830 pub(crate) fn new(
15831 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15832 ) -> Self {
15833 Self(RequestBuilder::new(stub))
15834 }
15835
15836 pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
15838 mut self,
15839 v: V,
15840 ) -> Self {
15841 self.0.request = v.into();
15842 self
15843 }
15844
15845 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15847 self.0.options = v.into();
15848 self
15849 }
15850
15851 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15858 (*self.0.stub)
15859 .update_client_tls_policy(self.0.request, self.0.options)
15860 .await
15861 .map(crate::Response::into_body)
15862 }
15863
15864 pub fn poller(
15866 self,
15867 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
15868 {
15869 type Operation = google_cloud_lro::internal::Operation<
15870 crate::model::ClientTlsPolicy,
15871 crate::model::OperationMetadata,
15872 >;
15873 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15874 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15875
15876 let stub = self.0.stub.clone();
15877 let mut options = self.0.options.clone();
15878 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15879 let query = move |name| {
15880 let stub = stub.clone();
15881 let options = options.clone();
15882 async {
15883 let op = GetOperation::new(stub)
15884 .set_name(name)
15885 .with_options(options)
15886 .send()
15887 .await?;
15888 Ok(Operation::new(op))
15889 }
15890 };
15891
15892 let start = move || async {
15893 let op = self.send().await?;
15894 Ok(Operation::new(op))
15895 };
15896
15897 google_cloud_lro::internal::new_poller(
15898 polling_error_policy,
15899 polling_backoff_policy,
15900 start,
15901 query,
15902 )
15903 }
15904
15905 pub fn set_update_mask<T>(mut self, v: T) -> Self
15907 where
15908 T: std::convert::Into<wkt::FieldMask>,
15909 {
15910 self.0.request.update_mask = std::option::Option::Some(v.into());
15911 self
15912 }
15913
15914 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15916 where
15917 T: std::convert::Into<wkt::FieldMask>,
15918 {
15919 self.0.request.update_mask = v.map(|x| x.into());
15920 self
15921 }
15922
15923 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
15927 where
15928 T: std::convert::Into<crate::model::ClientTlsPolicy>,
15929 {
15930 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
15931 self
15932 }
15933
15934 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15938 where
15939 T: std::convert::Into<crate::model::ClientTlsPolicy>,
15940 {
15941 self.0.request.client_tls_policy = v.map(|x| x.into());
15942 self
15943 }
15944 }
15945
15946 #[doc(hidden)]
15947 impl crate::RequestBuilder for UpdateClientTlsPolicy {
15948 fn request_options(&mut self) -> &mut crate::RequestOptions {
15949 &mut self.0.options
15950 }
15951 }
15952
15953 #[derive(Clone, Debug)]
15971 pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
15972
15973 impl DeleteClientTlsPolicy {
15974 pub(crate) fn new(
15975 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15976 ) -> Self {
15977 Self(RequestBuilder::new(stub))
15978 }
15979
15980 pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
15982 mut self,
15983 v: V,
15984 ) -> Self {
15985 self.0.request = v.into();
15986 self
15987 }
15988
15989 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15991 self.0.options = v.into();
15992 self
15993 }
15994
15995 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16002 (*self.0.stub)
16003 .delete_client_tls_policy(self.0.request, self.0.options)
16004 .await
16005 .map(crate::Response::into_body)
16006 }
16007
16008 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16010 type Operation =
16011 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16012 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16013 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16014
16015 let stub = self.0.stub.clone();
16016 let mut options = self.0.options.clone();
16017 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16018 let query = move |name| {
16019 let stub = stub.clone();
16020 let options = options.clone();
16021 async {
16022 let op = GetOperation::new(stub)
16023 .set_name(name)
16024 .with_options(options)
16025 .send()
16026 .await?;
16027 Ok(Operation::new(op))
16028 }
16029 };
16030
16031 let start = move || async {
16032 let op = self.send().await?;
16033 Ok(Operation::new(op))
16034 };
16035
16036 google_cloud_lro::internal::new_unit_response_poller(
16037 polling_error_policy,
16038 polling_backoff_policy,
16039 start,
16040 query,
16041 )
16042 }
16043
16044 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16048 self.0.request.name = v.into();
16049 self
16050 }
16051 }
16052
16053 #[doc(hidden)]
16054 impl crate::RequestBuilder for DeleteClientTlsPolicy {
16055 fn request_options(&mut self) -> &mut crate::RequestOptions {
16056 &mut self.0.options
16057 }
16058 }
16059
16060 #[derive(Clone, Debug)]
16081 pub struct ListGatewaySecurityPolicies(
16082 RequestBuilder<crate::model::ListGatewaySecurityPoliciesRequest>,
16083 );
16084
16085 impl ListGatewaySecurityPolicies {
16086 pub(crate) fn new(
16087 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16088 ) -> Self {
16089 Self(RequestBuilder::new(stub))
16090 }
16091
16092 pub fn with_request<V: Into<crate::model::ListGatewaySecurityPoliciesRequest>>(
16094 mut self,
16095 v: V,
16096 ) -> Self {
16097 self.0.request = v.into();
16098 self
16099 }
16100
16101 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16103 self.0.options = v.into();
16104 self
16105 }
16106
16107 pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPoliciesResponse> {
16109 (*self.0.stub)
16110 .list_gateway_security_policies(self.0.request, self.0.options)
16111 .await
16112 .map(crate::Response::into_body)
16113 }
16114
16115 pub fn by_page(
16117 self,
16118 ) -> impl google_cloud_gax::paginator::Paginator<
16119 crate::model::ListGatewaySecurityPoliciesResponse,
16120 crate::Error,
16121 > {
16122 use std::clone::Clone;
16123 let token = self.0.request.page_token.clone();
16124 let execute = move |token: String| {
16125 let mut builder = self.clone();
16126 builder.0.request = builder.0.request.set_page_token(token);
16127 builder.send()
16128 };
16129 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16130 }
16131
16132 pub fn by_item(
16134 self,
16135 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16136 crate::model::ListGatewaySecurityPoliciesResponse,
16137 crate::Error,
16138 > {
16139 use google_cloud_gax::paginator::Paginator;
16140 self.by_page().items()
16141 }
16142
16143 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16147 self.0.request.parent = v.into();
16148 self
16149 }
16150
16151 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16153 self.0.request.page_size = v.into();
16154 self
16155 }
16156
16157 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16159 self.0.request.page_token = v.into();
16160 self
16161 }
16162 }
16163
16164 #[doc(hidden)]
16165 impl crate::RequestBuilder for ListGatewaySecurityPolicies {
16166 fn request_options(&mut self) -> &mut crate::RequestOptions {
16167 &mut self.0.options
16168 }
16169 }
16170
16171 #[derive(Clone, Debug)]
16188 pub struct GetGatewaySecurityPolicy(
16189 RequestBuilder<crate::model::GetGatewaySecurityPolicyRequest>,
16190 );
16191
16192 impl GetGatewaySecurityPolicy {
16193 pub(crate) fn new(
16194 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16195 ) -> Self {
16196 Self(RequestBuilder::new(stub))
16197 }
16198
16199 pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRequest>>(
16201 mut self,
16202 v: V,
16203 ) -> Self {
16204 self.0.request = v.into();
16205 self
16206 }
16207
16208 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16210 self.0.options = v.into();
16211 self
16212 }
16213
16214 pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicy> {
16216 (*self.0.stub)
16217 .get_gateway_security_policy(self.0.request, self.0.options)
16218 .await
16219 .map(crate::Response::into_body)
16220 }
16221
16222 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16226 self.0.request.name = v.into();
16227 self
16228 }
16229 }
16230
16231 #[doc(hidden)]
16232 impl crate::RequestBuilder for GetGatewaySecurityPolicy {
16233 fn request_options(&mut self) -> &mut crate::RequestOptions {
16234 &mut self.0.options
16235 }
16236 }
16237
16238 #[derive(Clone, Debug)]
16256 pub struct CreateGatewaySecurityPolicy(
16257 RequestBuilder<crate::model::CreateGatewaySecurityPolicyRequest>,
16258 );
16259
16260 impl CreateGatewaySecurityPolicy {
16261 pub(crate) fn new(
16262 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16263 ) -> Self {
16264 Self(RequestBuilder::new(stub))
16265 }
16266
16267 pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRequest>>(
16269 mut self,
16270 v: V,
16271 ) -> Self {
16272 self.0.request = v.into();
16273 self
16274 }
16275
16276 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16278 self.0.options = v.into();
16279 self
16280 }
16281
16282 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16289 (*self.0.stub)
16290 .create_gateway_security_policy(self.0.request, self.0.options)
16291 .await
16292 .map(crate::Response::into_body)
16293 }
16294
16295 pub fn poller(
16297 self,
16298 ) -> impl google_cloud_lro::Poller<
16299 crate::model::GatewaySecurityPolicy,
16300 crate::model::OperationMetadata,
16301 > {
16302 type Operation = google_cloud_lro::internal::Operation<
16303 crate::model::GatewaySecurityPolicy,
16304 crate::model::OperationMetadata,
16305 >;
16306 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16307 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16308
16309 let stub = self.0.stub.clone();
16310 let mut options = self.0.options.clone();
16311 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16312 let query = move |name| {
16313 let stub = stub.clone();
16314 let options = options.clone();
16315 async {
16316 let op = GetOperation::new(stub)
16317 .set_name(name)
16318 .with_options(options)
16319 .send()
16320 .await?;
16321 Ok(Operation::new(op))
16322 }
16323 };
16324
16325 let start = move || async {
16326 let op = self.send().await?;
16327 Ok(Operation::new(op))
16328 };
16329
16330 google_cloud_lro::internal::new_poller(
16331 polling_error_policy,
16332 polling_backoff_policy,
16333 start,
16334 query,
16335 )
16336 }
16337
16338 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16342 self.0.request.parent = v.into();
16343 self
16344 }
16345
16346 pub fn set_gateway_security_policy_id<T: Into<std::string::String>>(
16350 mut self,
16351 v: T,
16352 ) -> Self {
16353 self.0.request.gateway_security_policy_id = v.into();
16354 self
16355 }
16356
16357 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16361 where
16362 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16363 {
16364 self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16365 self
16366 }
16367
16368 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16372 where
16373 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16374 {
16375 self.0.request.gateway_security_policy = v.map(|x| x.into());
16376 self
16377 }
16378 }
16379
16380 #[doc(hidden)]
16381 impl crate::RequestBuilder for CreateGatewaySecurityPolicy {
16382 fn request_options(&mut self) -> &mut crate::RequestOptions {
16383 &mut self.0.options
16384 }
16385 }
16386
16387 #[derive(Clone, Debug)]
16405 pub struct UpdateGatewaySecurityPolicy(
16406 RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRequest>,
16407 );
16408
16409 impl UpdateGatewaySecurityPolicy {
16410 pub(crate) fn new(
16411 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16412 ) -> Self {
16413 Self(RequestBuilder::new(stub))
16414 }
16415
16416 pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRequest>>(
16418 mut self,
16419 v: V,
16420 ) -> Self {
16421 self.0.request = v.into();
16422 self
16423 }
16424
16425 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16427 self.0.options = v.into();
16428 self
16429 }
16430
16431 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16438 (*self.0.stub)
16439 .update_gateway_security_policy(self.0.request, self.0.options)
16440 .await
16441 .map(crate::Response::into_body)
16442 }
16443
16444 pub fn poller(
16446 self,
16447 ) -> impl google_cloud_lro::Poller<
16448 crate::model::GatewaySecurityPolicy,
16449 crate::model::OperationMetadata,
16450 > {
16451 type Operation = google_cloud_lro::internal::Operation<
16452 crate::model::GatewaySecurityPolicy,
16453 crate::model::OperationMetadata,
16454 >;
16455 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16456 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16457
16458 let stub = self.0.stub.clone();
16459 let mut options = self.0.options.clone();
16460 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16461 let query = move |name| {
16462 let stub = stub.clone();
16463 let options = options.clone();
16464 async {
16465 let op = GetOperation::new(stub)
16466 .set_name(name)
16467 .with_options(options)
16468 .send()
16469 .await?;
16470 Ok(Operation::new(op))
16471 }
16472 };
16473
16474 let start = move || async {
16475 let op = self.send().await?;
16476 Ok(Operation::new(op))
16477 };
16478
16479 google_cloud_lro::internal::new_poller(
16480 polling_error_policy,
16481 polling_backoff_policy,
16482 start,
16483 query,
16484 )
16485 }
16486
16487 pub fn set_update_mask<T>(mut self, v: T) -> Self
16489 where
16490 T: std::convert::Into<wkt::FieldMask>,
16491 {
16492 self.0.request.update_mask = std::option::Option::Some(v.into());
16493 self
16494 }
16495
16496 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16498 where
16499 T: std::convert::Into<wkt::FieldMask>,
16500 {
16501 self.0.request.update_mask = v.map(|x| x.into());
16502 self
16503 }
16504
16505 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16509 where
16510 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16511 {
16512 self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16513 self
16514 }
16515
16516 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16520 where
16521 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16522 {
16523 self.0.request.gateway_security_policy = v.map(|x| x.into());
16524 self
16525 }
16526 }
16527
16528 #[doc(hidden)]
16529 impl crate::RequestBuilder for UpdateGatewaySecurityPolicy {
16530 fn request_options(&mut self) -> &mut crate::RequestOptions {
16531 &mut self.0.options
16532 }
16533 }
16534
16535 #[derive(Clone, Debug)]
16553 pub struct DeleteGatewaySecurityPolicy(
16554 RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRequest>,
16555 );
16556
16557 impl DeleteGatewaySecurityPolicy {
16558 pub(crate) fn new(
16559 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16560 ) -> Self {
16561 Self(RequestBuilder::new(stub))
16562 }
16563
16564 pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRequest>>(
16566 mut self,
16567 v: V,
16568 ) -> Self {
16569 self.0.request = v.into();
16570 self
16571 }
16572
16573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16575 self.0.options = v.into();
16576 self
16577 }
16578
16579 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16586 (*self.0.stub)
16587 .delete_gateway_security_policy(self.0.request, self.0.options)
16588 .await
16589 .map(crate::Response::into_body)
16590 }
16591
16592 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16594 type Operation =
16595 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16596 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16597 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16598
16599 let stub = self.0.stub.clone();
16600 let mut options = self.0.options.clone();
16601 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16602 let query = move |name| {
16603 let stub = stub.clone();
16604 let options = options.clone();
16605 async {
16606 let op = GetOperation::new(stub)
16607 .set_name(name)
16608 .with_options(options)
16609 .send()
16610 .await?;
16611 Ok(Operation::new(op))
16612 }
16613 };
16614
16615 let start = move || async {
16616 let op = self.send().await?;
16617 Ok(Operation::new(op))
16618 };
16619
16620 google_cloud_lro::internal::new_unit_response_poller(
16621 polling_error_policy,
16622 polling_backoff_policy,
16623 start,
16624 query,
16625 )
16626 }
16627
16628 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16632 self.0.request.name = v.into();
16633 self
16634 }
16635 }
16636
16637 #[doc(hidden)]
16638 impl crate::RequestBuilder for DeleteGatewaySecurityPolicy {
16639 fn request_options(&mut self) -> &mut crate::RequestOptions {
16640 &mut self.0.options
16641 }
16642 }
16643
16644 #[derive(Clone, Debug)]
16665 pub struct ListGatewaySecurityPolicyRules(
16666 RequestBuilder<crate::model::ListGatewaySecurityPolicyRulesRequest>,
16667 );
16668
16669 impl ListGatewaySecurityPolicyRules {
16670 pub(crate) fn new(
16671 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16672 ) -> Self {
16673 Self(RequestBuilder::new(stub))
16674 }
16675
16676 pub fn with_request<V: Into<crate::model::ListGatewaySecurityPolicyRulesRequest>>(
16678 mut self,
16679 v: V,
16680 ) -> Self {
16681 self.0.request = v.into();
16682 self
16683 }
16684
16685 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16687 self.0.options = v.into();
16688 self
16689 }
16690
16691 pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPolicyRulesResponse> {
16693 (*self.0.stub)
16694 .list_gateway_security_policy_rules(self.0.request, self.0.options)
16695 .await
16696 .map(crate::Response::into_body)
16697 }
16698
16699 pub fn by_page(
16701 self,
16702 ) -> impl google_cloud_gax::paginator::Paginator<
16703 crate::model::ListGatewaySecurityPolicyRulesResponse,
16704 crate::Error,
16705 > {
16706 use std::clone::Clone;
16707 let token = self.0.request.page_token.clone();
16708 let execute = move |token: String| {
16709 let mut builder = self.clone();
16710 builder.0.request = builder.0.request.set_page_token(token);
16711 builder.send()
16712 };
16713 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16714 }
16715
16716 pub fn by_item(
16718 self,
16719 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16720 crate::model::ListGatewaySecurityPolicyRulesResponse,
16721 crate::Error,
16722 > {
16723 use google_cloud_gax::paginator::Paginator;
16724 self.by_page().items()
16725 }
16726
16727 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16731 self.0.request.parent = v.into();
16732 self
16733 }
16734
16735 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16737 self.0.request.page_size = v.into();
16738 self
16739 }
16740
16741 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16743 self.0.request.page_token = v.into();
16744 self
16745 }
16746 }
16747
16748 #[doc(hidden)]
16749 impl crate::RequestBuilder for ListGatewaySecurityPolicyRules {
16750 fn request_options(&mut self) -> &mut crate::RequestOptions {
16751 &mut self.0.options
16752 }
16753 }
16754
16755 #[derive(Clone, Debug)]
16772 pub struct GetGatewaySecurityPolicyRule(
16773 RequestBuilder<crate::model::GetGatewaySecurityPolicyRuleRequest>,
16774 );
16775
16776 impl GetGatewaySecurityPolicyRule {
16777 pub(crate) fn new(
16778 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16779 ) -> Self {
16780 Self(RequestBuilder::new(stub))
16781 }
16782
16783 pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRuleRequest>>(
16785 mut self,
16786 v: V,
16787 ) -> Self {
16788 self.0.request = v.into();
16789 self
16790 }
16791
16792 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16794 self.0.options = v.into();
16795 self
16796 }
16797
16798 pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicyRule> {
16800 (*self.0.stub)
16801 .get_gateway_security_policy_rule(self.0.request, self.0.options)
16802 .await
16803 .map(crate::Response::into_body)
16804 }
16805
16806 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16810 self.0.request.name = v.into();
16811 self
16812 }
16813 }
16814
16815 #[doc(hidden)]
16816 impl crate::RequestBuilder for GetGatewaySecurityPolicyRule {
16817 fn request_options(&mut self) -> &mut crate::RequestOptions {
16818 &mut self.0.options
16819 }
16820 }
16821
16822 #[derive(Clone, Debug)]
16840 pub struct CreateGatewaySecurityPolicyRule(
16841 RequestBuilder<crate::model::CreateGatewaySecurityPolicyRuleRequest>,
16842 );
16843
16844 impl CreateGatewaySecurityPolicyRule {
16845 pub(crate) fn new(
16846 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16847 ) -> Self {
16848 Self(RequestBuilder::new(stub))
16849 }
16850
16851 pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRuleRequest>>(
16853 mut self,
16854 v: V,
16855 ) -> Self {
16856 self.0.request = v.into();
16857 self
16858 }
16859
16860 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16862 self.0.options = v.into();
16863 self
16864 }
16865
16866 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16873 (*self.0.stub)
16874 .create_gateway_security_policy_rule(self.0.request, self.0.options)
16875 .await
16876 .map(crate::Response::into_body)
16877 }
16878
16879 pub fn poller(
16881 self,
16882 ) -> impl google_cloud_lro::Poller<
16883 crate::model::GatewaySecurityPolicyRule,
16884 crate::model::OperationMetadata,
16885 > {
16886 type Operation = google_cloud_lro::internal::Operation<
16887 crate::model::GatewaySecurityPolicyRule,
16888 crate::model::OperationMetadata,
16889 >;
16890 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16891 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16892
16893 let stub = self.0.stub.clone();
16894 let mut options = self.0.options.clone();
16895 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16896 let query = move |name| {
16897 let stub = stub.clone();
16898 let options = options.clone();
16899 async {
16900 let op = GetOperation::new(stub)
16901 .set_name(name)
16902 .with_options(options)
16903 .send()
16904 .await?;
16905 Ok(Operation::new(op))
16906 }
16907 };
16908
16909 let start = move || async {
16910 let op = self.send().await?;
16911 Ok(Operation::new(op))
16912 };
16913
16914 google_cloud_lro::internal::new_poller(
16915 polling_error_policy,
16916 polling_backoff_policy,
16917 start,
16918 query,
16919 )
16920 }
16921
16922 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16926 self.0.request.parent = v.into();
16927 self
16928 }
16929
16930 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
16934 where
16935 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
16936 {
16937 self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
16938 self
16939 }
16940
16941 pub fn set_or_clear_gateway_security_policy_rule<T>(
16945 mut self,
16946 v: std::option::Option<T>,
16947 ) -> Self
16948 where
16949 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
16950 {
16951 self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
16952 self
16953 }
16954
16955 pub fn set_gateway_security_policy_rule_id<T: Into<std::string::String>>(
16957 mut self,
16958 v: T,
16959 ) -> Self {
16960 self.0.request.gateway_security_policy_rule_id = v.into();
16961 self
16962 }
16963 }
16964
16965 #[doc(hidden)]
16966 impl crate::RequestBuilder for CreateGatewaySecurityPolicyRule {
16967 fn request_options(&mut self) -> &mut crate::RequestOptions {
16968 &mut self.0.options
16969 }
16970 }
16971
16972 #[derive(Clone, Debug)]
16990 pub struct UpdateGatewaySecurityPolicyRule(
16991 RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRuleRequest>,
16992 );
16993
16994 impl UpdateGatewaySecurityPolicyRule {
16995 pub(crate) fn new(
16996 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16997 ) -> Self {
16998 Self(RequestBuilder::new(stub))
16999 }
17000
17001 pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRuleRequest>>(
17003 mut self,
17004 v: V,
17005 ) -> Self {
17006 self.0.request = v.into();
17007 self
17008 }
17009
17010 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17012 self.0.options = v.into();
17013 self
17014 }
17015
17016 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17023 (*self.0.stub)
17024 .update_gateway_security_policy_rule(self.0.request, self.0.options)
17025 .await
17026 .map(crate::Response::into_body)
17027 }
17028
17029 pub fn poller(
17031 self,
17032 ) -> impl google_cloud_lro::Poller<
17033 crate::model::GatewaySecurityPolicyRule,
17034 crate::model::OperationMetadata,
17035 > {
17036 type Operation = google_cloud_lro::internal::Operation<
17037 crate::model::GatewaySecurityPolicyRule,
17038 crate::model::OperationMetadata,
17039 >;
17040 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17041 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17042
17043 let stub = self.0.stub.clone();
17044 let mut options = self.0.options.clone();
17045 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17046 let query = move |name| {
17047 let stub = stub.clone();
17048 let options = options.clone();
17049 async {
17050 let op = GetOperation::new(stub)
17051 .set_name(name)
17052 .with_options(options)
17053 .send()
17054 .await?;
17055 Ok(Operation::new(op))
17056 }
17057 };
17058
17059 let start = move || async {
17060 let op = self.send().await?;
17061 Ok(Operation::new(op))
17062 };
17063
17064 google_cloud_lro::internal::new_poller(
17065 polling_error_policy,
17066 polling_backoff_policy,
17067 start,
17068 query,
17069 )
17070 }
17071
17072 pub fn set_update_mask<T>(mut self, v: T) -> Self
17074 where
17075 T: std::convert::Into<wkt::FieldMask>,
17076 {
17077 self.0.request.update_mask = std::option::Option::Some(v.into());
17078 self
17079 }
17080
17081 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17083 where
17084 T: std::convert::Into<wkt::FieldMask>,
17085 {
17086 self.0.request.update_mask = v.map(|x| x.into());
17087 self
17088 }
17089
17090 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
17094 where
17095 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17096 {
17097 self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
17098 self
17099 }
17100
17101 pub fn set_or_clear_gateway_security_policy_rule<T>(
17105 mut self,
17106 v: std::option::Option<T>,
17107 ) -> Self
17108 where
17109 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17110 {
17111 self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
17112 self
17113 }
17114 }
17115
17116 #[doc(hidden)]
17117 impl crate::RequestBuilder for UpdateGatewaySecurityPolicyRule {
17118 fn request_options(&mut self) -> &mut crate::RequestOptions {
17119 &mut self.0.options
17120 }
17121 }
17122
17123 #[derive(Clone, Debug)]
17141 pub struct DeleteGatewaySecurityPolicyRule(
17142 RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRuleRequest>,
17143 );
17144
17145 impl DeleteGatewaySecurityPolicyRule {
17146 pub(crate) fn new(
17147 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17148 ) -> Self {
17149 Self(RequestBuilder::new(stub))
17150 }
17151
17152 pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRuleRequest>>(
17154 mut self,
17155 v: V,
17156 ) -> Self {
17157 self.0.request = v.into();
17158 self
17159 }
17160
17161 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17163 self.0.options = v.into();
17164 self
17165 }
17166
17167 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17174 (*self.0.stub)
17175 .delete_gateway_security_policy_rule(self.0.request, self.0.options)
17176 .await
17177 .map(crate::Response::into_body)
17178 }
17179
17180 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17182 type Operation =
17183 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17184 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17185 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17186
17187 let stub = self.0.stub.clone();
17188 let mut options = self.0.options.clone();
17189 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17190 let query = move |name| {
17191 let stub = stub.clone();
17192 let options = options.clone();
17193 async {
17194 let op = GetOperation::new(stub)
17195 .set_name(name)
17196 .with_options(options)
17197 .send()
17198 .await?;
17199 Ok(Operation::new(op))
17200 }
17201 };
17202
17203 let start = move || async {
17204 let op = self.send().await?;
17205 Ok(Operation::new(op))
17206 };
17207
17208 google_cloud_lro::internal::new_unit_response_poller(
17209 polling_error_policy,
17210 polling_backoff_policy,
17211 start,
17212 query,
17213 )
17214 }
17215
17216 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17220 self.0.request.name = v.into();
17221 self
17222 }
17223 }
17224
17225 #[doc(hidden)]
17226 impl crate::RequestBuilder for DeleteGatewaySecurityPolicyRule {
17227 fn request_options(&mut self) -> &mut crate::RequestOptions {
17228 &mut self.0.options
17229 }
17230 }
17231
17232 #[derive(Clone, Debug)]
17253 pub struct ListUrlLists(RequestBuilder<crate::model::ListUrlListsRequest>);
17254
17255 impl ListUrlLists {
17256 pub(crate) fn new(
17257 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17258 ) -> Self {
17259 Self(RequestBuilder::new(stub))
17260 }
17261
17262 pub fn with_request<V: Into<crate::model::ListUrlListsRequest>>(mut self, v: V) -> Self {
17264 self.0.request = v.into();
17265 self
17266 }
17267
17268 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17270 self.0.options = v.into();
17271 self
17272 }
17273
17274 pub async fn send(self) -> Result<crate::model::ListUrlListsResponse> {
17276 (*self.0.stub)
17277 .list_url_lists(self.0.request, self.0.options)
17278 .await
17279 .map(crate::Response::into_body)
17280 }
17281
17282 pub fn by_page(
17284 self,
17285 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUrlListsResponse, crate::Error>
17286 {
17287 use std::clone::Clone;
17288 let token = self.0.request.page_token.clone();
17289 let execute = move |token: String| {
17290 let mut builder = self.clone();
17291 builder.0.request = builder.0.request.set_page_token(token);
17292 builder.send()
17293 };
17294 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17295 }
17296
17297 pub fn by_item(
17299 self,
17300 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17301 crate::model::ListUrlListsResponse,
17302 crate::Error,
17303 > {
17304 use google_cloud_gax::paginator::Paginator;
17305 self.by_page().items()
17306 }
17307
17308 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17312 self.0.request.parent = v.into();
17313 self
17314 }
17315
17316 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17318 self.0.request.page_size = v.into();
17319 self
17320 }
17321
17322 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17324 self.0.request.page_token = v.into();
17325 self
17326 }
17327 }
17328
17329 #[doc(hidden)]
17330 impl crate::RequestBuilder for ListUrlLists {
17331 fn request_options(&mut self) -> &mut crate::RequestOptions {
17332 &mut self.0.options
17333 }
17334 }
17335
17336 #[derive(Clone, Debug)]
17353 pub struct GetUrlList(RequestBuilder<crate::model::GetUrlListRequest>);
17354
17355 impl GetUrlList {
17356 pub(crate) fn new(
17357 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17358 ) -> Self {
17359 Self(RequestBuilder::new(stub))
17360 }
17361
17362 pub fn with_request<V: Into<crate::model::GetUrlListRequest>>(mut self, v: V) -> Self {
17364 self.0.request = v.into();
17365 self
17366 }
17367
17368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17370 self.0.options = v.into();
17371 self
17372 }
17373
17374 pub async fn send(self) -> Result<crate::model::UrlList> {
17376 (*self.0.stub)
17377 .get_url_list(self.0.request, self.0.options)
17378 .await
17379 .map(crate::Response::into_body)
17380 }
17381
17382 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17386 self.0.request.name = v.into();
17387 self
17388 }
17389 }
17390
17391 #[doc(hidden)]
17392 impl crate::RequestBuilder for GetUrlList {
17393 fn request_options(&mut self) -> &mut crate::RequestOptions {
17394 &mut self.0.options
17395 }
17396 }
17397
17398 #[derive(Clone, Debug)]
17416 pub struct CreateUrlList(RequestBuilder<crate::model::CreateUrlListRequest>);
17417
17418 impl CreateUrlList {
17419 pub(crate) fn new(
17420 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17421 ) -> Self {
17422 Self(RequestBuilder::new(stub))
17423 }
17424
17425 pub fn with_request<V: Into<crate::model::CreateUrlListRequest>>(mut self, v: V) -> Self {
17427 self.0.request = v.into();
17428 self
17429 }
17430
17431 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17433 self.0.options = v.into();
17434 self
17435 }
17436
17437 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17444 (*self.0.stub)
17445 .create_url_list(self.0.request, self.0.options)
17446 .await
17447 .map(crate::Response::into_body)
17448 }
17449
17450 pub fn poller(
17452 self,
17453 ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
17454 {
17455 type Operation = google_cloud_lro::internal::Operation<
17456 crate::model::UrlList,
17457 crate::model::OperationMetadata,
17458 >;
17459 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17460 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17461
17462 let stub = self.0.stub.clone();
17463 let mut options = self.0.options.clone();
17464 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17465 let query = move |name| {
17466 let stub = stub.clone();
17467 let options = options.clone();
17468 async {
17469 let op = GetOperation::new(stub)
17470 .set_name(name)
17471 .with_options(options)
17472 .send()
17473 .await?;
17474 Ok(Operation::new(op))
17475 }
17476 };
17477
17478 let start = move || async {
17479 let op = self.send().await?;
17480 Ok(Operation::new(op))
17481 };
17482
17483 google_cloud_lro::internal::new_poller(
17484 polling_error_policy,
17485 polling_backoff_policy,
17486 start,
17487 query,
17488 )
17489 }
17490
17491 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17495 self.0.request.parent = v.into();
17496 self
17497 }
17498
17499 pub fn set_url_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17503 self.0.request.url_list_id = v.into();
17504 self
17505 }
17506
17507 pub fn set_url_list<T>(mut self, v: T) -> Self
17511 where
17512 T: std::convert::Into<crate::model::UrlList>,
17513 {
17514 self.0.request.url_list = std::option::Option::Some(v.into());
17515 self
17516 }
17517
17518 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
17522 where
17523 T: std::convert::Into<crate::model::UrlList>,
17524 {
17525 self.0.request.url_list = v.map(|x| x.into());
17526 self
17527 }
17528 }
17529
17530 #[doc(hidden)]
17531 impl crate::RequestBuilder for CreateUrlList {
17532 fn request_options(&mut self) -> &mut crate::RequestOptions {
17533 &mut self.0.options
17534 }
17535 }
17536
17537 #[derive(Clone, Debug)]
17555 pub struct UpdateUrlList(RequestBuilder<crate::model::UpdateUrlListRequest>);
17556
17557 impl UpdateUrlList {
17558 pub(crate) fn new(
17559 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17560 ) -> Self {
17561 Self(RequestBuilder::new(stub))
17562 }
17563
17564 pub fn with_request<V: Into<crate::model::UpdateUrlListRequest>>(mut self, v: V) -> Self {
17566 self.0.request = v.into();
17567 self
17568 }
17569
17570 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17572 self.0.options = v.into();
17573 self
17574 }
17575
17576 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17583 (*self.0.stub)
17584 .update_url_list(self.0.request, self.0.options)
17585 .await
17586 .map(crate::Response::into_body)
17587 }
17588
17589 pub fn poller(
17591 self,
17592 ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
17593 {
17594 type Operation = google_cloud_lro::internal::Operation<
17595 crate::model::UrlList,
17596 crate::model::OperationMetadata,
17597 >;
17598 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17599 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17600
17601 let stub = self.0.stub.clone();
17602 let mut options = self.0.options.clone();
17603 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17604 let query = move |name| {
17605 let stub = stub.clone();
17606 let options = options.clone();
17607 async {
17608 let op = GetOperation::new(stub)
17609 .set_name(name)
17610 .with_options(options)
17611 .send()
17612 .await?;
17613 Ok(Operation::new(op))
17614 }
17615 };
17616
17617 let start = move || async {
17618 let op = self.send().await?;
17619 Ok(Operation::new(op))
17620 };
17621
17622 google_cloud_lro::internal::new_poller(
17623 polling_error_policy,
17624 polling_backoff_policy,
17625 start,
17626 query,
17627 )
17628 }
17629
17630 pub fn set_update_mask<T>(mut self, v: T) -> Self
17632 where
17633 T: std::convert::Into<wkt::FieldMask>,
17634 {
17635 self.0.request.update_mask = std::option::Option::Some(v.into());
17636 self
17637 }
17638
17639 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17641 where
17642 T: std::convert::Into<wkt::FieldMask>,
17643 {
17644 self.0.request.update_mask = v.map(|x| x.into());
17645 self
17646 }
17647
17648 pub fn set_url_list<T>(mut self, v: T) -> Self
17652 where
17653 T: std::convert::Into<crate::model::UrlList>,
17654 {
17655 self.0.request.url_list = std::option::Option::Some(v.into());
17656 self
17657 }
17658
17659 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
17663 where
17664 T: std::convert::Into<crate::model::UrlList>,
17665 {
17666 self.0.request.url_list = v.map(|x| x.into());
17667 self
17668 }
17669 }
17670
17671 #[doc(hidden)]
17672 impl crate::RequestBuilder for UpdateUrlList {
17673 fn request_options(&mut self) -> &mut crate::RequestOptions {
17674 &mut self.0.options
17675 }
17676 }
17677
17678 #[derive(Clone, Debug)]
17696 pub struct DeleteUrlList(RequestBuilder<crate::model::DeleteUrlListRequest>);
17697
17698 impl DeleteUrlList {
17699 pub(crate) fn new(
17700 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17701 ) -> Self {
17702 Self(RequestBuilder::new(stub))
17703 }
17704
17705 pub fn with_request<V: Into<crate::model::DeleteUrlListRequest>>(mut self, v: V) -> Self {
17707 self.0.request = v.into();
17708 self
17709 }
17710
17711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17713 self.0.options = v.into();
17714 self
17715 }
17716
17717 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17724 (*self.0.stub)
17725 .delete_url_list(self.0.request, self.0.options)
17726 .await
17727 .map(crate::Response::into_body)
17728 }
17729
17730 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17732 type Operation =
17733 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17734 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17735 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17736
17737 let stub = self.0.stub.clone();
17738 let mut options = self.0.options.clone();
17739 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17740 let query = move |name| {
17741 let stub = stub.clone();
17742 let options = options.clone();
17743 async {
17744 let op = GetOperation::new(stub)
17745 .set_name(name)
17746 .with_options(options)
17747 .send()
17748 .await?;
17749 Ok(Operation::new(op))
17750 }
17751 };
17752
17753 let start = move || async {
17754 let op = self.send().await?;
17755 Ok(Operation::new(op))
17756 };
17757
17758 google_cloud_lro::internal::new_unit_response_poller(
17759 polling_error_policy,
17760 polling_backoff_policy,
17761 start,
17762 query,
17763 )
17764 }
17765
17766 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17770 self.0.request.name = v.into();
17771 self
17772 }
17773 }
17774
17775 #[doc(hidden)]
17776 impl crate::RequestBuilder for DeleteUrlList {
17777 fn request_options(&mut self) -> &mut crate::RequestOptions {
17778 &mut self.0.options
17779 }
17780 }
17781
17782 #[derive(Clone, Debug)]
17803 pub struct ListTlsInspectionPolicies(
17804 RequestBuilder<crate::model::ListTlsInspectionPoliciesRequest>,
17805 );
17806
17807 impl ListTlsInspectionPolicies {
17808 pub(crate) fn new(
17809 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17810 ) -> Self {
17811 Self(RequestBuilder::new(stub))
17812 }
17813
17814 pub fn with_request<V: Into<crate::model::ListTlsInspectionPoliciesRequest>>(
17816 mut self,
17817 v: V,
17818 ) -> Self {
17819 self.0.request = v.into();
17820 self
17821 }
17822
17823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17825 self.0.options = v.into();
17826 self
17827 }
17828
17829 pub async fn send(self) -> Result<crate::model::ListTlsInspectionPoliciesResponse> {
17831 (*self.0.stub)
17832 .list_tls_inspection_policies(self.0.request, self.0.options)
17833 .await
17834 .map(crate::Response::into_body)
17835 }
17836
17837 pub fn by_page(
17839 self,
17840 ) -> impl google_cloud_gax::paginator::Paginator<
17841 crate::model::ListTlsInspectionPoliciesResponse,
17842 crate::Error,
17843 > {
17844 use std::clone::Clone;
17845 let token = self.0.request.page_token.clone();
17846 let execute = move |token: String| {
17847 let mut builder = self.clone();
17848 builder.0.request = builder.0.request.set_page_token(token);
17849 builder.send()
17850 };
17851 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17852 }
17853
17854 pub fn by_item(
17856 self,
17857 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17858 crate::model::ListTlsInspectionPoliciesResponse,
17859 crate::Error,
17860 > {
17861 use google_cloud_gax::paginator::Paginator;
17862 self.by_page().items()
17863 }
17864
17865 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17869 self.0.request.parent = v.into();
17870 self
17871 }
17872
17873 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17875 self.0.request.page_size = v.into();
17876 self
17877 }
17878
17879 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17881 self.0.request.page_token = v.into();
17882 self
17883 }
17884 }
17885
17886 #[doc(hidden)]
17887 impl crate::RequestBuilder for ListTlsInspectionPolicies {
17888 fn request_options(&mut self) -> &mut crate::RequestOptions {
17889 &mut self.0.options
17890 }
17891 }
17892
17893 #[derive(Clone, Debug)]
17910 pub struct GetTlsInspectionPolicy(RequestBuilder<crate::model::GetTlsInspectionPolicyRequest>);
17911
17912 impl GetTlsInspectionPolicy {
17913 pub(crate) fn new(
17914 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17915 ) -> Self {
17916 Self(RequestBuilder::new(stub))
17917 }
17918
17919 pub fn with_request<V: Into<crate::model::GetTlsInspectionPolicyRequest>>(
17921 mut self,
17922 v: V,
17923 ) -> Self {
17924 self.0.request = v.into();
17925 self
17926 }
17927
17928 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17930 self.0.options = v.into();
17931 self
17932 }
17933
17934 pub async fn send(self) -> Result<crate::model::TlsInspectionPolicy> {
17936 (*self.0.stub)
17937 .get_tls_inspection_policy(self.0.request, self.0.options)
17938 .await
17939 .map(crate::Response::into_body)
17940 }
17941
17942 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17946 self.0.request.name = v.into();
17947 self
17948 }
17949 }
17950
17951 #[doc(hidden)]
17952 impl crate::RequestBuilder for GetTlsInspectionPolicy {
17953 fn request_options(&mut self) -> &mut crate::RequestOptions {
17954 &mut self.0.options
17955 }
17956 }
17957
17958 #[derive(Clone, Debug)]
17976 pub struct CreateTlsInspectionPolicy(
17977 RequestBuilder<crate::model::CreateTlsInspectionPolicyRequest>,
17978 );
17979
17980 impl CreateTlsInspectionPolicy {
17981 pub(crate) fn new(
17982 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17983 ) -> Self {
17984 Self(RequestBuilder::new(stub))
17985 }
17986
17987 pub fn with_request<V: Into<crate::model::CreateTlsInspectionPolicyRequest>>(
17989 mut self,
17990 v: V,
17991 ) -> Self {
17992 self.0.request = v.into();
17993 self
17994 }
17995
17996 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17998 self.0.options = v.into();
17999 self
18000 }
18001
18002 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18009 (*self.0.stub)
18010 .create_tls_inspection_policy(self.0.request, self.0.options)
18011 .await
18012 .map(crate::Response::into_body)
18013 }
18014
18015 pub fn poller(
18017 self,
18018 ) -> impl google_cloud_lro::Poller<
18019 crate::model::TlsInspectionPolicy,
18020 crate::model::OperationMetadata,
18021 > {
18022 type Operation = google_cloud_lro::internal::Operation<
18023 crate::model::TlsInspectionPolicy,
18024 crate::model::OperationMetadata,
18025 >;
18026 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18027 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18028
18029 let stub = self.0.stub.clone();
18030 let mut options = self.0.options.clone();
18031 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18032 let query = move |name| {
18033 let stub = stub.clone();
18034 let options = options.clone();
18035 async {
18036 let op = GetOperation::new(stub)
18037 .set_name(name)
18038 .with_options(options)
18039 .send()
18040 .await?;
18041 Ok(Operation::new(op))
18042 }
18043 };
18044
18045 let start = move || async {
18046 let op = self.send().await?;
18047 Ok(Operation::new(op))
18048 };
18049
18050 google_cloud_lro::internal::new_poller(
18051 polling_error_policy,
18052 polling_backoff_policy,
18053 start,
18054 query,
18055 )
18056 }
18057
18058 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18062 self.0.request.parent = v.into();
18063 self
18064 }
18065
18066 pub fn set_tls_inspection_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18070 self.0.request.tls_inspection_policy_id = v.into();
18071 self
18072 }
18073
18074 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18078 where
18079 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18080 {
18081 self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18082 self
18083 }
18084
18085 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18089 where
18090 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18091 {
18092 self.0.request.tls_inspection_policy = v.map(|x| x.into());
18093 self
18094 }
18095 }
18096
18097 #[doc(hidden)]
18098 impl crate::RequestBuilder for CreateTlsInspectionPolicy {
18099 fn request_options(&mut self) -> &mut crate::RequestOptions {
18100 &mut self.0.options
18101 }
18102 }
18103
18104 #[derive(Clone, Debug)]
18122 pub struct UpdateTlsInspectionPolicy(
18123 RequestBuilder<crate::model::UpdateTlsInspectionPolicyRequest>,
18124 );
18125
18126 impl UpdateTlsInspectionPolicy {
18127 pub(crate) fn new(
18128 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18129 ) -> Self {
18130 Self(RequestBuilder::new(stub))
18131 }
18132
18133 pub fn with_request<V: Into<crate::model::UpdateTlsInspectionPolicyRequest>>(
18135 mut self,
18136 v: V,
18137 ) -> Self {
18138 self.0.request = v.into();
18139 self
18140 }
18141
18142 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18144 self.0.options = v.into();
18145 self
18146 }
18147
18148 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18155 (*self.0.stub)
18156 .update_tls_inspection_policy(self.0.request, self.0.options)
18157 .await
18158 .map(crate::Response::into_body)
18159 }
18160
18161 pub fn poller(
18163 self,
18164 ) -> impl google_cloud_lro::Poller<
18165 crate::model::TlsInspectionPolicy,
18166 crate::model::OperationMetadata,
18167 > {
18168 type Operation = google_cloud_lro::internal::Operation<
18169 crate::model::TlsInspectionPolicy,
18170 crate::model::OperationMetadata,
18171 >;
18172 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18173 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18174
18175 let stub = self.0.stub.clone();
18176 let mut options = self.0.options.clone();
18177 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18178 let query = move |name| {
18179 let stub = stub.clone();
18180 let options = options.clone();
18181 async {
18182 let op = GetOperation::new(stub)
18183 .set_name(name)
18184 .with_options(options)
18185 .send()
18186 .await?;
18187 Ok(Operation::new(op))
18188 }
18189 };
18190
18191 let start = move || async {
18192 let op = self.send().await?;
18193 Ok(Operation::new(op))
18194 };
18195
18196 google_cloud_lro::internal::new_poller(
18197 polling_error_policy,
18198 polling_backoff_policy,
18199 start,
18200 query,
18201 )
18202 }
18203
18204 pub fn set_update_mask<T>(mut self, v: T) -> Self
18206 where
18207 T: std::convert::Into<wkt::FieldMask>,
18208 {
18209 self.0.request.update_mask = std::option::Option::Some(v.into());
18210 self
18211 }
18212
18213 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18215 where
18216 T: std::convert::Into<wkt::FieldMask>,
18217 {
18218 self.0.request.update_mask = v.map(|x| x.into());
18219 self
18220 }
18221
18222 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18226 where
18227 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18228 {
18229 self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18230 self
18231 }
18232
18233 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18237 where
18238 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18239 {
18240 self.0.request.tls_inspection_policy = v.map(|x| x.into());
18241 self
18242 }
18243 }
18244
18245 #[doc(hidden)]
18246 impl crate::RequestBuilder for UpdateTlsInspectionPolicy {
18247 fn request_options(&mut self) -> &mut crate::RequestOptions {
18248 &mut self.0.options
18249 }
18250 }
18251
18252 #[derive(Clone, Debug)]
18270 pub struct DeleteTlsInspectionPolicy(
18271 RequestBuilder<crate::model::DeleteTlsInspectionPolicyRequest>,
18272 );
18273
18274 impl DeleteTlsInspectionPolicy {
18275 pub(crate) fn new(
18276 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18277 ) -> Self {
18278 Self(RequestBuilder::new(stub))
18279 }
18280
18281 pub fn with_request<V: Into<crate::model::DeleteTlsInspectionPolicyRequest>>(
18283 mut self,
18284 v: V,
18285 ) -> Self {
18286 self.0.request = v.into();
18287 self
18288 }
18289
18290 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18292 self.0.options = v.into();
18293 self
18294 }
18295
18296 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18303 (*self.0.stub)
18304 .delete_tls_inspection_policy(self.0.request, self.0.options)
18305 .await
18306 .map(crate::Response::into_body)
18307 }
18308
18309 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18311 type Operation =
18312 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18315
18316 let stub = self.0.stub.clone();
18317 let mut options = self.0.options.clone();
18318 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18319 let query = move |name| {
18320 let stub = stub.clone();
18321 let options = options.clone();
18322 async {
18323 let op = GetOperation::new(stub)
18324 .set_name(name)
18325 .with_options(options)
18326 .send()
18327 .await?;
18328 Ok(Operation::new(op))
18329 }
18330 };
18331
18332 let start = move || async {
18333 let op = self.send().await?;
18334 Ok(Operation::new(op))
18335 };
18336
18337 google_cloud_lro::internal::new_unit_response_poller(
18338 polling_error_policy,
18339 polling_backoff_policy,
18340 start,
18341 query,
18342 )
18343 }
18344
18345 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18349 self.0.request.name = v.into();
18350 self
18351 }
18352
18353 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18355 self.0.request.force = v.into();
18356 self
18357 }
18358 }
18359
18360 #[doc(hidden)]
18361 impl crate::RequestBuilder for DeleteTlsInspectionPolicy {
18362 fn request_options(&mut self) -> &mut crate::RequestOptions {
18363 &mut self.0.options
18364 }
18365 }
18366
18367 #[derive(Clone, Debug)]
18388 pub struct ListAuthzPolicies(RequestBuilder<crate::model::ListAuthzPoliciesRequest>);
18389
18390 impl ListAuthzPolicies {
18391 pub(crate) fn new(
18392 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18393 ) -> Self {
18394 Self(RequestBuilder::new(stub))
18395 }
18396
18397 pub fn with_request<V: Into<crate::model::ListAuthzPoliciesRequest>>(
18399 mut self,
18400 v: V,
18401 ) -> Self {
18402 self.0.request = v.into();
18403 self
18404 }
18405
18406 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18408 self.0.options = v.into();
18409 self
18410 }
18411
18412 pub async fn send(self) -> Result<crate::model::ListAuthzPoliciesResponse> {
18414 (*self.0.stub)
18415 .list_authz_policies(self.0.request, self.0.options)
18416 .await
18417 .map(crate::Response::into_body)
18418 }
18419
18420 pub fn by_page(
18422 self,
18423 ) -> impl google_cloud_gax::paginator::Paginator<
18424 crate::model::ListAuthzPoliciesResponse,
18425 crate::Error,
18426 > {
18427 use std::clone::Clone;
18428 let token = self.0.request.page_token.clone();
18429 let execute = move |token: String| {
18430 let mut builder = self.clone();
18431 builder.0.request = builder.0.request.set_page_token(token);
18432 builder.send()
18433 };
18434 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18435 }
18436
18437 pub fn by_item(
18439 self,
18440 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18441 crate::model::ListAuthzPoliciesResponse,
18442 crate::Error,
18443 > {
18444 use google_cloud_gax::paginator::Paginator;
18445 self.by_page().items()
18446 }
18447
18448 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18452 self.0.request.parent = v.into();
18453 self
18454 }
18455
18456 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18458 self.0.request.page_size = v.into();
18459 self
18460 }
18461
18462 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18464 self.0.request.page_token = v.into();
18465 self
18466 }
18467
18468 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18470 self.0.request.filter = v.into();
18471 self
18472 }
18473
18474 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18476 self.0.request.order_by = v.into();
18477 self
18478 }
18479 }
18480
18481 #[doc(hidden)]
18482 impl crate::RequestBuilder for ListAuthzPolicies {
18483 fn request_options(&mut self) -> &mut crate::RequestOptions {
18484 &mut self.0.options
18485 }
18486 }
18487
18488 #[derive(Clone, Debug)]
18505 pub struct GetAuthzPolicy(RequestBuilder<crate::model::GetAuthzPolicyRequest>);
18506
18507 impl GetAuthzPolicy {
18508 pub(crate) fn new(
18509 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18510 ) -> Self {
18511 Self(RequestBuilder::new(stub))
18512 }
18513
18514 pub fn with_request<V: Into<crate::model::GetAuthzPolicyRequest>>(mut self, v: V) -> Self {
18516 self.0.request = v.into();
18517 self
18518 }
18519
18520 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18522 self.0.options = v.into();
18523 self
18524 }
18525
18526 pub async fn send(self) -> Result<crate::model::AuthzPolicy> {
18528 (*self.0.stub)
18529 .get_authz_policy(self.0.request, self.0.options)
18530 .await
18531 .map(crate::Response::into_body)
18532 }
18533
18534 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18538 self.0.request.name = v.into();
18539 self
18540 }
18541 }
18542
18543 #[doc(hidden)]
18544 impl crate::RequestBuilder for GetAuthzPolicy {
18545 fn request_options(&mut self) -> &mut crate::RequestOptions {
18546 &mut self.0.options
18547 }
18548 }
18549
18550 #[derive(Clone, Debug)]
18568 pub struct CreateAuthzPolicy(RequestBuilder<crate::model::CreateAuthzPolicyRequest>);
18569
18570 impl CreateAuthzPolicy {
18571 pub(crate) fn new(
18572 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18573 ) -> Self {
18574 Self(RequestBuilder::new(stub))
18575 }
18576
18577 pub fn with_request<V: Into<crate::model::CreateAuthzPolicyRequest>>(
18579 mut self,
18580 v: V,
18581 ) -> Self {
18582 self.0.request = v.into();
18583 self
18584 }
18585
18586 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18588 self.0.options = v.into();
18589 self
18590 }
18591
18592 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18599 (*self.0.stub)
18600 .create_authz_policy(self.0.request, self.0.options)
18601 .await
18602 .map(crate::Response::into_body)
18603 }
18604
18605 pub fn poller(
18607 self,
18608 ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
18609 {
18610 type Operation = google_cloud_lro::internal::Operation<
18611 crate::model::AuthzPolicy,
18612 crate::model::OperationMetadata,
18613 >;
18614 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18615 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18616
18617 let stub = self.0.stub.clone();
18618 let mut options = self.0.options.clone();
18619 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18620 let query = move |name| {
18621 let stub = stub.clone();
18622 let options = options.clone();
18623 async {
18624 let op = GetOperation::new(stub)
18625 .set_name(name)
18626 .with_options(options)
18627 .send()
18628 .await?;
18629 Ok(Operation::new(op))
18630 }
18631 };
18632
18633 let start = move || async {
18634 let op = self.send().await?;
18635 Ok(Operation::new(op))
18636 };
18637
18638 google_cloud_lro::internal::new_poller(
18639 polling_error_policy,
18640 polling_backoff_policy,
18641 start,
18642 query,
18643 )
18644 }
18645
18646 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18650 self.0.request.parent = v.into();
18651 self
18652 }
18653
18654 pub fn set_authz_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18658 self.0.request.authz_policy_id = v.into();
18659 self
18660 }
18661
18662 pub fn set_authz_policy<T>(mut self, v: T) -> Self
18666 where
18667 T: std::convert::Into<crate::model::AuthzPolicy>,
18668 {
18669 self.0.request.authz_policy = std::option::Option::Some(v.into());
18670 self
18671 }
18672
18673 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
18677 where
18678 T: std::convert::Into<crate::model::AuthzPolicy>,
18679 {
18680 self.0.request.authz_policy = v.map(|x| x.into());
18681 self
18682 }
18683
18684 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18686 self.0.request.request_id = v.into();
18687 self
18688 }
18689 }
18690
18691 #[doc(hidden)]
18692 impl crate::RequestBuilder for CreateAuthzPolicy {
18693 fn request_options(&mut self) -> &mut crate::RequestOptions {
18694 &mut self.0.options
18695 }
18696 }
18697
18698 #[derive(Clone, Debug)]
18716 pub struct UpdateAuthzPolicy(RequestBuilder<crate::model::UpdateAuthzPolicyRequest>);
18717
18718 impl UpdateAuthzPolicy {
18719 pub(crate) fn new(
18720 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18721 ) -> Self {
18722 Self(RequestBuilder::new(stub))
18723 }
18724
18725 pub fn with_request<V: Into<crate::model::UpdateAuthzPolicyRequest>>(
18727 mut self,
18728 v: V,
18729 ) -> Self {
18730 self.0.request = v.into();
18731 self
18732 }
18733
18734 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18736 self.0.options = v.into();
18737 self
18738 }
18739
18740 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18747 (*self.0.stub)
18748 .update_authz_policy(self.0.request, self.0.options)
18749 .await
18750 .map(crate::Response::into_body)
18751 }
18752
18753 pub fn poller(
18755 self,
18756 ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
18757 {
18758 type Operation = google_cloud_lro::internal::Operation<
18759 crate::model::AuthzPolicy,
18760 crate::model::OperationMetadata,
18761 >;
18762 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18763 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18764
18765 let stub = self.0.stub.clone();
18766 let mut options = self.0.options.clone();
18767 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18768 let query = move |name| {
18769 let stub = stub.clone();
18770 let options = options.clone();
18771 async {
18772 let op = GetOperation::new(stub)
18773 .set_name(name)
18774 .with_options(options)
18775 .send()
18776 .await?;
18777 Ok(Operation::new(op))
18778 }
18779 };
18780
18781 let start = move || async {
18782 let op = self.send().await?;
18783 Ok(Operation::new(op))
18784 };
18785
18786 google_cloud_lro::internal::new_poller(
18787 polling_error_policy,
18788 polling_backoff_policy,
18789 start,
18790 query,
18791 )
18792 }
18793
18794 pub fn set_update_mask<T>(mut self, v: T) -> Self
18798 where
18799 T: std::convert::Into<wkt::FieldMask>,
18800 {
18801 self.0.request.update_mask = std::option::Option::Some(v.into());
18802 self
18803 }
18804
18805 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18809 where
18810 T: std::convert::Into<wkt::FieldMask>,
18811 {
18812 self.0.request.update_mask = v.map(|x| x.into());
18813 self
18814 }
18815
18816 pub fn set_authz_policy<T>(mut self, v: T) -> Self
18820 where
18821 T: std::convert::Into<crate::model::AuthzPolicy>,
18822 {
18823 self.0.request.authz_policy = std::option::Option::Some(v.into());
18824 self
18825 }
18826
18827 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
18831 where
18832 T: std::convert::Into<crate::model::AuthzPolicy>,
18833 {
18834 self.0.request.authz_policy = v.map(|x| x.into());
18835 self
18836 }
18837
18838 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18840 self.0.request.request_id = v.into();
18841 self
18842 }
18843 }
18844
18845 #[doc(hidden)]
18846 impl crate::RequestBuilder for UpdateAuthzPolicy {
18847 fn request_options(&mut self) -> &mut crate::RequestOptions {
18848 &mut self.0.options
18849 }
18850 }
18851
18852 #[derive(Clone, Debug)]
18870 pub struct DeleteAuthzPolicy(RequestBuilder<crate::model::DeleteAuthzPolicyRequest>);
18871
18872 impl DeleteAuthzPolicy {
18873 pub(crate) fn new(
18874 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18875 ) -> Self {
18876 Self(RequestBuilder::new(stub))
18877 }
18878
18879 pub fn with_request<V: Into<crate::model::DeleteAuthzPolicyRequest>>(
18881 mut self,
18882 v: V,
18883 ) -> Self {
18884 self.0.request = v.into();
18885 self
18886 }
18887
18888 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18890 self.0.options = v.into();
18891 self
18892 }
18893
18894 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18901 (*self.0.stub)
18902 .delete_authz_policy(self.0.request, self.0.options)
18903 .await
18904 .map(crate::Response::into_body)
18905 }
18906
18907 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18909 type Operation =
18910 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18911 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18912 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18913
18914 let stub = self.0.stub.clone();
18915 let mut options = self.0.options.clone();
18916 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18917 let query = move |name| {
18918 let stub = stub.clone();
18919 let options = options.clone();
18920 async {
18921 let op = GetOperation::new(stub)
18922 .set_name(name)
18923 .with_options(options)
18924 .send()
18925 .await?;
18926 Ok(Operation::new(op))
18927 }
18928 };
18929
18930 let start = move || async {
18931 let op = self.send().await?;
18932 Ok(Operation::new(op))
18933 };
18934
18935 google_cloud_lro::internal::new_unit_response_poller(
18936 polling_error_policy,
18937 polling_backoff_policy,
18938 start,
18939 query,
18940 )
18941 }
18942
18943 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18947 self.0.request.name = v.into();
18948 self
18949 }
18950
18951 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18953 self.0.request.request_id = v.into();
18954 self
18955 }
18956 }
18957
18958 #[doc(hidden)]
18959 impl crate::RequestBuilder for DeleteAuthzPolicy {
18960 fn request_options(&mut self) -> &mut crate::RequestOptions {
18961 &mut self.0.options
18962 }
18963 }
18964
18965 #[derive(Clone, Debug)]
18986 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18987
18988 impl ListLocations {
18989 pub(crate) fn new(
18990 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18991 ) -> Self {
18992 Self(RequestBuilder::new(stub))
18993 }
18994
18995 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18997 mut self,
18998 v: V,
18999 ) -> Self {
19000 self.0.request = v.into();
19001 self
19002 }
19003
19004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19006 self.0.options = v.into();
19007 self
19008 }
19009
19010 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19012 (*self.0.stub)
19013 .list_locations(self.0.request, self.0.options)
19014 .await
19015 .map(crate::Response::into_body)
19016 }
19017
19018 pub fn by_page(
19020 self,
19021 ) -> impl google_cloud_gax::paginator::Paginator<
19022 google_cloud_location::model::ListLocationsResponse,
19023 crate::Error,
19024 > {
19025 use std::clone::Clone;
19026 let token = self.0.request.page_token.clone();
19027 let execute = move |token: String| {
19028 let mut builder = self.clone();
19029 builder.0.request = builder.0.request.set_page_token(token);
19030 builder.send()
19031 };
19032 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19033 }
19034
19035 pub fn by_item(
19037 self,
19038 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19039 google_cloud_location::model::ListLocationsResponse,
19040 crate::Error,
19041 > {
19042 use google_cloud_gax::paginator::Paginator;
19043 self.by_page().items()
19044 }
19045
19046 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19048 self.0.request.name = v.into();
19049 self
19050 }
19051
19052 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19054 self.0.request.filter = v.into();
19055 self
19056 }
19057
19058 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19060 self.0.request.page_size = v.into();
19061 self
19062 }
19063
19064 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19066 self.0.request.page_token = v.into();
19067 self
19068 }
19069 }
19070
19071 #[doc(hidden)]
19072 impl crate::RequestBuilder for ListLocations {
19073 fn request_options(&mut self) -> &mut crate::RequestOptions {
19074 &mut self.0.options
19075 }
19076 }
19077
19078 #[derive(Clone, Debug)]
19095 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19096
19097 impl GetLocation {
19098 pub(crate) fn new(
19099 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19100 ) -> Self {
19101 Self(RequestBuilder::new(stub))
19102 }
19103
19104 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19106 mut self,
19107 v: V,
19108 ) -> Self {
19109 self.0.request = v.into();
19110 self
19111 }
19112
19113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19115 self.0.options = v.into();
19116 self
19117 }
19118
19119 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19121 (*self.0.stub)
19122 .get_location(self.0.request, self.0.options)
19123 .await
19124 .map(crate::Response::into_body)
19125 }
19126
19127 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19129 self.0.request.name = v.into();
19130 self
19131 }
19132 }
19133
19134 #[doc(hidden)]
19135 impl crate::RequestBuilder for GetLocation {
19136 fn request_options(&mut self) -> &mut crate::RequestOptions {
19137 &mut self.0.options
19138 }
19139 }
19140
19141 #[derive(Clone, Debug)]
19158 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
19159
19160 impl SetIamPolicy {
19161 pub(crate) fn new(
19162 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19163 ) -> Self {
19164 Self(RequestBuilder::new(stub))
19165 }
19166
19167 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
19169 mut self,
19170 v: V,
19171 ) -> Self {
19172 self.0.request = v.into();
19173 self
19174 }
19175
19176 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19178 self.0.options = v.into();
19179 self
19180 }
19181
19182 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19184 (*self.0.stub)
19185 .set_iam_policy(self.0.request, self.0.options)
19186 .await
19187 .map(crate::Response::into_body)
19188 }
19189
19190 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19194 self.0.request.resource = v.into();
19195 self
19196 }
19197
19198 pub fn set_policy<T>(mut self, v: T) -> Self
19202 where
19203 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19204 {
19205 self.0.request.policy = std::option::Option::Some(v.into());
19206 self
19207 }
19208
19209 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
19213 where
19214 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19215 {
19216 self.0.request.policy = v.map(|x| x.into());
19217 self
19218 }
19219
19220 pub fn set_update_mask<T>(mut self, v: T) -> Self
19222 where
19223 T: std::convert::Into<wkt::FieldMask>,
19224 {
19225 self.0.request.update_mask = std::option::Option::Some(v.into());
19226 self
19227 }
19228
19229 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19231 where
19232 T: std::convert::Into<wkt::FieldMask>,
19233 {
19234 self.0.request.update_mask = v.map(|x| x.into());
19235 self
19236 }
19237 }
19238
19239 #[doc(hidden)]
19240 impl crate::RequestBuilder for SetIamPolicy {
19241 fn request_options(&mut self) -> &mut crate::RequestOptions {
19242 &mut self.0.options
19243 }
19244 }
19245
19246 #[derive(Clone, Debug)]
19263 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
19264
19265 impl GetIamPolicy {
19266 pub(crate) fn new(
19267 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19268 ) -> Self {
19269 Self(RequestBuilder::new(stub))
19270 }
19271
19272 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
19274 mut self,
19275 v: V,
19276 ) -> Self {
19277 self.0.request = v.into();
19278 self
19279 }
19280
19281 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19283 self.0.options = v.into();
19284 self
19285 }
19286
19287 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19289 (*self.0.stub)
19290 .get_iam_policy(self.0.request, self.0.options)
19291 .await
19292 .map(crate::Response::into_body)
19293 }
19294
19295 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19299 self.0.request.resource = v.into();
19300 self
19301 }
19302
19303 pub fn set_options<T>(mut self, v: T) -> Self
19305 where
19306 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19307 {
19308 self.0.request.options = std::option::Option::Some(v.into());
19309 self
19310 }
19311
19312 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
19314 where
19315 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19316 {
19317 self.0.request.options = v.map(|x| x.into());
19318 self
19319 }
19320 }
19321
19322 #[doc(hidden)]
19323 impl crate::RequestBuilder for GetIamPolicy {
19324 fn request_options(&mut self) -> &mut crate::RequestOptions {
19325 &mut self.0.options
19326 }
19327 }
19328
19329 #[derive(Clone, Debug)]
19346 pub struct TestIamPermissions(
19347 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
19348 );
19349
19350 impl TestIamPermissions {
19351 pub(crate) fn new(
19352 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19353 ) -> Self {
19354 Self(RequestBuilder::new(stub))
19355 }
19356
19357 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
19359 mut self,
19360 v: V,
19361 ) -> Self {
19362 self.0.request = v.into();
19363 self
19364 }
19365
19366 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19368 self.0.options = v.into();
19369 self
19370 }
19371
19372 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
19374 (*self.0.stub)
19375 .test_iam_permissions(self.0.request, self.0.options)
19376 .await
19377 .map(crate::Response::into_body)
19378 }
19379
19380 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19384 self.0.request.resource = v.into();
19385 self
19386 }
19387
19388 pub fn set_permissions<T, V>(mut self, v: T) -> Self
19392 where
19393 T: std::iter::IntoIterator<Item = V>,
19394 V: std::convert::Into<std::string::String>,
19395 {
19396 use std::iter::Iterator;
19397 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
19398 self
19399 }
19400 }
19401
19402 #[doc(hidden)]
19403 impl crate::RequestBuilder for TestIamPermissions {
19404 fn request_options(&mut self) -> &mut crate::RequestOptions {
19405 &mut self.0.options
19406 }
19407 }
19408
19409 #[derive(Clone, Debug)]
19430 pub struct ListOperations(
19431 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19432 );
19433
19434 impl ListOperations {
19435 pub(crate) fn new(
19436 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19437 ) -> Self {
19438 Self(RequestBuilder::new(stub))
19439 }
19440
19441 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19443 mut self,
19444 v: V,
19445 ) -> Self {
19446 self.0.request = v.into();
19447 self
19448 }
19449
19450 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19452 self.0.options = v.into();
19453 self
19454 }
19455
19456 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19458 (*self.0.stub)
19459 .list_operations(self.0.request, self.0.options)
19460 .await
19461 .map(crate::Response::into_body)
19462 }
19463
19464 pub fn by_page(
19466 self,
19467 ) -> impl google_cloud_gax::paginator::Paginator<
19468 google_cloud_longrunning::model::ListOperationsResponse,
19469 crate::Error,
19470 > {
19471 use std::clone::Clone;
19472 let token = self.0.request.page_token.clone();
19473 let execute = move |token: String| {
19474 let mut builder = self.clone();
19475 builder.0.request = builder.0.request.set_page_token(token);
19476 builder.send()
19477 };
19478 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19479 }
19480
19481 pub fn by_item(
19483 self,
19484 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19485 google_cloud_longrunning::model::ListOperationsResponse,
19486 crate::Error,
19487 > {
19488 use google_cloud_gax::paginator::Paginator;
19489 self.by_page().items()
19490 }
19491
19492 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19494 self.0.request.name = v.into();
19495 self
19496 }
19497
19498 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19500 self.0.request.filter = v.into();
19501 self
19502 }
19503
19504 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19506 self.0.request.page_size = v.into();
19507 self
19508 }
19509
19510 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19512 self.0.request.page_token = v.into();
19513 self
19514 }
19515
19516 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19518 self.0.request.return_partial_success = v.into();
19519 self
19520 }
19521 }
19522
19523 #[doc(hidden)]
19524 impl crate::RequestBuilder for ListOperations {
19525 fn request_options(&mut self) -> &mut crate::RequestOptions {
19526 &mut self.0.options
19527 }
19528 }
19529
19530 #[derive(Clone, Debug)]
19547 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19548
19549 impl GetOperation {
19550 pub(crate) fn new(
19551 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19552 ) -> Self {
19553 Self(RequestBuilder::new(stub))
19554 }
19555
19556 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19558 mut self,
19559 v: V,
19560 ) -> Self {
19561 self.0.request = v.into();
19562 self
19563 }
19564
19565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19567 self.0.options = v.into();
19568 self
19569 }
19570
19571 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19573 (*self.0.stub)
19574 .get_operation(self.0.request, self.0.options)
19575 .await
19576 .map(crate::Response::into_body)
19577 }
19578
19579 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19581 self.0.request.name = v.into();
19582 self
19583 }
19584 }
19585
19586 #[doc(hidden)]
19587 impl crate::RequestBuilder for GetOperation {
19588 fn request_options(&mut self) -> &mut crate::RequestOptions {
19589 &mut self.0.options
19590 }
19591 }
19592
19593 #[derive(Clone, Debug)]
19610 pub struct DeleteOperation(
19611 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
19612 );
19613
19614 impl DeleteOperation {
19615 pub(crate) fn new(
19616 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19617 ) -> Self {
19618 Self(RequestBuilder::new(stub))
19619 }
19620
19621 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
19623 mut self,
19624 v: V,
19625 ) -> Self {
19626 self.0.request = v.into();
19627 self
19628 }
19629
19630 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19632 self.0.options = v.into();
19633 self
19634 }
19635
19636 pub async fn send(self) -> Result<()> {
19638 (*self.0.stub)
19639 .delete_operation(self.0.request, self.0.options)
19640 .await
19641 .map(crate::Response::into_body)
19642 }
19643
19644 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19646 self.0.request.name = v.into();
19647 self
19648 }
19649 }
19650
19651 #[doc(hidden)]
19652 impl crate::RequestBuilder for DeleteOperation {
19653 fn request_options(&mut self) -> &mut crate::RequestOptions {
19654 &mut self.0.options
19655 }
19656 }
19657
19658 #[derive(Clone, Debug)]
19675 pub struct CancelOperation(
19676 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19677 );
19678
19679 impl CancelOperation {
19680 pub(crate) fn new(
19681 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19682 ) -> Self {
19683 Self(RequestBuilder::new(stub))
19684 }
19685
19686 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19688 mut self,
19689 v: V,
19690 ) -> Self {
19691 self.0.request = v.into();
19692 self
19693 }
19694
19695 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19697 self.0.options = v.into();
19698 self
19699 }
19700
19701 pub async fn send(self) -> Result<()> {
19703 (*self.0.stub)
19704 .cancel_operation(self.0.request, self.0.options)
19705 .await
19706 .map(crate::Response::into_body)
19707 }
19708
19709 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19711 self.0.request.name = v.into();
19712 self
19713 }
19714 }
19715
19716 #[doc(hidden)]
19717 impl crate::RequestBuilder for CancelOperation {
19718 fn request_options(&mut self) -> &mut crate::RequestOptions {
19719 &mut self.0.options
19720 }
19721 }
19722}
19723
19724pub mod organization_security_profile_group_service {
19725 use crate::Result;
19726
19727 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19741
19742 pub(crate) mod client {
19743 use super::super::super::client::OrganizationSecurityProfileGroupService;
19744 pub struct Factory;
19745 impl crate::ClientFactory for Factory {
19746 type Client = OrganizationSecurityProfileGroupService;
19747 type Credentials = gaxi::options::Credentials;
19748 async fn build(
19749 self,
19750 config: gaxi::options::ClientConfig,
19751 ) -> crate::ClientBuilderResult<Self::Client> {
19752 Self::Client::new(config).await
19753 }
19754 }
19755 }
19756
19757 #[derive(Clone, Debug)]
19759 pub(crate) struct RequestBuilder<R: std::default::Default> {
19760 stub: std::sync::Arc<
19761 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19762 >,
19763 request: R,
19764 options: crate::RequestOptions,
19765 }
19766
19767 impl<R> RequestBuilder<R>
19768 where
19769 R: std::default::Default,
19770 {
19771 pub(crate) fn new(
19772 stub: std::sync::Arc<
19773 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19774 >,
19775 ) -> Self {
19776 Self {
19777 stub,
19778 request: R::default(),
19779 options: crate::RequestOptions::default(),
19780 }
19781 }
19782 }
19783
19784 #[derive(Clone, Debug)]
19805 pub struct ListSecurityProfileGroups(
19806 RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
19807 );
19808
19809 impl ListSecurityProfileGroups {
19810 pub(crate) fn new(
19811 stub: std::sync::Arc<
19812 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19813 >,
19814 ) -> Self {
19815 Self(RequestBuilder::new(stub))
19816 }
19817
19818 pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
19820 mut self,
19821 v: V,
19822 ) -> Self {
19823 self.0.request = v.into();
19824 self
19825 }
19826
19827 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19829 self.0.options = v.into();
19830 self
19831 }
19832
19833 pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
19835 (*self.0.stub)
19836 .list_security_profile_groups(self.0.request, self.0.options)
19837 .await
19838 .map(crate::Response::into_body)
19839 }
19840
19841 pub fn by_page(
19843 self,
19844 ) -> impl google_cloud_gax::paginator::Paginator<
19845 crate::model::ListSecurityProfileGroupsResponse,
19846 crate::Error,
19847 > {
19848 use std::clone::Clone;
19849 let token = self.0.request.page_token.clone();
19850 let execute = move |token: String| {
19851 let mut builder = self.clone();
19852 builder.0.request = builder.0.request.set_page_token(token);
19853 builder.send()
19854 };
19855 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19856 }
19857
19858 pub fn by_item(
19860 self,
19861 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19862 crate::model::ListSecurityProfileGroupsResponse,
19863 crate::Error,
19864 > {
19865 use google_cloud_gax::paginator::Paginator;
19866 self.by_page().items()
19867 }
19868
19869 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19873 self.0.request.parent = v.into();
19874 self
19875 }
19876
19877 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19879 self.0.request.page_size = v.into();
19880 self
19881 }
19882
19883 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19885 self.0.request.page_token = v.into();
19886 self
19887 }
19888 }
19889
19890 #[doc(hidden)]
19891 impl crate::RequestBuilder for ListSecurityProfileGroups {
19892 fn request_options(&mut self) -> &mut crate::RequestOptions {
19893 &mut self.0.options
19894 }
19895 }
19896
19897 #[derive(Clone, Debug)]
19914 pub struct GetSecurityProfileGroup(
19915 RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
19916 );
19917
19918 impl GetSecurityProfileGroup {
19919 pub(crate) fn new(
19920 stub: std::sync::Arc<
19921 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19922 >,
19923 ) -> Self {
19924 Self(RequestBuilder::new(stub))
19925 }
19926
19927 pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
19929 mut self,
19930 v: V,
19931 ) -> Self {
19932 self.0.request = v.into();
19933 self
19934 }
19935
19936 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19938 self.0.options = v.into();
19939 self
19940 }
19941
19942 pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
19944 (*self.0.stub)
19945 .get_security_profile_group(self.0.request, self.0.options)
19946 .await
19947 .map(crate::Response::into_body)
19948 }
19949
19950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19954 self.0.request.name = v.into();
19955 self
19956 }
19957 }
19958
19959 #[doc(hidden)]
19960 impl crate::RequestBuilder for GetSecurityProfileGroup {
19961 fn request_options(&mut self) -> &mut crate::RequestOptions {
19962 &mut self.0.options
19963 }
19964 }
19965
19966 #[derive(Clone, Debug)]
19984 pub struct CreateSecurityProfileGroup(
19985 RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
19986 );
19987
19988 impl CreateSecurityProfileGroup {
19989 pub(crate) fn new(
19990 stub: std::sync::Arc<
19991 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19992 >,
19993 ) -> Self {
19994 Self(RequestBuilder::new(stub))
19995 }
19996
19997 pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
19999 mut self,
20000 v: V,
20001 ) -> Self {
20002 self.0.request = v.into();
20003 self
20004 }
20005
20006 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20008 self.0.options = v.into();
20009 self
20010 }
20011
20012 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20019 (*self.0.stub)
20020 .create_security_profile_group(self.0.request, self.0.options)
20021 .await
20022 .map(crate::Response::into_body)
20023 }
20024
20025 pub fn poller(
20027 self,
20028 ) -> impl google_cloud_lro::Poller<
20029 crate::model::SecurityProfileGroup,
20030 crate::model::OperationMetadata,
20031 > {
20032 type Operation = google_cloud_lro::internal::Operation<
20033 crate::model::SecurityProfileGroup,
20034 crate::model::OperationMetadata,
20035 >;
20036 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20037 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20038
20039 let stub = self.0.stub.clone();
20040 let mut options = self.0.options.clone();
20041 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20042 let query = move |name| {
20043 let stub = stub.clone();
20044 let options = options.clone();
20045 async {
20046 let op = GetOperation::new(stub)
20047 .set_name(name)
20048 .with_options(options)
20049 .send()
20050 .await?;
20051 Ok(Operation::new(op))
20052 }
20053 };
20054
20055 let start = move || async {
20056 let op = self.send().await?;
20057 Ok(Operation::new(op))
20058 };
20059
20060 google_cloud_lro::internal::new_poller(
20061 polling_error_policy,
20062 polling_backoff_policy,
20063 start,
20064 query,
20065 )
20066 }
20067
20068 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20072 self.0.request.parent = v.into();
20073 self
20074 }
20075
20076 pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20080 self.0.request.security_profile_group_id = v.into();
20081 self
20082 }
20083
20084 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20088 where
20089 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20090 {
20091 self.0.request.security_profile_group = std::option::Option::Some(v.into());
20092 self
20093 }
20094
20095 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20099 where
20100 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20101 {
20102 self.0.request.security_profile_group = v.map(|x| x.into());
20103 self
20104 }
20105 }
20106
20107 #[doc(hidden)]
20108 impl crate::RequestBuilder for CreateSecurityProfileGroup {
20109 fn request_options(&mut self) -> &mut crate::RequestOptions {
20110 &mut self.0.options
20111 }
20112 }
20113
20114 #[derive(Clone, Debug)]
20132 pub struct UpdateSecurityProfileGroup(
20133 RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
20134 );
20135
20136 impl UpdateSecurityProfileGroup {
20137 pub(crate) fn new(
20138 stub: std::sync::Arc<
20139 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20140 >,
20141 ) -> Self {
20142 Self(RequestBuilder::new(stub))
20143 }
20144
20145 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
20147 mut self,
20148 v: V,
20149 ) -> Self {
20150 self.0.request = v.into();
20151 self
20152 }
20153
20154 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20156 self.0.options = v.into();
20157 self
20158 }
20159
20160 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20167 (*self.0.stub)
20168 .update_security_profile_group(self.0.request, self.0.options)
20169 .await
20170 .map(crate::Response::into_body)
20171 }
20172
20173 pub fn poller(
20175 self,
20176 ) -> impl google_cloud_lro::Poller<
20177 crate::model::SecurityProfileGroup,
20178 crate::model::OperationMetadata,
20179 > {
20180 type Operation = google_cloud_lro::internal::Operation<
20181 crate::model::SecurityProfileGroup,
20182 crate::model::OperationMetadata,
20183 >;
20184 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20185 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20186
20187 let stub = self.0.stub.clone();
20188 let mut options = self.0.options.clone();
20189 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20190 let query = move |name| {
20191 let stub = stub.clone();
20192 let options = options.clone();
20193 async {
20194 let op = GetOperation::new(stub)
20195 .set_name(name)
20196 .with_options(options)
20197 .send()
20198 .await?;
20199 Ok(Operation::new(op))
20200 }
20201 };
20202
20203 let start = move || async {
20204 let op = self.send().await?;
20205 Ok(Operation::new(op))
20206 };
20207
20208 google_cloud_lro::internal::new_poller(
20209 polling_error_policy,
20210 polling_backoff_policy,
20211 start,
20212 query,
20213 )
20214 }
20215
20216 pub fn set_update_mask<T>(mut self, v: T) -> Self
20220 where
20221 T: std::convert::Into<wkt::FieldMask>,
20222 {
20223 self.0.request.update_mask = std::option::Option::Some(v.into());
20224 self
20225 }
20226
20227 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20231 where
20232 T: std::convert::Into<wkt::FieldMask>,
20233 {
20234 self.0.request.update_mask = v.map(|x| x.into());
20235 self
20236 }
20237
20238 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20242 where
20243 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20244 {
20245 self.0.request.security_profile_group = std::option::Option::Some(v.into());
20246 self
20247 }
20248
20249 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20253 where
20254 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20255 {
20256 self.0.request.security_profile_group = v.map(|x| x.into());
20257 self
20258 }
20259 }
20260
20261 #[doc(hidden)]
20262 impl crate::RequestBuilder for UpdateSecurityProfileGroup {
20263 fn request_options(&mut self) -> &mut crate::RequestOptions {
20264 &mut self.0.options
20265 }
20266 }
20267
20268 #[derive(Clone, Debug)]
20286 pub struct DeleteSecurityProfileGroup(
20287 RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
20288 );
20289
20290 impl DeleteSecurityProfileGroup {
20291 pub(crate) fn new(
20292 stub: std::sync::Arc<
20293 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20294 >,
20295 ) -> Self {
20296 Self(RequestBuilder::new(stub))
20297 }
20298
20299 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
20301 mut self,
20302 v: V,
20303 ) -> Self {
20304 self.0.request = v.into();
20305 self
20306 }
20307
20308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20310 self.0.options = v.into();
20311 self
20312 }
20313
20314 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20321 (*self.0.stub)
20322 .delete_security_profile_group(self.0.request, self.0.options)
20323 .await
20324 .map(crate::Response::into_body)
20325 }
20326
20327 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20329 type Operation =
20330 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20331 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20332 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20333
20334 let stub = self.0.stub.clone();
20335 let mut options = self.0.options.clone();
20336 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20337 let query = move |name| {
20338 let stub = stub.clone();
20339 let options = options.clone();
20340 async {
20341 let op = GetOperation::new(stub)
20342 .set_name(name)
20343 .with_options(options)
20344 .send()
20345 .await?;
20346 Ok(Operation::new(op))
20347 }
20348 };
20349
20350 let start = move || async {
20351 let op = self.send().await?;
20352 Ok(Operation::new(op))
20353 };
20354
20355 google_cloud_lro::internal::new_unit_response_poller(
20356 polling_error_policy,
20357 polling_backoff_policy,
20358 start,
20359 query,
20360 )
20361 }
20362
20363 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20367 self.0.request.name = v.into();
20368 self
20369 }
20370
20371 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20373 self.0.request.etag = v.into();
20374 self
20375 }
20376 }
20377
20378 #[doc(hidden)]
20379 impl crate::RequestBuilder for DeleteSecurityProfileGroup {
20380 fn request_options(&mut self) -> &mut crate::RequestOptions {
20381 &mut self.0.options
20382 }
20383 }
20384
20385 #[derive(Clone, Debug)]
20406 pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
20407
20408 impl ListSecurityProfiles {
20409 pub(crate) fn new(
20410 stub: std::sync::Arc<
20411 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20412 >,
20413 ) -> Self {
20414 Self(RequestBuilder::new(stub))
20415 }
20416
20417 pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
20419 mut self,
20420 v: V,
20421 ) -> Self {
20422 self.0.request = v.into();
20423 self
20424 }
20425
20426 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20428 self.0.options = v.into();
20429 self
20430 }
20431
20432 pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
20434 (*self.0.stub)
20435 .list_security_profiles(self.0.request, self.0.options)
20436 .await
20437 .map(crate::Response::into_body)
20438 }
20439
20440 pub fn by_page(
20442 self,
20443 ) -> impl google_cloud_gax::paginator::Paginator<
20444 crate::model::ListSecurityProfilesResponse,
20445 crate::Error,
20446 > {
20447 use std::clone::Clone;
20448 let token = self.0.request.page_token.clone();
20449 let execute = move |token: String| {
20450 let mut builder = self.clone();
20451 builder.0.request = builder.0.request.set_page_token(token);
20452 builder.send()
20453 };
20454 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20455 }
20456
20457 pub fn by_item(
20459 self,
20460 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20461 crate::model::ListSecurityProfilesResponse,
20462 crate::Error,
20463 > {
20464 use google_cloud_gax::paginator::Paginator;
20465 self.by_page().items()
20466 }
20467
20468 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20472 self.0.request.parent = v.into();
20473 self
20474 }
20475
20476 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20478 self.0.request.page_size = v.into();
20479 self
20480 }
20481
20482 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20484 self.0.request.page_token = v.into();
20485 self
20486 }
20487 }
20488
20489 #[doc(hidden)]
20490 impl crate::RequestBuilder for ListSecurityProfiles {
20491 fn request_options(&mut self) -> &mut crate::RequestOptions {
20492 &mut self.0.options
20493 }
20494 }
20495
20496 #[derive(Clone, Debug)]
20513 pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
20514
20515 impl GetSecurityProfile {
20516 pub(crate) fn new(
20517 stub: std::sync::Arc<
20518 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20519 >,
20520 ) -> Self {
20521 Self(RequestBuilder::new(stub))
20522 }
20523
20524 pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
20526 mut self,
20527 v: V,
20528 ) -> Self {
20529 self.0.request = v.into();
20530 self
20531 }
20532
20533 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20535 self.0.options = v.into();
20536 self
20537 }
20538
20539 pub async fn send(self) -> Result<crate::model::SecurityProfile> {
20541 (*self.0.stub)
20542 .get_security_profile(self.0.request, self.0.options)
20543 .await
20544 .map(crate::Response::into_body)
20545 }
20546
20547 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20551 self.0.request.name = v.into();
20552 self
20553 }
20554 }
20555
20556 #[doc(hidden)]
20557 impl crate::RequestBuilder for GetSecurityProfile {
20558 fn request_options(&mut self) -> &mut crate::RequestOptions {
20559 &mut self.0.options
20560 }
20561 }
20562
20563 #[derive(Clone, Debug)]
20581 pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
20582
20583 impl CreateSecurityProfile {
20584 pub(crate) fn new(
20585 stub: std::sync::Arc<
20586 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20587 >,
20588 ) -> Self {
20589 Self(RequestBuilder::new(stub))
20590 }
20591
20592 pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
20594 mut self,
20595 v: V,
20596 ) -> Self {
20597 self.0.request = v.into();
20598 self
20599 }
20600
20601 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20603 self.0.options = v.into();
20604 self
20605 }
20606
20607 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20614 (*self.0.stub)
20615 .create_security_profile(self.0.request, self.0.options)
20616 .await
20617 .map(crate::Response::into_body)
20618 }
20619
20620 pub fn poller(
20622 self,
20623 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
20624 {
20625 type Operation = google_cloud_lro::internal::Operation<
20626 crate::model::SecurityProfile,
20627 crate::model::OperationMetadata,
20628 >;
20629 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20630 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20631
20632 let stub = self.0.stub.clone();
20633 let mut options = self.0.options.clone();
20634 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20635 let query = move |name| {
20636 let stub = stub.clone();
20637 let options = options.clone();
20638 async {
20639 let op = GetOperation::new(stub)
20640 .set_name(name)
20641 .with_options(options)
20642 .send()
20643 .await?;
20644 Ok(Operation::new(op))
20645 }
20646 };
20647
20648 let start = move || async {
20649 let op = self.send().await?;
20650 Ok(Operation::new(op))
20651 };
20652
20653 google_cloud_lro::internal::new_poller(
20654 polling_error_policy,
20655 polling_backoff_policy,
20656 start,
20657 query,
20658 )
20659 }
20660
20661 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20665 self.0.request.parent = v.into();
20666 self
20667 }
20668
20669 pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20673 self.0.request.security_profile_id = v.into();
20674 self
20675 }
20676
20677 pub fn set_security_profile<T>(mut self, v: T) -> Self
20681 where
20682 T: std::convert::Into<crate::model::SecurityProfile>,
20683 {
20684 self.0.request.security_profile = std::option::Option::Some(v.into());
20685 self
20686 }
20687
20688 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
20692 where
20693 T: std::convert::Into<crate::model::SecurityProfile>,
20694 {
20695 self.0.request.security_profile = v.map(|x| x.into());
20696 self
20697 }
20698 }
20699
20700 #[doc(hidden)]
20701 impl crate::RequestBuilder for CreateSecurityProfile {
20702 fn request_options(&mut self) -> &mut crate::RequestOptions {
20703 &mut self.0.options
20704 }
20705 }
20706
20707 #[derive(Clone, Debug)]
20725 pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
20726
20727 impl UpdateSecurityProfile {
20728 pub(crate) fn new(
20729 stub: std::sync::Arc<
20730 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20731 >,
20732 ) -> Self {
20733 Self(RequestBuilder::new(stub))
20734 }
20735
20736 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
20738 mut self,
20739 v: V,
20740 ) -> Self {
20741 self.0.request = v.into();
20742 self
20743 }
20744
20745 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20747 self.0.options = v.into();
20748 self
20749 }
20750
20751 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20758 (*self.0.stub)
20759 .update_security_profile(self.0.request, self.0.options)
20760 .await
20761 .map(crate::Response::into_body)
20762 }
20763
20764 pub fn poller(
20766 self,
20767 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
20768 {
20769 type Operation = google_cloud_lro::internal::Operation<
20770 crate::model::SecurityProfile,
20771 crate::model::OperationMetadata,
20772 >;
20773 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20774 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20775
20776 let stub = self.0.stub.clone();
20777 let mut options = self.0.options.clone();
20778 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20779 let query = move |name| {
20780 let stub = stub.clone();
20781 let options = options.clone();
20782 async {
20783 let op = GetOperation::new(stub)
20784 .set_name(name)
20785 .with_options(options)
20786 .send()
20787 .await?;
20788 Ok(Operation::new(op))
20789 }
20790 };
20791
20792 let start = move || async {
20793 let op = self.send().await?;
20794 Ok(Operation::new(op))
20795 };
20796
20797 google_cloud_lro::internal::new_poller(
20798 polling_error_policy,
20799 polling_backoff_policy,
20800 start,
20801 query,
20802 )
20803 }
20804
20805 pub fn set_update_mask<T>(mut self, v: T) -> Self
20809 where
20810 T: std::convert::Into<wkt::FieldMask>,
20811 {
20812 self.0.request.update_mask = std::option::Option::Some(v.into());
20813 self
20814 }
20815
20816 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20820 where
20821 T: std::convert::Into<wkt::FieldMask>,
20822 {
20823 self.0.request.update_mask = v.map(|x| x.into());
20824 self
20825 }
20826
20827 pub fn set_security_profile<T>(mut self, v: T) -> Self
20831 where
20832 T: std::convert::Into<crate::model::SecurityProfile>,
20833 {
20834 self.0.request.security_profile = std::option::Option::Some(v.into());
20835 self
20836 }
20837
20838 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
20842 where
20843 T: std::convert::Into<crate::model::SecurityProfile>,
20844 {
20845 self.0.request.security_profile = v.map(|x| x.into());
20846 self
20847 }
20848 }
20849
20850 #[doc(hidden)]
20851 impl crate::RequestBuilder for UpdateSecurityProfile {
20852 fn request_options(&mut self) -> &mut crate::RequestOptions {
20853 &mut self.0.options
20854 }
20855 }
20856
20857 #[derive(Clone, Debug)]
20875 pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
20876
20877 impl DeleteSecurityProfile {
20878 pub(crate) fn new(
20879 stub: std::sync::Arc<
20880 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20881 >,
20882 ) -> Self {
20883 Self(RequestBuilder::new(stub))
20884 }
20885
20886 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
20888 mut self,
20889 v: V,
20890 ) -> Self {
20891 self.0.request = v.into();
20892 self
20893 }
20894
20895 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20897 self.0.options = v.into();
20898 self
20899 }
20900
20901 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20908 (*self.0.stub)
20909 .delete_security_profile(self.0.request, self.0.options)
20910 .await
20911 .map(crate::Response::into_body)
20912 }
20913
20914 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20916 type Operation =
20917 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20918 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20919 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20920
20921 let stub = self.0.stub.clone();
20922 let mut options = self.0.options.clone();
20923 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20924 let query = move |name| {
20925 let stub = stub.clone();
20926 let options = options.clone();
20927 async {
20928 let op = GetOperation::new(stub)
20929 .set_name(name)
20930 .with_options(options)
20931 .send()
20932 .await?;
20933 Ok(Operation::new(op))
20934 }
20935 };
20936
20937 let start = move || async {
20938 let op = self.send().await?;
20939 Ok(Operation::new(op))
20940 };
20941
20942 google_cloud_lro::internal::new_unit_response_poller(
20943 polling_error_policy,
20944 polling_backoff_policy,
20945 start,
20946 query,
20947 )
20948 }
20949
20950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20954 self.0.request.name = v.into();
20955 self
20956 }
20957
20958 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20960 self.0.request.etag = v.into();
20961 self
20962 }
20963 }
20964
20965 #[doc(hidden)]
20966 impl crate::RequestBuilder for DeleteSecurityProfile {
20967 fn request_options(&mut self) -> &mut crate::RequestOptions {
20968 &mut self.0.options
20969 }
20970 }
20971
20972 #[derive(Clone, Debug)]
20993 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20994
20995 impl ListLocations {
20996 pub(crate) fn new(
20997 stub: std::sync::Arc<
20998 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20999 >,
21000 ) -> Self {
21001 Self(RequestBuilder::new(stub))
21002 }
21003
21004 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21006 mut self,
21007 v: V,
21008 ) -> Self {
21009 self.0.request = v.into();
21010 self
21011 }
21012
21013 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21015 self.0.options = v.into();
21016 self
21017 }
21018
21019 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21021 (*self.0.stub)
21022 .list_locations(self.0.request, self.0.options)
21023 .await
21024 .map(crate::Response::into_body)
21025 }
21026
21027 pub fn by_page(
21029 self,
21030 ) -> impl google_cloud_gax::paginator::Paginator<
21031 google_cloud_location::model::ListLocationsResponse,
21032 crate::Error,
21033 > {
21034 use std::clone::Clone;
21035 let token = self.0.request.page_token.clone();
21036 let execute = move |token: String| {
21037 let mut builder = self.clone();
21038 builder.0.request = builder.0.request.set_page_token(token);
21039 builder.send()
21040 };
21041 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21042 }
21043
21044 pub fn by_item(
21046 self,
21047 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21048 google_cloud_location::model::ListLocationsResponse,
21049 crate::Error,
21050 > {
21051 use google_cloud_gax::paginator::Paginator;
21052 self.by_page().items()
21053 }
21054
21055 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21057 self.0.request.name = v.into();
21058 self
21059 }
21060
21061 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21063 self.0.request.filter = v.into();
21064 self
21065 }
21066
21067 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21069 self.0.request.page_size = v.into();
21070 self
21071 }
21072
21073 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21075 self.0.request.page_token = v.into();
21076 self
21077 }
21078 }
21079
21080 #[doc(hidden)]
21081 impl crate::RequestBuilder for ListLocations {
21082 fn request_options(&mut self) -> &mut crate::RequestOptions {
21083 &mut self.0.options
21084 }
21085 }
21086
21087 #[derive(Clone, Debug)]
21104 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21105
21106 impl GetLocation {
21107 pub(crate) fn new(
21108 stub: std::sync::Arc<
21109 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21110 >,
21111 ) -> Self {
21112 Self(RequestBuilder::new(stub))
21113 }
21114
21115 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21117 mut self,
21118 v: V,
21119 ) -> Self {
21120 self.0.request = v.into();
21121 self
21122 }
21123
21124 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21126 self.0.options = v.into();
21127 self
21128 }
21129
21130 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21132 (*self.0.stub)
21133 .get_location(self.0.request, self.0.options)
21134 .await
21135 .map(crate::Response::into_body)
21136 }
21137
21138 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21140 self.0.request.name = v.into();
21141 self
21142 }
21143 }
21144
21145 #[doc(hidden)]
21146 impl crate::RequestBuilder for GetLocation {
21147 fn request_options(&mut self) -> &mut crate::RequestOptions {
21148 &mut self.0.options
21149 }
21150 }
21151
21152 #[derive(Clone, Debug)]
21169 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
21170
21171 impl SetIamPolicy {
21172 pub(crate) fn new(
21173 stub: std::sync::Arc<
21174 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21175 >,
21176 ) -> Self {
21177 Self(RequestBuilder::new(stub))
21178 }
21179
21180 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
21182 mut self,
21183 v: V,
21184 ) -> Self {
21185 self.0.request = v.into();
21186 self
21187 }
21188
21189 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21191 self.0.options = v.into();
21192 self
21193 }
21194
21195 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21197 (*self.0.stub)
21198 .set_iam_policy(self.0.request, self.0.options)
21199 .await
21200 .map(crate::Response::into_body)
21201 }
21202
21203 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21207 self.0.request.resource = v.into();
21208 self
21209 }
21210
21211 pub fn set_policy<T>(mut self, v: T) -> Self
21215 where
21216 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21217 {
21218 self.0.request.policy = std::option::Option::Some(v.into());
21219 self
21220 }
21221
21222 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
21226 where
21227 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21228 {
21229 self.0.request.policy = v.map(|x| x.into());
21230 self
21231 }
21232
21233 pub fn set_update_mask<T>(mut self, v: T) -> Self
21235 where
21236 T: std::convert::Into<wkt::FieldMask>,
21237 {
21238 self.0.request.update_mask = std::option::Option::Some(v.into());
21239 self
21240 }
21241
21242 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21244 where
21245 T: std::convert::Into<wkt::FieldMask>,
21246 {
21247 self.0.request.update_mask = v.map(|x| x.into());
21248 self
21249 }
21250 }
21251
21252 #[doc(hidden)]
21253 impl crate::RequestBuilder for SetIamPolicy {
21254 fn request_options(&mut self) -> &mut crate::RequestOptions {
21255 &mut self.0.options
21256 }
21257 }
21258
21259 #[derive(Clone, Debug)]
21276 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
21277
21278 impl GetIamPolicy {
21279 pub(crate) fn new(
21280 stub: std::sync::Arc<
21281 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21282 >,
21283 ) -> Self {
21284 Self(RequestBuilder::new(stub))
21285 }
21286
21287 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
21289 mut self,
21290 v: V,
21291 ) -> Self {
21292 self.0.request = v.into();
21293 self
21294 }
21295
21296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21298 self.0.options = v.into();
21299 self
21300 }
21301
21302 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21304 (*self.0.stub)
21305 .get_iam_policy(self.0.request, self.0.options)
21306 .await
21307 .map(crate::Response::into_body)
21308 }
21309
21310 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21314 self.0.request.resource = v.into();
21315 self
21316 }
21317
21318 pub fn set_options<T>(mut self, v: T) -> Self
21320 where
21321 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21322 {
21323 self.0.request.options = std::option::Option::Some(v.into());
21324 self
21325 }
21326
21327 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
21329 where
21330 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21331 {
21332 self.0.request.options = v.map(|x| x.into());
21333 self
21334 }
21335 }
21336
21337 #[doc(hidden)]
21338 impl crate::RequestBuilder for GetIamPolicy {
21339 fn request_options(&mut self) -> &mut crate::RequestOptions {
21340 &mut self.0.options
21341 }
21342 }
21343
21344 #[derive(Clone, Debug)]
21361 pub struct TestIamPermissions(
21362 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
21363 );
21364
21365 impl TestIamPermissions {
21366 pub(crate) fn new(
21367 stub: std::sync::Arc<
21368 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21369 >,
21370 ) -> Self {
21371 Self(RequestBuilder::new(stub))
21372 }
21373
21374 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
21376 mut self,
21377 v: V,
21378 ) -> Self {
21379 self.0.request = v.into();
21380 self
21381 }
21382
21383 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21385 self.0.options = v.into();
21386 self
21387 }
21388
21389 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
21391 (*self.0.stub)
21392 .test_iam_permissions(self.0.request, self.0.options)
21393 .await
21394 .map(crate::Response::into_body)
21395 }
21396
21397 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21401 self.0.request.resource = v.into();
21402 self
21403 }
21404
21405 pub fn set_permissions<T, V>(mut self, v: T) -> Self
21409 where
21410 T: std::iter::IntoIterator<Item = V>,
21411 V: std::convert::Into<std::string::String>,
21412 {
21413 use std::iter::Iterator;
21414 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
21415 self
21416 }
21417 }
21418
21419 #[doc(hidden)]
21420 impl crate::RequestBuilder for TestIamPermissions {
21421 fn request_options(&mut self) -> &mut crate::RequestOptions {
21422 &mut self.0.options
21423 }
21424 }
21425
21426 #[derive(Clone, Debug)]
21447 pub struct ListOperations(
21448 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21449 );
21450
21451 impl ListOperations {
21452 pub(crate) fn new(
21453 stub: std::sync::Arc<
21454 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21455 >,
21456 ) -> Self {
21457 Self(RequestBuilder::new(stub))
21458 }
21459
21460 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21462 mut self,
21463 v: V,
21464 ) -> Self {
21465 self.0.request = v.into();
21466 self
21467 }
21468
21469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21471 self.0.options = v.into();
21472 self
21473 }
21474
21475 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21477 (*self.0.stub)
21478 .list_operations(self.0.request, self.0.options)
21479 .await
21480 .map(crate::Response::into_body)
21481 }
21482
21483 pub fn by_page(
21485 self,
21486 ) -> impl google_cloud_gax::paginator::Paginator<
21487 google_cloud_longrunning::model::ListOperationsResponse,
21488 crate::Error,
21489 > {
21490 use std::clone::Clone;
21491 let token = self.0.request.page_token.clone();
21492 let execute = move |token: String| {
21493 let mut builder = self.clone();
21494 builder.0.request = builder.0.request.set_page_token(token);
21495 builder.send()
21496 };
21497 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21498 }
21499
21500 pub fn by_item(
21502 self,
21503 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21504 google_cloud_longrunning::model::ListOperationsResponse,
21505 crate::Error,
21506 > {
21507 use google_cloud_gax::paginator::Paginator;
21508 self.by_page().items()
21509 }
21510
21511 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21513 self.0.request.name = v.into();
21514 self
21515 }
21516
21517 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21519 self.0.request.filter = v.into();
21520 self
21521 }
21522
21523 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21525 self.0.request.page_size = v.into();
21526 self
21527 }
21528
21529 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21531 self.0.request.page_token = v.into();
21532 self
21533 }
21534
21535 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21537 self.0.request.return_partial_success = v.into();
21538 self
21539 }
21540 }
21541
21542 #[doc(hidden)]
21543 impl crate::RequestBuilder for ListOperations {
21544 fn request_options(&mut self) -> &mut crate::RequestOptions {
21545 &mut self.0.options
21546 }
21547 }
21548
21549 #[derive(Clone, Debug)]
21566 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21567
21568 impl GetOperation {
21569 pub(crate) fn new(
21570 stub: std::sync::Arc<
21571 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21572 >,
21573 ) -> Self {
21574 Self(RequestBuilder::new(stub))
21575 }
21576
21577 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21579 mut self,
21580 v: V,
21581 ) -> Self {
21582 self.0.request = v.into();
21583 self
21584 }
21585
21586 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21588 self.0.options = v.into();
21589 self
21590 }
21591
21592 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21594 (*self.0.stub)
21595 .get_operation(self.0.request, self.0.options)
21596 .await
21597 .map(crate::Response::into_body)
21598 }
21599
21600 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21602 self.0.request.name = v.into();
21603 self
21604 }
21605 }
21606
21607 #[doc(hidden)]
21608 impl crate::RequestBuilder for GetOperation {
21609 fn request_options(&mut self) -> &mut crate::RequestOptions {
21610 &mut self.0.options
21611 }
21612 }
21613
21614 #[derive(Clone, Debug)]
21631 pub struct DeleteOperation(
21632 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
21633 );
21634
21635 impl DeleteOperation {
21636 pub(crate) fn new(
21637 stub: std::sync::Arc<
21638 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21639 >,
21640 ) -> Self {
21641 Self(RequestBuilder::new(stub))
21642 }
21643
21644 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
21646 mut self,
21647 v: V,
21648 ) -> Self {
21649 self.0.request = v.into();
21650 self
21651 }
21652
21653 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21655 self.0.options = v.into();
21656 self
21657 }
21658
21659 pub async fn send(self) -> Result<()> {
21661 (*self.0.stub)
21662 .delete_operation(self.0.request, self.0.options)
21663 .await
21664 .map(crate::Response::into_body)
21665 }
21666
21667 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21669 self.0.request.name = v.into();
21670 self
21671 }
21672 }
21673
21674 #[doc(hidden)]
21675 impl crate::RequestBuilder for DeleteOperation {
21676 fn request_options(&mut self) -> &mut crate::RequestOptions {
21677 &mut self.0.options
21678 }
21679 }
21680
21681 #[derive(Clone, Debug)]
21698 pub struct CancelOperation(
21699 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21700 );
21701
21702 impl CancelOperation {
21703 pub(crate) fn new(
21704 stub: std::sync::Arc<
21705 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21706 >,
21707 ) -> Self {
21708 Self(RequestBuilder::new(stub))
21709 }
21710
21711 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21713 mut self,
21714 v: V,
21715 ) -> Self {
21716 self.0.request = v.into();
21717 self
21718 }
21719
21720 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21722 self.0.options = v.into();
21723 self
21724 }
21725
21726 pub async fn send(self) -> Result<()> {
21728 (*self.0.stub)
21729 .cancel_operation(self.0.request, self.0.options)
21730 .await
21731 .map(crate::Response::into_body)
21732 }
21733
21734 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21736 self.0.request.name = v.into();
21737 self
21738 }
21739 }
21740
21741 #[doc(hidden)]
21742 impl crate::RequestBuilder for CancelOperation {
21743 fn request_options(&mut self) -> &mut crate::RequestOptions {
21744 &mut self.0.options
21745 }
21746 }
21747}