1pub mod address_group_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::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 gax::client_builder::internal::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 ) -> gax::client_builder::Result<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: gax::options::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: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
97
98 impl ListAddressGroups {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
107 mut self,
108 v: V,
109 ) -> Self {
110 self.0.request = v.into();
111 self
112 }
113
114 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116 self.0.options = v.into();
117 self
118 }
119
120 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
122 (*self.0.stub)
123 .list_address_groups(self.0.request, self.0.options)
124 .await
125 .map(gax::response::Response::into_body)
126 }
127
128 pub fn by_page(
130 self,
131 ) -> impl gax::paginator::Paginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
132 {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
147 {
148 use gax::paginator::Paginator;
149 self.by_page().items()
150 }
151
152 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
156 self.0.request.parent = v.into();
157 self
158 }
159
160 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
162 self.0.request.page_size = v.into();
163 self
164 }
165
166 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
168 self.0.request.page_token = v.into();
169 self
170 }
171
172 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
174 self.0.request.return_partial_success = v.into();
175 self
176 }
177 }
178
179 #[doc(hidden)]
180 impl gax::options::internal::RequestBuilder for ListAddressGroups {
181 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
182 &mut self.0.options
183 }
184 }
185
186 #[derive(Clone, Debug)]
204 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
205
206 impl GetAddressGroup {
207 pub(crate) fn new(
208 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
209 ) -> Self {
210 Self(RequestBuilder::new(stub))
211 }
212
213 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
215 self.0.request = v.into();
216 self
217 }
218
219 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
221 self.0.options = v.into();
222 self
223 }
224
225 pub async fn send(self) -> Result<crate::model::AddressGroup> {
227 (*self.0.stub)
228 .get_address_group(self.0.request, self.0.options)
229 .await
230 .map(gax::response::Response::into_body)
231 }
232
233 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
237 self.0.request.name = v.into();
238 self
239 }
240 }
241
242 #[doc(hidden)]
243 impl gax::options::internal::RequestBuilder for GetAddressGroup {
244 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
245 &mut self.0.options
246 }
247 }
248
249 #[derive(Clone, Debug)]
268 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
269
270 impl CreateAddressGroup {
271 pub(crate) fn new(
272 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
273 ) -> Self {
274 Self(RequestBuilder::new(stub))
275 }
276
277 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
279 mut self,
280 v: V,
281 ) -> Self {
282 self.0.request = v.into();
283 self
284 }
285
286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
288 self.0.options = v.into();
289 self
290 }
291
292 pub async fn send(self) -> Result<longrunning::model::Operation> {
299 (*self.0.stub)
300 .create_address_group(self.0.request, self.0.options)
301 .await
302 .map(gax::response::Response::into_body)
303 }
304
305 pub fn poller(
307 self,
308 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
309 type Operation = lro::internal::Operation<
310 crate::model::AddressGroup,
311 crate::model::OperationMetadata,
312 >;
313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
315
316 let stub = self.0.stub.clone();
317 let mut options = self.0.options.clone();
318 options.set_retry_policy(gax::retry_policy::NeverRetry);
319 let query = move |name| {
320 let stub = stub.clone();
321 let options = options.clone();
322 async {
323 let op = GetOperation::new(stub)
324 .set_name(name)
325 .with_options(options)
326 .send()
327 .await?;
328 Ok(Operation::new(op))
329 }
330 };
331
332 let start = move || async {
333 let op = self.send().await?;
334 Ok(Operation::new(op))
335 };
336
337 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
338 }
339
340 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
344 self.0.request.parent = v.into();
345 self
346 }
347
348 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
352 self.0.request.address_group_id = v.into();
353 self
354 }
355
356 pub fn set_address_group<T>(mut self, v: T) -> Self
360 where
361 T: std::convert::Into<crate::model::AddressGroup>,
362 {
363 self.0.request.address_group = std::option::Option::Some(v.into());
364 self
365 }
366
367 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
371 where
372 T: std::convert::Into<crate::model::AddressGroup>,
373 {
374 self.0.request.address_group = v.map(|x| x.into());
375 self
376 }
377
378 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
380 self.0.request.request_id = v.into();
381 self
382 }
383 }
384
385 #[doc(hidden)]
386 impl gax::options::internal::RequestBuilder for CreateAddressGroup {
387 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
388 &mut self.0.options
389 }
390 }
391
392 #[derive(Clone, Debug)]
411 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
412
413 impl UpdateAddressGroup {
414 pub(crate) fn new(
415 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
416 ) -> Self {
417 Self(RequestBuilder::new(stub))
418 }
419
420 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
422 mut self,
423 v: V,
424 ) -> Self {
425 self.0.request = v.into();
426 self
427 }
428
429 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
431 self.0.options = v.into();
432 self
433 }
434
435 pub async fn send(self) -> Result<longrunning::model::Operation> {
442 (*self.0.stub)
443 .update_address_group(self.0.request, self.0.options)
444 .await
445 .map(gax::response::Response::into_body)
446 }
447
448 pub fn poller(
450 self,
451 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
452 type Operation = lro::internal::Operation<
453 crate::model::AddressGroup,
454 crate::model::OperationMetadata,
455 >;
456 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
457 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
458
459 let stub = self.0.stub.clone();
460 let mut options = self.0.options.clone();
461 options.set_retry_policy(gax::retry_policy::NeverRetry);
462 let query = move |name| {
463 let stub = stub.clone();
464 let options = options.clone();
465 async {
466 let op = GetOperation::new(stub)
467 .set_name(name)
468 .with_options(options)
469 .send()
470 .await?;
471 Ok(Operation::new(op))
472 }
473 };
474
475 let start = move || async {
476 let op = self.send().await?;
477 Ok(Operation::new(op))
478 };
479
480 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
481 }
482
483 pub fn set_update_mask<T>(mut self, v: T) -> Self
485 where
486 T: std::convert::Into<wkt::FieldMask>,
487 {
488 self.0.request.update_mask = std::option::Option::Some(v.into());
489 self
490 }
491
492 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
494 where
495 T: std::convert::Into<wkt::FieldMask>,
496 {
497 self.0.request.update_mask = v.map(|x| x.into());
498 self
499 }
500
501 pub fn set_address_group<T>(mut self, v: T) -> Self
505 where
506 T: std::convert::Into<crate::model::AddressGroup>,
507 {
508 self.0.request.address_group = std::option::Option::Some(v.into());
509 self
510 }
511
512 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
516 where
517 T: std::convert::Into<crate::model::AddressGroup>,
518 {
519 self.0.request.address_group = v.map(|x| x.into());
520 self
521 }
522
523 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
525 self.0.request.request_id = v.into();
526 self
527 }
528 }
529
530 #[doc(hidden)]
531 impl gax::options::internal::RequestBuilder for UpdateAddressGroup {
532 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
533 &mut self.0.options
534 }
535 }
536
537 #[derive(Clone, Debug)]
556 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
557
558 impl AddAddressGroupItems {
559 pub(crate) fn new(
560 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
561 ) -> Self {
562 Self(RequestBuilder::new(stub))
563 }
564
565 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
567 mut self,
568 v: V,
569 ) -> Self {
570 self.0.request = v.into();
571 self
572 }
573
574 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
576 self.0.options = v.into();
577 self
578 }
579
580 pub async fn send(self) -> Result<longrunning::model::Operation> {
587 (*self.0.stub)
588 .add_address_group_items(self.0.request, self.0.options)
589 .await
590 .map(gax::response::Response::into_body)
591 }
592
593 pub fn poller(
595 self,
596 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
597 type Operation = lro::internal::Operation<
598 crate::model::AddressGroup,
599 crate::model::OperationMetadata,
600 >;
601 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
602 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
603
604 let stub = self.0.stub.clone();
605 let mut options = self.0.options.clone();
606 options.set_retry_policy(gax::retry_policy::NeverRetry);
607 let query = move |name| {
608 let stub = stub.clone();
609 let options = options.clone();
610 async {
611 let op = GetOperation::new(stub)
612 .set_name(name)
613 .with_options(options)
614 .send()
615 .await?;
616 Ok(Operation::new(op))
617 }
618 };
619
620 let start = move || async {
621 let op = self.send().await?;
622 Ok(Operation::new(op))
623 };
624
625 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
626 }
627
628 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
632 self.0.request.address_group = v.into();
633 self
634 }
635
636 pub fn set_items<T, V>(mut self, v: T) -> Self
640 where
641 T: std::iter::IntoIterator<Item = V>,
642 V: std::convert::Into<std::string::String>,
643 {
644 use std::iter::Iterator;
645 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
646 self
647 }
648
649 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
651 self.0.request.request_id = v.into();
652 self
653 }
654 }
655
656 #[doc(hidden)]
657 impl gax::options::internal::RequestBuilder for AddAddressGroupItems {
658 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
659 &mut self.0.options
660 }
661 }
662
663 #[derive(Clone, Debug)]
682 pub struct RemoveAddressGroupItems(
683 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
684 );
685
686 impl RemoveAddressGroupItems {
687 pub(crate) fn new(
688 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
689 ) -> Self {
690 Self(RequestBuilder::new(stub))
691 }
692
693 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
695 mut self,
696 v: V,
697 ) -> Self {
698 self.0.request = v.into();
699 self
700 }
701
702 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
704 self.0.options = v.into();
705 self
706 }
707
708 pub async fn send(self) -> Result<longrunning::model::Operation> {
715 (*self.0.stub)
716 .remove_address_group_items(self.0.request, self.0.options)
717 .await
718 .map(gax::response::Response::into_body)
719 }
720
721 pub fn poller(
723 self,
724 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
725 type Operation = lro::internal::Operation<
726 crate::model::AddressGroup,
727 crate::model::OperationMetadata,
728 >;
729 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
730 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
731
732 let stub = self.0.stub.clone();
733 let mut options = self.0.options.clone();
734 options.set_retry_policy(gax::retry_policy::NeverRetry);
735 let query = move |name| {
736 let stub = stub.clone();
737 let options = options.clone();
738 async {
739 let op = GetOperation::new(stub)
740 .set_name(name)
741 .with_options(options)
742 .send()
743 .await?;
744 Ok(Operation::new(op))
745 }
746 };
747
748 let start = move || async {
749 let op = self.send().await?;
750 Ok(Operation::new(op))
751 };
752
753 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
754 }
755
756 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
760 self.0.request.address_group = v.into();
761 self
762 }
763
764 pub fn set_items<T, V>(mut self, v: T) -> Self
768 where
769 T: std::iter::IntoIterator<Item = V>,
770 V: std::convert::Into<std::string::String>,
771 {
772 use std::iter::Iterator;
773 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
774 self
775 }
776
777 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
779 self.0.request.request_id = v.into();
780 self
781 }
782 }
783
784 #[doc(hidden)]
785 impl gax::options::internal::RequestBuilder for RemoveAddressGroupItems {
786 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
787 &mut self.0.options
788 }
789 }
790
791 #[derive(Clone, Debug)]
810 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
811
812 impl CloneAddressGroupItems {
813 pub(crate) fn new(
814 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
815 ) -> Self {
816 Self(RequestBuilder::new(stub))
817 }
818
819 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
821 mut self,
822 v: V,
823 ) -> Self {
824 self.0.request = v.into();
825 self
826 }
827
828 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
830 self.0.options = v.into();
831 self
832 }
833
834 pub async fn send(self) -> Result<longrunning::model::Operation> {
841 (*self.0.stub)
842 .clone_address_group_items(self.0.request, self.0.options)
843 .await
844 .map(gax::response::Response::into_body)
845 }
846
847 pub fn poller(
849 self,
850 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
851 type Operation = lro::internal::Operation<
852 crate::model::AddressGroup,
853 crate::model::OperationMetadata,
854 >;
855 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
856 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
857
858 let stub = self.0.stub.clone();
859 let mut options = self.0.options.clone();
860 options.set_retry_policy(gax::retry_policy::NeverRetry);
861 let query = move |name| {
862 let stub = stub.clone();
863 let options = options.clone();
864 async {
865 let op = GetOperation::new(stub)
866 .set_name(name)
867 .with_options(options)
868 .send()
869 .await?;
870 Ok(Operation::new(op))
871 }
872 };
873
874 let start = move || async {
875 let op = self.send().await?;
876 Ok(Operation::new(op))
877 };
878
879 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
880 }
881
882 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
886 self.0.request.address_group = v.into();
887 self
888 }
889
890 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
894 self.0.request.source_address_group = v.into();
895 self
896 }
897
898 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
900 self.0.request.request_id = v.into();
901 self
902 }
903 }
904
905 #[doc(hidden)]
906 impl gax::options::internal::RequestBuilder for CloneAddressGroupItems {
907 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
908 &mut self.0.options
909 }
910 }
911
912 #[derive(Clone, Debug)]
931 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
932
933 impl DeleteAddressGroup {
934 pub(crate) fn new(
935 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
936 ) -> Self {
937 Self(RequestBuilder::new(stub))
938 }
939
940 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
942 mut self,
943 v: V,
944 ) -> Self {
945 self.0.request = v.into();
946 self
947 }
948
949 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
951 self.0.options = v.into();
952 self
953 }
954
955 pub async fn send(self) -> Result<longrunning::model::Operation> {
962 (*self.0.stub)
963 .delete_address_group(self.0.request, self.0.options)
964 .await
965 .map(gax::response::Response::into_body)
966 }
967
968 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
970 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
971 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
972 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
973
974 let stub = self.0.stub.clone();
975 let mut options = self.0.options.clone();
976 options.set_retry_policy(gax::retry_policy::NeverRetry);
977 let query = move |name| {
978 let stub = stub.clone();
979 let options = options.clone();
980 async {
981 let op = GetOperation::new(stub)
982 .set_name(name)
983 .with_options(options)
984 .send()
985 .await?;
986 Ok(Operation::new(op))
987 }
988 };
989
990 let start = move || async {
991 let op = self.send().await?;
992 Ok(Operation::new(op))
993 };
994
995 lro::internal::new_unit_response_poller(
996 polling_error_policy,
997 polling_backoff_policy,
998 start,
999 query,
1000 )
1001 }
1002
1003 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1007 self.0.request.name = v.into();
1008 self
1009 }
1010
1011 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1013 self.0.request.request_id = v.into();
1014 self
1015 }
1016 }
1017
1018 #[doc(hidden)]
1019 impl gax::options::internal::RequestBuilder for DeleteAddressGroup {
1020 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1021 &mut self.0.options
1022 }
1023 }
1024
1025 #[derive(Clone, Debug)]
1047 pub struct ListAddressGroupReferences(
1048 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1049 );
1050
1051 impl ListAddressGroupReferences {
1052 pub(crate) fn new(
1053 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1054 ) -> Self {
1055 Self(RequestBuilder::new(stub))
1056 }
1057
1058 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1060 mut self,
1061 v: V,
1062 ) -> Self {
1063 self.0.request = v.into();
1064 self
1065 }
1066
1067 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1069 self.0.options = v.into();
1070 self
1071 }
1072
1073 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1075 (*self.0.stub)
1076 .list_address_group_references(self.0.request, self.0.options)
1077 .await
1078 .map(gax::response::Response::into_body)
1079 }
1080
1081 pub fn by_page(
1083 self,
1084 ) -> impl gax::paginator::Paginator<
1085 crate::model::ListAddressGroupReferencesResponse,
1086 gax::error::Error,
1087 > {
1088 use std::clone::Clone;
1089 let token = self.0.request.page_token.clone();
1090 let execute = move |token: String| {
1091 let mut builder = self.clone();
1092 builder.0.request = builder.0.request.set_page_token(token);
1093 builder.send()
1094 };
1095 gax::paginator::internal::new_paginator(token, execute)
1096 }
1097
1098 pub fn by_item(
1100 self,
1101 ) -> impl gax::paginator::ItemPaginator<
1102 crate::model::ListAddressGroupReferencesResponse,
1103 gax::error::Error,
1104 > {
1105 use gax::paginator::Paginator;
1106 self.by_page().items()
1107 }
1108
1109 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1113 self.0.request.address_group = v.into();
1114 self
1115 }
1116
1117 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1119 self.0.request.page_size = v.into();
1120 self
1121 }
1122
1123 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1125 self.0.request.page_token = v.into();
1126 self
1127 }
1128 }
1129
1130 #[doc(hidden)]
1131 impl gax::options::internal::RequestBuilder for ListAddressGroupReferences {
1132 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1133 &mut self.0.options
1134 }
1135 }
1136
1137 #[derive(Clone, Debug)]
1159 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1160
1161 impl ListLocations {
1162 pub(crate) fn new(
1163 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1164 ) -> Self {
1165 Self(RequestBuilder::new(stub))
1166 }
1167
1168 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1170 mut self,
1171 v: V,
1172 ) -> Self {
1173 self.0.request = v.into();
1174 self
1175 }
1176
1177 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1179 self.0.options = v.into();
1180 self
1181 }
1182
1183 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1185 (*self.0.stub)
1186 .list_locations(self.0.request, self.0.options)
1187 .await
1188 .map(gax::response::Response::into_body)
1189 }
1190
1191 pub fn by_page(
1193 self,
1194 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1195 {
1196 use std::clone::Clone;
1197 let token = self.0.request.page_token.clone();
1198 let execute = move |token: String| {
1199 let mut builder = self.clone();
1200 builder.0.request = builder.0.request.set_page_token(token);
1201 builder.send()
1202 };
1203 gax::paginator::internal::new_paginator(token, execute)
1204 }
1205
1206 pub fn by_item(
1208 self,
1209 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1210 {
1211 use gax::paginator::Paginator;
1212 self.by_page().items()
1213 }
1214
1215 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1217 self.0.request.name = v.into();
1218 self
1219 }
1220
1221 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1223 self.0.request.filter = v.into();
1224 self
1225 }
1226
1227 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1229 self.0.request.page_size = v.into();
1230 self
1231 }
1232
1233 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1235 self.0.request.page_token = v.into();
1236 self
1237 }
1238 }
1239
1240 #[doc(hidden)]
1241 impl gax::options::internal::RequestBuilder for ListLocations {
1242 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1243 &mut self.0.options
1244 }
1245 }
1246
1247 #[derive(Clone, Debug)]
1265 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1266
1267 impl GetLocation {
1268 pub(crate) fn new(
1269 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1270 ) -> Self {
1271 Self(RequestBuilder::new(stub))
1272 }
1273
1274 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1276 self.0.request = v.into();
1277 self
1278 }
1279
1280 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1282 self.0.options = v.into();
1283 self
1284 }
1285
1286 pub async fn send(self) -> Result<location::model::Location> {
1288 (*self.0.stub)
1289 .get_location(self.0.request, self.0.options)
1290 .await
1291 .map(gax::response::Response::into_body)
1292 }
1293
1294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1296 self.0.request.name = v.into();
1297 self
1298 }
1299 }
1300
1301 #[doc(hidden)]
1302 impl gax::options::internal::RequestBuilder for GetLocation {
1303 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1304 &mut self.0.options
1305 }
1306 }
1307
1308 #[derive(Clone, Debug)]
1326 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1327
1328 impl SetIamPolicy {
1329 pub(crate) fn new(
1330 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1331 ) -> Self {
1332 Self(RequestBuilder::new(stub))
1333 }
1334
1335 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1337 self.0.request = v.into();
1338 self
1339 }
1340
1341 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1343 self.0.options = v.into();
1344 self
1345 }
1346
1347 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1349 (*self.0.stub)
1350 .set_iam_policy(self.0.request, self.0.options)
1351 .await
1352 .map(gax::response::Response::into_body)
1353 }
1354
1355 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1359 self.0.request.resource = v.into();
1360 self
1361 }
1362
1363 pub fn set_policy<T>(mut self, v: T) -> Self
1367 where
1368 T: std::convert::Into<iam_v1::model::Policy>,
1369 {
1370 self.0.request.policy = std::option::Option::Some(v.into());
1371 self
1372 }
1373
1374 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1378 where
1379 T: std::convert::Into<iam_v1::model::Policy>,
1380 {
1381 self.0.request.policy = v.map(|x| x.into());
1382 self
1383 }
1384
1385 pub fn set_update_mask<T>(mut self, v: T) -> Self
1387 where
1388 T: std::convert::Into<wkt::FieldMask>,
1389 {
1390 self.0.request.update_mask = std::option::Option::Some(v.into());
1391 self
1392 }
1393
1394 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1396 where
1397 T: std::convert::Into<wkt::FieldMask>,
1398 {
1399 self.0.request.update_mask = v.map(|x| x.into());
1400 self
1401 }
1402 }
1403
1404 #[doc(hidden)]
1405 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1406 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1407 &mut self.0.options
1408 }
1409 }
1410
1411 #[derive(Clone, Debug)]
1429 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1430
1431 impl GetIamPolicy {
1432 pub(crate) fn new(
1433 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1434 ) -> Self {
1435 Self(RequestBuilder::new(stub))
1436 }
1437
1438 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1440 self.0.request = v.into();
1441 self
1442 }
1443
1444 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1446 self.0.options = v.into();
1447 self
1448 }
1449
1450 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1452 (*self.0.stub)
1453 .get_iam_policy(self.0.request, self.0.options)
1454 .await
1455 .map(gax::response::Response::into_body)
1456 }
1457
1458 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462 self.0.request.resource = v.into();
1463 self
1464 }
1465
1466 pub fn set_options<T>(mut self, v: T) -> Self
1468 where
1469 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1470 {
1471 self.0.request.options = std::option::Option::Some(v.into());
1472 self
1473 }
1474
1475 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1477 where
1478 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1479 {
1480 self.0.request.options = v.map(|x| x.into());
1481 self
1482 }
1483 }
1484
1485 #[doc(hidden)]
1486 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1487 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1488 &mut self.0.options
1489 }
1490 }
1491
1492 #[derive(Clone, Debug)]
1510 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1511
1512 impl TestIamPermissions {
1513 pub(crate) fn new(
1514 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1515 ) -> Self {
1516 Self(RequestBuilder::new(stub))
1517 }
1518
1519 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1521 mut self,
1522 v: V,
1523 ) -> Self {
1524 self.0.request = v.into();
1525 self
1526 }
1527
1528 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1530 self.0.options = v.into();
1531 self
1532 }
1533
1534 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1536 (*self.0.stub)
1537 .test_iam_permissions(self.0.request, self.0.options)
1538 .await
1539 .map(gax::response::Response::into_body)
1540 }
1541
1542 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.resource = v.into();
1547 self
1548 }
1549
1550 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1554 where
1555 T: std::iter::IntoIterator<Item = V>,
1556 V: std::convert::Into<std::string::String>,
1557 {
1558 use std::iter::Iterator;
1559 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1560 self
1561 }
1562 }
1563
1564 #[doc(hidden)]
1565 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1566 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1567 &mut self.0.options
1568 }
1569 }
1570
1571 #[derive(Clone, Debug)]
1593 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1594
1595 impl ListOperations {
1596 pub(crate) fn new(
1597 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1598 ) -> Self {
1599 Self(RequestBuilder::new(stub))
1600 }
1601
1602 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1604 mut self,
1605 v: V,
1606 ) -> Self {
1607 self.0.request = v.into();
1608 self
1609 }
1610
1611 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1613 self.0.options = v.into();
1614 self
1615 }
1616
1617 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1619 (*self.0.stub)
1620 .list_operations(self.0.request, self.0.options)
1621 .await
1622 .map(gax::response::Response::into_body)
1623 }
1624
1625 pub fn by_page(
1627 self,
1628 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1629 {
1630 use std::clone::Clone;
1631 let token = self.0.request.page_token.clone();
1632 let execute = move |token: String| {
1633 let mut builder = self.clone();
1634 builder.0.request = builder.0.request.set_page_token(token);
1635 builder.send()
1636 };
1637 gax::paginator::internal::new_paginator(token, execute)
1638 }
1639
1640 pub fn by_item(
1642 self,
1643 ) -> impl gax::paginator::ItemPaginator<
1644 longrunning::model::ListOperationsResponse,
1645 gax::error::Error,
1646 > {
1647 use gax::paginator::Paginator;
1648 self.by_page().items()
1649 }
1650
1651 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1653 self.0.request.name = v.into();
1654 self
1655 }
1656
1657 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1659 self.0.request.filter = v.into();
1660 self
1661 }
1662
1663 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1665 self.0.request.page_size = v.into();
1666 self
1667 }
1668
1669 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1671 self.0.request.page_token = v.into();
1672 self
1673 }
1674
1675 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1677 self.0.request.return_partial_success = v.into();
1678 self
1679 }
1680 }
1681
1682 #[doc(hidden)]
1683 impl gax::options::internal::RequestBuilder for ListOperations {
1684 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1685 &mut self.0.options
1686 }
1687 }
1688
1689 #[derive(Clone, Debug)]
1707 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1708
1709 impl GetOperation {
1710 pub(crate) fn new(
1711 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1712 ) -> Self {
1713 Self(RequestBuilder::new(stub))
1714 }
1715
1716 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1718 mut self,
1719 v: V,
1720 ) -> Self {
1721 self.0.request = v.into();
1722 self
1723 }
1724
1725 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1727 self.0.options = v.into();
1728 self
1729 }
1730
1731 pub async fn send(self) -> Result<longrunning::model::Operation> {
1733 (*self.0.stub)
1734 .get_operation(self.0.request, self.0.options)
1735 .await
1736 .map(gax::response::Response::into_body)
1737 }
1738
1739 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1741 self.0.request.name = v.into();
1742 self
1743 }
1744 }
1745
1746 #[doc(hidden)]
1747 impl gax::options::internal::RequestBuilder for GetOperation {
1748 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1749 &mut self.0.options
1750 }
1751 }
1752
1753 #[derive(Clone, Debug)]
1771 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1772
1773 impl DeleteOperation {
1774 pub(crate) fn new(
1775 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1776 ) -> Self {
1777 Self(RequestBuilder::new(stub))
1778 }
1779
1780 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1782 mut self,
1783 v: V,
1784 ) -> Self {
1785 self.0.request = v.into();
1786 self
1787 }
1788
1789 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1791 self.0.options = v.into();
1792 self
1793 }
1794
1795 pub async fn send(self) -> Result<()> {
1797 (*self.0.stub)
1798 .delete_operation(self.0.request, self.0.options)
1799 .await
1800 .map(gax::response::Response::into_body)
1801 }
1802
1803 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805 self.0.request.name = v.into();
1806 self
1807 }
1808 }
1809
1810 #[doc(hidden)]
1811 impl gax::options::internal::RequestBuilder for DeleteOperation {
1812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1813 &mut self.0.options
1814 }
1815 }
1816
1817 #[derive(Clone, Debug)]
1835 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1836
1837 impl CancelOperation {
1838 pub(crate) fn new(
1839 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1840 ) -> Self {
1841 Self(RequestBuilder::new(stub))
1842 }
1843
1844 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1846 mut self,
1847 v: V,
1848 ) -> Self {
1849 self.0.request = v.into();
1850 self
1851 }
1852
1853 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1855 self.0.options = v.into();
1856 self
1857 }
1858
1859 pub async fn send(self) -> Result<()> {
1861 (*self.0.stub)
1862 .cancel_operation(self.0.request, self.0.options)
1863 .await
1864 .map(gax::response::Response::into_body)
1865 }
1866
1867 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1869 self.0.request.name = v.into();
1870 self
1871 }
1872 }
1873
1874 #[doc(hidden)]
1875 impl gax::options::internal::RequestBuilder for CancelOperation {
1876 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1877 &mut self.0.options
1878 }
1879 }
1880}
1881
1882pub mod organization_address_group_service {
1883 use crate::Result;
1884
1885 pub type ClientBuilder =
1899 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1900
1901 pub(crate) mod client {
1902 use super::super::super::client::OrganizationAddressGroupService;
1903 pub struct Factory;
1904 impl gax::client_builder::internal::ClientFactory for Factory {
1905 type Client = OrganizationAddressGroupService;
1906 type Credentials = gaxi::options::Credentials;
1907 async fn build(
1908 self,
1909 config: gaxi::options::ClientConfig,
1910 ) -> gax::client_builder::Result<Self::Client> {
1911 Self::Client::new(config).await
1912 }
1913 }
1914 }
1915
1916 #[derive(Clone, Debug)]
1918 pub(crate) struct RequestBuilder<R: std::default::Default> {
1919 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1920 request: R,
1921 options: gax::options::RequestOptions,
1922 }
1923
1924 impl<R> RequestBuilder<R>
1925 where
1926 R: std::default::Default,
1927 {
1928 pub(crate) fn new(
1929 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1930 ) -> Self {
1931 Self {
1932 stub,
1933 request: R::default(),
1934 options: gax::options::RequestOptions::default(),
1935 }
1936 }
1937 }
1938
1939 #[derive(Clone, Debug)]
1961 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
1962
1963 impl ListAddressGroups {
1964 pub(crate) fn new(
1965 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1966 ) -> Self {
1967 Self(RequestBuilder::new(stub))
1968 }
1969
1970 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
1972 mut self,
1973 v: V,
1974 ) -> Self {
1975 self.0.request = v.into();
1976 self
1977 }
1978
1979 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1981 self.0.options = v.into();
1982 self
1983 }
1984
1985 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
1987 (*self.0.stub)
1988 .list_address_groups(self.0.request, self.0.options)
1989 .await
1990 .map(gax::response::Response::into_body)
1991 }
1992
1993 pub fn by_page(
1995 self,
1996 ) -> impl gax::paginator::Paginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
1997 {
1998 use std::clone::Clone;
1999 let token = self.0.request.page_token.clone();
2000 let execute = move |token: String| {
2001 let mut builder = self.clone();
2002 builder.0.request = builder.0.request.set_page_token(token);
2003 builder.send()
2004 };
2005 gax::paginator::internal::new_paginator(token, execute)
2006 }
2007
2008 pub fn by_item(
2010 self,
2011 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
2012 {
2013 use gax::paginator::Paginator;
2014 self.by_page().items()
2015 }
2016
2017 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2021 self.0.request.parent = v.into();
2022 self
2023 }
2024
2025 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2027 self.0.request.page_size = v.into();
2028 self
2029 }
2030
2031 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.0.request.page_token = v.into();
2034 self
2035 }
2036
2037 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2039 self.0.request.return_partial_success = v.into();
2040 self
2041 }
2042 }
2043
2044 #[doc(hidden)]
2045 impl gax::options::internal::RequestBuilder for ListAddressGroups {
2046 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2047 &mut self.0.options
2048 }
2049 }
2050
2051 #[derive(Clone, Debug)]
2069 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2070
2071 impl GetAddressGroup {
2072 pub(crate) fn new(
2073 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2074 ) -> Self {
2075 Self(RequestBuilder::new(stub))
2076 }
2077
2078 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2080 self.0.request = v.into();
2081 self
2082 }
2083
2084 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2086 self.0.options = v.into();
2087 self
2088 }
2089
2090 pub async fn send(self) -> Result<crate::model::AddressGroup> {
2092 (*self.0.stub)
2093 .get_address_group(self.0.request, self.0.options)
2094 .await
2095 .map(gax::response::Response::into_body)
2096 }
2097
2098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102 self.0.request.name = v.into();
2103 self
2104 }
2105 }
2106
2107 #[doc(hidden)]
2108 impl gax::options::internal::RequestBuilder for GetAddressGroup {
2109 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2110 &mut self.0.options
2111 }
2112 }
2113
2114 #[derive(Clone, Debug)]
2133 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2134
2135 impl CreateAddressGroup {
2136 pub(crate) fn new(
2137 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2138 ) -> Self {
2139 Self(RequestBuilder::new(stub))
2140 }
2141
2142 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2144 mut self,
2145 v: V,
2146 ) -> Self {
2147 self.0.request = v.into();
2148 self
2149 }
2150
2151 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2153 self.0.options = v.into();
2154 self
2155 }
2156
2157 pub async fn send(self) -> Result<longrunning::model::Operation> {
2164 (*self.0.stub)
2165 .create_address_group(self.0.request, self.0.options)
2166 .await
2167 .map(gax::response::Response::into_body)
2168 }
2169
2170 pub fn poller(
2172 self,
2173 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2174 type Operation = lro::internal::Operation<
2175 crate::model::AddressGroup,
2176 crate::model::OperationMetadata,
2177 >;
2178 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2179 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2180
2181 let stub = self.0.stub.clone();
2182 let mut options = self.0.options.clone();
2183 options.set_retry_policy(gax::retry_policy::NeverRetry);
2184 let query = move |name| {
2185 let stub = stub.clone();
2186 let options = options.clone();
2187 async {
2188 let op = GetOperation::new(stub)
2189 .set_name(name)
2190 .with_options(options)
2191 .send()
2192 .await?;
2193 Ok(Operation::new(op))
2194 }
2195 };
2196
2197 let start = move || async {
2198 let op = self.send().await?;
2199 Ok(Operation::new(op))
2200 };
2201
2202 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2203 }
2204
2205 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209 self.0.request.parent = v.into();
2210 self
2211 }
2212
2213 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2217 self.0.request.address_group_id = v.into();
2218 self
2219 }
2220
2221 pub fn set_address_group<T>(mut self, v: T) -> Self
2225 where
2226 T: std::convert::Into<crate::model::AddressGroup>,
2227 {
2228 self.0.request.address_group = std::option::Option::Some(v.into());
2229 self
2230 }
2231
2232 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2236 where
2237 T: std::convert::Into<crate::model::AddressGroup>,
2238 {
2239 self.0.request.address_group = v.map(|x| x.into());
2240 self
2241 }
2242
2243 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2245 self.0.request.request_id = v.into();
2246 self
2247 }
2248 }
2249
2250 #[doc(hidden)]
2251 impl gax::options::internal::RequestBuilder for CreateAddressGroup {
2252 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2253 &mut self.0.options
2254 }
2255 }
2256
2257 #[derive(Clone, Debug)]
2276 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2277
2278 impl UpdateAddressGroup {
2279 pub(crate) fn new(
2280 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2281 ) -> Self {
2282 Self(RequestBuilder::new(stub))
2283 }
2284
2285 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2287 mut self,
2288 v: V,
2289 ) -> Self {
2290 self.0.request = v.into();
2291 self
2292 }
2293
2294 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2296 self.0.options = v.into();
2297 self
2298 }
2299
2300 pub async fn send(self) -> Result<longrunning::model::Operation> {
2307 (*self.0.stub)
2308 .update_address_group(self.0.request, self.0.options)
2309 .await
2310 .map(gax::response::Response::into_body)
2311 }
2312
2313 pub fn poller(
2315 self,
2316 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2317 type Operation = lro::internal::Operation<
2318 crate::model::AddressGroup,
2319 crate::model::OperationMetadata,
2320 >;
2321 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2322 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2323
2324 let stub = self.0.stub.clone();
2325 let mut options = self.0.options.clone();
2326 options.set_retry_policy(gax::retry_policy::NeverRetry);
2327 let query = move |name| {
2328 let stub = stub.clone();
2329 let options = options.clone();
2330 async {
2331 let op = GetOperation::new(stub)
2332 .set_name(name)
2333 .with_options(options)
2334 .send()
2335 .await?;
2336 Ok(Operation::new(op))
2337 }
2338 };
2339
2340 let start = move || async {
2341 let op = self.send().await?;
2342 Ok(Operation::new(op))
2343 };
2344
2345 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2346 }
2347
2348 pub fn set_update_mask<T>(mut self, v: T) -> Self
2350 where
2351 T: std::convert::Into<wkt::FieldMask>,
2352 {
2353 self.0.request.update_mask = std::option::Option::Some(v.into());
2354 self
2355 }
2356
2357 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2359 where
2360 T: std::convert::Into<wkt::FieldMask>,
2361 {
2362 self.0.request.update_mask = v.map(|x| x.into());
2363 self
2364 }
2365
2366 pub fn set_address_group<T>(mut self, v: T) -> Self
2370 where
2371 T: std::convert::Into<crate::model::AddressGroup>,
2372 {
2373 self.0.request.address_group = std::option::Option::Some(v.into());
2374 self
2375 }
2376
2377 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2381 where
2382 T: std::convert::Into<crate::model::AddressGroup>,
2383 {
2384 self.0.request.address_group = v.map(|x| x.into());
2385 self
2386 }
2387
2388 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2390 self.0.request.request_id = v.into();
2391 self
2392 }
2393 }
2394
2395 #[doc(hidden)]
2396 impl gax::options::internal::RequestBuilder for UpdateAddressGroup {
2397 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2398 &mut self.0.options
2399 }
2400 }
2401
2402 #[derive(Clone, Debug)]
2421 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2422
2423 impl AddAddressGroupItems {
2424 pub(crate) fn new(
2425 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2426 ) -> Self {
2427 Self(RequestBuilder::new(stub))
2428 }
2429
2430 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2432 mut self,
2433 v: V,
2434 ) -> Self {
2435 self.0.request = v.into();
2436 self
2437 }
2438
2439 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2441 self.0.options = v.into();
2442 self
2443 }
2444
2445 pub async fn send(self) -> Result<longrunning::model::Operation> {
2452 (*self.0.stub)
2453 .add_address_group_items(self.0.request, self.0.options)
2454 .await
2455 .map(gax::response::Response::into_body)
2456 }
2457
2458 pub fn poller(
2460 self,
2461 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2462 type Operation = lro::internal::Operation<
2463 crate::model::AddressGroup,
2464 crate::model::OperationMetadata,
2465 >;
2466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2468
2469 let stub = self.0.stub.clone();
2470 let mut options = self.0.options.clone();
2471 options.set_retry_policy(gax::retry_policy::NeverRetry);
2472 let query = move |name| {
2473 let stub = stub.clone();
2474 let options = options.clone();
2475 async {
2476 let op = GetOperation::new(stub)
2477 .set_name(name)
2478 .with_options(options)
2479 .send()
2480 .await?;
2481 Ok(Operation::new(op))
2482 }
2483 };
2484
2485 let start = move || async {
2486 let op = self.send().await?;
2487 Ok(Operation::new(op))
2488 };
2489
2490 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2491 }
2492
2493 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2497 self.0.request.address_group = v.into();
2498 self
2499 }
2500
2501 pub fn set_items<T, V>(mut self, v: T) -> Self
2505 where
2506 T: std::iter::IntoIterator<Item = V>,
2507 V: std::convert::Into<std::string::String>,
2508 {
2509 use std::iter::Iterator;
2510 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2511 self
2512 }
2513
2514 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2516 self.0.request.request_id = v.into();
2517 self
2518 }
2519 }
2520
2521 #[doc(hidden)]
2522 impl gax::options::internal::RequestBuilder for AddAddressGroupItems {
2523 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2524 &mut self.0.options
2525 }
2526 }
2527
2528 #[derive(Clone, Debug)]
2547 pub struct RemoveAddressGroupItems(
2548 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2549 );
2550
2551 impl RemoveAddressGroupItems {
2552 pub(crate) fn new(
2553 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2554 ) -> Self {
2555 Self(RequestBuilder::new(stub))
2556 }
2557
2558 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2560 mut self,
2561 v: V,
2562 ) -> Self {
2563 self.0.request = v.into();
2564 self
2565 }
2566
2567 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2569 self.0.options = v.into();
2570 self
2571 }
2572
2573 pub async fn send(self) -> Result<longrunning::model::Operation> {
2580 (*self.0.stub)
2581 .remove_address_group_items(self.0.request, self.0.options)
2582 .await
2583 .map(gax::response::Response::into_body)
2584 }
2585
2586 pub fn poller(
2588 self,
2589 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2590 type Operation = lro::internal::Operation<
2591 crate::model::AddressGroup,
2592 crate::model::OperationMetadata,
2593 >;
2594 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2595 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2596
2597 let stub = self.0.stub.clone();
2598 let mut options = self.0.options.clone();
2599 options.set_retry_policy(gax::retry_policy::NeverRetry);
2600 let query = move |name| {
2601 let stub = stub.clone();
2602 let options = options.clone();
2603 async {
2604 let op = GetOperation::new(stub)
2605 .set_name(name)
2606 .with_options(options)
2607 .send()
2608 .await?;
2609 Ok(Operation::new(op))
2610 }
2611 };
2612
2613 let start = move || async {
2614 let op = self.send().await?;
2615 Ok(Operation::new(op))
2616 };
2617
2618 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2619 }
2620
2621 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2625 self.0.request.address_group = v.into();
2626 self
2627 }
2628
2629 pub fn set_items<T, V>(mut self, v: T) -> Self
2633 where
2634 T: std::iter::IntoIterator<Item = V>,
2635 V: std::convert::Into<std::string::String>,
2636 {
2637 use std::iter::Iterator;
2638 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2639 self
2640 }
2641
2642 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2644 self.0.request.request_id = v.into();
2645 self
2646 }
2647 }
2648
2649 #[doc(hidden)]
2650 impl gax::options::internal::RequestBuilder for RemoveAddressGroupItems {
2651 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2652 &mut self.0.options
2653 }
2654 }
2655
2656 #[derive(Clone, Debug)]
2675 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2676
2677 impl CloneAddressGroupItems {
2678 pub(crate) fn new(
2679 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2680 ) -> Self {
2681 Self(RequestBuilder::new(stub))
2682 }
2683
2684 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2686 mut self,
2687 v: V,
2688 ) -> Self {
2689 self.0.request = v.into();
2690 self
2691 }
2692
2693 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2695 self.0.options = v.into();
2696 self
2697 }
2698
2699 pub async fn send(self) -> Result<longrunning::model::Operation> {
2706 (*self.0.stub)
2707 .clone_address_group_items(self.0.request, self.0.options)
2708 .await
2709 .map(gax::response::Response::into_body)
2710 }
2711
2712 pub fn poller(
2714 self,
2715 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2716 type Operation = lro::internal::Operation<
2717 crate::model::AddressGroup,
2718 crate::model::OperationMetadata,
2719 >;
2720 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2721 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2722
2723 let stub = self.0.stub.clone();
2724 let mut options = self.0.options.clone();
2725 options.set_retry_policy(gax::retry_policy::NeverRetry);
2726 let query = move |name| {
2727 let stub = stub.clone();
2728 let options = options.clone();
2729 async {
2730 let op = GetOperation::new(stub)
2731 .set_name(name)
2732 .with_options(options)
2733 .send()
2734 .await?;
2735 Ok(Operation::new(op))
2736 }
2737 };
2738
2739 let start = move || async {
2740 let op = self.send().await?;
2741 Ok(Operation::new(op))
2742 };
2743
2744 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2745 }
2746
2747 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2751 self.0.request.address_group = v.into();
2752 self
2753 }
2754
2755 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2759 self.0.request.source_address_group = v.into();
2760 self
2761 }
2762
2763 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2765 self.0.request.request_id = v.into();
2766 self
2767 }
2768 }
2769
2770 #[doc(hidden)]
2771 impl gax::options::internal::RequestBuilder for CloneAddressGroupItems {
2772 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2773 &mut self.0.options
2774 }
2775 }
2776
2777 #[derive(Clone, Debug)]
2796 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2797
2798 impl DeleteAddressGroup {
2799 pub(crate) fn new(
2800 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2801 ) -> Self {
2802 Self(RequestBuilder::new(stub))
2803 }
2804
2805 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2807 mut self,
2808 v: V,
2809 ) -> Self {
2810 self.0.request = v.into();
2811 self
2812 }
2813
2814 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2816 self.0.options = v.into();
2817 self
2818 }
2819
2820 pub async fn send(self) -> Result<longrunning::model::Operation> {
2827 (*self.0.stub)
2828 .delete_address_group(self.0.request, self.0.options)
2829 .await
2830 .map(gax::response::Response::into_body)
2831 }
2832
2833 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2835 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2836 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2837 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2838
2839 let stub = self.0.stub.clone();
2840 let mut options = self.0.options.clone();
2841 options.set_retry_policy(gax::retry_policy::NeverRetry);
2842 let query = move |name| {
2843 let stub = stub.clone();
2844 let options = options.clone();
2845 async {
2846 let op = GetOperation::new(stub)
2847 .set_name(name)
2848 .with_options(options)
2849 .send()
2850 .await?;
2851 Ok(Operation::new(op))
2852 }
2853 };
2854
2855 let start = move || async {
2856 let op = self.send().await?;
2857 Ok(Operation::new(op))
2858 };
2859
2860 lro::internal::new_unit_response_poller(
2861 polling_error_policy,
2862 polling_backoff_policy,
2863 start,
2864 query,
2865 )
2866 }
2867
2868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2872 self.0.request.name = v.into();
2873 self
2874 }
2875
2876 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2878 self.0.request.request_id = v.into();
2879 self
2880 }
2881 }
2882
2883 #[doc(hidden)]
2884 impl gax::options::internal::RequestBuilder for DeleteAddressGroup {
2885 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2886 &mut self.0.options
2887 }
2888 }
2889
2890 #[derive(Clone, Debug)]
2912 pub struct ListAddressGroupReferences(
2913 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2914 );
2915
2916 impl ListAddressGroupReferences {
2917 pub(crate) fn new(
2918 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2919 ) -> Self {
2920 Self(RequestBuilder::new(stub))
2921 }
2922
2923 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2925 mut self,
2926 v: V,
2927 ) -> Self {
2928 self.0.request = v.into();
2929 self
2930 }
2931
2932 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2934 self.0.options = v.into();
2935 self
2936 }
2937
2938 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
2940 (*self.0.stub)
2941 .list_address_group_references(self.0.request, self.0.options)
2942 .await
2943 .map(gax::response::Response::into_body)
2944 }
2945
2946 pub fn by_page(
2948 self,
2949 ) -> impl gax::paginator::Paginator<
2950 crate::model::ListAddressGroupReferencesResponse,
2951 gax::error::Error,
2952 > {
2953 use std::clone::Clone;
2954 let token = self.0.request.page_token.clone();
2955 let execute = move |token: String| {
2956 let mut builder = self.clone();
2957 builder.0.request = builder.0.request.set_page_token(token);
2958 builder.send()
2959 };
2960 gax::paginator::internal::new_paginator(token, execute)
2961 }
2962
2963 pub fn by_item(
2965 self,
2966 ) -> impl gax::paginator::ItemPaginator<
2967 crate::model::ListAddressGroupReferencesResponse,
2968 gax::error::Error,
2969 > {
2970 use gax::paginator::Paginator;
2971 self.by_page().items()
2972 }
2973
2974 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2978 self.0.request.address_group = v.into();
2979 self
2980 }
2981
2982 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2984 self.0.request.page_size = v.into();
2985 self
2986 }
2987
2988 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2990 self.0.request.page_token = v.into();
2991 self
2992 }
2993 }
2994
2995 #[doc(hidden)]
2996 impl gax::options::internal::RequestBuilder for ListAddressGroupReferences {
2997 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2998 &mut self.0.options
2999 }
3000 }
3001
3002 #[derive(Clone, Debug)]
3024 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3025
3026 impl ListLocations {
3027 pub(crate) fn new(
3028 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3029 ) -> Self {
3030 Self(RequestBuilder::new(stub))
3031 }
3032
3033 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3035 mut self,
3036 v: V,
3037 ) -> Self {
3038 self.0.request = v.into();
3039 self
3040 }
3041
3042 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3044 self.0.options = v.into();
3045 self
3046 }
3047
3048 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3050 (*self.0.stub)
3051 .list_locations(self.0.request, self.0.options)
3052 .await
3053 .map(gax::response::Response::into_body)
3054 }
3055
3056 pub fn by_page(
3058 self,
3059 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3060 {
3061 use std::clone::Clone;
3062 let token = self.0.request.page_token.clone();
3063 let execute = move |token: String| {
3064 let mut builder = self.clone();
3065 builder.0.request = builder.0.request.set_page_token(token);
3066 builder.send()
3067 };
3068 gax::paginator::internal::new_paginator(token, execute)
3069 }
3070
3071 pub fn by_item(
3073 self,
3074 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3075 {
3076 use gax::paginator::Paginator;
3077 self.by_page().items()
3078 }
3079
3080 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3082 self.0.request.name = v.into();
3083 self
3084 }
3085
3086 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3088 self.0.request.filter = v.into();
3089 self
3090 }
3091
3092 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3094 self.0.request.page_size = v.into();
3095 self
3096 }
3097
3098 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3100 self.0.request.page_token = v.into();
3101 self
3102 }
3103 }
3104
3105 #[doc(hidden)]
3106 impl gax::options::internal::RequestBuilder for ListLocations {
3107 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3108 &mut self.0.options
3109 }
3110 }
3111
3112 #[derive(Clone, Debug)]
3130 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3131
3132 impl GetLocation {
3133 pub(crate) fn new(
3134 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3135 ) -> Self {
3136 Self(RequestBuilder::new(stub))
3137 }
3138
3139 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3141 self.0.request = v.into();
3142 self
3143 }
3144
3145 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3147 self.0.options = v.into();
3148 self
3149 }
3150
3151 pub async fn send(self) -> Result<location::model::Location> {
3153 (*self.0.stub)
3154 .get_location(self.0.request, self.0.options)
3155 .await
3156 .map(gax::response::Response::into_body)
3157 }
3158
3159 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3161 self.0.request.name = v.into();
3162 self
3163 }
3164 }
3165
3166 #[doc(hidden)]
3167 impl gax::options::internal::RequestBuilder for GetLocation {
3168 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3169 &mut self.0.options
3170 }
3171 }
3172
3173 #[derive(Clone, Debug)]
3191 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3192
3193 impl SetIamPolicy {
3194 pub(crate) fn new(
3195 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3196 ) -> Self {
3197 Self(RequestBuilder::new(stub))
3198 }
3199
3200 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3202 self.0.request = v.into();
3203 self
3204 }
3205
3206 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3208 self.0.options = v.into();
3209 self
3210 }
3211
3212 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3214 (*self.0.stub)
3215 .set_iam_policy(self.0.request, self.0.options)
3216 .await
3217 .map(gax::response::Response::into_body)
3218 }
3219
3220 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3224 self.0.request.resource = v.into();
3225 self
3226 }
3227
3228 pub fn set_policy<T>(mut self, v: T) -> Self
3232 where
3233 T: std::convert::Into<iam_v1::model::Policy>,
3234 {
3235 self.0.request.policy = std::option::Option::Some(v.into());
3236 self
3237 }
3238
3239 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3243 where
3244 T: std::convert::Into<iam_v1::model::Policy>,
3245 {
3246 self.0.request.policy = v.map(|x| x.into());
3247 self
3248 }
3249
3250 pub fn set_update_mask<T>(mut self, v: T) -> Self
3252 where
3253 T: std::convert::Into<wkt::FieldMask>,
3254 {
3255 self.0.request.update_mask = std::option::Option::Some(v.into());
3256 self
3257 }
3258
3259 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3261 where
3262 T: std::convert::Into<wkt::FieldMask>,
3263 {
3264 self.0.request.update_mask = v.map(|x| x.into());
3265 self
3266 }
3267 }
3268
3269 #[doc(hidden)]
3270 impl gax::options::internal::RequestBuilder for SetIamPolicy {
3271 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3272 &mut self.0.options
3273 }
3274 }
3275
3276 #[derive(Clone, Debug)]
3294 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3295
3296 impl GetIamPolicy {
3297 pub(crate) fn new(
3298 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3299 ) -> Self {
3300 Self(RequestBuilder::new(stub))
3301 }
3302
3303 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3305 self.0.request = v.into();
3306 self
3307 }
3308
3309 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3311 self.0.options = v.into();
3312 self
3313 }
3314
3315 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3317 (*self.0.stub)
3318 .get_iam_policy(self.0.request, self.0.options)
3319 .await
3320 .map(gax::response::Response::into_body)
3321 }
3322
3323 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3327 self.0.request.resource = v.into();
3328 self
3329 }
3330
3331 pub fn set_options<T>(mut self, v: T) -> Self
3333 where
3334 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3335 {
3336 self.0.request.options = std::option::Option::Some(v.into());
3337 self
3338 }
3339
3340 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3342 where
3343 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3344 {
3345 self.0.request.options = v.map(|x| x.into());
3346 self
3347 }
3348 }
3349
3350 #[doc(hidden)]
3351 impl gax::options::internal::RequestBuilder for GetIamPolicy {
3352 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3353 &mut self.0.options
3354 }
3355 }
3356
3357 #[derive(Clone, Debug)]
3375 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
3376
3377 impl TestIamPermissions {
3378 pub(crate) fn new(
3379 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3380 ) -> Self {
3381 Self(RequestBuilder::new(stub))
3382 }
3383
3384 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
3386 mut self,
3387 v: V,
3388 ) -> Self {
3389 self.0.request = v.into();
3390 self
3391 }
3392
3393 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3395 self.0.options = v.into();
3396 self
3397 }
3398
3399 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
3401 (*self.0.stub)
3402 .test_iam_permissions(self.0.request, self.0.options)
3403 .await
3404 .map(gax::response::Response::into_body)
3405 }
3406
3407 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.0.request.resource = v.into();
3412 self
3413 }
3414
3415 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3419 where
3420 T: std::iter::IntoIterator<Item = V>,
3421 V: std::convert::Into<std::string::String>,
3422 {
3423 use std::iter::Iterator;
3424 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3425 self
3426 }
3427 }
3428
3429 #[doc(hidden)]
3430 impl gax::options::internal::RequestBuilder for TestIamPermissions {
3431 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3432 &mut self.0.options
3433 }
3434 }
3435
3436 #[derive(Clone, Debug)]
3458 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3459
3460 impl ListOperations {
3461 pub(crate) fn new(
3462 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3463 ) -> Self {
3464 Self(RequestBuilder::new(stub))
3465 }
3466
3467 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3469 mut self,
3470 v: V,
3471 ) -> Self {
3472 self.0.request = v.into();
3473 self
3474 }
3475
3476 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3478 self.0.options = v.into();
3479 self
3480 }
3481
3482 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3484 (*self.0.stub)
3485 .list_operations(self.0.request, self.0.options)
3486 .await
3487 .map(gax::response::Response::into_body)
3488 }
3489
3490 pub fn by_page(
3492 self,
3493 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3494 {
3495 use std::clone::Clone;
3496 let token = self.0.request.page_token.clone();
3497 let execute = move |token: String| {
3498 let mut builder = self.clone();
3499 builder.0.request = builder.0.request.set_page_token(token);
3500 builder.send()
3501 };
3502 gax::paginator::internal::new_paginator(token, execute)
3503 }
3504
3505 pub fn by_item(
3507 self,
3508 ) -> impl gax::paginator::ItemPaginator<
3509 longrunning::model::ListOperationsResponse,
3510 gax::error::Error,
3511 > {
3512 use gax::paginator::Paginator;
3513 self.by_page().items()
3514 }
3515
3516 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3518 self.0.request.name = v.into();
3519 self
3520 }
3521
3522 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3524 self.0.request.filter = v.into();
3525 self
3526 }
3527
3528 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3530 self.0.request.page_size = v.into();
3531 self
3532 }
3533
3534 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3536 self.0.request.page_token = v.into();
3537 self
3538 }
3539
3540 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3542 self.0.request.return_partial_success = v.into();
3543 self
3544 }
3545 }
3546
3547 #[doc(hidden)]
3548 impl gax::options::internal::RequestBuilder for ListOperations {
3549 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3550 &mut self.0.options
3551 }
3552 }
3553
3554 #[derive(Clone, Debug)]
3572 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3573
3574 impl GetOperation {
3575 pub(crate) fn new(
3576 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3577 ) -> Self {
3578 Self(RequestBuilder::new(stub))
3579 }
3580
3581 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3583 mut self,
3584 v: V,
3585 ) -> Self {
3586 self.0.request = v.into();
3587 self
3588 }
3589
3590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3592 self.0.options = v.into();
3593 self
3594 }
3595
3596 pub async fn send(self) -> Result<longrunning::model::Operation> {
3598 (*self.0.stub)
3599 .get_operation(self.0.request, self.0.options)
3600 .await
3601 .map(gax::response::Response::into_body)
3602 }
3603
3604 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3606 self.0.request.name = v.into();
3607 self
3608 }
3609 }
3610
3611 #[doc(hidden)]
3612 impl gax::options::internal::RequestBuilder for GetOperation {
3613 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3614 &mut self.0.options
3615 }
3616 }
3617
3618 #[derive(Clone, Debug)]
3636 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3637
3638 impl DeleteOperation {
3639 pub(crate) fn new(
3640 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3641 ) -> Self {
3642 Self(RequestBuilder::new(stub))
3643 }
3644
3645 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3647 mut self,
3648 v: V,
3649 ) -> Self {
3650 self.0.request = v.into();
3651 self
3652 }
3653
3654 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3656 self.0.options = v.into();
3657 self
3658 }
3659
3660 pub async fn send(self) -> Result<()> {
3662 (*self.0.stub)
3663 .delete_operation(self.0.request, self.0.options)
3664 .await
3665 .map(gax::response::Response::into_body)
3666 }
3667
3668 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3670 self.0.request.name = v.into();
3671 self
3672 }
3673 }
3674
3675 #[doc(hidden)]
3676 impl gax::options::internal::RequestBuilder for DeleteOperation {
3677 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3678 &mut self.0.options
3679 }
3680 }
3681
3682 #[derive(Clone, Debug)]
3700 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3701
3702 impl CancelOperation {
3703 pub(crate) fn new(
3704 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3705 ) -> Self {
3706 Self(RequestBuilder::new(stub))
3707 }
3708
3709 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3711 mut self,
3712 v: V,
3713 ) -> Self {
3714 self.0.request = v.into();
3715 self
3716 }
3717
3718 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3720 self.0.options = v.into();
3721 self
3722 }
3723
3724 pub async fn send(self) -> Result<()> {
3726 (*self.0.stub)
3727 .cancel_operation(self.0.request, self.0.options)
3728 .await
3729 .map(gax::response::Response::into_body)
3730 }
3731
3732 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3734 self.0.request.name = v.into();
3735 self
3736 }
3737 }
3738
3739 #[doc(hidden)]
3740 impl gax::options::internal::RequestBuilder for CancelOperation {
3741 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3742 &mut self.0.options
3743 }
3744 }
3745}
3746
3747pub mod network_security {
3748 use crate::Result;
3749
3750 pub type ClientBuilder =
3764 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3765
3766 pub(crate) mod client {
3767 use super::super::super::client::NetworkSecurity;
3768 pub struct Factory;
3769 impl gax::client_builder::internal::ClientFactory for Factory {
3770 type Client = NetworkSecurity;
3771 type Credentials = gaxi::options::Credentials;
3772 async fn build(
3773 self,
3774 config: gaxi::options::ClientConfig,
3775 ) -> gax::client_builder::Result<Self::Client> {
3776 Self::Client::new(config).await
3777 }
3778 }
3779 }
3780
3781 #[derive(Clone, Debug)]
3783 pub(crate) struct RequestBuilder<R: std::default::Default> {
3784 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3785 request: R,
3786 options: gax::options::RequestOptions,
3787 }
3788
3789 impl<R> RequestBuilder<R>
3790 where
3791 R: std::default::Default,
3792 {
3793 pub(crate) fn new(
3794 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3795 ) -> Self {
3796 Self {
3797 stub,
3798 request: R::default(),
3799 options: gax::options::RequestOptions::default(),
3800 }
3801 }
3802 }
3803
3804 #[derive(Clone, Debug)]
3826 pub struct ListAuthorizationPolicies(
3827 RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
3828 );
3829
3830 impl ListAuthorizationPolicies {
3831 pub(crate) fn new(
3832 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3833 ) -> Self {
3834 Self(RequestBuilder::new(stub))
3835 }
3836
3837 pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
3839 mut self,
3840 v: V,
3841 ) -> Self {
3842 self.0.request = v.into();
3843 self
3844 }
3845
3846 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3848 self.0.options = v.into();
3849 self
3850 }
3851
3852 pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
3854 (*self.0.stub)
3855 .list_authorization_policies(self.0.request, self.0.options)
3856 .await
3857 .map(gax::response::Response::into_body)
3858 }
3859
3860 pub fn by_page(
3862 self,
3863 ) -> impl gax::paginator::Paginator<
3864 crate::model::ListAuthorizationPoliciesResponse,
3865 gax::error::Error,
3866 > {
3867 use std::clone::Clone;
3868 let token = self.0.request.page_token.clone();
3869 let execute = move |token: String| {
3870 let mut builder = self.clone();
3871 builder.0.request = builder.0.request.set_page_token(token);
3872 builder.send()
3873 };
3874 gax::paginator::internal::new_paginator(token, execute)
3875 }
3876
3877 pub fn by_item(
3879 self,
3880 ) -> impl gax::paginator::ItemPaginator<
3881 crate::model::ListAuthorizationPoliciesResponse,
3882 gax::error::Error,
3883 > {
3884 use gax::paginator::Paginator;
3885 self.by_page().items()
3886 }
3887
3888 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892 self.0.request.parent = v.into();
3893 self
3894 }
3895
3896 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3898 self.0.request.page_size = v.into();
3899 self
3900 }
3901
3902 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3904 self.0.request.page_token = v.into();
3905 self
3906 }
3907 }
3908
3909 #[doc(hidden)]
3910 impl gax::options::internal::RequestBuilder for ListAuthorizationPolicies {
3911 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3912 &mut self.0.options
3913 }
3914 }
3915
3916 #[derive(Clone, Debug)]
3934 pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
3935
3936 impl GetAuthorizationPolicy {
3937 pub(crate) fn new(
3938 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3939 ) -> Self {
3940 Self(RequestBuilder::new(stub))
3941 }
3942
3943 pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
3945 mut self,
3946 v: V,
3947 ) -> Self {
3948 self.0.request = v.into();
3949 self
3950 }
3951
3952 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3954 self.0.options = v.into();
3955 self
3956 }
3957
3958 pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
3960 (*self.0.stub)
3961 .get_authorization_policy(self.0.request, self.0.options)
3962 .await
3963 .map(gax::response::Response::into_body)
3964 }
3965
3966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3970 self.0.request.name = v.into();
3971 self
3972 }
3973 }
3974
3975 #[doc(hidden)]
3976 impl gax::options::internal::RequestBuilder for GetAuthorizationPolicy {
3977 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3978 &mut self.0.options
3979 }
3980 }
3981
3982 #[derive(Clone, Debug)]
4001 pub struct CreateAuthorizationPolicy(
4002 RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
4003 );
4004
4005 impl CreateAuthorizationPolicy {
4006 pub(crate) fn new(
4007 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4008 ) -> Self {
4009 Self(RequestBuilder::new(stub))
4010 }
4011
4012 pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
4014 mut self,
4015 v: V,
4016 ) -> Self {
4017 self.0.request = v.into();
4018 self
4019 }
4020
4021 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4023 self.0.options = v.into();
4024 self
4025 }
4026
4027 pub async fn send(self) -> Result<longrunning::model::Operation> {
4034 (*self.0.stub)
4035 .create_authorization_policy(self.0.request, self.0.options)
4036 .await
4037 .map(gax::response::Response::into_body)
4038 }
4039
4040 pub fn poller(
4042 self,
4043 ) -> impl lro::Poller<crate::model::AuthorizationPolicy, crate::model::OperationMetadata>
4044 {
4045 type Operation = lro::internal::Operation<
4046 crate::model::AuthorizationPolicy,
4047 crate::model::OperationMetadata,
4048 >;
4049 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4050 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4051
4052 let stub = self.0.stub.clone();
4053 let mut options = self.0.options.clone();
4054 options.set_retry_policy(gax::retry_policy::NeverRetry);
4055 let query = move |name| {
4056 let stub = stub.clone();
4057 let options = options.clone();
4058 async {
4059 let op = GetOperation::new(stub)
4060 .set_name(name)
4061 .with_options(options)
4062 .send()
4063 .await?;
4064 Ok(Operation::new(op))
4065 }
4066 };
4067
4068 let start = move || async {
4069 let op = self.send().await?;
4070 Ok(Operation::new(op))
4071 };
4072
4073 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4074 }
4075
4076 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4080 self.0.request.parent = v.into();
4081 self
4082 }
4083
4084 pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4088 self.0.request.authorization_policy_id = v.into();
4089 self
4090 }
4091
4092 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
4096 where
4097 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4098 {
4099 self.0.request.authorization_policy = std::option::Option::Some(v.into());
4100 self
4101 }
4102
4103 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
4107 where
4108 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4109 {
4110 self.0.request.authorization_policy = v.map(|x| x.into());
4111 self
4112 }
4113 }
4114
4115 #[doc(hidden)]
4116 impl gax::options::internal::RequestBuilder for CreateAuthorizationPolicy {
4117 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4118 &mut self.0.options
4119 }
4120 }
4121
4122 #[derive(Clone, Debug)]
4141 pub struct UpdateAuthorizationPolicy(
4142 RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
4143 );
4144
4145 impl UpdateAuthorizationPolicy {
4146 pub(crate) fn new(
4147 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4148 ) -> Self {
4149 Self(RequestBuilder::new(stub))
4150 }
4151
4152 pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
4154 mut self,
4155 v: V,
4156 ) -> Self {
4157 self.0.request = v.into();
4158 self
4159 }
4160
4161 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4163 self.0.options = v.into();
4164 self
4165 }
4166
4167 pub async fn send(self) -> Result<longrunning::model::Operation> {
4174 (*self.0.stub)
4175 .update_authorization_policy(self.0.request, self.0.options)
4176 .await
4177 .map(gax::response::Response::into_body)
4178 }
4179
4180 pub fn poller(
4182 self,
4183 ) -> impl lro::Poller<crate::model::AuthorizationPolicy, crate::model::OperationMetadata>
4184 {
4185 type Operation = lro::internal::Operation<
4186 crate::model::AuthorizationPolicy,
4187 crate::model::OperationMetadata,
4188 >;
4189 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4190 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4191
4192 let stub = self.0.stub.clone();
4193 let mut options = self.0.options.clone();
4194 options.set_retry_policy(gax::retry_policy::NeverRetry);
4195 let query = move |name| {
4196 let stub = stub.clone();
4197 let options = options.clone();
4198 async {
4199 let op = GetOperation::new(stub)
4200 .set_name(name)
4201 .with_options(options)
4202 .send()
4203 .await?;
4204 Ok(Operation::new(op))
4205 }
4206 };
4207
4208 let start = move || async {
4209 let op = self.send().await?;
4210 Ok(Operation::new(op))
4211 };
4212
4213 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4214 }
4215
4216 pub fn set_update_mask<T>(mut self, v: T) -> Self
4218 where
4219 T: std::convert::Into<wkt::FieldMask>,
4220 {
4221 self.0.request.update_mask = std::option::Option::Some(v.into());
4222 self
4223 }
4224
4225 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4227 where
4228 T: std::convert::Into<wkt::FieldMask>,
4229 {
4230 self.0.request.update_mask = v.map(|x| x.into());
4231 self
4232 }
4233
4234 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
4238 where
4239 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4240 {
4241 self.0.request.authorization_policy = std::option::Option::Some(v.into());
4242 self
4243 }
4244
4245 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
4249 where
4250 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4251 {
4252 self.0.request.authorization_policy = v.map(|x| x.into());
4253 self
4254 }
4255 }
4256
4257 #[doc(hidden)]
4258 impl gax::options::internal::RequestBuilder for UpdateAuthorizationPolicy {
4259 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4260 &mut self.0.options
4261 }
4262 }
4263
4264 #[derive(Clone, Debug)]
4283 pub struct DeleteAuthorizationPolicy(
4284 RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
4285 );
4286
4287 impl DeleteAuthorizationPolicy {
4288 pub(crate) fn new(
4289 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4290 ) -> Self {
4291 Self(RequestBuilder::new(stub))
4292 }
4293
4294 pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
4296 mut self,
4297 v: V,
4298 ) -> Self {
4299 self.0.request = v.into();
4300 self
4301 }
4302
4303 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4305 self.0.options = v.into();
4306 self
4307 }
4308
4309 pub async fn send(self) -> Result<longrunning::model::Operation> {
4316 (*self.0.stub)
4317 .delete_authorization_policy(self.0.request, self.0.options)
4318 .await
4319 .map(gax::response::Response::into_body)
4320 }
4321
4322 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4324 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4325 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4326 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4327
4328 let stub = self.0.stub.clone();
4329 let mut options = self.0.options.clone();
4330 options.set_retry_policy(gax::retry_policy::NeverRetry);
4331 let query = move |name| {
4332 let stub = stub.clone();
4333 let options = options.clone();
4334 async {
4335 let op = GetOperation::new(stub)
4336 .set_name(name)
4337 .with_options(options)
4338 .send()
4339 .await?;
4340 Ok(Operation::new(op))
4341 }
4342 };
4343
4344 let start = move || async {
4345 let op = self.send().await?;
4346 Ok(Operation::new(op))
4347 };
4348
4349 lro::internal::new_unit_response_poller(
4350 polling_error_policy,
4351 polling_backoff_policy,
4352 start,
4353 query,
4354 )
4355 }
4356
4357 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4361 self.0.request.name = v.into();
4362 self
4363 }
4364 }
4365
4366 #[doc(hidden)]
4367 impl gax::options::internal::RequestBuilder for DeleteAuthorizationPolicy {
4368 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4369 &mut self.0.options
4370 }
4371 }
4372
4373 #[derive(Clone, Debug)]
4395 pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
4396
4397 impl ListServerTlsPolicies {
4398 pub(crate) fn new(
4399 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4400 ) -> Self {
4401 Self(RequestBuilder::new(stub))
4402 }
4403
4404 pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
4406 mut self,
4407 v: V,
4408 ) -> Self {
4409 self.0.request = v.into();
4410 self
4411 }
4412
4413 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4415 self.0.options = v.into();
4416 self
4417 }
4418
4419 pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
4421 (*self.0.stub)
4422 .list_server_tls_policies(self.0.request, self.0.options)
4423 .await
4424 .map(gax::response::Response::into_body)
4425 }
4426
4427 pub fn by_page(
4429 self,
4430 ) -> impl gax::paginator::Paginator<crate::model::ListServerTlsPoliciesResponse, gax::error::Error>
4431 {
4432 use std::clone::Clone;
4433 let token = self.0.request.page_token.clone();
4434 let execute = move |token: String| {
4435 let mut builder = self.clone();
4436 builder.0.request = builder.0.request.set_page_token(token);
4437 builder.send()
4438 };
4439 gax::paginator::internal::new_paginator(token, execute)
4440 }
4441
4442 pub fn by_item(
4444 self,
4445 ) -> impl gax::paginator::ItemPaginator<
4446 crate::model::ListServerTlsPoliciesResponse,
4447 gax::error::Error,
4448 > {
4449 use gax::paginator::Paginator;
4450 self.by_page().items()
4451 }
4452
4453 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4457 self.0.request.parent = v.into();
4458 self
4459 }
4460
4461 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4463 self.0.request.page_size = v.into();
4464 self
4465 }
4466
4467 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4469 self.0.request.page_token = v.into();
4470 self
4471 }
4472 }
4473
4474 #[doc(hidden)]
4475 impl gax::options::internal::RequestBuilder for ListServerTlsPolicies {
4476 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4477 &mut self.0.options
4478 }
4479 }
4480
4481 #[derive(Clone, Debug)]
4499 pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
4500
4501 impl GetServerTlsPolicy {
4502 pub(crate) fn new(
4503 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4504 ) -> Self {
4505 Self(RequestBuilder::new(stub))
4506 }
4507
4508 pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
4510 mut self,
4511 v: V,
4512 ) -> Self {
4513 self.0.request = v.into();
4514 self
4515 }
4516
4517 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4519 self.0.options = v.into();
4520 self
4521 }
4522
4523 pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
4525 (*self.0.stub)
4526 .get_server_tls_policy(self.0.request, self.0.options)
4527 .await
4528 .map(gax::response::Response::into_body)
4529 }
4530
4531 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4535 self.0.request.name = v.into();
4536 self
4537 }
4538 }
4539
4540 #[doc(hidden)]
4541 impl gax::options::internal::RequestBuilder for GetServerTlsPolicy {
4542 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4543 &mut self.0.options
4544 }
4545 }
4546
4547 #[derive(Clone, Debug)]
4566 pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
4567
4568 impl CreateServerTlsPolicy {
4569 pub(crate) fn new(
4570 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4571 ) -> Self {
4572 Self(RequestBuilder::new(stub))
4573 }
4574
4575 pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
4577 mut self,
4578 v: V,
4579 ) -> Self {
4580 self.0.request = v.into();
4581 self
4582 }
4583
4584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4586 self.0.options = v.into();
4587 self
4588 }
4589
4590 pub async fn send(self) -> Result<longrunning::model::Operation> {
4597 (*self.0.stub)
4598 .create_server_tls_policy(self.0.request, self.0.options)
4599 .await
4600 .map(gax::response::Response::into_body)
4601 }
4602
4603 pub fn poller(
4605 self,
4606 ) -> impl lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
4607 {
4608 type Operation = lro::internal::Operation<
4609 crate::model::ServerTlsPolicy,
4610 crate::model::OperationMetadata,
4611 >;
4612 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4613 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4614
4615 let stub = self.0.stub.clone();
4616 let mut options = self.0.options.clone();
4617 options.set_retry_policy(gax::retry_policy::NeverRetry);
4618 let query = move |name| {
4619 let stub = stub.clone();
4620 let options = options.clone();
4621 async {
4622 let op = GetOperation::new(stub)
4623 .set_name(name)
4624 .with_options(options)
4625 .send()
4626 .await?;
4627 Ok(Operation::new(op))
4628 }
4629 };
4630
4631 let start = move || async {
4632 let op = self.send().await?;
4633 Ok(Operation::new(op))
4634 };
4635
4636 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4637 }
4638
4639 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4643 self.0.request.parent = v.into();
4644 self
4645 }
4646
4647 pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4651 self.0.request.server_tls_policy_id = v.into();
4652 self
4653 }
4654
4655 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
4659 where
4660 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4661 {
4662 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
4663 self
4664 }
4665
4666 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
4670 where
4671 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4672 {
4673 self.0.request.server_tls_policy = v.map(|x| x.into());
4674 self
4675 }
4676 }
4677
4678 #[doc(hidden)]
4679 impl gax::options::internal::RequestBuilder for CreateServerTlsPolicy {
4680 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4681 &mut self.0.options
4682 }
4683 }
4684
4685 #[derive(Clone, Debug)]
4704 pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
4705
4706 impl UpdateServerTlsPolicy {
4707 pub(crate) fn new(
4708 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4709 ) -> Self {
4710 Self(RequestBuilder::new(stub))
4711 }
4712
4713 pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
4715 mut self,
4716 v: V,
4717 ) -> Self {
4718 self.0.request = v.into();
4719 self
4720 }
4721
4722 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4724 self.0.options = v.into();
4725 self
4726 }
4727
4728 pub async fn send(self) -> Result<longrunning::model::Operation> {
4735 (*self.0.stub)
4736 .update_server_tls_policy(self.0.request, self.0.options)
4737 .await
4738 .map(gax::response::Response::into_body)
4739 }
4740
4741 pub fn poller(
4743 self,
4744 ) -> impl lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
4745 {
4746 type Operation = lro::internal::Operation<
4747 crate::model::ServerTlsPolicy,
4748 crate::model::OperationMetadata,
4749 >;
4750 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4751 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4752
4753 let stub = self.0.stub.clone();
4754 let mut options = self.0.options.clone();
4755 options.set_retry_policy(gax::retry_policy::NeverRetry);
4756 let query = move |name| {
4757 let stub = stub.clone();
4758 let options = options.clone();
4759 async {
4760 let op = GetOperation::new(stub)
4761 .set_name(name)
4762 .with_options(options)
4763 .send()
4764 .await?;
4765 Ok(Operation::new(op))
4766 }
4767 };
4768
4769 let start = move || async {
4770 let op = self.send().await?;
4771 Ok(Operation::new(op))
4772 };
4773
4774 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4775 }
4776
4777 pub fn set_update_mask<T>(mut self, v: T) -> Self
4779 where
4780 T: std::convert::Into<wkt::FieldMask>,
4781 {
4782 self.0.request.update_mask = std::option::Option::Some(v.into());
4783 self
4784 }
4785
4786 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4788 where
4789 T: std::convert::Into<wkt::FieldMask>,
4790 {
4791 self.0.request.update_mask = v.map(|x| x.into());
4792 self
4793 }
4794
4795 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
4799 where
4800 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4801 {
4802 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
4803 self
4804 }
4805
4806 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
4810 where
4811 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4812 {
4813 self.0.request.server_tls_policy = v.map(|x| x.into());
4814 self
4815 }
4816 }
4817
4818 #[doc(hidden)]
4819 impl gax::options::internal::RequestBuilder for UpdateServerTlsPolicy {
4820 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4821 &mut self.0.options
4822 }
4823 }
4824
4825 #[derive(Clone, Debug)]
4844 pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
4845
4846 impl DeleteServerTlsPolicy {
4847 pub(crate) fn new(
4848 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4849 ) -> Self {
4850 Self(RequestBuilder::new(stub))
4851 }
4852
4853 pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
4855 mut self,
4856 v: V,
4857 ) -> Self {
4858 self.0.request = v.into();
4859 self
4860 }
4861
4862 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4864 self.0.options = v.into();
4865 self
4866 }
4867
4868 pub async fn send(self) -> Result<longrunning::model::Operation> {
4875 (*self.0.stub)
4876 .delete_server_tls_policy(self.0.request, self.0.options)
4877 .await
4878 .map(gax::response::Response::into_body)
4879 }
4880
4881 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4883 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4884 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4885 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4886
4887 let stub = self.0.stub.clone();
4888 let mut options = self.0.options.clone();
4889 options.set_retry_policy(gax::retry_policy::NeverRetry);
4890 let query = move |name| {
4891 let stub = stub.clone();
4892 let options = options.clone();
4893 async {
4894 let op = GetOperation::new(stub)
4895 .set_name(name)
4896 .with_options(options)
4897 .send()
4898 .await?;
4899 Ok(Operation::new(op))
4900 }
4901 };
4902
4903 let start = move || async {
4904 let op = self.send().await?;
4905 Ok(Operation::new(op))
4906 };
4907
4908 lro::internal::new_unit_response_poller(
4909 polling_error_policy,
4910 polling_backoff_policy,
4911 start,
4912 query,
4913 )
4914 }
4915
4916 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4920 self.0.request.name = v.into();
4921 self
4922 }
4923 }
4924
4925 #[doc(hidden)]
4926 impl gax::options::internal::RequestBuilder for DeleteServerTlsPolicy {
4927 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4928 &mut self.0.options
4929 }
4930 }
4931
4932 #[derive(Clone, Debug)]
4954 pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
4955
4956 impl ListClientTlsPolicies {
4957 pub(crate) fn new(
4958 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4959 ) -> Self {
4960 Self(RequestBuilder::new(stub))
4961 }
4962
4963 pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
4965 mut self,
4966 v: V,
4967 ) -> Self {
4968 self.0.request = v.into();
4969 self
4970 }
4971
4972 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4974 self.0.options = v.into();
4975 self
4976 }
4977
4978 pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
4980 (*self.0.stub)
4981 .list_client_tls_policies(self.0.request, self.0.options)
4982 .await
4983 .map(gax::response::Response::into_body)
4984 }
4985
4986 pub fn by_page(
4988 self,
4989 ) -> impl gax::paginator::Paginator<crate::model::ListClientTlsPoliciesResponse, gax::error::Error>
4990 {
4991 use std::clone::Clone;
4992 let token = self.0.request.page_token.clone();
4993 let execute = move |token: String| {
4994 let mut builder = self.clone();
4995 builder.0.request = builder.0.request.set_page_token(token);
4996 builder.send()
4997 };
4998 gax::paginator::internal::new_paginator(token, execute)
4999 }
5000
5001 pub fn by_item(
5003 self,
5004 ) -> impl gax::paginator::ItemPaginator<
5005 crate::model::ListClientTlsPoliciesResponse,
5006 gax::error::Error,
5007 > {
5008 use gax::paginator::Paginator;
5009 self.by_page().items()
5010 }
5011
5012 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5016 self.0.request.parent = v.into();
5017 self
5018 }
5019
5020 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5022 self.0.request.page_size = v.into();
5023 self
5024 }
5025
5026 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5028 self.0.request.page_token = v.into();
5029 self
5030 }
5031 }
5032
5033 #[doc(hidden)]
5034 impl gax::options::internal::RequestBuilder for ListClientTlsPolicies {
5035 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5036 &mut self.0.options
5037 }
5038 }
5039
5040 #[derive(Clone, Debug)]
5058 pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
5059
5060 impl GetClientTlsPolicy {
5061 pub(crate) fn new(
5062 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5063 ) -> Self {
5064 Self(RequestBuilder::new(stub))
5065 }
5066
5067 pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
5069 mut self,
5070 v: V,
5071 ) -> Self {
5072 self.0.request = v.into();
5073 self
5074 }
5075
5076 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5078 self.0.options = v.into();
5079 self
5080 }
5081
5082 pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
5084 (*self.0.stub)
5085 .get_client_tls_policy(self.0.request, self.0.options)
5086 .await
5087 .map(gax::response::Response::into_body)
5088 }
5089
5090 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5094 self.0.request.name = v.into();
5095 self
5096 }
5097 }
5098
5099 #[doc(hidden)]
5100 impl gax::options::internal::RequestBuilder for GetClientTlsPolicy {
5101 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5102 &mut self.0.options
5103 }
5104 }
5105
5106 #[derive(Clone, Debug)]
5125 pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
5126
5127 impl CreateClientTlsPolicy {
5128 pub(crate) fn new(
5129 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5130 ) -> Self {
5131 Self(RequestBuilder::new(stub))
5132 }
5133
5134 pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
5136 mut self,
5137 v: V,
5138 ) -> Self {
5139 self.0.request = v.into();
5140 self
5141 }
5142
5143 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5145 self.0.options = v.into();
5146 self
5147 }
5148
5149 pub async fn send(self) -> Result<longrunning::model::Operation> {
5156 (*self.0.stub)
5157 .create_client_tls_policy(self.0.request, self.0.options)
5158 .await
5159 .map(gax::response::Response::into_body)
5160 }
5161
5162 pub fn poller(
5164 self,
5165 ) -> impl lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
5166 {
5167 type Operation = lro::internal::Operation<
5168 crate::model::ClientTlsPolicy,
5169 crate::model::OperationMetadata,
5170 >;
5171 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5172 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5173
5174 let stub = self.0.stub.clone();
5175 let mut options = self.0.options.clone();
5176 options.set_retry_policy(gax::retry_policy::NeverRetry);
5177 let query = move |name| {
5178 let stub = stub.clone();
5179 let options = options.clone();
5180 async {
5181 let op = GetOperation::new(stub)
5182 .set_name(name)
5183 .with_options(options)
5184 .send()
5185 .await?;
5186 Ok(Operation::new(op))
5187 }
5188 };
5189
5190 let start = move || async {
5191 let op = self.send().await?;
5192 Ok(Operation::new(op))
5193 };
5194
5195 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5196 }
5197
5198 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5202 self.0.request.parent = v.into();
5203 self
5204 }
5205
5206 pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5210 self.0.request.client_tls_policy_id = v.into();
5211 self
5212 }
5213
5214 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
5218 where
5219 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5220 {
5221 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
5222 self
5223 }
5224
5225 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
5229 where
5230 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5231 {
5232 self.0.request.client_tls_policy = v.map(|x| x.into());
5233 self
5234 }
5235 }
5236
5237 #[doc(hidden)]
5238 impl gax::options::internal::RequestBuilder for CreateClientTlsPolicy {
5239 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5240 &mut self.0.options
5241 }
5242 }
5243
5244 #[derive(Clone, Debug)]
5263 pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
5264
5265 impl UpdateClientTlsPolicy {
5266 pub(crate) fn new(
5267 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5268 ) -> Self {
5269 Self(RequestBuilder::new(stub))
5270 }
5271
5272 pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
5274 mut self,
5275 v: V,
5276 ) -> Self {
5277 self.0.request = v.into();
5278 self
5279 }
5280
5281 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5283 self.0.options = v.into();
5284 self
5285 }
5286
5287 pub async fn send(self) -> Result<longrunning::model::Operation> {
5294 (*self.0.stub)
5295 .update_client_tls_policy(self.0.request, self.0.options)
5296 .await
5297 .map(gax::response::Response::into_body)
5298 }
5299
5300 pub fn poller(
5302 self,
5303 ) -> impl lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
5304 {
5305 type Operation = lro::internal::Operation<
5306 crate::model::ClientTlsPolicy,
5307 crate::model::OperationMetadata,
5308 >;
5309 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5310 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5311
5312 let stub = self.0.stub.clone();
5313 let mut options = self.0.options.clone();
5314 options.set_retry_policy(gax::retry_policy::NeverRetry);
5315 let query = move |name| {
5316 let stub = stub.clone();
5317 let options = options.clone();
5318 async {
5319 let op = GetOperation::new(stub)
5320 .set_name(name)
5321 .with_options(options)
5322 .send()
5323 .await?;
5324 Ok(Operation::new(op))
5325 }
5326 };
5327
5328 let start = move || async {
5329 let op = self.send().await?;
5330 Ok(Operation::new(op))
5331 };
5332
5333 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5334 }
5335
5336 pub fn set_update_mask<T>(mut self, v: T) -> Self
5338 where
5339 T: std::convert::Into<wkt::FieldMask>,
5340 {
5341 self.0.request.update_mask = std::option::Option::Some(v.into());
5342 self
5343 }
5344
5345 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5347 where
5348 T: std::convert::Into<wkt::FieldMask>,
5349 {
5350 self.0.request.update_mask = v.map(|x| x.into());
5351 self
5352 }
5353
5354 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
5358 where
5359 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5360 {
5361 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
5362 self
5363 }
5364
5365 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
5369 where
5370 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5371 {
5372 self.0.request.client_tls_policy = v.map(|x| x.into());
5373 self
5374 }
5375 }
5376
5377 #[doc(hidden)]
5378 impl gax::options::internal::RequestBuilder for UpdateClientTlsPolicy {
5379 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5380 &mut self.0.options
5381 }
5382 }
5383
5384 #[derive(Clone, Debug)]
5403 pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
5404
5405 impl DeleteClientTlsPolicy {
5406 pub(crate) fn new(
5407 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5408 ) -> Self {
5409 Self(RequestBuilder::new(stub))
5410 }
5411
5412 pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
5414 mut self,
5415 v: V,
5416 ) -> Self {
5417 self.0.request = v.into();
5418 self
5419 }
5420
5421 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5423 self.0.options = v.into();
5424 self
5425 }
5426
5427 pub async fn send(self) -> Result<longrunning::model::Operation> {
5434 (*self.0.stub)
5435 .delete_client_tls_policy(self.0.request, self.0.options)
5436 .await
5437 .map(gax::response::Response::into_body)
5438 }
5439
5440 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5442 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5443 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5444 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5445
5446 let stub = self.0.stub.clone();
5447 let mut options = self.0.options.clone();
5448 options.set_retry_policy(gax::retry_policy::NeverRetry);
5449 let query = move |name| {
5450 let stub = stub.clone();
5451 let options = options.clone();
5452 async {
5453 let op = GetOperation::new(stub)
5454 .set_name(name)
5455 .with_options(options)
5456 .send()
5457 .await?;
5458 Ok(Operation::new(op))
5459 }
5460 };
5461
5462 let start = move || async {
5463 let op = self.send().await?;
5464 Ok(Operation::new(op))
5465 };
5466
5467 lro::internal::new_unit_response_poller(
5468 polling_error_policy,
5469 polling_backoff_policy,
5470 start,
5471 query,
5472 )
5473 }
5474
5475 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5479 self.0.request.name = v.into();
5480 self
5481 }
5482 }
5483
5484 #[doc(hidden)]
5485 impl gax::options::internal::RequestBuilder for DeleteClientTlsPolicy {
5486 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5487 &mut self.0.options
5488 }
5489 }
5490
5491 #[derive(Clone, Debug)]
5513 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5514
5515 impl ListLocations {
5516 pub(crate) fn new(
5517 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5518 ) -> Self {
5519 Self(RequestBuilder::new(stub))
5520 }
5521
5522 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5524 mut self,
5525 v: V,
5526 ) -> Self {
5527 self.0.request = v.into();
5528 self
5529 }
5530
5531 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5533 self.0.options = v.into();
5534 self
5535 }
5536
5537 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5539 (*self.0.stub)
5540 .list_locations(self.0.request, self.0.options)
5541 .await
5542 .map(gax::response::Response::into_body)
5543 }
5544
5545 pub fn by_page(
5547 self,
5548 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5549 {
5550 use std::clone::Clone;
5551 let token = self.0.request.page_token.clone();
5552 let execute = move |token: String| {
5553 let mut builder = self.clone();
5554 builder.0.request = builder.0.request.set_page_token(token);
5555 builder.send()
5556 };
5557 gax::paginator::internal::new_paginator(token, execute)
5558 }
5559
5560 pub fn by_item(
5562 self,
5563 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5564 {
5565 use gax::paginator::Paginator;
5566 self.by_page().items()
5567 }
5568
5569 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5571 self.0.request.name = v.into();
5572 self
5573 }
5574
5575 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5577 self.0.request.filter = v.into();
5578 self
5579 }
5580
5581 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5583 self.0.request.page_size = v.into();
5584 self
5585 }
5586
5587 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5589 self.0.request.page_token = v.into();
5590 self
5591 }
5592 }
5593
5594 #[doc(hidden)]
5595 impl gax::options::internal::RequestBuilder for ListLocations {
5596 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5597 &mut self.0.options
5598 }
5599 }
5600
5601 #[derive(Clone, Debug)]
5619 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5620
5621 impl GetLocation {
5622 pub(crate) fn new(
5623 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5624 ) -> Self {
5625 Self(RequestBuilder::new(stub))
5626 }
5627
5628 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5630 self.0.request = v.into();
5631 self
5632 }
5633
5634 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5636 self.0.options = v.into();
5637 self
5638 }
5639
5640 pub async fn send(self) -> Result<location::model::Location> {
5642 (*self.0.stub)
5643 .get_location(self.0.request, self.0.options)
5644 .await
5645 .map(gax::response::Response::into_body)
5646 }
5647
5648 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5650 self.0.request.name = v.into();
5651 self
5652 }
5653 }
5654
5655 #[doc(hidden)]
5656 impl gax::options::internal::RequestBuilder for GetLocation {
5657 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5658 &mut self.0.options
5659 }
5660 }
5661
5662 #[derive(Clone, Debug)]
5680 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5681
5682 impl SetIamPolicy {
5683 pub(crate) fn new(
5684 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5685 ) -> Self {
5686 Self(RequestBuilder::new(stub))
5687 }
5688
5689 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5691 self.0.request = v.into();
5692 self
5693 }
5694
5695 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5697 self.0.options = v.into();
5698 self
5699 }
5700
5701 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5703 (*self.0.stub)
5704 .set_iam_policy(self.0.request, self.0.options)
5705 .await
5706 .map(gax::response::Response::into_body)
5707 }
5708
5709 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5713 self.0.request.resource = v.into();
5714 self
5715 }
5716
5717 pub fn set_policy<T>(mut self, v: T) -> Self
5721 where
5722 T: std::convert::Into<iam_v1::model::Policy>,
5723 {
5724 self.0.request.policy = std::option::Option::Some(v.into());
5725 self
5726 }
5727
5728 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5732 where
5733 T: std::convert::Into<iam_v1::model::Policy>,
5734 {
5735 self.0.request.policy = v.map(|x| x.into());
5736 self
5737 }
5738
5739 pub fn set_update_mask<T>(mut self, v: T) -> Self
5741 where
5742 T: std::convert::Into<wkt::FieldMask>,
5743 {
5744 self.0.request.update_mask = std::option::Option::Some(v.into());
5745 self
5746 }
5747
5748 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5750 where
5751 T: std::convert::Into<wkt::FieldMask>,
5752 {
5753 self.0.request.update_mask = v.map(|x| x.into());
5754 self
5755 }
5756 }
5757
5758 #[doc(hidden)]
5759 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5760 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5761 &mut self.0.options
5762 }
5763 }
5764
5765 #[derive(Clone, Debug)]
5783 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5784
5785 impl GetIamPolicy {
5786 pub(crate) fn new(
5787 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5788 ) -> Self {
5789 Self(RequestBuilder::new(stub))
5790 }
5791
5792 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5794 self.0.request = v.into();
5795 self
5796 }
5797
5798 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5800 self.0.options = v.into();
5801 self
5802 }
5803
5804 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5806 (*self.0.stub)
5807 .get_iam_policy(self.0.request, self.0.options)
5808 .await
5809 .map(gax::response::Response::into_body)
5810 }
5811
5812 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5816 self.0.request.resource = v.into();
5817 self
5818 }
5819
5820 pub fn set_options<T>(mut self, v: T) -> Self
5822 where
5823 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5824 {
5825 self.0.request.options = std::option::Option::Some(v.into());
5826 self
5827 }
5828
5829 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5831 where
5832 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5833 {
5834 self.0.request.options = v.map(|x| x.into());
5835 self
5836 }
5837 }
5838
5839 #[doc(hidden)]
5840 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5841 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5842 &mut self.0.options
5843 }
5844 }
5845
5846 #[derive(Clone, Debug)]
5864 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5865
5866 impl TestIamPermissions {
5867 pub(crate) fn new(
5868 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5869 ) -> Self {
5870 Self(RequestBuilder::new(stub))
5871 }
5872
5873 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5875 mut self,
5876 v: V,
5877 ) -> Self {
5878 self.0.request = v.into();
5879 self
5880 }
5881
5882 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5884 self.0.options = v.into();
5885 self
5886 }
5887
5888 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5890 (*self.0.stub)
5891 .test_iam_permissions(self.0.request, self.0.options)
5892 .await
5893 .map(gax::response::Response::into_body)
5894 }
5895
5896 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5900 self.0.request.resource = v.into();
5901 self
5902 }
5903
5904 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5908 where
5909 T: std::iter::IntoIterator<Item = V>,
5910 V: std::convert::Into<std::string::String>,
5911 {
5912 use std::iter::Iterator;
5913 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5914 self
5915 }
5916 }
5917
5918 #[doc(hidden)]
5919 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5920 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5921 &mut self.0.options
5922 }
5923 }
5924
5925 #[derive(Clone, Debug)]
5947 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5948
5949 impl ListOperations {
5950 pub(crate) fn new(
5951 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5952 ) -> Self {
5953 Self(RequestBuilder::new(stub))
5954 }
5955
5956 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5958 mut self,
5959 v: V,
5960 ) -> Self {
5961 self.0.request = v.into();
5962 self
5963 }
5964
5965 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5967 self.0.options = v.into();
5968 self
5969 }
5970
5971 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5973 (*self.0.stub)
5974 .list_operations(self.0.request, self.0.options)
5975 .await
5976 .map(gax::response::Response::into_body)
5977 }
5978
5979 pub fn by_page(
5981 self,
5982 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5983 {
5984 use std::clone::Clone;
5985 let token = self.0.request.page_token.clone();
5986 let execute = move |token: String| {
5987 let mut builder = self.clone();
5988 builder.0.request = builder.0.request.set_page_token(token);
5989 builder.send()
5990 };
5991 gax::paginator::internal::new_paginator(token, execute)
5992 }
5993
5994 pub fn by_item(
5996 self,
5997 ) -> impl gax::paginator::ItemPaginator<
5998 longrunning::model::ListOperationsResponse,
5999 gax::error::Error,
6000 > {
6001 use gax::paginator::Paginator;
6002 self.by_page().items()
6003 }
6004
6005 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6007 self.0.request.name = v.into();
6008 self
6009 }
6010
6011 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013 self.0.request.filter = v.into();
6014 self
6015 }
6016
6017 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6019 self.0.request.page_size = v.into();
6020 self
6021 }
6022
6023 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6025 self.0.request.page_token = v.into();
6026 self
6027 }
6028
6029 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6031 self.0.request.return_partial_success = v.into();
6032 self
6033 }
6034 }
6035
6036 #[doc(hidden)]
6037 impl gax::options::internal::RequestBuilder for ListOperations {
6038 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6039 &mut self.0.options
6040 }
6041 }
6042
6043 #[derive(Clone, Debug)]
6061 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6062
6063 impl GetOperation {
6064 pub(crate) fn new(
6065 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6066 ) -> Self {
6067 Self(RequestBuilder::new(stub))
6068 }
6069
6070 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6072 mut self,
6073 v: V,
6074 ) -> Self {
6075 self.0.request = v.into();
6076 self
6077 }
6078
6079 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6081 self.0.options = v.into();
6082 self
6083 }
6084
6085 pub async fn send(self) -> Result<longrunning::model::Operation> {
6087 (*self.0.stub)
6088 .get_operation(self.0.request, self.0.options)
6089 .await
6090 .map(gax::response::Response::into_body)
6091 }
6092
6093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6095 self.0.request.name = v.into();
6096 self
6097 }
6098 }
6099
6100 #[doc(hidden)]
6101 impl gax::options::internal::RequestBuilder for GetOperation {
6102 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6103 &mut self.0.options
6104 }
6105 }
6106
6107 #[derive(Clone, Debug)]
6125 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6126
6127 impl DeleteOperation {
6128 pub(crate) fn new(
6129 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6130 ) -> Self {
6131 Self(RequestBuilder::new(stub))
6132 }
6133
6134 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6136 mut self,
6137 v: V,
6138 ) -> Self {
6139 self.0.request = v.into();
6140 self
6141 }
6142
6143 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6145 self.0.options = v.into();
6146 self
6147 }
6148
6149 pub async fn send(self) -> Result<()> {
6151 (*self.0.stub)
6152 .delete_operation(self.0.request, self.0.options)
6153 .await
6154 .map(gax::response::Response::into_body)
6155 }
6156
6157 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6159 self.0.request.name = v.into();
6160 self
6161 }
6162 }
6163
6164 #[doc(hidden)]
6165 impl gax::options::internal::RequestBuilder for DeleteOperation {
6166 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6167 &mut self.0.options
6168 }
6169 }
6170
6171 #[derive(Clone, Debug)]
6189 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6190
6191 impl CancelOperation {
6192 pub(crate) fn new(
6193 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6194 ) -> Self {
6195 Self(RequestBuilder::new(stub))
6196 }
6197
6198 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6200 mut self,
6201 v: V,
6202 ) -> Self {
6203 self.0.request = v.into();
6204 self
6205 }
6206
6207 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6209 self.0.options = v.into();
6210 self
6211 }
6212
6213 pub async fn send(self) -> Result<()> {
6215 (*self.0.stub)
6216 .cancel_operation(self.0.request, self.0.options)
6217 .await
6218 .map(gax::response::Response::into_body)
6219 }
6220
6221 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6223 self.0.request.name = v.into();
6224 self
6225 }
6226 }
6227
6228 #[doc(hidden)]
6229 impl gax::options::internal::RequestBuilder for CancelOperation {
6230 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6231 &mut self.0.options
6232 }
6233 }
6234}