1pub mod address_group_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::AddressGroupService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = AddressGroupService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
96
97 impl ListAddressGroups {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
106 mut self,
107 v: V,
108 ) -> Self {
109 self.0.request = v.into();
110 self
111 }
112
113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
115 self.0.options = v.into();
116 self
117 }
118
119 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
121 (*self.0.stub)
122 .list_address_groups(self.0.request, self.0.options)
123 .await
124 .map(crate::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl google_cloud_gax::paginator::Paginator<
131 crate::model::ListAddressGroupsResponse,
132 crate::Error,
133 > {
134 use std::clone::Clone;
135 let token = self.0.request.page_token.clone();
136 let execute = move |token: String| {
137 let mut builder = self.clone();
138 builder.0.request = builder.0.request.set_page_token(token);
139 builder.send()
140 };
141 google_cloud_gax::paginator::internal::new_paginator(token, execute)
142 }
143
144 pub fn by_item(
146 self,
147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
148 crate::model::ListAddressGroupsResponse,
149 crate::Error,
150 > {
151 use google_cloud_gax::paginator::Paginator;
152 self.by_page().items()
153 }
154
155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159 self.0.request.parent = v.into();
160 self
161 }
162
163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165 self.0.request.page_size = v.into();
166 self
167 }
168
169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.page_token = v.into();
172 self
173 }
174
175 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
177 self.0.request.return_partial_success = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl crate::RequestBuilder for ListAddressGroups {
184 fn request_options(&mut self) -> &mut crate::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
206 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
207
208 impl GetAddressGroup {
209 pub(crate) fn new(
210 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
211 ) -> Self {
212 Self(RequestBuilder::new(stub))
213 }
214
215 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
217 self.0.request = v.into();
218 self
219 }
220
221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223 self.0.options = v.into();
224 self
225 }
226
227 pub async fn send(self) -> Result<crate::model::AddressGroup> {
229 (*self.0.stub)
230 .get_address_group(self.0.request, self.0.options)
231 .await
232 .map(crate::Response::into_body)
233 }
234
235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239 self.0.request.name = v.into();
240 self
241 }
242 }
243
244 #[doc(hidden)]
245 impl crate::RequestBuilder for GetAddressGroup {
246 fn request_options(&mut self) -> &mut crate::RequestOptions {
247 &mut self.0.options
248 }
249 }
250
251 #[derive(Clone, Debug)]
269 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
270
271 impl CreateAddressGroup {
272 pub(crate) fn new(
273 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
274 ) -> Self {
275 Self(RequestBuilder::new(stub))
276 }
277
278 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
280 mut self,
281 v: V,
282 ) -> Self {
283 self.0.request = v.into();
284 self
285 }
286
287 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
289 self.0.options = v.into();
290 self
291 }
292
293 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
300 (*self.0.stub)
301 .create_address_group(self.0.request, self.0.options)
302 .await
303 .map(crate::Response::into_body)
304 }
305
306 pub fn poller(
308 self,
309 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
310 {
311 type Operation = google_cloud_lro::internal::Operation<
312 crate::model::AddressGroup,
313 crate::model::OperationMetadata,
314 >;
315 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
316 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
317
318 let stub = self.0.stub.clone();
319 let mut options = self.0.options.clone();
320 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
321 let query = move |name| {
322 let stub = stub.clone();
323 let options = options.clone();
324 async {
325 let op = GetOperation::new(stub)
326 .set_name(name)
327 .with_options(options)
328 .send()
329 .await?;
330 Ok(Operation::new(op))
331 }
332 };
333
334 let start = move || async {
335 let op = self.send().await?;
336 Ok(Operation::new(op))
337 };
338
339 google_cloud_lro::internal::new_poller(
340 polling_error_policy,
341 polling_backoff_policy,
342 start,
343 query,
344 )
345 }
346
347 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
351 self.0.request.parent = v.into();
352 self
353 }
354
355 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
359 self.0.request.address_group_id = v.into();
360 self
361 }
362
363 pub fn set_address_group<T>(mut self, v: T) -> Self
367 where
368 T: std::convert::Into<crate::model::AddressGroup>,
369 {
370 self.0.request.address_group = std::option::Option::Some(v.into());
371 self
372 }
373
374 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
378 where
379 T: std::convert::Into<crate::model::AddressGroup>,
380 {
381 self.0.request.address_group = v.map(|x| x.into());
382 self
383 }
384
385 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
387 self.0.request.request_id = v.into();
388 self
389 }
390 }
391
392 #[doc(hidden)]
393 impl crate::RequestBuilder for CreateAddressGroup {
394 fn request_options(&mut self) -> &mut crate::RequestOptions {
395 &mut self.0.options
396 }
397 }
398
399 #[derive(Clone, Debug)]
417 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
418
419 impl UpdateAddressGroup {
420 pub(crate) fn new(
421 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
422 ) -> Self {
423 Self(RequestBuilder::new(stub))
424 }
425
426 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
428 mut self,
429 v: V,
430 ) -> Self {
431 self.0.request = v.into();
432 self
433 }
434
435 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
437 self.0.options = v.into();
438 self
439 }
440
441 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
448 (*self.0.stub)
449 .update_address_group(self.0.request, self.0.options)
450 .await
451 .map(crate::Response::into_body)
452 }
453
454 pub fn poller(
456 self,
457 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
458 {
459 type Operation = google_cloud_lro::internal::Operation<
460 crate::model::AddressGroup,
461 crate::model::OperationMetadata,
462 >;
463 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
464 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
465
466 let stub = self.0.stub.clone();
467 let mut options = self.0.options.clone();
468 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
469 let query = move |name| {
470 let stub = stub.clone();
471 let options = options.clone();
472 async {
473 let op = GetOperation::new(stub)
474 .set_name(name)
475 .with_options(options)
476 .send()
477 .await?;
478 Ok(Operation::new(op))
479 }
480 };
481
482 let start = move || async {
483 let op = self.send().await?;
484 Ok(Operation::new(op))
485 };
486
487 google_cloud_lro::internal::new_poller(
488 polling_error_policy,
489 polling_backoff_policy,
490 start,
491 query,
492 )
493 }
494
495 pub fn set_update_mask<T>(mut self, v: T) -> Self
497 where
498 T: std::convert::Into<wkt::FieldMask>,
499 {
500 self.0.request.update_mask = std::option::Option::Some(v.into());
501 self
502 }
503
504 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
506 where
507 T: std::convert::Into<wkt::FieldMask>,
508 {
509 self.0.request.update_mask = v.map(|x| x.into());
510 self
511 }
512
513 pub fn set_address_group<T>(mut self, v: T) -> Self
517 where
518 T: std::convert::Into<crate::model::AddressGroup>,
519 {
520 self.0.request.address_group = std::option::Option::Some(v.into());
521 self
522 }
523
524 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
528 where
529 T: std::convert::Into<crate::model::AddressGroup>,
530 {
531 self.0.request.address_group = v.map(|x| x.into());
532 self
533 }
534
535 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
537 self.0.request.request_id = v.into();
538 self
539 }
540 }
541
542 #[doc(hidden)]
543 impl crate::RequestBuilder for UpdateAddressGroup {
544 fn request_options(&mut self) -> &mut crate::RequestOptions {
545 &mut self.0.options
546 }
547 }
548
549 #[derive(Clone, Debug)]
567 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
568
569 impl AddAddressGroupItems {
570 pub(crate) fn new(
571 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
572 ) -> Self {
573 Self(RequestBuilder::new(stub))
574 }
575
576 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
578 mut self,
579 v: V,
580 ) -> Self {
581 self.0.request = v.into();
582 self
583 }
584
585 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
587 self.0.options = v.into();
588 self
589 }
590
591 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
598 (*self.0.stub)
599 .add_address_group_items(self.0.request, self.0.options)
600 .await
601 .map(crate::Response::into_body)
602 }
603
604 pub fn poller(
606 self,
607 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
608 {
609 type Operation = google_cloud_lro::internal::Operation<
610 crate::model::AddressGroup,
611 crate::model::OperationMetadata,
612 >;
613 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
614 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
615
616 let stub = self.0.stub.clone();
617 let mut options = self.0.options.clone();
618 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
619 let query = move |name| {
620 let stub = stub.clone();
621 let options = options.clone();
622 async {
623 let op = GetOperation::new(stub)
624 .set_name(name)
625 .with_options(options)
626 .send()
627 .await?;
628 Ok(Operation::new(op))
629 }
630 };
631
632 let start = move || async {
633 let op = self.send().await?;
634 Ok(Operation::new(op))
635 };
636
637 google_cloud_lro::internal::new_poller(
638 polling_error_policy,
639 polling_backoff_policy,
640 start,
641 query,
642 )
643 }
644
645 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
649 self.0.request.address_group = v.into();
650 self
651 }
652
653 pub fn set_items<T, V>(mut self, v: T) -> Self
657 where
658 T: std::iter::IntoIterator<Item = V>,
659 V: std::convert::Into<std::string::String>,
660 {
661 use std::iter::Iterator;
662 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
663 self
664 }
665
666 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
668 self.0.request.request_id = v.into();
669 self
670 }
671 }
672
673 #[doc(hidden)]
674 impl crate::RequestBuilder for AddAddressGroupItems {
675 fn request_options(&mut self) -> &mut crate::RequestOptions {
676 &mut self.0.options
677 }
678 }
679
680 #[derive(Clone, Debug)]
698 pub struct RemoveAddressGroupItems(
699 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
700 );
701
702 impl RemoveAddressGroupItems {
703 pub(crate) fn new(
704 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
705 ) -> Self {
706 Self(RequestBuilder::new(stub))
707 }
708
709 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
711 mut self,
712 v: V,
713 ) -> Self {
714 self.0.request = v.into();
715 self
716 }
717
718 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
720 self.0.options = v.into();
721 self
722 }
723
724 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
731 (*self.0.stub)
732 .remove_address_group_items(self.0.request, self.0.options)
733 .await
734 .map(crate::Response::into_body)
735 }
736
737 pub fn poller(
739 self,
740 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
741 {
742 type Operation = google_cloud_lro::internal::Operation<
743 crate::model::AddressGroup,
744 crate::model::OperationMetadata,
745 >;
746 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
747 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
748
749 let stub = self.0.stub.clone();
750 let mut options = self.0.options.clone();
751 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
752 let query = move |name| {
753 let stub = stub.clone();
754 let options = options.clone();
755 async {
756 let op = GetOperation::new(stub)
757 .set_name(name)
758 .with_options(options)
759 .send()
760 .await?;
761 Ok(Operation::new(op))
762 }
763 };
764
765 let start = move || async {
766 let op = self.send().await?;
767 Ok(Operation::new(op))
768 };
769
770 google_cloud_lro::internal::new_poller(
771 polling_error_policy,
772 polling_backoff_policy,
773 start,
774 query,
775 )
776 }
777
778 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
782 self.0.request.address_group = v.into();
783 self
784 }
785
786 pub fn set_items<T, V>(mut self, v: T) -> Self
790 where
791 T: std::iter::IntoIterator<Item = V>,
792 V: std::convert::Into<std::string::String>,
793 {
794 use std::iter::Iterator;
795 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
796 self
797 }
798
799 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
801 self.0.request.request_id = v.into();
802 self
803 }
804 }
805
806 #[doc(hidden)]
807 impl crate::RequestBuilder for RemoveAddressGroupItems {
808 fn request_options(&mut self) -> &mut crate::RequestOptions {
809 &mut self.0.options
810 }
811 }
812
813 #[derive(Clone, Debug)]
831 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
832
833 impl CloneAddressGroupItems {
834 pub(crate) fn new(
835 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
836 ) -> Self {
837 Self(RequestBuilder::new(stub))
838 }
839
840 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
842 mut self,
843 v: V,
844 ) -> Self {
845 self.0.request = v.into();
846 self
847 }
848
849 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
851 self.0.options = v.into();
852 self
853 }
854
855 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
862 (*self.0.stub)
863 .clone_address_group_items(self.0.request, self.0.options)
864 .await
865 .map(crate::Response::into_body)
866 }
867
868 pub fn poller(
870 self,
871 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
872 {
873 type Operation = google_cloud_lro::internal::Operation<
874 crate::model::AddressGroup,
875 crate::model::OperationMetadata,
876 >;
877 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
878 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
879
880 let stub = self.0.stub.clone();
881 let mut options = self.0.options.clone();
882 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
883 let query = move |name| {
884 let stub = stub.clone();
885 let options = options.clone();
886 async {
887 let op = GetOperation::new(stub)
888 .set_name(name)
889 .with_options(options)
890 .send()
891 .await?;
892 Ok(Operation::new(op))
893 }
894 };
895
896 let start = move || async {
897 let op = self.send().await?;
898 Ok(Operation::new(op))
899 };
900
901 google_cloud_lro::internal::new_poller(
902 polling_error_policy,
903 polling_backoff_policy,
904 start,
905 query,
906 )
907 }
908
909 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
913 self.0.request.address_group = v.into();
914 self
915 }
916
917 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
921 self.0.request.source_address_group = v.into();
922 self
923 }
924
925 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
927 self.0.request.request_id = v.into();
928 self
929 }
930 }
931
932 #[doc(hidden)]
933 impl crate::RequestBuilder for CloneAddressGroupItems {
934 fn request_options(&mut self) -> &mut crate::RequestOptions {
935 &mut self.0.options
936 }
937 }
938
939 #[derive(Clone, Debug)]
957 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
958
959 impl DeleteAddressGroup {
960 pub(crate) fn new(
961 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
962 ) -> Self {
963 Self(RequestBuilder::new(stub))
964 }
965
966 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
968 mut self,
969 v: V,
970 ) -> Self {
971 self.0.request = v.into();
972 self
973 }
974
975 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
977 self.0.options = v.into();
978 self
979 }
980
981 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
988 (*self.0.stub)
989 .delete_address_group(self.0.request, self.0.options)
990 .await
991 .map(crate::Response::into_body)
992 }
993
994 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
996 type Operation =
997 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
998 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
999 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1000
1001 let stub = self.0.stub.clone();
1002 let mut options = self.0.options.clone();
1003 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1004 let query = move |name| {
1005 let stub = stub.clone();
1006 let options = options.clone();
1007 async {
1008 let op = GetOperation::new(stub)
1009 .set_name(name)
1010 .with_options(options)
1011 .send()
1012 .await?;
1013 Ok(Operation::new(op))
1014 }
1015 };
1016
1017 let start = move || async {
1018 let op = self.send().await?;
1019 Ok(Operation::new(op))
1020 };
1021
1022 google_cloud_lro::internal::new_unit_response_poller(
1023 polling_error_policy,
1024 polling_backoff_policy,
1025 start,
1026 query,
1027 )
1028 }
1029
1030 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1034 self.0.request.name = v.into();
1035 self
1036 }
1037
1038 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1040 self.0.request.request_id = v.into();
1041 self
1042 }
1043 }
1044
1045 #[doc(hidden)]
1046 impl crate::RequestBuilder for DeleteAddressGroup {
1047 fn request_options(&mut self) -> &mut crate::RequestOptions {
1048 &mut self.0.options
1049 }
1050 }
1051
1052 #[derive(Clone, Debug)]
1073 pub struct ListAddressGroupReferences(
1074 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1075 );
1076
1077 impl ListAddressGroupReferences {
1078 pub(crate) fn new(
1079 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1080 ) -> Self {
1081 Self(RequestBuilder::new(stub))
1082 }
1083
1084 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1086 mut self,
1087 v: V,
1088 ) -> Self {
1089 self.0.request = v.into();
1090 self
1091 }
1092
1093 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1095 self.0.options = v.into();
1096 self
1097 }
1098
1099 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1101 (*self.0.stub)
1102 .list_address_group_references(self.0.request, self.0.options)
1103 .await
1104 .map(crate::Response::into_body)
1105 }
1106
1107 pub fn by_page(
1109 self,
1110 ) -> impl google_cloud_gax::paginator::Paginator<
1111 crate::model::ListAddressGroupReferencesResponse,
1112 crate::Error,
1113 > {
1114 use std::clone::Clone;
1115 let token = self.0.request.page_token.clone();
1116 let execute = move |token: String| {
1117 let mut builder = self.clone();
1118 builder.0.request = builder.0.request.set_page_token(token);
1119 builder.send()
1120 };
1121 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1122 }
1123
1124 pub fn by_item(
1126 self,
1127 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1128 crate::model::ListAddressGroupReferencesResponse,
1129 crate::Error,
1130 > {
1131 use google_cloud_gax::paginator::Paginator;
1132 self.by_page().items()
1133 }
1134
1135 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139 self.0.request.address_group = v.into();
1140 self
1141 }
1142
1143 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1145 self.0.request.page_size = v.into();
1146 self
1147 }
1148
1149 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151 self.0.request.page_token = v.into();
1152 self
1153 }
1154 }
1155
1156 #[doc(hidden)]
1157 impl crate::RequestBuilder for ListAddressGroupReferences {
1158 fn request_options(&mut self) -> &mut crate::RequestOptions {
1159 &mut self.0.options
1160 }
1161 }
1162
1163 #[derive(Clone, Debug)]
1184 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1185
1186 impl ListLocations {
1187 pub(crate) fn new(
1188 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1189 ) -> Self {
1190 Self(RequestBuilder::new(stub))
1191 }
1192
1193 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1195 mut self,
1196 v: V,
1197 ) -> Self {
1198 self.0.request = v.into();
1199 self
1200 }
1201
1202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1204 self.0.options = v.into();
1205 self
1206 }
1207
1208 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1210 (*self.0.stub)
1211 .list_locations(self.0.request, self.0.options)
1212 .await
1213 .map(crate::Response::into_body)
1214 }
1215
1216 pub fn by_page(
1218 self,
1219 ) -> impl google_cloud_gax::paginator::Paginator<
1220 google_cloud_location::model::ListLocationsResponse,
1221 crate::Error,
1222 > {
1223 use std::clone::Clone;
1224 let token = self.0.request.page_token.clone();
1225 let execute = move |token: String| {
1226 let mut builder = self.clone();
1227 builder.0.request = builder.0.request.set_page_token(token);
1228 builder.send()
1229 };
1230 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1231 }
1232
1233 pub fn by_item(
1235 self,
1236 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1237 google_cloud_location::model::ListLocationsResponse,
1238 crate::Error,
1239 > {
1240 use google_cloud_gax::paginator::Paginator;
1241 self.by_page().items()
1242 }
1243
1244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1246 self.0.request.name = v.into();
1247 self
1248 }
1249
1250 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1252 self.0.request.filter = v.into();
1253 self
1254 }
1255
1256 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1258 self.0.request.page_size = v.into();
1259 self
1260 }
1261
1262 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1264 self.0.request.page_token = v.into();
1265 self
1266 }
1267 }
1268
1269 #[doc(hidden)]
1270 impl crate::RequestBuilder for ListLocations {
1271 fn request_options(&mut self) -> &mut crate::RequestOptions {
1272 &mut self.0.options
1273 }
1274 }
1275
1276 #[derive(Clone, Debug)]
1293 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1294
1295 impl GetLocation {
1296 pub(crate) fn new(
1297 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1298 ) -> Self {
1299 Self(RequestBuilder::new(stub))
1300 }
1301
1302 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1304 mut self,
1305 v: V,
1306 ) -> Self {
1307 self.0.request = v.into();
1308 self
1309 }
1310
1311 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1313 self.0.options = v.into();
1314 self
1315 }
1316
1317 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1319 (*self.0.stub)
1320 .get_location(self.0.request, self.0.options)
1321 .await
1322 .map(crate::Response::into_body)
1323 }
1324
1325 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327 self.0.request.name = v.into();
1328 self
1329 }
1330 }
1331
1332 #[doc(hidden)]
1333 impl crate::RequestBuilder for GetLocation {
1334 fn request_options(&mut self) -> &mut crate::RequestOptions {
1335 &mut self.0.options
1336 }
1337 }
1338
1339 #[derive(Clone, Debug)]
1356 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1357
1358 impl SetIamPolicy {
1359 pub(crate) fn new(
1360 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1361 ) -> Self {
1362 Self(RequestBuilder::new(stub))
1363 }
1364
1365 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1367 mut self,
1368 v: V,
1369 ) -> Self {
1370 self.0.request = v.into();
1371 self
1372 }
1373
1374 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1376 self.0.options = v.into();
1377 self
1378 }
1379
1380 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1382 (*self.0.stub)
1383 .set_iam_policy(self.0.request, self.0.options)
1384 .await
1385 .map(crate::Response::into_body)
1386 }
1387
1388 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1392 self.0.request.resource = v.into();
1393 self
1394 }
1395
1396 pub fn set_policy<T>(mut self, v: T) -> Self
1400 where
1401 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1402 {
1403 self.0.request.policy = std::option::Option::Some(v.into());
1404 self
1405 }
1406
1407 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1411 where
1412 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1413 {
1414 self.0.request.policy = v.map(|x| x.into());
1415 self
1416 }
1417
1418 pub fn set_update_mask<T>(mut self, v: T) -> Self
1420 where
1421 T: std::convert::Into<wkt::FieldMask>,
1422 {
1423 self.0.request.update_mask = std::option::Option::Some(v.into());
1424 self
1425 }
1426
1427 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1429 where
1430 T: std::convert::Into<wkt::FieldMask>,
1431 {
1432 self.0.request.update_mask = v.map(|x| x.into());
1433 self
1434 }
1435 }
1436
1437 #[doc(hidden)]
1438 impl crate::RequestBuilder for SetIamPolicy {
1439 fn request_options(&mut self) -> &mut crate::RequestOptions {
1440 &mut self.0.options
1441 }
1442 }
1443
1444 #[derive(Clone, Debug)]
1461 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1462
1463 impl GetIamPolicy {
1464 pub(crate) fn new(
1465 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1466 ) -> Self {
1467 Self(RequestBuilder::new(stub))
1468 }
1469
1470 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1472 mut self,
1473 v: V,
1474 ) -> Self {
1475 self.0.request = v.into();
1476 self
1477 }
1478
1479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1481 self.0.options = v.into();
1482 self
1483 }
1484
1485 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1487 (*self.0.stub)
1488 .get_iam_policy(self.0.request, self.0.options)
1489 .await
1490 .map(crate::Response::into_body)
1491 }
1492
1493 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1497 self.0.request.resource = v.into();
1498 self
1499 }
1500
1501 pub fn set_options<T>(mut self, v: T) -> Self
1503 where
1504 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1505 {
1506 self.0.request.options = std::option::Option::Some(v.into());
1507 self
1508 }
1509
1510 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1512 where
1513 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1514 {
1515 self.0.request.options = v.map(|x| x.into());
1516 self
1517 }
1518 }
1519
1520 #[doc(hidden)]
1521 impl crate::RequestBuilder for GetIamPolicy {
1522 fn request_options(&mut self) -> &mut crate::RequestOptions {
1523 &mut self.0.options
1524 }
1525 }
1526
1527 #[derive(Clone, Debug)]
1544 pub struct TestIamPermissions(
1545 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1546 );
1547
1548 impl TestIamPermissions {
1549 pub(crate) fn new(
1550 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1551 ) -> Self {
1552 Self(RequestBuilder::new(stub))
1553 }
1554
1555 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1557 mut self,
1558 v: V,
1559 ) -> Self {
1560 self.0.request = v.into();
1561 self
1562 }
1563
1564 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1566 self.0.options = v.into();
1567 self
1568 }
1569
1570 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1572 (*self.0.stub)
1573 .test_iam_permissions(self.0.request, self.0.options)
1574 .await
1575 .map(crate::Response::into_body)
1576 }
1577
1578 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1582 self.0.request.resource = v.into();
1583 self
1584 }
1585
1586 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1590 where
1591 T: std::iter::IntoIterator<Item = V>,
1592 V: std::convert::Into<std::string::String>,
1593 {
1594 use std::iter::Iterator;
1595 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1596 self
1597 }
1598 }
1599
1600 #[doc(hidden)]
1601 impl crate::RequestBuilder for TestIamPermissions {
1602 fn request_options(&mut self) -> &mut crate::RequestOptions {
1603 &mut self.0.options
1604 }
1605 }
1606
1607 #[derive(Clone, Debug)]
1628 pub struct ListOperations(
1629 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1630 );
1631
1632 impl ListOperations {
1633 pub(crate) fn new(
1634 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1635 ) -> Self {
1636 Self(RequestBuilder::new(stub))
1637 }
1638
1639 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1641 mut self,
1642 v: V,
1643 ) -> Self {
1644 self.0.request = v.into();
1645 self
1646 }
1647
1648 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1650 self.0.options = v.into();
1651 self
1652 }
1653
1654 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1656 (*self.0.stub)
1657 .list_operations(self.0.request, self.0.options)
1658 .await
1659 .map(crate::Response::into_body)
1660 }
1661
1662 pub fn by_page(
1664 self,
1665 ) -> impl google_cloud_gax::paginator::Paginator<
1666 google_cloud_longrunning::model::ListOperationsResponse,
1667 crate::Error,
1668 > {
1669 use std::clone::Clone;
1670 let token = self.0.request.page_token.clone();
1671 let execute = move |token: String| {
1672 let mut builder = self.clone();
1673 builder.0.request = builder.0.request.set_page_token(token);
1674 builder.send()
1675 };
1676 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1677 }
1678
1679 pub fn by_item(
1681 self,
1682 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1683 google_cloud_longrunning::model::ListOperationsResponse,
1684 crate::Error,
1685 > {
1686 use google_cloud_gax::paginator::Paginator;
1687 self.by_page().items()
1688 }
1689
1690 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1692 self.0.request.name = v.into();
1693 self
1694 }
1695
1696 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698 self.0.request.filter = v.into();
1699 self
1700 }
1701
1702 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1704 self.0.request.page_size = v.into();
1705 self
1706 }
1707
1708 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1710 self.0.request.page_token = v.into();
1711 self
1712 }
1713
1714 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1716 self.0.request.return_partial_success = v.into();
1717 self
1718 }
1719 }
1720
1721 #[doc(hidden)]
1722 impl crate::RequestBuilder for ListOperations {
1723 fn request_options(&mut self) -> &mut crate::RequestOptions {
1724 &mut self.0.options
1725 }
1726 }
1727
1728 #[derive(Clone, Debug)]
1745 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1746
1747 impl GetOperation {
1748 pub(crate) fn new(
1749 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1750 ) -> Self {
1751 Self(RequestBuilder::new(stub))
1752 }
1753
1754 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1756 mut self,
1757 v: V,
1758 ) -> Self {
1759 self.0.request = v.into();
1760 self
1761 }
1762
1763 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1765 self.0.options = v.into();
1766 self
1767 }
1768
1769 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1771 (*self.0.stub)
1772 .get_operation(self.0.request, self.0.options)
1773 .await
1774 .map(crate::Response::into_body)
1775 }
1776
1777 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1779 self.0.request.name = v.into();
1780 self
1781 }
1782 }
1783
1784 #[doc(hidden)]
1785 impl crate::RequestBuilder for GetOperation {
1786 fn request_options(&mut self) -> &mut crate::RequestOptions {
1787 &mut self.0.options
1788 }
1789 }
1790
1791 #[derive(Clone, Debug)]
1808 pub struct DeleteOperation(
1809 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1810 );
1811
1812 impl DeleteOperation {
1813 pub(crate) fn new(
1814 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1815 ) -> Self {
1816 Self(RequestBuilder::new(stub))
1817 }
1818
1819 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1821 mut self,
1822 v: V,
1823 ) -> Self {
1824 self.0.request = v.into();
1825 self
1826 }
1827
1828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1830 self.0.options = v.into();
1831 self
1832 }
1833
1834 pub async fn send(self) -> Result<()> {
1836 (*self.0.stub)
1837 .delete_operation(self.0.request, self.0.options)
1838 .await
1839 .map(crate::Response::into_body)
1840 }
1841
1842 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1844 self.0.request.name = v.into();
1845 self
1846 }
1847 }
1848
1849 #[doc(hidden)]
1850 impl crate::RequestBuilder for DeleteOperation {
1851 fn request_options(&mut self) -> &mut crate::RequestOptions {
1852 &mut self.0.options
1853 }
1854 }
1855
1856 #[derive(Clone, Debug)]
1873 pub struct CancelOperation(
1874 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1875 );
1876
1877 impl CancelOperation {
1878 pub(crate) fn new(
1879 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1880 ) -> Self {
1881 Self(RequestBuilder::new(stub))
1882 }
1883
1884 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1886 mut self,
1887 v: V,
1888 ) -> Self {
1889 self.0.request = v.into();
1890 self
1891 }
1892
1893 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1895 self.0.options = v.into();
1896 self
1897 }
1898
1899 pub async fn send(self) -> Result<()> {
1901 (*self.0.stub)
1902 .cancel_operation(self.0.request, self.0.options)
1903 .await
1904 .map(crate::Response::into_body)
1905 }
1906
1907 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1909 self.0.request.name = v.into();
1910 self
1911 }
1912 }
1913
1914 #[doc(hidden)]
1915 impl crate::RequestBuilder for CancelOperation {
1916 fn request_options(&mut self) -> &mut crate::RequestOptions {
1917 &mut self.0.options
1918 }
1919 }
1920}
1921
1922pub mod organization_address_group_service {
1924 use crate::Result;
1925
1926 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1940
1941 pub(crate) mod client {
1942 use super::super::super::client::OrganizationAddressGroupService;
1943 pub struct Factory;
1944 impl crate::ClientFactory for Factory {
1945 type Client = OrganizationAddressGroupService;
1946 type Credentials = gaxi::options::Credentials;
1947 async fn build(
1948 self,
1949 config: gaxi::options::ClientConfig,
1950 ) -> crate::ClientBuilderResult<Self::Client> {
1951 Self::Client::new(config).await
1952 }
1953 }
1954 }
1955
1956 #[derive(Clone, Debug)]
1958 pub(crate) struct RequestBuilder<R: std::default::Default> {
1959 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1960 request: R,
1961 options: crate::RequestOptions,
1962 }
1963
1964 impl<R> RequestBuilder<R>
1965 where
1966 R: std::default::Default,
1967 {
1968 pub(crate) fn new(
1969 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1970 ) -> Self {
1971 Self {
1972 stub,
1973 request: R::default(),
1974 options: crate::RequestOptions::default(),
1975 }
1976 }
1977 }
1978
1979 #[derive(Clone, Debug)]
2000 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
2001
2002 impl ListAddressGroups {
2003 pub(crate) fn new(
2004 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2005 ) -> Self {
2006 Self(RequestBuilder::new(stub))
2007 }
2008
2009 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
2011 mut self,
2012 v: V,
2013 ) -> Self {
2014 self.0.request = v.into();
2015 self
2016 }
2017
2018 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2020 self.0.options = v.into();
2021 self
2022 }
2023
2024 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
2026 (*self.0.stub)
2027 .list_address_groups(self.0.request, self.0.options)
2028 .await
2029 .map(crate::Response::into_body)
2030 }
2031
2032 pub fn by_page(
2034 self,
2035 ) -> impl google_cloud_gax::paginator::Paginator<
2036 crate::model::ListAddressGroupsResponse,
2037 crate::Error,
2038 > {
2039 use std::clone::Clone;
2040 let token = self.0.request.page_token.clone();
2041 let execute = move |token: String| {
2042 let mut builder = self.clone();
2043 builder.0.request = builder.0.request.set_page_token(token);
2044 builder.send()
2045 };
2046 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2047 }
2048
2049 pub fn by_item(
2051 self,
2052 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2053 crate::model::ListAddressGroupsResponse,
2054 crate::Error,
2055 > {
2056 use google_cloud_gax::paginator::Paginator;
2057 self.by_page().items()
2058 }
2059
2060 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2064 self.0.request.parent = v.into();
2065 self
2066 }
2067
2068 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2070 self.0.request.page_size = v.into();
2071 self
2072 }
2073
2074 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2076 self.0.request.page_token = v.into();
2077 self
2078 }
2079
2080 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2082 self.0.request.return_partial_success = v.into();
2083 self
2084 }
2085 }
2086
2087 #[doc(hidden)]
2088 impl crate::RequestBuilder for ListAddressGroups {
2089 fn request_options(&mut self) -> &mut crate::RequestOptions {
2090 &mut self.0.options
2091 }
2092 }
2093
2094 #[derive(Clone, Debug)]
2111 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2112
2113 impl GetAddressGroup {
2114 pub(crate) fn new(
2115 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2116 ) -> Self {
2117 Self(RequestBuilder::new(stub))
2118 }
2119
2120 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2122 self.0.request = v.into();
2123 self
2124 }
2125
2126 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2128 self.0.options = v.into();
2129 self
2130 }
2131
2132 pub async fn send(self) -> Result<crate::model::AddressGroup> {
2134 (*self.0.stub)
2135 .get_address_group(self.0.request, self.0.options)
2136 .await
2137 .map(crate::Response::into_body)
2138 }
2139
2140 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2144 self.0.request.name = v.into();
2145 self
2146 }
2147 }
2148
2149 #[doc(hidden)]
2150 impl crate::RequestBuilder for GetAddressGroup {
2151 fn request_options(&mut self) -> &mut crate::RequestOptions {
2152 &mut self.0.options
2153 }
2154 }
2155
2156 #[derive(Clone, Debug)]
2174 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2175
2176 impl CreateAddressGroup {
2177 pub(crate) fn new(
2178 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2179 ) -> Self {
2180 Self(RequestBuilder::new(stub))
2181 }
2182
2183 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2185 mut self,
2186 v: V,
2187 ) -> Self {
2188 self.0.request = v.into();
2189 self
2190 }
2191
2192 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2194 self.0.options = v.into();
2195 self
2196 }
2197
2198 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2205 (*self.0.stub)
2206 .create_address_group(self.0.request, self.0.options)
2207 .await
2208 .map(crate::Response::into_body)
2209 }
2210
2211 pub fn poller(
2213 self,
2214 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2215 {
2216 type Operation = google_cloud_lro::internal::Operation<
2217 crate::model::AddressGroup,
2218 crate::model::OperationMetadata,
2219 >;
2220 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2221 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2222
2223 let stub = self.0.stub.clone();
2224 let mut options = self.0.options.clone();
2225 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2226 let query = move |name| {
2227 let stub = stub.clone();
2228 let options = options.clone();
2229 async {
2230 let op = GetOperation::new(stub)
2231 .set_name(name)
2232 .with_options(options)
2233 .send()
2234 .await?;
2235 Ok(Operation::new(op))
2236 }
2237 };
2238
2239 let start = move || async {
2240 let op = self.send().await?;
2241 Ok(Operation::new(op))
2242 };
2243
2244 google_cloud_lro::internal::new_poller(
2245 polling_error_policy,
2246 polling_backoff_policy,
2247 start,
2248 query,
2249 )
2250 }
2251
2252 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2256 self.0.request.parent = v.into();
2257 self
2258 }
2259
2260 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.0.request.address_group_id = v.into();
2265 self
2266 }
2267
2268 pub fn set_address_group<T>(mut self, v: T) -> Self
2272 where
2273 T: std::convert::Into<crate::model::AddressGroup>,
2274 {
2275 self.0.request.address_group = std::option::Option::Some(v.into());
2276 self
2277 }
2278
2279 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2283 where
2284 T: std::convert::Into<crate::model::AddressGroup>,
2285 {
2286 self.0.request.address_group = v.map(|x| x.into());
2287 self
2288 }
2289
2290 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2292 self.0.request.request_id = v.into();
2293 self
2294 }
2295 }
2296
2297 #[doc(hidden)]
2298 impl crate::RequestBuilder for CreateAddressGroup {
2299 fn request_options(&mut self) -> &mut crate::RequestOptions {
2300 &mut self.0.options
2301 }
2302 }
2303
2304 #[derive(Clone, Debug)]
2322 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2323
2324 impl UpdateAddressGroup {
2325 pub(crate) fn new(
2326 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2327 ) -> Self {
2328 Self(RequestBuilder::new(stub))
2329 }
2330
2331 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2333 mut self,
2334 v: V,
2335 ) -> Self {
2336 self.0.request = v.into();
2337 self
2338 }
2339
2340 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2342 self.0.options = v.into();
2343 self
2344 }
2345
2346 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2353 (*self.0.stub)
2354 .update_address_group(self.0.request, self.0.options)
2355 .await
2356 .map(crate::Response::into_body)
2357 }
2358
2359 pub fn poller(
2361 self,
2362 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2363 {
2364 type Operation = google_cloud_lro::internal::Operation<
2365 crate::model::AddressGroup,
2366 crate::model::OperationMetadata,
2367 >;
2368 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2369 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2370
2371 let stub = self.0.stub.clone();
2372 let mut options = self.0.options.clone();
2373 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2374 let query = move |name| {
2375 let stub = stub.clone();
2376 let options = options.clone();
2377 async {
2378 let op = GetOperation::new(stub)
2379 .set_name(name)
2380 .with_options(options)
2381 .send()
2382 .await?;
2383 Ok(Operation::new(op))
2384 }
2385 };
2386
2387 let start = move || async {
2388 let op = self.send().await?;
2389 Ok(Operation::new(op))
2390 };
2391
2392 google_cloud_lro::internal::new_poller(
2393 polling_error_policy,
2394 polling_backoff_policy,
2395 start,
2396 query,
2397 )
2398 }
2399
2400 pub fn set_update_mask<T>(mut self, v: T) -> Self
2402 where
2403 T: std::convert::Into<wkt::FieldMask>,
2404 {
2405 self.0.request.update_mask = std::option::Option::Some(v.into());
2406 self
2407 }
2408
2409 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2411 where
2412 T: std::convert::Into<wkt::FieldMask>,
2413 {
2414 self.0.request.update_mask = v.map(|x| x.into());
2415 self
2416 }
2417
2418 pub fn set_address_group<T>(mut self, v: T) -> Self
2422 where
2423 T: std::convert::Into<crate::model::AddressGroup>,
2424 {
2425 self.0.request.address_group = std::option::Option::Some(v.into());
2426 self
2427 }
2428
2429 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2433 where
2434 T: std::convert::Into<crate::model::AddressGroup>,
2435 {
2436 self.0.request.address_group = v.map(|x| x.into());
2437 self
2438 }
2439
2440 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2442 self.0.request.request_id = v.into();
2443 self
2444 }
2445 }
2446
2447 #[doc(hidden)]
2448 impl crate::RequestBuilder for UpdateAddressGroup {
2449 fn request_options(&mut self) -> &mut crate::RequestOptions {
2450 &mut self.0.options
2451 }
2452 }
2453
2454 #[derive(Clone, Debug)]
2472 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2473
2474 impl AddAddressGroupItems {
2475 pub(crate) fn new(
2476 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2477 ) -> Self {
2478 Self(RequestBuilder::new(stub))
2479 }
2480
2481 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2483 mut self,
2484 v: V,
2485 ) -> Self {
2486 self.0.request = v.into();
2487 self
2488 }
2489
2490 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2492 self.0.options = v.into();
2493 self
2494 }
2495
2496 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2503 (*self.0.stub)
2504 .add_address_group_items(self.0.request, self.0.options)
2505 .await
2506 .map(crate::Response::into_body)
2507 }
2508
2509 pub fn poller(
2511 self,
2512 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2513 {
2514 type Operation = google_cloud_lro::internal::Operation<
2515 crate::model::AddressGroup,
2516 crate::model::OperationMetadata,
2517 >;
2518 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2519 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2520
2521 let stub = self.0.stub.clone();
2522 let mut options = self.0.options.clone();
2523 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2524 let query = move |name| {
2525 let stub = stub.clone();
2526 let options = options.clone();
2527 async {
2528 let op = GetOperation::new(stub)
2529 .set_name(name)
2530 .with_options(options)
2531 .send()
2532 .await?;
2533 Ok(Operation::new(op))
2534 }
2535 };
2536
2537 let start = move || async {
2538 let op = self.send().await?;
2539 Ok(Operation::new(op))
2540 };
2541
2542 google_cloud_lro::internal::new_poller(
2543 polling_error_policy,
2544 polling_backoff_policy,
2545 start,
2546 query,
2547 )
2548 }
2549
2550 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2554 self.0.request.address_group = v.into();
2555 self
2556 }
2557
2558 pub fn set_items<T, V>(mut self, v: T) -> Self
2562 where
2563 T: std::iter::IntoIterator<Item = V>,
2564 V: std::convert::Into<std::string::String>,
2565 {
2566 use std::iter::Iterator;
2567 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2568 self
2569 }
2570
2571 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573 self.0.request.request_id = v.into();
2574 self
2575 }
2576 }
2577
2578 #[doc(hidden)]
2579 impl crate::RequestBuilder for AddAddressGroupItems {
2580 fn request_options(&mut self) -> &mut crate::RequestOptions {
2581 &mut self.0.options
2582 }
2583 }
2584
2585 #[derive(Clone, Debug)]
2603 pub struct RemoveAddressGroupItems(
2604 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2605 );
2606
2607 impl RemoveAddressGroupItems {
2608 pub(crate) fn new(
2609 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2610 ) -> Self {
2611 Self(RequestBuilder::new(stub))
2612 }
2613
2614 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2616 mut self,
2617 v: V,
2618 ) -> Self {
2619 self.0.request = v.into();
2620 self
2621 }
2622
2623 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2625 self.0.options = v.into();
2626 self
2627 }
2628
2629 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2636 (*self.0.stub)
2637 .remove_address_group_items(self.0.request, self.0.options)
2638 .await
2639 .map(crate::Response::into_body)
2640 }
2641
2642 pub fn poller(
2644 self,
2645 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2646 {
2647 type Operation = google_cloud_lro::internal::Operation<
2648 crate::model::AddressGroup,
2649 crate::model::OperationMetadata,
2650 >;
2651 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2652 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2653
2654 let stub = self.0.stub.clone();
2655 let mut options = self.0.options.clone();
2656 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2657 let query = move |name| {
2658 let stub = stub.clone();
2659 let options = options.clone();
2660 async {
2661 let op = GetOperation::new(stub)
2662 .set_name(name)
2663 .with_options(options)
2664 .send()
2665 .await?;
2666 Ok(Operation::new(op))
2667 }
2668 };
2669
2670 let start = move || async {
2671 let op = self.send().await?;
2672 Ok(Operation::new(op))
2673 };
2674
2675 google_cloud_lro::internal::new_poller(
2676 polling_error_policy,
2677 polling_backoff_policy,
2678 start,
2679 query,
2680 )
2681 }
2682
2683 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2687 self.0.request.address_group = v.into();
2688 self
2689 }
2690
2691 pub fn set_items<T, V>(mut self, v: T) -> Self
2695 where
2696 T: std::iter::IntoIterator<Item = V>,
2697 V: std::convert::Into<std::string::String>,
2698 {
2699 use std::iter::Iterator;
2700 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2701 self
2702 }
2703
2704 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2706 self.0.request.request_id = v.into();
2707 self
2708 }
2709 }
2710
2711 #[doc(hidden)]
2712 impl crate::RequestBuilder for RemoveAddressGroupItems {
2713 fn request_options(&mut self) -> &mut crate::RequestOptions {
2714 &mut self.0.options
2715 }
2716 }
2717
2718 #[derive(Clone, Debug)]
2736 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2737
2738 impl CloneAddressGroupItems {
2739 pub(crate) fn new(
2740 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2741 ) -> Self {
2742 Self(RequestBuilder::new(stub))
2743 }
2744
2745 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2747 mut self,
2748 v: V,
2749 ) -> Self {
2750 self.0.request = v.into();
2751 self
2752 }
2753
2754 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2756 self.0.options = v.into();
2757 self
2758 }
2759
2760 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2767 (*self.0.stub)
2768 .clone_address_group_items(self.0.request, self.0.options)
2769 .await
2770 .map(crate::Response::into_body)
2771 }
2772
2773 pub fn poller(
2775 self,
2776 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2777 {
2778 type Operation = google_cloud_lro::internal::Operation<
2779 crate::model::AddressGroup,
2780 crate::model::OperationMetadata,
2781 >;
2782 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2783 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2784
2785 let stub = self.0.stub.clone();
2786 let mut options = self.0.options.clone();
2787 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2788 let query = move |name| {
2789 let stub = stub.clone();
2790 let options = options.clone();
2791 async {
2792 let op = GetOperation::new(stub)
2793 .set_name(name)
2794 .with_options(options)
2795 .send()
2796 .await?;
2797 Ok(Operation::new(op))
2798 }
2799 };
2800
2801 let start = move || async {
2802 let op = self.send().await?;
2803 Ok(Operation::new(op))
2804 };
2805
2806 google_cloud_lro::internal::new_poller(
2807 polling_error_policy,
2808 polling_backoff_policy,
2809 start,
2810 query,
2811 )
2812 }
2813
2814 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818 self.0.request.address_group = v.into();
2819 self
2820 }
2821
2822 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826 self.0.request.source_address_group = v.into();
2827 self
2828 }
2829
2830 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832 self.0.request.request_id = v.into();
2833 self
2834 }
2835 }
2836
2837 #[doc(hidden)]
2838 impl crate::RequestBuilder for CloneAddressGroupItems {
2839 fn request_options(&mut self) -> &mut crate::RequestOptions {
2840 &mut self.0.options
2841 }
2842 }
2843
2844 #[derive(Clone, Debug)]
2862 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2863
2864 impl DeleteAddressGroup {
2865 pub(crate) fn new(
2866 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2867 ) -> Self {
2868 Self(RequestBuilder::new(stub))
2869 }
2870
2871 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2873 mut self,
2874 v: V,
2875 ) -> Self {
2876 self.0.request = v.into();
2877 self
2878 }
2879
2880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2882 self.0.options = v.into();
2883 self
2884 }
2885
2886 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2893 (*self.0.stub)
2894 .delete_address_group(self.0.request, self.0.options)
2895 .await
2896 .map(crate::Response::into_body)
2897 }
2898
2899 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2901 type Operation =
2902 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2903 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2904 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2905
2906 let stub = self.0.stub.clone();
2907 let mut options = self.0.options.clone();
2908 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2909 let query = move |name| {
2910 let stub = stub.clone();
2911 let options = options.clone();
2912 async {
2913 let op = GetOperation::new(stub)
2914 .set_name(name)
2915 .with_options(options)
2916 .send()
2917 .await?;
2918 Ok(Operation::new(op))
2919 }
2920 };
2921
2922 let start = move || async {
2923 let op = self.send().await?;
2924 Ok(Operation::new(op))
2925 };
2926
2927 google_cloud_lro::internal::new_unit_response_poller(
2928 polling_error_policy,
2929 polling_backoff_policy,
2930 start,
2931 query,
2932 )
2933 }
2934
2935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939 self.0.request.name = v.into();
2940 self
2941 }
2942
2943 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2945 self.0.request.request_id = v.into();
2946 self
2947 }
2948 }
2949
2950 #[doc(hidden)]
2951 impl crate::RequestBuilder for DeleteAddressGroup {
2952 fn request_options(&mut self) -> &mut crate::RequestOptions {
2953 &mut self.0.options
2954 }
2955 }
2956
2957 #[derive(Clone, Debug)]
2978 pub struct ListAddressGroupReferences(
2979 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2980 );
2981
2982 impl ListAddressGroupReferences {
2983 pub(crate) fn new(
2984 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2985 ) -> Self {
2986 Self(RequestBuilder::new(stub))
2987 }
2988
2989 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2991 mut self,
2992 v: V,
2993 ) -> Self {
2994 self.0.request = v.into();
2995 self
2996 }
2997
2998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3000 self.0.options = v.into();
3001 self
3002 }
3003
3004 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
3006 (*self.0.stub)
3007 .list_address_group_references(self.0.request, self.0.options)
3008 .await
3009 .map(crate::Response::into_body)
3010 }
3011
3012 pub fn by_page(
3014 self,
3015 ) -> impl google_cloud_gax::paginator::Paginator<
3016 crate::model::ListAddressGroupReferencesResponse,
3017 crate::Error,
3018 > {
3019 use std::clone::Clone;
3020 let token = self.0.request.page_token.clone();
3021 let execute = move |token: String| {
3022 let mut builder = self.clone();
3023 builder.0.request = builder.0.request.set_page_token(token);
3024 builder.send()
3025 };
3026 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3027 }
3028
3029 pub fn by_item(
3031 self,
3032 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3033 crate::model::ListAddressGroupReferencesResponse,
3034 crate::Error,
3035 > {
3036 use google_cloud_gax::paginator::Paginator;
3037 self.by_page().items()
3038 }
3039
3040 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
3044 self.0.request.address_group = v.into();
3045 self
3046 }
3047
3048 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3050 self.0.request.page_size = v.into();
3051 self
3052 }
3053
3054 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3056 self.0.request.page_token = v.into();
3057 self
3058 }
3059 }
3060
3061 #[doc(hidden)]
3062 impl crate::RequestBuilder for ListAddressGroupReferences {
3063 fn request_options(&mut self) -> &mut crate::RequestOptions {
3064 &mut self.0.options
3065 }
3066 }
3067
3068 #[derive(Clone, Debug)]
3089 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3090
3091 impl ListLocations {
3092 pub(crate) fn new(
3093 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3094 ) -> Self {
3095 Self(RequestBuilder::new(stub))
3096 }
3097
3098 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3100 mut self,
3101 v: V,
3102 ) -> Self {
3103 self.0.request = v.into();
3104 self
3105 }
3106
3107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3109 self.0.options = v.into();
3110 self
3111 }
3112
3113 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3115 (*self.0.stub)
3116 .list_locations(self.0.request, self.0.options)
3117 .await
3118 .map(crate::Response::into_body)
3119 }
3120
3121 pub fn by_page(
3123 self,
3124 ) -> impl google_cloud_gax::paginator::Paginator<
3125 google_cloud_location::model::ListLocationsResponse,
3126 crate::Error,
3127 > {
3128 use std::clone::Clone;
3129 let token = self.0.request.page_token.clone();
3130 let execute = move |token: String| {
3131 let mut builder = self.clone();
3132 builder.0.request = builder.0.request.set_page_token(token);
3133 builder.send()
3134 };
3135 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3136 }
3137
3138 pub fn by_item(
3140 self,
3141 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3142 google_cloud_location::model::ListLocationsResponse,
3143 crate::Error,
3144 > {
3145 use google_cloud_gax::paginator::Paginator;
3146 self.by_page().items()
3147 }
3148
3149 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3151 self.0.request.name = v.into();
3152 self
3153 }
3154
3155 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3157 self.0.request.filter = v.into();
3158 self
3159 }
3160
3161 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3163 self.0.request.page_size = v.into();
3164 self
3165 }
3166
3167 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3169 self.0.request.page_token = v.into();
3170 self
3171 }
3172 }
3173
3174 #[doc(hidden)]
3175 impl crate::RequestBuilder for ListLocations {
3176 fn request_options(&mut self) -> &mut crate::RequestOptions {
3177 &mut self.0.options
3178 }
3179 }
3180
3181 #[derive(Clone, Debug)]
3198 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3199
3200 impl GetLocation {
3201 pub(crate) fn new(
3202 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3203 ) -> Self {
3204 Self(RequestBuilder::new(stub))
3205 }
3206
3207 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3209 mut self,
3210 v: V,
3211 ) -> Self {
3212 self.0.request = v.into();
3213 self
3214 }
3215
3216 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3218 self.0.options = v.into();
3219 self
3220 }
3221
3222 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3224 (*self.0.stub)
3225 .get_location(self.0.request, self.0.options)
3226 .await
3227 .map(crate::Response::into_body)
3228 }
3229
3230 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3232 self.0.request.name = v.into();
3233 self
3234 }
3235 }
3236
3237 #[doc(hidden)]
3238 impl crate::RequestBuilder for GetLocation {
3239 fn request_options(&mut self) -> &mut crate::RequestOptions {
3240 &mut self.0.options
3241 }
3242 }
3243
3244 #[derive(Clone, Debug)]
3261 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3262
3263 impl SetIamPolicy {
3264 pub(crate) fn new(
3265 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3266 ) -> Self {
3267 Self(RequestBuilder::new(stub))
3268 }
3269
3270 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3272 mut self,
3273 v: V,
3274 ) -> Self {
3275 self.0.request = v.into();
3276 self
3277 }
3278
3279 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3281 self.0.options = v.into();
3282 self
3283 }
3284
3285 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3287 (*self.0.stub)
3288 .set_iam_policy(self.0.request, self.0.options)
3289 .await
3290 .map(crate::Response::into_body)
3291 }
3292
3293 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3297 self.0.request.resource = v.into();
3298 self
3299 }
3300
3301 pub fn set_policy<T>(mut self, v: T) -> Self
3305 where
3306 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3307 {
3308 self.0.request.policy = std::option::Option::Some(v.into());
3309 self
3310 }
3311
3312 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3316 where
3317 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3318 {
3319 self.0.request.policy = v.map(|x| x.into());
3320 self
3321 }
3322
3323 pub fn set_update_mask<T>(mut self, v: T) -> Self
3325 where
3326 T: std::convert::Into<wkt::FieldMask>,
3327 {
3328 self.0.request.update_mask = std::option::Option::Some(v.into());
3329 self
3330 }
3331
3332 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3334 where
3335 T: std::convert::Into<wkt::FieldMask>,
3336 {
3337 self.0.request.update_mask = v.map(|x| x.into());
3338 self
3339 }
3340 }
3341
3342 #[doc(hidden)]
3343 impl crate::RequestBuilder for SetIamPolicy {
3344 fn request_options(&mut self) -> &mut crate::RequestOptions {
3345 &mut self.0.options
3346 }
3347 }
3348
3349 #[derive(Clone, Debug)]
3366 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3367
3368 impl GetIamPolicy {
3369 pub(crate) fn new(
3370 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3371 ) -> Self {
3372 Self(RequestBuilder::new(stub))
3373 }
3374
3375 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3377 mut self,
3378 v: V,
3379 ) -> Self {
3380 self.0.request = v.into();
3381 self
3382 }
3383
3384 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3386 self.0.options = v.into();
3387 self
3388 }
3389
3390 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3392 (*self.0.stub)
3393 .get_iam_policy(self.0.request, self.0.options)
3394 .await
3395 .map(crate::Response::into_body)
3396 }
3397
3398 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3402 self.0.request.resource = v.into();
3403 self
3404 }
3405
3406 pub fn set_options<T>(mut self, v: T) -> Self
3408 where
3409 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3410 {
3411 self.0.request.options = std::option::Option::Some(v.into());
3412 self
3413 }
3414
3415 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3417 where
3418 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3419 {
3420 self.0.request.options = v.map(|x| x.into());
3421 self
3422 }
3423 }
3424
3425 #[doc(hidden)]
3426 impl crate::RequestBuilder for GetIamPolicy {
3427 fn request_options(&mut self) -> &mut crate::RequestOptions {
3428 &mut self.0.options
3429 }
3430 }
3431
3432 #[derive(Clone, Debug)]
3449 pub struct TestIamPermissions(
3450 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3451 );
3452
3453 impl TestIamPermissions {
3454 pub(crate) fn new(
3455 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3456 ) -> Self {
3457 Self(RequestBuilder::new(stub))
3458 }
3459
3460 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3462 mut self,
3463 v: V,
3464 ) -> Self {
3465 self.0.request = v.into();
3466 self
3467 }
3468
3469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3471 self.0.options = v.into();
3472 self
3473 }
3474
3475 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3477 (*self.0.stub)
3478 .test_iam_permissions(self.0.request, self.0.options)
3479 .await
3480 .map(crate::Response::into_body)
3481 }
3482
3483 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3487 self.0.request.resource = v.into();
3488 self
3489 }
3490
3491 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3495 where
3496 T: std::iter::IntoIterator<Item = V>,
3497 V: std::convert::Into<std::string::String>,
3498 {
3499 use std::iter::Iterator;
3500 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3501 self
3502 }
3503 }
3504
3505 #[doc(hidden)]
3506 impl crate::RequestBuilder for TestIamPermissions {
3507 fn request_options(&mut self) -> &mut crate::RequestOptions {
3508 &mut self.0.options
3509 }
3510 }
3511
3512 #[derive(Clone, Debug)]
3533 pub struct ListOperations(
3534 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3535 );
3536
3537 impl ListOperations {
3538 pub(crate) fn new(
3539 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3540 ) -> Self {
3541 Self(RequestBuilder::new(stub))
3542 }
3543
3544 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3546 mut self,
3547 v: V,
3548 ) -> Self {
3549 self.0.request = v.into();
3550 self
3551 }
3552
3553 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3555 self.0.options = v.into();
3556 self
3557 }
3558
3559 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3561 (*self.0.stub)
3562 .list_operations(self.0.request, self.0.options)
3563 .await
3564 .map(crate::Response::into_body)
3565 }
3566
3567 pub fn by_page(
3569 self,
3570 ) -> impl google_cloud_gax::paginator::Paginator<
3571 google_cloud_longrunning::model::ListOperationsResponse,
3572 crate::Error,
3573 > {
3574 use std::clone::Clone;
3575 let token = self.0.request.page_token.clone();
3576 let execute = move |token: String| {
3577 let mut builder = self.clone();
3578 builder.0.request = builder.0.request.set_page_token(token);
3579 builder.send()
3580 };
3581 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3582 }
3583
3584 pub fn by_item(
3586 self,
3587 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3588 google_cloud_longrunning::model::ListOperationsResponse,
3589 crate::Error,
3590 > {
3591 use google_cloud_gax::paginator::Paginator;
3592 self.by_page().items()
3593 }
3594
3595 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3597 self.0.request.name = v.into();
3598 self
3599 }
3600
3601 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3603 self.0.request.filter = v.into();
3604 self
3605 }
3606
3607 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3609 self.0.request.page_size = v.into();
3610 self
3611 }
3612
3613 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3615 self.0.request.page_token = v.into();
3616 self
3617 }
3618
3619 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3621 self.0.request.return_partial_success = v.into();
3622 self
3623 }
3624 }
3625
3626 #[doc(hidden)]
3627 impl crate::RequestBuilder for ListOperations {
3628 fn request_options(&mut self) -> &mut crate::RequestOptions {
3629 &mut self.0.options
3630 }
3631 }
3632
3633 #[derive(Clone, Debug)]
3650 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3651
3652 impl GetOperation {
3653 pub(crate) fn new(
3654 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3655 ) -> Self {
3656 Self(RequestBuilder::new(stub))
3657 }
3658
3659 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3661 mut self,
3662 v: V,
3663 ) -> Self {
3664 self.0.request = v.into();
3665 self
3666 }
3667
3668 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3670 self.0.options = v.into();
3671 self
3672 }
3673
3674 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3676 (*self.0.stub)
3677 .get_operation(self.0.request, self.0.options)
3678 .await
3679 .map(crate::Response::into_body)
3680 }
3681
3682 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3684 self.0.request.name = v.into();
3685 self
3686 }
3687 }
3688
3689 #[doc(hidden)]
3690 impl crate::RequestBuilder for GetOperation {
3691 fn request_options(&mut self) -> &mut crate::RequestOptions {
3692 &mut self.0.options
3693 }
3694 }
3695
3696 #[derive(Clone, Debug)]
3713 pub struct DeleteOperation(
3714 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3715 );
3716
3717 impl DeleteOperation {
3718 pub(crate) fn new(
3719 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3720 ) -> Self {
3721 Self(RequestBuilder::new(stub))
3722 }
3723
3724 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3726 mut self,
3727 v: V,
3728 ) -> Self {
3729 self.0.request = v.into();
3730 self
3731 }
3732
3733 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3735 self.0.options = v.into();
3736 self
3737 }
3738
3739 pub async fn send(self) -> Result<()> {
3741 (*self.0.stub)
3742 .delete_operation(self.0.request, self.0.options)
3743 .await
3744 .map(crate::Response::into_body)
3745 }
3746
3747 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3749 self.0.request.name = v.into();
3750 self
3751 }
3752 }
3753
3754 #[doc(hidden)]
3755 impl crate::RequestBuilder for DeleteOperation {
3756 fn request_options(&mut self) -> &mut crate::RequestOptions {
3757 &mut self.0.options
3758 }
3759 }
3760
3761 #[derive(Clone, Debug)]
3778 pub struct CancelOperation(
3779 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3780 );
3781
3782 impl CancelOperation {
3783 pub(crate) fn new(
3784 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3785 ) -> Self {
3786 Self(RequestBuilder::new(stub))
3787 }
3788
3789 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3791 mut self,
3792 v: V,
3793 ) -> Self {
3794 self.0.request = v.into();
3795 self
3796 }
3797
3798 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3800 self.0.options = v.into();
3801 self
3802 }
3803
3804 pub async fn send(self) -> Result<()> {
3806 (*self.0.stub)
3807 .cancel_operation(self.0.request, self.0.options)
3808 .await
3809 .map(crate::Response::into_body)
3810 }
3811
3812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3814 self.0.request.name = v.into();
3815 self
3816 }
3817 }
3818
3819 #[doc(hidden)]
3820 impl crate::RequestBuilder for CancelOperation {
3821 fn request_options(&mut self) -> &mut crate::RequestOptions {
3822 &mut self.0.options
3823 }
3824 }
3825}
3826
3827pub mod dns_threat_detector_service {
3829 use crate::Result;
3830
3831 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3845
3846 pub(crate) mod client {
3847 use super::super::super::client::DnsThreatDetectorService;
3848 pub struct Factory;
3849 impl crate::ClientFactory for Factory {
3850 type Client = DnsThreatDetectorService;
3851 type Credentials = gaxi::options::Credentials;
3852 async fn build(
3853 self,
3854 config: gaxi::options::ClientConfig,
3855 ) -> crate::ClientBuilderResult<Self::Client> {
3856 Self::Client::new(config).await
3857 }
3858 }
3859 }
3860
3861 #[derive(Clone, Debug)]
3863 pub(crate) struct RequestBuilder<R: std::default::Default> {
3864 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3865 request: R,
3866 options: crate::RequestOptions,
3867 }
3868
3869 impl<R> RequestBuilder<R>
3870 where
3871 R: std::default::Default,
3872 {
3873 pub(crate) fn new(
3874 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3875 ) -> Self {
3876 Self {
3877 stub,
3878 request: R::default(),
3879 options: crate::RequestOptions::default(),
3880 }
3881 }
3882 }
3883
3884 #[derive(Clone, Debug)]
3905 pub struct ListDnsThreatDetectors(RequestBuilder<crate::model::ListDnsThreatDetectorsRequest>);
3906
3907 impl ListDnsThreatDetectors {
3908 pub(crate) fn new(
3909 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3910 ) -> Self {
3911 Self(RequestBuilder::new(stub))
3912 }
3913
3914 pub fn with_request<V: Into<crate::model::ListDnsThreatDetectorsRequest>>(
3916 mut self,
3917 v: V,
3918 ) -> Self {
3919 self.0.request = v.into();
3920 self
3921 }
3922
3923 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3925 self.0.options = v.into();
3926 self
3927 }
3928
3929 pub async fn send(self) -> Result<crate::model::ListDnsThreatDetectorsResponse> {
3931 (*self.0.stub)
3932 .list_dns_threat_detectors(self.0.request, self.0.options)
3933 .await
3934 .map(crate::Response::into_body)
3935 }
3936
3937 pub fn by_page(
3939 self,
3940 ) -> impl google_cloud_gax::paginator::Paginator<
3941 crate::model::ListDnsThreatDetectorsResponse,
3942 crate::Error,
3943 > {
3944 use std::clone::Clone;
3945 let token = self.0.request.page_token.clone();
3946 let execute = move |token: String| {
3947 let mut builder = self.clone();
3948 builder.0.request = builder.0.request.set_page_token(token);
3949 builder.send()
3950 };
3951 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3952 }
3953
3954 pub fn by_item(
3956 self,
3957 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3958 crate::model::ListDnsThreatDetectorsResponse,
3959 crate::Error,
3960 > {
3961 use google_cloud_gax::paginator::Paginator;
3962 self.by_page().items()
3963 }
3964
3965 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3969 self.0.request.parent = v.into();
3970 self
3971 }
3972
3973 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3975 self.0.request.page_size = v.into();
3976 self
3977 }
3978
3979 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3981 self.0.request.page_token = v.into();
3982 self
3983 }
3984 }
3985
3986 #[doc(hidden)]
3987 impl crate::RequestBuilder for ListDnsThreatDetectors {
3988 fn request_options(&mut self) -> &mut crate::RequestOptions {
3989 &mut self.0.options
3990 }
3991 }
3992
3993 #[derive(Clone, Debug)]
4010 pub struct GetDnsThreatDetector(RequestBuilder<crate::model::GetDnsThreatDetectorRequest>);
4011
4012 impl GetDnsThreatDetector {
4013 pub(crate) fn new(
4014 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4015 ) -> Self {
4016 Self(RequestBuilder::new(stub))
4017 }
4018
4019 pub fn with_request<V: Into<crate::model::GetDnsThreatDetectorRequest>>(
4021 mut self,
4022 v: V,
4023 ) -> Self {
4024 self.0.request = v.into();
4025 self
4026 }
4027
4028 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4030 self.0.options = v.into();
4031 self
4032 }
4033
4034 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4036 (*self.0.stub)
4037 .get_dns_threat_detector(self.0.request, self.0.options)
4038 .await
4039 .map(crate::Response::into_body)
4040 }
4041
4042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4046 self.0.request.name = v.into();
4047 self
4048 }
4049 }
4050
4051 #[doc(hidden)]
4052 impl crate::RequestBuilder for GetDnsThreatDetector {
4053 fn request_options(&mut self) -> &mut crate::RequestOptions {
4054 &mut self.0.options
4055 }
4056 }
4057
4058 #[derive(Clone, Debug)]
4075 pub struct CreateDnsThreatDetector(
4076 RequestBuilder<crate::model::CreateDnsThreatDetectorRequest>,
4077 );
4078
4079 impl CreateDnsThreatDetector {
4080 pub(crate) fn new(
4081 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4082 ) -> Self {
4083 Self(RequestBuilder::new(stub))
4084 }
4085
4086 pub fn with_request<V: Into<crate::model::CreateDnsThreatDetectorRequest>>(
4088 mut self,
4089 v: V,
4090 ) -> Self {
4091 self.0.request = v.into();
4092 self
4093 }
4094
4095 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4097 self.0.options = v.into();
4098 self
4099 }
4100
4101 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4103 (*self.0.stub)
4104 .create_dns_threat_detector(self.0.request, self.0.options)
4105 .await
4106 .map(crate::Response::into_body)
4107 }
4108
4109 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4113 self.0.request.parent = v.into();
4114 self
4115 }
4116
4117 pub fn set_dns_threat_detector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4119 self.0.request.dns_threat_detector_id = v.into();
4120 self
4121 }
4122
4123 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4127 where
4128 T: std::convert::Into<crate::model::DnsThreatDetector>,
4129 {
4130 self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4131 self
4132 }
4133
4134 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4138 where
4139 T: std::convert::Into<crate::model::DnsThreatDetector>,
4140 {
4141 self.0.request.dns_threat_detector = v.map(|x| x.into());
4142 self
4143 }
4144 }
4145
4146 #[doc(hidden)]
4147 impl crate::RequestBuilder for CreateDnsThreatDetector {
4148 fn request_options(&mut self) -> &mut crate::RequestOptions {
4149 &mut self.0.options
4150 }
4151 }
4152
4153 #[derive(Clone, Debug)]
4170 pub struct UpdateDnsThreatDetector(
4171 RequestBuilder<crate::model::UpdateDnsThreatDetectorRequest>,
4172 );
4173
4174 impl UpdateDnsThreatDetector {
4175 pub(crate) fn new(
4176 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4177 ) -> Self {
4178 Self(RequestBuilder::new(stub))
4179 }
4180
4181 pub fn with_request<V: Into<crate::model::UpdateDnsThreatDetectorRequest>>(
4183 mut self,
4184 v: V,
4185 ) -> Self {
4186 self.0.request = v.into();
4187 self
4188 }
4189
4190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4192 self.0.options = v.into();
4193 self
4194 }
4195
4196 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4198 (*self.0.stub)
4199 .update_dns_threat_detector(self.0.request, self.0.options)
4200 .await
4201 .map(crate::Response::into_body)
4202 }
4203
4204 pub fn set_update_mask<T>(mut self, v: T) -> Self
4206 where
4207 T: std::convert::Into<wkt::FieldMask>,
4208 {
4209 self.0.request.update_mask = std::option::Option::Some(v.into());
4210 self
4211 }
4212
4213 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4215 where
4216 T: std::convert::Into<wkt::FieldMask>,
4217 {
4218 self.0.request.update_mask = v.map(|x| x.into());
4219 self
4220 }
4221
4222 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4226 where
4227 T: std::convert::Into<crate::model::DnsThreatDetector>,
4228 {
4229 self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4230 self
4231 }
4232
4233 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4237 where
4238 T: std::convert::Into<crate::model::DnsThreatDetector>,
4239 {
4240 self.0.request.dns_threat_detector = v.map(|x| x.into());
4241 self
4242 }
4243 }
4244
4245 #[doc(hidden)]
4246 impl crate::RequestBuilder for UpdateDnsThreatDetector {
4247 fn request_options(&mut self) -> &mut crate::RequestOptions {
4248 &mut self.0.options
4249 }
4250 }
4251
4252 #[derive(Clone, Debug)]
4269 pub struct DeleteDnsThreatDetector(
4270 RequestBuilder<crate::model::DeleteDnsThreatDetectorRequest>,
4271 );
4272
4273 impl DeleteDnsThreatDetector {
4274 pub(crate) fn new(
4275 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4276 ) -> Self {
4277 Self(RequestBuilder::new(stub))
4278 }
4279
4280 pub fn with_request<V: Into<crate::model::DeleteDnsThreatDetectorRequest>>(
4282 mut self,
4283 v: V,
4284 ) -> Self {
4285 self.0.request = v.into();
4286 self
4287 }
4288
4289 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4291 self.0.options = v.into();
4292 self
4293 }
4294
4295 pub async fn send(self) -> Result<()> {
4297 (*self.0.stub)
4298 .delete_dns_threat_detector(self.0.request, self.0.options)
4299 .await
4300 .map(crate::Response::into_body)
4301 }
4302
4303 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4307 self.0.request.name = v.into();
4308 self
4309 }
4310 }
4311
4312 #[doc(hidden)]
4313 impl crate::RequestBuilder for DeleteDnsThreatDetector {
4314 fn request_options(&mut self) -> &mut crate::RequestOptions {
4315 &mut self.0.options
4316 }
4317 }
4318
4319 #[derive(Clone, Debug)]
4340 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4341
4342 impl ListLocations {
4343 pub(crate) fn new(
4344 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4345 ) -> Self {
4346 Self(RequestBuilder::new(stub))
4347 }
4348
4349 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4351 mut self,
4352 v: V,
4353 ) -> Self {
4354 self.0.request = v.into();
4355 self
4356 }
4357
4358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4360 self.0.options = v.into();
4361 self
4362 }
4363
4364 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4366 (*self.0.stub)
4367 .list_locations(self.0.request, self.0.options)
4368 .await
4369 .map(crate::Response::into_body)
4370 }
4371
4372 pub fn by_page(
4374 self,
4375 ) -> impl google_cloud_gax::paginator::Paginator<
4376 google_cloud_location::model::ListLocationsResponse,
4377 crate::Error,
4378 > {
4379 use std::clone::Clone;
4380 let token = self.0.request.page_token.clone();
4381 let execute = move |token: String| {
4382 let mut builder = self.clone();
4383 builder.0.request = builder.0.request.set_page_token(token);
4384 builder.send()
4385 };
4386 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4387 }
4388
4389 pub fn by_item(
4391 self,
4392 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4393 google_cloud_location::model::ListLocationsResponse,
4394 crate::Error,
4395 > {
4396 use google_cloud_gax::paginator::Paginator;
4397 self.by_page().items()
4398 }
4399
4400 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4402 self.0.request.name = v.into();
4403 self
4404 }
4405
4406 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4408 self.0.request.filter = v.into();
4409 self
4410 }
4411
4412 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4414 self.0.request.page_size = v.into();
4415 self
4416 }
4417
4418 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4420 self.0.request.page_token = v.into();
4421 self
4422 }
4423 }
4424
4425 #[doc(hidden)]
4426 impl crate::RequestBuilder for ListLocations {
4427 fn request_options(&mut self) -> &mut crate::RequestOptions {
4428 &mut self.0.options
4429 }
4430 }
4431
4432 #[derive(Clone, Debug)]
4449 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4450
4451 impl GetLocation {
4452 pub(crate) fn new(
4453 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4454 ) -> Self {
4455 Self(RequestBuilder::new(stub))
4456 }
4457
4458 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4460 mut self,
4461 v: V,
4462 ) -> Self {
4463 self.0.request = v.into();
4464 self
4465 }
4466
4467 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4469 self.0.options = v.into();
4470 self
4471 }
4472
4473 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4475 (*self.0.stub)
4476 .get_location(self.0.request, self.0.options)
4477 .await
4478 .map(crate::Response::into_body)
4479 }
4480
4481 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4483 self.0.request.name = v.into();
4484 self
4485 }
4486 }
4487
4488 #[doc(hidden)]
4489 impl crate::RequestBuilder for GetLocation {
4490 fn request_options(&mut self) -> &mut crate::RequestOptions {
4491 &mut self.0.options
4492 }
4493 }
4494
4495 #[derive(Clone, Debug)]
4512 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4513
4514 impl SetIamPolicy {
4515 pub(crate) fn new(
4516 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4517 ) -> Self {
4518 Self(RequestBuilder::new(stub))
4519 }
4520
4521 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4523 mut self,
4524 v: V,
4525 ) -> Self {
4526 self.0.request = v.into();
4527 self
4528 }
4529
4530 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4532 self.0.options = v.into();
4533 self
4534 }
4535
4536 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4538 (*self.0.stub)
4539 .set_iam_policy(self.0.request, self.0.options)
4540 .await
4541 .map(crate::Response::into_body)
4542 }
4543
4544 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4548 self.0.request.resource = v.into();
4549 self
4550 }
4551
4552 pub fn set_policy<T>(mut self, v: T) -> Self
4556 where
4557 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4558 {
4559 self.0.request.policy = std::option::Option::Some(v.into());
4560 self
4561 }
4562
4563 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4567 where
4568 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4569 {
4570 self.0.request.policy = v.map(|x| x.into());
4571 self
4572 }
4573
4574 pub fn set_update_mask<T>(mut self, v: T) -> Self
4576 where
4577 T: std::convert::Into<wkt::FieldMask>,
4578 {
4579 self.0.request.update_mask = std::option::Option::Some(v.into());
4580 self
4581 }
4582
4583 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4585 where
4586 T: std::convert::Into<wkt::FieldMask>,
4587 {
4588 self.0.request.update_mask = v.map(|x| x.into());
4589 self
4590 }
4591 }
4592
4593 #[doc(hidden)]
4594 impl crate::RequestBuilder for SetIamPolicy {
4595 fn request_options(&mut self) -> &mut crate::RequestOptions {
4596 &mut self.0.options
4597 }
4598 }
4599
4600 #[derive(Clone, Debug)]
4617 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4618
4619 impl GetIamPolicy {
4620 pub(crate) fn new(
4621 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4622 ) -> Self {
4623 Self(RequestBuilder::new(stub))
4624 }
4625
4626 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4628 mut self,
4629 v: V,
4630 ) -> Self {
4631 self.0.request = v.into();
4632 self
4633 }
4634
4635 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4637 self.0.options = v.into();
4638 self
4639 }
4640
4641 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4643 (*self.0.stub)
4644 .get_iam_policy(self.0.request, self.0.options)
4645 .await
4646 .map(crate::Response::into_body)
4647 }
4648
4649 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4653 self.0.request.resource = v.into();
4654 self
4655 }
4656
4657 pub fn set_options<T>(mut self, v: T) -> Self
4659 where
4660 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4661 {
4662 self.0.request.options = std::option::Option::Some(v.into());
4663 self
4664 }
4665
4666 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4668 where
4669 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4670 {
4671 self.0.request.options = v.map(|x| x.into());
4672 self
4673 }
4674 }
4675
4676 #[doc(hidden)]
4677 impl crate::RequestBuilder for GetIamPolicy {
4678 fn request_options(&mut self) -> &mut crate::RequestOptions {
4679 &mut self.0.options
4680 }
4681 }
4682
4683 #[derive(Clone, Debug)]
4700 pub struct TestIamPermissions(
4701 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4702 );
4703
4704 impl TestIamPermissions {
4705 pub(crate) fn new(
4706 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4707 ) -> Self {
4708 Self(RequestBuilder::new(stub))
4709 }
4710
4711 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4713 mut self,
4714 v: V,
4715 ) -> Self {
4716 self.0.request = v.into();
4717 self
4718 }
4719
4720 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4722 self.0.options = v.into();
4723 self
4724 }
4725
4726 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4728 (*self.0.stub)
4729 .test_iam_permissions(self.0.request, self.0.options)
4730 .await
4731 .map(crate::Response::into_body)
4732 }
4733
4734 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4738 self.0.request.resource = v.into();
4739 self
4740 }
4741
4742 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4746 where
4747 T: std::iter::IntoIterator<Item = V>,
4748 V: std::convert::Into<std::string::String>,
4749 {
4750 use std::iter::Iterator;
4751 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4752 self
4753 }
4754 }
4755
4756 #[doc(hidden)]
4757 impl crate::RequestBuilder for TestIamPermissions {
4758 fn request_options(&mut self) -> &mut crate::RequestOptions {
4759 &mut self.0.options
4760 }
4761 }
4762
4763 #[derive(Clone, Debug)]
4784 pub struct ListOperations(
4785 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4786 );
4787
4788 impl ListOperations {
4789 pub(crate) fn new(
4790 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4791 ) -> Self {
4792 Self(RequestBuilder::new(stub))
4793 }
4794
4795 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4797 mut self,
4798 v: V,
4799 ) -> Self {
4800 self.0.request = v.into();
4801 self
4802 }
4803
4804 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4806 self.0.options = v.into();
4807 self
4808 }
4809
4810 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4812 (*self.0.stub)
4813 .list_operations(self.0.request, self.0.options)
4814 .await
4815 .map(crate::Response::into_body)
4816 }
4817
4818 pub fn by_page(
4820 self,
4821 ) -> impl google_cloud_gax::paginator::Paginator<
4822 google_cloud_longrunning::model::ListOperationsResponse,
4823 crate::Error,
4824 > {
4825 use std::clone::Clone;
4826 let token = self.0.request.page_token.clone();
4827 let execute = move |token: String| {
4828 let mut builder = self.clone();
4829 builder.0.request = builder.0.request.set_page_token(token);
4830 builder.send()
4831 };
4832 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4833 }
4834
4835 pub fn by_item(
4837 self,
4838 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4839 google_cloud_longrunning::model::ListOperationsResponse,
4840 crate::Error,
4841 > {
4842 use google_cloud_gax::paginator::Paginator;
4843 self.by_page().items()
4844 }
4845
4846 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4848 self.0.request.name = v.into();
4849 self
4850 }
4851
4852 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4854 self.0.request.filter = v.into();
4855 self
4856 }
4857
4858 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4860 self.0.request.page_size = v.into();
4861 self
4862 }
4863
4864 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4866 self.0.request.page_token = v.into();
4867 self
4868 }
4869
4870 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4872 self.0.request.return_partial_success = v.into();
4873 self
4874 }
4875 }
4876
4877 #[doc(hidden)]
4878 impl crate::RequestBuilder for ListOperations {
4879 fn request_options(&mut self) -> &mut crate::RequestOptions {
4880 &mut self.0.options
4881 }
4882 }
4883
4884 #[derive(Clone, Debug)]
4901 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4902
4903 impl GetOperation {
4904 pub(crate) fn new(
4905 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4906 ) -> Self {
4907 Self(RequestBuilder::new(stub))
4908 }
4909
4910 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4912 mut self,
4913 v: V,
4914 ) -> Self {
4915 self.0.request = v.into();
4916 self
4917 }
4918
4919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4921 self.0.options = v.into();
4922 self
4923 }
4924
4925 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4927 (*self.0.stub)
4928 .get_operation(self.0.request, self.0.options)
4929 .await
4930 .map(crate::Response::into_body)
4931 }
4932
4933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4935 self.0.request.name = v.into();
4936 self
4937 }
4938 }
4939
4940 #[doc(hidden)]
4941 impl crate::RequestBuilder for GetOperation {
4942 fn request_options(&mut self) -> &mut crate::RequestOptions {
4943 &mut self.0.options
4944 }
4945 }
4946
4947 #[derive(Clone, Debug)]
4964 pub struct DeleteOperation(
4965 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4966 );
4967
4968 impl DeleteOperation {
4969 pub(crate) fn new(
4970 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4971 ) -> Self {
4972 Self(RequestBuilder::new(stub))
4973 }
4974
4975 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4977 mut self,
4978 v: V,
4979 ) -> Self {
4980 self.0.request = v.into();
4981 self
4982 }
4983
4984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4986 self.0.options = v.into();
4987 self
4988 }
4989
4990 pub async fn send(self) -> Result<()> {
4992 (*self.0.stub)
4993 .delete_operation(self.0.request, self.0.options)
4994 .await
4995 .map(crate::Response::into_body)
4996 }
4997
4998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5000 self.0.request.name = v.into();
5001 self
5002 }
5003 }
5004
5005 #[doc(hidden)]
5006 impl crate::RequestBuilder for DeleteOperation {
5007 fn request_options(&mut self) -> &mut crate::RequestOptions {
5008 &mut self.0.options
5009 }
5010 }
5011
5012 #[derive(Clone, Debug)]
5029 pub struct CancelOperation(
5030 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5031 );
5032
5033 impl CancelOperation {
5034 pub(crate) fn new(
5035 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5036 ) -> Self {
5037 Self(RequestBuilder::new(stub))
5038 }
5039
5040 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5042 mut self,
5043 v: V,
5044 ) -> Self {
5045 self.0.request = v.into();
5046 self
5047 }
5048
5049 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5051 self.0.options = v.into();
5052 self
5053 }
5054
5055 pub async fn send(self) -> Result<()> {
5057 (*self.0.stub)
5058 .cancel_operation(self.0.request, self.0.options)
5059 .await
5060 .map(crate::Response::into_body)
5061 }
5062
5063 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5065 self.0.request.name = v.into();
5066 self
5067 }
5068 }
5069
5070 #[doc(hidden)]
5071 impl crate::RequestBuilder for CancelOperation {
5072 fn request_options(&mut self) -> &mut crate::RequestOptions {
5073 &mut self.0.options
5074 }
5075 }
5076}
5077
5078pub mod firewall_activation {
5080 use crate::Result;
5081
5082 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5096
5097 pub(crate) mod client {
5098 use super::super::super::client::FirewallActivation;
5099 pub struct Factory;
5100 impl crate::ClientFactory for Factory {
5101 type Client = FirewallActivation;
5102 type Credentials = gaxi::options::Credentials;
5103 async fn build(
5104 self,
5105 config: gaxi::options::ClientConfig,
5106 ) -> crate::ClientBuilderResult<Self::Client> {
5107 Self::Client::new(config).await
5108 }
5109 }
5110 }
5111
5112 #[derive(Clone, Debug)]
5114 pub(crate) struct RequestBuilder<R: std::default::Default> {
5115 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5116 request: R,
5117 options: crate::RequestOptions,
5118 }
5119
5120 impl<R> RequestBuilder<R>
5121 where
5122 R: std::default::Default,
5123 {
5124 pub(crate) fn new(
5125 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5126 ) -> Self {
5127 Self {
5128 stub,
5129 request: R::default(),
5130 options: crate::RequestOptions::default(),
5131 }
5132 }
5133 }
5134
5135 #[derive(Clone, Debug)]
5156 pub struct ListFirewallEndpoints(RequestBuilder<crate::model::ListFirewallEndpointsRequest>);
5157
5158 impl ListFirewallEndpoints {
5159 pub(crate) fn new(
5160 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5161 ) -> Self {
5162 Self(RequestBuilder::new(stub))
5163 }
5164
5165 pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5167 mut self,
5168 v: V,
5169 ) -> Self {
5170 self.0.request = v.into();
5171 self
5172 }
5173
5174 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5176 self.0.options = v.into();
5177 self
5178 }
5179
5180 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5182 (*self.0.stub)
5183 .list_firewall_endpoints(self.0.request, self.0.options)
5184 .await
5185 .map(crate::Response::into_body)
5186 }
5187
5188 pub fn by_page(
5190 self,
5191 ) -> impl google_cloud_gax::paginator::Paginator<
5192 crate::model::ListFirewallEndpointsResponse,
5193 crate::Error,
5194 > {
5195 use std::clone::Clone;
5196 let token = self.0.request.page_token.clone();
5197 let execute = move |token: String| {
5198 let mut builder = self.clone();
5199 builder.0.request = builder.0.request.set_page_token(token);
5200 builder.send()
5201 };
5202 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5203 }
5204
5205 pub fn by_item(
5207 self,
5208 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5209 crate::model::ListFirewallEndpointsResponse,
5210 crate::Error,
5211 > {
5212 use google_cloud_gax::paginator::Paginator;
5213 self.by_page().items()
5214 }
5215
5216 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5220 self.0.request.parent = v.into();
5221 self
5222 }
5223
5224 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5226 self.0.request.page_size = v.into();
5227 self
5228 }
5229
5230 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5232 self.0.request.page_token = v.into();
5233 self
5234 }
5235
5236 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5238 self.0.request.filter = v.into();
5239 self
5240 }
5241
5242 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5244 self.0.request.order_by = v.into();
5245 self
5246 }
5247 }
5248
5249 #[doc(hidden)]
5250 impl crate::RequestBuilder for ListFirewallEndpoints {
5251 fn request_options(&mut self) -> &mut crate::RequestOptions {
5252 &mut self.0.options
5253 }
5254 }
5255
5256 #[derive(Clone, Debug)]
5277 pub struct ListProjectFirewallEndpoints(
5278 RequestBuilder<crate::model::ListFirewallEndpointsRequest>,
5279 );
5280
5281 impl ListProjectFirewallEndpoints {
5282 pub(crate) fn new(
5283 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5284 ) -> Self {
5285 Self(RequestBuilder::new(stub))
5286 }
5287
5288 pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5290 mut self,
5291 v: V,
5292 ) -> Self {
5293 self.0.request = v.into();
5294 self
5295 }
5296
5297 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5299 self.0.options = v.into();
5300 self
5301 }
5302
5303 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5305 (*self.0.stub)
5306 .list_project_firewall_endpoints(self.0.request, self.0.options)
5307 .await
5308 .map(crate::Response::into_body)
5309 }
5310
5311 pub fn by_page(
5313 self,
5314 ) -> impl google_cloud_gax::paginator::Paginator<
5315 crate::model::ListFirewallEndpointsResponse,
5316 crate::Error,
5317 > {
5318 use std::clone::Clone;
5319 let token = self.0.request.page_token.clone();
5320 let execute = move |token: String| {
5321 let mut builder = self.clone();
5322 builder.0.request = builder.0.request.set_page_token(token);
5323 builder.send()
5324 };
5325 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5326 }
5327
5328 pub fn by_item(
5330 self,
5331 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5332 crate::model::ListFirewallEndpointsResponse,
5333 crate::Error,
5334 > {
5335 use google_cloud_gax::paginator::Paginator;
5336 self.by_page().items()
5337 }
5338
5339 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5343 self.0.request.parent = v.into();
5344 self
5345 }
5346
5347 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5349 self.0.request.page_size = v.into();
5350 self
5351 }
5352
5353 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5355 self.0.request.page_token = v.into();
5356 self
5357 }
5358
5359 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5361 self.0.request.filter = v.into();
5362 self
5363 }
5364
5365 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5367 self.0.request.order_by = v.into();
5368 self
5369 }
5370 }
5371
5372 #[doc(hidden)]
5373 impl crate::RequestBuilder for ListProjectFirewallEndpoints {
5374 fn request_options(&mut self) -> &mut crate::RequestOptions {
5375 &mut self.0.options
5376 }
5377 }
5378
5379 #[derive(Clone, Debug)]
5396 pub struct GetFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5397
5398 impl GetFirewallEndpoint {
5399 pub(crate) fn new(
5400 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5401 ) -> Self {
5402 Self(RequestBuilder::new(stub))
5403 }
5404
5405 pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5407 mut self,
5408 v: V,
5409 ) -> Self {
5410 self.0.request = v.into();
5411 self
5412 }
5413
5414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5416 self.0.options = v.into();
5417 self
5418 }
5419
5420 pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5422 (*self.0.stub)
5423 .get_firewall_endpoint(self.0.request, self.0.options)
5424 .await
5425 .map(crate::Response::into_body)
5426 }
5427
5428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5432 self.0.request.name = v.into();
5433 self
5434 }
5435 }
5436
5437 #[doc(hidden)]
5438 impl crate::RequestBuilder for GetFirewallEndpoint {
5439 fn request_options(&mut self) -> &mut crate::RequestOptions {
5440 &mut self.0.options
5441 }
5442 }
5443
5444 #[derive(Clone, Debug)]
5461 pub struct GetProjectFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5462
5463 impl GetProjectFirewallEndpoint {
5464 pub(crate) fn new(
5465 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5466 ) -> Self {
5467 Self(RequestBuilder::new(stub))
5468 }
5469
5470 pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5472 mut self,
5473 v: V,
5474 ) -> Self {
5475 self.0.request = v.into();
5476 self
5477 }
5478
5479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5481 self.0.options = v.into();
5482 self
5483 }
5484
5485 pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5487 (*self.0.stub)
5488 .get_project_firewall_endpoint(self.0.request, self.0.options)
5489 .await
5490 .map(crate::Response::into_body)
5491 }
5492
5493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5497 self.0.request.name = v.into();
5498 self
5499 }
5500 }
5501
5502 #[doc(hidden)]
5503 impl crate::RequestBuilder for GetProjectFirewallEndpoint {
5504 fn request_options(&mut self) -> &mut crate::RequestOptions {
5505 &mut self.0.options
5506 }
5507 }
5508
5509 #[derive(Clone, Debug)]
5527 pub struct CreateFirewallEndpoint(RequestBuilder<crate::model::CreateFirewallEndpointRequest>);
5528
5529 impl CreateFirewallEndpoint {
5530 pub(crate) fn new(
5531 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5532 ) -> Self {
5533 Self(RequestBuilder::new(stub))
5534 }
5535
5536 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5538 mut self,
5539 v: V,
5540 ) -> Self {
5541 self.0.request = v.into();
5542 self
5543 }
5544
5545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5547 self.0.options = v.into();
5548 self
5549 }
5550
5551 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5558 (*self.0.stub)
5559 .create_firewall_endpoint(self.0.request, self.0.options)
5560 .await
5561 .map(crate::Response::into_body)
5562 }
5563
5564 pub fn poller(
5566 self,
5567 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5568 {
5569 type Operation = google_cloud_lro::internal::Operation<
5570 crate::model::FirewallEndpoint,
5571 crate::model::OperationMetadata,
5572 >;
5573 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5574 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5575
5576 let stub = self.0.stub.clone();
5577 let mut options = self.0.options.clone();
5578 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5579 let query = move |name| {
5580 let stub = stub.clone();
5581 let options = options.clone();
5582 async {
5583 let op = GetOperation::new(stub)
5584 .set_name(name)
5585 .with_options(options)
5586 .send()
5587 .await?;
5588 Ok(Operation::new(op))
5589 }
5590 };
5591
5592 let start = move || async {
5593 let op = self.send().await?;
5594 Ok(Operation::new(op))
5595 };
5596
5597 google_cloud_lro::internal::new_poller(
5598 polling_error_policy,
5599 polling_backoff_policy,
5600 start,
5601 query,
5602 )
5603 }
5604
5605 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5609 self.0.request.parent = v.into();
5610 self
5611 }
5612
5613 pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5617 self.0.request.firewall_endpoint_id = v.into();
5618 self
5619 }
5620
5621 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5625 where
5626 T: std::convert::Into<crate::model::FirewallEndpoint>,
5627 {
5628 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5629 self
5630 }
5631
5632 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5636 where
5637 T: std::convert::Into<crate::model::FirewallEndpoint>,
5638 {
5639 self.0.request.firewall_endpoint = v.map(|x| x.into());
5640 self
5641 }
5642
5643 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5645 self.0.request.request_id = v.into();
5646 self
5647 }
5648 }
5649
5650 #[doc(hidden)]
5651 impl crate::RequestBuilder for CreateFirewallEndpoint {
5652 fn request_options(&mut self) -> &mut crate::RequestOptions {
5653 &mut self.0.options
5654 }
5655 }
5656
5657 #[derive(Clone, Debug)]
5675 pub struct CreateProjectFirewallEndpoint(
5676 RequestBuilder<crate::model::CreateFirewallEndpointRequest>,
5677 );
5678
5679 impl CreateProjectFirewallEndpoint {
5680 pub(crate) fn new(
5681 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5682 ) -> Self {
5683 Self(RequestBuilder::new(stub))
5684 }
5685
5686 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5688 mut self,
5689 v: V,
5690 ) -> Self {
5691 self.0.request = v.into();
5692 self
5693 }
5694
5695 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5697 self.0.options = v.into();
5698 self
5699 }
5700
5701 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5708 (*self.0.stub)
5709 .create_project_firewall_endpoint(self.0.request, self.0.options)
5710 .await
5711 .map(crate::Response::into_body)
5712 }
5713
5714 pub fn poller(
5716 self,
5717 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5718 {
5719 type Operation = google_cloud_lro::internal::Operation<
5720 crate::model::FirewallEndpoint,
5721 crate::model::OperationMetadata,
5722 >;
5723 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5724 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5725
5726 let stub = self.0.stub.clone();
5727 let mut options = self.0.options.clone();
5728 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5729 let query = move |name| {
5730 let stub = stub.clone();
5731 let options = options.clone();
5732 async {
5733 let op = GetOperation::new(stub)
5734 .set_name(name)
5735 .with_options(options)
5736 .send()
5737 .await?;
5738 Ok(Operation::new(op))
5739 }
5740 };
5741
5742 let start = move || async {
5743 let op = self.send().await?;
5744 Ok(Operation::new(op))
5745 };
5746
5747 google_cloud_lro::internal::new_poller(
5748 polling_error_policy,
5749 polling_backoff_policy,
5750 start,
5751 query,
5752 )
5753 }
5754
5755 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5759 self.0.request.parent = v.into();
5760 self
5761 }
5762
5763 pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5767 self.0.request.firewall_endpoint_id = v.into();
5768 self
5769 }
5770
5771 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5775 where
5776 T: std::convert::Into<crate::model::FirewallEndpoint>,
5777 {
5778 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5779 self
5780 }
5781
5782 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5786 where
5787 T: std::convert::Into<crate::model::FirewallEndpoint>,
5788 {
5789 self.0.request.firewall_endpoint = v.map(|x| x.into());
5790 self
5791 }
5792
5793 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5795 self.0.request.request_id = v.into();
5796 self
5797 }
5798 }
5799
5800 #[doc(hidden)]
5801 impl crate::RequestBuilder for CreateProjectFirewallEndpoint {
5802 fn request_options(&mut self) -> &mut crate::RequestOptions {
5803 &mut self.0.options
5804 }
5805 }
5806
5807 #[derive(Clone, Debug)]
5825 pub struct DeleteFirewallEndpoint(RequestBuilder<crate::model::DeleteFirewallEndpointRequest>);
5826
5827 impl DeleteFirewallEndpoint {
5828 pub(crate) fn new(
5829 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5830 ) -> Self {
5831 Self(RequestBuilder::new(stub))
5832 }
5833
5834 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5836 mut self,
5837 v: V,
5838 ) -> Self {
5839 self.0.request = v.into();
5840 self
5841 }
5842
5843 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5845 self.0.options = v.into();
5846 self
5847 }
5848
5849 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5856 (*self.0.stub)
5857 .delete_firewall_endpoint(self.0.request, self.0.options)
5858 .await
5859 .map(crate::Response::into_body)
5860 }
5861
5862 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5864 type Operation =
5865 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5866 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5867 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5868
5869 let stub = self.0.stub.clone();
5870 let mut options = self.0.options.clone();
5871 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5872 let query = move |name| {
5873 let stub = stub.clone();
5874 let options = options.clone();
5875 async {
5876 let op = GetOperation::new(stub)
5877 .set_name(name)
5878 .with_options(options)
5879 .send()
5880 .await?;
5881 Ok(Operation::new(op))
5882 }
5883 };
5884
5885 let start = move || async {
5886 let op = self.send().await?;
5887 Ok(Operation::new(op))
5888 };
5889
5890 google_cloud_lro::internal::new_unit_response_poller(
5891 polling_error_policy,
5892 polling_backoff_policy,
5893 start,
5894 query,
5895 )
5896 }
5897
5898 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5902 self.0.request.name = v.into();
5903 self
5904 }
5905
5906 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5908 self.0.request.request_id = v.into();
5909 self
5910 }
5911 }
5912
5913 #[doc(hidden)]
5914 impl crate::RequestBuilder for DeleteFirewallEndpoint {
5915 fn request_options(&mut self) -> &mut crate::RequestOptions {
5916 &mut self.0.options
5917 }
5918 }
5919
5920 #[derive(Clone, Debug)]
5938 pub struct DeleteProjectFirewallEndpoint(
5939 RequestBuilder<crate::model::DeleteFirewallEndpointRequest>,
5940 );
5941
5942 impl DeleteProjectFirewallEndpoint {
5943 pub(crate) fn new(
5944 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5945 ) -> Self {
5946 Self(RequestBuilder::new(stub))
5947 }
5948
5949 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5951 mut self,
5952 v: V,
5953 ) -> Self {
5954 self.0.request = v.into();
5955 self
5956 }
5957
5958 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5960 self.0.options = v.into();
5961 self
5962 }
5963
5964 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5971 (*self.0.stub)
5972 .delete_project_firewall_endpoint(self.0.request, self.0.options)
5973 .await
5974 .map(crate::Response::into_body)
5975 }
5976
5977 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5979 type Operation =
5980 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5981 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5982 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5983
5984 let stub = self.0.stub.clone();
5985 let mut options = self.0.options.clone();
5986 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5987 let query = move |name| {
5988 let stub = stub.clone();
5989 let options = options.clone();
5990 async {
5991 let op = GetOperation::new(stub)
5992 .set_name(name)
5993 .with_options(options)
5994 .send()
5995 .await?;
5996 Ok(Operation::new(op))
5997 }
5998 };
5999
6000 let start = move || async {
6001 let op = self.send().await?;
6002 Ok(Operation::new(op))
6003 };
6004
6005 google_cloud_lro::internal::new_unit_response_poller(
6006 polling_error_policy,
6007 polling_backoff_policy,
6008 start,
6009 query,
6010 )
6011 }
6012
6013 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6017 self.0.request.name = v.into();
6018 self
6019 }
6020
6021 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6023 self.0.request.request_id = v.into();
6024 self
6025 }
6026 }
6027
6028 #[doc(hidden)]
6029 impl crate::RequestBuilder for DeleteProjectFirewallEndpoint {
6030 fn request_options(&mut self) -> &mut crate::RequestOptions {
6031 &mut self.0.options
6032 }
6033 }
6034
6035 #[derive(Clone, Debug)]
6053 pub struct UpdateFirewallEndpoint(RequestBuilder<crate::model::UpdateFirewallEndpointRequest>);
6054
6055 impl UpdateFirewallEndpoint {
6056 pub(crate) fn new(
6057 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6058 ) -> Self {
6059 Self(RequestBuilder::new(stub))
6060 }
6061
6062 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
6064 mut self,
6065 v: V,
6066 ) -> Self {
6067 self.0.request = v.into();
6068 self
6069 }
6070
6071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6073 self.0.options = v.into();
6074 self
6075 }
6076
6077 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6084 (*self.0.stub)
6085 .update_firewall_endpoint(self.0.request, self.0.options)
6086 .await
6087 .map(crate::Response::into_body)
6088 }
6089
6090 pub fn poller(
6092 self,
6093 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
6094 {
6095 type Operation = google_cloud_lro::internal::Operation<
6096 crate::model::FirewallEndpoint,
6097 crate::model::OperationMetadata,
6098 >;
6099 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6100 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6101
6102 let stub = self.0.stub.clone();
6103 let mut options = self.0.options.clone();
6104 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6105 let query = move |name| {
6106 let stub = stub.clone();
6107 let options = options.clone();
6108 async {
6109 let op = GetOperation::new(stub)
6110 .set_name(name)
6111 .with_options(options)
6112 .send()
6113 .await?;
6114 Ok(Operation::new(op))
6115 }
6116 };
6117
6118 let start = move || async {
6119 let op = self.send().await?;
6120 Ok(Operation::new(op))
6121 };
6122
6123 google_cloud_lro::internal::new_poller(
6124 polling_error_policy,
6125 polling_backoff_policy,
6126 start,
6127 query,
6128 )
6129 }
6130
6131 pub fn set_update_mask<T>(mut self, v: T) -> Self
6135 where
6136 T: std::convert::Into<wkt::FieldMask>,
6137 {
6138 self.0.request.update_mask = std::option::Option::Some(v.into());
6139 self
6140 }
6141
6142 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6146 where
6147 T: std::convert::Into<wkt::FieldMask>,
6148 {
6149 self.0.request.update_mask = v.map(|x| x.into());
6150 self
6151 }
6152
6153 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
6157 where
6158 T: std::convert::Into<crate::model::FirewallEndpoint>,
6159 {
6160 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
6161 self
6162 }
6163
6164 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
6168 where
6169 T: std::convert::Into<crate::model::FirewallEndpoint>,
6170 {
6171 self.0.request.firewall_endpoint = v.map(|x| x.into());
6172 self
6173 }
6174
6175 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6177 self.0.request.request_id = v.into();
6178 self
6179 }
6180 }
6181
6182 #[doc(hidden)]
6183 impl crate::RequestBuilder for UpdateFirewallEndpoint {
6184 fn request_options(&mut self) -> &mut crate::RequestOptions {
6185 &mut self.0.options
6186 }
6187 }
6188
6189 #[derive(Clone, Debug)]
6207 pub struct UpdateProjectFirewallEndpoint(
6208 RequestBuilder<crate::model::UpdateFirewallEndpointRequest>,
6209 );
6210
6211 impl UpdateProjectFirewallEndpoint {
6212 pub(crate) fn new(
6213 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6214 ) -> Self {
6215 Self(RequestBuilder::new(stub))
6216 }
6217
6218 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
6220 mut self,
6221 v: V,
6222 ) -> Self {
6223 self.0.request = v.into();
6224 self
6225 }
6226
6227 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6229 self.0.options = v.into();
6230 self
6231 }
6232
6233 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6240 (*self.0.stub)
6241 .update_project_firewall_endpoint(self.0.request, self.0.options)
6242 .await
6243 .map(crate::Response::into_body)
6244 }
6245
6246 pub fn poller(
6248 self,
6249 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
6250 {
6251 type Operation = google_cloud_lro::internal::Operation<
6252 crate::model::FirewallEndpoint,
6253 crate::model::OperationMetadata,
6254 >;
6255 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6256 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6257
6258 let stub = self.0.stub.clone();
6259 let mut options = self.0.options.clone();
6260 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6261 let query = move |name| {
6262 let stub = stub.clone();
6263 let options = options.clone();
6264 async {
6265 let op = GetOperation::new(stub)
6266 .set_name(name)
6267 .with_options(options)
6268 .send()
6269 .await?;
6270 Ok(Operation::new(op))
6271 }
6272 };
6273
6274 let start = move || async {
6275 let op = self.send().await?;
6276 Ok(Operation::new(op))
6277 };
6278
6279 google_cloud_lro::internal::new_poller(
6280 polling_error_policy,
6281 polling_backoff_policy,
6282 start,
6283 query,
6284 )
6285 }
6286
6287 pub fn set_update_mask<T>(mut self, v: T) -> Self
6291 where
6292 T: std::convert::Into<wkt::FieldMask>,
6293 {
6294 self.0.request.update_mask = std::option::Option::Some(v.into());
6295 self
6296 }
6297
6298 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6302 where
6303 T: std::convert::Into<wkt::FieldMask>,
6304 {
6305 self.0.request.update_mask = v.map(|x| x.into());
6306 self
6307 }
6308
6309 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
6313 where
6314 T: std::convert::Into<crate::model::FirewallEndpoint>,
6315 {
6316 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
6317 self
6318 }
6319
6320 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
6324 where
6325 T: std::convert::Into<crate::model::FirewallEndpoint>,
6326 {
6327 self.0.request.firewall_endpoint = v.map(|x| x.into());
6328 self
6329 }
6330
6331 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6333 self.0.request.request_id = v.into();
6334 self
6335 }
6336 }
6337
6338 #[doc(hidden)]
6339 impl crate::RequestBuilder for UpdateProjectFirewallEndpoint {
6340 fn request_options(&mut self) -> &mut crate::RequestOptions {
6341 &mut self.0.options
6342 }
6343 }
6344
6345 #[derive(Clone, Debug)]
6366 pub struct ListFirewallEndpointAssociations(
6367 RequestBuilder<crate::model::ListFirewallEndpointAssociationsRequest>,
6368 );
6369
6370 impl ListFirewallEndpointAssociations {
6371 pub(crate) fn new(
6372 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6373 ) -> Self {
6374 Self(RequestBuilder::new(stub))
6375 }
6376
6377 pub fn with_request<V: Into<crate::model::ListFirewallEndpointAssociationsRequest>>(
6379 mut self,
6380 v: V,
6381 ) -> Self {
6382 self.0.request = v.into();
6383 self
6384 }
6385
6386 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6388 self.0.options = v.into();
6389 self
6390 }
6391
6392 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointAssociationsResponse> {
6394 (*self.0.stub)
6395 .list_firewall_endpoint_associations(self.0.request, self.0.options)
6396 .await
6397 .map(crate::Response::into_body)
6398 }
6399
6400 pub fn by_page(
6402 self,
6403 ) -> impl google_cloud_gax::paginator::Paginator<
6404 crate::model::ListFirewallEndpointAssociationsResponse,
6405 crate::Error,
6406 > {
6407 use std::clone::Clone;
6408 let token = self.0.request.page_token.clone();
6409 let execute = move |token: String| {
6410 let mut builder = self.clone();
6411 builder.0.request = builder.0.request.set_page_token(token);
6412 builder.send()
6413 };
6414 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6415 }
6416
6417 pub fn by_item(
6419 self,
6420 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6421 crate::model::ListFirewallEndpointAssociationsResponse,
6422 crate::Error,
6423 > {
6424 use google_cloud_gax::paginator::Paginator;
6425 self.by_page().items()
6426 }
6427
6428 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6432 self.0.request.parent = v.into();
6433 self
6434 }
6435
6436 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6438 self.0.request.page_size = v.into();
6439 self
6440 }
6441
6442 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6444 self.0.request.page_token = v.into();
6445 self
6446 }
6447
6448 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6450 self.0.request.filter = v.into();
6451 self
6452 }
6453
6454 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6456 self.0.request.order_by = v.into();
6457 self
6458 }
6459 }
6460
6461 #[doc(hidden)]
6462 impl crate::RequestBuilder for ListFirewallEndpointAssociations {
6463 fn request_options(&mut self) -> &mut crate::RequestOptions {
6464 &mut self.0.options
6465 }
6466 }
6467
6468 #[derive(Clone, Debug)]
6485 pub struct GetFirewallEndpointAssociation(
6486 RequestBuilder<crate::model::GetFirewallEndpointAssociationRequest>,
6487 );
6488
6489 impl GetFirewallEndpointAssociation {
6490 pub(crate) fn new(
6491 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6492 ) -> Self {
6493 Self(RequestBuilder::new(stub))
6494 }
6495
6496 pub fn with_request<V: Into<crate::model::GetFirewallEndpointAssociationRequest>>(
6498 mut self,
6499 v: V,
6500 ) -> Self {
6501 self.0.request = v.into();
6502 self
6503 }
6504
6505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6507 self.0.options = v.into();
6508 self
6509 }
6510
6511 pub async fn send(self) -> Result<crate::model::FirewallEndpointAssociation> {
6513 (*self.0.stub)
6514 .get_firewall_endpoint_association(self.0.request, self.0.options)
6515 .await
6516 .map(crate::Response::into_body)
6517 }
6518
6519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6523 self.0.request.name = v.into();
6524 self
6525 }
6526 }
6527
6528 #[doc(hidden)]
6529 impl crate::RequestBuilder for GetFirewallEndpointAssociation {
6530 fn request_options(&mut self) -> &mut crate::RequestOptions {
6531 &mut self.0.options
6532 }
6533 }
6534
6535 #[derive(Clone, Debug)]
6553 pub struct CreateFirewallEndpointAssociation(
6554 RequestBuilder<crate::model::CreateFirewallEndpointAssociationRequest>,
6555 );
6556
6557 impl CreateFirewallEndpointAssociation {
6558 pub(crate) fn new(
6559 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6560 ) -> Self {
6561 Self(RequestBuilder::new(stub))
6562 }
6563
6564 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointAssociationRequest>>(
6566 mut self,
6567 v: V,
6568 ) -> Self {
6569 self.0.request = v.into();
6570 self
6571 }
6572
6573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6575 self.0.options = v.into();
6576 self
6577 }
6578
6579 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6586 (*self.0.stub)
6587 .create_firewall_endpoint_association(self.0.request, self.0.options)
6588 .await
6589 .map(crate::Response::into_body)
6590 }
6591
6592 pub fn poller(
6594 self,
6595 ) -> impl google_cloud_lro::Poller<
6596 crate::model::FirewallEndpointAssociation,
6597 crate::model::OperationMetadata,
6598 > {
6599 type Operation = google_cloud_lro::internal::Operation<
6600 crate::model::FirewallEndpointAssociation,
6601 crate::model::OperationMetadata,
6602 >;
6603 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6604 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6605
6606 let stub = self.0.stub.clone();
6607 let mut options = self.0.options.clone();
6608 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6609 let query = move |name| {
6610 let stub = stub.clone();
6611 let options = options.clone();
6612 async {
6613 let op = GetOperation::new(stub)
6614 .set_name(name)
6615 .with_options(options)
6616 .send()
6617 .await?;
6618 Ok(Operation::new(op))
6619 }
6620 };
6621
6622 let start = move || async {
6623 let op = self.send().await?;
6624 Ok(Operation::new(op))
6625 };
6626
6627 google_cloud_lro::internal::new_poller(
6628 polling_error_policy,
6629 polling_backoff_policy,
6630 start,
6631 query,
6632 )
6633 }
6634
6635 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6639 self.0.request.parent = v.into();
6640 self
6641 }
6642
6643 pub fn set_firewall_endpoint_association_id<T: Into<std::string::String>>(
6645 mut self,
6646 v: T,
6647 ) -> Self {
6648 self.0.request.firewall_endpoint_association_id = v.into();
6649 self
6650 }
6651
6652 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6656 where
6657 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6658 {
6659 self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6660 self
6661 }
6662
6663 pub fn set_or_clear_firewall_endpoint_association<T>(
6667 mut self,
6668 v: std::option::Option<T>,
6669 ) -> Self
6670 where
6671 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6672 {
6673 self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6674 self
6675 }
6676
6677 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6679 self.0.request.request_id = v.into();
6680 self
6681 }
6682 }
6683
6684 #[doc(hidden)]
6685 impl crate::RequestBuilder for CreateFirewallEndpointAssociation {
6686 fn request_options(&mut self) -> &mut crate::RequestOptions {
6687 &mut self.0.options
6688 }
6689 }
6690
6691 #[derive(Clone, Debug)]
6709 pub struct DeleteFirewallEndpointAssociation(
6710 RequestBuilder<crate::model::DeleteFirewallEndpointAssociationRequest>,
6711 );
6712
6713 impl DeleteFirewallEndpointAssociation {
6714 pub(crate) fn new(
6715 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6716 ) -> Self {
6717 Self(RequestBuilder::new(stub))
6718 }
6719
6720 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointAssociationRequest>>(
6722 mut self,
6723 v: V,
6724 ) -> Self {
6725 self.0.request = v.into();
6726 self
6727 }
6728
6729 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6731 self.0.options = v.into();
6732 self
6733 }
6734
6735 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6742 (*self.0.stub)
6743 .delete_firewall_endpoint_association(self.0.request, self.0.options)
6744 .await
6745 .map(crate::Response::into_body)
6746 }
6747
6748 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6750 type Operation =
6751 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6752 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6753 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6754
6755 let stub = self.0.stub.clone();
6756 let mut options = self.0.options.clone();
6757 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6758 let query = move |name| {
6759 let stub = stub.clone();
6760 let options = options.clone();
6761 async {
6762 let op = GetOperation::new(stub)
6763 .set_name(name)
6764 .with_options(options)
6765 .send()
6766 .await?;
6767 Ok(Operation::new(op))
6768 }
6769 };
6770
6771 let start = move || async {
6772 let op = self.send().await?;
6773 Ok(Operation::new(op))
6774 };
6775
6776 google_cloud_lro::internal::new_unit_response_poller(
6777 polling_error_policy,
6778 polling_backoff_policy,
6779 start,
6780 query,
6781 )
6782 }
6783
6784 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6788 self.0.request.name = v.into();
6789 self
6790 }
6791
6792 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6794 self.0.request.request_id = v.into();
6795 self
6796 }
6797 }
6798
6799 #[doc(hidden)]
6800 impl crate::RequestBuilder for DeleteFirewallEndpointAssociation {
6801 fn request_options(&mut self) -> &mut crate::RequestOptions {
6802 &mut self.0.options
6803 }
6804 }
6805
6806 #[derive(Clone, Debug)]
6824 pub struct UpdateFirewallEndpointAssociation(
6825 RequestBuilder<crate::model::UpdateFirewallEndpointAssociationRequest>,
6826 );
6827
6828 impl UpdateFirewallEndpointAssociation {
6829 pub(crate) fn new(
6830 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6831 ) -> Self {
6832 Self(RequestBuilder::new(stub))
6833 }
6834
6835 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointAssociationRequest>>(
6837 mut self,
6838 v: V,
6839 ) -> Self {
6840 self.0.request = v.into();
6841 self
6842 }
6843
6844 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6846 self.0.options = v.into();
6847 self
6848 }
6849
6850 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6857 (*self.0.stub)
6858 .update_firewall_endpoint_association(self.0.request, self.0.options)
6859 .await
6860 .map(crate::Response::into_body)
6861 }
6862
6863 pub fn poller(
6865 self,
6866 ) -> impl google_cloud_lro::Poller<
6867 crate::model::FirewallEndpointAssociation,
6868 crate::model::OperationMetadata,
6869 > {
6870 type Operation = google_cloud_lro::internal::Operation<
6871 crate::model::FirewallEndpointAssociation,
6872 crate::model::OperationMetadata,
6873 >;
6874 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6875 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6876
6877 let stub = self.0.stub.clone();
6878 let mut options = self.0.options.clone();
6879 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6880 let query = move |name| {
6881 let stub = stub.clone();
6882 let options = options.clone();
6883 async {
6884 let op = GetOperation::new(stub)
6885 .set_name(name)
6886 .with_options(options)
6887 .send()
6888 .await?;
6889 Ok(Operation::new(op))
6890 }
6891 };
6892
6893 let start = move || async {
6894 let op = self.send().await?;
6895 Ok(Operation::new(op))
6896 };
6897
6898 google_cloud_lro::internal::new_poller(
6899 polling_error_policy,
6900 polling_backoff_policy,
6901 start,
6902 query,
6903 )
6904 }
6905
6906 pub fn set_update_mask<T>(mut self, v: T) -> Self
6910 where
6911 T: std::convert::Into<wkt::FieldMask>,
6912 {
6913 self.0.request.update_mask = std::option::Option::Some(v.into());
6914 self
6915 }
6916
6917 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6921 where
6922 T: std::convert::Into<wkt::FieldMask>,
6923 {
6924 self.0.request.update_mask = v.map(|x| x.into());
6925 self
6926 }
6927
6928 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6932 where
6933 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6934 {
6935 self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6936 self
6937 }
6938
6939 pub fn set_or_clear_firewall_endpoint_association<T>(
6943 mut self,
6944 v: std::option::Option<T>,
6945 ) -> Self
6946 where
6947 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6948 {
6949 self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6950 self
6951 }
6952
6953 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6955 self.0.request.request_id = v.into();
6956 self
6957 }
6958 }
6959
6960 #[doc(hidden)]
6961 impl crate::RequestBuilder for UpdateFirewallEndpointAssociation {
6962 fn request_options(&mut self) -> &mut crate::RequestOptions {
6963 &mut self.0.options
6964 }
6965 }
6966
6967 #[derive(Clone, Debug)]
6988 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6989
6990 impl ListLocations {
6991 pub(crate) fn new(
6992 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6993 ) -> Self {
6994 Self(RequestBuilder::new(stub))
6995 }
6996
6997 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6999 mut self,
7000 v: V,
7001 ) -> Self {
7002 self.0.request = v.into();
7003 self
7004 }
7005
7006 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7008 self.0.options = v.into();
7009 self
7010 }
7011
7012 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7014 (*self.0.stub)
7015 .list_locations(self.0.request, self.0.options)
7016 .await
7017 .map(crate::Response::into_body)
7018 }
7019
7020 pub fn by_page(
7022 self,
7023 ) -> impl google_cloud_gax::paginator::Paginator<
7024 google_cloud_location::model::ListLocationsResponse,
7025 crate::Error,
7026 > {
7027 use std::clone::Clone;
7028 let token = self.0.request.page_token.clone();
7029 let execute = move |token: String| {
7030 let mut builder = self.clone();
7031 builder.0.request = builder.0.request.set_page_token(token);
7032 builder.send()
7033 };
7034 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7035 }
7036
7037 pub fn by_item(
7039 self,
7040 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7041 google_cloud_location::model::ListLocationsResponse,
7042 crate::Error,
7043 > {
7044 use google_cloud_gax::paginator::Paginator;
7045 self.by_page().items()
7046 }
7047
7048 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7050 self.0.request.name = v.into();
7051 self
7052 }
7053
7054 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7056 self.0.request.filter = v.into();
7057 self
7058 }
7059
7060 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7062 self.0.request.page_size = v.into();
7063 self
7064 }
7065
7066 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7068 self.0.request.page_token = v.into();
7069 self
7070 }
7071 }
7072
7073 #[doc(hidden)]
7074 impl crate::RequestBuilder for ListLocations {
7075 fn request_options(&mut self) -> &mut crate::RequestOptions {
7076 &mut self.0.options
7077 }
7078 }
7079
7080 #[derive(Clone, Debug)]
7097 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7098
7099 impl GetLocation {
7100 pub(crate) fn new(
7101 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7102 ) -> Self {
7103 Self(RequestBuilder::new(stub))
7104 }
7105
7106 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7108 mut self,
7109 v: V,
7110 ) -> Self {
7111 self.0.request = v.into();
7112 self
7113 }
7114
7115 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7117 self.0.options = v.into();
7118 self
7119 }
7120
7121 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7123 (*self.0.stub)
7124 .get_location(self.0.request, self.0.options)
7125 .await
7126 .map(crate::Response::into_body)
7127 }
7128
7129 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7131 self.0.request.name = v.into();
7132 self
7133 }
7134 }
7135
7136 #[doc(hidden)]
7137 impl crate::RequestBuilder for GetLocation {
7138 fn request_options(&mut self) -> &mut crate::RequestOptions {
7139 &mut self.0.options
7140 }
7141 }
7142
7143 #[derive(Clone, Debug)]
7160 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
7161
7162 impl SetIamPolicy {
7163 pub(crate) fn new(
7164 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7165 ) -> Self {
7166 Self(RequestBuilder::new(stub))
7167 }
7168
7169 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
7171 mut self,
7172 v: V,
7173 ) -> Self {
7174 self.0.request = v.into();
7175 self
7176 }
7177
7178 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7180 self.0.options = v.into();
7181 self
7182 }
7183
7184 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7186 (*self.0.stub)
7187 .set_iam_policy(self.0.request, self.0.options)
7188 .await
7189 .map(crate::Response::into_body)
7190 }
7191
7192 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7196 self.0.request.resource = v.into();
7197 self
7198 }
7199
7200 pub fn set_policy<T>(mut self, v: T) -> Self
7204 where
7205 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7206 {
7207 self.0.request.policy = std::option::Option::Some(v.into());
7208 self
7209 }
7210
7211 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7215 where
7216 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7217 {
7218 self.0.request.policy = v.map(|x| x.into());
7219 self
7220 }
7221
7222 pub fn set_update_mask<T>(mut self, v: T) -> Self
7224 where
7225 T: std::convert::Into<wkt::FieldMask>,
7226 {
7227 self.0.request.update_mask = std::option::Option::Some(v.into());
7228 self
7229 }
7230
7231 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7233 where
7234 T: std::convert::Into<wkt::FieldMask>,
7235 {
7236 self.0.request.update_mask = v.map(|x| x.into());
7237 self
7238 }
7239 }
7240
7241 #[doc(hidden)]
7242 impl crate::RequestBuilder for SetIamPolicy {
7243 fn request_options(&mut self) -> &mut crate::RequestOptions {
7244 &mut self.0.options
7245 }
7246 }
7247
7248 #[derive(Clone, Debug)]
7265 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
7266
7267 impl GetIamPolicy {
7268 pub(crate) fn new(
7269 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7270 ) -> Self {
7271 Self(RequestBuilder::new(stub))
7272 }
7273
7274 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
7276 mut self,
7277 v: V,
7278 ) -> Self {
7279 self.0.request = v.into();
7280 self
7281 }
7282
7283 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7285 self.0.options = v.into();
7286 self
7287 }
7288
7289 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7291 (*self.0.stub)
7292 .get_iam_policy(self.0.request, self.0.options)
7293 .await
7294 .map(crate::Response::into_body)
7295 }
7296
7297 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7301 self.0.request.resource = v.into();
7302 self
7303 }
7304
7305 pub fn set_options<T>(mut self, v: T) -> Self
7307 where
7308 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7309 {
7310 self.0.request.options = std::option::Option::Some(v.into());
7311 self
7312 }
7313
7314 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7316 where
7317 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7318 {
7319 self.0.request.options = v.map(|x| x.into());
7320 self
7321 }
7322 }
7323
7324 #[doc(hidden)]
7325 impl crate::RequestBuilder for GetIamPolicy {
7326 fn request_options(&mut self) -> &mut crate::RequestOptions {
7327 &mut self.0.options
7328 }
7329 }
7330
7331 #[derive(Clone, Debug)]
7348 pub struct TestIamPermissions(
7349 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
7350 );
7351
7352 impl TestIamPermissions {
7353 pub(crate) fn new(
7354 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7355 ) -> Self {
7356 Self(RequestBuilder::new(stub))
7357 }
7358
7359 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
7361 mut self,
7362 v: V,
7363 ) -> Self {
7364 self.0.request = v.into();
7365 self
7366 }
7367
7368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7370 self.0.options = v.into();
7371 self
7372 }
7373
7374 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
7376 (*self.0.stub)
7377 .test_iam_permissions(self.0.request, self.0.options)
7378 .await
7379 .map(crate::Response::into_body)
7380 }
7381
7382 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7386 self.0.request.resource = v.into();
7387 self
7388 }
7389
7390 pub fn set_permissions<T, V>(mut self, v: T) -> Self
7394 where
7395 T: std::iter::IntoIterator<Item = V>,
7396 V: std::convert::Into<std::string::String>,
7397 {
7398 use std::iter::Iterator;
7399 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7400 self
7401 }
7402 }
7403
7404 #[doc(hidden)]
7405 impl crate::RequestBuilder for TestIamPermissions {
7406 fn request_options(&mut self) -> &mut crate::RequestOptions {
7407 &mut self.0.options
7408 }
7409 }
7410
7411 #[derive(Clone, Debug)]
7432 pub struct ListOperations(
7433 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7434 );
7435
7436 impl ListOperations {
7437 pub(crate) fn new(
7438 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7439 ) -> Self {
7440 Self(RequestBuilder::new(stub))
7441 }
7442
7443 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7445 mut self,
7446 v: V,
7447 ) -> Self {
7448 self.0.request = v.into();
7449 self
7450 }
7451
7452 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7454 self.0.options = v.into();
7455 self
7456 }
7457
7458 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7460 (*self.0.stub)
7461 .list_operations(self.0.request, self.0.options)
7462 .await
7463 .map(crate::Response::into_body)
7464 }
7465
7466 pub fn by_page(
7468 self,
7469 ) -> impl google_cloud_gax::paginator::Paginator<
7470 google_cloud_longrunning::model::ListOperationsResponse,
7471 crate::Error,
7472 > {
7473 use std::clone::Clone;
7474 let token = self.0.request.page_token.clone();
7475 let execute = move |token: String| {
7476 let mut builder = self.clone();
7477 builder.0.request = builder.0.request.set_page_token(token);
7478 builder.send()
7479 };
7480 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7481 }
7482
7483 pub fn by_item(
7485 self,
7486 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7487 google_cloud_longrunning::model::ListOperationsResponse,
7488 crate::Error,
7489 > {
7490 use google_cloud_gax::paginator::Paginator;
7491 self.by_page().items()
7492 }
7493
7494 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7496 self.0.request.name = v.into();
7497 self
7498 }
7499
7500 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7502 self.0.request.filter = v.into();
7503 self
7504 }
7505
7506 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7508 self.0.request.page_size = v.into();
7509 self
7510 }
7511
7512 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7514 self.0.request.page_token = v.into();
7515 self
7516 }
7517
7518 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7520 self.0.request.return_partial_success = v.into();
7521 self
7522 }
7523 }
7524
7525 #[doc(hidden)]
7526 impl crate::RequestBuilder for ListOperations {
7527 fn request_options(&mut self) -> &mut crate::RequestOptions {
7528 &mut self.0.options
7529 }
7530 }
7531
7532 #[derive(Clone, Debug)]
7549 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7550
7551 impl GetOperation {
7552 pub(crate) fn new(
7553 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7554 ) -> Self {
7555 Self(RequestBuilder::new(stub))
7556 }
7557
7558 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7560 mut self,
7561 v: V,
7562 ) -> Self {
7563 self.0.request = v.into();
7564 self
7565 }
7566
7567 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7569 self.0.options = v.into();
7570 self
7571 }
7572
7573 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7575 (*self.0.stub)
7576 .get_operation(self.0.request, self.0.options)
7577 .await
7578 .map(crate::Response::into_body)
7579 }
7580
7581 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7583 self.0.request.name = v.into();
7584 self
7585 }
7586 }
7587
7588 #[doc(hidden)]
7589 impl crate::RequestBuilder for GetOperation {
7590 fn request_options(&mut self) -> &mut crate::RequestOptions {
7591 &mut self.0.options
7592 }
7593 }
7594
7595 #[derive(Clone, Debug)]
7612 pub struct DeleteOperation(
7613 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7614 );
7615
7616 impl DeleteOperation {
7617 pub(crate) fn new(
7618 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7619 ) -> Self {
7620 Self(RequestBuilder::new(stub))
7621 }
7622
7623 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7625 mut self,
7626 v: V,
7627 ) -> Self {
7628 self.0.request = v.into();
7629 self
7630 }
7631
7632 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7634 self.0.options = v.into();
7635 self
7636 }
7637
7638 pub async fn send(self) -> Result<()> {
7640 (*self.0.stub)
7641 .delete_operation(self.0.request, self.0.options)
7642 .await
7643 .map(crate::Response::into_body)
7644 }
7645
7646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7648 self.0.request.name = v.into();
7649 self
7650 }
7651 }
7652
7653 #[doc(hidden)]
7654 impl crate::RequestBuilder for DeleteOperation {
7655 fn request_options(&mut self) -> &mut crate::RequestOptions {
7656 &mut self.0.options
7657 }
7658 }
7659
7660 #[derive(Clone, Debug)]
7677 pub struct CancelOperation(
7678 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7679 );
7680
7681 impl CancelOperation {
7682 pub(crate) fn new(
7683 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7684 ) -> Self {
7685 Self(RequestBuilder::new(stub))
7686 }
7687
7688 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7690 mut self,
7691 v: V,
7692 ) -> Self {
7693 self.0.request = v.into();
7694 self
7695 }
7696
7697 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7699 self.0.options = v.into();
7700 self
7701 }
7702
7703 pub async fn send(self) -> Result<()> {
7705 (*self.0.stub)
7706 .cancel_operation(self.0.request, self.0.options)
7707 .await
7708 .map(crate::Response::into_body)
7709 }
7710
7711 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7713 self.0.request.name = v.into();
7714 self
7715 }
7716 }
7717
7718 #[doc(hidden)]
7719 impl crate::RequestBuilder for CancelOperation {
7720 fn request_options(&mut self) -> &mut crate::RequestOptions {
7721 &mut self.0.options
7722 }
7723 }
7724}
7725
7726pub mod intercept {
7728 use crate::Result;
7729
7730 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7744
7745 pub(crate) mod client {
7746 use super::super::super::client::Intercept;
7747 pub struct Factory;
7748 impl crate::ClientFactory for Factory {
7749 type Client = Intercept;
7750 type Credentials = gaxi::options::Credentials;
7751 async fn build(
7752 self,
7753 config: gaxi::options::ClientConfig,
7754 ) -> crate::ClientBuilderResult<Self::Client> {
7755 Self::Client::new(config).await
7756 }
7757 }
7758 }
7759
7760 #[derive(Clone, Debug)]
7762 pub(crate) struct RequestBuilder<R: std::default::Default> {
7763 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7764 request: R,
7765 options: crate::RequestOptions,
7766 }
7767
7768 impl<R> RequestBuilder<R>
7769 where
7770 R: std::default::Default,
7771 {
7772 pub(crate) fn new(
7773 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7774 ) -> Self {
7775 Self {
7776 stub,
7777 request: R::default(),
7778 options: crate::RequestOptions::default(),
7779 }
7780 }
7781 }
7782
7783 #[derive(Clone, Debug)]
7804 pub struct ListInterceptEndpointGroups(
7805 RequestBuilder<crate::model::ListInterceptEndpointGroupsRequest>,
7806 );
7807
7808 impl ListInterceptEndpointGroups {
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<V: Into<crate::model::ListInterceptEndpointGroupsRequest>>(
7817 mut self,
7818 v: V,
7819 ) -> Self {
7820 self.0.request = v.into();
7821 self
7822 }
7823
7824 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7826 self.0.options = v.into();
7827 self
7828 }
7829
7830 pub async fn send(self) -> Result<crate::model::ListInterceptEndpointGroupsResponse> {
7832 (*self.0.stub)
7833 .list_intercept_endpoint_groups(self.0.request, self.0.options)
7834 .await
7835 .map(crate::Response::into_body)
7836 }
7837
7838 pub fn by_page(
7840 self,
7841 ) -> impl google_cloud_gax::paginator::Paginator<
7842 crate::model::ListInterceptEndpointGroupsResponse,
7843 crate::Error,
7844 > {
7845 use std::clone::Clone;
7846 let token = self.0.request.page_token.clone();
7847 let execute = move |token: String| {
7848 let mut builder = self.clone();
7849 builder.0.request = builder.0.request.set_page_token(token);
7850 builder.send()
7851 };
7852 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7853 }
7854
7855 pub fn by_item(
7857 self,
7858 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7859 crate::model::ListInterceptEndpointGroupsResponse,
7860 crate::Error,
7861 > {
7862 use google_cloud_gax::paginator::Paginator;
7863 self.by_page().items()
7864 }
7865
7866 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7870 self.0.request.parent = v.into();
7871 self
7872 }
7873
7874 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7876 self.0.request.page_size = v.into();
7877 self
7878 }
7879
7880 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7882 self.0.request.page_token = v.into();
7883 self
7884 }
7885
7886 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7888 self.0.request.filter = v.into();
7889 self
7890 }
7891
7892 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7894 self.0.request.order_by = v.into();
7895 self
7896 }
7897 }
7898
7899 #[doc(hidden)]
7900 impl crate::RequestBuilder for ListInterceptEndpointGroups {
7901 fn request_options(&mut self) -> &mut crate::RequestOptions {
7902 &mut self.0.options
7903 }
7904 }
7905
7906 #[derive(Clone, Debug)]
7923 pub struct GetInterceptEndpointGroup(
7924 RequestBuilder<crate::model::GetInterceptEndpointGroupRequest>,
7925 );
7926
7927 impl GetInterceptEndpointGroup {
7928 pub(crate) fn new(
7929 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7930 ) -> Self {
7931 Self(RequestBuilder::new(stub))
7932 }
7933
7934 pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupRequest>>(
7936 mut self,
7937 v: V,
7938 ) -> Self {
7939 self.0.request = v.into();
7940 self
7941 }
7942
7943 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7945 self.0.options = v.into();
7946 self
7947 }
7948
7949 pub async fn send(self) -> Result<crate::model::InterceptEndpointGroup> {
7951 (*self.0.stub)
7952 .get_intercept_endpoint_group(self.0.request, self.0.options)
7953 .await
7954 .map(crate::Response::into_body)
7955 }
7956
7957 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7961 self.0.request.name = v.into();
7962 self
7963 }
7964 }
7965
7966 #[doc(hidden)]
7967 impl crate::RequestBuilder for GetInterceptEndpointGroup {
7968 fn request_options(&mut self) -> &mut crate::RequestOptions {
7969 &mut self.0.options
7970 }
7971 }
7972
7973 #[derive(Clone, Debug)]
7991 pub struct CreateInterceptEndpointGroup(
7992 RequestBuilder<crate::model::CreateInterceptEndpointGroupRequest>,
7993 );
7994
7995 impl CreateInterceptEndpointGroup {
7996 pub(crate) fn new(
7997 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7998 ) -> Self {
7999 Self(RequestBuilder::new(stub))
8000 }
8001
8002 pub fn with_request<V: Into<crate::model::CreateInterceptEndpointGroupRequest>>(
8004 mut self,
8005 v: V,
8006 ) -> Self {
8007 self.0.request = v.into();
8008 self
8009 }
8010
8011 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8013 self.0.options = v.into();
8014 self
8015 }
8016
8017 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8024 (*self.0.stub)
8025 .create_intercept_endpoint_group(self.0.request, self.0.options)
8026 .await
8027 .map(crate::Response::into_body)
8028 }
8029
8030 pub fn poller(
8032 self,
8033 ) -> impl google_cloud_lro::Poller<
8034 crate::model::InterceptEndpointGroup,
8035 crate::model::OperationMetadata,
8036 > {
8037 type Operation = google_cloud_lro::internal::Operation<
8038 crate::model::InterceptEndpointGroup,
8039 crate::model::OperationMetadata,
8040 >;
8041 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8042 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8043
8044 let stub = self.0.stub.clone();
8045 let mut options = self.0.options.clone();
8046 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8047 let query = move |name| {
8048 let stub = stub.clone();
8049 let options = options.clone();
8050 async {
8051 let op = GetOperation::new(stub)
8052 .set_name(name)
8053 .with_options(options)
8054 .send()
8055 .await?;
8056 Ok(Operation::new(op))
8057 }
8058 };
8059
8060 let start = move || async {
8061 let op = self.send().await?;
8062 Ok(Operation::new(op))
8063 };
8064
8065 google_cloud_lro::internal::new_poller(
8066 polling_error_policy,
8067 polling_backoff_policy,
8068 start,
8069 query,
8070 )
8071 }
8072
8073 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8077 self.0.request.parent = v.into();
8078 self
8079 }
8080
8081 pub fn set_intercept_endpoint_group_id<T: Into<std::string::String>>(
8085 mut self,
8086 v: T,
8087 ) -> Self {
8088 self.0.request.intercept_endpoint_group_id = v.into();
8089 self
8090 }
8091
8092 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
8096 where
8097 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8098 {
8099 self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
8100 self
8101 }
8102
8103 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
8107 where
8108 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8109 {
8110 self.0.request.intercept_endpoint_group = v.map(|x| x.into());
8111 self
8112 }
8113
8114 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8116 self.0.request.request_id = v.into();
8117 self
8118 }
8119 }
8120
8121 #[doc(hidden)]
8122 impl crate::RequestBuilder for CreateInterceptEndpointGroup {
8123 fn request_options(&mut self) -> &mut crate::RequestOptions {
8124 &mut self.0.options
8125 }
8126 }
8127
8128 #[derive(Clone, Debug)]
8146 pub struct UpdateInterceptEndpointGroup(
8147 RequestBuilder<crate::model::UpdateInterceptEndpointGroupRequest>,
8148 );
8149
8150 impl UpdateInterceptEndpointGroup {
8151 pub(crate) fn new(
8152 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8153 ) -> Self {
8154 Self(RequestBuilder::new(stub))
8155 }
8156
8157 pub fn with_request<V: Into<crate::model::UpdateInterceptEndpointGroupRequest>>(
8159 mut self,
8160 v: V,
8161 ) -> Self {
8162 self.0.request = v.into();
8163 self
8164 }
8165
8166 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8168 self.0.options = v.into();
8169 self
8170 }
8171
8172 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8179 (*self.0.stub)
8180 .update_intercept_endpoint_group(self.0.request, self.0.options)
8181 .await
8182 .map(crate::Response::into_body)
8183 }
8184
8185 pub fn poller(
8187 self,
8188 ) -> impl google_cloud_lro::Poller<
8189 crate::model::InterceptEndpointGroup,
8190 crate::model::OperationMetadata,
8191 > {
8192 type Operation = google_cloud_lro::internal::Operation<
8193 crate::model::InterceptEndpointGroup,
8194 crate::model::OperationMetadata,
8195 >;
8196 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8197 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8198
8199 let stub = self.0.stub.clone();
8200 let mut options = self.0.options.clone();
8201 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8202 let query = move |name| {
8203 let stub = stub.clone();
8204 let options = options.clone();
8205 async {
8206 let op = GetOperation::new(stub)
8207 .set_name(name)
8208 .with_options(options)
8209 .send()
8210 .await?;
8211 Ok(Operation::new(op))
8212 }
8213 };
8214
8215 let start = move || async {
8216 let op = self.send().await?;
8217 Ok(Operation::new(op))
8218 };
8219
8220 google_cloud_lro::internal::new_poller(
8221 polling_error_policy,
8222 polling_backoff_policy,
8223 start,
8224 query,
8225 )
8226 }
8227
8228 pub fn set_update_mask<T>(mut self, v: T) -> Self
8230 where
8231 T: std::convert::Into<wkt::FieldMask>,
8232 {
8233 self.0.request.update_mask = std::option::Option::Some(v.into());
8234 self
8235 }
8236
8237 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8239 where
8240 T: std::convert::Into<wkt::FieldMask>,
8241 {
8242 self.0.request.update_mask = v.map(|x| x.into());
8243 self
8244 }
8245
8246 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
8250 where
8251 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8252 {
8253 self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
8254 self
8255 }
8256
8257 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
8261 where
8262 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8263 {
8264 self.0.request.intercept_endpoint_group = v.map(|x| x.into());
8265 self
8266 }
8267
8268 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8270 self.0.request.request_id = v.into();
8271 self
8272 }
8273 }
8274
8275 #[doc(hidden)]
8276 impl crate::RequestBuilder for UpdateInterceptEndpointGroup {
8277 fn request_options(&mut self) -> &mut crate::RequestOptions {
8278 &mut self.0.options
8279 }
8280 }
8281
8282 #[derive(Clone, Debug)]
8300 pub struct DeleteInterceptEndpointGroup(
8301 RequestBuilder<crate::model::DeleteInterceptEndpointGroupRequest>,
8302 );
8303
8304 impl DeleteInterceptEndpointGroup {
8305 pub(crate) fn new(
8306 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8307 ) -> Self {
8308 Self(RequestBuilder::new(stub))
8309 }
8310
8311 pub fn with_request<V: Into<crate::model::DeleteInterceptEndpointGroupRequest>>(
8313 mut self,
8314 v: V,
8315 ) -> Self {
8316 self.0.request = v.into();
8317 self
8318 }
8319
8320 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8322 self.0.options = v.into();
8323 self
8324 }
8325
8326 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8333 (*self.0.stub)
8334 .delete_intercept_endpoint_group(self.0.request, self.0.options)
8335 .await
8336 .map(crate::Response::into_body)
8337 }
8338
8339 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8341 type Operation =
8342 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8343 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8344 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8345
8346 let stub = self.0.stub.clone();
8347 let mut options = self.0.options.clone();
8348 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8349 let query = move |name| {
8350 let stub = stub.clone();
8351 let options = options.clone();
8352 async {
8353 let op = GetOperation::new(stub)
8354 .set_name(name)
8355 .with_options(options)
8356 .send()
8357 .await?;
8358 Ok(Operation::new(op))
8359 }
8360 };
8361
8362 let start = move || async {
8363 let op = self.send().await?;
8364 Ok(Operation::new(op))
8365 };
8366
8367 google_cloud_lro::internal::new_unit_response_poller(
8368 polling_error_policy,
8369 polling_backoff_policy,
8370 start,
8371 query,
8372 )
8373 }
8374
8375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8379 self.0.request.name = v.into();
8380 self
8381 }
8382
8383 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8385 self.0.request.request_id = v.into();
8386 self
8387 }
8388 }
8389
8390 #[doc(hidden)]
8391 impl crate::RequestBuilder for DeleteInterceptEndpointGroup {
8392 fn request_options(&mut self) -> &mut crate::RequestOptions {
8393 &mut self.0.options
8394 }
8395 }
8396
8397 #[derive(Clone, Debug)]
8418 pub struct ListInterceptEndpointGroupAssociations(
8419 RequestBuilder<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
8420 );
8421
8422 impl ListInterceptEndpointGroupAssociations {
8423 pub(crate) fn new(
8424 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8425 ) -> Self {
8426 Self(RequestBuilder::new(stub))
8427 }
8428
8429 pub fn with_request<
8431 V: Into<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
8432 >(
8433 mut self,
8434 v: V,
8435 ) -> Self {
8436 self.0.request = v.into();
8437 self
8438 }
8439
8440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8442 self.0.options = v.into();
8443 self
8444 }
8445
8446 pub async fn send(
8448 self,
8449 ) -> Result<crate::model::ListInterceptEndpointGroupAssociationsResponse> {
8450 (*self.0.stub)
8451 .list_intercept_endpoint_group_associations(self.0.request, self.0.options)
8452 .await
8453 .map(crate::Response::into_body)
8454 }
8455
8456 pub fn by_page(
8458 self,
8459 ) -> impl google_cloud_gax::paginator::Paginator<
8460 crate::model::ListInterceptEndpointGroupAssociationsResponse,
8461 crate::Error,
8462 > {
8463 use std::clone::Clone;
8464 let token = self.0.request.page_token.clone();
8465 let execute = move |token: String| {
8466 let mut builder = self.clone();
8467 builder.0.request = builder.0.request.set_page_token(token);
8468 builder.send()
8469 };
8470 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8471 }
8472
8473 pub fn by_item(
8475 self,
8476 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8477 crate::model::ListInterceptEndpointGroupAssociationsResponse,
8478 crate::Error,
8479 > {
8480 use google_cloud_gax::paginator::Paginator;
8481 self.by_page().items()
8482 }
8483
8484 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8488 self.0.request.parent = v.into();
8489 self
8490 }
8491
8492 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8494 self.0.request.page_size = v.into();
8495 self
8496 }
8497
8498 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8500 self.0.request.page_token = v.into();
8501 self
8502 }
8503
8504 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8506 self.0.request.filter = v.into();
8507 self
8508 }
8509
8510 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8512 self.0.request.order_by = v.into();
8513 self
8514 }
8515 }
8516
8517 #[doc(hidden)]
8518 impl crate::RequestBuilder for ListInterceptEndpointGroupAssociations {
8519 fn request_options(&mut self) -> &mut crate::RequestOptions {
8520 &mut self.0.options
8521 }
8522 }
8523
8524 #[derive(Clone, Debug)]
8541 pub struct GetInterceptEndpointGroupAssociation(
8542 RequestBuilder<crate::model::GetInterceptEndpointGroupAssociationRequest>,
8543 );
8544
8545 impl GetInterceptEndpointGroupAssociation {
8546 pub(crate) fn new(
8547 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8548 ) -> Self {
8549 Self(RequestBuilder::new(stub))
8550 }
8551
8552 pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupAssociationRequest>>(
8554 mut self,
8555 v: V,
8556 ) -> Self {
8557 self.0.request = v.into();
8558 self
8559 }
8560
8561 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8563 self.0.options = v.into();
8564 self
8565 }
8566
8567 pub async fn send(self) -> Result<crate::model::InterceptEndpointGroupAssociation> {
8569 (*self.0.stub)
8570 .get_intercept_endpoint_group_association(self.0.request, self.0.options)
8571 .await
8572 .map(crate::Response::into_body)
8573 }
8574
8575 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8579 self.0.request.name = v.into();
8580 self
8581 }
8582 }
8583
8584 #[doc(hidden)]
8585 impl crate::RequestBuilder for GetInterceptEndpointGroupAssociation {
8586 fn request_options(&mut self) -> &mut crate::RequestOptions {
8587 &mut self.0.options
8588 }
8589 }
8590
8591 #[derive(Clone, Debug)]
8609 pub struct CreateInterceptEndpointGroupAssociation(
8610 RequestBuilder<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8611 );
8612
8613 impl CreateInterceptEndpointGroupAssociation {
8614 pub(crate) fn new(
8615 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8616 ) -> Self {
8617 Self(RequestBuilder::new(stub))
8618 }
8619
8620 pub fn with_request<
8622 V: Into<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8623 >(
8624 mut self,
8625 v: V,
8626 ) -> Self {
8627 self.0.request = v.into();
8628 self
8629 }
8630
8631 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8633 self.0.options = v.into();
8634 self
8635 }
8636
8637 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8644 (*self.0.stub)
8645 .create_intercept_endpoint_group_association(self.0.request, self.0.options)
8646 .await
8647 .map(crate::Response::into_body)
8648 }
8649
8650 pub fn poller(
8652 self,
8653 ) -> impl google_cloud_lro::Poller<
8654 crate::model::InterceptEndpointGroupAssociation,
8655 crate::model::OperationMetadata,
8656 > {
8657 type Operation = google_cloud_lro::internal::Operation<
8658 crate::model::InterceptEndpointGroupAssociation,
8659 crate::model::OperationMetadata,
8660 >;
8661 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8662 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8663
8664 let stub = self.0.stub.clone();
8665 let mut options = self.0.options.clone();
8666 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8667 let query = move |name| {
8668 let stub = stub.clone();
8669 let options = options.clone();
8670 async {
8671 let op = GetOperation::new(stub)
8672 .set_name(name)
8673 .with_options(options)
8674 .send()
8675 .await?;
8676 Ok(Operation::new(op))
8677 }
8678 };
8679
8680 let start = move || async {
8681 let op = self.send().await?;
8682 Ok(Operation::new(op))
8683 };
8684
8685 google_cloud_lro::internal::new_poller(
8686 polling_error_policy,
8687 polling_backoff_policy,
8688 start,
8689 query,
8690 )
8691 }
8692
8693 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8697 self.0.request.parent = v.into();
8698 self
8699 }
8700
8701 pub fn set_intercept_endpoint_group_association_id<T: Into<std::string::String>>(
8703 mut self,
8704 v: T,
8705 ) -> Self {
8706 self.0.request.intercept_endpoint_group_association_id = v.into();
8707 self
8708 }
8709
8710 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8714 where
8715 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8716 {
8717 self.0.request.intercept_endpoint_group_association =
8718 std::option::Option::Some(v.into());
8719 self
8720 }
8721
8722 pub fn set_or_clear_intercept_endpoint_group_association<T>(
8726 mut self,
8727 v: std::option::Option<T>,
8728 ) -> Self
8729 where
8730 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8731 {
8732 self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8733 self
8734 }
8735
8736 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8738 self.0.request.request_id = v.into();
8739 self
8740 }
8741 }
8742
8743 #[doc(hidden)]
8744 impl crate::RequestBuilder for CreateInterceptEndpointGroupAssociation {
8745 fn request_options(&mut self) -> &mut crate::RequestOptions {
8746 &mut self.0.options
8747 }
8748 }
8749
8750 #[derive(Clone, Debug)]
8768 pub struct UpdateInterceptEndpointGroupAssociation(
8769 RequestBuilder<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8770 );
8771
8772 impl UpdateInterceptEndpointGroupAssociation {
8773 pub(crate) fn new(
8774 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8775 ) -> Self {
8776 Self(RequestBuilder::new(stub))
8777 }
8778
8779 pub fn with_request<
8781 V: Into<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8782 >(
8783 mut self,
8784 v: V,
8785 ) -> Self {
8786 self.0.request = v.into();
8787 self
8788 }
8789
8790 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8792 self.0.options = v.into();
8793 self
8794 }
8795
8796 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8803 (*self.0.stub)
8804 .update_intercept_endpoint_group_association(self.0.request, self.0.options)
8805 .await
8806 .map(crate::Response::into_body)
8807 }
8808
8809 pub fn poller(
8811 self,
8812 ) -> impl google_cloud_lro::Poller<
8813 crate::model::InterceptEndpointGroupAssociation,
8814 crate::model::OperationMetadata,
8815 > {
8816 type Operation = google_cloud_lro::internal::Operation<
8817 crate::model::InterceptEndpointGroupAssociation,
8818 crate::model::OperationMetadata,
8819 >;
8820 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8821 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8822
8823 let stub = self.0.stub.clone();
8824 let mut options = self.0.options.clone();
8825 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8826 let query = move |name| {
8827 let stub = stub.clone();
8828 let options = options.clone();
8829 async {
8830 let op = GetOperation::new(stub)
8831 .set_name(name)
8832 .with_options(options)
8833 .send()
8834 .await?;
8835 Ok(Operation::new(op))
8836 }
8837 };
8838
8839 let start = move || async {
8840 let op = self.send().await?;
8841 Ok(Operation::new(op))
8842 };
8843
8844 google_cloud_lro::internal::new_poller(
8845 polling_error_policy,
8846 polling_backoff_policy,
8847 start,
8848 query,
8849 )
8850 }
8851
8852 pub fn set_update_mask<T>(mut self, v: T) -> Self
8854 where
8855 T: std::convert::Into<wkt::FieldMask>,
8856 {
8857 self.0.request.update_mask = std::option::Option::Some(v.into());
8858 self
8859 }
8860
8861 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8863 where
8864 T: std::convert::Into<wkt::FieldMask>,
8865 {
8866 self.0.request.update_mask = v.map(|x| x.into());
8867 self
8868 }
8869
8870 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8874 where
8875 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8876 {
8877 self.0.request.intercept_endpoint_group_association =
8878 std::option::Option::Some(v.into());
8879 self
8880 }
8881
8882 pub fn set_or_clear_intercept_endpoint_group_association<T>(
8886 mut self,
8887 v: std::option::Option<T>,
8888 ) -> Self
8889 where
8890 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8891 {
8892 self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8893 self
8894 }
8895
8896 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8898 self.0.request.request_id = v.into();
8899 self
8900 }
8901 }
8902
8903 #[doc(hidden)]
8904 impl crate::RequestBuilder for UpdateInterceptEndpointGroupAssociation {
8905 fn request_options(&mut self) -> &mut crate::RequestOptions {
8906 &mut self.0.options
8907 }
8908 }
8909
8910 #[derive(Clone, Debug)]
8928 pub struct DeleteInterceptEndpointGroupAssociation(
8929 RequestBuilder<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8930 );
8931
8932 impl DeleteInterceptEndpointGroupAssociation {
8933 pub(crate) fn new(
8934 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8935 ) -> Self {
8936 Self(RequestBuilder::new(stub))
8937 }
8938
8939 pub fn with_request<
8941 V: Into<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8942 >(
8943 mut self,
8944 v: V,
8945 ) -> Self {
8946 self.0.request = v.into();
8947 self
8948 }
8949
8950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8952 self.0.options = v.into();
8953 self
8954 }
8955
8956 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8963 (*self.0.stub)
8964 .delete_intercept_endpoint_group_association(self.0.request, self.0.options)
8965 .await
8966 .map(crate::Response::into_body)
8967 }
8968
8969 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8971 type Operation =
8972 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8973 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8974 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8975
8976 let stub = self.0.stub.clone();
8977 let mut options = self.0.options.clone();
8978 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8979 let query = move |name| {
8980 let stub = stub.clone();
8981 let options = options.clone();
8982 async {
8983 let op = GetOperation::new(stub)
8984 .set_name(name)
8985 .with_options(options)
8986 .send()
8987 .await?;
8988 Ok(Operation::new(op))
8989 }
8990 };
8991
8992 let start = move || async {
8993 let op = self.send().await?;
8994 Ok(Operation::new(op))
8995 };
8996
8997 google_cloud_lro::internal::new_unit_response_poller(
8998 polling_error_policy,
8999 polling_backoff_policy,
9000 start,
9001 query,
9002 )
9003 }
9004
9005 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9009 self.0.request.name = v.into();
9010 self
9011 }
9012
9013 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9015 self.0.request.request_id = v.into();
9016 self
9017 }
9018 }
9019
9020 #[doc(hidden)]
9021 impl crate::RequestBuilder for DeleteInterceptEndpointGroupAssociation {
9022 fn request_options(&mut self) -> &mut crate::RequestOptions {
9023 &mut self.0.options
9024 }
9025 }
9026
9027 #[derive(Clone, Debug)]
9048 pub struct ListInterceptDeploymentGroups(
9049 RequestBuilder<crate::model::ListInterceptDeploymentGroupsRequest>,
9050 );
9051
9052 impl ListInterceptDeploymentGroups {
9053 pub(crate) fn new(
9054 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9055 ) -> Self {
9056 Self(RequestBuilder::new(stub))
9057 }
9058
9059 pub fn with_request<V: Into<crate::model::ListInterceptDeploymentGroupsRequest>>(
9061 mut self,
9062 v: V,
9063 ) -> Self {
9064 self.0.request = v.into();
9065 self
9066 }
9067
9068 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9070 self.0.options = v.into();
9071 self
9072 }
9073
9074 pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentGroupsResponse> {
9076 (*self.0.stub)
9077 .list_intercept_deployment_groups(self.0.request, self.0.options)
9078 .await
9079 .map(crate::Response::into_body)
9080 }
9081
9082 pub fn by_page(
9084 self,
9085 ) -> impl google_cloud_gax::paginator::Paginator<
9086 crate::model::ListInterceptDeploymentGroupsResponse,
9087 crate::Error,
9088 > {
9089 use std::clone::Clone;
9090 let token = self.0.request.page_token.clone();
9091 let execute = move |token: String| {
9092 let mut builder = self.clone();
9093 builder.0.request = builder.0.request.set_page_token(token);
9094 builder.send()
9095 };
9096 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9097 }
9098
9099 pub fn by_item(
9101 self,
9102 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9103 crate::model::ListInterceptDeploymentGroupsResponse,
9104 crate::Error,
9105 > {
9106 use google_cloud_gax::paginator::Paginator;
9107 self.by_page().items()
9108 }
9109
9110 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9114 self.0.request.parent = v.into();
9115 self
9116 }
9117
9118 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9120 self.0.request.page_size = v.into();
9121 self
9122 }
9123
9124 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9126 self.0.request.page_token = v.into();
9127 self
9128 }
9129
9130 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9132 self.0.request.filter = v.into();
9133 self
9134 }
9135
9136 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9138 self.0.request.order_by = v.into();
9139 self
9140 }
9141 }
9142
9143 #[doc(hidden)]
9144 impl crate::RequestBuilder for ListInterceptDeploymentGroups {
9145 fn request_options(&mut self) -> &mut crate::RequestOptions {
9146 &mut self.0.options
9147 }
9148 }
9149
9150 #[derive(Clone, Debug)]
9167 pub struct GetInterceptDeploymentGroup(
9168 RequestBuilder<crate::model::GetInterceptDeploymentGroupRequest>,
9169 );
9170
9171 impl GetInterceptDeploymentGroup {
9172 pub(crate) fn new(
9173 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9174 ) -> Self {
9175 Self(RequestBuilder::new(stub))
9176 }
9177
9178 pub fn with_request<V: Into<crate::model::GetInterceptDeploymentGroupRequest>>(
9180 mut self,
9181 v: V,
9182 ) -> Self {
9183 self.0.request = v.into();
9184 self
9185 }
9186
9187 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9189 self.0.options = v.into();
9190 self
9191 }
9192
9193 pub async fn send(self) -> Result<crate::model::InterceptDeploymentGroup> {
9195 (*self.0.stub)
9196 .get_intercept_deployment_group(self.0.request, self.0.options)
9197 .await
9198 .map(crate::Response::into_body)
9199 }
9200
9201 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9205 self.0.request.name = v.into();
9206 self
9207 }
9208 }
9209
9210 #[doc(hidden)]
9211 impl crate::RequestBuilder for GetInterceptDeploymentGroup {
9212 fn request_options(&mut self) -> &mut crate::RequestOptions {
9213 &mut self.0.options
9214 }
9215 }
9216
9217 #[derive(Clone, Debug)]
9235 pub struct CreateInterceptDeploymentGroup(
9236 RequestBuilder<crate::model::CreateInterceptDeploymentGroupRequest>,
9237 );
9238
9239 impl CreateInterceptDeploymentGroup {
9240 pub(crate) fn new(
9241 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9242 ) -> Self {
9243 Self(RequestBuilder::new(stub))
9244 }
9245
9246 pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentGroupRequest>>(
9248 mut self,
9249 v: V,
9250 ) -> Self {
9251 self.0.request = v.into();
9252 self
9253 }
9254
9255 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9257 self.0.options = v.into();
9258 self
9259 }
9260
9261 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9268 (*self.0.stub)
9269 .create_intercept_deployment_group(self.0.request, self.0.options)
9270 .await
9271 .map(crate::Response::into_body)
9272 }
9273
9274 pub fn poller(
9276 self,
9277 ) -> impl google_cloud_lro::Poller<
9278 crate::model::InterceptDeploymentGroup,
9279 crate::model::OperationMetadata,
9280 > {
9281 type Operation = google_cloud_lro::internal::Operation<
9282 crate::model::InterceptDeploymentGroup,
9283 crate::model::OperationMetadata,
9284 >;
9285 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9286 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9287
9288 let stub = self.0.stub.clone();
9289 let mut options = self.0.options.clone();
9290 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9291 let query = move |name| {
9292 let stub = stub.clone();
9293 let options = options.clone();
9294 async {
9295 let op = GetOperation::new(stub)
9296 .set_name(name)
9297 .with_options(options)
9298 .send()
9299 .await?;
9300 Ok(Operation::new(op))
9301 }
9302 };
9303
9304 let start = move || async {
9305 let op = self.send().await?;
9306 Ok(Operation::new(op))
9307 };
9308
9309 google_cloud_lro::internal::new_poller(
9310 polling_error_policy,
9311 polling_backoff_policy,
9312 start,
9313 query,
9314 )
9315 }
9316
9317 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9321 self.0.request.parent = v.into();
9322 self
9323 }
9324
9325 pub fn set_intercept_deployment_group_id<T: Into<std::string::String>>(
9329 mut self,
9330 v: T,
9331 ) -> Self {
9332 self.0.request.intercept_deployment_group_id = v.into();
9333 self
9334 }
9335
9336 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
9340 where
9341 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9342 {
9343 self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
9344 self
9345 }
9346
9347 pub fn set_or_clear_intercept_deployment_group<T>(
9351 mut self,
9352 v: std::option::Option<T>,
9353 ) -> Self
9354 where
9355 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9356 {
9357 self.0.request.intercept_deployment_group = v.map(|x| x.into());
9358 self
9359 }
9360
9361 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9363 self.0.request.request_id = v.into();
9364 self
9365 }
9366 }
9367
9368 #[doc(hidden)]
9369 impl crate::RequestBuilder for CreateInterceptDeploymentGroup {
9370 fn request_options(&mut self) -> &mut crate::RequestOptions {
9371 &mut self.0.options
9372 }
9373 }
9374
9375 #[derive(Clone, Debug)]
9393 pub struct UpdateInterceptDeploymentGroup(
9394 RequestBuilder<crate::model::UpdateInterceptDeploymentGroupRequest>,
9395 );
9396
9397 impl UpdateInterceptDeploymentGroup {
9398 pub(crate) fn new(
9399 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9400 ) -> Self {
9401 Self(RequestBuilder::new(stub))
9402 }
9403
9404 pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentGroupRequest>>(
9406 mut self,
9407 v: V,
9408 ) -> Self {
9409 self.0.request = v.into();
9410 self
9411 }
9412
9413 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9415 self.0.options = v.into();
9416 self
9417 }
9418
9419 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9426 (*self.0.stub)
9427 .update_intercept_deployment_group(self.0.request, self.0.options)
9428 .await
9429 .map(crate::Response::into_body)
9430 }
9431
9432 pub fn poller(
9434 self,
9435 ) -> impl google_cloud_lro::Poller<
9436 crate::model::InterceptDeploymentGroup,
9437 crate::model::OperationMetadata,
9438 > {
9439 type Operation = google_cloud_lro::internal::Operation<
9440 crate::model::InterceptDeploymentGroup,
9441 crate::model::OperationMetadata,
9442 >;
9443 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9444 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9445
9446 let stub = self.0.stub.clone();
9447 let mut options = self.0.options.clone();
9448 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9449 let query = move |name| {
9450 let stub = stub.clone();
9451 let options = options.clone();
9452 async {
9453 let op = GetOperation::new(stub)
9454 .set_name(name)
9455 .with_options(options)
9456 .send()
9457 .await?;
9458 Ok(Operation::new(op))
9459 }
9460 };
9461
9462 let start = move || async {
9463 let op = self.send().await?;
9464 Ok(Operation::new(op))
9465 };
9466
9467 google_cloud_lro::internal::new_poller(
9468 polling_error_policy,
9469 polling_backoff_policy,
9470 start,
9471 query,
9472 )
9473 }
9474
9475 pub fn set_update_mask<T>(mut self, v: T) -> Self
9477 where
9478 T: std::convert::Into<wkt::FieldMask>,
9479 {
9480 self.0.request.update_mask = std::option::Option::Some(v.into());
9481 self
9482 }
9483
9484 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9486 where
9487 T: std::convert::Into<wkt::FieldMask>,
9488 {
9489 self.0.request.update_mask = v.map(|x| x.into());
9490 self
9491 }
9492
9493 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
9497 where
9498 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9499 {
9500 self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
9501 self
9502 }
9503
9504 pub fn set_or_clear_intercept_deployment_group<T>(
9508 mut self,
9509 v: std::option::Option<T>,
9510 ) -> Self
9511 where
9512 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9513 {
9514 self.0.request.intercept_deployment_group = v.map(|x| x.into());
9515 self
9516 }
9517
9518 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9520 self.0.request.request_id = v.into();
9521 self
9522 }
9523 }
9524
9525 #[doc(hidden)]
9526 impl crate::RequestBuilder for UpdateInterceptDeploymentGroup {
9527 fn request_options(&mut self) -> &mut crate::RequestOptions {
9528 &mut self.0.options
9529 }
9530 }
9531
9532 #[derive(Clone, Debug)]
9550 pub struct DeleteInterceptDeploymentGroup(
9551 RequestBuilder<crate::model::DeleteInterceptDeploymentGroupRequest>,
9552 );
9553
9554 impl DeleteInterceptDeploymentGroup {
9555 pub(crate) fn new(
9556 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9557 ) -> Self {
9558 Self(RequestBuilder::new(stub))
9559 }
9560
9561 pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentGroupRequest>>(
9563 mut self,
9564 v: V,
9565 ) -> Self {
9566 self.0.request = v.into();
9567 self
9568 }
9569
9570 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9572 self.0.options = v.into();
9573 self
9574 }
9575
9576 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9583 (*self.0.stub)
9584 .delete_intercept_deployment_group(self.0.request, self.0.options)
9585 .await
9586 .map(crate::Response::into_body)
9587 }
9588
9589 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9591 type Operation =
9592 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9593 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9594 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9595
9596 let stub = self.0.stub.clone();
9597 let mut options = self.0.options.clone();
9598 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9599 let query = move |name| {
9600 let stub = stub.clone();
9601 let options = options.clone();
9602 async {
9603 let op = GetOperation::new(stub)
9604 .set_name(name)
9605 .with_options(options)
9606 .send()
9607 .await?;
9608 Ok(Operation::new(op))
9609 }
9610 };
9611
9612 let start = move || async {
9613 let op = self.send().await?;
9614 Ok(Operation::new(op))
9615 };
9616
9617 google_cloud_lro::internal::new_unit_response_poller(
9618 polling_error_policy,
9619 polling_backoff_policy,
9620 start,
9621 query,
9622 )
9623 }
9624
9625 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9629 self.0.request.name = v.into();
9630 self
9631 }
9632
9633 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9635 self.0.request.request_id = v.into();
9636 self
9637 }
9638 }
9639
9640 #[doc(hidden)]
9641 impl crate::RequestBuilder for DeleteInterceptDeploymentGroup {
9642 fn request_options(&mut self) -> &mut crate::RequestOptions {
9643 &mut self.0.options
9644 }
9645 }
9646
9647 #[derive(Clone, Debug)]
9668 pub struct ListInterceptDeployments(
9669 RequestBuilder<crate::model::ListInterceptDeploymentsRequest>,
9670 );
9671
9672 impl ListInterceptDeployments {
9673 pub(crate) fn new(
9674 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9675 ) -> Self {
9676 Self(RequestBuilder::new(stub))
9677 }
9678
9679 pub fn with_request<V: Into<crate::model::ListInterceptDeploymentsRequest>>(
9681 mut self,
9682 v: V,
9683 ) -> Self {
9684 self.0.request = v.into();
9685 self
9686 }
9687
9688 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9690 self.0.options = v.into();
9691 self
9692 }
9693
9694 pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentsResponse> {
9696 (*self.0.stub)
9697 .list_intercept_deployments(self.0.request, self.0.options)
9698 .await
9699 .map(crate::Response::into_body)
9700 }
9701
9702 pub fn by_page(
9704 self,
9705 ) -> impl google_cloud_gax::paginator::Paginator<
9706 crate::model::ListInterceptDeploymentsResponse,
9707 crate::Error,
9708 > {
9709 use std::clone::Clone;
9710 let token = self.0.request.page_token.clone();
9711 let execute = move |token: String| {
9712 let mut builder = self.clone();
9713 builder.0.request = builder.0.request.set_page_token(token);
9714 builder.send()
9715 };
9716 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9717 }
9718
9719 pub fn by_item(
9721 self,
9722 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9723 crate::model::ListInterceptDeploymentsResponse,
9724 crate::Error,
9725 > {
9726 use google_cloud_gax::paginator::Paginator;
9727 self.by_page().items()
9728 }
9729
9730 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9734 self.0.request.parent = v.into();
9735 self
9736 }
9737
9738 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9740 self.0.request.page_size = v.into();
9741 self
9742 }
9743
9744 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9746 self.0.request.page_token = v.into();
9747 self
9748 }
9749
9750 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9752 self.0.request.filter = v.into();
9753 self
9754 }
9755
9756 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9758 self.0.request.order_by = v.into();
9759 self
9760 }
9761 }
9762
9763 #[doc(hidden)]
9764 impl crate::RequestBuilder for ListInterceptDeployments {
9765 fn request_options(&mut self) -> &mut crate::RequestOptions {
9766 &mut self.0.options
9767 }
9768 }
9769
9770 #[derive(Clone, Debug)]
9787 pub struct GetInterceptDeployment(RequestBuilder<crate::model::GetInterceptDeploymentRequest>);
9788
9789 impl GetInterceptDeployment {
9790 pub(crate) fn new(
9791 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9792 ) -> Self {
9793 Self(RequestBuilder::new(stub))
9794 }
9795
9796 pub fn with_request<V: Into<crate::model::GetInterceptDeploymentRequest>>(
9798 mut self,
9799 v: V,
9800 ) -> Self {
9801 self.0.request = v.into();
9802 self
9803 }
9804
9805 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9807 self.0.options = v.into();
9808 self
9809 }
9810
9811 pub async fn send(self) -> Result<crate::model::InterceptDeployment> {
9813 (*self.0.stub)
9814 .get_intercept_deployment(self.0.request, self.0.options)
9815 .await
9816 .map(crate::Response::into_body)
9817 }
9818
9819 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9823 self.0.request.name = v.into();
9824 self
9825 }
9826 }
9827
9828 #[doc(hidden)]
9829 impl crate::RequestBuilder for GetInterceptDeployment {
9830 fn request_options(&mut self) -> &mut crate::RequestOptions {
9831 &mut self.0.options
9832 }
9833 }
9834
9835 #[derive(Clone, Debug)]
9853 pub struct CreateInterceptDeployment(
9854 RequestBuilder<crate::model::CreateInterceptDeploymentRequest>,
9855 );
9856
9857 impl CreateInterceptDeployment {
9858 pub(crate) fn new(
9859 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9860 ) -> Self {
9861 Self(RequestBuilder::new(stub))
9862 }
9863
9864 pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentRequest>>(
9866 mut self,
9867 v: V,
9868 ) -> Self {
9869 self.0.request = v.into();
9870 self
9871 }
9872
9873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9875 self.0.options = v.into();
9876 self
9877 }
9878
9879 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9886 (*self.0.stub)
9887 .create_intercept_deployment(self.0.request, self.0.options)
9888 .await
9889 .map(crate::Response::into_body)
9890 }
9891
9892 pub fn poller(
9894 self,
9895 ) -> impl google_cloud_lro::Poller<
9896 crate::model::InterceptDeployment,
9897 crate::model::OperationMetadata,
9898 > {
9899 type Operation = google_cloud_lro::internal::Operation<
9900 crate::model::InterceptDeployment,
9901 crate::model::OperationMetadata,
9902 >;
9903 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9904 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9905
9906 let stub = self.0.stub.clone();
9907 let mut options = self.0.options.clone();
9908 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9909 let query = move |name| {
9910 let stub = stub.clone();
9911 let options = options.clone();
9912 async {
9913 let op = GetOperation::new(stub)
9914 .set_name(name)
9915 .with_options(options)
9916 .send()
9917 .await?;
9918 Ok(Operation::new(op))
9919 }
9920 };
9921
9922 let start = move || async {
9923 let op = self.send().await?;
9924 Ok(Operation::new(op))
9925 };
9926
9927 google_cloud_lro::internal::new_poller(
9928 polling_error_policy,
9929 polling_backoff_policy,
9930 start,
9931 query,
9932 )
9933 }
9934
9935 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9939 self.0.request.parent = v.into();
9940 self
9941 }
9942
9943 pub fn set_intercept_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9947 self.0.request.intercept_deployment_id = v.into();
9948 self
9949 }
9950
9951 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9955 where
9956 T: std::convert::Into<crate::model::InterceptDeployment>,
9957 {
9958 self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9959 self
9960 }
9961
9962 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9966 where
9967 T: std::convert::Into<crate::model::InterceptDeployment>,
9968 {
9969 self.0.request.intercept_deployment = v.map(|x| x.into());
9970 self
9971 }
9972
9973 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9975 self.0.request.request_id = v.into();
9976 self
9977 }
9978 }
9979
9980 #[doc(hidden)]
9981 impl crate::RequestBuilder for CreateInterceptDeployment {
9982 fn request_options(&mut self) -> &mut crate::RequestOptions {
9983 &mut self.0.options
9984 }
9985 }
9986
9987 #[derive(Clone, Debug)]
10005 pub struct UpdateInterceptDeployment(
10006 RequestBuilder<crate::model::UpdateInterceptDeploymentRequest>,
10007 );
10008
10009 impl UpdateInterceptDeployment {
10010 pub(crate) fn new(
10011 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10012 ) -> Self {
10013 Self(RequestBuilder::new(stub))
10014 }
10015
10016 pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentRequest>>(
10018 mut self,
10019 v: V,
10020 ) -> Self {
10021 self.0.request = v.into();
10022 self
10023 }
10024
10025 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10027 self.0.options = v.into();
10028 self
10029 }
10030
10031 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10038 (*self.0.stub)
10039 .update_intercept_deployment(self.0.request, self.0.options)
10040 .await
10041 .map(crate::Response::into_body)
10042 }
10043
10044 pub fn poller(
10046 self,
10047 ) -> impl google_cloud_lro::Poller<
10048 crate::model::InterceptDeployment,
10049 crate::model::OperationMetadata,
10050 > {
10051 type Operation = google_cloud_lro::internal::Operation<
10052 crate::model::InterceptDeployment,
10053 crate::model::OperationMetadata,
10054 >;
10055 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10056 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10057
10058 let stub = self.0.stub.clone();
10059 let mut options = self.0.options.clone();
10060 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10061 let query = move |name| {
10062 let stub = stub.clone();
10063 let options = options.clone();
10064 async {
10065 let op = GetOperation::new(stub)
10066 .set_name(name)
10067 .with_options(options)
10068 .send()
10069 .await?;
10070 Ok(Operation::new(op))
10071 }
10072 };
10073
10074 let start = move || async {
10075 let op = self.send().await?;
10076 Ok(Operation::new(op))
10077 };
10078
10079 google_cloud_lro::internal::new_poller(
10080 polling_error_policy,
10081 polling_backoff_policy,
10082 start,
10083 query,
10084 )
10085 }
10086
10087 pub fn set_update_mask<T>(mut self, v: T) -> Self
10089 where
10090 T: std::convert::Into<wkt::FieldMask>,
10091 {
10092 self.0.request.update_mask = std::option::Option::Some(v.into());
10093 self
10094 }
10095
10096 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10098 where
10099 T: std::convert::Into<wkt::FieldMask>,
10100 {
10101 self.0.request.update_mask = v.map(|x| x.into());
10102 self
10103 }
10104
10105 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
10109 where
10110 T: std::convert::Into<crate::model::InterceptDeployment>,
10111 {
10112 self.0.request.intercept_deployment = std::option::Option::Some(v.into());
10113 self
10114 }
10115
10116 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
10120 where
10121 T: std::convert::Into<crate::model::InterceptDeployment>,
10122 {
10123 self.0.request.intercept_deployment = v.map(|x| x.into());
10124 self
10125 }
10126
10127 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10129 self.0.request.request_id = v.into();
10130 self
10131 }
10132 }
10133
10134 #[doc(hidden)]
10135 impl crate::RequestBuilder for UpdateInterceptDeployment {
10136 fn request_options(&mut self) -> &mut crate::RequestOptions {
10137 &mut self.0.options
10138 }
10139 }
10140
10141 #[derive(Clone, Debug)]
10159 pub struct DeleteInterceptDeployment(
10160 RequestBuilder<crate::model::DeleteInterceptDeploymentRequest>,
10161 );
10162
10163 impl DeleteInterceptDeployment {
10164 pub(crate) fn new(
10165 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10166 ) -> Self {
10167 Self(RequestBuilder::new(stub))
10168 }
10169
10170 pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentRequest>>(
10172 mut self,
10173 v: V,
10174 ) -> Self {
10175 self.0.request = v.into();
10176 self
10177 }
10178
10179 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10181 self.0.options = v.into();
10182 self
10183 }
10184
10185 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10192 (*self.0.stub)
10193 .delete_intercept_deployment(self.0.request, self.0.options)
10194 .await
10195 .map(crate::Response::into_body)
10196 }
10197
10198 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10200 type Operation =
10201 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10202 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10203 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10204
10205 let stub = self.0.stub.clone();
10206 let mut options = self.0.options.clone();
10207 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10208 let query = move |name| {
10209 let stub = stub.clone();
10210 let options = options.clone();
10211 async {
10212 let op = GetOperation::new(stub)
10213 .set_name(name)
10214 .with_options(options)
10215 .send()
10216 .await?;
10217 Ok(Operation::new(op))
10218 }
10219 };
10220
10221 let start = move || async {
10222 let op = self.send().await?;
10223 Ok(Operation::new(op))
10224 };
10225
10226 google_cloud_lro::internal::new_unit_response_poller(
10227 polling_error_policy,
10228 polling_backoff_policy,
10229 start,
10230 query,
10231 )
10232 }
10233
10234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10238 self.0.request.name = v.into();
10239 self
10240 }
10241
10242 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10244 self.0.request.request_id = v.into();
10245 self
10246 }
10247 }
10248
10249 #[doc(hidden)]
10250 impl crate::RequestBuilder for DeleteInterceptDeployment {
10251 fn request_options(&mut self) -> &mut crate::RequestOptions {
10252 &mut self.0.options
10253 }
10254 }
10255
10256 #[derive(Clone, Debug)]
10277 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10278
10279 impl ListLocations {
10280 pub(crate) fn new(
10281 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10282 ) -> Self {
10283 Self(RequestBuilder::new(stub))
10284 }
10285
10286 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10288 mut self,
10289 v: V,
10290 ) -> Self {
10291 self.0.request = v.into();
10292 self
10293 }
10294
10295 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10297 self.0.options = v.into();
10298 self
10299 }
10300
10301 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10303 (*self.0.stub)
10304 .list_locations(self.0.request, self.0.options)
10305 .await
10306 .map(crate::Response::into_body)
10307 }
10308
10309 pub fn by_page(
10311 self,
10312 ) -> impl google_cloud_gax::paginator::Paginator<
10313 google_cloud_location::model::ListLocationsResponse,
10314 crate::Error,
10315 > {
10316 use std::clone::Clone;
10317 let token = self.0.request.page_token.clone();
10318 let execute = move |token: String| {
10319 let mut builder = self.clone();
10320 builder.0.request = builder.0.request.set_page_token(token);
10321 builder.send()
10322 };
10323 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10324 }
10325
10326 pub fn by_item(
10328 self,
10329 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10330 google_cloud_location::model::ListLocationsResponse,
10331 crate::Error,
10332 > {
10333 use google_cloud_gax::paginator::Paginator;
10334 self.by_page().items()
10335 }
10336
10337 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10339 self.0.request.name = v.into();
10340 self
10341 }
10342
10343 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10345 self.0.request.filter = v.into();
10346 self
10347 }
10348
10349 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10351 self.0.request.page_size = v.into();
10352 self
10353 }
10354
10355 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10357 self.0.request.page_token = v.into();
10358 self
10359 }
10360 }
10361
10362 #[doc(hidden)]
10363 impl crate::RequestBuilder for ListLocations {
10364 fn request_options(&mut self) -> &mut crate::RequestOptions {
10365 &mut self.0.options
10366 }
10367 }
10368
10369 #[derive(Clone, Debug)]
10386 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10387
10388 impl GetLocation {
10389 pub(crate) fn new(
10390 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10391 ) -> Self {
10392 Self(RequestBuilder::new(stub))
10393 }
10394
10395 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10397 mut self,
10398 v: V,
10399 ) -> Self {
10400 self.0.request = v.into();
10401 self
10402 }
10403
10404 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10406 self.0.options = v.into();
10407 self
10408 }
10409
10410 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10412 (*self.0.stub)
10413 .get_location(self.0.request, self.0.options)
10414 .await
10415 .map(crate::Response::into_body)
10416 }
10417
10418 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10420 self.0.request.name = v.into();
10421 self
10422 }
10423 }
10424
10425 #[doc(hidden)]
10426 impl crate::RequestBuilder for GetLocation {
10427 fn request_options(&mut self) -> &mut crate::RequestOptions {
10428 &mut self.0.options
10429 }
10430 }
10431
10432 #[derive(Clone, Debug)]
10449 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10450
10451 impl SetIamPolicy {
10452 pub(crate) fn new(
10453 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10454 ) -> Self {
10455 Self(RequestBuilder::new(stub))
10456 }
10457
10458 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10460 mut self,
10461 v: V,
10462 ) -> Self {
10463 self.0.request = v.into();
10464 self
10465 }
10466
10467 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10469 self.0.options = v.into();
10470 self
10471 }
10472
10473 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10475 (*self.0.stub)
10476 .set_iam_policy(self.0.request, self.0.options)
10477 .await
10478 .map(crate::Response::into_body)
10479 }
10480
10481 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10485 self.0.request.resource = v.into();
10486 self
10487 }
10488
10489 pub fn set_policy<T>(mut self, v: T) -> Self
10493 where
10494 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10495 {
10496 self.0.request.policy = std::option::Option::Some(v.into());
10497 self
10498 }
10499
10500 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10504 where
10505 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10506 {
10507 self.0.request.policy = v.map(|x| x.into());
10508 self
10509 }
10510
10511 pub fn set_update_mask<T>(mut self, v: T) -> Self
10513 where
10514 T: std::convert::Into<wkt::FieldMask>,
10515 {
10516 self.0.request.update_mask = std::option::Option::Some(v.into());
10517 self
10518 }
10519
10520 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10522 where
10523 T: std::convert::Into<wkt::FieldMask>,
10524 {
10525 self.0.request.update_mask = v.map(|x| x.into());
10526 self
10527 }
10528 }
10529
10530 #[doc(hidden)]
10531 impl crate::RequestBuilder for SetIamPolicy {
10532 fn request_options(&mut self) -> &mut crate::RequestOptions {
10533 &mut self.0.options
10534 }
10535 }
10536
10537 #[derive(Clone, Debug)]
10554 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10555
10556 impl GetIamPolicy {
10557 pub(crate) fn new(
10558 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10559 ) -> Self {
10560 Self(RequestBuilder::new(stub))
10561 }
10562
10563 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10565 mut self,
10566 v: V,
10567 ) -> Self {
10568 self.0.request = v.into();
10569 self
10570 }
10571
10572 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10574 self.0.options = v.into();
10575 self
10576 }
10577
10578 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10580 (*self.0.stub)
10581 .get_iam_policy(self.0.request, self.0.options)
10582 .await
10583 .map(crate::Response::into_body)
10584 }
10585
10586 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10590 self.0.request.resource = v.into();
10591 self
10592 }
10593
10594 pub fn set_options<T>(mut self, v: T) -> Self
10596 where
10597 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10598 {
10599 self.0.request.options = std::option::Option::Some(v.into());
10600 self
10601 }
10602
10603 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10605 where
10606 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10607 {
10608 self.0.request.options = v.map(|x| x.into());
10609 self
10610 }
10611 }
10612
10613 #[doc(hidden)]
10614 impl crate::RequestBuilder for GetIamPolicy {
10615 fn request_options(&mut self) -> &mut crate::RequestOptions {
10616 &mut self.0.options
10617 }
10618 }
10619
10620 #[derive(Clone, Debug)]
10637 pub struct TestIamPermissions(
10638 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10639 );
10640
10641 impl TestIamPermissions {
10642 pub(crate) fn new(
10643 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10644 ) -> Self {
10645 Self(RequestBuilder::new(stub))
10646 }
10647
10648 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10650 mut self,
10651 v: V,
10652 ) -> Self {
10653 self.0.request = v.into();
10654 self
10655 }
10656
10657 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10659 self.0.options = v.into();
10660 self
10661 }
10662
10663 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10665 (*self.0.stub)
10666 .test_iam_permissions(self.0.request, self.0.options)
10667 .await
10668 .map(crate::Response::into_body)
10669 }
10670
10671 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10675 self.0.request.resource = v.into();
10676 self
10677 }
10678
10679 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10683 where
10684 T: std::iter::IntoIterator<Item = V>,
10685 V: std::convert::Into<std::string::String>,
10686 {
10687 use std::iter::Iterator;
10688 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10689 self
10690 }
10691 }
10692
10693 #[doc(hidden)]
10694 impl crate::RequestBuilder for TestIamPermissions {
10695 fn request_options(&mut self) -> &mut crate::RequestOptions {
10696 &mut self.0.options
10697 }
10698 }
10699
10700 #[derive(Clone, Debug)]
10721 pub struct ListOperations(
10722 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10723 );
10724
10725 impl ListOperations {
10726 pub(crate) fn new(
10727 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10728 ) -> Self {
10729 Self(RequestBuilder::new(stub))
10730 }
10731
10732 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10734 mut self,
10735 v: V,
10736 ) -> Self {
10737 self.0.request = v.into();
10738 self
10739 }
10740
10741 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10743 self.0.options = v.into();
10744 self
10745 }
10746
10747 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10749 (*self.0.stub)
10750 .list_operations(self.0.request, self.0.options)
10751 .await
10752 .map(crate::Response::into_body)
10753 }
10754
10755 pub fn by_page(
10757 self,
10758 ) -> impl google_cloud_gax::paginator::Paginator<
10759 google_cloud_longrunning::model::ListOperationsResponse,
10760 crate::Error,
10761 > {
10762 use std::clone::Clone;
10763 let token = self.0.request.page_token.clone();
10764 let execute = move |token: String| {
10765 let mut builder = self.clone();
10766 builder.0.request = builder.0.request.set_page_token(token);
10767 builder.send()
10768 };
10769 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10770 }
10771
10772 pub fn by_item(
10774 self,
10775 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10776 google_cloud_longrunning::model::ListOperationsResponse,
10777 crate::Error,
10778 > {
10779 use google_cloud_gax::paginator::Paginator;
10780 self.by_page().items()
10781 }
10782
10783 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10785 self.0.request.name = v.into();
10786 self
10787 }
10788
10789 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10791 self.0.request.filter = v.into();
10792 self
10793 }
10794
10795 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10797 self.0.request.page_size = v.into();
10798 self
10799 }
10800
10801 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10803 self.0.request.page_token = v.into();
10804 self
10805 }
10806
10807 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10809 self.0.request.return_partial_success = v.into();
10810 self
10811 }
10812 }
10813
10814 #[doc(hidden)]
10815 impl crate::RequestBuilder for ListOperations {
10816 fn request_options(&mut self) -> &mut crate::RequestOptions {
10817 &mut self.0.options
10818 }
10819 }
10820
10821 #[derive(Clone, Debug)]
10838 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10839
10840 impl GetOperation {
10841 pub(crate) fn new(
10842 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10843 ) -> Self {
10844 Self(RequestBuilder::new(stub))
10845 }
10846
10847 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10849 mut self,
10850 v: V,
10851 ) -> Self {
10852 self.0.request = v.into();
10853 self
10854 }
10855
10856 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10858 self.0.options = v.into();
10859 self
10860 }
10861
10862 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10864 (*self.0.stub)
10865 .get_operation(self.0.request, self.0.options)
10866 .await
10867 .map(crate::Response::into_body)
10868 }
10869
10870 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10872 self.0.request.name = v.into();
10873 self
10874 }
10875 }
10876
10877 #[doc(hidden)]
10878 impl crate::RequestBuilder for GetOperation {
10879 fn request_options(&mut self) -> &mut crate::RequestOptions {
10880 &mut self.0.options
10881 }
10882 }
10883
10884 #[derive(Clone, Debug)]
10901 pub struct DeleteOperation(
10902 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10903 );
10904
10905 impl DeleteOperation {
10906 pub(crate) fn new(
10907 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10908 ) -> Self {
10909 Self(RequestBuilder::new(stub))
10910 }
10911
10912 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10914 mut self,
10915 v: V,
10916 ) -> Self {
10917 self.0.request = v.into();
10918 self
10919 }
10920
10921 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10923 self.0.options = v.into();
10924 self
10925 }
10926
10927 pub async fn send(self) -> Result<()> {
10929 (*self.0.stub)
10930 .delete_operation(self.0.request, self.0.options)
10931 .await
10932 .map(crate::Response::into_body)
10933 }
10934
10935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10937 self.0.request.name = v.into();
10938 self
10939 }
10940 }
10941
10942 #[doc(hidden)]
10943 impl crate::RequestBuilder for DeleteOperation {
10944 fn request_options(&mut self) -> &mut crate::RequestOptions {
10945 &mut self.0.options
10946 }
10947 }
10948
10949 #[derive(Clone, Debug)]
10966 pub struct CancelOperation(
10967 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10968 );
10969
10970 impl CancelOperation {
10971 pub(crate) fn new(
10972 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10973 ) -> Self {
10974 Self(RequestBuilder::new(stub))
10975 }
10976
10977 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10979 mut self,
10980 v: V,
10981 ) -> Self {
10982 self.0.request = v.into();
10983 self
10984 }
10985
10986 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10988 self.0.options = v.into();
10989 self
10990 }
10991
10992 pub async fn send(self) -> Result<()> {
10994 (*self.0.stub)
10995 .cancel_operation(self.0.request, self.0.options)
10996 .await
10997 .map(crate::Response::into_body)
10998 }
10999
11000 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11002 self.0.request.name = v.into();
11003 self
11004 }
11005 }
11006
11007 #[doc(hidden)]
11008 impl crate::RequestBuilder for CancelOperation {
11009 fn request_options(&mut self) -> &mut crate::RequestOptions {
11010 &mut self.0.options
11011 }
11012 }
11013}
11014
11015pub mod mirroring {
11017 use crate::Result;
11018
11019 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11033
11034 pub(crate) mod client {
11035 use super::super::super::client::Mirroring;
11036 pub struct Factory;
11037 impl crate::ClientFactory for Factory {
11038 type Client = Mirroring;
11039 type Credentials = gaxi::options::Credentials;
11040 async fn build(
11041 self,
11042 config: gaxi::options::ClientConfig,
11043 ) -> crate::ClientBuilderResult<Self::Client> {
11044 Self::Client::new(config).await
11045 }
11046 }
11047 }
11048
11049 #[derive(Clone, Debug)]
11051 pub(crate) struct RequestBuilder<R: std::default::Default> {
11052 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11053 request: R,
11054 options: crate::RequestOptions,
11055 }
11056
11057 impl<R> RequestBuilder<R>
11058 where
11059 R: std::default::Default,
11060 {
11061 pub(crate) fn new(
11062 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11063 ) -> Self {
11064 Self {
11065 stub,
11066 request: R::default(),
11067 options: crate::RequestOptions::default(),
11068 }
11069 }
11070 }
11071
11072 #[derive(Clone, Debug)]
11093 pub struct ListMirroringEndpointGroups(
11094 RequestBuilder<crate::model::ListMirroringEndpointGroupsRequest>,
11095 );
11096
11097 impl ListMirroringEndpointGroups {
11098 pub(crate) fn new(
11099 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11100 ) -> Self {
11101 Self(RequestBuilder::new(stub))
11102 }
11103
11104 pub fn with_request<V: Into<crate::model::ListMirroringEndpointGroupsRequest>>(
11106 mut self,
11107 v: V,
11108 ) -> Self {
11109 self.0.request = v.into();
11110 self
11111 }
11112
11113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11115 self.0.options = v.into();
11116 self
11117 }
11118
11119 pub async fn send(self) -> Result<crate::model::ListMirroringEndpointGroupsResponse> {
11121 (*self.0.stub)
11122 .list_mirroring_endpoint_groups(self.0.request, self.0.options)
11123 .await
11124 .map(crate::Response::into_body)
11125 }
11126
11127 pub fn by_page(
11129 self,
11130 ) -> impl google_cloud_gax::paginator::Paginator<
11131 crate::model::ListMirroringEndpointGroupsResponse,
11132 crate::Error,
11133 > {
11134 use std::clone::Clone;
11135 let token = self.0.request.page_token.clone();
11136 let execute = move |token: String| {
11137 let mut builder = self.clone();
11138 builder.0.request = builder.0.request.set_page_token(token);
11139 builder.send()
11140 };
11141 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11142 }
11143
11144 pub fn by_item(
11146 self,
11147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11148 crate::model::ListMirroringEndpointGroupsResponse,
11149 crate::Error,
11150 > {
11151 use google_cloud_gax::paginator::Paginator;
11152 self.by_page().items()
11153 }
11154
11155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11159 self.0.request.parent = v.into();
11160 self
11161 }
11162
11163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11165 self.0.request.page_size = v.into();
11166 self
11167 }
11168
11169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11171 self.0.request.page_token = v.into();
11172 self
11173 }
11174
11175 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11177 self.0.request.filter = v.into();
11178 self
11179 }
11180
11181 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11183 self.0.request.order_by = v.into();
11184 self
11185 }
11186 }
11187
11188 #[doc(hidden)]
11189 impl crate::RequestBuilder for ListMirroringEndpointGroups {
11190 fn request_options(&mut self) -> &mut crate::RequestOptions {
11191 &mut self.0.options
11192 }
11193 }
11194
11195 #[derive(Clone, Debug)]
11212 pub struct GetMirroringEndpointGroup(
11213 RequestBuilder<crate::model::GetMirroringEndpointGroupRequest>,
11214 );
11215
11216 impl GetMirroringEndpointGroup {
11217 pub(crate) fn new(
11218 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11219 ) -> Self {
11220 Self(RequestBuilder::new(stub))
11221 }
11222
11223 pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupRequest>>(
11225 mut self,
11226 v: V,
11227 ) -> Self {
11228 self.0.request = v.into();
11229 self
11230 }
11231
11232 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11234 self.0.options = v.into();
11235 self
11236 }
11237
11238 pub async fn send(self) -> Result<crate::model::MirroringEndpointGroup> {
11240 (*self.0.stub)
11241 .get_mirroring_endpoint_group(self.0.request, self.0.options)
11242 .await
11243 .map(crate::Response::into_body)
11244 }
11245
11246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11250 self.0.request.name = v.into();
11251 self
11252 }
11253 }
11254
11255 #[doc(hidden)]
11256 impl crate::RequestBuilder for GetMirroringEndpointGroup {
11257 fn request_options(&mut self) -> &mut crate::RequestOptions {
11258 &mut self.0.options
11259 }
11260 }
11261
11262 #[derive(Clone, Debug)]
11280 pub struct CreateMirroringEndpointGroup(
11281 RequestBuilder<crate::model::CreateMirroringEndpointGroupRequest>,
11282 );
11283
11284 impl CreateMirroringEndpointGroup {
11285 pub(crate) fn new(
11286 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11287 ) -> Self {
11288 Self(RequestBuilder::new(stub))
11289 }
11290
11291 pub fn with_request<V: Into<crate::model::CreateMirroringEndpointGroupRequest>>(
11293 mut self,
11294 v: V,
11295 ) -> Self {
11296 self.0.request = v.into();
11297 self
11298 }
11299
11300 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11302 self.0.options = v.into();
11303 self
11304 }
11305
11306 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11313 (*self.0.stub)
11314 .create_mirroring_endpoint_group(self.0.request, self.0.options)
11315 .await
11316 .map(crate::Response::into_body)
11317 }
11318
11319 pub fn poller(
11321 self,
11322 ) -> impl google_cloud_lro::Poller<
11323 crate::model::MirroringEndpointGroup,
11324 crate::model::OperationMetadata,
11325 > {
11326 type Operation = google_cloud_lro::internal::Operation<
11327 crate::model::MirroringEndpointGroup,
11328 crate::model::OperationMetadata,
11329 >;
11330 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11331 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11332
11333 let stub = self.0.stub.clone();
11334 let mut options = self.0.options.clone();
11335 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11336 let query = move |name| {
11337 let stub = stub.clone();
11338 let options = options.clone();
11339 async {
11340 let op = GetOperation::new(stub)
11341 .set_name(name)
11342 .with_options(options)
11343 .send()
11344 .await?;
11345 Ok(Operation::new(op))
11346 }
11347 };
11348
11349 let start = move || async {
11350 let op = self.send().await?;
11351 Ok(Operation::new(op))
11352 };
11353
11354 google_cloud_lro::internal::new_poller(
11355 polling_error_policy,
11356 polling_backoff_policy,
11357 start,
11358 query,
11359 )
11360 }
11361
11362 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11366 self.0.request.parent = v.into();
11367 self
11368 }
11369
11370 pub fn set_mirroring_endpoint_group_id<T: Into<std::string::String>>(
11374 mut self,
11375 v: T,
11376 ) -> Self {
11377 self.0.request.mirroring_endpoint_group_id = v.into();
11378 self
11379 }
11380
11381 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
11385 where
11386 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11387 {
11388 self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
11389 self
11390 }
11391
11392 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
11396 where
11397 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11398 {
11399 self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
11400 self
11401 }
11402
11403 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11405 self.0.request.request_id = v.into();
11406 self
11407 }
11408 }
11409
11410 #[doc(hidden)]
11411 impl crate::RequestBuilder for CreateMirroringEndpointGroup {
11412 fn request_options(&mut self) -> &mut crate::RequestOptions {
11413 &mut self.0.options
11414 }
11415 }
11416
11417 #[derive(Clone, Debug)]
11435 pub struct UpdateMirroringEndpointGroup(
11436 RequestBuilder<crate::model::UpdateMirroringEndpointGroupRequest>,
11437 );
11438
11439 impl UpdateMirroringEndpointGroup {
11440 pub(crate) fn new(
11441 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11442 ) -> Self {
11443 Self(RequestBuilder::new(stub))
11444 }
11445
11446 pub fn with_request<V: Into<crate::model::UpdateMirroringEndpointGroupRequest>>(
11448 mut self,
11449 v: V,
11450 ) -> Self {
11451 self.0.request = v.into();
11452 self
11453 }
11454
11455 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11457 self.0.options = v.into();
11458 self
11459 }
11460
11461 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11468 (*self.0.stub)
11469 .update_mirroring_endpoint_group(self.0.request, self.0.options)
11470 .await
11471 .map(crate::Response::into_body)
11472 }
11473
11474 pub fn poller(
11476 self,
11477 ) -> impl google_cloud_lro::Poller<
11478 crate::model::MirroringEndpointGroup,
11479 crate::model::OperationMetadata,
11480 > {
11481 type Operation = google_cloud_lro::internal::Operation<
11482 crate::model::MirroringEndpointGroup,
11483 crate::model::OperationMetadata,
11484 >;
11485 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11486 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11487
11488 let stub = self.0.stub.clone();
11489 let mut options = self.0.options.clone();
11490 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11491 let query = move |name| {
11492 let stub = stub.clone();
11493 let options = options.clone();
11494 async {
11495 let op = GetOperation::new(stub)
11496 .set_name(name)
11497 .with_options(options)
11498 .send()
11499 .await?;
11500 Ok(Operation::new(op))
11501 }
11502 };
11503
11504 let start = move || async {
11505 let op = self.send().await?;
11506 Ok(Operation::new(op))
11507 };
11508
11509 google_cloud_lro::internal::new_poller(
11510 polling_error_policy,
11511 polling_backoff_policy,
11512 start,
11513 query,
11514 )
11515 }
11516
11517 pub fn set_update_mask<T>(mut self, v: T) -> Self
11519 where
11520 T: std::convert::Into<wkt::FieldMask>,
11521 {
11522 self.0.request.update_mask = std::option::Option::Some(v.into());
11523 self
11524 }
11525
11526 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11528 where
11529 T: std::convert::Into<wkt::FieldMask>,
11530 {
11531 self.0.request.update_mask = v.map(|x| x.into());
11532 self
11533 }
11534
11535 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
11539 where
11540 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11541 {
11542 self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
11543 self
11544 }
11545
11546 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
11550 where
11551 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11552 {
11553 self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
11554 self
11555 }
11556
11557 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11559 self.0.request.request_id = v.into();
11560 self
11561 }
11562 }
11563
11564 #[doc(hidden)]
11565 impl crate::RequestBuilder for UpdateMirroringEndpointGroup {
11566 fn request_options(&mut self) -> &mut crate::RequestOptions {
11567 &mut self.0.options
11568 }
11569 }
11570
11571 #[derive(Clone, Debug)]
11589 pub struct DeleteMirroringEndpointGroup(
11590 RequestBuilder<crate::model::DeleteMirroringEndpointGroupRequest>,
11591 );
11592
11593 impl DeleteMirroringEndpointGroup {
11594 pub(crate) fn new(
11595 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11596 ) -> Self {
11597 Self(RequestBuilder::new(stub))
11598 }
11599
11600 pub fn with_request<V: Into<crate::model::DeleteMirroringEndpointGroupRequest>>(
11602 mut self,
11603 v: V,
11604 ) -> Self {
11605 self.0.request = v.into();
11606 self
11607 }
11608
11609 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11611 self.0.options = v.into();
11612 self
11613 }
11614
11615 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11622 (*self.0.stub)
11623 .delete_mirroring_endpoint_group(self.0.request, self.0.options)
11624 .await
11625 .map(crate::Response::into_body)
11626 }
11627
11628 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11630 type Operation =
11631 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11632 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11633 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11634
11635 let stub = self.0.stub.clone();
11636 let mut options = self.0.options.clone();
11637 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11638 let query = move |name| {
11639 let stub = stub.clone();
11640 let options = options.clone();
11641 async {
11642 let op = GetOperation::new(stub)
11643 .set_name(name)
11644 .with_options(options)
11645 .send()
11646 .await?;
11647 Ok(Operation::new(op))
11648 }
11649 };
11650
11651 let start = move || async {
11652 let op = self.send().await?;
11653 Ok(Operation::new(op))
11654 };
11655
11656 google_cloud_lro::internal::new_unit_response_poller(
11657 polling_error_policy,
11658 polling_backoff_policy,
11659 start,
11660 query,
11661 )
11662 }
11663
11664 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11668 self.0.request.name = v.into();
11669 self
11670 }
11671
11672 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11674 self.0.request.request_id = v.into();
11675 self
11676 }
11677 }
11678
11679 #[doc(hidden)]
11680 impl crate::RequestBuilder for DeleteMirroringEndpointGroup {
11681 fn request_options(&mut self) -> &mut crate::RequestOptions {
11682 &mut self.0.options
11683 }
11684 }
11685
11686 #[derive(Clone, Debug)]
11707 pub struct ListMirroringEndpointGroupAssociations(
11708 RequestBuilder<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11709 );
11710
11711 impl ListMirroringEndpointGroupAssociations {
11712 pub(crate) fn new(
11713 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11714 ) -> Self {
11715 Self(RequestBuilder::new(stub))
11716 }
11717
11718 pub fn with_request<
11720 V: Into<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11721 >(
11722 mut self,
11723 v: V,
11724 ) -> Self {
11725 self.0.request = v.into();
11726 self
11727 }
11728
11729 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11731 self.0.options = v.into();
11732 self
11733 }
11734
11735 pub async fn send(
11737 self,
11738 ) -> Result<crate::model::ListMirroringEndpointGroupAssociationsResponse> {
11739 (*self.0.stub)
11740 .list_mirroring_endpoint_group_associations(self.0.request, self.0.options)
11741 .await
11742 .map(crate::Response::into_body)
11743 }
11744
11745 pub fn by_page(
11747 self,
11748 ) -> impl google_cloud_gax::paginator::Paginator<
11749 crate::model::ListMirroringEndpointGroupAssociationsResponse,
11750 crate::Error,
11751 > {
11752 use std::clone::Clone;
11753 let token = self.0.request.page_token.clone();
11754 let execute = move |token: String| {
11755 let mut builder = self.clone();
11756 builder.0.request = builder.0.request.set_page_token(token);
11757 builder.send()
11758 };
11759 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11760 }
11761
11762 pub fn by_item(
11764 self,
11765 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11766 crate::model::ListMirroringEndpointGroupAssociationsResponse,
11767 crate::Error,
11768 > {
11769 use google_cloud_gax::paginator::Paginator;
11770 self.by_page().items()
11771 }
11772
11773 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11777 self.0.request.parent = v.into();
11778 self
11779 }
11780
11781 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11783 self.0.request.page_size = v.into();
11784 self
11785 }
11786
11787 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11789 self.0.request.page_token = v.into();
11790 self
11791 }
11792
11793 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11795 self.0.request.filter = v.into();
11796 self
11797 }
11798
11799 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11801 self.0.request.order_by = v.into();
11802 self
11803 }
11804 }
11805
11806 #[doc(hidden)]
11807 impl crate::RequestBuilder for ListMirroringEndpointGroupAssociations {
11808 fn request_options(&mut self) -> &mut crate::RequestOptions {
11809 &mut self.0.options
11810 }
11811 }
11812
11813 #[derive(Clone, Debug)]
11830 pub struct GetMirroringEndpointGroupAssociation(
11831 RequestBuilder<crate::model::GetMirroringEndpointGroupAssociationRequest>,
11832 );
11833
11834 impl GetMirroringEndpointGroupAssociation {
11835 pub(crate) fn new(
11836 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11837 ) -> Self {
11838 Self(RequestBuilder::new(stub))
11839 }
11840
11841 pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupAssociationRequest>>(
11843 mut self,
11844 v: V,
11845 ) -> Self {
11846 self.0.request = v.into();
11847 self
11848 }
11849
11850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11852 self.0.options = v.into();
11853 self
11854 }
11855
11856 pub async fn send(self) -> Result<crate::model::MirroringEndpointGroupAssociation> {
11858 (*self.0.stub)
11859 .get_mirroring_endpoint_group_association(self.0.request, self.0.options)
11860 .await
11861 .map(crate::Response::into_body)
11862 }
11863
11864 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11868 self.0.request.name = v.into();
11869 self
11870 }
11871 }
11872
11873 #[doc(hidden)]
11874 impl crate::RequestBuilder for GetMirroringEndpointGroupAssociation {
11875 fn request_options(&mut self) -> &mut crate::RequestOptions {
11876 &mut self.0.options
11877 }
11878 }
11879
11880 #[derive(Clone, Debug)]
11898 pub struct CreateMirroringEndpointGroupAssociation(
11899 RequestBuilder<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11900 );
11901
11902 impl CreateMirroringEndpointGroupAssociation {
11903 pub(crate) fn new(
11904 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11905 ) -> Self {
11906 Self(RequestBuilder::new(stub))
11907 }
11908
11909 pub fn with_request<
11911 V: Into<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11912 >(
11913 mut self,
11914 v: V,
11915 ) -> Self {
11916 self.0.request = v.into();
11917 self
11918 }
11919
11920 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11922 self.0.options = v.into();
11923 self
11924 }
11925
11926 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11933 (*self.0.stub)
11934 .create_mirroring_endpoint_group_association(self.0.request, self.0.options)
11935 .await
11936 .map(crate::Response::into_body)
11937 }
11938
11939 pub fn poller(
11941 self,
11942 ) -> impl google_cloud_lro::Poller<
11943 crate::model::MirroringEndpointGroupAssociation,
11944 crate::model::OperationMetadata,
11945 > {
11946 type Operation = google_cloud_lro::internal::Operation<
11947 crate::model::MirroringEndpointGroupAssociation,
11948 crate::model::OperationMetadata,
11949 >;
11950 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11951 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11952
11953 let stub = self.0.stub.clone();
11954 let mut options = self.0.options.clone();
11955 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11956 let query = move |name| {
11957 let stub = stub.clone();
11958 let options = options.clone();
11959 async {
11960 let op = GetOperation::new(stub)
11961 .set_name(name)
11962 .with_options(options)
11963 .send()
11964 .await?;
11965 Ok(Operation::new(op))
11966 }
11967 };
11968
11969 let start = move || async {
11970 let op = self.send().await?;
11971 Ok(Operation::new(op))
11972 };
11973
11974 google_cloud_lro::internal::new_poller(
11975 polling_error_policy,
11976 polling_backoff_policy,
11977 start,
11978 query,
11979 )
11980 }
11981
11982 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11986 self.0.request.parent = v.into();
11987 self
11988 }
11989
11990 pub fn set_mirroring_endpoint_group_association_id<T: Into<std::string::String>>(
11992 mut self,
11993 v: T,
11994 ) -> Self {
11995 self.0.request.mirroring_endpoint_group_association_id = v.into();
11996 self
11997 }
11998
11999 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
12003 where
12004 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12005 {
12006 self.0.request.mirroring_endpoint_group_association =
12007 std::option::Option::Some(v.into());
12008 self
12009 }
12010
12011 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
12015 mut self,
12016 v: std::option::Option<T>,
12017 ) -> Self
12018 where
12019 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12020 {
12021 self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
12022 self
12023 }
12024
12025 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12027 self.0.request.request_id = v.into();
12028 self
12029 }
12030 }
12031
12032 #[doc(hidden)]
12033 impl crate::RequestBuilder for CreateMirroringEndpointGroupAssociation {
12034 fn request_options(&mut self) -> &mut crate::RequestOptions {
12035 &mut self.0.options
12036 }
12037 }
12038
12039 #[derive(Clone, Debug)]
12057 pub struct UpdateMirroringEndpointGroupAssociation(
12058 RequestBuilder<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
12059 );
12060
12061 impl UpdateMirroringEndpointGroupAssociation {
12062 pub(crate) fn new(
12063 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12064 ) -> Self {
12065 Self(RequestBuilder::new(stub))
12066 }
12067
12068 pub fn with_request<
12070 V: Into<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
12071 >(
12072 mut self,
12073 v: V,
12074 ) -> Self {
12075 self.0.request = v.into();
12076 self
12077 }
12078
12079 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12081 self.0.options = v.into();
12082 self
12083 }
12084
12085 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12092 (*self.0.stub)
12093 .update_mirroring_endpoint_group_association(self.0.request, self.0.options)
12094 .await
12095 .map(crate::Response::into_body)
12096 }
12097
12098 pub fn poller(
12100 self,
12101 ) -> impl google_cloud_lro::Poller<
12102 crate::model::MirroringEndpointGroupAssociation,
12103 crate::model::OperationMetadata,
12104 > {
12105 type Operation = google_cloud_lro::internal::Operation<
12106 crate::model::MirroringEndpointGroupAssociation,
12107 crate::model::OperationMetadata,
12108 >;
12109 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12110 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12111
12112 let stub = self.0.stub.clone();
12113 let mut options = self.0.options.clone();
12114 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12115 let query = move |name| {
12116 let stub = stub.clone();
12117 let options = options.clone();
12118 async {
12119 let op = GetOperation::new(stub)
12120 .set_name(name)
12121 .with_options(options)
12122 .send()
12123 .await?;
12124 Ok(Operation::new(op))
12125 }
12126 };
12127
12128 let start = move || async {
12129 let op = self.send().await?;
12130 Ok(Operation::new(op))
12131 };
12132
12133 google_cloud_lro::internal::new_poller(
12134 polling_error_policy,
12135 polling_backoff_policy,
12136 start,
12137 query,
12138 )
12139 }
12140
12141 pub fn set_update_mask<T>(mut self, v: T) -> Self
12143 where
12144 T: std::convert::Into<wkt::FieldMask>,
12145 {
12146 self.0.request.update_mask = std::option::Option::Some(v.into());
12147 self
12148 }
12149
12150 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12152 where
12153 T: std::convert::Into<wkt::FieldMask>,
12154 {
12155 self.0.request.update_mask = v.map(|x| x.into());
12156 self
12157 }
12158
12159 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
12163 where
12164 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12165 {
12166 self.0.request.mirroring_endpoint_group_association =
12167 std::option::Option::Some(v.into());
12168 self
12169 }
12170
12171 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
12175 mut self,
12176 v: std::option::Option<T>,
12177 ) -> Self
12178 where
12179 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12180 {
12181 self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
12182 self
12183 }
12184
12185 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12187 self.0.request.request_id = v.into();
12188 self
12189 }
12190 }
12191
12192 #[doc(hidden)]
12193 impl crate::RequestBuilder for UpdateMirroringEndpointGroupAssociation {
12194 fn request_options(&mut self) -> &mut crate::RequestOptions {
12195 &mut self.0.options
12196 }
12197 }
12198
12199 #[derive(Clone, Debug)]
12217 pub struct DeleteMirroringEndpointGroupAssociation(
12218 RequestBuilder<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
12219 );
12220
12221 impl DeleteMirroringEndpointGroupAssociation {
12222 pub(crate) fn new(
12223 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12224 ) -> Self {
12225 Self(RequestBuilder::new(stub))
12226 }
12227
12228 pub fn with_request<
12230 V: Into<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
12231 >(
12232 mut self,
12233 v: V,
12234 ) -> Self {
12235 self.0.request = v.into();
12236 self
12237 }
12238
12239 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12241 self.0.options = v.into();
12242 self
12243 }
12244
12245 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12252 (*self.0.stub)
12253 .delete_mirroring_endpoint_group_association(self.0.request, self.0.options)
12254 .await
12255 .map(crate::Response::into_body)
12256 }
12257
12258 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12260 type Operation =
12261 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12262 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12263 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12264
12265 let stub = self.0.stub.clone();
12266 let mut options = self.0.options.clone();
12267 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12268 let query = move |name| {
12269 let stub = stub.clone();
12270 let options = options.clone();
12271 async {
12272 let op = GetOperation::new(stub)
12273 .set_name(name)
12274 .with_options(options)
12275 .send()
12276 .await?;
12277 Ok(Operation::new(op))
12278 }
12279 };
12280
12281 let start = move || async {
12282 let op = self.send().await?;
12283 Ok(Operation::new(op))
12284 };
12285
12286 google_cloud_lro::internal::new_unit_response_poller(
12287 polling_error_policy,
12288 polling_backoff_policy,
12289 start,
12290 query,
12291 )
12292 }
12293
12294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12298 self.0.request.name = v.into();
12299 self
12300 }
12301
12302 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12304 self.0.request.request_id = v.into();
12305 self
12306 }
12307 }
12308
12309 #[doc(hidden)]
12310 impl crate::RequestBuilder for DeleteMirroringEndpointGroupAssociation {
12311 fn request_options(&mut self) -> &mut crate::RequestOptions {
12312 &mut self.0.options
12313 }
12314 }
12315
12316 #[derive(Clone, Debug)]
12337 pub struct ListMirroringDeploymentGroups(
12338 RequestBuilder<crate::model::ListMirroringDeploymentGroupsRequest>,
12339 );
12340
12341 impl ListMirroringDeploymentGroups {
12342 pub(crate) fn new(
12343 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12344 ) -> Self {
12345 Self(RequestBuilder::new(stub))
12346 }
12347
12348 pub fn with_request<V: Into<crate::model::ListMirroringDeploymentGroupsRequest>>(
12350 mut self,
12351 v: V,
12352 ) -> Self {
12353 self.0.request = v.into();
12354 self
12355 }
12356
12357 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12359 self.0.options = v.into();
12360 self
12361 }
12362
12363 pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentGroupsResponse> {
12365 (*self.0.stub)
12366 .list_mirroring_deployment_groups(self.0.request, self.0.options)
12367 .await
12368 .map(crate::Response::into_body)
12369 }
12370
12371 pub fn by_page(
12373 self,
12374 ) -> impl google_cloud_gax::paginator::Paginator<
12375 crate::model::ListMirroringDeploymentGroupsResponse,
12376 crate::Error,
12377 > {
12378 use std::clone::Clone;
12379 let token = self.0.request.page_token.clone();
12380 let execute = move |token: String| {
12381 let mut builder = self.clone();
12382 builder.0.request = builder.0.request.set_page_token(token);
12383 builder.send()
12384 };
12385 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12386 }
12387
12388 pub fn by_item(
12390 self,
12391 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12392 crate::model::ListMirroringDeploymentGroupsResponse,
12393 crate::Error,
12394 > {
12395 use google_cloud_gax::paginator::Paginator;
12396 self.by_page().items()
12397 }
12398
12399 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12403 self.0.request.parent = v.into();
12404 self
12405 }
12406
12407 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12409 self.0.request.page_size = v.into();
12410 self
12411 }
12412
12413 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12415 self.0.request.page_token = v.into();
12416 self
12417 }
12418
12419 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12421 self.0.request.filter = v.into();
12422 self
12423 }
12424
12425 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12427 self.0.request.order_by = v.into();
12428 self
12429 }
12430 }
12431
12432 #[doc(hidden)]
12433 impl crate::RequestBuilder for ListMirroringDeploymentGroups {
12434 fn request_options(&mut self) -> &mut crate::RequestOptions {
12435 &mut self.0.options
12436 }
12437 }
12438
12439 #[derive(Clone, Debug)]
12456 pub struct GetMirroringDeploymentGroup(
12457 RequestBuilder<crate::model::GetMirroringDeploymentGroupRequest>,
12458 );
12459
12460 impl GetMirroringDeploymentGroup {
12461 pub(crate) fn new(
12462 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12463 ) -> Self {
12464 Self(RequestBuilder::new(stub))
12465 }
12466
12467 pub fn with_request<V: Into<crate::model::GetMirroringDeploymentGroupRequest>>(
12469 mut self,
12470 v: V,
12471 ) -> Self {
12472 self.0.request = v.into();
12473 self
12474 }
12475
12476 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12478 self.0.options = v.into();
12479 self
12480 }
12481
12482 pub async fn send(self) -> Result<crate::model::MirroringDeploymentGroup> {
12484 (*self.0.stub)
12485 .get_mirroring_deployment_group(self.0.request, self.0.options)
12486 .await
12487 .map(crate::Response::into_body)
12488 }
12489
12490 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12494 self.0.request.name = v.into();
12495 self
12496 }
12497 }
12498
12499 #[doc(hidden)]
12500 impl crate::RequestBuilder for GetMirroringDeploymentGroup {
12501 fn request_options(&mut self) -> &mut crate::RequestOptions {
12502 &mut self.0.options
12503 }
12504 }
12505
12506 #[derive(Clone, Debug)]
12524 pub struct CreateMirroringDeploymentGroup(
12525 RequestBuilder<crate::model::CreateMirroringDeploymentGroupRequest>,
12526 );
12527
12528 impl CreateMirroringDeploymentGroup {
12529 pub(crate) fn new(
12530 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12531 ) -> Self {
12532 Self(RequestBuilder::new(stub))
12533 }
12534
12535 pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentGroupRequest>>(
12537 mut self,
12538 v: V,
12539 ) -> Self {
12540 self.0.request = v.into();
12541 self
12542 }
12543
12544 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12546 self.0.options = v.into();
12547 self
12548 }
12549
12550 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12557 (*self.0.stub)
12558 .create_mirroring_deployment_group(self.0.request, self.0.options)
12559 .await
12560 .map(crate::Response::into_body)
12561 }
12562
12563 pub fn poller(
12565 self,
12566 ) -> impl google_cloud_lro::Poller<
12567 crate::model::MirroringDeploymentGroup,
12568 crate::model::OperationMetadata,
12569 > {
12570 type Operation = google_cloud_lro::internal::Operation<
12571 crate::model::MirroringDeploymentGroup,
12572 crate::model::OperationMetadata,
12573 >;
12574 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12575 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12576
12577 let stub = self.0.stub.clone();
12578 let mut options = self.0.options.clone();
12579 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12580 let query = move |name| {
12581 let stub = stub.clone();
12582 let options = options.clone();
12583 async {
12584 let op = GetOperation::new(stub)
12585 .set_name(name)
12586 .with_options(options)
12587 .send()
12588 .await?;
12589 Ok(Operation::new(op))
12590 }
12591 };
12592
12593 let start = move || async {
12594 let op = self.send().await?;
12595 Ok(Operation::new(op))
12596 };
12597
12598 google_cloud_lro::internal::new_poller(
12599 polling_error_policy,
12600 polling_backoff_policy,
12601 start,
12602 query,
12603 )
12604 }
12605
12606 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12610 self.0.request.parent = v.into();
12611 self
12612 }
12613
12614 pub fn set_mirroring_deployment_group_id<T: Into<std::string::String>>(
12618 mut self,
12619 v: T,
12620 ) -> Self {
12621 self.0.request.mirroring_deployment_group_id = v.into();
12622 self
12623 }
12624
12625 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12629 where
12630 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12631 {
12632 self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12633 self
12634 }
12635
12636 pub fn set_or_clear_mirroring_deployment_group<T>(
12640 mut self,
12641 v: std::option::Option<T>,
12642 ) -> Self
12643 where
12644 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12645 {
12646 self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12647 self
12648 }
12649
12650 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12652 self.0.request.request_id = v.into();
12653 self
12654 }
12655 }
12656
12657 #[doc(hidden)]
12658 impl crate::RequestBuilder for CreateMirroringDeploymentGroup {
12659 fn request_options(&mut self) -> &mut crate::RequestOptions {
12660 &mut self.0.options
12661 }
12662 }
12663
12664 #[derive(Clone, Debug)]
12682 pub struct UpdateMirroringDeploymentGroup(
12683 RequestBuilder<crate::model::UpdateMirroringDeploymentGroupRequest>,
12684 );
12685
12686 impl UpdateMirroringDeploymentGroup {
12687 pub(crate) fn new(
12688 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12689 ) -> Self {
12690 Self(RequestBuilder::new(stub))
12691 }
12692
12693 pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentGroupRequest>>(
12695 mut self,
12696 v: V,
12697 ) -> Self {
12698 self.0.request = v.into();
12699 self
12700 }
12701
12702 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12704 self.0.options = v.into();
12705 self
12706 }
12707
12708 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12715 (*self.0.stub)
12716 .update_mirroring_deployment_group(self.0.request, self.0.options)
12717 .await
12718 .map(crate::Response::into_body)
12719 }
12720
12721 pub fn poller(
12723 self,
12724 ) -> impl google_cloud_lro::Poller<
12725 crate::model::MirroringDeploymentGroup,
12726 crate::model::OperationMetadata,
12727 > {
12728 type Operation = google_cloud_lro::internal::Operation<
12729 crate::model::MirroringDeploymentGroup,
12730 crate::model::OperationMetadata,
12731 >;
12732 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12733 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12734
12735 let stub = self.0.stub.clone();
12736 let mut options = self.0.options.clone();
12737 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12738 let query = move |name| {
12739 let stub = stub.clone();
12740 let options = options.clone();
12741 async {
12742 let op = GetOperation::new(stub)
12743 .set_name(name)
12744 .with_options(options)
12745 .send()
12746 .await?;
12747 Ok(Operation::new(op))
12748 }
12749 };
12750
12751 let start = move || async {
12752 let op = self.send().await?;
12753 Ok(Operation::new(op))
12754 };
12755
12756 google_cloud_lro::internal::new_poller(
12757 polling_error_policy,
12758 polling_backoff_policy,
12759 start,
12760 query,
12761 )
12762 }
12763
12764 pub fn set_update_mask<T>(mut self, v: T) -> Self
12766 where
12767 T: std::convert::Into<wkt::FieldMask>,
12768 {
12769 self.0.request.update_mask = std::option::Option::Some(v.into());
12770 self
12771 }
12772
12773 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12775 where
12776 T: std::convert::Into<wkt::FieldMask>,
12777 {
12778 self.0.request.update_mask = v.map(|x| x.into());
12779 self
12780 }
12781
12782 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12786 where
12787 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12788 {
12789 self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12790 self
12791 }
12792
12793 pub fn set_or_clear_mirroring_deployment_group<T>(
12797 mut self,
12798 v: std::option::Option<T>,
12799 ) -> Self
12800 where
12801 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12802 {
12803 self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12804 self
12805 }
12806
12807 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12809 self.0.request.request_id = v.into();
12810 self
12811 }
12812 }
12813
12814 #[doc(hidden)]
12815 impl crate::RequestBuilder for UpdateMirroringDeploymentGroup {
12816 fn request_options(&mut self) -> &mut crate::RequestOptions {
12817 &mut self.0.options
12818 }
12819 }
12820
12821 #[derive(Clone, Debug)]
12839 pub struct DeleteMirroringDeploymentGroup(
12840 RequestBuilder<crate::model::DeleteMirroringDeploymentGroupRequest>,
12841 );
12842
12843 impl DeleteMirroringDeploymentGroup {
12844 pub(crate) fn new(
12845 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12846 ) -> Self {
12847 Self(RequestBuilder::new(stub))
12848 }
12849
12850 pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentGroupRequest>>(
12852 mut self,
12853 v: V,
12854 ) -> Self {
12855 self.0.request = v.into();
12856 self
12857 }
12858
12859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12861 self.0.options = v.into();
12862 self
12863 }
12864
12865 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12872 (*self.0.stub)
12873 .delete_mirroring_deployment_group(self.0.request, self.0.options)
12874 .await
12875 .map(crate::Response::into_body)
12876 }
12877
12878 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12880 type Operation =
12881 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12882 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12883 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12884
12885 let stub = self.0.stub.clone();
12886 let mut options = self.0.options.clone();
12887 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12888 let query = move |name| {
12889 let stub = stub.clone();
12890 let options = options.clone();
12891 async {
12892 let op = GetOperation::new(stub)
12893 .set_name(name)
12894 .with_options(options)
12895 .send()
12896 .await?;
12897 Ok(Operation::new(op))
12898 }
12899 };
12900
12901 let start = move || async {
12902 let op = self.send().await?;
12903 Ok(Operation::new(op))
12904 };
12905
12906 google_cloud_lro::internal::new_unit_response_poller(
12907 polling_error_policy,
12908 polling_backoff_policy,
12909 start,
12910 query,
12911 )
12912 }
12913
12914 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12918 self.0.request.name = v.into();
12919 self
12920 }
12921
12922 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12924 self.0.request.request_id = v.into();
12925 self
12926 }
12927 }
12928
12929 #[doc(hidden)]
12930 impl crate::RequestBuilder for DeleteMirroringDeploymentGroup {
12931 fn request_options(&mut self) -> &mut crate::RequestOptions {
12932 &mut self.0.options
12933 }
12934 }
12935
12936 #[derive(Clone, Debug)]
12957 pub struct ListMirroringDeployments(
12958 RequestBuilder<crate::model::ListMirroringDeploymentsRequest>,
12959 );
12960
12961 impl ListMirroringDeployments {
12962 pub(crate) fn new(
12963 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12964 ) -> Self {
12965 Self(RequestBuilder::new(stub))
12966 }
12967
12968 pub fn with_request<V: Into<crate::model::ListMirroringDeploymentsRequest>>(
12970 mut self,
12971 v: V,
12972 ) -> Self {
12973 self.0.request = v.into();
12974 self
12975 }
12976
12977 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12979 self.0.options = v.into();
12980 self
12981 }
12982
12983 pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentsResponse> {
12985 (*self.0.stub)
12986 .list_mirroring_deployments(self.0.request, self.0.options)
12987 .await
12988 .map(crate::Response::into_body)
12989 }
12990
12991 pub fn by_page(
12993 self,
12994 ) -> impl google_cloud_gax::paginator::Paginator<
12995 crate::model::ListMirroringDeploymentsResponse,
12996 crate::Error,
12997 > {
12998 use std::clone::Clone;
12999 let token = self.0.request.page_token.clone();
13000 let execute = move |token: String| {
13001 let mut builder = self.clone();
13002 builder.0.request = builder.0.request.set_page_token(token);
13003 builder.send()
13004 };
13005 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13006 }
13007
13008 pub fn by_item(
13010 self,
13011 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13012 crate::model::ListMirroringDeploymentsResponse,
13013 crate::Error,
13014 > {
13015 use google_cloud_gax::paginator::Paginator;
13016 self.by_page().items()
13017 }
13018
13019 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13023 self.0.request.parent = v.into();
13024 self
13025 }
13026
13027 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13029 self.0.request.page_size = v.into();
13030 self
13031 }
13032
13033 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13035 self.0.request.page_token = v.into();
13036 self
13037 }
13038
13039 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13041 self.0.request.filter = v.into();
13042 self
13043 }
13044
13045 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13047 self.0.request.order_by = v.into();
13048 self
13049 }
13050 }
13051
13052 #[doc(hidden)]
13053 impl crate::RequestBuilder for ListMirroringDeployments {
13054 fn request_options(&mut self) -> &mut crate::RequestOptions {
13055 &mut self.0.options
13056 }
13057 }
13058
13059 #[derive(Clone, Debug)]
13076 pub struct GetMirroringDeployment(RequestBuilder<crate::model::GetMirroringDeploymentRequest>);
13077
13078 impl GetMirroringDeployment {
13079 pub(crate) fn new(
13080 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13081 ) -> Self {
13082 Self(RequestBuilder::new(stub))
13083 }
13084
13085 pub fn with_request<V: Into<crate::model::GetMirroringDeploymentRequest>>(
13087 mut self,
13088 v: V,
13089 ) -> Self {
13090 self.0.request = v.into();
13091 self
13092 }
13093
13094 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13096 self.0.options = v.into();
13097 self
13098 }
13099
13100 pub async fn send(self) -> Result<crate::model::MirroringDeployment> {
13102 (*self.0.stub)
13103 .get_mirroring_deployment(self.0.request, self.0.options)
13104 .await
13105 .map(crate::Response::into_body)
13106 }
13107
13108 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13112 self.0.request.name = v.into();
13113 self
13114 }
13115 }
13116
13117 #[doc(hidden)]
13118 impl crate::RequestBuilder for GetMirroringDeployment {
13119 fn request_options(&mut self) -> &mut crate::RequestOptions {
13120 &mut self.0.options
13121 }
13122 }
13123
13124 #[derive(Clone, Debug)]
13142 pub struct CreateMirroringDeployment(
13143 RequestBuilder<crate::model::CreateMirroringDeploymentRequest>,
13144 );
13145
13146 impl CreateMirroringDeployment {
13147 pub(crate) fn new(
13148 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13149 ) -> Self {
13150 Self(RequestBuilder::new(stub))
13151 }
13152
13153 pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentRequest>>(
13155 mut self,
13156 v: V,
13157 ) -> Self {
13158 self.0.request = v.into();
13159 self
13160 }
13161
13162 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13164 self.0.options = v.into();
13165 self
13166 }
13167
13168 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13175 (*self.0.stub)
13176 .create_mirroring_deployment(self.0.request, self.0.options)
13177 .await
13178 .map(crate::Response::into_body)
13179 }
13180
13181 pub fn poller(
13183 self,
13184 ) -> impl google_cloud_lro::Poller<
13185 crate::model::MirroringDeployment,
13186 crate::model::OperationMetadata,
13187 > {
13188 type Operation = google_cloud_lro::internal::Operation<
13189 crate::model::MirroringDeployment,
13190 crate::model::OperationMetadata,
13191 >;
13192 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13193 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13194
13195 let stub = self.0.stub.clone();
13196 let mut options = self.0.options.clone();
13197 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13198 let query = move |name| {
13199 let stub = stub.clone();
13200 let options = options.clone();
13201 async {
13202 let op = GetOperation::new(stub)
13203 .set_name(name)
13204 .with_options(options)
13205 .send()
13206 .await?;
13207 Ok(Operation::new(op))
13208 }
13209 };
13210
13211 let start = move || async {
13212 let op = self.send().await?;
13213 Ok(Operation::new(op))
13214 };
13215
13216 google_cloud_lro::internal::new_poller(
13217 polling_error_policy,
13218 polling_backoff_policy,
13219 start,
13220 query,
13221 )
13222 }
13223
13224 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13228 self.0.request.parent = v.into();
13229 self
13230 }
13231
13232 pub fn set_mirroring_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13236 self.0.request.mirroring_deployment_id = v.into();
13237 self
13238 }
13239
13240 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
13244 where
13245 T: std::convert::Into<crate::model::MirroringDeployment>,
13246 {
13247 self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
13248 self
13249 }
13250
13251 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
13255 where
13256 T: std::convert::Into<crate::model::MirroringDeployment>,
13257 {
13258 self.0.request.mirroring_deployment = v.map(|x| x.into());
13259 self
13260 }
13261
13262 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13264 self.0.request.request_id = v.into();
13265 self
13266 }
13267 }
13268
13269 #[doc(hidden)]
13270 impl crate::RequestBuilder for CreateMirroringDeployment {
13271 fn request_options(&mut self) -> &mut crate::RequestOptions {
13272 &mut self.0.options
13273 }
13274 }
13275
13276 #[derive(Clone, Debug)]
13294 pub struct UpdateMirroringDeployment(
13295 RequestBuilder<crate::model::UpdateMirroringDeploymentRequest>,
13296 );
13297
13298 impl UpdateMirroringDeployment {
13299 pub(crate) fn new(
13300 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13301 ) -> Self {
13302 Self(RequestBuilder::new(stub))
13303 }
13304
13305 pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentRequest>>(
13307 mut self,
13308 v: V,
13309 ) -> Self {
13310 self.0.request = v.into();
13311 self
13312 }
13313
13314 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13316 self.0.options = v.into();
13317 self
13318 }
13319
13320 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13327 (*self.0.stub)
13328 .update_mirroring_deployment(self.0.request, self.0.options)
13329 .await
13330 .map(crate::Response::into_body)
13331 }
13332
13333 pub fn poller(
13335 self,
13336 ) -> impl google_cloud_lro::Poller<
13337 crate::model::MirroringDeployment,
13338 crate::model::OperationMetadata,
13339 > {
13340 type Operation = google_cloud_lro::internal::Operation<
13341 crate::model::MirroringDeployment,
13342 crate::model::OperationMetadata,
13343 >;
13344 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13345 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13346
13347 let stub = self.0.stub.clone();
13348 let mut options = self.0.options.clone();
13349 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13350 let query = move |name| {
13351 let stub = stub.clone();
13352 let options = options.clone();
13353 async {
13354 let op = GetOperation::new(stub)
13355 .set_name(name)
13356 .with_options(options)
13357 .send()
13358 .await?;
13359 Ok(Operation::new(op))
13360 }
13361 };
13362
13363 let start = move || async {
13364 let op = self.send().await?;
13365 Ok(Operation::new(op))
13366 };
13367
13368 google_cloud_lro::internal::new_poller(
13369 polling_error_policy,
13370 polling_backoff_policy,
13371 start,
13372 query,
13373 )
13374 }
13375
13376 pub fn set_update_mask<T>(mut self, v: T) -> Self
13378 where
13379 T: std::convert::Into<wkt::FieldMask>,
13380 {
13381 self.0.request.update_mask = std::option::Option::Some(v.into());
13382 self
13383 }
13384
13385 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13387 where
13388 T: std::convert::Into<wkt::FieldMask>,
13389 {
13390 self.0.request.update_mask = v.map(|x| x.into());
13391 self
13392 }
13393
13394 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
13398 where
13399 T: std::convert::Into<crate::model::MirroringDeployment>,
13400 {
13401 self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
13402 self
13403 }
13404
13405 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
13409 where
13410 T: std::convert::Into<crate::model::MirroringDeployment>,
13411 {
13412 self.0.request.mirroring_deployment = v.map(|x| x.into());
13413 self
13414 }
13415
13416 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13418 self.0.request.request_id = v.into();
13419 self
13420 }
13421 }
13422
13423 #[doc(hidden)]
13424 impl crate::RequestBuilder for UpdateMirroringDeployment {
13425 fn request_options(&mut self) -> &mut crate::RequestOptions {
13426 &mut self.0.options
13427 }
13428 }
13429
13430 #[derive(Clone, Debug)]
13448 pub struct DeleteMirroringDeployment(
13449 RequestBuilder<crate::model::DeleteMirroringDeploymentRequest>,
13450 );
13451
13452 impl DeleteMirroringDeployment {
13453 pub(crate) fn new(
13454 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13455 ) -> Self {
13456 Self(RequestBuilder::new(stub))
13457 }
13458
13459 pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentRequest>>(
13461 mut self,
13462 v: V,
13463 ) -> Self {
13464 self.0.request = v.into();
13465 self
13466 }
13467
13468 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13470 self.0.options = v.into();
13471 self
13472 }
13473
13474 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13481 (*self.0.stub)
13482 .delete_mirroring_deployment(self.0.request, self.0.options)
13483 .await
13484 .map(crate::Response::into_body)
13485 }
13486
13487 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
13489 type Operation =
13490 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13491 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13492 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13493
13494 let stub = self.0.stub.clone();
13495 let mut options = self.0.options.clone();
13496 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13497 let query = move |name| {
13498 let stub = stub.clone();
13499 let options = options.clone();
13500 async {
13501 let op = GetOperation::new(stub)
13502 .set_name(name)
13503 .with_options(options)
13504 .send()
13505 .await?;
13506 Ok(Operation::new(op))
13507 }
13508 };
13509
13510 let start = move || async {
13511 let op = self.send().await?;
13512 Ok(Operation::new(op))
13513 };
13514
13515 google_cloud_lro::internal::new_unit_response_poller(
13516 polling_error_policy,
13517 polling_backoff_policy,
13518 start,
13519 query,
13520 )
13521 }
13522
13523 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13527 self.0.request.name = v.into();
13528 self
13529 }
13530
13531 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13533 self.0.request.request_id = v.into();
13534 self
13535 }
13536 }
13537
13538 #[doc(hidden)]
13539 impl crate::RequestBuilder for DeleteMirroringDeployment {
13540 fn request_options(&mut self) -> &mut crate::RequestOptions {
13541 &mut self.0.options
13542 }
13543 }
13544
13545 #[derive(Clone, Debug)]
13566 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13567
13568 impl ListLocations {
13569 pub(crate) fn new(
13570 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13571 ) -> Self {
13572 Self(RequestBuilder::new(stub))
13573 }
13574
13575 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13577 mut self,
13578 v: V,
13579 ) -> Self {
13580 self.0.request = v.into();
13581 self
13582 }
13583
13584 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13586 self.0.options = v.into();
13587 self
13588 }
13589
13590 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13592 (*self.0.stub)
13593 .list_locations(self.0.request, self.0.options)
13594 .await
13595 .map(crate::Response::into_body)
13596 }
13597
13598 pub fn by_page(
13600 self,
13601 ) -> impl google_cloud_gax::paginator::Paginator<
13602 google_cloud_location::model::ListLocationsResponse,
13603 crate::Error,
13604 > {
13605 use std::clone::Clone;
13606 let token = self.0.request.page_token.clone();
13607 let execute = move |token: String| {
13608 let mut builder = self.clone();
13609 builder.0.request = builder.0.request.set_page_token(token);
13610 builder.send()
13611 };
13612 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13613 }
13614
13615 pub fn by_item(
13617 self,
13618 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13619 google_cloud_location::model::ListLocationsResponse,
13620 crate::Error,
13621 > {
13622 use google_cloud_gax::paginator::Paginator;
13623 self.by_page().items()
13624 }
13625
13626 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13628 self.0.request.name = v.into();
13629 self
13630 }
13631
13632 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13634 self.0.request.filter = v.into();
13635 self
13636 }
13637
13638 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13640 self.0.request.page_size = v.into();
13641 self
13642 }
13643
13644 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13646 self.0.request.page_token = v.into();
13647 self
13648 }
13649 }
13650
13651 #[doc(hidden)]
13652 impl crate::RequestBuilder for ListLocations {
13653 fn request_options(&mut self) -> &mut crate::RequestOptions {
13654 &mut self.0.options
13655 }
13656 }
13657
13658 #[derive(Clone, Debug)]
13675 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13676
13677 impl GetLocation {
13678 pub(crate) fn new(
13679 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13680 ) -> Self {
13681 Self(RequestBuilder::new(stub))
13682 }
13683
13684 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13686 mut self,
13687 v: V,
13688 ) -> Self {
13689 self.0.request = v.into();
13690 self
13691 }
13692
13693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13695 self.0.options = v.into();
13696 self
13697 }
13698
13699 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13701 (*self.0.stub)
13702 .get_location(self.0.request, self.0.options)
13703 .await
13704 .map(crate::Response::into_body)
13705 }
13706
13707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13709 self.0.request.name = v.into();
13710 self
13711 }
13712 }
13713
13714 #[doc(hidden)]
13715 impl crate::RequestBuilder for GetLocation {
13716 fn request_options(&mut self) -> &mut crate::RequestOptions {
13717 &mut self.0.options
13718 }
13719 }
13720
13721 #[derive(Clone, Debug)]
13738 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13739
13740 impl SetIamPolicy {
13741 pub(crate) fn new(
13742 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13743 ) -> Self {
13744 Self(RequestBuilder::new(stub))
13745 }
13746
13747 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13749 mut self,
13750 v: V,
13751 ) -> Self {
13752 self.0.request = v.into();
13753 self
13754 }
13755
13756 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13758 self.0.options = v.into();
13759 self
13760 }
13761
13762 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13764 (*self.0.stub)
13765 .set_iam_policy(self.0.request, self.0.options)
13766 .await
13767 .map(crate::Response::into_body)
13768 }
13769
13770 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13774 self.0.request.resource = v.into();
13775 self
13776 }
13777
13778 pub fn set_policy<T>(mut self, v: T) -> Self
13782 where
13783 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13784 {
13785 self.0.request.policy = std::option::Option::Some(v.into());
13786 self
13787 }
13788
13789 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13793 where
13794 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13795 {
13796 self.0.request.policy = v.map(|x| x.into());
13797 self
13798 }
13799
13800 pub fn set_update_mask<T>(mut self, v: T) -> Self
13802 where
13803 T: std::convert::Into<wkt::FieldMask>,
13804 {
13805 self.0.request.update_mask = std::option::Option::Some(v.into());
13806 self
13807 }
13808
13809 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13811 where
13812 T: std::convert::Into<wkt::FieldMask>,
13813 {
13814 self.0.request.update_mask = v.map(|x| x.into());
13815 self
13816 }
13817 }
13818
13819 #[doc(hidden)]
13820 impl crate::RequestBuilder for SetIamPolicy {
13821 fn request_options(&mut self) -> &mut crate::RequestOptions {
13822 &mut self.0.options
13823 }
13824 }
13825
13826 #[derive(Clone, Debug)]
13843 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13844
13845 impl GetIamPolicy {
13846 pub(crate) fn new(
13847 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13848 ) -> Self {
13849 Self(RequestBuilder::new(stub))
13850 }
13851
13852 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13854 mut self,
13855 v: V,
13856 ) -> Self {
13857 self.0.request = v.into();
13858 self
13859 }
13860
13861 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13863 self.0.options = v.into();
13864 self
13865 }
13866
13867 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13869 (*self.0.stub)
13870 .get_iam_policy(self.0.request, self.0.options)
13871 .await
13872 .map(crate::Response::into_body)
13873 }
13874
13875 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13879 self.0.request.resource = v.into();
13880 self
13881 }
13882
13883 pub fn set_options<T>(mut self, v: T) -> Self
13885 where
13886 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13887 {
13888 self.0.request.options = std::option::Option::Some(v.into());
13889 self
13890 }
13891
13892 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13894 where
13895 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13896 {
13897 self.0.request.options = v.map(|x| x.into());
13898 self
13899 }
13900 }
13901
13902 #[doc(hidden)]
13903 impl crate::RequestBuilder for GetIamPolicy {
13904 fn request_options(&mut self) -> &mut crate::RequestOptions {
13905 &mut self.0.options
13906 }
13907 }
13908
13909 #[derive(Clone, Debug)]
13926 pub struct TestIamPermissions(
13927 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13928 );
13929
13930 impl TestIamPermissions {
13931 pub(crate) fn new(
13932 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13933 ) -> Self {
13934 Self(RequestBuilder::new(stub))
13935 }
13936
13937 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13939 mut self,
13940 v: V,
13941 ) -> Self {
13942 self.0.request = v.into();
13943 self
13944 }
13945
13946 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13948 self.0.options = v.into();
13949 self
13950 }
13951
13952 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13954 (*self.0.stub)
13955 .test_iam_permissions(self.0.request, self.0.options)
13956 .await
13957 .map(crate::Response::into_body)
13958 }
13959
13960 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13964 self.0.request.resource = v.into();
13965 self
13966 }
13967
13968 pub fn set_permissions<T, V>(mut self, v: T) -> Self
13972 where
13973 T: std::iter::IntoIterator<Item = V>,
13974 V: std::convert::Into<std::string::String>,
13975 {
13976 use std::iter::Iterator;
13977 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13978 self
13979 }
13980 }
13981
13982 #[doc(hidden)]
13983 impl crate::RequestBuilder for TestIamPermissions {
13984 fn request_options(&mut self) -> &mut crate::RequestOptions {
13985 &mut self.0.options
13986 }
13987 }
13988
13989 #[derive(Clone, Debug)]
14010 pub struct ListOperations(
14011 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14012 );
14013
14014 impl ListOperations {
14015 pub(crate) fn new(
14016 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14017 ) -> Self {
14018 Self(RequestBuilder::new(stub))
14019 }
14020
14021 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14023 mut self,
14024 v: V,
14025 ) -> Self {
14026 self.0.request = v.into();
14027 self
14028 }
14029
14030 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14032 self.0.options = v.into();
14033 self
14034 }
14035
14036 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14038 (*self.0.stub)
14039 .list_operations(self.0.request, self.0.options)
14040 .await
14041 .map(crate::Response::into_body)
14042 }
14043
14044 pub fn by_page(
14046 self,
14047 ) -> impl google_cloud_gax::paginator::Paginator<
14048 google_cloud_longrunning::model::ListOperationsResponse,
14049 crate::Error,
14050 > {
14051 use std::clone::Clone;
14052 let token = self.0.request.page_token.clone();
14053 let execute = move |token: String| {
14054 let mut builder = self.clone();
14055 builder.0.request = builder.0.request.set_page_token(token);
14056 builder.send()
14057 };
14058 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14059 }
14060
14061 pub fn by_item(
14063 self,
14064 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14065 google_cloud_longrunning::model::ListOperationsResponse,
14066 crate::Error,
14067 > {
14068 use google_cloud_gax::paginator::Paginator;
14069 self.by_page().items()
14070 }
14071
14072 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14074 self.0.request.name = v.into();
14075 self
14076 }
14077
14078 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14080 self.0.request.filter = v.into();
14081 self
14082 }
14083
14084 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14086 self.0.request.page_size = v.into();
14087 self
14088 }
14089
14090 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14092 self.0.request.page_token = v.into();
14093 self
14094 }
14095
14096 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14098 self.0.request.return_partial_success = v.into();
14099 self
14100 }
14101 }
14102
14103 #[doc(hidden)]
14104 impl crate::RequestBuilder for ListOperations {
14105 fn request_options(&mut self) -> &mut crate::RequestOptions {
14106 &mut self.0.options
14107 }
14108 }
14109
14110 #[derive(Clone, Debug)]
14127 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14128
14129 impl GetOperation {
14130 pub(crate) fn new(
14131 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14132 ) -> Self {
14133 Self(RequestBuilder::new(stub))
14134 }
14135
14136 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14138 mut self,
14139 v: V,
14140 ) -> Self {
14141 self.0.request = v.into();
14142 self
14143 }
14144
14145 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14147 self.0.options = v.into();
14148 self
14149 }
14150
14151 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14153 (*self.0.stub)
14154 .get_operation(self.0.request, self.0.options)
14155 .await
14156 .map(crate::Response::into_body)
14157 }
14158
14159 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14161 self.0.request.name = v.into();
14162 self
14163 }
14164 }
14165
14166 #[doc(hidden)]
14167 impl crate::RequestBuilder for GetOperation {
14168 fn request_options(&mut self) -> &mut crate::RequestOptions {
14169 &mut self.0.options
14170 }
14171 }
14172
14173 #[derive(Clone, Debug)]
14190 pub struct DeleteOperation(
14191 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
14192 );
14193
14194 impl DeleteOperation {
14195 pub(crate) fn new(
14196 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14197 ) -> Self {
14198 Self(RequestBuilder::new(stub))
14199 }
14200
14201 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
14203 mut self,
14204 v: V,
14205 ) -> Self {
14206 self.0.request = v.into();
14207 self
14208 }
14209
14210 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14212 self.0.options = v.into();
14213 self
14214 }
14215
14216 pub async fn send(self) -> Result<()> {
14218 (*self.0.stub)
14219 .delete_operation(self.0.request, self.0.options)
14220 .await
14221 .map(crate::Response::into_body)
14222 }
14223
14224 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14226 self.0.request.name = v.into();
14227 self
14228 }
14229 }
14230
14231 #[doc(hidden)]
14232 impl crate::RequestBuilder for DeleteOperation {
14233 fn request_options(&mut self) -> &mut crate::RequestOptions {
14234 &mut self.0.options
14235 }
14236 }
14237
14238 #[derive(Clone, Debug)]
14255 pub struct CancelOperation(
14256 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14257 );
14258
14259 impl CancelOperation {
14260 pub(crate) fn new(
14261 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14262 ) -> Self {
14263 Self(RequestBuilder::new(stub))
14264 }
14265
14266 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14268 mut self,
14269 v: V,
14270 ) -> Self {
14271 self.0.request = v.into();
14272 self
14273 }
14274
14275 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14277 self.0.options = v.into();
14278 self
14279 }
14280
14281 pub async fn send(self) -> Result<()> {
14283 (*self.0.stub)
14284 .cancel_operation(self.0.request, self.0.options)
14285 .await
14286 .map(crate::Response::into_body)
14287 }
14288
14289 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14291 self.0.request.name = v.into();
14292 self
14293 }
14294 }
14295
14296 #[doc(hidden)]
14297 impl crate::RequestBuilder for CancelOperation {
14298 fn request_options(&mut self) -> &mut crate::RequestOptions {
14299 &mut self.0.options
14300 }
14301 }
14302}
14303
14304pub mod network_security {
14306 use crate::Result;
14307
14308 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14322
14323 pub(crate) mod client {
14324 use super::super::super::client::NetworkSecurity;
14325 pub struct Factory;
14326 impl crate::ClientFactory for Factory {
14327 type Client = NetworkSecurity;
14328 type Credentials = gaxi::options::Credentials;
14329 async fn build(
14330 self,
14331 config: gaxi::options::ClientConfig,
14332 ) -> crate::ClientBuilderResult<Self::Client> {
14333 Self::Client::new(config).await
14334 }
14335 }
14336 }
14337
14338 #[derive(Clone, Debug)]
14340 pub(crate) struct RequestBuilder<R: std::default::Default> {
14341 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14342 request: R,
14343 options: crate::RequestOptions,
14344 }
14345
14346 impl<R> RequestBuilder<R>
14347 where
14348 R: std::default::Default,
14349 {
14350 pub(crate) fn new(
14351 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14352 ) -> Self {
14353 Self {
14354 stub,
14355 request: R::default(),
14356 options: crate::RequestOptions::default(),
14357 }
14358 }
14359 }
14360
14361 #[derive(Clone, Debug)]
14382 pub struct ListAuthorizationPolicies(
14383 RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
14384 );
14385
14386 impl ListAuthorizationPolicies {
14387 pub(crate) fn new(
14388 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14389 ) -> Self {
14390 Self(RequestBuilder::new(stub))
14391 }
14392
14393 pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
14395 mut self,
14396 v: V,
14397 ) -> Self {
14398 self.0.request = v.into();
14399 self
14400 }
14401
14402 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14404 self.0.options = v.into();
14405 self
14406 }
14407
14408 pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
14410 (*self.0.stub)
14411 .list_authorization_policies(self.0.request, self.0.options)
14412 .await
14413 .map(crate::Response::into_body)
14414 }
14415
14416 pub fn by_page(
14418 self,
14419 ) -> impl google_cloud_gax::paginator::Paginator<
14420 crate::model::ListAuthorizationPoliciesResponse,
14421 crate::Error,
14422 > {
14423 use std::clone::Clone;
14424 let token = self.0.request.page_token.clone();
14425 let execute = move |token: String| {
14426 let mut builder = self.clone();
14427 builder.0.request = builder.0.request.set_page_token(token);
14428 builder.send()
14429 };
14430 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14431 }
14432
14433 pub fn by_item(
14435 self,
14436 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14437 crate::model::ListAuthorizationPoliciesResponse,
14438 crate::Error,
14439 > {
14440 use google_cloud_gax::paginator::Paginator;
14441 self.by_page().items()
14442 }
14443
14444 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14448 self.0.request.parent = v.into();
14449 self
14450 }
14451
14452 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14454 self.0.request.page_size = v.into();
14455 self
14456 }
14457
14458 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14460 self.0.request.page_token = v.into();
14461 self
14462 }
14463 }
14464
14465 #[doc(hidden)]
14466 impl crate::RequestBuilder for ListAuthorizationPolicies {
14467 fn request_options(&mut self) -> &mut crate::RequestOptions {
14468 &mut self.0.options
14469 }
14470 }
14471
14472 #[derive(Clone, Debug)]
14489 pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
14490
14491 impl GetAuthorizationPolicy {
14492 pub(crate) fn new(
14493 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14494 ) -> Self {
14495 Self(RequestBuilder::new(stub))
14496 }
14497
14498 pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
14500 mut self,
14501 v: V,
14502 ) -> Self {
14503 self.0.request = v.into();
14504 self
14505 }
14506
14507 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14509 self.0.options = v.into();
14510 self
14511 }
14512
14513 pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
14515 (*self.0.stub)
14516 .get_authorization_policy(self.0.request, self.0.options)
14517 .await
14518 .map(crate::Response::into_body)
14519 }
14520
14521 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14525 self.0.request.name = v.into();
14526 self
14527 }
14528 }
14529
14530 #[doc(hidden)]
14531 impl crate::RequestBuilder for GetAuthorizationPolicy {
14532 fn request_options(&mut self) -> &mut crate::RequestOptions {
14533 &mut self.0.options
14534 }
14535 }
14536
14537 #[derive(Clone, Debug)]
14555 pub struct CreateAuthorizationPolicy(
14556 RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
14557 );
14558
14559 impl CreateAuthorizationPolicy {
14560 pub(crate) fn new(
14561 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14562 ) -> Self {
14563 Self(RequestBuilder::new(stub))
14564 }
14565
14566 pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
14568 mut self,
14569 v: V,
14570 ) -> Self {
14571 self.0.request = v.into();
14572 self
14573 }
14574
14575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14577 self.0.options = v.into();
14578 self
14579 }
14580
14581 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14588 (*self.0.stub)
14589 .create_authorization_policy(self.0.request, self.0.options)
14590 .await
14591 .map(crate::Response::into_body)
14592 }
14593
14594 pub fn poller(
14596 self,
14597 ) -> impl google_cloud_lro::Poller<
14598 crate::model::AuthorizationPolicy,
14599 crate::model::OperationMetadata,
14600 > {
14601 type Operation = google_cloud_lro::internal::Operation<
14602 crate::model::AuthorizationPolicy,
14603 crate::model::OperationMetadata,
14604 >;
14605 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14606 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14607
14608 let stub = self.0.stub.clone();
14609 let mut options = self.0.options.clone();
14610 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14611 let query = move |name| {
14612 let stub = stub.clone();
14613 let options = options.clone();
14614 async {
14615 let op = GetOperation::new(stub)
14616 .set_name(name)
14617 .with_options(options)
14618 .send()
14619 .await?;
14620 Ok(Operation::new(op))
14621 }
14622 };
14623
14624 let start = move || async {
14625 let op = self.send().await?;
14626 Ok(Operation::new(op))
14627 };
14628
14629 google_cloud_lro::internal::new_poller(
14630 polling_error_policy,
14631 polling_backoff_policy,
14632 start,
14633 query,
14634 )
14635 }
14636
14637 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14641 self.0.request.parent = v.into();
14642 self
14643 }
14644
14645 pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14649 self.0.request.authorization_policy_id = v.into();
14650 self
14651 }
14652
14653 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14657 where
14658 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14659 {
14660 self.0.request.authorization_policy = std::option::Option::Some(v.into());
14661 self
14662 }
14663
14664 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14668 where
14669 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14670 {
14671 self.0.request.authorization_policy = v.map(|x| x.into());
14672 self
14673 }
14674 }
14675
14676 #[doc(hidden)]
14677 impl crate::RequestBuilder for CreateAuthorizationPolicy {
14678 fn request_options(&mut self) -> &mut crate::RequestOptions {
14679 &mut self.0.options
14680 }
14681 }
14682
14683 #[derive(Clone, Debug)]
14701 pub struct UpdateAuthorizationPolicy(
14702 RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
14703 );
14704
14705 impl UpdateAuthorizationPolicy {
14706 pub(crate) fn new(
14707 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14708 ) -> Self {
14709 Self(RequestBuilder::new(stub))
14710 }
14711
14712 pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
14714 mut self,
14715 v: V,
14716 ) -> Self {
14717 self.0.request = v.into();
14718 self
14719 }
14720
14721 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14723 self.0.options = v.into();
14724 self
14725 }
14726
14727 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14734 (*self.0.stub)
14735 .update_authorization_policy(self.0.request, self.0.options)
14736 .await
14737 .map(crate::Response::into_body)
14738 }
14739
14740 pub fn poller(
14742 self,
14743 ) -> impl google_cloud_lro::Poller<
14744 crate::model::AuthorizationPolicy,
14745 crate::model::OperationMetadata,
14746 > {
14747 type Operation = google_cloud_lro::internal::Operation<
14748 crate::model::AuthorizationPolicy,
14749 crate::model::OperationMetadata,
14750 >;
14751 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14752 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14753
14754 let stub = self.0.stub.clone();
14755 let mut options = self.0.options.clone();
14756 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14757 let query = move |name| {
14758 let stub = stub.clone();
14759 let options = options.clone();
14760 async {
14761 let op = GetOperation::new(stub)
14762 .set_name(name)
14763 .with_options(options)
14764 .send()
14765 .await?;
14766 Ok(Operation::new(op))
14767 }
14768 };
14769
14770 let start = move || async {
14771 let op = self.send().await?;
14772 Ok(Operation::new(op))
14773 };
14774
14775 google_cloud_lro::internal::new_poller(
14776 polling_error_policy,
14777 polling_backoff_policy,
14778 start,
14779 query,
14780 )
14781 }
14782
14783 pub fn set_update_mask<T>(mut self, v: T) -> Self
14785 where
14786 T: std::convert::Into<wkt::FieldMask>,
14787 {
14788 self.0.request.update_mask = std::option::Option::Some(v.into());
14789 self
14790 }
14791
14792 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14794 where
14795 T: std::convert::Into<wkt::FieldMask>,
14796 {
14797 self.0.request.update_mask = v.map(|x| x.into());
14798 self
14799 }
14800
14801 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14805 where
14806 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14807 {
14808 self.0.request.authorization_policy = std::option::Option::Some(v.into());
14809 self
14810 }
14811
14812 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14816 where
14817 T: std::convert::Into<crate::model::AuthorizationPolicy>,
14818 {
14819 self.0.request.authorization_policy = v.map(|x| x.into());
14820 self
14821 }
14822 }
14823
14824 #[doc(hidden)]
14825 impl crate::RequestBuilder for UpdateAuthorizationPolicy {
14826 fn request_options(&mut self) -> &mut crate::RequestOptions {
14827 &mut self.0.options
14828 }
14829 }
14830
14831 #[derive(Clone, Debug)]
14849 pub struct DeleteAuthorizationPolicy(
14850 RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
14851 );
14852
14853 impl DeleteAuthorizationPolicy {
14854 pub(crate) fn new(
14855 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14856 ) -> Self {
14857 Self(RequestBuilder::new(stub))
14858 }
14859
14860 pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
14862 mut self,
14863 v: V,
14864 ) -> Self {
14865 self.0.request = v.into();
14866 self
14867 }
14868
14869 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14871 self.0.options = v.into();
14872 self
14873 }
14874
14875 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14882 (*self.0.stub)
14883 .delete_authorization_policy(self.0.request, self.0.options)
14884 .await
14885 .map(crate::Response::into_body)
14886 }
14887
14888 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14890 type Operation =
14891 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14892 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14893 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14894
14895 let stub = self.0.stub.clone();
14896 let mut options = self.0.options.clone();
14897 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14898 let query = move |name| {
14899 let stub = stub.clone();
14900 let options = options.clone();
14901 async {
14902 let op = GetOperation::new(stub)
14903 .set_name(name)
14904 .with_options(options)
14905 .send()
14906 .await?;
14907 Ok(Operation::new(op))
14908 }
14909 };
14910
14911 let start = move || async {
14912 let op = self.send().await?;
14913 Ok(Operation::new(op))
14914 };
14915
14916 google_cloud_lro::internal::new_unit_response_poller(
14917 polling_error_policy,
14918 polling_backoff_policy,
14919 start,
14920 query,
14921 )
14922 }
14923
14924 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14928 self.0.request.name = v.into();
14929 self
14930 }
14931 }
14932
14933 #[doc(hidden)]
14934 impl crate::RequestBuilder for DeleteAuthorizationPolicy {
14935 fn request_options(&mut self) -> &mut crate::RequestOptions {
14936 &mut self.0.options
14937 }
14938 }
14939
14940 #[derive(Clone, Debug)]
14961 pub struct ListBackendAuthenticationConfigs(
14962 RequestBuilder<crate::model::ListBackendAuthenticationConfigsRequest>,
14963 );
14964
14965 impl ListBackendAuthenticationConfigs {
14966 pub(crate) fn new(
14967 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14968 ) -> Self {
14969 Self(RequestBuilder::new(stub))
14970 }
14971
14972 pub fn with_request<V: Into<crate::model::ListBackendAuthenticationConfigsRequest>>(
14974 mut self,
14975 v: V,
14976 ) -> Self {
14977 self.0.request = v.into();
14978 self
14979 }
14980
14981 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14983 self.0.options = v.into();
14984 self
14985 }
14986
14987 pub async fn send(self) -> Result<crate::model::ListBackendAuthenticationConfigsResponse> {
14989 (*self.0.stub)
14990 .list_backend_authentication_configs(self.0.request, self.0.options)
14991 .await
14992 .map(crate::Response::into_body)
14993 }
14994
14995 pub fn by_page(
14997 self,
14998 ) -> impl google_cloud_gax::paginator::Paginator<
14999 crate::model::ListBackendAuthenticationConfigsResponse,
15000 crate::Error,
15001 > {
15002 use std::clone::Clone;
15003 let token = self.0.request.page_token.clone();
15004 let execute = move |token: String| {
15005 let mut builder = self.clone();
15006 builder.0.request = builder.0.request.set_page_token(token);
15007 builder.send()
15008 };
15009 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15010 }
15011
15012 pub fn by_item(
15014 self,
15015 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15016 crate::model::ListBackendAuthenticationConfigsResponse,
15017 crate::Error,
15018 > {
15019 use google_cloud_gax::paginator::Paginator;
15020 self.by_page().items()
15021 }
15022
15023 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15027 self.0.request.parent = v.into();
15028 self
15029 }
15030
15031 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15033 self.0.request.page_size = v.into();
15034 self
15035 }
15036
15037 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15039 self.0.request.page_token = v.into();
15040 self
15041 }
15042 }
15043
15044 #[doc(hidden)]
15045 impl crate::RequestBuilder for ListBackendAuthenticationConfigs {
15046 fn request_options(&mut self) -> &mut crate::RequestOptions {
15047 &mut self.0.options
15048 }
15049 }
15050
15051 #[derive(Clone, Debug)]
15068 pub struct GetBackendAuthenticationConfig(
15069 RequestBuilder<crate::model::GetBackendAuthenticationConfigRequest>,
15070 );
15071
15072 impl GetBackendAuthenticationConfig {
15073 pub(crate) fn new(
15074 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15075 ) -> Self {
15076 Self(RequestBuilder::new(stub))
15077 }
15078
15079 pub fn with_request<V: Into<crate::model::GetBackendAuthenticationConfigRequest>>(
15081 mut self,
15082 v: V,
15083 ) -> Self {
15084 self.0.request = v.into();
15085 self
15086 }
15087
15088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15090 self.0.options = v.into();
15091 self
15092 }
15093
15094 pub async fn send(self) -> Result<crate::model::BackendAuthenticationConfig> {
15096 (*self.0.stub)
15097 .get_backend_authentication_config(self.0.request, self.0.options)
15098 .await
15099 .map(crate::Response::into_body)
15100 }
15101
15102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15106 self.0.request.name = v.into();
15107 self
15108 }
15109 }
15110
15111 #[doc(hidden)]
15112 impl crate::RequestBuilder for GetBackendAuthenticationConfig {
15113 fn request_options(&mut self) -> &mut crate::RequestOptions {
15114 &mut self.0.options
15115 }
15116 }
15117
15118 #[derive(Clone, Debug)]
15136 pub struct CreateBackendAuthenticationConfig(
15137 RequestBuilder<crate::model::CreateBackendAuthenticationConfigRequest>,
15138 );
15139
15140 impl CreateBackendAuthenticationConfig {
15141 pub(crate) fn new(
15142 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15143 ) -> Self {
15144 Self(RequestBuilder::new(stub))
15145 }
15146
15147 pub fn with_request<V: Into<crate::model::CreateBackendAuthenticationConfigRequest>>(
15149 mut self,
15150 v: V,
15151 ) -> Self {
15152 self.0.request = v.into();
15153 self
15154 }
15155
15156 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15158 self.0.options = v.into();
15159 self
15160 }
15161
15162 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15169 (*self.0.stub)
15170 .create_backend_authentication_config(self.0.request, self.0.options)
15171 .await
15172 .map(crate::Response::into_body)
15173 }
15174
15175 pub fn poller(
15177 self,
15178 ) -> impl google_cloud_lro::Poller<
15179 crate::model::BackendAuthenticationConfig,
15180 crate::model::OperationMetadata,
15181 > {
15182 type Operation = google_cloud_lro::internal::Operation<
15183 crate::model::BackendAuthenticationConfig,
15184 crate::model::OperationMetadata,
15185 >;
15186 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15187 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15188
15189 let stub = self.0.stub.clone();
15190 let mut options = self.0.options.clone();
15191 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15192 let query = move |name| {
15193 let stub = stub.clone();
15194 let options = options.clone();
15195 async {
15196 let op = GetOperation::new(stub)
15197 .set_name(name)
15198 .with_options(options)
15199 .send()
15200 .await?;
15201 Ok(Operation::new(op))
15202 }
15203 };
15204
15205 let start = move || async {
15206 let op = self.send().await?;
15207 Ok(Operation::new(op))
15208 };
15209
15210 google_cloud_lro::internal::new_poller(
15211 polling_error_policy,
15212 polling_backoff_policy,
15213 start,
15214 query,
15215 )
15216 }
15217
15218 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15222 self.0.request.parent = v.into();
15223 self
15224 }
15225
15226 pub fn set_backend_authentication_config_id<T: Into<std::string::String>>(
15230 mut self,
15231 v: T,
15232 ) -> Self {
15233 self.0.request.backend_authentication_config_id = v.into();
15234 self
15235 }
15236
15237 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
15241 where
15242 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15243 {
15244 self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
15245 self
15246 }
15247
15248 pub fn set_or_clear_backend_authentication_config<T>(
15252 mut self,
15253 v: std::option::Option<T>,
15254 ) -> Self
15255 where
15256 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15257 {
15258 self.0.request.backend_authentication_config = v.map(|x| x.into());
15259 self
15260 }
15261 }
15262
15263 #[doc(hidden)]
15264 impl crate::RequestBuilder for CreateBackendAuthenticationConfig {
15265 fn request_options(&mut self) -> &mut crate::RequestOptions {
15266 &mut self.0.options
15267 }
15268 }
15269
15270 #[derive(Clone, Debug)]
15288 pub struct UpdateBackendAuthenticationConfig(
15289 RequestBuilder<crate::model::UpdateBackendAuthenticationConfigRequest>,
15290 );
15291
15292 impl UpdateBackendAuthenticationConfig {
15293 pub(crate) fn new(
15294 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15295 ) -> Self {
15296 Self(RequestBuilder::new(stub))
15297 }
15298
15299 pub fn with_request<V: Into<crate::model::UpdateBackendAuthenticationConfigRequest>>(
15301 mut self,
15302 v: V,
15303 ) -> Self {
15304 self.0.request = v.into();
15305 self
15306 }
15307
15308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15310 self.0.options = v.into();
15311 self
15312 }
15313
15314 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15321 (*self.0.stub)
15322 .update_backend_authentication_config(self.0.request, self.0.options)
15323 .await
15324 .map(crate::Response::into_body)
15325 }
15326
15327 pub fn poller(
15329 self,
15330 ) -> impl google_cloud_lro::Poller<
15331 crate::model::BackendAuthenticationConfig,
15332 crate::model::OperationMetadata,
15333 > {
15334 type Operation = google_cloud_lro::internal::Operation<
15335 crate::model::BackendAuthenticationConfig,
15336 crate::model::OperationMetadata,
15337 >;
15338 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15339 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15340
15341 let stub = self.0.stub.clone();
15342 let mut options = self.0.options.clone();
15343 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15344 let query = move |name| {
15345 let stub = stub.clone();
15346 let options = options.clone();
15347 async {
15348 let op = GetOperation::new(stub)
15349 .set_name(name)
15350 .with_options(options)
15351 .send()
15352 .await?;
15353 Ok(Operation::new(op))
15354 }
15355 };
15356
15357 let start = move || async {
15358 let op = self.send().await?;
15359 Ok(Operation::new(op))
15360 };
15361
15362 google_cloud_lro::internal::new_poller(
15363 polling_error_policy,
15364 polling_backoff_policy,
15365 start,
15366 query,
15367 )
15368 }
15369
15370 pub fn set_update_mask<T>(mut self, v: T) -> Self
15372 where
15373 T: std::convert::Into<wkt::FieldMask>,
15374 {
15375 self.0.request.update_mask = std::option::Option::Some(v.into());
15376 self
15377 }
15378
15379 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15381 where
15382 T: std::convert::Into<wkt::FieldMask>,
15383 {
15384 self.0.request.update_mask = v.map(|x| x.into());
15385 self
15386 }
15387
15388 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
15392 where
15393 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15394 {
15395 self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
15396 self
15397 }
15398
15399 pub fn set_or_clear_backend_authentication_config<T>(
15403 mut self,
15404 v: std::option::Option<T>,
15405 ) -> Self
15406 where
15407 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15408 {
15409 self.0.request.backend_authentication_config = v.map(|x| x.into());
15410 self
15411 }
15412 }
15413
15414 #[doc(hidden)]
15415 impl crate::RequestBuilder for UpdateBackendAuthenticationConfig {
15416 fn request_options(&mut self) -> &mut crate::RequestOptions {
15417 &mut self.0.options
15418 }
15419 }
15420
15421 #[derive(Clone, Debug)]
15439 pub struct DeleteBackendAuthenticationConfig(
15440 RequestBuilder<crate::model::DeleteBackendAuthenticationConfigRequest>,
15441 );
15442
15443 impl DeleteBackendAuthenticationConfig {
15444 pub(crate) fn new(
15445 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15446 ) -> Self {
15447 Self(RequestBuilder::new(stub))
15448 }
15449
15450 pub fn with_request<V: Into<crate::model::DeleteBackendAuthenticationConfigRequest>>(
15452 mut self,
15453 v: V,
15454 ) -> Self {
15455 self.0.request = v.into();
15456 self
15457 }
15458
15459 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15461 self.0.options = v.into();
15462 self
15463 }
15464
15465 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15472 (*self.0.stub)
15473 .delete_backend_authentication_config(self.0.request, self.0.options)
15474 .await
15475 .map(crate::Response::into_body)
15476 }
15477
15478 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15480 type Operation =
15481 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15482 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15483 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15484
15485 let stub = self.0.stub.clone();
15486 let mut options = self.0.options.clone();
15487 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15488 let query = move |name| {
15489 let stub = stub.clone();
15490 let options = options.clone();
15491 async {
15492 let op = GetOperation::new(stub)
15493 .set_name(name)
15494 .with_options(options)
15495 .send()
15496 .await?;
15497 Ok(Operation::new(op))
15498 }
15499 };
15500
15501 let start = move || async {
15502 let op = self.send().await?;
15503 Ok(Operation::new(op))
15504 };
15505
15506 google_cloud_lro::internal::new_unit_response_poller(
15507 polling_error_policy,
15508 polling_backoff_policy,
15509 start,
15510 query,
15511 )
15512 }
15513
15514 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15518 self.0.request.name = v.into();
15519 self
15520 }
15521
15522 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
15524 self.0.request.etag = v.into();
15525 self
15526 }
15527 }
15528
15529 #[doc(hidden)]
15530 impl crate::RequestBuilder for DeleteBackendAuthenticationConfig {
15531 fn request_options(&mut self) -> &mut crate::RequestOptions {
15532 &mut self.0.options
15533 }
15534 }
15535
15536 #[derive(Clone, Debug)]
15557 pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
15558
15559 impl ListServerTlsPolicies {
15560 pub(crate) fn new(
15561 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15562 ) -> Self {
15563 Self(RequestBuilder::new(stub))
15564 }
15565
15566 pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
15568 mut self,
15569 v: V,
15570 ) -> Self {
15571 self.0.request = v.into();
15572 self
15573 }
15574
15575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15577 self.0.options = v.into();
15578 self
15579 }
15580
15581 pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
15583 (*self.0.stub)
15584 .list_server_tls_policies(self.0.request, self.0.options)
15585 .await
15586 .map(crate::Response::into_body)
15587 }
15588
15589 pub fn by_page(
15591 self,
15592 ) -> impl google_cloud_gax::paginator::Paginator<
15593 crate::model::ListServerTlsPoliciesResponse,
15594 crate::Error,
15595 > {
15596 use std::clone::Clone;
15597 let token = self.0.request.page_token.clone();
15598 let execute = move |token: String| {
15599 let mut builder = self.clone();
15600 builder.0.request = builder.0.request.set_page_token(token);
15601 builder.send()
15602 };
15603 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15604 }
15605
15606 pub fn by_item(
15608 self,
15609 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15610 crate::model::ListServerTlsPoliciesResponse,
15611 crate::Error,
15612 > {
15613 use google_cloud_gax::paginator::Paginator;
15614 self.by_page().items()
15615 }
15616
15617 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15621 self.0.request.parent = v.into();
15622 self
15623 }
15624
15625 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15627 self.0.request.page_size = v.into();
15628 self
15629 }
15630
15631 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15633 self.0.request.page_token = v.into();
15634 self
15635 }
15636
15637 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15639 self.0.request.return_partial_success = v.into();
15640 self
15641 }
15642 }
15643
15644 #[doc(hidden)]
15645 impl crate::RequestBuilder for ListServerTlsPolicies {
15646 fn request_options(&mut self) -> &mut crate::RequestOptions {
15647 &mut self.0.options
15648 }
15649 }
15650
15651 #[derive(Clone, Debug)]
15668 pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
15669
15670 impl GetServerTlsPolicy {
15671 pub(crate) fn new(
15672 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15673 ) -> Self {
15674 Self(RequestBuilder::new(stub))
15675 }
15676
15677 pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
15679 mut self,
15680 v: V,
15681 ) -> Self {
15682 self.0.request = v.into();
15683 self
15684 }
15685
15686 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15688 self.0.options = v.into();
15689 self
15690 }
15691
15692 pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
15694 (*self.0.stub)
15695 .get_server_tls_policy(self.0.request, self.0.options)
15696 .await
15697 .map(crate::Response::into_body)
15698 }
15699
15700 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15704 self.0.request.name = v.into();
15705 self
15706 }
15707 }
15708
15709 #[doc(hidden)]
15710 impl crate::RequestBuilder for GetServerTlsPolicy {
15711 fn request_options(&mut self) -> &mut crate::RequestOptions {
15712 &mut self.0.options
15713 }
15714 }
15715
15716 #[derive(Clone, Debug)]
15734 pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
15735
15736 impl CreateServerTlsPolicy {
15737 pub(crate) fn new(
15738 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15739 ) -> Self {
15740 Self(RequestBuilder::new(stub))
15741 }
15742
15743 pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
15745 mut self,
15746 v: V,
15747 ) -> Self {
15748 self.0.request = v.into();
15749 self
15750 }
15751
15752 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15754 self.0.options = v.into();
15755 self
15756 }
15757
15758 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15765 (*self.0.stub)
15766 .create_server_tls_policy(self.0.request, self.0.options)
15767 .await
15768 .map(crate::Response::into_body)
15769 }
15770
15771 pub fn poller(
15773 self,
15774 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15775 {
15776 type Operation = google_cloud_lro::internal::Operation<
15777 crate::model::ServerTlsPolicy,
15778 crate::model::OperationMetadata,
15779 >;
15780 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15781 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15782
15783 let stub = self.0.stub.clone();
15784 let mut options = self.0.options.clone();
15785 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15786 let query = move |name| {
15787 let stub = stub.clone();
15788 let options = options.clone();
15789 async {
15790 let op = GetOperation::new(stub)
15791 .set_name(name)
15792 .with_options(options)
15793 .send()
15794 .await?;
15795 Ok(Operation::new(op))
15796 }
15797 };
15798
15799 let start = move || async {
15800 let op = self.send().await?;
15801 Ok(Operation::new(op))
15802 };
15803
15804 google_cloud_lro::internal::new_poller(
15805 polling_error_policy,
15806 polling_backoff_policy,
15807 start,
15808 query,
15809 )
15810 }
15811
15812 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15816 self.0.request.parent = v.into();
15817 self
15818 }
15819
15820 pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15824 self.0.request.server_tls_policy_id = v.into();
15825 self
15826 }
15827
15828 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15832 where
15833 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15834 {
15835 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15836 self
15837 }
15838
15839 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15843 where
15844 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15845 {
15846 self.0.request.server_tls_policy = v.map(|x| x.into());
15847 self
15848 }
15849 }
15850
15851 #[doc(hidden)]
15852 impl crate::RequestBuilder for CreateServerTlsPolicy {
15853 fn request_options(&mut self) -> &mut crate::RequestOptions {
15854 &mut self.0.options
15855 }
15856 }
15857
15858 #[derive(Clone, Debug)]
15876 pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
15877
15878 impl UpdateServerTlsPolicy {
15879 pub(crate) fn new(
15880 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15881 ) -> Self {
15882 Self(RequestBuilder::new(stub))
15883 }
15884
15885 pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
15887 mut self,
15888 v: V,
15889 ) -> Self {
15890 self.0.request = v.into();
15891 self
15892 }
15893
15894 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15896 self.0.options = v.into();
15897 self
15898 }
15899
15900 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15907 (*self.0.stub)
15908 .update_server_tls_policy(self.0.request, self.0.options)
15909 .await
15910 .map(crate::Response::into_body)
15911 }
15912
15913 pub fn poller(
15915 self,
15916 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15917 {
15918 type Operation = google_cloud_lro::internal::Operation<
15919 crate::model::ServerTlsPolicy,
15920 crate::model::OperationMetadata,
15921 >;
15922 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15923 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15924
15925 let stub = self.0.stub.clone();
15926 let mut options = self.0.options.clone();
15927 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15928 let query = move |name| {
15929 let stub = stub.clone();
15930 let options = options.clone();
15931 async {
15932 let op = GetOperation::new(stub)
15933 .set_name(name)
15934 .with_options(options)
15935 .send()
15936 .await?;
15937 Ok(Operation::new(op))
15938 }
15939 };
15940
15941 let start = move || async {
15942 let op = self.send().await?;
15943 Ok(Operation::new(op))
15944 };
15945
15946 google_cloud_lro::internal::new_poller(
15947 polling_error_policy,
15948 polling_backoff_policy,
15949 start,
15950 query,
15951 )
15952 }
15953
15954 pub fn set_update_mask<T>(mut self, v: T) -> Self
15956 where
15957 T: std::convert::Into<wkt::FieldMask>,
15958 {
15959 self.0.request.update_mask = std::option::Option::Some(v.into());
15960 self
15961 }
15962
15963 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15965 where
15966 T: std::convert::Into<wkt::FieldMask>,
15967 {
15968 self.0.request.update_mask = v.map(|x| x.into());
15969 self
15970 }
15971
15972 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15976 where
15977 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15978 {
15979 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15980 self
15981 }
15982
15983 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15987 where
15988 T: std::convert::Into<crate::model::ServerTlsPolicy>,
15989 {
15990 self.0.request.server_tls_policy = v.map(|x| x.into());
15991 self
15992 }
15993 }
15994
15995 #[doc(hidden)]
15996 impl crate::RequestBuilder for UpdateServerTlsPolicy {
15997 fn request_options(&mut self) -> &mut crate::RequestOptions {
15998 &mut self.0.options
15999 }
16000 }
16001
16002 #[derive(Clone, Debug)]
16020 pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
16021
16022 impl DeleteServerTlsPolicy {
16023 pub(crate) fn new(
16024 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16025 ) -> Self {
16026 Self(RequestBuilder::new(stub))
16027 }
16028
16029 pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
16031 mut self,
16032 v: V,
16033 ) -> Self {
16034 self.0.request = v.into();
16035 self
16036 }
16037
16038 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16040 self.0.options = v.into();
16041 self
16042 }
16043
16044 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16051 (*self.0.stub)
16052 .delete_server_tls_policy(self.0.request, self.0.options)
16053 .await
16054 .map(crate::Response::into_body)
16055 }
16056
16057 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16059 type Operation =
16060 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16061 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16062 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16063
16064 let stub = self.0.stub.clone();
16065 let mut options = self.0.options.clone();
16066 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16067 let query = move |name| {
16068 let stub = stub.clone();
16069 let options = options.clone();
16070 async {
16071 let op = GetOperation::new(stub)
16072 .set_name(name)
16073 .with_options(options)
16074 .send()
16075 .await?;
16076 Ok(Operation::new(op))
16077 }
16078 };
16079
16080 let start = move || async {
16081 let op = self.send().await?;
16082 Ok(Operation::new(op))
16083 };
16084
16085 google_cloud_lro::internal::new_unit_response_poller(
16086 polling_error_policy,
16087 polling_backoff_policy,
16088 start,
16089 query,
16090 )
16091 }
16092
16093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16097 self.0.request.name = v.into();
16098 self
16099 }
16100 }
16101
16102 #[doc(hidden)]
16103 impl crate::RequestBuilder for DeleteServerTlsPolicy {
16104 fn request_options(&mut self) -> &mut crate::RequestOptions {
16105 &mut self.0.options
16106 }
16107 }
16108
16109 #[derive(Clone, Debug)]
16130 pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
16131
16132 impl ListClientTlsPolicies {
16133 pub(crate) fn new(
16134 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16135 ) -> Self {
16136 Self(RequestBuilder::new(stub))
16137 }
16138
16139 pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
16141 mut self,
16142 v: V,
16143 ) -> Self {
16144 self.0.request = v.into();
16145 self
16146 }
16147
16148 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16150 self.0.options = v.into();
16151 self
16152 }
16153
16154 pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
16156 (*self.0.stub)
16157 .list_client_tls_policies(self.0.request, self.0.options)
16158 .await
16159 .map(crate::Response::into_body)
16160 }
16161
16162 pub fn by_page(
16164 self,
16165 ) -> impl google_cloud_gax::paginator::Paginator<
16166 crate::model::ListClientTlsPoliciesResponse,
16167 crate::Error,
16168 > {
16169 use std::clone::Clone;
16170 let token = self.0.request.page_token.clone();
16171 let execute = move |token: String| {
16172 let mut builder = self.clone();
16173 builder.0.request = builder.0.request.set_page_token(token);
16174 builder.send()
16175 };
16176 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16177 }
16178
16179 pub fn by_item(
16181 self,
16182 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16183 crate::model::ListClientTlsPoliciesResponse,
16184 crate::Error,
16185 > {
16186 use google_cloud_gax::paginator::Paginator;
16187 self.by_page().items()
16188 }
16189
16190 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16194 self.0.request.parent = v.into();
16195 self
16196 }
16197
16198 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16200 self.0.request.page_size = v.into();
16201 self
16202 }
16203
16204 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16206 self.0.request.page_token = v.into();
16207 self
16208 }
16209 }
16210
16211 #[doc(hidden)]
16212 impl crate::RequestBuilder for ListClientTlsPolicies {
16213 fn request_options(&mut self) -> &mut crate::RequestOptions {
16214 &mut self.0.options
16215 }
16216 }
16217
16218 #[derive(Clone, Debug)]
16235 pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
16236
16237 impl GetClientTlsPolicy {
16238 pub(crate) fn new(
16239 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16240 ) -> Self {
16241 Self(RequestBuilder::new(stub))
16242 }
16243
16244 pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
16246 mut self,
16247 v: V,
16248 ) -> Self {
16249 self.0.request = v.into();
16250 self
16251 }
16252
16253 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16255 self.0.options = v.into();
16256 self
16257 }
16258
16259 pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
16261 (*self.0.stub)
16262 .get_client_tls_policy(self.0.request, self.0.options)
16263 .await
16264 .map(crate::Response::into_body)
16265 }
16266
16267 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16271 self.0.request.name = v.into();
16272 self
16273 }
16274 }
16275
16276 #[doc(hidden)]
16277 impl crate::RequestBuilder for GetClientTlsPolicy {
16278 fn request_options(&mut self) -> &mut crate::RequestOptions {
16279 &mut self.0.options
16280 }
16281 }
16282
16283 #[derive(Clone, Debug)]
16301 pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
16302
16303 impl CreateClientTlsPolicy {
16304 pub(crate) fn new(
16305 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16306 ) -> Self {
16307 Self(RequestBuilder::new(stub))
16308 }
16309
16310 pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
16312 mut self,
16313 v: V,
16314 ) -> Self {
16315 self.0.request = v.into();
16316 self
16317 }
16318
16319 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16321 self.0.options = v.into();
16322 self
16323 }
16324
16325 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16332 (*self.0.stub)
16333 .create_client_tls_policy(self.0.request, self.0.options)
16334 .await
16335 .map(crate::Response::into_body)
16336 }
16337
16338 pub fn poller(
16340 self,
16341 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
16342 {
16343 type Operation = google_cloud_lro::internal::Operation<
16344 crate::model::ClientTlsPolicy,
16345 crate::model::OperationMetadata,
16346 >;
16347 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16348 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16349
16350 let stub = self.0.stub.clone();
16351 let mut options = self.0.options.clone();
16352 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16353 let query = move |name| {
16354 let stub = stub.clone();
16355 let options = options.clone();
16356 async {
16357 let op = GetOperation::new(stub)
16358 .set_name(name)
16359 .with_options(options)
16360 .send()
16361 .await?;
16362 Ok(Operation::new(op))
16363 }
16364 };
16365
16366 let start = move || async {
16367 let op = self.send().await?;
16368 Ok(Operation::new(op))
16369 };
16370
16371 google_cloud_lro::internal::new_poller(
16372 polling_error_policy,
16373 polling_backoff_policy,
16374 start,
16375 query,
16376 )
16377 }
16378
16379 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16383 self.0.request.parent = v.into();
16384 self
16385 }
16386
16387 pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16391 self.0.request.client_tls_policy_id = v.into();
16392 self
16393 }
16394
16395 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
16399 where
16400 T: std::convert::Into<crate::model::ClientTlsPolicy>,
16401 {
16402 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
16403 self
16404 }
16405
16406 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16410 where
16411 T: std::convert::Into<crate::model::ClientTlsPolicy>,
16412 {
16413 self.0.request.client_tls_policy = v.map(|x| x.into());
16414 self
16415 }
16416 }
16417
16418 #[doc(hidden)]
16419 impl crate::RequestBuilder for CreateClientTlsPolicy {
16420 fn request_options(&mut self) -> &mut crate::RequestOptions {
16421 &mut self.0.options
16422 }
16423 }
16424
16425 #[derive(Clone, Debug)]
16443 pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
16444
16445 impl UpdateClientTlsPolicy {
16446 pub(crate) fn new(
16447 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16448 ) -> Self {
16449 Self(RequestBuilder::new(stub))
16450 }
16451
16452 pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
16454 mut self,
16455 v: V,
16456 ) -> Self {
16457 self.0.request = v.into();
16458 self
16459 }
16460
16461 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16463 self.0.options = v.into();
16464 self
16465 }
16466
16467 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16474 (*self.0.stub)
16475 .update_client_tls_policy(self.0.request, self.0.options)
16476 .await
16477 .map(crate::Response::into_body)
16478 }
16479
16480 pub fn poller(
16482 self,
16483 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
16484 {
16485 type Operation = google_cloud_lro::internal::Operation<
16486 crate::model::ClientTlsPolicy,
16487 crate::model::OperationMetadata,
16488 >;
16489 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16490 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16491
16492 let stub = self.0.stub.clone();
16493 let mut options = self.0.options.clone();
16494 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16495 let query = move |name| {
16496 let stub = stub.clone();
16497 let options = options.clone();
16498 async {
16499 let op = GetOperation::new(stub)
16500 .set_name(name)
16501 .with_options(options)
16502 .send()
16503 .await?;
16504 Ok(Operation::new(op))
16505 }
16506 };
16507
16508 let start = move || async {
16509 let op = self.send().await?;
16510 Ok(Operation::new(op))
16511 };
16512
16513 google_cloud_lro::internal::new_poller(
16514 polling_error_policy,
16515 polling_backoff_policy,
16516 start,
16517 query,
16518 )
16519 }
16520
16521 pub fn set_update_mask<T>(mut self, v: T) -> Self
16523 where
16524 T: std::convert::Into<wkt::FieldMask>,
16525 {
16526 self.0.request.update_mask = std::option::Option::Some(v.into());
16527 self
16528 }
16529
16530 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16532 where
16533 T: std::convert::Into<wkt::FieldMask>,
16534 {
16535 self.0.request.update_mask = v.map(|x| x.into());
16536 self
16537 }
16538
16539 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
16543 where
16544 T: std::convert::Into<crate::model::ClientTlsPolicy>,
16545 {
16546 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
16547 self
16548 }
16549
16550 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16554 where
16555 T: std::convert::Into<crate::model::ClientTlsPolicy>,
16556 {
16557 self.0.request.client_tls_policy = v.map(|x| x.into());
16558 self
16559 }
16560 }
16561
16562 #[doc(hidden)]
16563 impl crate::RequestBuilder for UpdateClientTlsPolicy {
16564 fn request_options(&mut self) -> &mut crate::RequestOptions {
16565 &mut self.0.options
16566 }
16567 }
16568
16569 #[derive(Clone, Debug)]
16587 pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
16588
16589 impl DeleteClientTlsPolicy {
16590 pub(crate) fn new(
16591 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16592 ) -> Self {
16593 Self(RequestBuilder::new(stub))
16594 }
16595
16596 pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
16598 mut self,
16599 v: V,
16600 ) -> Self {
16601 self.0.request = v.into();
16602 self
16603 }
16604
16605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16607 self.0.options = v.into();
16608 self
16609 }
16610
16611 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16618 (*self.0.stub)
16619 .delete_client_tls_policy(self.0.request, self.0.options)
16620 .await
16621 .map(crate::Response::into_body)
16622 }
16623
16624 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16626 type Operation =
16627 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16628 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16629 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16630
16631 let stub = self.0.stub.clone();
16632 let mut options = self.0.options.clone();
16633 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16634 let query = move |name| {
16635 let stub = stub.clone();
16636 let options = options.clone();
16637 async {
16638 let op = GetOperation::new(stub)
16639 .set_name(name)
16640 .with_options(options)
16641 .send()
16642 .await?;
16643 Ok(Operation::new(op))
16644 }
16645 };
16646
16647 let start = move || async {
16648 let op = self.send().await?;
16649 Ok(Operation::new(op))
16650 };
16651
16652 google_cloud_lro::internal::new_unit_response_poller(
16653 polling_error_policy,
16654 polling_backoff_policy,
16655 start,
16656 query,
16657 )
16658 }
16659
16660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16664 self.0.request.name = v.into();
16665 self
16666 }
16667 }
16668
16669 #[doc(hidden)]
16670 impl crate::RequestBuilder for DeleteClientTlsPolicy {
16671 fn request_options(&mut self) -> &mut crate::RequestOptions {
16672 &mut self.0.options
16673 }
16674 }
16675
16676 #[derive(Clone, Debug)]
16697 pub struct ListGatewaySecurityPolicies(
16698 RequestBuilder<crate::model::ListGatewaySecurityPoliciesRequest>,
16699 );
16700
16701 impl ListGatewaySecurityPolicies {
16702 pub(crate) fn new(
16703 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16704 ) -> Self {
16705 Self(RequestBuilder::new(stub))
16706 }
16707
16708 pub fn with_request<V: Into<crate::model::ListGatewaySecurityPoliciesRequest>>(
16710 mut self,
16711 v: V,
16712 ) -> Self {
16713 self.0.request = v.into();
16714 self
16715 }
16716
16717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16719 self.0.options = v.into();
16720 self
16721 }
16722
16723 pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPoliciesResponse> {
16725 (*self.0.stub)
16726 .list_gateway_security_policies(self.0.request, self.0.options)
16727 .await
16728 .map(crate::Response::into_body)
16729 }
16730
16731 pub fn by_page(
16733 self,
16734 ) -> impl google_cloud_gax::paginator::Paginator<
16735 crate::model::ListGatewaySecurityPoliciesResponse,
16736 crate::Error,
16737 > {
16738 use std::clone::Clone;
16739 let token = self.0.request.page_token.clone();
16740 let execute = move |token: String| {
16741 let mut builder = self.clone();
16742 builder.0.request = builder.0.request.set_page_token(token);
16743 builder.send()
16744 };
16745 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16746 }
16747
16748 pub fn by_item(
16750 self,
16751 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16752 crate::model::ListGatewaySecurityPoliciesResponse,
16753 crate::Error,
16754 > {
16755 use google_cloud_gax::paginator::Paginator;
16756 self.by_page().items()
16757 }
16758
16759 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16763 self.0.request.parent = v.into();
16764 self
16765 }
16766
16767 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16769 self.0.request.page_size = v.into();
16770 self
16771 }
16772
16773 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16775 self.0.request.page_token = v.into();
16776 self
16777 }
16778 }
16779
16780 #[doc(hidden)]
16781 impl crate::RequestBuilder for ListGatewaySecurityPolicies {
16782 fn request_options(&mut self) -> &mut crate::RequestOptions {
16783 &mut self.0.options
16784 }
16785 }
16786
16787 #[derive(Clone, Debug)]
16804 pub struct GetGatewaySecurityPolicy(
16805 RequestBuilder<crate::model::GetGatewaySecurityPolicyRequest>,
16806 );
16807
16808 impl GetGatewaySecurityPolicy {
16809 pub(crate) fn new(
16810 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16811 ) -> Self {
16812 Self(RequestBuilder::new(stub))
16813 }
16814
16815 pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRequest>>(
16817 mut self,
16818 v: V,
16819 ) -> Self {
16820 self.0.request = v.into();
16821 self
16822 }
16823
16824 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16826 self.0.options = v.into();
16827 self
16828 }
16829
16830 pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicy> {
16832 (*self.0.stub)
16833 .get_gateway_security_policy(self.0.request, self.0.options)
16834 .await
16835 .map(crate::Response::into_body)
16836 }
16837
16838 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16842 self.0.request.name = v.into();
16843 self
16844 }
16845 }
16846
16847 #[doc(hidden)]
16848 impl crate::RequestBuilder for GetGatewaySecurityPolicy {
16849 fn request_options(&mut self) -> &mut crate::RequestOptions {
16850 &mut self.0.options
16851 }
16852 }
16853
16854 #[derive(Clone, Debug)]
16872 pub struct CreateGatewaySecurityPolicy(
16873 RequestBuilder<crate::model::CreateGatewaySecurityPolicyRequest>,
16874 );
16875
16876 impl CreateGatewaySecurityPolicy {
16877 pub(crate) fn new(
16878 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16879 ) -> Self {
16880 Self(RequestBuilder::new(stub))
16881 }
16882
16883 pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRequest>>(
16885 mut self,
16886 v: V,
16887 ) -> Self {
16888 self.0.request = v.into();
16889 self
16890 }
16891
16892 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16894 self.0.options = v.into();
16895 self
16896 }
16897
16898 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16905 (*self.0.stub)
16906 .create_gateway_security_policy(self.0.request, self.0.options)
16907 .await
16908 .map(crate::Response::into_body)
16909 }
16910
16911 pub fn poller(
16913 self,
16914 ) -> impl google_cloud_lro::Poller<
16915 crate::model::GatewaySecurityPolicy,
16916 crate::model::OperationMetadata,
16917 > {
16918 type Operation = google_cloud_lro::internal::Operation<
16919 crate::model::GatewaySecurityPolicy,
16920 crate::model::OperationMetadata,
16921 >;
16922 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16923 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16924
16925 let stub = self.0.stub.clone();
16926 let mut options = self.0.options.clone();
16927 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16928 let query = move |name| {
16929 let stub = stub.clone();
16930 let options = options.clone();
16931 async {
16932 let op = GetOperation::new(stub)
16933 .set_name(name)
16934 .with_options(options)
16935 .send()
16936 .await?;
16937 Ok(Operation::new(op))
16938 }
16939 };
16940
16941 let start = move || async {
16942 let op = self.send().await?;
16943 Ok(Operation::new(op))
16944 };
16945
16946 google_cloud_lro::internal::new_poller(
16947 polling_error_policy,
16948 polling_backoff_policy,
16949 start,
16950 query,
16951 )
16952 }
16953
16954 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16958 self.0.request.parent = v.into();
16959 self
16960 }
16961
16962 pub fn set_gateway_security_policy_id<T: Into<std::string::String>>(
16966 mut self,
16967 v: T,
16968 ) -> Self {
16969 self.0.request.gateway_security_policy_id = v.into();
16970 self
16971 }
16972
16973 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16977 where
16978 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16979 {
16980 self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16981 self
16982 }
16983
16984 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16988 where
16989 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16990 {
16991 self.0.request.gateway_security_policy = v.map(|x| x.into());
16992 self
16993 }
16994 }
16995
16996 #[doc(hidden)]
16997 impl crate::RequestBuilder for CreateGatewaySecurityPolicy {
16998 fn request_options(&mut self) -> &mut crate::RequestOptions {
16999 &mut self.0.options
17000 }
17001 }
17002
17003 #[derive(Clone, Debug)]
17021 pub struct UpdateGatewaySecurityPolicy(
17022 RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRequest>,
17023 );
17024
17025 impl UpdateGatewaySecurityPolicy {
17026 pub(crate) fn new(
17027 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17028 ) -> Self {
17029 Self(RequestBuilder::new(stub))
17030 }
17031
17032 pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRequest>>(
17034 mut self,
17035 v: V,
17036 ) -> Self {
17037 self.0.request = v.into();
17038 self
17039 }
17040
17041 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17043 self.0.options = v.into();
17044 self
17045 }
17046
17047 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17054 (*self.0.stub)
17055 .update_gateway_security_policy(self.0.request, self.0.options)
17056 .await
17057 .map(crate::Response::into_body)
17058 }
17059
17060 pub fn poller(
17062 self,
17063 ) -> impl google_cloud_lro::Poller<
17064 crate::model::GatewaySecurityPolicy,
17065 crate::model::OperationMetadata,
17066 > {
17067 type Operation = google_cloud_lro::internal::Operation<
17068 crate::model::GatewaySecurityPolicy,
17069 crate::model::OperationMetadata,
17070 >;
17071 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17072 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17073
17074 let stub = self.0.stub.clone();
17075 let mut options = self.0.options.clone();
17076 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17077 let query = move |name| {
17078 let stub = stub.clone();
17079 let options = options.clone();
17080 async {
17081 let op = GetOperation::new(stub)
17082 .set_name(name)
17083 .with_options(options)
17084 .send()
17085 .await?;
17086 Ok(Operation::new(op))
17087 }
17088 };
17089
17090 let start = move || async {
17091 let op = self.send().await?;
17092 Ok(Operation::new(op))
17093 };
17094
17095 google_cloud_lro::internal::new_poller(
17096 polling_error_policy,
17097 polling_backoff_policy,
17098 start,
17099 query,
17100 )
17101 }
17102
17103 pub fn set_update_mask<T>(mut self, v: T) -> Self
17105 where
17106 T: std::convert::Into<wkt::FieldMask>,
17107 {
17108 self.0.request.update_mask = std::option::Option::Some(v.into());
17109 self
17110 }
17111
17112 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17114 where
17115 T: std::convert::Into<wkt::FieldMask>,
17116 {
17117 self.0.request.update_mask = v.map(|x| x.into());
17118 self
17119 }
17120
17121 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
17125 where
17126 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17127 {
17128 self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
17129 self
17130 }
17131
17132 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
17136 where
17137 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17138 {
17139 self.0.request.gateway_security_policy = v.map(|x| x.into());
17140 self
17141 }
17142 }
17143
17144 #[doc(hidden)]
17145 impl crate::RequestBuilder for UpdateGatewaySecurityPolicy {
17146 fn request_options(&mut self) -> &mut crate::RequestOptions {
17147 &mut self.0.options
17148 }
17149 }
17150
17151 #[derive(Clone, Debug)]
17169 pub struct DeleteGatewaySecurityPolicy(
17170 RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRequest>,
17171 );
17172
17173 impl DeleteGatewaySecurityPolicy {
17174 pub(crate) fn new(
17175 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17176 ) -> Self {
17177 Self(RequestBuilder::new(stub))
17178 }
17179
17180 pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRequest>>(
17182 mut self,
17183 v: V,
17184 ) -> Self {
17185 self.0.request = v.into();
17186 self
17187 }
17188
17189 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17191 self.0.options = v.into();
17192 self
17193 }
17194
17195 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17202 (*self.0.stub)
17203 .delete_gateway_security_policy(self.0.request, self.0.options)
17204 .await
17205 .map(crate::Response::into_body)
17206 }
17207
17208 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17210 type Operation =
17211 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17212 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17213 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17214
17215 let stub = self.0.stub.clone();
17216 let mut options = self.0.options.clone();
17217 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17218 let query = move |name| {
17219 let stub = stub.clone();
17220 let options = options.clone();
17221 async {
17222 let op = GetOperation::new(stub)
17223 .set_name(name)
17224 .with_options(options)
17225 .send()
17226 .await?;
17227 Ok(Operation::new(op))
17228 }
17229 };
17230
17231 let start = move || async {
17232 let op = self.send().await?;
17233 Ok(Operation::new(op))
17234 };
17235
17236 google_cloud_lro::internal::new_unit_response_poller(
17237 polling_error_policy,
17238 polling_backoff_policy,
17239 start,
17240 query,
17241 )
17242 }
17243
17244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17248 self.0.request.name = v.into();
17249 self
17250 }
17251 }
17252
17253 #[doc(hidden)]
17254 impl crate::RequestBuilder for DeleteGatewaySecurityPolicy {
17255 fn request_options(&mut self) -> &mut crate::RequestOptions {
17256 &mut self.0.options
17257 }
17258 }
17259
17260 #[derive(Clone, Debug)]
17281 pub struct ListGatewaySecurityPolicyRules(
17282 RequestBuilder<crate::model::ListGatewaySecurityPolicyRulesRequest>,
17283 );
17284
17285 impl ListGatewaySecurityPolicyRules {
17286 pub(crate) fn new(
17287 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17288 ) -> Self {
17289 Self(RequestBuilder::new(stub))
17290 }
17291
17292 pub fn with_request<V: Into<crate::model::ListGatewaySecurityPolicyRulesRequest>>(
17294 mut self,
17295 v: V,
17296 ) -> Self {
17297 self.0.request = v.into();
17298 self
17299 }
17300
17301 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17303 self.0.options = v.into();
17304 self
17305 }
17306
17307 pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPolicyRulesResponse> {
17309 (*self.0.stub)
17310 .list_gateway_security_policy_rules(self.0.request, self.0.options)
17311 .await
17312 .map(crate::Response::into_body)
17313 }
17314
17315 pub fn by_page(
17317 self,
17318 ) -> impl google_cloud_gax::paginator::Paginator<
17319 crate::model::ListGatewaySecurityPolicyRulesResponse,
17320 crate::Error,
17321 > {
17322 use std::clone::Clone;
17323 let token = self.0.request.page_token.clone();
17324 let execute = move |token: String| {
17325 let mut builder = self.clone();
17326 builder.0.request = builder.0.request.set_page_token(token);
17327 builder.send()
17328 };
17329 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17330 }
17331
17332 pub fn by_item(
17334 self,
17335 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17336 crate::model::ListGatewaySecurityPolicyRulesResponse,
17337 crate::Error,
17338 > {
17339 use google_cloud_gax::paginator::Paginator;
17340 self.by_page().items()
17341 }
17342
17343 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17347 self.0.request.parent = v.into();
17348 self
17349 }
17350
17351 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17353 self.0.request.page_size = v.into();
17354 self
17355 }
17356
17357 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17359 self.0.request.page_token = v.into();
17360 self
17361 }
17362 }
17363
17364 #[doc(hidden)]
17365 impl crate::RequestBuilder for ListGatewaySecurityPolicyRules {
17366 fn request_options(&mut self) -> &mut crate::RequestOptions {
17367 &mut self.0.options
17368 }
17369 }
17370
17371 #[derive(Clone, Debug)]
17388 pub struct GetGatewaySecurityPolicyRule(
17389 RequestBuilder<crate::model::GetGatewaySecurityPolicyRuleRequest>,
17390 );
17391
17392 impl GetGatewaySecurityPolicyRule {
17393 pub(crate) fn new(
17394 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17395 ) -> Self {
17396 Self(RequestBuilder::new(stub))
17397 }
17398
17399 pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRuleRequest>>(
17401 mut self,
17402 v: V,
17403 ) -> Self {
17404 self.0.request = v.into();
17405 self
17406 }
17407
17408 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17410 self.0.options = v.into();
17411 self
17412 }
17413
17414 pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicyRule> {
17416 (*self.0.stub)
17417 .get_gateway_security_policy_rule(self.0.request, self.0.options)
17418 .await
17419 .map(crate::Response::into_body)
17420 }
17421
17422 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17426 self.0.request.name = v.into();
17427 self
17428 }
17429 }
17430
17431 #[doc(hidden)]
17432 impl crate::RequestBuilder for GetGatewaySecurityPolicyRule {
17433 fn request_options(&mut self) -> &mut crate::RequestOptions {
17434 &mut self.0.options
17435 }
17436 }
17437
17438 #[derive(Clone, Debug)]
17456 pub struct CreateGatewaySecurityPolicyRule(
17457 RequestBuilder<crate::model::CreateGatewaySecurityPolicyRuleRequest>,
17458 );
17459
17460 impl CreateGatewaySecurityPolicyRule {
17461 pub(crate) fn new(
17462 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17463 ) -> Self {
17464 Self(RequestBuilder::new(stub))
17465 }
17466
17467 pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRuleRequest>>(
17469 mut self,
17470 v: V,
17471 ) -> Self {
17472 self.0.request = v.into();
17473 self
17474 }
17475
17476 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17478 self.0.options = v.into();
17479 self
17480 }
17481
17482 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17489 (*self.0.stub)
17490 .create_gateway_security_policy_rule(self.0.request, self.0.options)
17491 .await
17492 .map(crate::Response::into_body)
17493 }
17494
17495 pub fn poller(
17497 self,
17498 ) -> impl google_cloud_lro::Poller<
17499 crate::model::GatewaySecurityPolicyRule,
17500 crate::model::OperationMetadata,
17501 > {
17502 type Operation = google_cloud_lro::internal::Operation<
17503 crate::model::GatewaySecurityPolicyRule,
17504 crate::model::OperationMetadata,
17505 >;
17506 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17507 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17508
17509 let stub = self.0.stub.clone();
17510 let mut options = self.0.options.clone();
17511 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17512 let query = move |name| {
17513 let stub = stub.clone();
17514 let options = options.clone();
17515 async {
17516 let op = GetOperation::new(stub)
17517 .set_name(name)
17518 .with_options(options)
17519 .send()
17520 .await?;
17521 Ok(Operation::new(op))
17522 }
17523 };
17524
17525 let start = move || async {
17526 let op = self.send().await?;
17527 Ok(Operation::new(op))
17528 };
17529
17530 google_cloud_lro::internal::new_poller(
17531 polling_error_policy,
17532 polling_backoff_policy,
17533 start,
17534 query,
17535 )
17536 }
17537
17538 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17542 self.0.request.parent = v.into();
17543 self
17544 }
17545
17546 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
17550 where
17551 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17552 {
17553 self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
17554 self
17555 }
17556
17557 pub fn set_or_clear_gateway_security_policy_rule<T>(
17561 mut self,
17562 v: std::option::Option<T>,
17563 ) -> Self
17564 where
17565 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17566 {
17567 self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
17568 self
17569 }
17570
17571 pub fn set_gateway_security_policy_rule_id<T: Into<std::string::String>>(
17573 mut self,
17574 v: T,
17575 ) -> Self {
17576 self.0.request.gateway_security_policy_rule_id = v.into();
17577 self
17578 }
17579 }
17580
17581 #[doc(hidden)]
17582 impl crate::RequestBuilder for CreateGatewaySecurityPolicyRule {
17583 fn request_options(&mut self) -> &mut crate::RequestOptions {
17584 &mut self.0.options
17585 }
17586 }
17587
17588 #[derive(Clone, Debug)]
17606 pub struct UpdateGatewaySecurityPolicyRule(
17607 RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRuleRequest>,
17608 );
17609
17610 impl UpdateGatewaySecurityPolicyRule {
17611 pub(crate) fn new(
17612 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17613 ) -> Self {
17614 Self(RequestBuilder::new(stub))
17615 }
17616
17617 pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRuleRequest>>(
17619 mut self,
17620 v: V,
17621 ) -> Self {
17622 self.0.request = v.into();
17623 self
17624 }
17625
17626 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17628 self.0.options = v.into();
17629 self
17630 }
17631
17632 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17639 (*self.0.stub)
17640 .update_gateway_security_policy_rule(self.0.request, self.0.options)
17641 .await
17642 .map(crate::Response::into_body)
17643 }
17644
17645 pub fn poller(
17647 self,
17648 ) -> impl google_cloud_lro::Poller<
17649 crate::model::GatewaySecurityPolicyRule,
17650 crate::model::OperationMetadata,
17651 > {
17652 type Operation = google_cloud_lro::internal::Operation<
17653 crate::model::GatewaySecurityPolicyRule,
17654 crate::model::OperationMetadata,
17655 >;
17656 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17657 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17658
17659 let stub = self.0.stub.clone();
17660 let mut options = self.0.options.clone();
17661 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17662 let query = move |name| {
17663 let stub = stub.clone();
17664 let options = options.clone();
17665 async {
17666 let op = GetOperation::new(stub)
17667 .set_name(name)
17668 .with_options(options)
17669 .send()
17670 .await?;
17671 Ok(Operation::new(op))
17672 }
17673 };
17674
17675 let start = move || async {
17676 let op = self.send().await?;
17677 Ok(Operation::new(op))
17678 };
17679
17680 google_cloud_lro::internal::new_poller(
17681 polling_error_policy,
17682 polling_backoff_policy,
17683 start,
17684 query,
17685 )
17686 }
17687
17688 pub fn set_update_mask<T>(mut self, v: T) -> Self
17690 where
17691 T: std::convert::Into<wkt::FieldMask>,
17692 {
17693 self.0.request.update_mask = std::option::Option::Some(v.into());
17694 self
17695 }
17696
17697 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17699 where
17700 T: std::convert::Into<wkt::FieldMask>,
17701 {
17702 self.0.request.update_mask = v.map(|x| x.into());
17703 self
17704 }
17705
17706 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
17710 where
17711 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17712 {
17713 self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
17714 self
17715 }
17716
17717 pub fn set_or_clear_gateway_security_policy_rule<T>(
17721 mut self,
17722 v: std::option::Option<T>,
17723 ) -> Self
17724 where
17725 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17726 {
17727 self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
17728 self
17729 }
17730 }
17731
17732 #[doc(hidden)]
17733 impl crate::RequestBuilder for UpdateGatewaySecurityPolicyRule {
17734 fn request_options(&mut self) -> &mut crate::RequestOptions {
17735 &mut self.0.options
17736 }
17737 }
17738
17739 #[derive(Clone, Debug)]
17757 pub struct DeleteGatewaySecurityPolicyRule(
17758 RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRuleRequest>,
17759 );
17760
17761 impl DeleteGatewaySecurityPolicyRule {
17762 pub(crate) fn new(
17763 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17764 ) -> Self {
17765 Self(RequestBuilder::new(stub))
17766 }
17767
17768 pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRuleRequest>>(
17770 mut self,
17771 v: V,
17772 ) -> Self {
17773 self.0.request = v.into();
17774 self
17775 }
17776
17777 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17779 self.0.options = v.into();
17780 self
17781 }
17782
17783 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17790 (*self.0.stub)
17791 .delete_gateway_security_policy_rule(self.0.request, self.0.options)
17792 .await
17793 .map(crate::Response::into_body)
17794 }
17795
17796 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17798 type Operation =
17799 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17800 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17801 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17802
17803 let stub = self.0.stub.clone();
17804 let mut options = self.0.options.clone();
17805 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17806 let query = move |name| {
17807 let stub = stub.clone();
17808 let options = options.clone();
17809 async {
17810 let op = GetOperation::new(stub)
17811 .set_name(name)
17812 .with_options(options)
17813 .send()
17814 .await?;
17815 Ok(Operation::new(op))
17816 }
17817 };
17818
17819 let start = move || async {
17820 let op = self.send().await?;
17821 Ok(Operation::new(op))
17822 };
17823
17824 google_cloud_lro::internal::new_unit_response_poller(
17825 polling_error_policy,
17826 polling_backoff_policy,
17827 start,
17828 query,
17829 )
17830 }
17831
17832 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17836 self.0.request.name = v.into();
17837 self
17838 }
17839 }
17840
17841 #[doc(hidden)]
17842 impl crate::RequestBuilder for DeleteGatewaySecurityPolicyRule {
17843 fn request_options(&mut self) -> &mut crate::RequestOptions {
17844 &mut self.0.options
17845 }
17846 }
17847
17848 #[derive(Clone, Debug)]
17869 pub struct ListUrlLists(RequestBuilder<crate::model::ListUrlListsRequest>);
17870
17871 impl ListUrlLists {
17872 pub(crate) fn new(
17873 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17874 ) -> Self {
17875 Self(RequestBuilder::new(stub))
17876 }
17877
17878 pub fn with_request<V: Into<crate::model::ListUrlListsRequest>>(mut self, v: V) -> Self {
17880 self.0.request = v.into();
17881 self
17882 }
17883
17884 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17886 self.0.options = v.into();
17887 self
17888 }
17889
17890 pub async fn send(self) -> Result<crate::model::ListUrlListsResponse> {
17892 (*self.0.stub)
17893 .list_url_lists(self.0.request, self.0.options)
17894 .await
17895 .map(crate::Response::into_body)
17896 }
17897
17898 pub fn by_page(
17900 self,
17901 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUrlListsResponse, crate::Error>
17902 {
17903 use std::clone::Clone;
17904 let token = self.0.request.page_token.clone();
17905 let execute = move |token: String| {
17906 let mut builder = self.clone();
17907 builder.0.request = builder.0.request.set_page_token(token);
17908 builder.send()
17909 };
17910 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17911 }
17912
17913 pub fn by_item(
17915 self,
17916 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17917 crate::model::ListUrlListsResponse,
17918 crate::Error,
17919 > {
17920 use google_cloud_gax::paginator::Paginator;
17921 self.by_page().items()
17922 }
17923
17924 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17928 self.0.request.parent = v.into();
17929 self
17930 }
17931
17932 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17934 self.0.request.page_size = v.into();
17935 self
17936 }
17937
17938 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17940 self.0.request.page_token = v.into();
17941 self
17942 }
17943 }
17944
17945 #[doc(hidden)]
17946 impl crate::RequestBuilder for ListUrlLists {
17947 fn request_options(&mut self) -> &mut crate::RequestOptions {
17948 &mut self.0.options
17949 }
17950 }
17951
17952 #[derive(Clone, Debug)]
17969 pub struct GetUrlList(RequestBuilder<crate::model::GetUrlListRequest>);
17970
17971 impl GetUrlList {
17972 pub(crate) fn new(
17973 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17974 ) -> Self {
17975 Self(RequestBuilder::new(stub))
17976 }
17977
17978 pub fn with_request<V: Into<crate::model::GetUrlListRequest>>(mut self, v: V) -> Self {
17980 self.0.request = v.into();
17981 self
17982 }
17983
17984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17986 self.0.options = v.into();
17987 self
17988 }
17989
17990 pub async fn send(self) -> Result<crate::model::UrlList> {
17992 (*self.0.stub)
17993 .get_url_list(self.0.request, self.0.options)
17994 .await
17995 .map(crate::Response::into_body)
17996 }
17997
17998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18002 self.0.request.name = v.into();
18003 self
18004 }
18005 }
18006
18007 #[doc(hidden)]
18008 impl crate::RequestBuilder for GetUrlList {
18009 fn request_options(&mut self) -> &mut crate::RequestOptions {
18010 &mut self.0.options
18011 }
18012 }
18013
18014 #[derive(Clone, Debug)]
18032 pub struct CreateUrlList(RequestBuilder<crate::model::CreateUrlListRequest>);
18033
18034 impl CreateUrlList {
18035 pub(crate) fn new(
18036 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18037 ) -> Self {
18038 Self(RequestBuilder::new(stub))
18039 }
18040
18041 pub fn with_request<V: Into<crate::model::CreateUrlListRequest>>(mut self, v: V) -> Self {
18043 self.0.request = v.into();
18044 self
18045 }
18046
18047 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18049 self.0.options = v.into();
18050 self
18051 }
18052
18053 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18060 (*self.0.stub)
18061 .create_url_list(self.0.request, self.0.options)
18062 .await
18063 .map(crate::Response::into_body)
18064 }
18065
18066 pub fn poller(
18068 self,
18069 ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
18070 {
18071 type Operation = google_cloud_lro::internal::Operation<
18072 crate::model::UrlList,
18073 crate::model::OperationMetadata,
18074 >;
18075 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18076 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18077
18078 let stub = self.0.stub.clone();
18079 let mut options = self.0.options.clone();
18080 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18081 let query = move |name| {
18082 let stub = stub.clone();
18083 let options = options.clone();
18084 async {
18085 let op = GetOperation::new(stub)
18086 .set_name(name)
18087 .with_options(options)
18088 .send()
18089 .await?;
18090 Ok(Operation::new(op))
18091 }
18092 };
18093
18094 let start = move || async {
18095 let op = self.send().await?;
18096 Ok(Operation::new(op))
18097 };
18098
18099 google_cloud_lro::internal::new_poller(
18100 polling_error_policy,
18101 polling_backoff_policy,
18102 start,
18103 query,
18104 )
18105 }
18106
18107 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18111 self.0.request.parent = v.into();
18112 self
18113 }
18114
18115 pub fn set_url_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18119 self.0.request.url_list_id = v.into();
18120 self
18121 }
18122
18123 pub fn set_url_list<T>(mut self, v: T) -> Self
18127 where
18128 T: std::convert::Into<crate::model::UrlList>,
18129 {
18130 self.0.request.url_list = std::option::Option::Some(v.into());
18131 self
18132 }
18133
18134 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
18138 where
18139 T: std::convert::Into<crate::model::UrlList>,
18140 {
18141 self.0.request.url_list = v.map(|x| x.into());
18142 self
18143 }
18144 }
18145
18146 #[doc(hidden)]
18147 impl crate::RequestBuilder for CreateUrlList {
18148 fn request_options(&mut self) -> &mut crate::RequestOptions {
18149 &mut self.0.options
18150 }
18151 }
18152
18153 #[derive(Clone, Debug)]
18171 pub struct UpdateUrlList(RequestBuilder<crate::model::UpdateUrlListRequest>);
18172
18173 impl UpdateUrlList {
18174 pub(crate) fn new(
18175 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18176 ) -> Self {
18177 Self(RequestBuilder::new(stub))
18178 }
18179
18180 pub fn with_request<V: Into<crate::model::UpdateUrlListRequest>>(mut self, v: V) -> Self {
18182 self.0.request = v.into();
18183 self
18184 }
18185
18186 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18188 self.0.options = v.into();
18189 self
18190 }
18191
18192 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18199 (*self.0.stub)
18200 .update_url_list(self.0.request, self.0.options)
18201 .await
18202 .map(crate::Response::into_body)
18203 }
18204
18205 pub fn poller(
18207 self,
18208 ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
18209 {
18210 type Operation = google_cloud_lro::internal::Operation<
18211 crate::model::UrlList,
18212 crate::model::OperationMetadata,
18213 >;
18214 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18215 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18216
18217 let stub = self.0.stub.clone();
18218 let mut options = self.0.options.clone();
18219 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18220 let query = move |name| {
18221 let stub = stub.clone();
18222 let options = options.clone();
18223 async {
18224 let op = GetOperation::new(stub)
18225 .set_name(name)
18226 .with_options(options)
18227 .send()
18228 .await?;
18229 Ok(Operation::new(op))
18230 }
18231 };
18232
18233 let start = move || async {
18234 let op = self.send().await?;
18235 Ok(Operation::new(op))
18236 };
18237
18238 google_cloud_lro::internal::new_poller(
18239 polling_error_policy,
18240 polling_backoff_policy,
18241 start,
18242 query,
18243 )
18244 }
18245
18246 pub fn set_update_mask<T>(mut self, v: T) -> Self
18248 where
18249 T: std::convert::Into<wkt::FieldMask>,
18250 {
18251 self.0.request.update_mask = std::option::Option::Some(v.into());
18252 self
18253 }
18254
18255 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18257 where
18258 T: std::convert::Into<wkt::FieldMask>,
18259 {
18260 self.0.request.update_mask = v.map(|x| x.into());
18261 self
18262 }
18263
18264 pub fn set_url_list<T>(mut self, v: T) -> Self
18268 where
18269 T: std::convert::Into<crate::model::UrlList>,
18270 {
18271 self.0.request.url_list = std::option::Option::Some(v.into());
18272 self
18273 }
18274
18275 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
18279 where
18280 T: std::convert::Into<crate::model::UrlList>,
18281 {
18282 self.0.request.url_list = v.map(|x| x.into());
18283 self
18284 }
18285 }
18286
18287 #[doc(hidden)]
18288 impl crate::RequestBuilder for UpdateUrlList {
18289 fn request_options(&mut self) -> &mut crate::RequestOptions {
18290 &mut self.0.options
18291 }
18292 }
18293
18294 #[derive(Clone, Debug)]
18312 pub struct DeleteUrlList(RequestBuilder<crate::model::DeleteUrlListRequest>);
18313
18314 impl DeleteUrlList {
18315 pub(crate) fn new(
18316 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18317 ) -> Self {
18318 Self(RequestBuilder::new(stub))
18319 }
18320
18321 pub fn with_request<V: Into<crate::model::DeleteUrlListRequest>>(mut self, v: V) -> Self {
18323 self.0.request = v.into();
18324 self
18325 }
18326
18327 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18329 self.0.options = v.into();
18330 self
18331 }
18332
18333 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18340 (*self.0.stub)
18341 .delete_url_list(self.0.request, self.0.options)
18342 .await
18343 .map(crate::Response::into_body)
18344 }
18345
18346 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18348 type Operation =
18349 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18350 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18351 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18352
18353 let stub = self.0.stub.clone();
18354 let mut options = self.0.options.clone();
18355 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18356 let query = move |name| {
18357 let stub = stub.clone();
18358 let options = options.clone();
18359 async {
18360 let op = GetOperation::new(stub)
18361 .set_name(name)
18362 .with_options(options)
18363 .send()
18364 .await?;
18365 Ok(Operation::new(op))
18366 }
18367 };
18368
18369 let start = move || async {
18370 let op = self.send().await?;
18371 Ok(Operation::new(op))
18372 };
18373
18374 google_cloud_lro::internal::new_unit_response_poller(
18375 polling_error_policy,
18376 polling_backoff_policy,
18377 start,
18378 query,
18379 )
18380 }
18381
18382 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18386 self.0.request.name = v.into();
18387 self
18388 }
18389 }
18390
18391 #[doc(hidden)]
18392 impl crate::RequestBuilder for DeleteUrlList {
18393 fn request_options(&mut self) -> &mut crate::RequestOptions {
18394 &mut self.0.options
18395 }
18396 }
18397
18398 #[derive(Clone, Debug)]
18419 pub struct ListTlsInspectionPolicies(
18420 RequestBuilder<crate::model::ListTlsInspectionPoliciesRequest>,
18421 );
18422
18423 impl ListTlsInspectionPolicies {
18424 pub(crate) fn new(
18425 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18426 ) -> Self {
18427 Self(RequestBuilder::new(stub))
18428 }
18429
18430 pub fn with_request<V: Into<crate::model::ListTlsInspectionPoliciesRequest>>(
18432 mut self,
18433 v: V,
18434 ) -> Self {
18435 self.0.request = v.into();
18436 self
18437 }
18438
18439 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18441 self.0.options = v.into();
18442 self
18443 }
18444
18445 pub async fn send(self) -> Result<crate::model::ListTlsInspectionPoliciesResponse> {
18447 (*self.0.stub)
18448 .list_tls_inspection_policies(self.0.request, self.0.options)
18449 .await
18450 .map(crate::Response::into_body)
18451 }
18452
18453 pub fn by_page(
18455 self,
18456 ) -> impl google_cloud_gax::paginator::Paginator<
18457 crate::model::ListTlsInspectionPoliciesResponse,
18458 crate::Error,
18459 > {
18460 use std::clone::Clone;
18461 let token = self.0.request.page_token.clone();
18462 let execute = move |token: String| {
18463 let mut builder = self.clone();
18464 builder.0.request = builder.0.request.set_page_token(token);
18465 builder.send()
18466 };
18467 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18468 }
18469
18470 pub fn by_item(
18472 self,
18473 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18474 crate::model::ListTlsInspectionPoliciesResponse,
18475 crate::Error,
18476 > {
18477 use google_cloud_gax::paginator::Paginator;
18478 self.by_page().items()
18479 }
18480
18481 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18485 self.0.request.parent = v.into();
18486 self
18487 }
18488
18489 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18491 self.0.request.page_size = v.into();
18492 self
18493 }
18494
18495 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18497 self.0.request.page_token = v.into();
18498 self
18499 }
18500 }
18501
18502 #[doc(hidden)]
18503 impl crate::RequestBuilder for ListTlsInspectionPolicies {
18504 fn request_options(&mut self) -> &mut crate::RequestOptions {
18505 &mut self.0.options
18506 }
18507 }
18508
18509 #[derive(Clone, Debug)]
18526 pub struct GetTlsInspectionPolicy(RequestBuilder<crate::model::GetTlsInspectionPolicyRequest>);
18527
18528 impl GetTlsInspectionPolicy {
18529 pub(crate) fn new(
18530 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18531 ) -> Self {
18532 Self(RequestBuilder::new(stub))
18533 }
18534
18535 pub fn with_request<V: Into<crate::model::GetTlsInspectionPolicyRequest>>(
18537 mut self,
18538 v: V,
18539 ) -> Self {
18540 self.0.request = v.into();
18541 self
18542 }
18543
18544 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18546 self.0.options = v.into();
18547 self
18548 }
18549
18550 pub async fn send(self) -> Result<crate::model::TlsInspectionPolicy> {
18552 (*self.0.stub)
18553 .get_tls_inspection_policy(self.0.request, self.0.options)
18554 .await
18555 .map(crate::Response::into_body)
18556 }
18557
18558 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18562 self.0.request.name = v.into();
18563 self
18564 }
18565 }
18566
18567 #[doc(hidden)]
18568 impl crate::RequestBuilder for GetTlsInspectionPolicy {
18569 fn request_options(&mut self) -> &mut crate::RequestOptions {
18570 &mut self.0.options
18571 }
18572 }
18573
18574 #[derive(Clone, Debug)]
18592 pub struct CreateTlsInspectionPolicy(
18593 RequestBuilder<crate::model::CreateTlsInspectionPolicyRequest>,
18594 );
18595
18596 impl CreateTlsInspectionPolicy {
18597 pub(crate) fn new(
18598 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18599 ) -> Self {
18600 Self(RequestBuilder::new(stub))
18601 }
18602
18603 pub fn with_request<V: Into<crate::model::CreateTlsInspectionPolicyRequest>>(
18605 mut self,
18606 v: V,
18607 ) -> Self {
18608 self.0.request = v.into();
18609 self
18610 }
18611
18612 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18614 self.0.options = v.into();
18615 self
18616 }
18617
18618 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18625 (*self.0.stub)
18626 .create_tls_inspection_policy(self.0.request, self.0.options)
18627 .await
18628 .map(crate::Response::into_body)
18629 }
18630
18631 pub fn poller(
18633 self,
18634 ) -> impl google_cloud_lro::Poller<
18635 crate::model::TlsInspectionPolicy,
18636 crate::model::OperationMetadata,
18637 > {
18638 type Operation = google_cloud_lro::internal::Operation<
18639 crate::model::TlsInspectionPolicy,
18640 crate::model::OperationMetadata,
18641 >;
18642 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18643 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18644
18645 let stub = self.0.stub.clone();
18646 let mut options = self.0.options.clone();
18647 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18648 let query = move |name| {
18649 let stub = stub.clone();
18650 let options = options.clone();
18651 async {
18652 let op = GetOperation::new(stub)
18653 .set_name(name)
18654 .with_options(options)
18655 .send()
18656 .await?;
18657 Ok(Operation::new(op))
18658 }
18659 };
18660
18661 let start = move || async {
18662 let op = self.send().await?;
18663 Ok(Operation::new(op))
18664 };
18665
18666 google_cloud_lro::internal::new_poller(
18667 polling_error_policy,
18668 polling_backoff_policy,
18669 start,
18670 query,
18671 )
18672 }
18673
18674 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18678 self.0.request.parent = v.into();
18679 self
18680 }
18681
18682 pub fn set_tls_inspection_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18686 self.0.request.tls_inspection_policy_id = v.into();
18687 self
18688 }
18689
18690 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18694 where
18695 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18696 {
18697 self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18698 self
18699 }
18700
18701 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18705 where
18706 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18707 {
18708 self.0.request.tls_inspection_policy = v.map(|x| x.into());
18709 self
18710 }
18711 }
18712
18713 #[doc(hidden)]
18714 impl crate::RequestBuilder for CreateTlsInspectionPolicy {
18715 fn request_options(&mut self) -> &mut crate::RequestOptions {
18716 &mut self.0.options
18717 }
18718 }
18719
18720 #[derive(Clone, Debug)]
18738 pub struct UpdateTlsInspectionPolicy(
18739 RequestBuilder<crate::model::UpdateTlsInspectionPolicyRequest>,
18740 );
18741
18742 impl UpdateTlsInspectionPolicy {
18743 pub(crate) fn new(
18744 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18745 ) -> Self {
18746 Self(RequestBuilder::new(stub))
18747 }
18748
18749 pub fn with_request<V: Into<crate::model::UpdateTlsInspectionPolicyRequest>>(
18751 mut self,
18752 v: V,
18753 ) -> Self {
18754 self.0.request = v.into();
18755 self
18756 }
18757
18758 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18760 self.0.options = v.into();
18761 self
18762 }
18763
18764 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18771 (*self.0.stub)
18772 .update_tls_inspection_policy(self.0.request, self.0.options)
18773 .await
18774 .map(crate::Response::into_body)
18775 }
18776
18777 pub fn poller(
18779 self,
18780 ) -> impl google_cloud_lro::Poller<
18781 crate::model::TlsInspectionPolicy,
18782 crate::model::OperationMetadata,
18783 > {
18784 type Operation = google_cloud_lro::internal::Operation<
18785 crate::model::TlsInspectionPolicy,
18786 crate::model::OperationMetadata,
18787 >;
18788 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18789 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18790
18791 let stub = self.0.stub.clone();
18792 let mut options = self.0.options.clone();
18793 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18794 let query = move |name| {
18795 let stub = stub.clone();
18796 let options = options.clone();
18797 async {
18798 let op = GetOperation::new(stub)
18799 .set_name(name)
18800 .with_options(options)
18801 .send()
18802 .await?;
18803 Ok(Operation::new(op))
18804 }
18805 };
18806
18807 let start = move || async {
18808 let op = self.send().await?;
18809 Ok(Operation::new(op))
18810 };
18811
18812 google_cloud_lro::internal::new_poller(
18813 polling_error_policy,
18814 polling_backoff_policy,
18815 start,
18816 query,
18817 )
18818 }
18819
18820 pub fn set_update_mask<T>(mut self, v: T) -> Self
18822 where
18823 T: std::convert::Into<wkt::FieldMask>,
18824 {
18825 self.0.request.update_mask = std::option::Option::Some(v.into());
18826 self
18827 }
18828
18829 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18831 where
18832 T: std::convert::Into<wkt::FieldMask>,
18833 {
18834 self.0.request.update_mask = v.map(|x| x.into());
18835 self
18836 }
18837
18838 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18842 where
18843 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18844 {
18845 self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18846 self
18847 }
18848
18849 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18853 where
18854 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18855 {
18856 self.0.request.tls_inspection_policy = v.map(|x| x.into());
18857 self
18858 }
18859 }
18860
18861 #[doc(hidden)]
18862 impl crate::RequestBuilder for UpdateTlsInspectionPolicy {
18863 fn request_options(&mut self) -> &mut crate::RequestOptions {
18864 &mut self.0.options
18865 }
18866 }
18867
18868 #[derive(Clone, Debug)]
18886 pub struct DeleteTlsInspectionPolicy(
18887 RequestBuilder<crate::model::DeleteTlsInspectionPolicyRequest>,
18888 );
18889
18890 impl DeleteTlsInspectionPolicy {
18891 pub(crate) fn new(
18892 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18893 ) -> Self {
18894 Self(RequestBuilder::new(stub))
18895 }
18896
18897 pub fn with_request<V: Into<crate::model::DeleteTlsInspectionPolicyRequest>>(
18899 mut self,
18900 v: V,
18901 ) -> Self {
18902 self.0.request = v.into();
18903 self
18904 }
18905
18906 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18908 self.0.options = v.into();
18909 self
18910 }
18911
18912 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18919 (*self.0.stub)
18920 .delete_tls_inspection_policy(self.0.request, self.0.options)
18921 .await
18922 .map(crate::Response::into_body)
18923 }
18924
18925 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18927 type Operation =
18928 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18929 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18930 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18931
18932 let stub = self.0.stub.clone();
18933 let mut options = self.0.options.clone();
18934 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18935 let query = move |name| {
18936 let stub = stub.clone();
18937 let options = options.clone();
18938 async {
18939 let op = GetOperation::new(stub)
18940 .set_name(name)
18941 .with_options(options)
18942 .send()
18943 .await?;
18944 Ok(Operation::new(op))
18945 }
18946 };
18947
18948 let start = move || async {
18949 let op = self.send().await?;
18950 Ok(Operation::new(op))
18951 };
18952
18953 google_cloud_lro::internal::new_unit_response_poller(
18954 polling_error_policy,
18955 polling_backoff_policy,
18956 start,
18957 query,
18958 )
18959 }
18960
18961 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18965 self.0.request.name = v.into();
18966 self
18967 }
18968
18969 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18971 self.0.request.force = v.into();
18972 self
18973 }
18974 }
18975
18976 #[doc(hidden)]
18977 impl crate::RequestBuilder for DeleteTlsInspectionPolicy {
18978 fn request_options(&mut self) -> &mut crate::RequestOptions {
18979 &mut self.0.options
18980 }
18981 }
18982
18983 #[derive(Clone, Debug)]
19004 pub struct ListAuthzPolicies(RequestBuilder<crate::model::ListAuthzPoliciesRequest>);
19005
19006 impl ListAuthzPolicies {
19007 pub(crate) fn new(
19008 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19009 ) -> Self {
19010 Self(RequestBuilder::new(stub))
19011 }
19012
19013 pub fn with_request<V: Into<crate::model::ListAuthzPoliciesRequest>>(
19015 mut self,
19016 v: V,
19017 ) -> Self {
19018 self.0.request = v.into();
19019 self
19020 }
19021
19022 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19024 self.0.options = v.into();
19025 self
19026 }
19027
19028 pub async fn send(self) -> Result<crate::model::ListAuthzPoliciesResponse> {
19030 (*self.0.stub)
19031 .list_authz_policies(self.0.request, self.0.options)
19032 .await
19033 .map(crate::Response::into_body)
19034 }
19035
19036 pub fn by_page(
19038 self,
19039 ) -> impl google_cloud_gax::paginator::Paginator<
19040 crate::model::ListAuthzPoliciesResponse,
19041 crate::Error,
19042 > {
19043 use std::clone::Clone;
19044 let token = self.0.request.page_token.clone();
19045 let execute = move |token: String| {
19046 let mut builder = self.clone();
19047 builder.0.request = builder.0.request.set_page_token(token);
19048 builder.send()
19049 };
19050 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19051 }
19052
19053 pub fn by_item(
19055 self,
19056 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19057 crate::model::ListAuthzPoliciesResponse,
19058 crate::Error,
19059 > {
19060 use google_cloud_gax::paginator::Paginator;
19061 self.by_page().items()
19062 }
19063
19064 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19068 self.0.request.parent = v.into();
19069 self
19070 }
19071
19072 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19074 self.0.request.page_size = v.into();
19075 self
19076 }
19077
19078 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19080 self.0.request.page_token = v.into();
19081 self
19082 }
19083
19084 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19086 self.0.request.filter = v.into();
19087 self
19088 }
19089
19090 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19092 self.0.request.order_by = v.into();
19093 self
19094 }
19095 }
19096
19097 #[doc(hidden)]
19098 impl crate::RequestBuilder for ListAuthzPolicies {
19099 fn request_options(&mut self) -> &mut crate::RequestOptions {
19100 &mut self.0.options
19101 }
19102 }
19103
19104 #[derive(Clone, Debug)]
19121 pub struct GetAuthzPolicy(RequestBuilder<crate::model::GetAuthzPolicyRequest>);
19122
19123 impl GetAuthzPolicy {
19124 pub(crate) fn new(
19125 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19126 ) -> Self {
19127 Self(RequestBuilder::new(stub))
19128 }
19129
19130 pub fn with_request<V: Into<crate::model::GetAuthzPolicyRequest>>(mut self, v: V) -> Self {
19132 self.0.request = v.into();
19133 self
19134 }
19135
19136 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19138 self.0.options = v.into();
19139 self
19140 }
19141
19142 pub async fn send(self) -> Result<crate::model::AuthzPolicy> {
19144 (*self.0.stub)
19145 .get_authz_policy(self.0.request, self.0.options)
19146 .await
19147 .map(crate::Response::into_body)
19148 }
19149
19150 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19154 self.0.request.name = v.into();
19155 self
19156 }
19157 }
19158
19159 #[doc(hidden)]
19160 impl crate::RequestBuilder for GetAuthzPolicy {
19161 fn request_options(&mut self) -> &mut crate::RequestOptions {
19162 &mut self.0.options
19163 }
19164 }
19165
19166 #[derive(Clone, Debug)]
19184 pub struct CreateAuthzPolicy(RequestBuilder<crate::model::CreateAuthzPolicyRequest>);
19185
19186 impl CreateAuthzPolicy {
19187 pub(crate) fn new(
19188 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19189 ) -> Self {
19190 Self(RequestBuilder::new(stub))
19191 }
19192
19193 pub fn with_request<V: Into<crate::model::CreateAuthzPolicyRequest>>(
19195 mut self,
19196 v: V,
19197 ) -> Self {
19198 self.0.request = v.into();
19199 self
19200 }
19201
19202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19204 self.0.options = v.into();
19205 self
19206 }
19207
19208 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19215 (*self.0.stub)
19216 .create_authz_policy(self.0.request, self.0.options)
19217 .await
19218 .map(crate::Response::into_body)
19219 }
19220
19221 pub fn poller(
19223 self,
19224 ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
19225 {
19226 type Operation = google_cloud_lro::internal::Operation<
19227 crate::model::AuthzPolicy,
19228 crate::model::OperationMetadata,
19229 >;
19230 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19231 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19232
19233 let stub = self.0.stub.clone();
19234 let mut options = self.0.options.clone();
19235 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19236 let query = move |name| {
19237 let stub = stub.clone();
19238 let options = options.clone();
19239 async {
19240 let op = GetOperation::new(stub)
19241 .set_name(name)
19242 .with_options(options)
19243 .send()
19244 .await?;
19245 Ok(Operation::new(op))
19246 }
19247 };
19248
19249 let start = move || async {
19250 let op = self.send().await?;
19251 Ok(Operation::new(op))
19252 };
19253
19254 google_cloud_lro::internal::new_poller(
19255 polling_error_policy,
19256 polling_backoff_policy,
19257 start,
19258 query,
19259 )
19260 }
19261
19262 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19266 self.0.request.parent = v.into();
19267 self
19268 }
19269
19270 pub fn set_authz_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19274 self.0.request.authz_policy_id = v.into();
19275 self
19276 }
19277
19278 pub fn set_authz_policy<T>(mut self, v: T) -> Self
19282 where
19283 T: std::convert::Into<crate::model::AuthzPolicy>,
19284 {
19285 self.0.request.authz_policy = std::option::Option::Some(v.into());
19286 self
19287 }
19288
19289 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
19293 where
19294 T: std::convert::Into<crate::model::AuthzPolicy>,
19295 {
19296 self.0.request.authz_policy = v.map(|x| x.into());
19297 self
19298 }
19299
19300 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19302 self.0.request.request_id = v.into();
19303 self
19304 }
19305 }
19306
19307 #[doc(hidden)]
19308 impl crate::RequestBuilder for CreateAuthzPolicy {
19309 fn request_options(&mut self) -> &mut crate::RequestOptions {
19310 &mut self.0.options
19311 }
19312 }
19313
19314 #[derive(Clone, Debug)]
19332 pub struct UpdateAuthzPolicy(RequestBuilder<crate::model::UpdateAuthzPolicyRequest>);
19333
19334 impl UpdateAuthzPolicy {
19335 pub(crate) fn new(
19336 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19337 ) -> Self {
19338 Self(RequestBuilder::new(stub))
19339 }
19340
19341 pub fn with_request<V: Into<crate::model::UpdateAuthzPolicyRequest>>(
19343 mut self,
19344 v: V,
19345 ) -> Self {
19346 self.0.request = v.into();
19347 self
19348 }
19349
19350 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19352 self.0.options = v.into();
19353 self
19354 }
19355
19356 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19363 (*self.0.stub)
19364 .update_authz_policy(self.0.request, self.0.options)
19365 .await
19366 .map(crate::Response::into_body)
19367 }
19368
19369 pub fn poller(
19371 self,
19372 ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
19373 {
19374 type Operation = google_cloud_lro::internal::Operation<
19375 crate::model::AuthzPolicy,
19376 crate::model::OperationMetadata,
19377 >;
19378 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19379 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19380
19381 let stub = self.0.stub.clone();
19382 let mut options = self.0.options.clone();
19383 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19384 let query = move |name| {
19385 let stub = stub.clone();
19386 let options = options.clone();
19387 async {
19388 let op = GetOperation::new(stub)
19389 .set_name(name)
19390 .with_options(options)
19391 .send()
19392 .await?;
19393 Ok(Operation::new(op))
19394 }
19395 };
19396
19397 let start = move || async {
19398 let op = self.send().await?;
19399 Ok(Operation::new(op))
19400 };
19401
19402 google_cloud_lro::internal::new_poller(
19403 polling_error_policy,
19404 polling_backoff_policy,
19405 start,
19406 query,
19407 )
19408 }
19409
19410 pub fn set_update_mask<T>(mut self, v: T) -> Self
19414 where
19415 T: std::convert::Into<wkt::FieldMask>,
19416 {
19417 self.0.request.update_mask = std::option::Option::Some(v.into());
19418 self
19419 }
19420
19421 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19425 where
19426 T: std::convert::Into<wkt::FieldMask>,
19427 {
19428 self.0.request.update_mask = v.map(|x| x.into());
19429 self
19430 }
19431
19432 pub fn set_authz_policy<T>(mut self, v: T) -> Self
19436 where
19437 T: std::convert::Into<crate::model::AuthzPolicy>,
19438 {
19439 self.0.request.authz_policy = std::option::Option::Some(v.into());
19440 self
19441 }
19442
19443 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
19447 where
19448 T: std::convert::Into<crate::model::AuthzPolicy>,
19449 {
19450 self.0.request.authz_policy = v.map(|x| x.into());
19451 self
19452 }
19453
19454 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19456 self.0.request.request_id = v.into();
19457 self
19458 }
19459 }
19460
19461 #[doc(hidden)]
19462 impl crate::RequestBuilder for UpdateAuthzPolicy {
19463 fn request_options(&mut self) -> &mut crate::RequestOptions {
19464 &mut self.0.options
19465 }
19466 }
19467
19468 #[derive(Clone, Debug)]
19486 pub struct DeleteAuthzPolicy(RequestBuilder<crate::model::DeleteAuthzPolicyRequest>);
19487
19488 impl DeleteAuthzPolicy {
19489 pub(crate) fn new(
19490 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19491 ) -> Self {
19492 Self(RequestBuilder::new(stub))
19493 }
19494
19495 pub fn with_request<V: Into<crate::model::DeleteAuthzPolicyRequest>>(
19497 mut self,
19498 v: V,
19499 ) -> Self {
19500 self.0.request = v.into();
19501 self
19502 }
19503
19504 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19506 self.0.options = v.into();
19507 self
19508 }
19509
19510 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19517 (*self.0.stub)
19518 .delete_authz_policy(self.0.request, self.0.options)
19519 .await
19520 .map(crate::Response::into_body)
19521 }
19522
19523 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19525 type Operation =
19526 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19527 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19528 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19529
19530 let stub = self.0.stub.clone();
19531 let mut options = self.0.options.clone();
19532 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19533 let query = move |name| {
19534 let stub = stub.clone();
19535 let options = options.clone();
19536 async {
19537 let op = GetOperation::new(stub)
19538 .set_name(name)
19539 .with_options(options)
19540 .send()
19541 .await?;
19542 Ok(Operation::new(op))
19543 }
19544 };
19545
19546 let start = move || async {
19547 let op = self.send().await?;
19548 Ok(Operation::new(op))
19549 };
19550
19551 google_cloud_lro::internal::new_unit_response_poller(
19552 polling_error_policy,
19553 polling_backoff_policy,
19554 start,
19555 query,
19556 )
19557 }
19558
19559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19563 self.0.request.name = v.into();
19564 self
19565 }
19566
19567 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19569 self.0.request.request_id = v.into();
19570 self
19571 }
19572 }
19573
19574 #[doc(hidden)]
19575 impl crate::RequestBuilder for DeleteAuthzPolicy {
19576 fn request_options(&mut self) -> &mut crate::RequestOptions {
19577 &mut self.0.options
19578 }
19579 }
19580
19581 #[derive(Clone, Debug)]
19602 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
19603
19604 impl ListLocations {
19605 pub(crate) fn new(
19606 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19607 ) -> Self {
19608 Self(RequestBuilder::new(stub))
19609 }
19610
19611 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19613 mut self,
19614 v: V,
19615 ) -> Self {
19616 self.0.request = v.into();
19617 self
19618 }
19619
19620 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19622 self.0.options = v.into();
19623 self
19624 }
19625
19626 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19628 (*self.0.stub)
19629 .list_locations(self.0.request, self.0.options)
19630 .await
19631 .map(crate::Response::into_body)
19632 }
19633
19634 pub fn by_page(
19636 self,
19637 ) -> impl google_cloud_gax::paginator::Paginator<
19638 google_cloud_location::model::ListLocationsResponse,
19639 crate::Error,
19640 > {
19641 use std::clone::Clone;
19642 let token = self.0.request.page_token.clone();
19643 let execute = move |token: String| {
19644 let mut builder = self.clone();
19645 builder.0.request = builder.0.request.set_page_token(token);
19646 builder.send()
19647 };
19648 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19649 }
19650
19651 pub fn by_item(
19653 self,
19654 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19655 google_cloud_location::model::ListLocationsResponse,
19656 crate::Error,
19657 > {
19658 use google_cloud_gax::paginator::Paginator;
19659 self.by_page().items()
19660 }
19661
19662 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19664 self.0.request.name = v.into();
19665 self
19666 }
19667
19668 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19670 self.0.request.filter = v.into();
19671 self
19672 }
19673
19674 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19676 self.0.request.page_size = v.into();
19677 self
19678 }
19679
19680 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19682 self.0.request.page_token = v.into();
19683 self
19684 }
19685 }
19686
19687 #[doc(hidden)]
19688 impl crate::RequestBuilder for ListLocations {
19689 fn request_options(&mut self) -> &mut crate::RequestOptions {
19690 &mut self.0.options
19691 }
19692 }
19693
19694 #[derive(Clone, Debug)]
19711 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19712
19713 impl GetLocation {
19714 pub(crate) fn new(
19715 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19716 ) -> Self {
19717 Self(RequestBuilder::new(stub))
19718 }
19719
19720 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19722 mut self,
19723 v: V,
19724 ) -> Self {
19725 self.0.request = v.into();
19726 self
19727 }
19728
19729 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19731 self.0.options = v.into();
19732 self
19733 }
19734
19735 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19737 (*self.0.stub)
19738 .get_location(self.0.request, self.0.options)
19739 .await
19740 .map(crate::Response::into_body)
19741 }
19742
19743 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19745 self.0.request.name = v.into();
19746 self
19747 }
19748 }
19749
19750 #[doc(hidden)]
19751 impl crate::RequestBuilder for GetLocation {
19752 fn request_options(&mut self) -> &mut crate::RequestOptions {
19753 &mut self.0.options
19754 }
19755 }
19756
19757 #[derive(Clone, Debug)]
19774 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
19775
19776 impl SetIamPolicy {
19777 pub(crate) fn new(
19778 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19779 ) -> Self {
19780 Self(RequestBuilder::new(stub))
19781 }
19782
19783 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
19785 mut self,
19786 v: V,
19787 ) -> Self {
19788 self.0.request = v.into();
19789 self
19790 }
19791
19792 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19794 self.0.options = v.into();
19795 self
19796 }
19797
19798 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19800 (*self.0.stub)
19801 .set_iam_policy(self.0.request, self.0.options)
19802 .await
19803 .map(crate::Response::into_body)
19804 }
19805
19806 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19810 self.0.request.resource = v.into();
19811 self
19812 }
19813
19814 pub fn set_policy<T>(mut self, v: T) -> Self
19818 where
19819 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19820 {
19821 self.0.request.policy = std::option::Option::Some(v.into());
19822 self
19823 }
19824
19825 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
19829 where
19830 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19831 {
19832 self.0.request.policy = v.map(|x| x.into());
19833 self
19834 }
19835
19836 pub fn set_update_mask<T>(mut self, v: T) -> Self
19838 where
19839 T: std::convert::Into<wkt::FieldMask>,
19840 {
19841 self.0.request.update_mask = std::option::Option::Some(v.into());
19842 self
19843 }
19844
19845 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19847 where
19848 T: std::convert::Into<wkt::FieldMask>,
19849 {
19850 self.0.request.update_mask = v.map(|x| x.into());
19851 self
19852 }
19853 }
19854
19855 #[doc(hidden)]
19856 impl crate::RequestBuilder for SetIamPolicy {
19857 fn request_options(&mut self) -> &mut crate::RequestOptions {
19858 &mut self.0.options
19859 }
19860 }
19861
19862 #[derive(Clone, Debug)]
19879 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
19880
19881 impl GetIamPolicy {
19882 pub(crate) fn new(
19883 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19884 ) -> Self {
19885 Self(RequestBuilder::new(stub))
19886 }
19887
19888 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
19890 mut self,
19891 v: V,
19892 ) -> Self {
19893 self.0.request = v.into();
19894 self
19895 }
19896
19897 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19899 self.0.options = v.into();
19900 self
19901 }
19902
19903 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19905 (*self.0.stub)
19906 .get_iam_policy(self.0.request, self.0.options)
19907 .await
19908 .map(crate::Response::into_body)
19909 }
19910
19911 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19915 self.0.request.resource = v.into();
19916 self
19917 }
19918
19919 pub fn set_options<T>(mut self, v: T) -> Self
19921 where
19922 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19923 {
19924 self.0.request.options = std::option::Option::Some(v.into());
19925 self
19926 }
19927
19928 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
19930 where
19931 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19932 {
19933 self.0.request.options = v.map(|x| x.into());
19934 self
19935 }
19936 }
19937
19938 #[doc(hidden)]
19939 impl crate::RequestBuilder for GetIamPolicy {
19940 fn request_options(&mut self) -> &mut crate::RequestOptions {
19941 &mut self.0.options
19942 }
19943 }
19944
19945 #[derive(Clone, Debug)]
19962 pub struct TestIamPermissions(
19963 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
19964 );
19965
19966 impl TestIamPermissions {
19967 pub(crate) fn new(
19968 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19969 ) -> Self {
19970 Self(RequestBuilder::new(stub))
19971 }
19972
19973 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
19975 mut self,
19976 v: V,
19977 ) -> Self {
19978 self.0.request = v.into();
19979 self
19980 }
19981
19982 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19984 self.0.options = v.into();
19985 self
19986 }
19987
19988 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
19990 (*self.0.stub)
19991 .test_iam_permissions(self.0.request, self.0.options)
19992 .await
19993 .map(crate::Response::into_body)
19994 }
19995
19996 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20000 self.0.request.resource = v.into();
20001 self
20002 }
20003
20004 pub fn set_permissions<T, V>(mut self, v: T) -> Self
20008 where
20009 T: std::iter::IntoIterator<Item = V>,
20010 V: std::convert::Into<std::string::String>,
20011 {
20012 use std::iter::Iterator;
20013 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
20014 self
20015 }
20016 }
20017
20018 #[doc(hidden)]
20019 impl crate::RequestBuilder for TestIamPermissions {
20020 fn request_options(&mut self) -> &mut crate::RequestOptions {
20021 &mut self.0.options
20022 }
20023 }
20024
20025 #[derive(Clone, Debug)]
20046 pub struct ListOperations(
20047 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20048 );
20049
20050 impl ListOperations {
20051 pub(crate) fn new(
20052 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20053 ) -> Self {
20054 Self(RequestBuilder::new(stub))
20055 }
20056
20057 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20059 mut self,
20060 v: V,
20061 ) -> Self {
20062 self.0.request = v.into();
20063 self
20064 }
20065
20066 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20068 self.0.options = v.into();
20069 self
20070 }
20071
20072 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20074 (*self.0.stub)
20075 .list_operations(self.0.request, self.0.options)
20076 .await
20077 .map(crate::Response::into_body)
20078 }
20079
20080 pub fn by_page(
20082 self,
20083 ) -> impl google_cloud_gax::paginator::Paginator<
20084 google_cloud_longrunning::model::ListOperationsResponse,
20085 crate::Error,
20086 > {
20087 use std::clone::Clone;
20088 let token = self.0.request.page_token.clone();
20089 let execute = move |token: String| {
20090 let mut builder = self.clone();
20091 builder.0.request = builder.0.request.set_page_token(token);
20092 builder.send()
20093 };
20094 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20095 }
20096
20097 pub fn by_item(
20099 self,
20100 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20101 google_cloud_longrunning::model::ListOperationsResponse,
20102 crate::Error,
20103 > {
20104 use google_cloud_gax::paginator::Paginator;
20105 self.by_page().items()
20106 }
20107
20108 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20110 self.0.request.name = v.into();
20111 self
20112 }
20113
20114 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20116 self.0.request.filter = v.into();
20117 self
20118 }
20119
20120 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20122 self.0.request.page_size = v.into();
20123 self
20124 }
20125
20126 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20128 self.0.request.page_token = v.into();
20129 self
20130 }
20131
20132 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20134 self.0.request.return_partial_success = v.into();
20135 self
20136 }
20137 }
20138
20139 #[doc(hidden)]
20140 impl crate::RequestBuilder for ListOperations {
20141 fn request_options(&mut self) -> &mut crate::RequestOptions {
20142 &mut self.0.options
20143 }
20144 }
20145
20146 #[derive(Clone, Debug)]
20163 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20164
20165 impl GetOperation {
20166 pub(crate) fn new(
20167 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20168 ) -> Self {
20169 Self(RequestBuilder::new(stub))
20170 }
20171
20172 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20174 mut self,
20175 v: V,
20176 ) -> Self {
20177 self.0.request = v.into();
20178 self
20179 }
20180
20181 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20183 self.0.options = v.into();
20184 self
20185 }
20186
20187 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20189 (*self.0.stub)
20190 .get_operation(self.0.request, self.0.options)
20191 .await
20192 .map(crate::Response::into_body)
20193 }
20194
20195 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20197 self.0.request.name = v.into();
20198 self
20199 }
20200 }
20201
20202 #[doc(hidden)]
20203 impl crate::RequestBuilder for GetOperation {
20204 fn request_options(&mut self) -> &mut crate::RequestOptions {
20205 &mut self.0.options
20206 }
20207 }
20208
20209 #[derive(Clone, Debug)]
20226 pub struct DeleteOperation(
20227 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
20228 );
20229
20230 impl DeleteOperation {
20231 pub(crate) fn new(
20232 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20233 ) -> Self {
20234 Self(RequestBuilder::new(stub))
20235 }
20236
20237 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
20239 mut self,
20240 v: V,
20241 ) -> Self {
20242 self.0.request = v.into();
20243 self
20244 }
20245
20246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20248 self.0.options = v.into();
20249 self
20250 }
20251
20252 pub async fn send(self) -> Result<()> {
20254 (*self.0.stub)
20255 .delete_operation(self.0.request, self.0.options)
20256 .await
20257 .map(crate::Response::into_body)
20258 }
20259
20260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20262 self.0.request.name = v.into();
20263 self
20264 }
20265 }
20266
20267 #[doc(hidden)]
20268 impl crate::RequestBuilder for DeleteOperation {
20269 fn request_options(&mut self) -> &mut crate::RequestOptions {
20270 &mut self.0.options
20271 }
20272 }
20273
20274 #[derive(Clone, Debug)]
20291 pub struct CancelOperation(
20292 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20293 );
20294
20295 impl CancelOperation {
20296 pub(crate) fn new(
20297 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20298 ) -> Self {
20299 Self(RequestBuilder::new(stub))
20300 }
20301
20302 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20304 mut self,
20305 v: V,
20306 ) -> Self {
20307 self.0.request = v.into();
20308 self
20309 }
20310
20311 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20313 self.0.options = v.into();
20314 self
20315 }
20316
20317 pub async fn send(self) -> Result<()> {
20319 (*self.0.stub)
20320 .cancel_operation(self.0.request, self.0.options)
20321 .await
20322 .map(crate::Response::into_body)
20323 }
20324
20325 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20327 self.0.request.name = v.into();
20328 self
20329 }
20330 }
20331
20332 #[doc(hidden)]
20333 impl crate::RequestBuilder for CancelOperation {
20334 fn request_options(&mut self) -> &mut crate::RequestOptions {
20335 &mut self.0.options
20336 }
20337 }
20338}
20339
20340pub mod security_profile_group_service {
20342 use crate::Result;
20343
20344 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20358
20359 pub(crate) mod client {
20360 use super::super::super::client::SecurityProfileGroupService;
20361 pub struct Factory;
20362 impl crate::ClientFactory for Factory {
20363 type Client = SecurityProfileGroupService;
20364 type Credentials = gaxi::options::Credentials;
20365 async fn build(
20366 self,
20367 config: gaxi::options::ClientConfig,
20368 ) -> crate::ClientBuilderResult<Self::Client> {
20369 Self::Client::new(config).await
20370 }
20371 }
20372 }
20373
20374 #[derive(Clone, Debug)]
20376 pub(crate) struct RequestBuilder<R: std::default::Default> {
20377 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20378 request: R,
20379 options: crate::RequestOptions,
20380 }
20381
20382 impl<R> RequestBuilder<R>
20383 where
20384 R: std::default::Default,
20385 {
20386 pub(crate) fn new(
20387 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20388 ) -> Self {
20389 Self {
20390 stub,
20391 request: R::default(),
20392 options: crate::RequestOptions::default(),
20393 }
20394 }
20395 }
20396
20397 #[derive(Clone, Debug)]
20418 pub struct ListSecurityProfileGroups(
20419 RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
20420 );
20421
20422 impl ListSecurityProfileGroups {
20423 pub(crate) fn new(
20424 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20425 ) -> Self {
20426 Self(RequestBuilder::new(stub))
20427 }
20428
20429 pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
20431 mut self,
20432 v: V,
20433 ) -> Self {
20434 self.0.request = v.into();
20435 self
20436 }
20437
20438 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20440 self.0.options = v.into();
20441 self
20442 }
20443
20444 pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
20446 (*self.0.stub)
20447 .list_security_profile_groups(self.0.request, self.0.options)
20448 .await
20449 .map(crate::Response::into_body)
20450 }
20451
20452 pub fn by_page(
20454 self,
20455 ) -> impl google_cloud_gax::paginator::Paginator<
20456 crate::model::ListSecurityProfileGroupsResponse,
20457 crate::Error,
20458 > {
20459 use std::clone::Clone;
20460 let token = self.0.request.page_token.clone();
20461 let execute = move |token: String| {
20462 let mut builder = self.clone();
20463 builder.0.request = builder.0.request.set_page_token(token);
20464 builder.send()
20465 };
20466 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20467 }
20468
20469 pub fn by_item(
20471 self,
20472 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20473 crate::model::ListSecurityProfileGroupsResponse,
20474 crate::Error,
20475 > {
20476 use google_cloud_gax::paginator::Paginator;
20477 self.by_page().items()
20478 }
20479
20480 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20484 self.0.request.parent = v.into();
20485 self
20486 }
20487
20488 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20490 self.0.request.page_size = v.into();
20491 self
20492 }
20493
20494 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20496 self.0.request.page_token = v.into();
20497 self
20498 }
20499 }
20500
20501 #[doc(hidden)]
20502 impl crate::RequestBuilder for ListSecurityProfileGroups {
20503 fn request_options(&mut self) -> &mut crate::RequestOptions {
20504 &mut self.0.options
20505 }
20506 }
20507
20508 #[derive(Clone, Debug)]
20525 pub struct GetSecurityProfileGroup(
20526 RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
20527 );
20528
20529 impl GetSecurityProfileGroup {
20530 pub(crate) fn new(
20531 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20532 ) -> Self {
20533 Self(RequestBuilder::new(stub))
20534 }
20535
20536 pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
20538 mut self,
20539 v: V,
20540 ) -> Self {
20541 self.0.request = v.into();
20542 self
20543 }
20544
20545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20547 self.0.options = v.into();
20548 self
20549 }
20550
20551 pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
20553 (*self.0.stub)
20554 .get_security_profile_group(self.0.request, self.0.options)
20555 .await
20556 .map(crate::Response::into_body)
20557 }
20558
20559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20563 self.0.request.name = v.into();
20564 self
20565 }
20566 }
20567
20568 #[doc(hidden)]
20569 impl crate::RequestBuilder for GetSecurityProfileGroup {
20570 fn request_options(&mut self) -> &mut crate::RequestOptions {
20571 &mut self.0.options
20572 }
20573 }
20574
20575 #[derive(Clone, Debug)]
20593 pub struct CreateSecurityProfileGroup(
20594 RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
20595 );
20596
20597 impl CreateSecurityProfileGroup {
20598 pub(crate) fn new(
20599 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20600 ) -> Self {
20601 Self(RequestBuilder::new(stub))
20602 }
20603
20604 pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
20606 mut self,
20607 v: V,
20608 ) -> Self {
20609 self.0.request = v.into();
20610 self
20611 }
20612
20613 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20615 self.0.options = v.into();
20616 self
20617 }
20618
20619 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20626 (*self.0.stub)
20627 .create_security_profile_group(self.0.request, self.0.options)
20628 .await
20629 .map(crate::Response::into_body)
20630 }
20631
20632 pub fn poller(
20634 self,
20635 ) -> impl google_cloud_lro::Poller<
20636 crate::model::SecurityProfileGroup,
20637 crate::model::OperationMetadata,
20638 > {
20639 type Operation = google_cloud_lro::internal::Operation<
20640 crate::model::SecurityProfileGroup,
20641 crate::model::OperationMetadata,
20642 >;
20643 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20644 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20645
20646 let stub = self.0.stub.clone();
20647 let mut options = self.0.options.clone();
20648 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20649 let query = move |name| {
20650 let stub = stub.clone();
20651 let options = options.clone();
20652 async {
20653 let op = GetOperation::new(stub)
20654 .set_name(name)
20655 .with_options(options)
20656 .send()
20657 .await?;
20658 Ok(Operation::new(op))
20659 }
20660 };
20661
20662 let start = move || async {
20663 let op = self.send().await?;
20664 Ok(Operation::new(op))
20665 };
20666
20667 google_cloud_lro::internal::new_poller(
20668 polling_error_policy,
20669 polling_backoff_policy,
20670 start,
20671 query,
20672 )
20673 }
20674
20675 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20679 self.0.request.parent = v.into();
20680 self
20681 }
20682
20683 pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20687 self.0.request.security_profile_group_id = v.into();
20688 self
20689 }
20690
20691 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20695 where
20696 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20697 {
20698 self.0.request.security_profile_group = std::option::Option::Some(v.into());
20699 self
20700 }
20701
20702 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20706 where
20707 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20708 {
20709 self.0.request.security_profile_group = v.map(|x| x.into());
20710 self
20711 }
20712 }
20713
20714 #[doc(hidden)]
20715 impl crate::RequestBuilder for CreateSecurityProfileGroup {
20716 fn request_options(&mut self) -> &mut crate::RequestOptions {
20717 &mut self.0.options
20718 }
20719 }
20720
20721 #[derive(Clone, Debug)]
20739 pub struct UpdateSecurityProfileGroup(
20740 RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
20741 );
20742
20743 impl UpdateSecurityProfileGroup {
20744 pub(crate) fn new(
20745 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20746 ) -> Self {
20747 Self(RequestBuilder::new(stub))
20748 }
20749
20750 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
20752 mut self,
20753 v: V,
20754 ) -> Self {
20755 self.0.request = v.into();
20756 self
20757 }
20758
20759 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20761 self.0.options = v.into();
20762 self
20763 }
20764
20765 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20772 (*self.0.stub)
20773 .update_security_profile_group(self.0.request, self.0.options)
20774 .await
20775 .map(crate::Response::into_body)
20776 }
20777
20778 pub fn poller(
20780 self,
20781 ) -> impl google_cloud_lro::Poller<
20782 crate::model::SecurityProfileGroup,
20783 crate::model::OperationMetadata,
20784 > {
20785 type Operation = google_cloud_lro::internal::Operation<
20786 crate::model::SecurityProfileGroup,
20787 crate::model::OperationMetadata,
20788 >;
20789 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20790 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20791
20792 let stub = self.0.stub.clone();
20793 let mut options = self.0.options.clone();
20794 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20795 let query = move |name| {
20796 let stub = stub.clone();
20797 let options = options.clone();
20798 async {
20799 let op = GetOperation::new(stub)
20800 .set_name(name)
20801 .with_options(options)
20802 .send()
20803 .await?;
20804 Ok(Operation::new(op))
20805 }
20806 };
20807
20808 let start = move || async {
20809 let op = self.send().await?;
20810 Ok(Operation::new(op))
20811 };
20812
20813 google_cloud_lro::internal::new_poller(
20814 polling_error_policy,
20815 polling_backoff_policy,
20816 start,
20817 query,
20818 )
20819 }
20820
20821 pub fn set_update_mask<T>(mut self, v: T) -> Self
20825 where
20826 T: std::convert::Into<wkt::FieldMask>,
20827 {
20828 self.0.request.update_mask = std::option::Option::Some(v.into());
20829 self
20830 }
20831
20832 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20836 where
20837 T: std::convert::Into<wkt::FieldMask>,
20838 {
20839 self.0.request.update_mask = v.map(|x| x.into());
20840 self
20841 }
20842
20843 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20847 where
20848 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20849 {
20850 self.0.request.security_profile_group = std::option::Option::Some(v.into());
20851 self
20852 }
20853
20854 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20858 where
20859 T: std::convert::Into<crate::model::SecurityProfileGroup>,
20860 {
20861 self.0.request.security_profile_group = v.map(|x| x.into());
20862 self
20863 }
20864 }
20865
20866 #[doc(hidden)]
20867 impl crate::RequestBuilder for UpdateSecurityProfileGroup {
20868 fn request_options(&mut self) -> &mut crate::RequestOptions {
20869 &mut self.0.options
20870 }
20871 }
20872
20873 #[derive(Clone, Debug)]
20891 pub struct DeleteSecurityProfileGroup(
20892 RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
20893 );
20894
20895 impl DeleteSecurityProfileGroup {
20896 pub(crate) fn new(
20897 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20898 ) -> Self {
20899 Self(RequestBuilder::new(stub))
20900 }
20901
20902 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
20904 mut self,
20905 v: V,
20906 ) -> Self {
20907 self.0.request = v.into();
20908 self
20909 }
20910
20911 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20913 self.0.options = v.into();
20914 self
20915 }
20916
20917 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20924 (*self.0.stub)
20925 .delete_security_profile_group(self.0.request, self.0.options)
20926 .await
20927 .map(crate::Response::into_body)
20928 }
20929
20930 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20932 type Operation =
20933 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20934 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20935 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20936
20937 let stub = self.0.stub.clone();
20938 let mut options = self.0.options.clone();
20939 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20940 let query = move |name| {
20941 let stub = stub.clone();
20942 let options = options.clone();
20943 async {
20944 let op = GetOperation::new(stub)
20945 .set_name(name)
20946 .with_options(options)
20947 .send()
20948 .await?;
20949 Ok(Operation::new(op))
20950 }
20951 };
20952
20953 let start = move || async {
20954 let op = self.send().await?;
20955 Ok(Operation::new(op))
20956 };
20957
20958 google_cloud_lro::internal::new_unit_response_poller(
20959 polling_error_policy,
20960 polling_backoff_policy,
20961 start,
20962 query,
20963 )
20964 }
20965
20966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20970 self.0.request.name = v.into();
20971 self
20972 }
20973
20974 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20976 self.0.request.etag = v.into();
20977 self
20978 }
20979 }
20980
20981 #[doc(hidden)]
20982 impl crate::RequestBuilder for DeleteSecurityProfileGroup {
20983 fn request_options(&mut self) -> &mut crate::RequestOptions {
20984 &mut self.0.options
20985 }
20986 }
20987
20988 #[derive(Clone, Debug)]
21009 pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
21010
21011 impl ListSecurityProfiles {
21012 pub(crate) fn new(
21013 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21014 ) -> Self {
21015 Self(RequestBuilder::new(stub))
21016 }
21017
21018 pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
21020 mut self,
21021 v: V,
21022 ) -> Self {
21023 self.0.request = v.into();
21024 self
21025 }
21026
21027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21029 self.0.options = v.into();
21030 self
21031 }
21032
21033 pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
21035 (*self.0.stub)
21036 .list_security_profiles(self.0.request, self.0.options)
21037 .await
21038 .map(crate::Response::into_body)
21039 }
21040
21041 pub fn by_page(
21043 self,
21044 ) -> impl google_cloud_gax::paginator::Paginator<
21045 crate::model::ListSecurityProfilesResponse,
21046 crate::Error,
21047 > {
21048 use std::clone::Clone;
21049 let token = self.0.request.page_token.clone();
21050 let execute = move |token: String| {
21051 let mut builder = self.clone();
21052 builder.0.request = builder.0.request.set_page_token(token);
21053 builder.send()
21054 };
21055 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21056 }
21057
21058 pub fn by_item(
21060 self,
21061 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21062 crate::model::ListSecurityProfilesResponse,
21063 crate::Error,
21064 > {
21065 use google_cloud_gax::paginator::Paginator;
21066 self.by_page().items()
21067 }
21068
21069 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21073 self.0.request.parent = v.into();
21074 self
21075 }
21076
21077 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21079 self.0.request.page_size = v.into();
21080 self
21081 }
21082
21083 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21085 self.0.request.page_token = v.into();
21086 self
21087 }
21088 }
21089
21090 #[doc(hidden)]
21091 impl crate::RequestBuilder for ListSecurityProfiles {
21092 fn request_options(&mut self) -> &mut crate::RequestOptions {
21093 &mut self.0.options
21094 }
21095 }
21096
21097 #[derive(Clone, Debug)]
21114 pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
21115
21116 impl GetSecurityProfile {
21117 pub(crate) fn new(
21118 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21119 ) -> Self {
21120 Self(RequestBuilder::new(stub))
21121 }
21122
21123 pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
21125 mut self,
21126 v: V,
21127 ) -> Self {
21128 self.0.request = v.into();
21129 self
21130 }
21131
21132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21134 self.0.options = v.into();
21135 self
21136 }
21137
21138 pub async fn send(self) -> Result<crate::model::SecurityProfile> {
21140 (*self.0.stub)
21141 .get_security_profile(self.0.request, self.0.options)
21142 .await
21143 .map(crate::Response::into_body)
21144 }
21145
21146 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21150 self.0.request.name = v.into();
21151 self
21152 }
21153 }
21154
21155 #[doc(hidden)]
21156 impl crate::RequestBuilder for GetSecurityProfile {
21157 fn request_options(&mut self) -> &mut crate::RequestOptions {
21158 &mut self.0.options
21159 }
21160 }
21161
21162 #[derive(Clone, Debug)]
21180 pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
21181
21182 impl CreateSecurityProfile {
21183 pub(crate) fn new(
21184 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21185 ) -> Self {
21186 Self(RequestBuilder::new(stub))
21187 }
21188
21189 pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
21191 mut self,
21192 v: V,
21193 ) -> Self {
21194 self.0.request = v.into();
21195 self
21196 }
21197
21198 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21200 self.0.options = v.into();
21201 self
21202 }
21203
21204 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21211 (*self.0.stub)
21212 .create_security_profile(self.0.request, self.0.options)
21213 .await
21214 .map(crate::Response::into_body)
21215 }
21216
21217 pub fn poller(
21219 self,
21220 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
21221 {
21222 type Operation = google_cloud_lro::internal::Operation<
21223 crate::model::SecurityProfile,
21224 crate::model::OperationMetadata,
21225 >;
21226 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21227 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21228
21229 let stub = self.0.stub.clone();
21230 let mut options = self.0.options.clone();
21231 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21232 let query = move |name| {
21233 let stub = stub.clone();
21234 let options = options.clone();
21235 async {
21236 let op = GetOperation::new(stub)
21237 .set_name(name)
21238 .with_options(options)
21239 .send()
21240 .await?;
21241 Ok(Operation::new(op))
21242 }
21243 };
21244
21245 let start = move || async {
21246 let op = self.send().await?;
21247 Ok(Operation::new(op))
21248 };
21249
21250 google_cloud_lro::internal::new_poller(
21251 polling_error_policy,
21252 polling_backoff_policy,
21253 start,
21254 query,
21255 )
21256 }
21257
21258 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21262 self.0.request.parent = v.into();
21263 self
21264 }
21265
21266 pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21270 self.0.request.security_profile_id = v.into();
21271 self
21272 }
21273
21274 pub fn set_security_profile<T>(mut self, v: T) -> Self
21278 where
21279 T: std::convert::Into<crate::model::SecurityProfile>,
21280 {
21281 self.0.request.security_profile = std::option::Option::Some(v.into());
21282 self
21283 }
21284
21285 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
21289 where
21290 T: std::convert::Into<crate::model::SecurityProfile>,
21291 {
21292 self.0.request.security_profile = v.map(|x| x.into());
21293 self
21294 }
21295 }
21296
21297 #[doc(hidden)]
21298 impl crate::RequestBuilder for CreateSecurityProfile {
21299 fn request_options(&mut self) -> &mut crate::RequestOptions {
21300 &mut self.0.options
21301 }
21302 }
21303
21304 #[derive(Clone, Debug)]
21322 pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
21323
21324 impl UpdateSecurityProfile {
21325 pub(crate) fn new(
21326 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21327 ) -> Self {
21328 Self(RequestBuilder::new(stub))
21329 }
21330
21331 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
21333 mut self,
21334 v: V,
21335 ) -> Self {
21336 self.0.request = v.into();
21337 self
21338 }
21339
21340 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21342 self.0.options = v.into();
21343 self
21344 }
21345
21346 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21353 (*self.0.stub)
21354 .update_security_profile(self.0.request, self.0.options)
21355 .await
21356 .map(crate::Response::into_body)
21357 }
21358
21359 pub fn poller(
21361 self,
21362 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
21363 {
21364 type Operation = google_cloud_lro::internal::Operation<
21365 crate::model::SecurityProfile,
21366 crate::model::OperationMetadata,
21367 >;
21368 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21369 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21370
21371 let stub = self.0.stub.clone();
21372 let mut options = self.0.options.clone();
21373 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21374 let query = move |name| {
21375 let stub = stub.clone();
21376 let options = options.clone();
21377 async {
21378 let op = GetOperation::new(stub)
21379 .set_name(name)
21380 .with_options(options)
21381 .send()
21382 .await?;
21383 Ok(Operation::new(op))
21384 }
21385 };
21386
21387 let start = move || async {
21388 let op = self.send().await?;
21389 Ok(Operation::new(op))
21390 };
21391
21392 google_cloud_lro::internal::new_poller(
21393 polling_error_policy,
21394 polling_backoff_policy,
21395 start,
21396 query,
21397 )
21398 }
21399
21400 pub fn set_update_mask<T>(mut self, v: T) -> Self
21404 where
21405 T: std::convert::Into<wkt::FieldMask>,
21406 {
21407 self.0.request.update_mask = std::option::Option::Some(v.into());
21408 self
21409 }
21410
21411 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21415 where
21416 T: std::convert::Into<wkt::FieldMask>,
21417 {
21418 self.0.request.update_mask = v.map(|x| x.into());
21419 self
21420 }
21421
21422 pub fn set_security_profile<T>(mut self, v: T) -> Self
21426 where
21427 T: std::convert::Into<crate::model::SecurityProfile>,
21428 {
21429 self.0.request.security_profile = std::option::Option::Some(v.into());
21430 self
21431 }
21432
21433 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
21437 where
21438 T: std::convert::Into<crate::model::SecurityProfile>,
21439 {
21440 self.0.request.security_profile = v.map(|x| x.into());
21441 self
21442 }
21443 }
21444
21445 #[doc(hidden)]
21446 impl crate::RequestBuilder for UpdateSecurityProfile {
21447 fn request_options(&mut self) -> &mut crate::RequestOptions {
21448 &mut self.0.options
21449 }
21450 }
21451
21452 #[derive(Clone, Debug)]
21470 pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
21471
21472 impl DeleteSecurityProfile {
21473 pub(crate) fn new(
21474 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21475 ) -> Self {
21476 Self(RequestBuilder::new(stub))
21477 }
21478
21479 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
21481 mut self,
21482 v: V,
21483 ) -> Self {
21484 self.0.request = v.into();
21485 self
21486 }
21487
21488 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21490 self.0.options = v.into();
21491 self
21492 }
21493
21494 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21501 (*self.0.stub)
21502 .delete_security_profile(self.0.request, self.0.options)
21503 .await
21504 .map(crate::Response::into_body)
21505 }
21506
21507 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
21509 type Operation =
21510 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
21511 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21512 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21513
21514 let stub = self.0.stub.clone();
21515 let mut options = self.0.options.clone();
21516 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21517 let query = move |name| {
21518 let stub = stub.clone();
21519 let options = options.clone();
21520 async {
21521 let op = GetOperation::new(stub)
21522 .set_name(name)
21523 .with_options(options)
21524 .send()
21525 .await?;
21526 Ok(Operation::new(op))
21527 }
21528 };
21529
21530 let start = move || async {
21531 let op = self.send().await?;
21532 Ok(Operation::new(op))
21533 };
21534
21535 google_cloud_lro::internal::new_unit_response_poller(
21536 polling_error_policy,
21537 polling_backoff_policy,
21538 start,
21539 query,
21540 )
21541 }
21542
21543 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21547 self.0.request.name = v.into();
21548 self
21549 }
21550
21551 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
21553 self.0.request.etag = v.into();
21554 self
21555 }
21556 }
21557
21558 #[doc(hidden)]
21559 impl crate::RequestBuilder for DeleteSecurityProfile {
21560 fn request_options(&mut self) -> &mut crate::RequestOptions {
21561 &mut self.0.options
21562 }
21563 }
21564
21565 #[derive(Clone, Debug)]
21586 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21587
21588 impl ListLocations {
21589 pub(crate) fn new(
21590 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21591 ) -> Self {
21592 Self(RequestBuilder::new(stub))
21593 }
21594
21595 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21597 mut self,
21598 v: V,
21599 ) -> Self {
21600 self.0.request = v.into();
21601 self
21602 }
21603
21604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21606 self.0.options = v.into();
21607 self
21608 }
21609
21610 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21612 (*self.0.stub)
21613 .list_locations(self.0.request, self.0.options)
21614 .await
21615 .map(crate::Response::into_body)
21616 }
21617
21618 pub fn by_page(
21620 self,
21621 ) -> impl google_cloud_gax::paginator::Paginator<
21622 google_cloud_location::model::ListLocationsResponse,
21623 crate::Error,
21624 > {
21625 use std::clone::Clone;
21626 let token = self.0.request.page_token.clone();
21627 let execute = move |token: String| {
21628 let mut builder = self.clone();
21629 builder.0.request = builder.0.request.set_page_token(token);
21630 builder.send()
21631 };
21632 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21633 }
21634
21635 pub fn by_item(
21637 self,
21638 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21639 google_cloud_location::model::ListLocationsResponse,
21640 crate::Error,
21641 > {
21642 use google_cloud_gax::paginator::Paginator;
21643 self.by_page().items()
21644 }
21645
21646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21648 self.0.request.name = v.into();
21649 self
21650 }
21651
21652 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21654 self.0.request.filter = v.into();
21655 self
21656 }
21657
21658 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21660 self.0.request.page_size = v.into();
21661 self
21662 }
21663
21664 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21666 self.0.request.page_token = v.into();
21667 self
21668 }
21669 }
21670
21671 #[doc(hidden)]
21672 impl crate::RequestBuilder for ListLocations {
21673 fn request_options(&mut self) -> &mut crate::RequestOptions {
21674 &mut self.0.options
21675 }
21676 }
21677
21678 #[derive(Clone, Debug)]
21695 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21696
21697 impl GetLocation {
21698 pub(crate) fn new(
21699 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21700 ) -> Self {
21701 Self(RequestBuilder::new(stub))
21702 }
21703
21704 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21706 mut self,
21707 v: V,
21708 ) -> Self {
21709 self.0.request = v.into();
21710 self
21711 }
21712
21713 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21715 self.0.options = v.into();
21716 self
21717 }
21718
21719 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21721 (*self.0.stub)
21722 .get_location(self.0.request, self.0.options)
21723 .await
21724 .map(crate::Response::into_body)
21725 }
21726
21727 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21729 self.0.request.name = v.into();
21730 self
21731 }
21732 }
21733
21734 #[doc(hidden)]
21735 impl crate::RequestBuilder for GetLocation {
21736 fn request_options(&mut self) -> &mut crate::RequestOptions {
21737 &mut self.0.options
21738 }
21739 }
21740
21741 #[derive(Clone, Debug)]
21758 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
21759
21760 impl SetIamPolicy {
21761 pub(crate) fn new(
21762 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21763 ) -> Self {
21764 Self(RequestBuilder::new(stub))
21765 }
21766
21767 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
21769 mut self,
21770 v: V,
21771 ) -> Self {
21772 self.0.request = v.into();
21773 self
21774 }
21775
21776 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21778 self.0.options = v.into();
21779 self
21780 }
21781
21782 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21784 (*self.0.stub)
21785 .set_iam_policy(self.0.request, self.0.options)
21786 .await
21787 .map(crate::Response::into_body)
21788 }
21789
21790 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21794 self.0.request.resource = v.into();
21795 self
21796 }
21797
21798 pub fn set_policy<T>(mut self, v: T) -> Self
21802 where
21803 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21804 {
21805 self.0.request.policy = std::option::Option::Some(v.into());
21806 self
21807 }
21808
21809 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
21813 where
21814 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21815 {
21816 self.0.request.policy = v.map(|x| x.into());
21817 self
21818 }
21819
21820 pub fn set_update_mask<T>(mut self, v: T) -> Self
21822 where
21823 T: std::convert::Into<wkt::FieldMask>,
21824 {
21825 self.0.request.update_mask = std::option::Option::Some(v.into());
21826 self
21827 }
21828
21829 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21831 where
21832 T: std::convert::Into<wkt::FieldMask>,
21833 {
21834 self.0.request.update_mask = v.map(|x| x.into());
21835 self
21836 }
21837 }
21838
21839 #[doc(hidden)]
21840 impl crate::RequestBuilder for SetIamPolicy {
21841 fn request_options(&mut self) -> &mut crate::RequestOptions {
21842 &mut self.0.options
21843 }
21844 }
21845
21846 #[derive(Clone, Debug)]
21863 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
21864
21865 impl GetIamPolicy {
21866 pub(crate) fn new(
21867 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21868 ) -> Self {
21869 Self(RequestBuilder::new(stub))
21870 }
21871
21872 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
21874 mut self,
21875 v: V,
21876 ) -> Self {
21877 self.0.request = v.into();
21878 self
21879 }
21880
21881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21883 self.0.options = v.into();
21884 self
21885 }
21886
21887 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21889 (*self.0.stub)
21890 .get_iam_policy(self.0.request, self.0.options)
21891 .await
21892 .map(crate::Response::into_body)
21893 }
21894
21895 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21899 self.0.request.resource = v.into();
21900 self
21901 }
21902
21903 pub fn set_options<T>(mut self, v: T) -> Self
21905 where
21906 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21907 {
21908 self.0.request.options = std::option::Option::Some(v.into());
21909 self
21910 }
21911
21912 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
21914 where
21915 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21916 {
21917 self.0.request.options = v.map(|x| x.into());
21918 self
21919 }
21920 }
21921
21922 #[doc(hidden)]
21923 impl crate::RequestBuilder for GetIamPolicy {
21924 fn request_options(&mut self) -> &mut crate::RequestOptions {
21925 &mut self.0.options
21926 }
21927 }
21928
21929 #[derive(Clone, Debug)]
21946 pub struct TestIamPermissions(
21947 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
21948 );
21949
21950 impl TestIamPermissions {
21951 pub(crate) fn new(
21952 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21953 ) -> Self {
21954 Self(RequestBuilder::new(stub))
21955 }
21956
21957 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
21959 mut self,
21960 v: V,
21961 ) -> Self {
21962 self.0.request = v.into();
21963 self
21964 }
21965
21966 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21968 self.0.options = v.into();
21969 self
21970 }
21971
21972 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
21974 (*self.0.stub)
21975 .test_iam_permissions(self.0.request, self.0.options)
21976 .await
21977 .map(crate::Response::into_body)
21978 }
21979
21980 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21984 self.0.request.resource = v.into();
21985 self
21986 }
21987
21988 pub fn set_permissions<T, V>(mut self, v: T) -> Self
21992 where
21993 T: std::iter::IntoIterator<Item = V>,
21994 V: std::convert::Into<std::string::String>,
21995 {
21996 use std::iter::Iterator;
21997 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
21998 self
21999 }
22000 }
22001
22002 #[doc(hidden)]
22003 impl crate::RequestBuilder for TestIamPermissions {
22004 fn request_options(&mut self) -> &mut crate::RequestOptions {
22005 &mut self.0.options
22006 }
22007 }
22008
22009 #[derive(Clone, Debug)]
22030 pub struct ListOperations(
22031 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
22032 );
22033
22034 impl ListOperations {
22035 pub(crate) fn new(
22036 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22037 ) -> Self {
22038 Self(RequestBuilder::new(stub))
22039 }
22040
22041 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
22043 mut self,
22044 v: V,
22045 ) -> Self {
22046 self.0.request = v.into();
22047 self
22048 }
22049
22050 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22052 self.0.options = v.into();
22053 self
22054 }
22055
22056 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
22058 (*self.0.stub)
22059 .list_operations(self.0.request, self.0.options)
22060 .await
22061 .map(crate::Response::into_body)
22062 }
22063
22064 pub fn by_page(
22066 self,
22067 ) -> impl google_cloud_gax::paginator::Paginator<
22068 google_cloud_longrunning::model::ListOperationsResponse,
22069 crate::Error,
22070 > {
22071 use std::clone::Clone;
22072 let token = self.0.request.page_token.clone();
22073 let execute = move |token: String| {
22074 let mut builder = self.clone();
22075 builder.0.request = builder.0.request.set_page_token(token);
22076 builder.send()
22077 };
22078 google_cloud_gax::paginator::internal::new_paginator(token, execute)
22079 }
22080
22081 pub fn by_item(
22083 self,
22084 ) -> impl google_cloud_gax::paginator::ItemPaginator<
22085 google_cloud_longrunning::model::ListOperationsResponse,
22086 crate::Error,
22087 > {
22088 use google_cloud_gax::paginator::Paginator;
22089 self.by_page().items()
22090 }
22091
22092 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22094 self.0.request.name = v.into();
22095 self
22096 }
22097
22098 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22100 self.0.request.filter = v.into();
22101 self
22102 }
22103
22104 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22106 self.0.request.page_size = v.into();
22107 self
22108 }
22109
22110 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22112 self.0.request.page_token = v.into();
22113 self
22114 }
22115
22116 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22118 self.0.request.return_partial_success = v.into();
22119 self
22120 }
22121 }
22122
22123 #[doc(hidden)]
22124 impl crate::RequestBuilder for ListOperations {
22125 fn request_options(&mut self) -> &mut crate::RequestOptions {
22126 &mut self.0.options
22127 }
22128 }
22129
22130 #[derive(Clone, Debug)]
22147 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22148
22149 impl GetOperation {
22150 pub(crate) fn new(
22151 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22152 ) -> Self {
22153 Self(RequestBuilder::new(stub))
22154 }
22155
22156 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22158 mut self,
22159 v: V,
22160 ) -> Self {
22161 self.0.request = v.into();
22162 self
22163 }
22164
22165 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22167 self.0.options = v.into();
22168 self
22169 }
22170
22171 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22173 (*self.0.stub)
22174 .get_operation(self.0.request, self.0.options)
22175 .await
22176 .map(crate::Response::into_body)
22177 }
22178
22179 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22181 self.0.request.name = v.into();
22182 self
22183 }
22184 }
22185
22186 #[doc(hidden)]
22187 impl crate::RequestBuilder for GetOperation {
22188 fn request_options(&mut self) -> &mut crate::RequestOptions {
22189 &mut self.0.options
22190 }
22191 }
22192
22193 #[derive(Clone, Debug)]
22210 pub struct DeleteOperation(
22211 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
22212 );
22213
22214 impl DeleteOperation {
22215 pub(crate) fn new(
22216 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22217 ) -> Self {
22218 Self(RequestBuilder::new(stub))
22219 }
22220
22221 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
22223 mut self,
22224 v: V,
22225 ) -> Self {
22226 self.0.request = v.into();
22227 self
22228 }
22229
22230 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22232 self.0.options = v.into();
22233 self
22234 }
22235
22236 pub async fn send(self) -> Result<()> {
22238 (*self.0.stub)
22239 .delete_operation(self.0.request, self.0.options)
22240 .await
22241 .map(crate::Response::into_body)
22242 }
22243
22244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22246 self.0.request.name = v.into();
22247 self
22248 }
22249 }
22250
22251 #[doc(hidden)]
22252 impl crate::RequestBuilder for DeleteOperation {
22253 fn request_options(&mut self) -> &mut crate::RequestOptions {
22254 &mut self.0.options
22255 }
22256 }
22257
22258 #[derive(Clone, Debug)]
22275 pub struct CancelOperation(
22276 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22277 );
22278
22279 impl CancelOperation {
22280 pub(crate) fn new(
22281 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22282 ) -> Self {
22283 Self(RequestBuilder::new(stub))
22284 }
22285
22286 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22288 mut self,
22289 v: V,
22290 ) -> Self {
22291 self.0.request = v.into();
22292 self
22293 }
22294
22295 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22297 self.0.options = v.into();
22298 self
22299 }
22300
22301 pub async fn send(self) -> Result<()> {
22303 (*self.0.stub)
22304 .cancel_operation(self.0.request, self.0.options)
22305 .await
22306 .map(crate::Response::into_body)
22307 }
22308
22309 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22311 self.0.request.name = v.into();
22312 self
22313 }
22314 }
22315
22316 #[doc(hidden)]
22317 impl crate::RequestBuilder for CancelOperation {
22318 fn request_options(&mut self) -> &mut crate::RequestOptions {
22319 &mut self.0.options
22320 }
22321 }
22322}
22323
22324pub mod organization_security_profile_group_service {
22326 use crate::Result;
22327
22328 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22342
22343 pub(crate) mod client {
22344 use super::super::super::client::OrganizationSecurityProfileGroupService;
22345 pub struct Factory;
22346 impl crate::ClientFactory for Factory {
22347 type Client = OrganizationSecurityProfileGroupService;
22348 type Credentials = gaxi::options::Credentials;
22349 async fn build(
22350 self,
22351 config: gaxi::options::ClientConfig,
22352 ) -> crate::ClientBuilderResult<Self::Client> {
22353 Self::Client::new(config).await
22354 }
22355 }
22356 }
22357
22358 #[derive(Clone, Debug)]
22360 pub(crate) struct RequestBuilder<R: std::default::Default> {
22361 stub: std::sync::Arc<
22362 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22363 >,
22364 request: R,
22365 options: crate::RequestOptions,
22366 }
22367
22368 impl<R> RequestBuilder<R>
22369 where
22370 R: std::default::Default,
22371 {
22372 pub(crate) fn new(
22373 stub: std::sync::Arc<
22374 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22375 >,
22376 ) -> Self {
22377 Self {
22378 stub,
22379 request: R::default(),
22380 options: crate::RequestOptions::default(),
22381 }
22382 }
22383 }
22384
22385 #[derive(Clone, Debug)]
22406 pub struct ListSecurityProfileGroups(
22407 RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
22408 );
22409
22410 impl ListSecurityProfileGroups {
22411 pub(crate) fn new(
22412 stub: std::sync::Arc<
22413 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22414 >,
22415 ) -> Self {
22416 Self(RequestBuilder::new(stub))
22417 }
22418
22419 pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
22421 mut self,
22422 v: V,
22423 ) -> Self {
22424 self.0.request = v.into();
22425 self
22426 }
22427
22428 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22430 self.0.options = v.into();
22431 self
22432 }
22433
22434 pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
22436 (*self.0.stub)
22437 .list_security_profile_groups(self.0.request, self.0.options)
22438 .await
22439 .map(crate::Response::into_body)
22440 }
22441
22442 pub fn by_page(
22444 self,
22445 ) -> impl google_cloud_gax::paginator::Paginator<
22446 crate::model::ListSecurityProfileGroupsResponse,
22447 crate::Error,
22448 > {
22449 use std::clone::Clone;
22450 let token = self.0.request.page_token.clone();
22451 let execute = move |token: String| {
22452 let mut builder = self.clone();
22453 builder.0.request = builder.0.request.set_page_token(token);
22454 builder.send()
22455 };
22456 google_cloud_gax::paginator::internal::new_paginator(token, execute)
22457 }
22458
22459 pub fn by_item(
22461 self,
22462 ) -> impl google_cloud_gax::paginator::ItemPaginator<
22463 crate::model::ListSecurityProfileGroupsResponse,
22464 crate::Error,
22465 > {
22466 use google_cloud_gax::paginator::Paginator;
22467 self.by_page().items()
22468 }
22469
22470 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22474 self.0.request.parent = v.into();
22475 self
22476 }
22477
22478 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22480 self.0.request.page_size = v.into();
22481 self
22482 }
22483
22484 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22486 self.0.request.page_token = v.into();
22487 self
22488 }
22489 }
22490
22491 #[doc(hidden)]
22492 impl crate::RequestBuilder for ListSecurityProfileGroups {
22493 fn request_options(&mut self) -> &mut crate::RequestOptions {
22494 &mut self.0.options
22495 }
22496 }
22497
22498 #[derive(Clone, Debug)]
22515 pub struct GetSecurityProfileGroup(
22516 RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
22517 );
22518
22519 impl GetSecurityProfileGroup {
22520 pub(crate) fn new(
22521 stub: std::sync::Arc<
22522 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22523 >,
22524 ) -> Self {
22525 Self(RequestBuilder::new(stub))
22526 }
22527
22528 pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
22530 mut self,
22531 v: V,
22532 ) -> Self {
22533 self.0.request = v.into();
22534 self
22535 }
22536
22537 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22539 self.0.options = v.into();
22540 self
22541 }
22542
22543 pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
22545 (*self.0.stub)
22546 .get_security_profile_group(self.0.request, self.0.options)
22547 .await
22548 .map(crate::Response::into_body)
22549 }
22550
22551 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22555 self.0.request.name = v.into();
22556 self
22557 }
22558 }
22559
22560 #[doc(hidden)]
22561 impl crate::RequestBuilder for GetSecurityProfileGroup {
22562 fn request_options(&mut self) -> &mut crate::RequestOptions {
22563 &mut self.0.options
22564 }
22565 }
22566
22567 #[derive(Clone, Debug)]
22585 pub struct CreateSecurityProfileGroup(
22586 RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
22587 );
22588
22589 impl CreateSecurityProfileGroup {
22590 pub(crate) fn new(
22591 stub: std::sync::Arc<
22592 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22593 >,
22594 ) -> Self {
22595 Self(RequestBuilder::new(stub))
22596 }
22597
22598 pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
22600 mut self,
22601 v: V,
22602 ) -> Self {
22603 self.0.request = v.into();
22604 self
22605 }
22606
22607 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22609 self.0.options = v.into();
22610 self
22611 }
22612
22613 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22620 (*self.0.stub)
22621 .create_security_profile_group(self.0.request, self.0.options)
22622 .await
22623 .map(crate::Response::into_body)
22624 }
22625
22626 pub fn poller(
22628 self,
22629 ) -> impl google_cloud_lro::Poller<
22630 crate::model::SecurityProfileGroup,
22631 crate::model::OperationMetadata,
22632 > {
22633 type Operation = google_cloud_lro::internal::Operation<
22634 crate::model::SecurityProfileGroup,
22635 crate::model::OperationMetadata,
22636 >;
22637 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
22638 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
22639
22640 let stub = self.0.stub.clone();
22641 let mut options = self.0.options.clone();
22642 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
22643 let query = move |name| {
22644 let stub = stub.clone();
22645 let options = options.clone();
22646 async {
22647 let op = GetOperation::new(stub)
22648 .set_name(name)
22649 .with_options(options)
22650 .send()
22651 .await?;
22652 Ok(Operation::new(op))
22653 }
22654 };
22655
22656 let start = move || async {
22657 let op = self.send().await?;
22658 Ok(Operation::new(op))
22659 };
22660
22661 google_cloud_lro::internal::new_poller(
22662 polling_error_policy,
22663 polling_backoff_policy,
22664 start,
22665 query,
22666 )
22667 }
22668
22669 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22673 self.0.request.parent = v.into();
22674 self
22675 }
22676
22677 pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
22681 self.0.request.security_profile_group_id = v.into();
22682 self
22683 }
22684
22685 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
22689 where
22690 T: std::convert::Into<crate::model::SecurityProfileGroup>,
22691 {
22692 self.0.request.security_profile_group = std::option::Option::Some(v.into());
22693 self
22694 }
22695
22696 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
22700 where
22701 T: std::convert::Into<crate::model::SecurityProfileGroup>,
22702 {
22703 self.0.request.security_profile_group = v.map(|x| x.into());
22704 self
22705 }
22706 }
22707
22708 #[doc(hidden)]
22709 impl crate::RequestBuilder for CreateSecurityProfileGroup {
22710 fn request_options(&mut self) -> &mut crate::RequestOptions {
22711 &mut self.0.options
22712 }
22713 }
22714
22715 #[derive(Clone, Debug)]
22733 pub struct UpdateSecurityProfileGroup(
22734 RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
22735 );
22736
22737 impl UpdateSecurityProfileGroup {
22738 pub(crate) fn new(
22739 stub: std::sync::Arc<
22740 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22741 >,
22742 ) -> Self {
22743 Self(RequestBuilder::new(stub))
22744 }
22745
22746 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
22748 mut self,
22749 v: V,
22750 ) -> Self {
22751 self.0.request = v.into();
22752 self
22753 }
22754
22755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22757 self.0.options = v.into();
22758 self
22759 }
22760
22761 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22768 (*self.0.stub)
22769 .update_security_profile_group(self.0.request, self.0.options)
22770 .await
22771 .map(crate::Response::into_body)
22772 }
22773
22774 pub fn poller(
22776 self,
22777 ) -> impl google_cloud_lro::Poller<
22778 crate::model::SecurityProfileGroup,
22779 crate::model::OperationMetadata,
22780 > {
22781 type Operation = google_cloud_lro::internal::Operation<
22782 crate::model::SecurityProfileGroup,
22783 crate::model::OperationMetadata,
22784 >;
22785 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
22786 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
22787
22788 let stub = self.0.stub.clone();
22789 let mut options = self.0.options.clone();
22790 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
22791 let query = move |name| {
22792 let stub = stub.clone();
22793 let options = options.clone();
22794 async {
22795 let op = GetOperation::new(stub)
22796 .set_name(name)
22797 .with_options(options)
22798 .send()
22799 .await?;
22800 Ok(Operation::new(op))
22801 }
22802 };
22803
22804 let start = move || async {
22805 let op = self.send().await?;
22806 Ok(Operation::new(op))
22807 };
22808
22809 google_cloud_lro::internal::new_poller(
22810 polling_error_policy,
22811 polling_backoff_policy,
22812 start,
22813 query,
22814 )
22815 }
22816
22817 pub fn set_update_mask<T>(mut self, v: T) -> Self
22821 where
22822 T: std::convert::Into<wkt::FieldMask>,
22823 {
22824 self.0.request.update_mask = std::option::Option::Some(v.into());
22825 self
22826 }
22827
22828 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22832 where
22833 T: std::convert::Into<wkt::FieldMask>,
22834 {
22835 self.0.request.update_mask = v.map(|x| x.into());
22836 self
22837 }
22838
22839 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
22843 where
22844 T: std::convert::Into<crate::model::SecurityProfileGroup>,
22845 {
22846 self.0.request.security_profile_group = std::option::Option::Some(v.into());
22847 self
22848 }
22849
22850 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
22854 where
22855 T: std::convert::Into<crate::model::SecurityProfileGroup>,
22856 {
22857 self.0.request.security_profile_group = v.map(|x| x.into());
22858 self
22859 }
22860 }
22861
22862 #[doc(hidden)]
22863 impl crate::RequestBuilder for UpdateSecurityProfileGroup {
22864 fn request_options(&mut self) -> &mut crate::RequestOptions {
22865 &mut self.0.options
22866 }
22867 }
22868
22869 #[derive(Clone, Debug)]
22887 pub struct DeleteSecurityProfileGroup(
22888 RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
22889 );
22890
22891 impl DeleteSecurityProfileGroup {
22892 pub(crate) fn new(
22893 stub: std::sync::Arc<
22894 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22895 >,
22896 ) -> Self {
22897 Self(RequestBuilder::new(stub))
22898 }
22899
22900 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
22902 mut self,
22903 v: V,
22904 ) -> Self {
22905 self.0.request = v.into();
22906 self
22907 }
22908
22909 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22911 self.0.options = v.into();
22912 self
22913 }
22914
22915 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22922 (*self.0.stub)
22923 .delete_security_profile_group(self.0.request, self.0.options)
22924 .await
22925 .map(crate::Response::into_body)
22926 }
22927
22928 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
22930 type Operation =
22931 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
22932 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
22933 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
22934
22935 let stub = self.0.stub.clone();
22936 let mut options = self.0.options.clone();
22937 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
22938 let query = move |name| {
22939 let stub = stub.clone();
22940 let options = options.clone();
22941 async {
22942 let op = GetOperation::new(stub)
22943 .set_name(name)
22944 .with_options(options)
22945 .send()
22946 .await?;
22947 Ok(Operation::new(op))
22948 }
22949 };
22950
22951 let start = move || async {
22952 let op = self.send().await?;
22953 Ok(Operation::new(op))
22954 };
22955
22956 google_cloud_lro::internal::new_unit_response_poller(
22957 polling_error_policy,
22958 polling_backoff_policy,
22959 start,
22960 query,
22961 )
22962 }
22963
22964 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22968 self.0.request.name = v.into();
22969 self
22970 }
22971
22972 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
22974 self.0.request.etag = v.into();
22975 self
22976 }
22977 }
22978
22979 #[doc(hidden)]
22980 impl crate::RequestBuilder for DeleteSecurityProfileGroup {
22981 fn request_options(&mut self) -> &mut crate::RequestOptions {
22982 &mut self.0.options
22983 }
22984 }
22985
22986 #[derive(Clone, Debug)]
23007 pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
23008
23009 impl ListSecurityProfiles {
23010 pub(crate) fn new(
23011 stub: std::sync::Arc<
23012 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23013 >,
23014 ) -> Self {
23015 Self(RequestBuilder::new(stub))
23016 }
23017
23018 pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
23020 mut self,
23021 v: V,
23022 ) -> Self {
23023 self.0.request = v.into();
23024 self
23025 }
23026
23027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23029 self.0.options = v.into();
23030 self
23031 }
23032
23033 pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
23035 (*self.0.stub)
23036 .list_security_profiles(self.0.request, self.0.options)
23037 .await
23038 .map(crate::Response::into_body)
23039 }
23040
23041 pub fn by_page(
23043 self,
23044 ) -> impl google_cloud_gax::paginator::Paginator<
23045 crate::model::ListSecurityProfilesResponse,
23046 crate::Error,
23047 > {
23048 use std::clone::Clone;
23049 let token = self.0.request.page_token.clone();
23050 let execute = move |token: String| {
23051 let mut builder = self.clone();
23052 builder.0.request = builder.0.request.set_page_token(token);
23053 builder.send()
23054 };
23055 google_cloud_gax::paginator::internal::new_paginator(token, execute)
23056 }
23057
23058 pub fn by_item(
23060 self,
23061 ) -> impl google_cloud_gax::paginator::ItemPaginator<
23062 crate::model::ListSecurityProfilesResponse,
23063 crate::Error,
23064 > {
23065 use google_cloud_gax::paginator::Paginator;
23066 self.by_page().items()
23067 }
23068
23069 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23073 self.0.request.parent = v.into();
23074 self
23075 }
23076
23077 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23079 self.0.request.page_size = v.into();
23080 self
23081 }
23082
23083 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23085 self.0.request.page_token = v.into();
23086 self
23087 }
23088 }
23089
23090 #[doc(hidden)]
23091 impl crate::RequestBuilder for ListSecurityProfiles {
23092 fn request_options(&mut self) -> &mut crate::RequestOptions {
23093 &mut self.0.options
23094 }
23095 }
23096
23097 #[derive(Clone, Debug)]
23114 pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
23115
23116 impl GetSecurityProfile {
23117 pub(crate) fn new(
23118 stub: std::sync::Arc<
23119 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23120 >,
23121 ) -> Self {
23122 Self(RequestBuilder::new(stub))
23123 }
23124
23125 pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
23127 mut self,
23128 v: V,
23129 ) -> Self {
23130 self.0.request = v.into();
23131 self
23132 }
23133
23134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23136 self.0.options = v.into();
23137 self
23138 }
23139
23140 pub async fn send(self) -> Result<crate::model::SecurityProfile> {
23142 (*self.0.stub)
23143 .get_security_profile(self.0.request, self.0.options)
23144 .await
23145 .map(crate::Response::into_body)
23146 }
23147
23148 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23152 self.0.request.name = v.into();
23153 self
23154 }
23155 }
23156
23157 #[doc(hidden)]
23158 impl crate::RequestBuilder for GetSecurityProfile {
23159 fn request_options(&mut self) -> &mut crate::RequestOptions {
23160 &mut self.0.options
23161 }
23162 }
23163
23164 #[derive(Clone, Debug)]
23182 pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
23183
23184 impl CreateSecurityProfile {
23185 pub(crate) fn new(
23186 stub: std::sync::Arc<
23187 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23188 >,
23189 ) -> Self {
23190 Self(RequestBuilder::new(stub))
23191 }
23192
23193 pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
23195 mut self,
23196 v: V,
23197 ) -> Self {
23198 self.0.request = v.into();
23199 self
23200 }
23201
23202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23204 self.0.options = v.into();
23205 self
23206 }
23207
23208 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23215 (*self.0.stub)
23216 .create_security_profile(self.0.request, self.0.options)
23217 .await
23218 .map(crate::Response::into_body)
23219 }
23220
23221 pub fn poller(
23223 self,
23224 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
23225 {
23226 type Operation = google_cloud_lro::internal::Operation<
23227 crate::model::SecurityProfile,
23228 crate::model::OperationMetadata,
23229 >;
23230 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23231 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23232
23233 let stub = self.0.stub.clone();
23234 let mut options = self.0.options.clone();
23235 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23236 let query = move |name| {
23237 let stub = stub.clone();
23238 let options = options.clone();
23239 async {
23240 let op = GetOperation::new(stub)
23241 .set_name(name)
23242 .with_options(options)
23243 .send()
23244 .await?;
23245 Ok(Operation::new(op))
23246 }
23247 };
23248
23249 let start = move || async {
23250 let op = self.send().await?;
23251 Ok(Operation::new(op))
23252 };
23253
23254 google_cloud_lro::internal::new_poller(
23255 polling_error_policy,
23256 polling_backoff_policy,
23257 start,
23258 query,
23259 )
23260 }
23261
23262 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23266 self.0.request.parent = v.into();
23267 self
23268 }
23269
23270 pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
23274 self.0.request.security_profile_id = v.into();
23275 self
23276 }
23277
23278 pub fn set_security_profile<T>(mut self, v: T) -> Self
23282 where
23283 T: std::convert::Into<crate::model::SecurityProfile>,
23284 {
23285 self.0.request.security_profile = std::option::Option::Some(v.into());
23286 self
23287 }
23288
23289 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
23293 where
23294 T: std::convert::Into<crate::model::SecurityProfile>,
23295 {
23296 self.0.request.security_profile = v.map(|x| x.into());
23297 self
23298 }
23299 }
23300
23301 #[doc(hidden)]
23302 impl crate::RequestBuilder for CreateSecurityProfile {
23303 fn request_options(&mut self) -> &mut crate::RequestOptions {
23304 &mut self.0.options
23305 }
23306 }
23307
23308 #[derive(Clone, Debug)]
23326 pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
23327
23328 impl UpdateSecurityProfile {
23329 pub(crate) fn new(
23330 stub: std::sync::Arc<
23331 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23332 >,
23333 ) -> Self {
23334 Self(RequestBuilder::new(stub))
23335 }
23336
23337 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
23339 mut self,
23340 v: V,
23341 ) -> Self {
23342 self.0.request = v.into();
23343 self
23344 }
23345
23346 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23348 self.0.options = v.into();
23349 self
23350 }
23351
23352 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23359 (*self.0.stub)
23360 .update_security_profile(self.0.request, self.0.options)
23361 .await
23362 .map(crate::Response::into_body)
23363 }
23364
23365 pub fn poller(
23367 self,
23368 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
23369 {
23370 type Operation = google_cloud_lro::internal::Operation<
23371 crate::model::SecurityProfile,
23372 crate::model::OperationMetadata,
23373 >;
23374 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23375 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23376
23377 let stub = self.0.stub.clone();
23378 let mut options = self.0.options.clone();
23379 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23380 let query = move |name| {
23381 let stub = stub.clone();
23382 let options = options.clone();
23383 async {
23384 let op = GetOperation::new(stub)
23385 .set_name(name)
23386 .with_options(options)
23387 .send()
23388 .await?;
23389 Ok(Operation::new(op))
23390 }
23391 };
23392
23393 let start = move || async {
23394 let op = self.send().await?;
23395 Ok(Operation::new(op))
23396 };
23397
23398 google_cloud_lro::internal::new_poller(
23399 polling_error_policy,
23400 polling_backoff_policy,
23401 start,
23402 query,
23403 )
23404 }
23405
23406 pub fn set_update_mask<T>(mut self, v: T) -> Self
23410 where
23411 T: std::convert::Into<wkt::FieldMask>,
23412 {
23413 self.0.request.update_mask = std::option::Option::Some(v.into());
23414 self
23415 }
23416
23417 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23421 where
23422 T: std::convert::Into<wkt::FieldMask>,
23423 {
23424 self.0.request.update_mask = v.map(|x| x.into());
23425 self
23426 }
23427
23428 pub fn set_security_profile<T>(mut self, v: T) -> Self
23432 where
23433 T: std::convert::Into<crate::model::SecurityProfile>,
23434 {
23435 self.0.request.security_profile = std::option::Option::Some(v.into());
23436 self
23437 }
23438
23439 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
23443 where
23444 T: std::convert::Into<crate::model::SecurityProfile>,
23445 {
23446 self.0.request.security_profile = v.map(|x| x.into());
23447 self
23448 }
23449 }
23450
23451 #[doc(hidden)]
23452 impl crate::RequestBuilder for UpdateSecurityProfile {
23453 fn request_options(&mut self) -> &mut crate::RequestOptions {
23454 &mut self.0.options
23455 }
23456 }
23457
23458 #[derive(Clone, Debug)]
23476 pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
23477
23478 impl DeleteSecurityProfile {
23479 pub(crate) fn new(
23480 stub: std::sync::Arc<
23481 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23482 >,
23483 ) -> Self {
23484 Self(RequestBuilder::new(stub))
23485 }
23486
23487 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
23489 mut self,
23490 v: V,
23491 ) -> Self {
23492 self.0.request = v.into();
23493 self
23494 }
23495
23496 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23498 self.0.options = v.into();
23499 self
23500 }
23501
23502 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23509 (*self.0.stub)
23510 .delete_security_profile(self.0.request, self.0.options)
23511 .await
23512 .map(crate::Response::into_body)
23513 }
23514
23515 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
23517 type Operation =
23518 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
23519 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23520 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23521
23522 let stub = self.0.stub.clone();
23523 let mut options = self.0.options.clone();
23524 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23525 let query = move |name| {
23526 let stub = stub.clone();
23527 let options = options.clone();
23528 async {
23529 let op = GetOperation::new(stub)
23530 .set_name(name)
23531 .with_options(options)
23532 .send()
23533 .await?;
23534 Ok(Operation::new(op))
23535 }
23536 };
23537
23538 let start = move || async {
23539 let op = self.send().await?;
23540 Ok(Operation::new(op))
23541 };
23542
23543 google_cloud_lro::internal::new_unit_response_poller(
23544 polling_error_policy,
23545 polling_backoff_policy,
23546 start,
23547 query,
23548 )
23549 }
23550
23551 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23555 self.0.request.name = v.into();
23556 self
23557 }
23558
23559 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
23561 self.0.request.etag = v.into();
23562 self
23563 }
23564 }
23565
23566 #[doc(hidden)]
23567 impl crate::RequestBuilder for DeleteSecurityProfile {
23568 fn request_options(&mut self) -> &mut crate::RequestOptions {
23569 &mut self.0.options
23570 }
23571 }
23572
23573 #[derive(Clone, Debug)]
23594 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
23595
23596 impl ListLocations {
23597 pub(crate) fn new(
23598 stub: std::sync::Arc<
23599 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23600 >,
23601 ) -> Self {
23602 Self(RequestBuilder::new(stub))
23603 }
23604
23605 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
23607 mut self,
23608 v: V,
23609 ) -> Self {
23610 self.0.request = v.into();
23611 self
23612 }
23613
23614 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23616 self.0.options = v.into();
23617 self
23618 }
23619
23620 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
23622 (*self.0.stub)
23623 .list_locations(self.0.request, self.0.options)
23624 .await
23625 .map(crate::Response::into_body)
23626 }
23627
23628 pub fn by_page(
23630 self,
23631 ) -> impl google_cloud_gax::paginator::Paginator<
23632 google_cloud_location::model::ListLocationsResponse,
23633 crate::Error,
23634 > {
23635 use std::clone::Clone;
23636 let token = self.0.request.page_token.clone();
23637 let execute = move |token: String| {
23638 let mut builder = self.clone();
23639 builder.0.request = builder.0.request.set_page_token(token);
23640 builder.send()
23641 };
23642 google_cloud_gax::paginator::internal::new_paginator(token, execute)
23643 }
23644
23645 pub fn by_item(
23647 self,
23648 ) -> impl google_cloud_gax::paginator::ItemPaginator<
23649 google_cloud_location::model::ListLocationsResponse,
23650 crate::Error,
23651 > {
23652 use google_cloud_gax::paginator::Paginator;
23653 self.by_page().items()
23654 }
23655
23656 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23658 self.0.request.name = v.into();
23659 self
23660 }
23661
23662 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
23664 self.0.request.filter = v.into();
23665 self
23666 }
23667
23668 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23670 self.0.request.page_size = v.into();
23671 self
23672 }
23673
23674 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23676 self.0.request.page_token = v.into();
23677 self
23678 }
23679 }
23680
23681 #[doc(hidden)]
23682 impl crate::RequestBuilder for ListLocations {
23683 fn request_options(&mut self) -> &mut crate::RequestOptions {
23684 &mut self.0.options
23685 }
23686 }
23687
23688 #[derive(Clone, Debug)]
23705 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
23706
23707 impl GetLocation {
23708 pub(crate) fn new(
23709 stub: std::sync::Arc<
23710 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23711 >,
23712 ) -> Self {
23713 Self(RequestBuilder::new(stub))
23714 }
23715
23716 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
23718 mut self,
23719 v: V,
23720 ) -> Self {
23721 self.0.request = v.into();
23722 self
23723 }
23724
23725 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23727 self.0.options = v.into();
23728 self
23729 }
23730
23731 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
23733 (*self.0.stub)
23734 .get_location(self.0.request, self.0.options)
23735 .await
23736 .map(crate::Response::into_body)
23737 }
23738
23739 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23741 self.0.request.name = v.into();
23742 self
23743 }
23744 }
23745
23746 #[doc(hidden)]
23747 impl crate::RequestBuilder for GetLocation {
23748 fn request_options(&mut self) -> &mut crate::RequestOptions {
23749 &mut self.0.options
23750 }
23751 }
23752
23753 #[derive(Clone, Debug)]
23770 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
23771
23772 impl SetIamPolicy {
23773 pub(crate) fn new(
23774 stub: std::sync::Arc<
23775 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23776 >,
23777 ) -> Self {
23778 Self(RequestBuilder::new(stub))
23779 }
23780
23781 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
23783 mut self,
23784 v: V,
23785 ) -> Self {
23786 self.0.request = v.into();
23787 self
23788 }
23789
23790 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23792 self.0.options = v.into();
23793 self
23794 }
23795
23796 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
23798 (*self.0.stub)
23799 .set_iam_policy(self.0.request, self.0.options)
23800 .await
23801 .map(crate::Response::into_body)
23802 }
23803
23804 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
23808 self.0.request.resource = v.into();
23809 self
23810 }
23811
23812 pub fn set_policy<T>(mut self, v: T) -> Self
23816 where
23817 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
23818 {
23819 self.0.request.policy = std::option::Option::Some(v.into());
23820 self
23821 }
23822
23823 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
23827 where
23828 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
23829 {
23830 self.0.request.policy = v.map(|x| x.into());
23831 self
23832 }
23833
23834 pub fn set_update_mask<T>(mut self, v: T) -> Self
23836 where
23837 T: std::convert::Into<wkt::FieldMask>,
23838 {
23839 self.0.request.update_mask = std::option::Option::Some(v.into());
23840 self
23841 }
23842
23843 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23845 where
23846 T: std::convert::Into<wkt::FieldMask>,
23847 {
23848 self.0.request.update_mask = v.map(|x| x.into());
23849 self
23850 }
23851 }
23852
23853 #[doc(hidden)]
23854 impl crate::RequestBuilder for SetIamPolicy {
23855 fn request_options(&mut self) -> &mut crate::RequestOptions {
23856 &mut self.0.options
23857 }
23858 }
23859
23860 #[derive(Clone, Debug)]
23877 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
23878
23879 impl GetIamPolicy {
23880 pub(crate) fn new(
23881 stub: std::sync::Arc<
23882 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23883 >,
23884 ) -> Self {
23885 Self(RequestBuilder::new(stub))
23886 }
23887
23888 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
23890 mut self,
23891 v: V,
23892 ) -> Self {
23893 self.0.request = v.into();
23894 self
23895 }
23896
23897 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23899 self.0.options = v.into();
23900 self
23901 }
23902
23903 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
23905 (*self.0.stub)
23906 .get_iam_policy(self.0.request, self.0.options)
23907 .await
23908 .map(crate::Response::into_body)
23909 }
23910
23911 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
23915 self.0.request.resource = v.into();
23916 self
23917 }
23918
23919 pub fn set_options<T>(mut self, v: T) -> Self
23921 where
23922 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
23923 {
23924 self.0.request.options = std::option::Option::Some(v.into());
23925 self
23926 }
23927
23928 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
23930 where
23931 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
23932 {
23933 self.0.request.options = v.map(|x| x.into());
23934 self
23935 }
23936 }
23937
23938 #[doc(hidden)]
23939 impl crate::RequestBuilder for GetIamPolicy {
23940 fn request_options(&mut self) -> &mut crate::RequestOptions {
23941 &mut self.0.options
23942 }
23943 }
23944
23945 #[derive(Clone, Debug)]
23962 pub struct TestIamPermissions(
23963 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
23964 );
23965
23966 impl TestIamPermissions {
23967 pub(crate) fn new(
23968 stub: std::sync::Arc<
23969 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23970 >,
23971 ) -> Self {
23972 Self(RequestBuilder::new(stub))
23973 }
23974
23975 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
23977 mut self,
23978 v: V,
23979 ) -> Self {
23980 self.0.request = v.into();
23981 self
23982 }
23983
23984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23986 self.0.options = v.into();
23987 self
23988 }
23989
23990 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
23992 (*self.0.stub)
23993 .test_iam_permissions(self.0.request, self.0.options)
23994 .await
23995 .map(crate::Response::into_body)
23996 }
23997
23998 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
24002 self.0.request.resource = v.into();
24003 self
24004 }
24005
24006 pub fn set_permissions<T, V>(mut self, v: T) -> Self
24010 where
24011 T: std::iter::IntoIterator<Item = V>,
24012 V: std::convert::Into<std::string::String>,
24013 {
24014 use std::iter::Iterator;
24015 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
24016 self
24017 }
24018 }
24019
24020 #[doc(hidden)]
24021 impl crate::RequestBuilder for TestIamPermissions {
24022 fn request_options(&mut self) -> &mut crate::RequestOptions {
24023 &mut self.0.options
24024 }
24025 }
24026
24027 #[derive(Clone, Debug)]
24048 pub struct ListOperations(
24049 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
24050 );
24051
24052 impl ListOperations {
24053 pub(crate) fn new(
24054 stub: std::sync::Arc<
24055 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24056 >,
24057 ) -> Self {
24058 Self(RequestBuilder::new(stub))
24059 }
24060
24061 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
24063 mut self,
24064 v: V,
24065 ) -> Self {
24066 self.0.request = v.into();
24067 self
24068 }
24069
24070 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24072 self.0.options = v.into();
24073 self
24074 }
24075
24076 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
24078 (*self.0.stub)
24079 .list_operations(self.0.request, self.0.options)
24080 .await
24081 .map(crate::Response::into_body)
24082 }
24083
24084 pub fn by_page(
24086 self,
24087 ) -> impl google_cloud_gax::paginator::Paginator<
24088 google_cloud_longrunning::model::ListOperationsResponse,
24089 crate::Error,
24090 > {
24091 use std::clone::Clone;
24092 let token = self.0.request.page_token.clone();
24093 let execute = move |token: String| {
24094 let mut builder = self.clone();
24095 builder.0.request = builder.0.request.set_page_token(token);
24096 builder.send()
24097 };
24098 google_cloud_gax::paginator::internal::new_paginator(token, execute)
24099 }
24100
24101 pub fn by_item(
24103 self,
24104 ) -> impl google_cloud_gax::paginator::ItemPaginator<
24105 google_cloud_longrunning::model::ListOperationsResponse,
24106 crate::Error,
24107 > {
24108 use google_cloud_gax::paginator::Paginator;
24109 self.by_page().items()
24110 }
24111
24112 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24114 self.0.request.name = v.into();
24115 self
24116 }
24117
24118 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24120 self.0.request.filter = v.into();
24121 self
24122 }
24123
24124 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24126 self.0.request.page_size = v.into();
24127 self
24128 }
24129
24130 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24132 self.0.request.page_token = v.into();
24133 self
24134 }
24135
24136 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
24138 self.0.request.return_partial_success = v.into();
24139 self
24140 }
24141 }
24142
24143 #[doc(hidden)]
24144 impl crate::RequestBuilder for ListOperations {
24145 fn request_options(&mut self) -> &mut crate::RequestOptions {
24146 &mut self.0.options
24147 }
24148 }
24149
24150 #[derive(Clone, Debug)]
24167 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
24168
24169 impl GetOperation {
24170 pub(crate) fn new(
24171 stub: std::sync::Arc<
24172 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24173 >,
24174 ) -> Self {
24175 Self(RequestBuilder::new(stub))
24176 }
24177
24178 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
24180 mut self,
24181 v: V,
24182 ) -> Self {
24183 self.0.request = v.into();
24184 self
24185 }
24186
24187 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24189 self.0.options = v.into();
24190 self
24191 }
24192
24193 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24195 (*self.0.stub)
24196 .get_operation(self.0.request, self.0.options)
24197 .await
24198 .map(crate::Response::into_body)
24199 }
24200
24201 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24203 self.0.request.name = v.into();
24204 self
24205 }
24206 }
24207
24208 #[doc(hidden)]
24209 impl crate::RequestBuilder for GetOperation {
24210 fn request_options(&mut self) -> &mut crate::RequestOptions {
24211 &mut self.0.options
24212 }
24213 }
24214
24215 #[derive(Clone, Debug)]
24232 pub struct DeleteOperation(
24233 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
24234 );
24235
24236 impl DeleteOperation {
24237 pub(crate) fn new(
24238 stub: std::sync::Arc<
24239 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24240 >,
24241 ) -> Self {
24242 Self(RequestBuilder::new(stub))
24243 }
24244
24245 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
24247 mut self,
24248 v: V,
24249 ) -> Self {
24250 self.0.request = v.into();
24251 self
24252 }
24253
24254 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24256 self.0.options = v.into();
24257 self
24258 }
24259
24260 pub async fn send(self) -> Result<()> {
24262 (*self.0.stub)
24263 .delete_operation(self.0.request, self.0.options)
24264 .await
24265 .map(crate::Response::into_body)
24266 }
24267
24268 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24270 self.0.request.name = v.into();
24271 self
24272 }
24273 }
24274
24275 #[doc(hidden)]
24276 impl crate::RequestBuilder for DeleteOperation {
24277 fn request_options(&mut self) -> &mut crate::RequestOptions {
24278 &mut self.0.options
24279 }
24280 }
24281
24282 #[derive(Clone, Debug)]
24299 pub struct CancelOperation(
24300 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
24301 );
24302
24303 impl CancelOperation {
24304 pub(crate) fn new(
24305 stub: std::sync::Arc<
24306 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24307 >,
24308 ) -> Self {
24309 Self(RequestBuilder::new(stub))
24310 }
24311
24312 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
24314 mut self,
24315 v: V,
24316 ) -> Self {
24317 self.0.request = v.into();
24318 self
24319 }
24320
24321 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24323 self.0.options = v.into();
24324 self
24325 }
24326
24327 pub async fn send(self) -> Result<()> {
24329 (*self.0.stub)
24330 .cancel_operation(self.0.request, self.0.options)
24331 .await
24332 .map(crate::Response::into_body)
24333 }
24334
24335 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24337 self.0.request.name = v.into();
24338 self
24339 }
24340 }
24341
24342 #[doc(hidden)]
24343 impl crate::RequestBuilder for CancelOperation {
24344 fn request_options(&mut self) -> &mut crate::RequestOptions {
24345 &mut self.0.options
24346 }
24347 }
24348}
24349
24350pub mod sse_realm_service {
24352 use crate::Result;
24353
24354 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
24368
24369 pub(crate) mod client {
24370 use super::super::super::client::SSERealmService;
24371 pub struct Factory;
24372 impl crate::ClientFactory for Factory {
24373 type Client = SSERealmService;
24374 type Credentials = gaxi::options::Credentials;
24375 async fn build(
24376 self,
24377 config: gaxi::options::ClientConfig,
24378 ) -> crate::ClientBuilderResult<Self::Client> {
24379 Self::Client::new(config).await
24380 }
24381 }
24382 }
24383
24384 #[derive(Clone, Debug)]
24386 pub(crate) struct RequestBuilder<R: std::default::Default> {
24387 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24388 request: R,
24389 options: crate::RequestOptions,
24390 }
24391
24392 impl<R> RequestBuilder<R>
24393 where
24394 R: std::default::Default,
24395 {
24396 pub(crate) fn new(
24397 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24398 ) -> Self {
24399 Self {
24400 stub,
24401 request: R::default(),
24402 options: crate::RequestOptions::default(),
24403 }
24404 }
24405 }
24406
24407 #[derive(Clone, Debug)]
24428 pub struct ListSACRealms(RequestBuilder<crate::model::ListSACRealmsRequest>);
24429
24430 impl ListSACRealms {
24431 pub(crate) fn new(
24432 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24433 ) -> Self {
24434 Self(RequestBuilder::new(stub))
24435 }
24436
24437 pub fn with_request<V: Into<crate::model::ListSACRealmsRequest>>(mut self, v: V) -> Self {
24439 self.0.request = v.into();
24440 self
24441 }
24442
24443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24445 self.0.options = v.into();
24446 self
24447 }
24448
24449 pub async fn send(self) -> Result<crate::model::ListSACRealmsResponse> {
24451 (*self.0.stub)
24452 .list_sac_realms(self.0.request, self.0.options)
24453 .await
24454 .map(crate::Response::into_body)
24455 }
24456
24457 pub fn by_page(
24459 self,
24460 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSACRealmsResponse, crate::Error>
24461 {
24462 use std::clone::Clone;
24463 let token = self.0.request.page_token.clone();
24464 let execute = move |token: String| {
24465 let mut builder = self.clone();
24466 builder.0.request = builder.0.request.set_page_token(token);
24467 builder.send()
24468 };
24469 google_cloud_gax::paginator::internal::new_paginator(token, execute)
24470 }
24471
24472 pub fn by_item(
24474 self,
24475 ) -> impl google_cloud_gax::paginator::ItemPaginator<
24476 crate::model::ListSACRealmsResponse,
24477 crate::Error,
24478 > {
24479 use google_cloud_gax::paginator::Paginator;
24480 self.by_page().items()
24481 }
24482
24483 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
24487 self.0.request.parent = v.into();
24488 self
24489 }
24490
24491 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24493 self.0.request.page_size = v.into();
24494 self
24495 }
24496
24497 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24499 self.0.request.page_token = v.into();
24500 self
24501 }
24502
24503 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24505 self.0.request.filter = v.into();
24506 self
24507 }
24508
24509 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
24511 self.0.request.order_by = v.into();
24512 self
24513 }
24514 }
24515
24516 #[doc(hidden)]
24517 impl crate::RequestBuilder for ListSACRealms {
24518 fn request_options(&mut self) -> &mut crate::RequestOptions {
24519 &mut self.0.options
24520 }
24521 }
24522
24523 #[derive(Clone, Debug)]
24540 pub struct GetSACRealm(RequestBuilder<crate::model::GetSACRealmRequest>);
24541
24542 impl GetSACRealm {
24543 pub(crate) fn new(
24544 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24545 ) -> Self {
24546 Self(RequestBuilder::new(stub))
24547 }
24548
24549 pub fn with_request<V: Into<crate::model::GetSACRealmRequest>>(mut self, v: V) -> Self {
24551 self.0.request = v.into();
24552 self
24553 }
24554
24555 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24557 self.0.options = v.into();
24558 self
24559 }
24560
24561 pub async fn send(self) -> Result<crate::model::SACRealm> {
24563 (*self.0.stub)
24564 .get_sac_realm(self.0.request, self.0.options)
24565 .await
24566 .map(crate::Response::into_body)
24567 }
24568
24569 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24573 self.0.request.name = v.into();
24574 self
24575 }
24576 }
24577
24578 #[doc(hidden)]
24579 impl crate::RequestBuilder for GetSACRealm {
24580 fn request_options(&mut self) -> &mut crate::RequestOptions {
24581 &mut self.0.options
24582 }
24583 }
24584
24585 #[derive(Clone, Debug)]
24603 pub struct CreateSACRealm(RequestBuilder<crate::model::CreateSACRealmRequest>);
24604
24605 impl CreateSACRealm {
24606 pub(crate) fn new(
24607 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24608 ) -> Self {
24609 Self(RequestBuilder::new(stub))
24610 }
24611
24612 pub fn with_request<V: Into<crate::model::CreateSACRealmRequest>>(mut self, v: V) -> Self {
24614 self.0.request = v.into();
24615 self
24616 }
24617
24618 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24620 self.0.options = v.into();
24621 self
24622 }
24623
24624 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24631 (*self.0.stub)
24632 .create_sac_realm(self.0.request, self.0.options)
24633 .await
24634 .map(crate::Response::into_body)
24635 }
24636
24637 pub fn poller(
24639 self,
24640 ) -> impl google_cloud_lro::Poller<crate::model::SACRealm, crate::model::OperationMetadata>
24641 {
24642 type Operation = google_cloud_lro::internal::Operation<
24643 crate::model::SACRealm,
24644 crate::model::OperationMetadata,
24645 >;
24646 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
24647 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
24648
24649 let stub = self.0.stub.clone();
24650 let mut options = self.0.options.clone();
24651 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
24652 let query = move |name| {
24653 let stub = stub.clone();
24654 let options = options.clone();
24655 async {
24656 let op = GetOperation::new(stub)
24657 .set_name(name)
24658 .with_options(options)
24659 .send()
24660 .await?;
24661 Ok(Operation::new(op))
24662 }
24663 };
24664
24665 let start = move || async {
24666 let op = self.send().await?;
24667 Ok(Operation::new(op))
24668 };
24669
24670 google_cloud_lro::internal::new_poller(
24671 polling_error_policy,
24672 polling_backoff_policy,
24673 start,
24674 query,
24675 )
24676 }
24677
24678 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
24682 self.0.request.parent = v.into();
24683 self
24684 }
24685
24686 pub fn set_sac_realm_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
24690 self.0.request.sac_realm_id = v.into();
24691 self
24692 }
24693
24694 pub fn set_sac_realm<T>(mut self, v: T) -> Self
24698 where
24699 T: std::convert::Into<crate::model::SACRealm>,
24700 {
24701 self.0.request.sac_realm = std::option::Option::Some(v.into());
24702 self
24703 }
24704
24705 pub fn set_or_clear_sac_realm<T>(mut self, v: std::option::Option<T>) -> Self
24709 where
24710 T: std::convert::Into<crate::model::SACRealm>,
24711 {
24712 self.0.request.sac_realm = v.map(|x| x.into());
24713 self
24714 }
24715
24716 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
24718 self.0.request.request_id = v.into();
24719 self
24720 }
24721 }
24722
24723 #[doc(hidden)]
24724 impl crate::RequestBuilder for CreateSACRealm {
24725 fn request_options(&mut self) -> &mut crate::RequestOptions {
24726 &mut self.0.options
24727 }
24728 }
24729
24730 #[derive(Clone, Debug)]
24748 pub struct DeleteSACRealm(RequestBuilder<crate::model::DeleteSACRealmRequest>);
24749
24750 impl DeleteSACRealm {
24751 pub(crate) fn new(
24752 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24753 ) -> Self {
24754 Self(RequestBuilder::new(stub))
24755 }
24756
24757 pub fn with_request<V: Into<crate::model::DeleteSACRealmRequest>>(mut self, v: V) -> Self {
24759 self.0.request = v.into();
24760 self
24761 }
24762
24763 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24765 self.0.options = v.into();
24766 self
24767 }
24768
24769 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24776 (*self.0.stub)
24777 .delete_sac_realm(self.0.request, self.0.options)
24778 .await
24779 .map(crate::Response::into_body)
24780 }
24781
24782 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
24784 type Operation =
24785 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
24786 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
24787 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
24788
24789 let stub = self.0.stub.clone();
24790 let mut options = self.0.options.clone();
24791 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
24792 let query = move |name| {
24793 let stub = stub.clone();
24794 let options = options.clone();
24795 async {
24796 let op = GetOperation::new(stub)
24797 .set_name(name)
24798 .with_options(options)
24799 .send()
24800 .await?;
24801 Ok(Operation::new(op))
24802 }
24803 };
24804
24805 let start = move || async {
24806 let op = self.send().await?;
24807 Ok(Operation::new(op))
24808 };
24809
24810 google_cloud_lro::internal::new_unit_response_poller(
24811 polling_error_policy,
24812 polling_backoff_policy,
24813 start,
24814 query,
24815 )
24816 }
24817
24818 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24822 self.0.request.name = v.into();
24823 self
24824 }
24825
24826 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
24828 self.0.request.request_id = v.into();
24829 self
24830 }
24831 }
24832
24833 #[doc(hidden)]
24834 impl crate::RequestBuilder for DeleteSACRealm {
24835 fn request_options(&mut self) -> &mut crate::RequestOptions {
24836 &mut self.0.options
24837 }
24838 }
24839
24840 #[derive(Clone, Debug)]
24861 pub struct ListSACAttachments(RequestBuilder<crate::model::ListSACAttachmentsRequest>);
24862
24863 impl ListSACAttachments {
24864 pub(crate) fn new(
24865 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24866 ) -> Self {
24867 Self(RequestBuilder::new(stub))
24868 }
24869
24870 pub fn with_request<V: Into<crate::model::ListSACAttachmentsRequest>>(
24872 mut self,
24873 v: V,
24874 ) -> Self {
24875 self.0.request = v.into();
24876 self
24877 }
24878
24879 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24881 self.0.options = v.into();
24882 self
24883 }
24884
24885 pub async fn send(self) -> Result<crate::model::ListSACAttachmentsResponse> {
24887 (*self.0.stub)
24888 .list_sac_attachments(self.0.request, self.0.options)
24889 .await
24890 .map(crate::Response::into_body)
24891 }
24892
24893 pub fn by_page(
24895 self,
24896 ) -> impl google_cloud_gax::paginator::Paginator<
24897 crate::model::ListSACAttachmentsResponse,
24898 crate::Error,
24899 > {
24900 use std::clone::Clone;
24901 let token = self.0.request.page_token.clone();
24902 let execute = move |token: String| {
24903 let mut builder = self.clone();
24904 builder.0.request = builder.0.request.set_page_token(token);
24905 builder.send()
24906 };
24907 google_cloud_gax::paginator::internal::new_paginator(token, execute)
24908 }
24909
24910 pub fn by_item(
24912 self,
24913 ) -> impl google_cloud_gax::paginator::ItemPaginator<
24914 crate::model::ListSACAttachmentsResponse,
24915 crate::Error,
24916 > {
24917 use google_cloud_gax::paginator::Paginator;
24918 self.by_page().items()
24919 }
24920
24921 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
24925 self.0.request.parent = v.into();
24926 self
24927 }
24928
24929 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24931 self.0.request.page_size = v.into();
24932 self
24933 }
24934
24935 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24937 self.0.request.page_token = v.into();
24938 self
24939 }
24940
24941 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24943 self.0.request.filter = v.into();
24944 self
24945 }
24946
24947 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
24949 self.0.request.order_by = v.into();
24950 self
24951 }
24952 }
24953
24954 #[doc(hidden)]
24955 impl crate::RequestBuilder for ListSACAttachments {
24956 fn request_options(&mut self) -> &mut crate::RequestOptions {
24957 &mut self.0.options
24958 }
24959 }
24960
24961 #[derive(Clone, Debug)]
24978 pub struct GetSACAttachment(RequestBuilder<crate::model::GetSACAttachmentRequest>);
24979
24980 impl GetSACAttachment {
24981 pub(crate) fn new(
24982 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24983 ) -> Self {
24984 Self(RequestBuilder::new(stub))
24985 }
24986
24987 pub fn with_request<V: Into<crate::model::GetSACAttachmentRequest>>(
24989 mut self,
24990 v: V,
24991 ) -> Self {
24992 self.0.request = v.into();
24993 self
24994 }
24995
24996 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24998 self.0.options = v.into();
24999 self
25000 }
25001
25002 pub async fn send(self) -> Result<crate::model::SACAttachment> {
25004 (*self.0.stub)
25005 .get_sac_attachment(self.0.request, self.0.options)
25006 .await
25007 .map(crate::Response::into_body)
25008 }
25009
25010 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25014 self.0.request.name = v.into();
25015 self
25016 }
25017 }
25018
25019 #[doc(hidden)]
25020 impl crate::RequestBuilder for GetSACAttachment {
25021 fn request_options(&mut self) -> &mut crate::RequestOptions {
25022 &mut self.0.options
25023 }
25024 }
25025
25026 #[derive(Clone, Debug)]
25044 pub struct CreateSACAttachment(RequestBuilder<crate::model::CreateSACAttachmentRequest>);
25045
25046 impl CreateSACAttachment {
25047 pub(crate) fn new(
25048 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25049 ) -> Self {
25050 Self(RequestBuilder::new(stub))
25051 }
25052
25053 pub fn with_request<V: Into<crate::model::CreateSACAttachmentRequest>>(
25055 mut self,
25056 v: V,
25057 ) -> Self {
25058 self.0.request = v.into();
25059 self
25060 }
25061
25062 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25064 self.0.options = v.into();
25065 self
25066 }
25067
25068 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25075 (*self.0.stub)
25076 .create_sac_attachment(self.0.request, self.0.options)
25077 .await
25078 .map(crate::Response::into_body)
25079 }
25080
25081 pub fn poller(
25083 self,
25084 ) -> impl google_cloud_lro::Poller<crate::model::SACAttachment, crate::model::OperationMetadata>
25085 {
25086 type Operation = google_cloud_lro::internal::Operation<
25087 crate::model::SACAttachment,
25088 crate::model::OperationMetadata,
25089 >;
25090 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25091 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25092
25093 let stub = self.0.stub.clone();
25094 let mut options = self.0.options.clone();
25095 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25096 let query = move |name| {
25097 let stub = stub.clone();
25098 let options = options.clone();
25099 async {
25100 let op = GetOperation::new(stub)
25101 .set_name(name)
25102 .with_options(options)
25103 .send()
25104 .await?;
25105 Ok(Operation::new(op))
25106 }
25107 };
25108
25109 let start = move || async {
25110 let op = self.send().await?;
25111 Ok(Operation::new(op))
25112 };
25113
25114 google_cloud_lro::internal::new_poller(
25115 polling_error_policy,
25116 polling_backoff_policy,
25117 start,
25118 query,
25119 )
25120 }
25121
25122 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25126 self.0.request.parent = v.into();
25127 self
25128 }
25129
25130 pub fn set_sac_attachment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25134 self.0.request.sac_attachment_id = v.into();
25135 self
25136 }
25137
25138 pub fn set_sac_attachment<T>(mut self, v: T) -> Self
25142 where
25143 T: std::convert::Into<crate::model::SACAttachment>,
25144 {
25145 self.0.request.sac_attachment = std::option::Option::Some(v.into());
25146 self
25147 }
25148
25149 pub fn set_or_clear_sac_attachment<T>(mut self, v: std::option::Option<T>) -> Self
25153 where
25154 T: std::convert::Into<crate::model::SACAttachment>,
25155 {
25156 self.0.request.sac_attachment = v.map(|x| x.into());
25157 self
25158 }
25159
25160 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25162 self.0.request.request_id = v.into();
25163 self
25164 }
25165 }
25166
25167 #[doc(hidden)]
25168 impl crate::RequestBuilder for CreateSACAttachment {
25169 fn request_options(&mut self) -> &mut crate::RequestOptions {
25170 &mut self.0.options
25171 }
25172 }
25173
25174 #[derive(Clone, Debug)]
25192 pub struct DeleteSACAttachment(RequestBuilder<crate::model::DeleteSACAttachmentRequest>);
25193
25194 impl DeleteSACAttachment {
25195 pub(crate) fn new(
25196 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25197 ) -> Self {
25198 Self(RequestBuilder::new(stub))
25199 }
25200
25201 pub fn with_request<V: Into<crate::model::DeleteSACAttachmentRequest>>(
25203 mut self,
25204 v: V,
25205 ) -> Self {
25206 self.0.request = v.into();
25207 self
25208 }
25209
25210 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25212 self.0.options = v.into();
25213 self
25214 }
25215
25216 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25223 (*self.0.stub)
25224 .delete_sac_attachment(self.0.request, self.0.options)
25225 .await
25226 .map(crate::Response::into_body)
25227 }
25228
25229 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
25231 type Operation =
25232 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
25233 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25234 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25235
25236 let stub = self.0.stub.clone();
25237 let mut options = self.0.options.clone();
25238 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25239 let query = move |name| {
25240 let stub = stub.clone();
25241 let options = options.clone();
25242 async {
25243 let op = GetOperation::new(stub)
25244 .set_name(name)
25245 .with_options(options)
25246 .send()
25247 .await?;
25248 Ok(Operation::new(op))
25249 }
25250 };
25251
25252 let start = move || async {
25253 let op = self.send().await?;
25254 Ok(Operation::new(op))
25255 };
25256
25257 google_cloud_lro::internal::new_unit_response_poller(
25258 polling_error_policy,
25259 polling_backoff_policy,
25260 start,
25261 query,
25262 )
25263 }
25264
25265 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25269 self.0.request.name = v.into();
25270 self
25271 }
25272
25273 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25275 self.0.request.request_id = v.into();
25276 self
25277 }
25278 }
25279
25280 #[doc(hidden)]
25281 impl crate::RequestBuilder for DeleteSACAttachment {
25282 fn request_options(&mut self) -> &mut crate::RequestOptions {
25283 &mut self.0.options
25284 }
25285 }
25286
25287 #[derive(Clone, Debug)]
25308 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
25309
25310 impl ListLocations {
25311 pub(crate) fn new(
25312 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25313 ) -> Self {
25314 Self(RequestBuilder::new(stub))
25315 }
25316
25317 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
25319 mut self,
25320 v: V,
25321 ) -> Self {
25322 self.0.request = v.into();
25323 self
25324 }
25325
25326 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25328 self.0.options = v.into();
25329 self
25330 }
25331
25332 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
25334 (*self.0.stub)
25335 .list_locations(self.0.request, self.0.options)
25336 .await
25337 .map(crate::Response::into_body)
25338 }
25339
25340 pub fn by_page(
25342 self,
25343 ) -> impl google_cloud_gax::paginator::Paginator<
25344 google_cloud_location::model::ListLocationsResponse,
25345 crate::Error,
25346 > {
25347 use std::clone::Clone;
25348 let token = self.0.request.page_token.clone();
25349 let execute = move |token: String| {
25350 let mut builder = self.clone();
25351 builder.0.request = builder.0.request.set_page_token(token);
25352 builder.send()
25353 };
25354 google_cloud_gax::paginator::internal::new_paginator(token, execute)
25355 }
25356
25357 pub fn by_item(
25359 self,
25360 ) -> impl google_cloud_gax::paginator::ItemPaginator<
25361 google_cloud_location::model::ListLocationsResponse,
25362 crate::Error,
25363 > {
25364 use google_cloud_gax::paginator::Paginator;
25365 self.by_page().items()
25366 }
25367
25368 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25370 self.0.request.name = v.into();
25371 self
25372 }
25373
25374 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
25376 self.0.request.filter = v.into();
25377 self
25378 }
25379
25380 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
25382 self.0.request.page_size = v.into();
25383 self
25384 }
25385
25386 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
25388 self.0.request.page_token = v.into();
25389 self
25390 }
25391 }
25392
25393 #[doc(hidden)]
25394 impl crate::RequestBuilder for ListLocations {
25395 fn request_options(&mut self) -> &mut crate::RequestOptions {
25396 &mut self.0.options
25397 }
25398 }
25399
25400 #[derive(Clone, Debug)]
25417 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
25418
25419 impl GetLocation {
25420 pub(crate) fn new(
25421 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25422 ) -> Self {
25423 Self(RequestBuilder::new(stub))
25424 }
25425
25426 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
25428 mut self,
25429 v: V,
25430 ) -> Self {
25431 self.0.request = v.into();
25432 self
25433 }
25434
25435 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25437 self.0.options = v.into();
25438 self
25439 }
25440
25441 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
25443 (*self.0.stub)
25444 .get_location(self.0.request, self.0.options)
25445 .await
25446 .map(crate::Response::into_body)
25447 }
25448
25449 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25451 self.0.request.name = v.into();
25452 self
25453 }
25454 }
25455
25456 #[doc(hidden)]
25457 impl crate::RequestBuilder for GetLocation {
25458 fn request_options(&mut self) -> &mut crate::RequestOptions {
25459 &mut self.0.options
25460 }
25461 }
25462
25463 #[derive(Clone, Debug)]
25480 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
25481
25482 impl SetIamPolicy {
25483 pub(crate) fn new(
25484 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25485 ) -> Self {
25486 Self(RequestBuilder::new(stub))
25487 }
25488
25489 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
25491 mut self,
25492 v: V,
25493 ) -> Self {
25494 self.0.request = v.into();
25495 self
25496 }
25497
25498 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25500 self.0.options = v.into();
25501 self
25502 }
25503
25504 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
25506 (*self.0.stub)
25507 .set_iam_policy(self.0.request, self.0.options)
25508 .await
25509 .map(crate::Response::into_body)
25510 }
25511
25512 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
25516 self.0.request.resource = v.into();
25517 self
25518 }
25519
25520 pub fn set_policy<T>(mut self, v: T) -> Self
25524 where
25525 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
25526 {
25527 self.0.request.policy = std::option::Option::Some(v.into());
25528 self
25529 }
25530
25531 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
25535 where
25536 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
25537 {
25538 self.0.request.policy = v.map(|x| x.into());
25539 self
25540 }
25541
25542 pub fn set_update_mask<T>(mut self, v: T) -> Self
25544 where
25545 T: std::convert::Into<wkt::FieldMask>,
25546 {
25547 self.0.request.update_mask = std::option::Option::Some(v.into());
25548 self
25549 }
25550
25551 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
25553 where
25554 T: std::convert::Into<wkt::FieldMask>,
25555 {
25556 self.0.request.update_mask = v.map(|x| x.into());
25557 self
25558 }
25559 }
25560
25561 #[doc(hidden)]
25562 impl crate::RequestBuilder for SetIamPolicy {
25563 fn request_options(&mut self) -> &mut crate::RequestOptions {
25564 &mut self.0.options
25565 }
25566 }
25567
25568 #[derive(Clone, Debug)]
25585 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
25586
25587 impl GetIamPolicy {
25588 pub(crate) fn new(
25589 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25590 ) -> Self {
25591 Self(RequestBuilder::new(stub))
25592 }
25593
25594 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
25596 mut self,
25597 v: V,
25598 ) -> Self {
25599 self.0.request = v.into();
25600 self
25601 }
25602
25603 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25605 self.0.options = v.into();
25606 self
25607 }
25608
25609 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
25611 (*self.0.stub)
25612 .get_iam_policy(self.0.request, self.0.options)
25613 .await
25614 .map(crate::Response::into_body)
25615 }
25616
25617 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
25621 self.0.request.resource = v.into();
25622 self
25623 }
25624
25625 pub fn set_options<T>(mut self, v: T) -> Self
25627 where
25628 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
25629 {
25630 self.0.request.options = std::option::Option::Some(v.into());
25631 self
25632 }
25633
25634 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
25636 where
25637 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
25638 {
25639 self.0.request.options = v.map(|x| x.into());
25640 self
25641 }
25642 }
25643
25644 #[doc(hidden)]
25645 impl crate::RequestBuilder for GetIamPolicy {
25646 fn request_options(&mut self) -> &mut crate::RequestOptions {
25647 &mut self.0.options
25648 }
25649 }
25650
25651 #[derive(Clone, Debug)]
25668 pub struct TestIamPermissions(
25669 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
25670 );
25671
25672 impl TestIamPermissions {
25673 pub(crate) fn new(
25674 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25675 ) -> Self {
25676 Self(RequestBuilder::new(stub))
25677 }
25678
25679 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
25681 mut self,
25682 v: V,
25683 ) -> Self {
25684 self.0.request = v.into();
25685 self
25686 }
25687
25688 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25690 self.0.options = v.into();
25691 self
25692 }
25693
25694 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
25696 (*self.0.stub)
25697 .test_iam_permissions(self.0.request, self.0.options)
25698 .await
25699 .map(crate::Response::into_body)
25700 }
25701
25702 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
25706 self.0.request.resource = v.into();
25707 self
25708 }
25709
25710 pub fn set_permissions<T, V>(mut self, v: T) -> Self
25714 where
25715 T: std::iter::IntoIterator<Item = V>,
25716 V: std::convert::Into<std::string::String>,
25717 {
25718 use std::iter::Iterator;
25719 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
25720 self
25721 }
25722 }
25723
25724 #[doc(hidden)]
25725 impl crate::RequestBuilder for TestIamPermissions {
25726 fn request_options(&mut self) -> &mut crate::RequestOptions {
25727 &mut self.0.options
25728 }
25729 }
25730
25731 #[derive(Clone, Debug)]
25752 pub struct ListOperations(
25753 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
25754 );
25755
25756 impl ListOperations {
25757 pub(crate) fn new(
25758 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25759 ) -> Self {
25760 Self(RequestBuilder::new(stub))
25761 }
25762
25763 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
25765 mut self,
25766 v: V,
25767 ) -> Self {
25768 self.0.request = v.into();
25769 self
25770 }
25771
25772 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25774 self.0.options = v.into();
25775 self
25776 }
25777
25778 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
25780 (*self.0.stub)
25781 .list_operations(self.0.request, self.0.options)
25782 .await
25783 .map(crate::Response::into_body)
25784 }
25785
25786 pub fn by_page(
25788 self,
25789 ) -> impl google_cloud_gax::paginator::Paginator<
25790 google_cloud_longrunning::model::ListOperationsResponse,
25791 crate::Error,
25792 > {
25793 use std::clone::Clone;
25794 let token = self.0.request.page_token.clone();
25795 let execute = move |token: String| {
25796 let mut builder = self.clone();
25797 builder.0.request = builder.0.request.set_page_token(token);
25798 builder.send()
25799 };
25800 google_cloud_gax::paginator::internal::new_paginator(token, execute)
25801 }
25802
25803 pub fn by_item(
25805 self,
25806 ) -> impl google_cloud_gax::paginator::ItemPaginator<
25807 google_cloud_longrunning::model::ListOperationsResponse,
25808 crate::Error,
25809 > {
25810 use google_cloud_gax::paginator::Paginator;
25811 self.by_page().items()
25812 }
25813
25814 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25816 self.0.request.name = v.into();
25817 self
25818 }
25819
25820 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
25822 self.0.request.filter = v.into();
25823 self
25824 }
25825
25826 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
25828 self.0.request.page_size = v.into();
25829 self
25830 }
25831
25832 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
25834 self.0.request.page_token = v.into();
25835 self
25836 }
25837
25838 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
25840 self.0.request.return_partial_success = v.into();
25841 self
25842 }
25843 }
25844
25845 #[doc(hidden)]
25846 impl crate::RequestBuilder for ListOperations {
25847 fn request_options(&mut self) -> &mut crate::RequestOptions {
25848 &mut self.0.options
25849 }
25850 }
25851
25852 #[derive(Clone, Debug)]
25869 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
25870
25871 impl GetOperation {
25872 pub(crate) fn new(
25873 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25874 ) -> Self {
25875 Self(RequestBuilder::new(stub))
25876 }
25877
25878 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
25880 mut self,
25881 v: V,
25882 ) -> Self {
25883 self.0.request = v.into();
25884 self
25885 }
25886
25887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25889 self.0.options = v.into();
25890 self
25891 }
25892
25893 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25895 (*self.0.stub)
25896 .get_operation(self.0.request, self.0.options)
25897 .await
25898 .map(crate::Response::into_body)
25899 }
25900
25901 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25903 self.0.request.name = v.into();
25904 self
25905 }
25906 }
25907
25908 #[doc(hidden)]
25909 impl crate::RequestBuilder for GetOperation {
25910 fn request_options(&mut self) -> &mut crate::RequestOptions {
25911 &mut self.0.options
25912 }
25913 }
25914
25915 #[derive(Clone, Debug)]
25932 pub struct DeleteOperation(
25933 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
25934 );
25935
25936 impl DeleteOperation {
25937 pub(crate) fn new(
25938 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25939 ) -> Self {
25940 Self(RequestBuilder::new(stub))
25941 }
25942
25943 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
25945 mut self,
25946 v: V,
25947 ) -> Self {
25948 self.0.request = v.into();
25949 self
25950 }
25951
25952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25954 self.0.options = v.into();
25955 self
25956 }
25957
25958 pub async fn send(self) -> Result<()> {
25960 (*self.0.stub)
25961 .delete_operation(self.0.request, self.0.options)
25962 .await
25963 .map(crate::Response::into_body)
25964 }
25965
25966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25968 self.0.request.name = v.into();
25969 self
25970 }
25971 }
25972
25973 #[doc(hidden)]
25974 impl crate::RequestBuilder for DeleteOperation {
25975 fn request_options(&mut self) -> &mut crate::RequestOptions {
25976 &mut self.0.options
25977 }
25978 }
25979
25980 #[derive(Clone, Debug)]
25997 pub struct CancelOperation(
25998 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
25999 );
26000
26001 impl CancelOperation {
26002 pub(crate) fn new(
26003 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26004 ) -> Self {
26005 Self(RequestBuilder::new(stub))
26006 }
26007
26008 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
26010 mut self,
26011 v: V,
26012 ) -> Self {
26013 self.0.request = v.into();
26014 self
26015 }
26016
26017 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26019 self.0.options = v.into();
26020 self
26021 }
26022
26023 pub async fn send(self) -> Result<()> {
26025 (*self.0.stub)
26026 .cancel_operation(self.0.request, self.0.options)
26027 .await
26028 .map(crate::Response::into_body)
26029 }
26030
26031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26033 self.0.request.name = v.into();
26034 self
26035 }
26036 }
26037
26038 #[doc(hidden)]
26039 impl crate::RequestBuilder for CancelOperation {
26040 fn request_options(&mut self) -> &mut crate::RequestOptions {
26041 &mut self.0.options
26042 }
26043 }
26044}