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)]
95 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
96
97 impl ListAddressGroups {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
106 mut self,
107 v: V,
108 ) -> Self {
109 self.0.request = v.into();
110 self
111 }
112
113 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
115 self.0.options = v.into();
116 self
117 }
118
119 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
121 (*self.0.stub)
122 .list_address_groups(self.0.request, self.0.options)
123 .await
124 .map(gax::response::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl gax::paginator::Paginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
131 {
132 use std::clone::Clone;
133 let token = self.0.request.page_token.clone();
134 let execute = move |token: String| {
135 let mut builder = self.clone();
136 builder.0.request = builder.0.request.set_page_token(token);
137 builder.send()
138 };
139 gax::paginator::internal::new_paginator(token, execute)
140 }
141
142 pub fn by_item(
144 self,
145 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
146 {
147 use gax::paginator::Paginator;
148 self.by_page().items()
149 }
150
151 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
155 self.0.request.parent = v.into();
156 self
157 }
158
159 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
161 self.0.request.page_size = v.into();
162 self
163 }
164
165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
167 self.0.request.page_token = v.into();
168 self
169 }
170
171 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
173 self.0.request.return_partial_success = v.into();
174 self
175 }
176 }
177
178 #[doc(hidden)]
179 impl gax::options::internal::RequestBuilder for ListAddressGroups {
180 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
181 &mut self.0.options
182 }
183 }
184
185 #[derive(Clone, Debug)]
202 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
203
204 impl GetAddressGroup {
205 pub(crate) fn new(
206 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
207 ) -> Self {
208 Self(RequestBuilder::new(stub))
209 }
210
211 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
213 self.0.request = v.into();
214 self
215 }
216
217 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
219 self.0.options = v.into();
220 self
221 }
222
223 pub async fn send(self) -> Result<crate::model::AddressGroup> {
225 (*self.0.stub)
226 .get_address_group(self.0.request, self.0.options)
227 .await
228 .map(gax::response::Response::into_body)
229 }
230
231 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
235 self.0.request.name = v.into();
236 self
237 }
238 }
239
240 #[doc(hidden)]
241 impl gax::options::internal::RequestBuilder for GetAddressGroup {
242 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
243 &mut self.0.options
244 }
245 }
246
247 #[derive(Clone, Debug)]
265 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
266
267 impl CreateAddressGroup {
268 pub(crate) fn new(
269 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
270 ) -> Self {
271 Self(RequestBuilder::new(stub))
272 }
273
274 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
276 mut self,
277 v: V,
278 ) -> Self {
279 self.0.request = v.into();
280 self
281 }
282
283 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
285 self.0.options = v.into();
286 self
287 }
288
289 pub async fn send(self) -> Result<longrunning::model::Operation> {
296 (*self.0.stub)
297 .create_address_group(self.0.request, self.0.options)
298 .await
299 .map(gax::response::Response::into_body)
300 }
301
302 pub fn poller(
304 self,
305 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
306 type Operation = lro::internal::Operation<
307 crate::model::AddressGroup,
308 crate::model::OperationMetadata,
309 >;
310 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
311 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
312
313 let stub = self.0.stub.clone();
314 let mut options = self.0.options.clone();
315 options.set_retry_policy(gax::retry_policy::NeverRetry);
316 let query = move |name| {
317 let stub = stub.clone();
318 let options = options.clone();
319 async {
320 let op = GetOperation::new(stub)
321 .set_name(name)
322 .with_options(options)
323 .send()
324 .await?;
325 Ok(Operation::new(op))
326 }
327 };
328
329 let start = move || async {
330 let op = self.send().await?;
331 Ok(Operation::new(op))
332 };
333
334 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
335 }
336
337 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
341 self.0.request.parent = v.into();
342 self
343 }
344
345 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
349 self.0.request.address_group_id = v.into();
350 self
351 }
352
353 pub fn set_address_group<T>(mut self, v: T) -> Self
357 where
358 T: std::convert::Into<crate::model::AddressGroup>,
359 {
360 self.0.request.address_group = std::option::Option::Some(v.into());
361 self
362 }
363
364 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
368 where
369 T: std::convert::Into<crate::model::AddressGroup>,
370 {
371 self.0.request.address_group = v.map(|x| x.into());
372 self
373 }
374
375 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
377 self.0.request.request_id = v.into();
378 self
379 }
380 }
381
382 #[doc(hidden)]
383 impl gax::options::internal::RequestBuilder for CreateAddressGroup {
384 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
385 &mut self.0.options
386 }
387 }
388
389 #[derive(Clone, Debug)]
407 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
408
409 impl UpdateAddressGroup {
410 pub(crate) fn new(
411 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
412 ) -> Self {
413 Self(RequestBuilder::new(stub))
414 }
415
416 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
418 mut self,
419 v: V,
420 ) -> Self {
421 self.0.request = v.into();
422 self
423 }
424
425 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
427 self.0.options = v.into();
428 self
429 }
430
431 pub async fn send(self) -> Result<longrunning::model::Operation> {
438 (*self.0.stub)
439 .update_address_group(self.0.request, self.0.options)
440 .await
441 .map(gax::response::Response::into_body)
442 }
443
444 pub fn poller(
446 self,
447 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
448 type Operation = lro::internal::Operation<
449 crate::model::AddressGroup,
450 crate::model::OperationMetadata,
451 >;
452 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
453 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
454
455 let stub = self.0.stub.clone();
456 let mut options = self.0.options.clone();
457 options.set_retry_policy(gax::retry_policy::NeverRetry);
458 let query = move |name| {
459 let stub = stub.clone();
460 let options = options.clone();
461 async {
462 let op = GetOperation::new(stub)
463 .set_name(name)
464 .with_options(options)
465 .send()
466 .await?;
467 Ok(Operation::new(op))
468 }
469 };
470
471 let start = move || async {
472 let op = self.send().await?;
473 Ok(Operation::new(op))
474 };
475
476 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
477 }
478
479 pub fn set_update_mask<T>(mut self, v: T) -> Self
481 where
482 T: std::convert::Into<wkt::FieldMask>,
483 {
484 self.0.request.update_mask = std::option::Option::Some(v.into());
485 self
486 }
487
488 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
490 where
491 T: std::convert::Into<wkt::FieldMask>,
492 {
493 self.0.request.update_mask = v.map(|x| x.into());
494 self
495 }
496
497 pub fn set_address_group<T>(mut self, v: T) -> Self
501 where
502 T: std::convert::Into<crate::model::AddressGroup>,
503 {
504 self.0.request.address_group = std::option::Option::Some(v.into());
505 self
506 }
507
508 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
512 where
513 T: std::convert::Into<crate::model::AddressGroup>,
514 {
515 self.0.request.address_group = v.map(|x| x.into());
516 self
517 }
518
519 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
521 self.0.request.request_id = v.into();
522 self
523 }
524 }
525
526 #[doc(hidden)]
527 impl gax::options::internal::RequestBuilder for UpdateAddressGroup {
528 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
529 &mut self.0.options
530 }
531 }
532
533 #[derive(Clone, Debug)]
551 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
552
553 impl AddAddressGroupItems {
554 pub(crate) fn new(
555 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
556 ) -> Self {
557 Self(RequestBuilder::new(stub))
558 }
559
560 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
562 mut self,
563 v: V,
564 ) -> Self {
565 self.0.request = v.into();
566 self
567 }
568
569 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
571 self.0.options = v.into();
572 self
573 }
574
575 pub async fn send(self) -> Result<longrunning::model::Operation> {
582 (*self.0.stub)
583 .add_address_group_items(self.0.request, self.0.options)
584 .await
585 .map(gax::response::Response::into_body)
586 }
587
588 pub fn poller(
590 self,
591 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
592 type Operation = lro::internal::Operation<
593 crate::model::AddressGroup,
594 crate::model::OperationMetadata,
595 >;
596 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
597 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
598
599 let stub = self.0.stub.clone();
600 let mut options = self.0.options.clone();
601 options.set_retry_policy(gax::retry_policy::NeverRetry);
602 let query = move |name| {
603 let stub = stub.clone();
604 let options = options.clone();
605 async {
606 let op = GetOperation::new(stub)
607 .set_name(name)
608 .with_options(options)
609 .send()
610 .await?;
611 Ok(Operation::new(op))
612 }
613 };
614
615 let start = move || async {
616 let op = self.send().await?;
617 Ok(Operation::new(op))
618 };
619
620 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
621 }
622
623 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
627 self.0.request.address_group = v.into();
628 self
629 }
630
631 pub fn set_items<T, V>(mut self, v: T) -> Self
635 where
636 T: std::iter::IntoIterator<Item = V>,
637 V: std::convert::Into<std::string::String>,
638 {
639 use std::iter::Iterator;
640 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
641 self
642 }
643
644 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
646 self.0.request.request_id = v.into();
647 self
648 }
649 }
650
651 #[doc(hidden)]
652 impl gax::options::internal::RequestBuilder for AddAddressGroupItems {
653 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
654 &mut self.0.options
655 }
656 }
657
658 #[derive(Clone, Debug)]
676 pub struct RemoveAddressGroupItems(
677 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
678 );
679
680 impl RemoveAddressGroupItems {
681 pub(crate) fn new(
682 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
683 ) -> Self {
684 Self(RequestBuilder::new(stub))
685 }
686
687 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
689 mut self,
690 v: V,
691 ) -> Self {
692 self.0.request = v.into();
693 self
694 }
695
696 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
698 self.0.options = v.into();
699 self
700 }
701
702 pub async fn send(self) -> Result<longrunning::model::Operation> {
709 (*self.0.stub)
710 .remove_address_group_items(self.0.request, self.0.options)
711 .await
712 .map(gax::response::Response::into_body)
713 }
714
715 pub fn poller(
717 self,
718 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
719 type Operation = lro::internal::Operation<
720 crate::model::AddressGroup,
721 crate::model::OperationMetadata,
722 >;
723 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
724 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
725
726 let stub = self.0.stub.clone();
727 let mut options = self.0.options.clone();
728 options.set_retry_policy(gax::retry_policy::NeverRetry);
729 let query = move |name| {
730 let stub = stub.clone();
731 let options = options.clone();
732 async {
733 let op = GetOperation::new(stub)
734 .set_name(name)
735 .with_options(options)
736 .send()
737 .await?;
738 Ok(Operation::new(op))
739 }
740 };
741
742 let start = move || async {
743 let op = self.send().await?;
744 Ok(Operation::new(op))
745 };
746
747 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
748 }
749
750 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
754 self.0.request.address_group = v.into();
755 self
756 }
757
758 pub fn set_items<T, V>(mut self, v: T) -> Self
762 where
763 T: std::iter::IntoIterator<Item = V>,
764 V: std::convert::Into<std::string::String>,
765 {
766 use std::iter::Iterator;
767 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
768 self
769 }
770
771 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
773 self.0.request.request_id = v.into();
774 self
775 }
776 }
777
778 #[doc(hidden)]
779 impl gax::options::internal::RequestBuilder for RemoveAddressGroupItems {
780 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
781 &mut self.0.options
782 }
783 }
784
785 #[derive(Clone, Debug)]
803 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
804
805 impl CloneAddressGroupItems {
806 pub(crate) fn new(
807 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
808 ) -> Self {
809 Self(RequestBuilder::new(stub))
810 }
811
812 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
814 mut self,
815 v: V,
816 ) -> Self {
817 self.0.request = v.into();
818 self
819 }
820
821 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
823 self.0.options = v.into();
824 self
825 }
826
827 pub async fn send(self) -> Result<longrunning::model::Operation> {
834 (*self.0.stub)
835 .clone_address_group_items(self.0.request, self.0.options)
836 .await
837 .map(gax::response::Response::into_body)
838 }
839
840 pub fn poller(
842 self,
843 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
844 type Operation = lro::internal::Operation<
845 crate::model::AddressGroup,
846 crate::model::OperationMetadata,
847 >;
848 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
849 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
850
851 let stub = self.0.stub.clone();
852 let mut options = self.0.options.clone();
853 options.set_retry_policy(gax::retry_policy::NeverRetry);
854 let query = move |name| {
855 let stub = stub.clone();
856 let options = options.clone();
857 async {
858 let op = GetOperation::new(stub)
859 .set_name(name)
860 .with_options(options)
861 .send()
862 .await?;
863 Ok(Operation::new(op))
864 }
865 };
866
867 let start = move || async {
868 let op = self.send().await?;
869 Ok(Operation::new(op))
870 };
871
872 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
873 }
874
875 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
879 self.0.request.address_group = v.into();
880 self
881 }
882
883 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
887 self.0.request.source_address_group = v.into();
888 self
889 }
890
891 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
893 self.0.request.request_id = v.into();
894 self
895 }
896 }
897
898 #[doc(hidden)]
899 impl gax::options::internal::RequestBuilder for CloneAddressGroupItems {
900 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
901 &mut self.0.options
902 }
903 }
904
905 #[derive(Clone, Debug)]
923 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
924
925 impl DeleteAddressGroup {
926 pub(crate) fn new(
927 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
928 ) -> Self {
929 Self(RequestBuilder::new(stub))
930 }
931
932 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
934 mut self,
935 v: V,
936 ) -> Self {
937 self.0.request = v.into();
938 self
939 }
940
941 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
943 self.0.options = v.into();
944 self
945 }
946
947 pub async fn send(self) -> Result<longrunning::model::Operation> {
954 (*self.0.stub)
955 .delete_address_group(self.0.request, self.0.options)
956 .await
957 .map(gax::response::Response::into_body)
958 }
959
960 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
962 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
963 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
964 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
965
966 let stub = self.0.stub.clone();
967 let mut options = self.0.options.clone();
968 options.set_retry_policy(gax::retry_policy::NeverRetry);
969 let query = move |name| {
970 let stub = stub.clone();
971 let options = options.clone();
972 async {
973 let op = GetOperation::new(stub)
974 .set_name(name)
975 .with_options(options)
976 .send()
977 .await?;
978 Ok(Operation::new(op))
979 }
980 };
981
982 let start = move || async {
983 let op = self.send().await?;
984 Ok(Operation::new(op))
985 };
986
987 lro::internal::new_unit_response_poller(
988 polling_error_policy,
989 polling_backoff_policy,
990 start,
991 query,
992 )
993 }
994
995 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
999 self.0.request.name = v.into();
1000 self
1001 }
1002
1003 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1005 self.0.request.request_id = v.into();
1006 self
1007 }
1008 }
1009
1010 #[doc(hidden)]
1011 impl gax::options::internal::RequestBuilder for DeleteAddressGroup {
1012 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1013 &mut self.0.options
1014 }
1015 }
1016
1017 #[derive(Clone, Debug)]
1038 pub struct ListAddressGroupReferences(
1039 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1040 );
1041
1042 impl ListAddressGroupReferences {
1043 pub(crate) fn new(
1044 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1045 ) -> Self {
1046 Self(RequestBuilder::new(stub))
1047 }
1048
1049 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1051 mut self,
1052 v: V,
1053 ) -> Self {
1054 self.0.request = v.into();
1055 self
1056 }
1057
1058 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1060 self.0.options = v.into();
1061 self
1062 }
1063
1064 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1066 (*self.0.stub)
1067 .list_address_group_references(self.0.request, self.0.options)
1068 .await
1069 .map(gax::response::Response::into_body)
1070 }
1071
1072 pub fn by_page(
1074 self,
1075 ) -> impl gax::paginator::Paginator<
1076 crate::model::ListAddressGroupReferencesResponse,
1077 gax::error::Error,
1078 > {
1079 use std::clone::Clone;
1080 let token = self.0.request.page_token.clone();
1081 let execute = move |token: String| {
1082 let mut builder = self.clone();
1083 builder.0.request = builder.0.request.set_page_token(token);
1084 builder.send()
1085 };
1086 gax::paginator::internal::new_paginator(token, execute)
1087 }
1088
1089 pub fn by_item(
1091 self,
1092 ) -> impl gax::paginator::ItemPaginator<
1093 crate::model::ListAddressGroupReferencesResponse,
1094 gax::error::Error,
1095 > {
1096 use gax::paginator::Paginator;
1097 self.by_page().items()
1098 }
1099
1100 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1104 self.0.request.address_group = v.into();
1105 self
1106 }
1107
1108 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1110 self.0.request.page_size = v.into();
1111 self
1112 }
1113
1114 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1116 self.0.request.page_token = v.into();
1117 self
1118 }
1119 }
1120
1121 #[doc(hidden)]
1122 impl gax::options::internal::RequestBuilder for ListAddressGroupReferences {
1123 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1124 &mut self.0.options
1125 }
1126 }
1127
1128 #[derive(Clone, Debug)]
1149 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1150
1151 impl ListLocations {
1152 pub(crate) fn new(
1153 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1154 ) -> Self {
1155 Self(RequestBuilder::new(stub))
1156 }
1157
1158 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1160 mut self,
1161 v: V,
1162 ) -> Self {
1163 self.0.request = v.into();
1164 self
1165 }
1166
1167 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1169 self.0.options = v.into();
1170 self
1171 }
1172
1173 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1175 (*self.0.stub)
1176 .list_locations(self.0.request, self.0.options)
1177 .await
1178 .map(gax::response::Response::into_body)
1179 }
1180
1181 pub fn by_page(
1183 self,
1184 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1185 {
1186 use std::clone::Clone;
1187 let token = self.0.request.page_token.clone();
1188 let execute = move |token: String| {
1189 let mut builder = self.clone();
1190 builder.0.request = builder.0.request.set_page_token(token);
1191 builder.send()
1192 };
1193 gax::paginator::internal::new_paginator(token, execute)
1194 }
1195
1196 pub fn by_item(
1198 self,
1199 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1200 {
1201 use gax::paginator::Paginator;
1202 self.by_page().items()
1203 }
1204
1205 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1207 self.0.request.name = v.into();
1208 self
1209 }
1210
1211 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1213 self.0.request.filter = v.into();
1214 self
1215 }
1216
1217 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1219 self.0.request.page_size = v.into();
1220 self
1221 }
1222
1223 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1225 self.0.request.page_token = v.into();
1226 self
1227 }
1228 }
1229
1230 #[doc(hidden)]
1231 impl gax::options::internal::RequestBuilder for ListLocations {
1232 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1233 &mut self.0.options
1234 }
1235 }
1236
1237 #[derive(Clone, Debug)]
1254 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1255
1256 impl GetLocation {
1257 pub(crate) fn new(
1258 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1259 ) -> Self {
1260 Self(RequestBuilder::new(stub))
1261 }
1262
1263 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1265 self.0.request = v.into();
1266 self
1267 }
1268
1269 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1271 self.0.options = v.into();
1272 self
1273 }
1274
1275 pub async fn send(self) -> Result<location::model::Location> {
1277 (*self.0.stub)
1278 .get_location(self.0.request, self.0.options)
1279 .await
1280 .map(gax::response::Response::into_body)
1281 }
1282
1283 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1285 self.0.request.name = v.into();
1286 self
1287 }
1288 }
1289
1290 #[doc(hidden)]
1291 impl gax::options::internal::RequestBuilder for GetLocation {
1292 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1293 &mut self.0.options
1294 }
1295 }
1296
1297 #[derive(Clone, Debug)]
1314 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1315
1316 impl SetIamPolicy {
1317 pub(crate) fn new(
1318 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1319 ) -> Self {
1320 Self(RequestBuilder::new(stub))
1321 }
1322
1323 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1325 self.0.request = v.into();
1326 self
1327 }
1328
1329 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1331 self.0.options = v.into();
1332 self
1333 }
1334
1335 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1337 (*self.0.stub)
1338 .set_iam_policy(self.0.request, self.0.options)
1339 .await
1340 .map(gax::response::Response::into_body)
1341 }
1342
1343 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1347 self.0.request.resource = v.into();
1348 self
1349 }
1350
1351 pub fn set_policy<T>(mut self, v: T) -> Self
1355 where
1356 T: std::convert::Into<iam_v1::model::Policy>,
1357 {
1358 self.0.request.policy = std::option::Option::Some(v.into());
1359 self
1360 }
1361
1362 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1366 where
1367 T: std::convert::Into<iam_v1::model::Policy>,
1368 {
1369 self.0.request.policy = v.map(|x| x.into());
1370 self
1371 }
1372
1373 pub fn set_update_mask<T>(mut self, v: T) -> Self
1375 where
1376 T: std::convert::Into<wkt::FieldMask>,
1377 {
1378 self.0.request.update_mask = std::option::Option::Some(v.into());
1379 self
1380 }
1381
1382 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1384 where
1385 T: std::convert::Into<wkt::FieldMask>,
1386 {
1387 self.0.request.update_mask = v.map(|x| x.into());
1388 self
1389 }
1390 }
1391
1392 #[doc(hidden)]
1393 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1394 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1395 &mut self.0.options
1396 }
1397 }
1398
1399 #[derive(Clone, Debug)]
1416 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1417
1418 impl GetIamPolicy {
1419 pub(crate) fn new(
1420 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1421 ) -> Self {
1422 Self(RequestBuilder::new(stub))
1423 }
1424
1425 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1427 self.0.request = v.into();
1428 self
1429 }
1430
1431 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1433 self.0.options = v.into();
1434 self
1435 }
1436
1437 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1439 (*self.0.stub)
1440 .get_iam_policy(self.0.request, self.0.options)
1441 .await
1442 .map(gax::response::Response::into_body)
1443 }
1444
1445 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1449 self.0.request.resource = v.into();
1450 self
1451 }
1452
1453 pub fn set_options<T>(mut self, v: T) -> Self
1455 where
1456 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1457 {
1458 self.0.request.options = std::option::Option::Some(v.into());
1459 self
1460 }
1461
1462 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1464 where
1465 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1466 {
1467 self.0.request.options = v.map(|x| x.into());
1468 self
1469 }
1470 }
1471
1472 #[doc(hidden)]
1473 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1474 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1475 &mut self.0.options
1476 }
1477 }
1478
1479 #[derive(Clone, Debug)]
1496 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1497
1498 impl TestIamPermissions {
1499 pub(crate) fn new(
1500 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1501 ) -> Self {
1502 Self(RequestBuilder::new(stub))
1503 }
1504
1505 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1507 mut self,
1508 v: V,
1509 ) -> Self {
1510 self.0.request = v.into();
1511 self
1512 }
1513
1514 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1516 self.0.options = v.into();
1517 self
1518 }
1519
1520 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1522 (*self.0.stub)
1523 .test_iam_permissions(self.0.request, self.0.options)
1524 .await
1525 .map(gax::response::Response::into_body)
1526 }
1527
1528 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1532 self.0.request.resource = v.into();
1533 self
1534 }
1535
1536 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1540 where
1541 T: std::iter::IntoIterator<Item = V>,
1542 V: std::convert::Into<std::string::String>,
1543 {
1544 use std::iter::Iterator;
1545 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1546 self
1547 }
1548 }
1549
1550 #[doc(hidden)]
1551 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1552 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1553 &mut self.0.options
1554 }
1555 }
1556
1557 #[derive(Clone, Debug)]
1578 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1579
1580 impl ListOperations {
1581 pub(crate) fn new(
1582 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1583 ) -> Self {
1584 Self(RequestBuilder::new(stub))
1585 }
1586
1587 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1589 mut self,
1590 v: V,
1591 ) -> Self {
1592 self.0.request = v.into();
1593 self
1594 }
1595
1596 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1598 self.0.options = v.into();
1599 self
1600 }
1601
1602 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1604 (*self.0.stub)
1605 .list_operations(self.0.request, self.0.options)
1606 .await
1607 .map(gax::response::Response::into_body)
1608 }
1609
1610 pub fn by_page(
1612 self,
1613 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1614 {
1615 use std::clone::Clone;
1616 let token = self.0.request.page_token.clone();
1617 let execute = move |token: String| {
1618 let mut builder = self.clone();
1619 builder.0.request = builder.0.request.set_page_token(token);
1620 builder.send()
1621 };
1622 gax::paginator::internal::new_paginator(token, execute)
1623 }
1624
1625 pub fn by_item(
1627 self,
1628 ) -> impl gax::paginator::ItemPaginator<
1629 longrunning::model::ListOperationsResponse,
1630 gax::error::Error,
1631 > {
1632 use gax::paginator::Paginator;
1633 self.by_page().items()
1634 }
1635
1636 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1638 self.0.request.name = v.into();
1639 self
1640 }
1641
1642 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1644 self.0.request.filter = v.into();
1645 self
1646 }
1647
1648 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1650 self.0.request.page_size = v.into();
1651 self
1652 }
1653
1654 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.0.request.page_token = v.into();
1657 self
1658 }
1659
1660 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1662 self.0.request.return_partial_success = v.into();
1663 self
1664 }
1665 }
1666
1667 #[doc(hidden)]
1668 impl gax::options::internal::RequestBuilder for ListOperations {
1669 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1670 &mut self.0.options
1671 }
1672 }
1673
1674 #[derive(Clone, Debug)]
1691 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1692
1693 impl GetOperation {
1694 pub(crate) fn new(
1695 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1696 ) -> Self {
1697 Self(RequestBuilder::new(stub))
1698 }
1699
1700 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1702 mut self,
1703 v: V,
1704 ) -> Self {
1705 self.0.request = v.into();
1706 self
1707 }
1708
1709 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1711 self.0.options = v.into();
1712 self
1713 }
1714
1715 pub async fn send(self) -> Result<longrunning::model::Operation> {
1717 (*self.0.stub)
1718 .get_operation(self.0.request, self.0.options)
1719 .await
1720 .map(gax::response::Response::into_body)
1721 }
1722
1723 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1725 self.0.request.name = v.into();
1726 self
1727 }
1728 }
1729
1730 #[doc(hidden)]
1731 impl gax::options::internal::RequestBuilder for GetOperation {
1732 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1733 &mut self.0.options
1734 }
1735 }
1736
1737 #[derive(Clone, Debug)]
1754 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1755
1756 impl DeleteOperation {
1757 pub(crate) fn new(
1758 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1759 ) -> Self {
1760 Self(RequestBuilder::new(stub))
1761 }
1762
1763 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1765 mut self,
1766 v: V,
1767 ) -> Self {
1768 self.0.request = v.into();
1769 self
1770 }
1771
1772 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1774 self.0.options = v.into();
1775 self
1776 }
1777
1778 pub async fn send(self) -> Result<()> {
1780 (*self.0.stub)
1781 .delete_operation(self.0.request, self.0.options)
1782 .await
1783 .map(gax::response::Response::into_body)
1784 }
1785
1786 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.0.request.name = v.into();
1789 self
1790 }
1791 }
1792
1793 #[doc(hidden)]
1794 impl gax::options::internal::RequestBuilder for DeleteOperation {
1795 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1796 &mut self.0.options
1797 }
1798 }
1799
1800 #[derive(Clone, Debug)]
1817 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1818
1819 impl CancelOperation {
1820 pub(crate) fn new(
1821 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1822 ) -> Self {
1823 Self(RequestBuilder::new(stub))
1824 }
1825
1826 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1828 mut self,
1829 v: V,
1830 ) -> Self {
1831 self.0.request = v.into();
1832 self
1833 }
1834
1835 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1837 self.0.options = v.into();
1838 self
1839 }
1840
1841 pub async fn send(self) -> Result<()> {
1843 (*self.0.stub)
1844 .cancel_operation(self.0.request, self.0.options)
1845 .await
1846 .map(gax::response::Response::into_body)
1847 }
1848
1849 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1851 self.0.request.name = v.into();
1852 self
1853 }
1854 }
1855
1856 #[doc(hidden)]
1857 impl gax::options::internal::RequestBuilder for CancelOperation {
1858 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1859 &mut self.0.options
1860 }
1861 }
1862}
1863
1864pub mod organization_address_group_service {
1865 use crate::Result;
1866
1867 pub type ClientBuilder =
1881 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1882
1883 pub(crate) mod client {
1884 use super::super::super::client::OrganizationAddressGroupService;
1885 pub struct Factory;
1886 impl gax::client_builder::internal::ClientFactory for Factory {
1887 type Client = OrganizationAddressGroupService;
1888 type Credentials = gaxi::options::Credentials;
1889 async fn build(
1890 self,
1891 config: gaxi::options::ClientConfig,
1892 ) -> gax::client_builder::Result<Self::Client> {
1893 Self::Client::new(config).await
1894 }
1895 }
1896 }
1897
1898 #[derive(Clone, Debug)]
1900 pub(crate) struct RequestBuilder<R: std::default::Default> {
1901 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1902 request: R,
1903 options: gax::options::RequestOptions,
1904 }
1905
1906 impl<R> RequestBuilder<R>
1907 where
1908 R: std::default::Default,
1909 {
1910 pub(crate) fn new(
1911 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1912 ) -> Self {
1913 Self {
1914 stub,
1915 request: R::default(),
1916 options: gax::options::RequestOptions::default(),
1917 }
1918 }
1919 }
1920
1921 #[derive(Clone, Debug)]
1942 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
1943
1944 impl ListAddressGroups {
1945 pub(crate) fn new(
1946 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1947 ) -> Self {
1948 Self(RequestBuilder::new(stub))
1949 }
1950
1951 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
1953 mut self,
1954 v: V,
1955 ) -> Self {
1956 self.0.request = v.into();
1957 self
1958 }
1959
1960 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1962 self.0.options = v.into();
1963 self
1964 }
1965
1966 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
1968 (*self.0.stub)
1969 .list_address_groups(self.0.request, self.0.options)
1970 .await
1971 .map(gax::response::Response::into_body)
1972 }
1973
1974 pub fn by_page(
1976 self,
1977 ) -> impl gax::paginator::Paginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
1978 {
1979 use std::clone::Clone;
1980 let token = self.0.request.page_token.clone();
1981 let execute = move |token: String| {
1982 let mut builder = self.clone();
1983 builder.0.request = builder.0.request.set_page_token(token);
1984 builder.send()
1985 };
1986 gax::paginator::internal::new_paginator(token, execute)
1987 }
1988
1989 pub fn by_item(
1991 self,
1992 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
1993 {
1994 use gax::paginator::Paginator;
1995 self.by_page().items()
1996 }
1997
1998 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2002 self.0.request.parent = v.into();
2003 self
2004 }
2005
2006 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2008 self.0.request.page_size = v.into();
2009 self
2010 }
2011
2012 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2014 self.0.request.page_token = v.into();
2015 self
2016 }
2017
2018 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2020 self.0.request.return_partial_success = v.into();
2021 self
2022 }
2023 }
2024
2025 #[doc(hidden)]
2026 impl gax::options::internal::RequestBuilder for ListAddressGroups {
2027 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2028 &mut self.0.options
2029 }
2030 }
2031
2032 #[derive(Clone, Debug)]
2049 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2050
2051 impl GetAddressGroup {
2052 pub(crate) fn new(
2053 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2054 ) -> Self {
2055 Self(RequestBuilder::new(stub))
2056 }
2057
2058 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2060 self.0.request = v.into();
2061 self
2062 }
2063
2064 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2066 self.0.options = v.into();
2067 self
2068 }
2069
2070 pub async fn send(self) -> Result<crate::model::AddressGroup> {
2072 (*self.0.stub)
2073 .get_address_group(self.0.request, self.0.options)
2074 .await
2075 .map(gax::response::Response::into_body)
2076 }
2077
2078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2082 self.0.request.name = v.into();
2083 self
2084 }
2085 }
2086
2087 #[doc(hidden)]
2088 impl gax::options::internal::RequestBuilder for GetAddressGroup {
2089 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2090 &mut self.0.options
2091 }
2092 }
2093
2094 #[derive(Clone, Debug)]
2112 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2113
2114 impl CreateAddressGroup {
2115 pub(crate) fn new(
2116 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2117 ) -> Self {
2118 Self(RequestBuilder::new(stub))
2119 }
2120
2121 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2123 mut self,
2124 v: V,
2125 ) -> Self {
2126 self.0.request = v.into();
2127 self
2128 }
2129
2130 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2132 self.0.options = v.into();
2133 self
2134 }
2135
2136 pub async fn send(self) -> Result<longrunning::model::Operation> {
2143 (*self.0.stub)
2144 .create_address_group(self.0.request, self.0.options)
2145 .await
2146 .map(gax::response::Response::into_body)
2147 }
2148
2149 pub fn poller(
2151 self,
2152 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2153 type Operation = lro::internal::Operation<
2154 crate::model::AddressGroup,
2155 crate::model::OperationMetadata,
2156 >;
2157 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2158 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2159
2160 let stub = self.0.stub.clone();
2161 let mut options = self.0.options.clone();
2162 options.set_retry_policy(gax::retry_policy::NeverRetry);
2163 let query = move |name| {
2164 let stub = stub.clone();
2165 let options = options.clone();
2166 async {
2167 let op = GetOperation::new(stub)
2168 .set_name(name)
2169 .with_options(options)
2170 .send()
2171 .await?;
2172 Ok(Operation::new(op))
2173 }
2174 };
2175
2176 let start = move || async {
2177 let op = self.send().await?;
2178 Ok(Operation::new(op))
2179 };
2180
2181 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2182 }
2183
2184 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2188 self.0.request.parent = v.into();
2189 self
2190 }
2191
2192 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2196 self.0.request.address_group_id = v.into();
2197 self
2198 }
2199
2200 pub fn set_address_group<T>(mut self, v: T) -> Self
2204 where
2205 T: std::convert::Into<crate::model::AddressGroup>,
2206 {
2207 self.0.request.address_group = std::option::Option::Some(v.into());
2208 self
2209 }
2210
2211 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2215 where
2216 T: std::convert::Into<crate::model::AddressGroup>,
2217 {
2218 self.0.request.address_group = v.map(|x| x.into());
2219 self
2220 }
2221
2222 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2224 self.0.request.request_id = v.into();
2225 self
2226 }
2227 }
2228
2229 #[doc(hidden)]
2230 impl gax::options::internal::RequestBuilder for CreateAddressGroup {
2231 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2232 &mut self.0.options
2233 }
2234 }
2235
2236 #[derive(Clone, Debug)]
2254 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2255
2256 impl UpdateAddressGroup {
2257 pub(crate) fn new(
2258 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2259 ) -> Self {
2260 Self(RequestBuilder::new(stub))
2261 }
2262
2263 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2265 mut self,
2266 v: V,
2267 ) -> Self {
2268 self.0.request = v.into();
2269 self
2270 }
2271
2272 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2274 self.0.options = v.into();
2275 self
2276 }
2277
2278 pub async fn send(self) -> Result<longrunning::model::Operation> {
2285 (*self.0.stub)
2286 .update_address_group(self.0.request, self.0.options)
2287 .await
2288 .map(gax::response::Response::into_body)
2289 }
2290
2291 pub fn poller(
2293 self,
2294 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2295 type Operation = lro::internal::Operation<
2296 crate::model::AddressGroup,
2297 crate::model::OperationMetadata,
2298 >;
2299 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2300 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2301
2302 let stub = self.0.stub.clone();
2303 let mut options = self.0.options.clone();
2304 options.set_retry_policy(gax::retry_policy::NeverRetry);
2305 let query = move |name| {
2306 let stub = stub.clone();
2307 let options = options.clone();
2308 async {
2309 let op = GetOperation::new(stub)
2310 .set_name(name)
2311 .with_options(options)
2312 .send()
2313 .await?;
2314 Ok(Operation::new(op))
2315 }
2316 };
2317
2318 let start = move || async {
2319 let op = self.send().await?;
2320 Ok(Operation::new(op))
2321 };
2322
2323 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2324 }
2325
2326 pub fn set_update_mask<T>(mut self, v: T) -> Self
2328 where
2329 T: std::convert::Into<wkt::FieldMask>,
2330 {
2331 self.0.request.update_mask = std::option::Option::Some(v.into());
2332 self
2333 }
2334
2335 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2337 where
2338 T: std::convert::Into<wkt::FieldMask>,
2339 {
2340 self.0.request.update_mask = v.map(|x| x.into());
2341 self
2342 }
2343
2344 pub fn set_address_group<T>(mut self, v: T) -> Self
2348 where
2349 T: std::convert::Into<crate::model::AddressGroup>,
2350 {
2351 self.0.request.address_group = std::option::Option::Some(v.into());
2352 self
2353 }
2354
2355 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2359 where
2360 T: std::convert::Into<crate::model::AddressGroup>,
2361 {
2362 self.0.request.address_group = v.map(|x| x.into());
2363 self
2364 }
2365
2366 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2368 self.0.request.request_id = v.into();
2369 self
2370 }
2371 }
2372
2373 #[doc(hidden)]
2374 impl gax::options::internal::RequestBuilder for UpdateAddressGroup {
2375 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2376 &mut self.0.options
2377 }
2378 }
2379
2380 #[derive(Clone, Debug)]
2398 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2399
2400 impl AddAddressGroupItems {
2401 pub(crate) fn new(
2402 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2403 ) -> Self {
2404 Self(RequestBuilder::new(stub))
2405 }
2406
2407 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2409 mut self,
2410 v: V,
2411 ) -> Self {
2412 self.0.request = v.into();
2413 self
2414 }
2415
2416 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2418 self.0.options = v.into();
2419 self
2420 }
2421
2422 pub async fn send(self) -> Result<longrunning::model::Operation> {
2429 (*self.0.stub)
2430 .add_address_group_items(self.0.request, self.0.options)
2431 .await
2432 .map(gax::response::Response::into_body)
2433 }
2434
2435 pub fn poller(
2437 self,
2438 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2439 type Operation = lro::internal::Operation<
2440 crate::model::AddressGroup,
2441 crate::model::OperationMetadata,
2442 >;
2443 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2444 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2445
2446 let stub = self.0.stub.clone();
2447 let mut options = self.0.options.clone();
2448 options.set_retry_policy(gax::retry_policy::NeverRetry);
2449 let query = move |name| {
2450 let stub = stub.clone();
2451 let options = options.clone();
2452 async {
2453 let op = GetOperation::new(stub)
2454 .set_name(name)
2455 .with_options(options)
2456 .send()
2457 .await?;
2458 Ok(Operation::new(op))
2459 }
2460 };
2461
2462 let start = move || async {
2463 let op = self.send().await?;
2464 Ok(Operation::new(op))
2465 };
2466
2467 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2468 }
2469
2470 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2474 self.0.request.address_group = v.into();
2475 self
2476 }
2477
2478 pub fn set_items<T, V>(mut self, v: T) -> Self
2482 where
2483 T: std::iter::IntoIterator<Item = V>,
2484 V: std::convert::Into<std::string::String>,
2485 {
2486 use std::iter::Iterator;
2487 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2488 self
2489 }
2490
2491 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2493 self.0.request.request_id = v.into();
2494 self
2495 }
2496 }
2497
2498 #[doc(hidden)]
2499 impl gax::options::internal::RequestBuilder for AddAddressGroupItems {
2500 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2501 &mut self.0.options
2502 }
2503 }
2504
2505 #[derive(Clone, Debug)]
2523 pub struct RemoveAddressGroupItems(
2524 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2525 );
2526
2527 impl RemoveAddressGroupItems {
2528 pub(crate) fn new(
2529 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2530 ) -> Self {
2531 Self(RequestBuilder::new(stub))
2532 }
2533
2534 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2536 mut self,
2537 v: V,
2538 ) -> Self {
2539 self.0.request = v.into();
2540 self
2541 }
2542
2543 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2545 self.0.options = v.into();
2546 self
2547 }
2548
2549 pub async fn send(self) -> Result<longrunning::model::Operation> {
2556 (*self.0.stub)
2557 .remove_address_group_items(self.0.request, self.0.options)
2558 .await
2559 .map(gax::response::Response::into_body)
2560 }
2561
2562 pub fn poller(
2564 self,
2565 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2566 type Operation = lro::internal::Operation<
2567 crate::model::AddressGroup,
2568 crate::model::OperationMetadata,
2569 >;
2570 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2571 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2572
2573 let stub = self.0.stub.clone();
2574 let mut options = self.0.options.clone();
2575 options.set_retry_policy(gax::retry_policy::NeverRetry);
2576 let query = move |name| {
2577 let stub = stub.clone();
2578 let options = options.clone();
2579 async {
2580 let op = GetOperation::new(stub)
2581 .set_name(name)
2582 .with_options(options)
2583 .send()
2584 .await?;
2585 Ok(Operation::new(op))
2586 }
2587 };
2588
2589 let start = move || async {
2590 let op = self.send().await?;
2591 Ok(Operation::new(op))
2592 };
2593
2594 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2595 }
2596
2597 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2601 self.0.request.address_group = v.into();
2602 self
2603 }
2604
2605 pub fn set_items<T, V>(mut self, v: T) -> Self
2609 where
2610 T: std::iter::IntoIterator<Item = V>,
2611 V: std::convert::Into<std::string::String>,
2612 {
2613 use std::iter::Iterator;
2614 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2615 self
2616 }
2617
2618 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2620 self.0.request.request_id = v.into();
2621 self
2622 }
2623 }
2624
2625 #[doc(hidden)]
2626 impl gax::options::internal::RequestBuilder for RemoveAddressGroupItems {
2627 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2628 &mut self.0.options
2629 }
2630 }
2631
2632 #[derive(Clone, Debug)]
2650 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2651
2652 impl CloneAddressGroupItems {
2653 pub(crate) fn new(
2654 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2655 ) -> Self {
2656 Self(RequestBuilder::new(stub))
2657 }
2658
2659 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2661 mut self,
2662 v: V,
2663 ) -> Self {
2664 self.0.request = v.into();
2665 self
2666 }
2667
2668 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2670 self.0.options = v.into();
2671 self
2672 }
2673
2674 pub async fn send(self) -> Result<longrunning::model::Operation> {
2681 (*self.0.stub)
2682 .clone_address_group_items(self.0.request, self.0.options)
2683 .await
2684 .map(gax::response::Response::into_body)
2685 }
2686
2687 pub fn poller(
2689 self,
2690 ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2691 type Operation = lro::internal::Operation<
2692 crate::model::AddressGroup,
2693 crate::model::OperationMetadata,
2694 >;
2695 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2696 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2697
2698 let stub = self.0.stub.clone();
2699 let mut options = self.0.options.clone();
2700 options.set_retry_policy(gax::retry_policy::NeverRetry);
2701 let query = move |name| {
2702 let stub = stub.clone();
2703 let options = options.clone();
2704 async {
2705 let op = GetOperation::new(stub)
2706 .set_name(name)
2707 .with_options(options)
2708 .send()
2709 .await?;
2710 Ok(Operation::new(op))
2711 }
2712 };
2713
2714 let start = move || async {
2715 let op = self.send().await?;
2716 Ok(Operation::new(op))
2717 };
2718
2719 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2720 }
2721
2722 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2726 self.0.request.address_group = v.into();
2727 self
2728 }
2729
2730 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2734 self.0.request.source_address_group = v.into();
2735 self
2736 }
2737
2738 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2740 self.0.request.request_id = v.into();
2741 self
2742 }
2743 }
2744
2745 #[doc(hidden)]
2746 impl gax::options::internal::RequestBuilder for CloneAddressGroupItems {
2747 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2748 &mut self.0.options
2749 }
2750 }
2751
2752 #[derive(Clone, Debug)]
2770 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2771
2772 impl DeleteAddressGroup {
2773 pub(crate) fn new(
2774 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2775 ) -> Self {
2776 Self(RequestBuilder::new(stub))
2777 }
2778
2779 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2781 mut self,
2782 v: V,
2783 ) -> Self {
2784 self.0.request = v.into();
2785 self
2786 }
2787
2788 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2790 self.0.options = v.into();
2791 self
2792 }
2793
2794 pub async fn send(self) -> Result<longrunning::model::Operation> {
2801 (*self.0.stub)
2802 .delete_address_group(self.0.request, self.0.options)
2803 .await
2804 .map(gax::response::Response::into_body)
2805 }
2806
2807 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2809 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2810 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2811 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2812
2813 let stub = self.0.stub.clone();
2814 let mut options = self.0.options.clone();
2815 options.set_retry_policy(gax::retry_policy::NeverRetry);
2816 let query = move |name| {
2817 let stub = stub.clone();
2818 let options = options.clone();
2819 async {
2820 let op = GetOperation::new(stub)
2821 .set_name(name)
2822 .with_options(options)
2823 .send()
2824 .await?;
2825 Ok(Operation::new(op))
2826 }
2827 };
2828
2829 let start = move || async {
2830 let op = self.send().await?;
2831 Ok(Operation::new(op))
2832 };
2833
2834 lro::internal::new_unit_response_poller(
2835 polling_error_policy,
2836 polling_backoff_policy,
2837 start,
2838 query,
2839 )
2840 }
2841
2842 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2846 self.0.request.name = v.into();
2847 self
2848 }
2849
2850 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2852 self.0.request.request_id = v.into();
2853 self
2854 }
2855 }
2856
2857 #[doc(hidden)]
2858 impl gax::options::internal::RequestBuilder for DeleteAddressGroup {
2859 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2860 &mut self.0.options
2861 }
2862 }
2863
2864 #[derive(Clone, Debug)]
2885 pub struct ListAddressGroupReferences(
2886 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2887 );
2888
2889 impl ListAddressGroupReferences {
2890 pub(crate) fn new(
2891 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2892 ) -> Self {
2893 Self(RequestBuilder::new(stub))
2894 }
2895
2896 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2898 mut self,
2899 v: V,
2900 ) -> Self {
2901 self.0.request = v.into();
2902 self
2903 }
2904
2905 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2907 self.0.options = v.into();
2908 self
2909 }
2910
2911 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
2913 (*self.0.stub)
2914 .list_address_group_references(self.0.request, self.0.options)
2915 .await
2916 .map(gax::response::Response::into_body)
2917 }
2918
2919 pub fn by_page(
2921 self,
2922 ) -> impl gax::paginator::Paginator<
2923 crate::model::ListAddressGroupReferencesResponse,
2924 gax::error::Error,
2925 > {
2926 use std::clone::Clone;
2927 let token = self.0.request.page_token.clone();
2928 let execute = move |token: String| {
2929 let mut builder = self.clone();
2930 builder.0.request = builder.0.request.set_page_token(token);
2931 builder.send()
2932 };
2933 gax::paginator::internal::new_paginator(token, execute)
2934 }
2935
2936 pub fn by_item(
2938 self,
2939 ) -> impl gax::paginator::ItemPaginator<
2940 crate::model::ListAddressGroupReferencesResponse,
2941 gax::error::Error,
2942 > {
2943 use gax::paginator::Paginator;
2944 self.by_page().items()
2945 }
2946
2947 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2951 self.0.request.address_group = v.into();
2952 self
2953 }
2954
2955 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2957 self.0.request.page_size = v.into();
2958 self
2959 }
2960
2961 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2963 self.0.request.page_token = v.into();
2964 self
2965 }
2966 }
2967
2968 #[doc(hidden)]
2969 impl gax::options::internal::RequestBuilder for ListAddressGroupReferences {
2970 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2971 &mut self.0.options
2972 }
2973 }
2974
2975 #[derive(Clone, Debug)]
2996 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2997
2998 impl ListLocations {
2999 pub(crate) fn new(
3000 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3001 ) -> Self {
3002 Self(RequestBuilder::new(stub))
3003 }
3004
3005 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3007 mut self,
3008 v: V,
3009 ) -> Self {
3010 self.0.request = v.into();
3011 self
3012 }
3013
3014 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3016 self.0.options = v.into();
3017 self
3018 }
3019
3020 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3022 (*self.0.stub)
3023 .list_locations(self.0.request, self.0.options)
3024 .await
3025 .map(gax::response::Response::into_body)
3026 }
3027
3028 pub fn by_page(
3030 self,
3031 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3032 {
3033 use std::clone::Clone;
3034 let token = self.0.request.page_token.clone();
3035 let execute = move |token: String| {
3036 let mut builder = self.clone();
3037 builder.0.request = builder.0.request.set_page_token(token);
3038 builder.send()
3039 };
3040 gax::paginator::internal::new_paginator(token, execute)
3041 }
3042
3043 pub fn by_item(
3045 self,
3046 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3047 {
3048 use gax::paginator::Paginator;
3049 self.by_page().items()
3050 }
3051
3052 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3054 self.0.request.name = v.into();
3055 self
3056 }
3057
3058 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3060 self.0.request.filter = v.into();
3061 self
3062 }
3063
3064 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3066 self.0.request.page_size = v.into();
3067 self
3068 }
3069
3070 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3072 self.0.request.page_token = v.into();
3073 self
3074 }
3075 }
3076
3077 #[doc(hidden)]
3078 impl gax::options::internal::RequestBuilder for ListLocations {
3079 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3080 &mut self.0.options
3081 }
3082 }
3083
3084 #[derive(Clone, Debug)]
3101 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3102
3103 impl GetLocation {
3104 pub(crate) fn new(
3105 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3106 ) -> Self {
3107 Self(RequestBuilder::new(stub))
3108 }
3109
3110 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3112 self.0.request = v.into();
3113 self
3114 }
3115
3116 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3118 self.0.options = v.into();
3119 self
3120 }
3121
3122 pub async fn send(self) -> Result<location::model::Location> {
3124 (*self.0.stub)
3125 .get_location(self.0.request, self.0.options)
3126 .await
3127 .map(gax::response::Response::into_body)
3128 }
3129
3130 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3132 self.0.request.name = v.into();
3133 self
3134 }
3135 }
3136
3137 #[doc(hidden)]
3138 impl gax::options::internal::RequestBuilder for GetLocation {
3139 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3140 &mut self.0.options
3141 }
3142 }
3143
3144 #[derive(Clone, Debug)]
3161 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3162
3163 impl SetIamPolicy {
3164 pub(crate) fn new(
3165 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3166 ) -> Self {
3167 Self(RequestBuilder::new(stub))
3168 }
3169
3170 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3172 self.0.request = v.into();
3173 self
3174 }
3175
3176 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3178 self.0.options = v.into();
3179 self
3180 }
3181
3182 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3184 (*self.0.stub)
3185 .set_iam_policy(self.0.request, self.0.options)
3186 .await
3187 .map(gax::response::Response::into_body)
3188 }
3189
3190 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3194 self.0.request.resource = v.into();
3195 self
3196 }
3197
3198 pub fn set_policy<T>(mut self, v: T) -> Self
3202 where
3203 T: std::convert::Into<iam_v1::model::Policy>,
3204 {
3205 self.0.request.policy = std::option::Option::Some(v.into());
3206 self
3207 }
3208
3209 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3213 where
3214 T: std::convert::Into<iam_v1::model::Policy>,
3215 {
3216 self.0.request.policy = v.map(|x| x.into());
3217 self
3218 }
3219
3220 pub fn set_update_mask<T>(mut self, v: T) -> Self
3222 where
3223 T: std::convert::Into<wkt::FieldMask>,
3224 {
3225 self.0.request.update_mask = std::option::Option::Some(v.into());
3226 self
3227 }
3228
3229 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3231 where
3232 T: std::convert::Into<wkt::FieldMask>,
3233 {
3234 self.0.request.update_mask = v.map(|x| x.into());
3235 self
3236 }
3237 }
3238
3239 #[doc(hidden)]
3240 impl gax::options::internal::RequestBuilder for SetIamPolicy {
3241 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3242 &mut self.0.options
3243 }
3244 }
3245
3246 #[derive(Clone, Debug)]
3263 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3264
3265 impl GetIamPolicy {
3266 pub(crate) fn new(
3267 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3268 ) -> Self {
3269 Self(RequestBuilder::new(stub))
3270 }
3271
3272 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3274 self.0.request = v.into();
3275 self
3276 }
3277
3278 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3280 self.0.options = v.into();
3281 self
3282 }
3283
3284 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3286 (*self.0.stub)
3287 .get_iam_policy(self.0.request, self.0.options)
3288 .await
3289 .map(gax::response::Response::into_body)
3290 }
3291
3292 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3296 self.0.request.resource = v.into();
3297 self
3298 }
3299
3300 pub fn set_options<T>(mut self, v: T) -> Self
3302 where
3303 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3304 {
3305 self.0.request.options = std::option::Option::Some(v.into());
3306 self
3307 }
3308
3309 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3311 where
3312 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3313 {
3314 self.0.request.options = v.map(|x| x.into());
3315 self
3316 }
3317 }
3318
3319 #[doc(hidden)]
3320 impl gax::options::internal::RequestBuilder for GetIamPolicy {
3321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3322 &mut self.0.options
3323 }
3324 }
3325
3326 #[derive(Clone, Debug)]
3343 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
3344
3345 impl TestIamPermissions {
3346 pub(crate) fn new(
3347 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3348 ) -> Self {
3349 Self(RequestBuilder::new(stub))
3350 }
3351
3352 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
3354 mut self,
3355 v: V,
3356 ) -> Self {
3357 self.0.request = v.into();
3358 self
3359 }
3360
3361 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3363 self.0.options = v.into();
3364 self
3365 }
3366
3367 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
3369 (*self.0.stub)
3370 .test_iam_permissions(self.0.request, self.0.options)
3371 .await
3372 .map(gax::response::Response::into_body)
3373 }
3374
3375 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3379 self.0.request.resource = v.into();
3380 self
3381 }
3382
3383 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3387 where
3388 T: std::iter::IntoIterator<Item = V>,
3389 V: std::convert::Into<std::string::String>,
3390 {
3391 use std::iter::Iterator;
3392 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3393 self
3394 }
3395 }
3396
3397 #[doc(hidden)]
3398 impl gax::options::internal::RequestBuilder for TestIamPermissions {
3399 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3400 &mut self.0.options
3401 }
3402 }
3403
3404 #[derive(Clone, Debug)]
3425 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3426
3427 impl ListOperations {
3428 pub(crate) fn new(
3429 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3430 ) -> Self {
3431 Self(RequestBuilder::new(stub))
3432 }
3433
3434 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3436 mut self,
3437 v: V,
3438 ) -> Self {
3439 self.0.request = v.into();
3440 self
3441 }
3442
3443 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3445 self.0.options = v.into();
3446 self
3447 }
3448
3449 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3451 (*self.0.stub)
3452 .list_operations(self.0.request, self.0.options)
3453 .await
3454 .map(gax::response::Response::into_body)
3455 }
3456
3457 pub fn by_page(
3459 self,
3460 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3461 {
3462 use std::clone::Clone;
3463 let token = self.0.request.page_token.clone();
3464 let execute = move |token: String| {
3465 let mut builder = self.clone();
3466 builder.0.request = builder.0.request.set_page_token(token);
3467 builder.send()
3468 };
3469 gax::paginator::internal::new_paginator(token, execute)
3470 }
3471
3472 pub fn by_item(
3474 self,
3475 ) -> impl gax::paginator::ItemPaginator<
3476 longrunning::model::ListOperationsResponse,
3477 gax::error::Error,
3478 > {
3479 use gax::paginator::Paginator;
3480 self.by_page().items()
3481 }
3482
3483 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3485 self.0.request.name = v.into();
3486 self
3487 }
3488
3489 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3491 self.0.request.filter = v.into();
3492 self
3493 }
3494
3495 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3497 self.0.request.page_size = v.into();
3498 self
3499 }
3500
3501 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3503 self.0.request.page_token = v.into();
3504 self
3505 }
3506
3507 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3509 self.0.request.return_partial_success = v.into();
3510 self
3511 }
3512 }
3513
3514 #[doc(hidden)]
3515 impl gax::options::internal::RequestBuilder for ListOperations {
3516 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3517 &mut self.0.options
3518 }
3519 }
3520
3521 #[derive(Clone, Debug)]
3538 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3539
3540 impl GetOperation {
3541 pub(crate) fn new(
3542 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3543 ) -> Self {
3544 Self(RequestBuilder::new(stub))
3545 }
3546
3547 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3549 mut self,
3550 v: V,
3551 ) -> Self {
3552 self.0.request = v.into();
3553 self
3554 }
3555
3556 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3558 self.0.options = v.into();
3559 self
3560 }
3561
3562 pub async fn send(self) -> Result<longrunning::model::Operation> {
3564 (*self.0.stub)
3565 .get_operation(self.0.request, self.0.options)
3566 .await
3567 .map(gax::response::Response::into_body)
3568 }
3569
3570 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3572 self.0.request.name = v.into();
3573 self
3574 }
3575 }
3576
3577 #[doc(hidden)]
3578 impl gax::options::internal::RequestBuilder for GetOperation {
3579 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3580 &mut self.0.options
3581 }
3582 }
3583
3584 #[derive(Clone, Debug)]
3601 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3602
3603 impl DeleteOperation {
3604 pub(crate) fn new(
3605 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3606 ) -> Self {
3607 Self(RequestBuilder::new(stub))
3608 }
3609
3610 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3612 mut self,
3613 v: V,
3614 ) -> Self {
3615 self.0.request = v.into();
3616 self
3617 }
3618
3619 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3621 self.0.options = v.into();
3622 self
3623 }
3624
3625 pub async fn send(self) -> Result<()> {
3627 (*self.0.stub)
3628 .delete_operation(self.0.request, self.0.options)
3629 .await
3630 .map(gax::response::Response::into_body)
3631 }
3632
3633 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3635 self.0.request.name = v.into();
3636 self
3637 }
3638 }
3639
3640 #[doc(hidden)]
3641 impl gax::options::internal::RequestBuilder for DeleteOperation {
3642 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3643 &mut self.0.options
3644 }
3645 }
3646
3647 #[derive(Clone, Debug)]
3664 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3665
3666 impl CancelOperation {
3667 pub(crate) fn new(
3668 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3669 ) -> Self {
3670 Self(RequestBuilder::new(stub))
3671 }
3672
3673 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3675 mut self,
3676 v: V,
3677 ) -> Self {
3678 self.0.request = v.into();
3679 self
3680 }
3681
3682 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3684 self.0.options = v.into();
3685 self
3686 }
3687
3688 pub async fn send(self) -> Result<()> {
3690 (*self.0.stub)
3691 .cancel_operation(self.0.request, self.0.options)
3692 .await
3693 .map(gax::response::Response::into_body)
3694 }
3695
3696 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3698 self.0.request.name = v.into();
3699 self
3700 }
3701 }
3702
3703 #[doc(hidden)]
3704 impl gax::options::internal::RequestBuilder for CancelOperation {
3705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3706 &mut self.0.options
3707 }
3708 }
3709}
3710
3711pub mod network_security {
3712 use crate::Result;
3713
3714 pub type ClientBuilder =
3728 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3729
3730 pub(crate) mod client {
3731 use super::super::super::client::NetworkSecurity;
3732 pub struct Factory;
3733 impl gax::client_builder::internal::ClientFactory for Factory {
3734 type Client = NetworkSecurity;
3735 type Credentials = gaxi::options::Credentials;
3736 async fn build(
3737 self,
3738 config: gaxi::options::ClientConfig,
3739 ) -> gax::client_builder::Result<Self::Client> {
3740 Self::Client::new(config).await
3741 }
3742 }
3743 }
3744
3745 #[derive(Clone, Debug)]
3747 pub(crate) struct RequestBuilder<R: std::default::Default> {
3748 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3749 request: R,
3750 options: gax::options::RequestOptions,
3751 }
3752
3753 impl<R> RequestBuilder<R>
3754 where
3755 R: std::default::Default,
3756 {
3757 pub(crate) fn new(
3758 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3759 ) -> Self {
3760 Self {
3761 stub,
3762 request: R::default(),
3763 options: gax::options::RequestOptions::default(),
3764 }
3765 }
3766 }
3767
3768 #[derive(Clone, Debug)]
3789 pub struct ListAuthorizationPolicies(
3790 RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
3791 );
3792
3793 impl ListAuthorizationPolicies {
3794 pub(crate) fn new(
3795 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3796 ) -> Self {
3797 Self(RequestBuilder::new(stub))
3798 }
3799
3800 pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
3802 mut self,
3803 v: V,
3804 ) -> Self {
3805 self.0.request = v.into();
3806 self
3807 }
3808
3809 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3811 self.0.options = v.into();
3812 self
3813 }
3814
3815 pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
3817 (*self.0.stub)
3818 .list_authorization_policies(self.0.request, self.0.options)
3819 .await
3820 .map(gax::response::Response::into_body)
3821 }
3822
3823 pub fn by_page(
3825 self,
3826 ) -> impl gax::paginator::Paginator<
3827 crate::model::ListAuthorizationPoliciesResponse,
3828 gax::error::Error,
3829 > {
3830 use std::clone::Clone;
3831 let token = self.0.request.page_token.clone();
3832 let execute = move |token: String| {
3833 let mut builder = self.clone();
3834 builder.0.request = builder.0.request.set_page_token(token);
3835 builder.send()
3836 };
3837 gax::paginator::internal::new_paginator(token, execute)
3838 }
3839
3840 pub fn by_item(
3842 self,
3843 ) -> impl gax::paginator::ItemPaginator<
3844 crate::model::ListAuthorizationPoliciesResponse,
3845 gax::error::Error,
3846 > {
3847 use gax::paginator::Paginator;
3848 self.by_page().items()
3849 }
3850
3851 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3855 self.0.request.parent = v.into();
3856 self
3857 }
3858
3859 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3861 self.0.request.page_size = v.into();
3862 self
3863 }
3864
3865 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3867 self.0.request.page_token = v.into();
3868 self
3869 }
3870 }
3871
3872 #[doc(hidden)]
3873 impl gax::options::internal::RequestBuilder for ListAuthorizationPolicies {
3874 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3875 &mut self.0.options
3876 }
3877 }
3878
3879 #[derive(Clone, Debug)]
3896 pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
3897
3898 impl GetAuthorizationPolicy {
3899 pub(crate) fn new(
3900 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3901 ) -> Self {
3902 Self(RequestBuilder::new(stub))
3903 }
3904
3905 pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
3907 mut self,
3908 v: V,
3909 ) -> Self {
3910 self.0.request = v.into();
3911 self
3912 }
3913
3914 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3916 self.0.options = v.into();
3917 self
3918 }
3919
3920 pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
3922 (*self.0.stub)
3923 .get_authorization_policy(self.0.request, self.0.options)
3924 .await
3925 .map(gax::response::Response::into_body)
3926 }
3927
3928 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3932 self.0.request.name = v.into();
3933 self
3934 }
3935 }
3936
3937 #[doc(hidden)]
3938 impl gax::options::internal::RequestBuilder for GetAuthorizationPolicy {
3939 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3940 &mut self.0.options
3941 }
3942 }
3943
3944 #[derive(Clone, Debug)]
3962 pub struct CreateAuthorizationPolicy(
3963 RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
3964 );
3965
3966 impl CreateAuthorizationPolicy {
3967 pub(crate) fn new(
3968 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3969 ) -> Self {
3970 Self(RequestBuilder::new(stub))
3971 }
3972
3973 pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
3975 mut self,
3976 v: V,
3977 ) -> Self {
3978 self.0.request = v.into();
3979 self
3980 }
3981
3982 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3984 self.0.options = v.into();
3985 self
3986 }
3987
3988 pub async fn send(self) -> Result<longrunning::model::Operation> {
3995 (*self.0.stub)
3996 .create_authorization_policy(self.0.request, self.0.options)
3997 .await
3998 .map(gax::response::Response::into_body)
3999 }
4000
4001 pub fn poller(
4003 self,
4004 ) -> impl lro::Poller<crate::model::AuthorizationPolicy, crate::model::OperationMetadata>
4005 {
4006 type Operation = lro::internal::Operation<
4007 crate::model::AuthorizationPolicy,
4008 crate::model::OperationMetadata,
4009 >;
4010 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4011 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4012
4013 let stub = self.0.stub.clone();
4014 let mut options = self.0.options.clone();
4015 options.set_retry_policy(gax::retry_policy::NeverRetry);
4016 let query = move |name| {
4017 let stub = stub.clone();
4018 let options = options.clone();
4019 async {
4020 let op = GetOperation::new(stub)
4021 .set_name(name)
4022 .with_options(options)
4023 .send()
4024 .await?;
4025 Ok(Operation::new(op))
4026 }
4027 };
4028
4029 let start = move || async {
4030 let op = self.send().await?;
4031 Ok(Operation::new(op))
4032 };
4033
4034 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4035 }
4036
4037 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4041 self.0.request.parent = v.into();
4042 self
4043 }
4044
4045 pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4049 self.0.request.authorization_policy_id = v.into();
4050 self
4051 }
4052
4053 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
4057 where
4058 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4059 {
4060 self.0.request.authorization_policy = std::option::Option::Some(v.into());
4061 self
4062 }
4063
4064 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
4068 where
4069 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4070 {
4071 self.0.request.authorization_policy = v.map(|x| x.into());
4072 self
4073 }
4074 }
4075
4076 #[doc(hidden)]
4077 impl gax::options::internal::RequestBuilder for CreateAuthorizationPolicy {
4078 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4079 &mut self.0.options
4080 }
4081 }
4082
4083 #[derive(Clone, Debug)]
4101 pub struct UpdateAuthorizationPolicy(
4102 RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
4103 );
4104
4105 impl UpdateAuthorizationPolicy {
4106 pub(crate) fn new(
4107 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4108 ) -> Self {
4109 Self(RequestBuilder::new(stub))
4110 }
4111
4112 pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
4114 mut self,
4115 v: V,
4116 ) -> Self {
4117 self.0.request = v.into();
4118 self
4119 }
4120
4121 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4123 self.0.options = v.into();
4124 self
4125 }
4126
4127 pub async fn send(self) -> Result<longrunning::model::Operation> {
4134 (*self.0.stub)
4135 .update_authorization_policy(self.0.request, self.0.options)
4136 .await
4137 .map(gax::response::Response::into_body)
4138 }
4139
4140 pub fn poller(
4142 self,
4143 ) -> impl lro::Poller<crate::model::AuthorizationPolicy, crate::model::OperationMetadata>
4144 {
4145 type Operation = lro::internal::Operation<
4146 crate::model::AuthorizationPolicy,
4147 crate::model::OperationMetadata,
4148 >;
4149 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4150 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4151
4152 let stub = self.0.stub.clone();
4153 let mut options = self.0.options.clone();
4154 options.set_retry_policy(gax::retry_policy::NeverRetry);
4155 let query = move |name| {
4156 let stub = stub.clone();
4157 let options = options.clone();
4158 async {
4159 let op = GetOperation::new(stub)
4160 .set_name(name)
4161 .with_options(options)
4162 .send()
4163 .await?;
4164 Ok(Operation::new(op))
4165 }
4166 };
4167
4168 let start = move || async {
4169 let op = self.send().await?;
4170 Ok(Operation::new(op))
4171 };
4172
4173 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4174 }
4175
4176 pub fn set_update_mask<T>(mut self, v: T) -> Self
4178 where
4179 T: std::convert::Into<wkt::FieldMask>,
4180 {
4181 self.0.request.update_mask = std::option::Option::Some(v.into());
4182 self
4183 }
4184
4185 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4187 where
4188 T: std::convert::Into<wkt::FieldMask>,
4189 {
4190 self.0.request.update_mask = v.map(|x| x.into());
4191 self
4192 }
4193
4194 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
4198 where
4199 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4200 {
4201 self.0.request.authorization_policy = std::option::Option::Some(v.into());
4202 self
4203 }
4204
4205 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
4209 where
4210 T: std::convert::Into<crate::model::AuthorizationPolicy>,
4211 {
4212 self.0.request.authorization_policy = v.map(|x| x.into());
4213 self
4214 }
4215 }
4216
4217 #[doc(hidden)]
4218 impl gax::options::internal::RequestBuilder for UpdateAuthorizationPolicy {
4219 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4220 &mut self.0.options
4221 }
4222 }
4223
4224 #[derive(Clone, Debug)]
4242 pub struct DeleteAuthorizationPolicy(
4243 RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
4244 );
4245
4246 impl DeleteAuthorizationPolicy {
4247 pub(crate) fn new(
4248 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4249 ) -> Self {
4250 Self(RequestBuilder::new(stub))
4251 }
4252
4253 pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
4255 mut self,
4256 v: V,
4257 ) -> Self {
4258 self.0.request = v.into();
4259 self
4260 }
4261
4262 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4264 self.0.options = v.into();
4265 self
4266 }
4267
4268 pub async fn send(self) -> Result<longrunning::model::Operation> {
4275 (*self.0.stub)
4276 .delete_authorization_policy(self.0.request, self.0.options)
4277 .await
4278 .map(gax::response::Response::into_body)
4279 }
4280
4281 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4283 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4284 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4285 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4286
4287 let stub = self.0.stub.clone();
4288 let mut options = self.0.options.clone();
4289 options.set_retry_policy(gax::retry_policy::NeverRetry);
4290 let query = move |name| {
4291 let stub = stub.clone();
4292 let options = options.clone();
4293 async {
4294 let op = GetOperation::new(stub)
4295 .set_name(name)
4296 .with_options(options)
4297 .send()
4298 .await?;
4299 Ok(Operation::new(op))
4300 }
4301 };
4302
4303 let start = move || async {
4304 let op = self.send().await?;
4305 Ok(Operation::new(op))
4306 };
4307
4308 lro::internal::new_unit_response_poller(
4309 polling_error_policy,
4310 polling_backoff_policy,
4311 start,
4312 query,
4313 )
4314 }
4315
4316 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4320 self.0.request.name = v.into();
4321 self
4322 }
4323 }
4324
4325 #[doc(hidden)]
4326 impl gax::options::internal::RequestBuilder for DeleteAuthorizationPolicy {
4327 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4328 &mut self.0.options
4329 }
4330 }
4331
4332 #[derive(Clone, Debug)]
4353 pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
4354
4355 impl ListServerTlsPolicies {
4356 pub(crate) fn new(
4357 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4358 ) -> Self {
4359 Self(RequestBuilder::new(stub))
4360 }
4361
4362 pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
4364 mut self,
4365 v: V,
4366 ) -> Self {
4367 self.0.request = v.into();
4368 self
4369 }
4370
4371 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4373 self.0.options = v.into();
4374 self
4375 }
4376
4377 pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
4379 (*self.0.stub)
4380 .list_server_tls_policies(self.0.request, self.0.options)
4381 .await
4382 .map(gax::response::Response::into_body)
4383 }
4384
4385 pub fn by_page(
4387 self,
4388 ) -> impl gax::paginator::Paginator<crate::model::ListServerTlsPoliciesResponse, gax::error::Error>
4389 {
4390 use std::clone::Clone;
4391 let token = self.0.request.page_token.clone();
4392 let execute = move |token: String| {
4393 let mut builder = self.clone();
4394 builder.0.request = builder.0.request.set_page_token(token);
4395 builder.send()
4396 };
4397 gax::paginator::internal::new_paginator(token, execute)
4398 }
4399
4400 pub fn by_item(
4402 self,
4403 ) -> impl gax::paginator::ItemPaginator<
4404 crate::model::ListServerTlsPoliciesResponse,
4405 gax::error::Error,
4406 > {
4407 use gax::paginator::Paginator;
4408 self.by_page().items()
4409 }
4410
4411 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4415 self.0.request.parent = v.into();
4416 self
4417 }
4418
4419 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4421 self.0.request.page_size = v.into();
4422 self
4423 }
4424
4425 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4427 self.0.request.page_token = v.into();
4428 self
4429 }
4430 }
4431
4432 #[doc(hidden)]
4433 impl gax::options::internal::RequestBuilder for ListServerTlsPolicies {
4434 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4435 &mut self.0.options
4436 }
4437 }
4438
4439 #[derive(Clone, Debug)]
4456 pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
4457
4458 impl GetServerTlsPolicy {
4459 pub(crate) fn new(
4460 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4461 ) -> Self {
4462 Self(RequestBuilder::new(stub))
4463 }
4464
4465 pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
4467 mut self,
4468 v: V,
4469 ) -> Self {
4470 self.0.request = v.into();
4471 self
4472 }
4473
4474 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4476 self.0.options = v.into();
4477 self
4478 }
4479
4480 pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
4482 (*self.0.stub)
4483 .get_server_tls_policy(self.0.request, self.0.options)
4484 .await
4485 .map(gax::response::Response::into_body)
4486 }
4487
4488 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4492 self.0.request.name = v.into();
4493 self
4494 }
4495 }
4496
4497 #[doc(hidden)]
4498 impl gax::options::internal::RequestBuilder for GetServerTlsPolicy {
4499 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4500 &mut self.0.options
4501 }
4502 }
4503
4504 #[derive(Clone, Debug)]
4522 pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
4523
4524 impl CreateServerTlsPolicy {
4525 pub(crate) fn new(
4526 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4527 ) -> Self {
4528 Self(RequestBuilder::new(stub))
4529 }
4530
4531 pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
4533 mut self,
4534 v: V,
4535 ) -> Self {
4536 self.0.request = v.into();
4537 self
4538 }
4539
4540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4542 self.0.options = v.into();
4543 self
4544 }
4545
4546 pub async fn send(self) -> Result<longrunning::model::Operation> {
4553 (*self.0.stub)
4554 .create_server_tls_policy(self.0.request, self.0.options)
4555 .await
4556 .map(gax::response::Response::into_body)
4557 }
4558
4559 pub fn poller(
4561 self,
4562 ) -> impl lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
4563 {
4564 type Operation = lro::internal::Operation<
4565 crate::model::ServerTlsPolicy,
4566 crate::model::OperationMetadata,
4567 >;
4568 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4569 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4570
4571 let stub = self.0.stub.clone();
4572 let mut options = self.0.options.clone();
4573 options.set_retry_policy(gax::retry_policy::NeverRetry);
4574 let query = move |name| {
4575 let stub = stub.clone();
4576 let options = options.clone();
4577 async {
4578 let op = GetOperation::new(stub)
4579 .set_name(name)
4580 .with_options(options)
4581 .send()
4582 .await?;
4583 Ok(Operation::new(op))
4584 }
4585 };
4586
4587 let start = move || async {
4588 let op = self.send().await?;
4589 Ok(Operation::new(op))
4590 };
4591
4592 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4593 }
4594
4595 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4599 self.0.request.parent = v.into();
4600 self
4601 }
4602
4603 pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4607 self.0.request.server_tls_policy_id = v.into();
4608 self
4609 }
4610
4611 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
4615 where
4616 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4617 {
4618 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
4619 self
4620 }
4621
4622 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
4626 where
4627 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4628 {
4629 self.0.request.server_tls_policy = v.map(|x| x.into());
4630 self
4631 }
4632 }
4633
4634 #[doc(hidden)]
4635 impl gax::options::internal::RequestBuilder for CreateServerTlsPolicy {
4636 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4637 &mut self.0.options
4638 }
4639 }
4640
4641 #[derive(Clone, Debug)]
4659 pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
4660
4661 impl UpdateServerTlsPolicy {
4662 pub(crate) fn new(
4663 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4664 ) -> Self {
4665 Self(RequestBuilder::new(stub))
4666 }
4667
4668 pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
4670 mut self,
4671 v: V,
4672 ) -> Self {
4673 self.0.request = v.into();
4674 self
4675 }
4676
4677 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4679 self.0.options = v.into();
4680 self
4681 }
4682
4683 pub async fn send(self) -> Result<longrunning::model::Operation> {
4690 (*self.0.stub)
4691 .update_server_tls_policy(self.0.request, self.0.options)
4692 .await
4693 .map(gax::response::Response::into_body)
4694 }
4695
4696 pub fn poller(
4698 self,
4699 ) -> impl lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
4700 {
4701 type Operation = lro::internal::Operation<
4702 crate::model::ServerTlsPolicy,
4703 crate::model::OperationMetadata,
4704 >;
4705 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4706 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4707
4708 let stub = self.0.stub.clone();
4709 let mut options = self.0.options.clone();
4710 options.set_retry_policy(gax::retry_policy::NeverRetry);
4711 let query = move |name| {
4712 let stub = stub.clone();
4713 let options = options.clone();
4714 async {
4715 let op = GetOperation::new(stub)
4716 .set_name(name)
4717 .with_options(options)
4718 .send()
4719 .await?;
4720 Ok(Operation::new(op))
4721 }
4722 };
4723
4724 let start = move || async {
4725 let op = self.send().await?;
4726 Ok(Operation::new(op))
4727 };
4728
4729 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4730 }
4731
4732 pub fn set_update_mask<T>(mut self, v: T) -> Self
4734 where
4735 T: std::convert::Into<wkt::FieldMask>,
4736 {
4737 self.0.request.update_mask = std::option::Option::Some(v.into());
4738 self
4739 }
4740
4741 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4743 where
4744 T: std::convert::Into<wkt::FieldMask>,
4745 {
4746 self.0.request.update_mask = v.map(|x| x.into());
4747 self
4748 }
4749
4750 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
4754 where
4755 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4756 {
4757 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
4758 self
4759 }
4760
4761 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
4765 where
4766 T: std::convert::Into<crate::model::ServerTlsPolicy>,
4767 {
4768 self.0.request.server_tls_policy = v.map(|x| x.into());
4769 self
4770 }
4771 }
4772
4773 #[doc(hidden)]
4774 impl gax::options::internal::RequestBuilder for UpdateServerTlsPolicy {
4775 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4776 &mut self.0.options
4777 }
4778 }
4779
4780 #[derive(Clone, Debug)]
4798 pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
4799
4800 impl DeleteServerTlsPolicy {
4801 pub(crate) fn new(
4802 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4803 ) -> Self {
4804 Self(RequestBuilder::new(stub))
4805 }
4806
4807 pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
4809 mut self,
4810 v: V,
4811 ) -> Self {
4812 self.0.request = v.into();
4813 self
4814 }
4815
4816 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4818 self.0.options = v.into();
4819 self
4820 }
4821
4822 pub async fn send(self) -> Result<longrunning::model::Operation> {
4829 (*self.0.stub)
4830 .delete_server_tls_policy(self.0.request, self.0.options)
4831 .await
4832 .map(gax::response::Response::into_body)
4833 }
4834
4835 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4837 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4838 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4839 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4840
4841 let stub = self.0.stub.clone();
4842 let mut options = self.0.options.clone();
4843 options.set_retry_policy(gax::retry_policy::NeverRetry);
4844 let query = move |name| {
4845 let stub = stub.clone();
4846 let options = options.clone();
4847 async {
4848 let op = GetOperation::new(stub)
4849 .set_name(name)
4850 .with_options(options)
4851 .send()
4852 .await?;
4853 Ok(Operation::new(op))
4854 }
4855 };
4856
4857 let start = move || async {
4858 let op = self.send().await?;
4859 Ok(Operation::new(op))
4860 };
4861
4862 lro::internal::new_unit_response_poller(
4863 polling_error_policy,
4864 polling_backoff_policy,
4865 start,
4866 query,
4867 )
4868 }
4869
4870 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4874 self.0.request.name = v.into();
4875 self
4876 }
4877 }
4878
4879 #[doc(hidden)]
4880 impl gax::options::internal::RequestBuilder for DeleteServerTlsPolicy {
4881 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4882 &mut self.0.options
4883 }
4884 }
4885
4886 #[derive(Clone, Debug)]
4907 pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
4908
4909 impl ListClientTlsPolicies {
4910 pub(crate) fn new(
4911 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4912 ) -> Self {
4913 Self(RequestBuilder::new(stub))
4914 }
4915
4916 pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
4918 mut self,
4919 v: V,
4920 ) -> Self {
4921 self.0.request = v.into();
4922 self
4923 }
4924
4925 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4927 self.0.options = v.into();
4928 self
4929 }
4930
4931 pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
4933 (*self.0.stub)
4934 .list_client_tls_policies(self.0.request, self.0.options)
4935 .await
4936 .map(gax::response::Response::into_body)
4937 }
4938
4939 pub fn by_page(
4941 self,
4942 ) -> impl gax::paginator::Paginator<crate::model::ListClientTlsPoliciesResponse, gax::error::Error>
4943 {
4944 use std::clone::Clone;
4945 let token = self.0.request.page_token.clone();
4946 let execute = move |token: String| {
4947 let mut builder = self.clone();
4948 builder.0.request = builder.0.request.set_page_token(token);
4949 builder.send()
4950 };
4951 gax::paginator::internal::new_paginator(token, execute)
4952 }
4953
4954 pub fn by_item(
4956 self,
4957 ) -> impl gax::paginator::ItemPaginator<
4958 crate::model::ListClientTlsPoliciesResponse,
4959 gax::error::Error,
4960 > {
4961 use gax::paginator::Paginator;
4962 self.by_page().items()
4963 }
4964
4965 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4969 self.0.request.parent = v.into();
4970 self
4971 }
4972
4973 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4975 self.0.request.page_size = v.into();
4976 self
4977 }
4978
4979 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4981 self.0.request.page_token = v.into();
4982 self
4983 }
4984 }
4985
4986 #[doc(hidden)]
4987 impl gax::options::internal::RequestBuilder for ListClientTlsPolicies {
4988 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4989 &mut self.0.options
4990 }
4991 }
4992
4993 #[derive(Clone, Debug)]
5010 pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
5011
5012 impl GetClientTlsPolicy {
5013 pub(crate) fn new(
5014 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5015 ) -> Self {
5016 Self(RequestBuilder::new(stub))
5017 }
5018
5019 pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
5021 mut self,
5022 v: V,
5023 ) -> Self {
5024 self.0.request = v.into();
5025 self
5026 }
5027
5028 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5030 self.0.options = v.into();
5031 self
5032 }
5033
5034 pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
5036 (*self.0.stub)
5037 .get_client_tls_policy(self.0.request, self.0.options)
5038 .await
5039 .map(gax::response::Response::into_body)
5040 }
5041
5042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5046 self.0.request.name = v.into();
5047 self
5048 }
5049 }
5050
5051 #[doc(hidden)]
5052 impl gax::options::internal::RequestBuilder for GetClientTlsPolicy {
5053 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5054 &mut self.0.options
5055 }
5056 }
5057
5058 #[derive(Clone, Debug)]
5076 pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
5077
5078 impl CreateClientTlsPolicy {
5079 pub(crate) fn new(
5080 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5081 ) -> Self {
5082 Self(RequestBuilder::new(stub))
5083 }
5084
5085 pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
5087 mut self,
5088 v: V,
5089 ) -> Self {
5090 self.0.request = v.into();
5091 self
5092 }
5093
5094 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5096 self.0.options = v.into();
5097 self
5098 }
5099
5100 pub async fn send(self) -> Result<longrunning::model::Operation> {
5107 (*self.0.stub)
5108 .create_client_tls_policy(self.0.request, self.0.options)
5109 .await
5110 .map(gax::response::Response::into_body)
5111 }
5112
5113 pub fn poller(
5115 self,
5116 ) -> impl lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
5117 {
5118 type Operation = lro::internal::Operation<
5119 crate::model::ClientTlsPolicy,
5120 crate::model::OperationMetadata,
5121 >;
5122 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5123 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5124
5125 let stub = self.0.stub.clone();
5126 let mut options = self.0.options.clone();
5127 options.set_retry_policy(gax::retry_policy::NeverRetry);
5128 let query = move |name| {
5129 let stub = stub.clone();
5130 let options = options.clone();
5131 async {
5132 let op = GetOperation::new(stub)
5133 .set_name(name)
5134 .with_options(options)
5135 .send()
5136 .await?;
5137 Ok(Operation::new(op))
5138 }
5139 };
5140
5141 let start = move || async {
5142 let op = self.send().await?;
5143 Ok(Operation::new(op))
5144 };
5145
5146 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5147 }
5148
5149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5153 self.0.request.parent = v.into();
5154 self
5155 }
5156
5157 pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5161 self.0.request.client_tls_policy_id = v.into();
5162 self
5163 }
5164
5165 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
5169 where
5170 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5171 {
5172 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
5173 self
5174 }
5175
5176 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
5180 where
5181 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5182 {
5183 self.0.request.client_tls_policy = v.map(|x| x.into());
5184 self
5185 }
5186 }
5187
5188 #[doc(hidden)]
5189 impl gax::options::internal::RequestBuilder for CreateClientTlsPolicy {
5190 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5191 &mut self.0.options
5192 }
5193 }
5194
5195 #[derive(Clone, Debug)]
5213 pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
5214
5215 impl UpdateClientTlsPolicy {
5216 pub(crate) fn new(
5217 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5218 ) -> Self {
5219 Self(RequestBuilder::new(stub))
5220 }
5221
5222 pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
5224 mut self,
5225 v: V,
5226 ) -> Self {
5227 self.0.request = v.into();
5228 self
5229 }
5230
5231 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5233 self.0.options = v.into();
5234 self
5235 }
5236
5237 pub async fn send(self) -> Result<longrunning::model::Operation> {
5244 (*self.0.stub)
5245 .update_client_tls_policy(self.0.request, self.0.options)
5246 .await
5247 .map(gax::response::Response::into_body)
5248 }
5249
5250 pub fn poller(
5252 self,
5253 ) -> impl lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
5254 {
5255 type Operation = lro::internal::Operation<
5256 crate::model::ClientTlsPolicy,
5257 crate::model::OperationMetadata,
5258 >;
5259 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5260 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5261
5262 let stub = self.0.stub.clone();
5263 let mut options = self.0.options.clone();
5264 options.set_retry_policy(gax::retry_policy::NeverRetry);
5265 let query = move |name| {
5266 let stub = stub.clone();
5267 let options = options.clone();
5268 async {
5269 let op = GetOperation::new(stub)
5270 .set_name(name)
5271 .with_options(options)
5272 .send()
5273 .await?;
5274 Ok(Operation::new(op))
5275 }
5276 };
5277
5278 let start = move || async {
5279 let op = self.send().await?;
5280 Ok(Operation::new(op))
5281 };
5282
5283 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5284 }
5285
5286 pub fn set_update_mask<T>(mut self, v: T) -> Self
5288 where
5289 T: std::convert::Into<wkt::FieldMask>,
5290 {
5291 self.0.request.update_mask = std::option::Option::Some(v.into());
5292 self
5293 }
5294
5295 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5297 where
5298 T: std::convert::Into<wkt::FieldMask>,
5299 {
5300 self.0.request.update_mask = v.map(|x| x.into());
5301 self
5302 }
5303
5304 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
5308 where
5309 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5310 {
5311 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
5312 self
5313 }
5314
5315 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
5319 where
5320 T: std::convert::Into<crate::model::ClientTlsPolicy>,
5321 {
5322 self.0.request.client_tls_policy = v.map(|x| x.into());
5323 self
5324 }
5325 }
5326
5327 #[doc(hidden)]
5328 impl gax::options::internal::RequestBuilder for UpdateClientTlsPolicy {
5329 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5330 &mut self.0.options
5331 }
5332 }
5333
5334 #[derive(Clone, Debug)]
5352 pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
5353
5354 impl DeleteClientTlsPolicy {
5355 pub(crate) fn new(
5356 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5357 ) -> Self {
5358 Self(RequestBuilder::new(stub))
5359 }
5360
5361 pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
5363 mut self,
5364 v: V,
5365 ) -> Self {
5366 self.0.request = v.into();
5367 self
5368 }
5369
5370 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5372 self.0.options = v.into();
5373 self
5374 }
5375
5376 pub async fn send(self) -> Result<longrunning::model::Operation> {
5383 (*self.0.stub)
5384 .delete_client_tls_policy(self.0.request, self.0.options)
5385 .await
5386 .map(gax::response::Response::into_body)
5387 }
5388
5389 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5391 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5392 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5393 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5394
5395 let stub = self.0.stub.clone();
5396 let mut options = self.0.options.clone();
5397 options.set_retry_policy(gax::retry_policy::NeverRetry);
5398 let query = move |name| {
5399 let stub = stub.clone();
5400 let options = options.clone();
5401 async {
5402 let op = GetOperation::new(stub)
5403 .set_name(name)
5404 .with_options(options)
5405 .send()
5406 .await?;
5407 Ok(Operation::new(op))
5408 }
5409 };
5410
5411 let start = move || async {
5412 let op = self.send().await?;
5413 Ok(Operation::new(op))
5414 };
5415
5416 lro::internal::new_unit_response_poller(
5417 polling_error_policy,
5418 polling_backoff_policy,
5419 start,
5420 query,
5421 )
5422 }
5423
5424 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5428 self.0.request.name = v.into();
5429 self
5430 }
5431 }
5432
5433 #[doc(hidden)]
5434 impl gax::options::internal::RequestBuilder for DeleteClientTlsPolicy {
5435 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5436 &mut self.0.options
5437 }
5438 }
5439
5440 #[derive(Clone, Debug)]
5461 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5462
5463 impl ListLocations {
5464 pub(crate) fn new(
5465 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5466 ) -> Self {
5467 Self(RequestBuilder::new(stub))
5468 }
5469
5470 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5472 mut self,
5473 v: V,
5474 ) -> Self {
5475 self.0.request = v.into();
5476 self
5477 }
5478
5479 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5481 self.0.options = v.into();
5482 self
5483 }
5484
5485 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5487 (*self.0.stub)
5488 .list_locations(self.0.request, self.0.options)
5489 .await
5490 .map(gax::response::Response::into_body)
5491 }
5492
5493 pub fn by_page(
5495 self,
5496 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5497 {
5498 use std::clone::Clone;
5499 let token = self.0.request.page_token.clone();
5500 let execute = move |token: String| {
5501 let mut builder = self.clone();
5502 builder.0.request = builder.0.request.set_page_token(token);
5503 builder.send()
5504 };
5505 gax::paginator::internal::new_paginator(token, execute)
5506 }
5507
5508 pub fn by_item(
5510 self,
5511 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5512 {
5513 use gax::paginator::Paginator;
5514 self.by_page().items()
5515 }
5516
5517 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5519 self.0.request.name = v.into();
5520 self
5521 }
5522
5523 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5525 self.0.request.filter = v.into();
5526 self
5527 }
5528
5529 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5531 self.0.request.page_size = v.into();
5532 self
5533 }
5534
5535 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5537 self.0.request.page_token = v.into();
5538 self
5539 }
5540 }
5541
5542 #[doc(hidden)]
5543 impl gax::options::internal::RequestBuilder for ListLocations {
5544 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5545 &mut self.0.options
5546 }
5547 }
5548
5549 #[derive(Clone, Debug)]
5566 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5567
5568 impl GetLocation {
5569 pub(crate) fn new(
5570 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5571 ) -> Self {
5572 Self(RequestBuilder::new(stub))
5573 }
5574
5575 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5577 self.0.request = v.into();
5578 self
5579 }
5580
5581 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5583 self.0.options = v.into();
5584 self
5585 }
5586
5587 pub async fn send(self) -> Result<location::model::Location> {
5589 (*self.0.stub)
5590 .get_location(self.0.request, self.0.options)
5591 .await
5592 .map(gax::response::Response::into_body)
5593 }
5594
5595 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5597 self.0.request.name = v.into();
5598 self
5599 }
5600 }
5601
5602 #[doc(hidden)]
5603 impl gax::options::internal::RequestBuilder for GetLocation {
5604 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5605 &mut self.0.options
5606 }
5607 }
5608
5609 #[derive(Clone, Debug)]
5626 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5627
5628 impl SetIamPolicy {
5629 pub(crate) fn new(
5630 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5631 ) -> Self {
5632 Self(RequestBuilder::new(stub))
5633 }
5634
5635 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5637 self.0.request = v.into();
5638 self
5639 }
5640
5641 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5643 self.0.options = v.into();
5644 self
5645 }
5646
5647 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5649 (*self.0.stub)
5650 .set_iam_policy(self.0.request, self.0.options)
5651 .await
5652 .map(gax::response::Response::into_body)
5653 }
5654
5655 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5659 self.0.request.resource = v.into();
5660 self
5661 }
5662
5663 pub fn set_policy<T>(mut self, v: T) -> Self
5667 where
5668 T: std::convert::Into<iam_v1::model::Policy>,
5669 {
5670 self.0.request.policy = std::option::Option::Some(v.into());
5671 self
5672 }
5673
5674 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5678 where
5679 T: std::convert::Into<iam_v1::model::Policy>,
5680 {
5681 self.0.request.policy = v.map(|x| x.into());
5682 self
5683 }
5684
5685 pub fn set_update_mask<T>(mut self, v: T) -> Self
5687 where
5688 T: std::convert::Into<wkt::FieldMask>,
5689 {
5690 self.0.request.update_mask = std::option::Option::Some(v.into());
5691 self
5692 }
5693
5694 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5696 where
5697 T: std::convert::Into<wkt::FieldMask>,
5698 {
5699 self.0.request.update_mask = v.map(|x| x.into());
5700 self
5701 }
5702 }
5703
5704 #[doc(hidden)]
5705 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5706 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5707 &mut self.0.options
5708 }
5709 }
5710
5711 #[derive(Clone, Debug)]
5728 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5729
5730 impl GetIamPolicy {
5731 pub(crate) fn new(
5732 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5733 ) -> Self {
5734 Self(RequestBuilder::new(stub))
5735 }
5736
5737 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5739 self.0.request = v.into();
5740 self
5741 }
5742
5743 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5745 self.0.options = v.into();
5746 self
5747 }
5748
5749 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5751 (*self.0.stub)
5752 .get_iam_policy(self.0.request, self.0.options)
5753 .await
5754 .map(gax::response::Response::into_body)
5755 }
5756
5757 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5761 self.0.request.resource = v.into();
5762 self
5763 }
5764
5765 pub fn set_options<T>(mut self, v: T) -> Self
5767 where
5768 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5769 {
5770 self.0.request.options = std::option::Option::Some(v.into());
5771 self
5772 }
5773
5774 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5776 where
5777 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5778 {
5779 self.0.request.options = v.map(|x| x.into());
5780 self
5781 }
5782 }
5783
5784 #[doc(hidden)]
5785 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5786 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5787 &mut self.0.options
5788 }
5789 }
5790
5791 #[derive(Clone, Debug)]
5808 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5809
5810 impl TestIamPermissions {
5811 pub(crate) fn new(
5812 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5813 ) -> Self {
5814 Self(RequestBuilder::new(stub))
5815 }
5816
5817 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5819 mut self,
5820 v: V,
5821 ) -> Self {
5822 self.0.request = v.into();
5823 self
5824 }
5825
5826 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5828 self.0.options = v.into();
5829 self
5830 }
5831
5832 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5834 (*self.0.stub)
5835 .test_iam_permissions(self.0.request, self.0.options)
5836 .await
5837 .map(gax::response::Response::into_body)
5838 }
5839
5840 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5844 self.0.request.resource = v.into();
5845 self
5846 }
5847
5848 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5852 where
5853 T: std::iter::IntoIterator<Item = V>,
5854 V: std::convert::Into<std::string::String>,
5855 {
5856 use std::iter::Iterator;
5857 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5858 self
5859 }
5860 }
5861
5862 #[doc(hidden)]
5863 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5864 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5865 &mut self.0.options
5866 }
5867 }
5868
5869 #[derive(Clone, Debug)]
5890 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5891
5892 impl ListOperations {
5893 pub(crate) fn new(
5894 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5895 ) -> Self {
5896 Self(RequestBuilder::new(stub))
5897 }
5898
5899 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5901 mut self,
5902 v: V,
5903 ) -> Self {
5904 self.0.request = v.into();
5905 self
5906 }
5907
5908 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5910 self.0.options = v.into();
5911 self
5912 }
5913
5914 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5916 (*self.0.stub)
5917 .list_operations(self.0.request, self.0.options)
5918 .await
5919 .map(gax::response::Response::into_body)
5920 }
5921
5922 pub fn by_page(
5924 self,
5925 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5926 {
5927 use std::clone::Clone;
5928 let token = self.0.request.page_token.clone();
5929 let execute = move |token: String| {
5930 let mut builder = self.clone();
5931 builder.0.request = builder.0.request.set_page_token(token);
5932 builder.send()
5933 };
5934 gax::paginator::internal::new_paginator(token, execute)
5935 }
5936
5937 pub fn by_item(
5939 self,
5940 ) -> impl gax::paginator::ItemPaginator<
5941 longrunning::model::ListOperationsResponse,
5942 gax::error::Error,
5943 > {
5944 use gax::paginator::Paginator;
5945 self.by_page().items()
5946 }
5947
5948 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5950 self.0.request.name = v.into();
5951 self
5952 }
5953
5954 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5956 self.0.request.filter = v.into();
5957 self
5958 }
5959
5960 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5962 self.0.request.page_size = v.into();
5963 self
5964 }
5965
5966 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5968 self.0.request.page_token = v.into();
5969 self
5970 }
5971
5972 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5974 self.0.request.return_partial_success = v.into();
5975 self
5976 }
5977 }
5978
5979 #[doc(hidden)]
5980 impl gax::options::internal::RequestBuilder for ListOperations {
5981 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5982 &mut self.0.options
5983 }
5984 }
5985
5986 #[derive(Clone, Debug)]
6003 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6004
6005 impl GetOperation {
6006 pub(crate) fn new(
6007 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6008 ) -> Self {
6009 Self(RequestBuilder::new(stub))
6010 }
6011
6012 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6014 mut self,
6015 v: V,
6016 ) -> Self {
6017 self.0.request = v.into();
6018 self
6019 }
6020
6021 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6023 self.0.options = v.into();
6024 self
6025 }
6026
6027 pub async fn send(self) -> Result<longrunning::model::Operation> {
6029 (*self.0.stub)
6030 .get_operation(self.0.request, self.0.options)
6031 .await
6032 .map(gax::response::Response::into_body)
6033 }
6034
6035 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6037 self.0.request.name = v.into();
6038 self
6039 }
6040 }
6041
6042 #[doc(hidden)]
6043 impl gax::options::internal::RequestBuilder for GetOperation {
6044 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6045 &mut self.0.options
6046 }
6047 }
6048
6049 #[derive(Clone, Debug)]
6066 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6067
6068 impl DeleteOperation {
6069 pub(crate) fn new(
6070 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6071 ) -> Self {
6072 Self(RequestBuilder::new(stub))
6073 }
6074
6075 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6077 mut self,
6078 v: V,
6079 ) -> Self {
6080 self.0.request = v.into();
6081 self
6082 }
6083
6084 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6086 self.0.options = v.into();
6087 self
6088 }
6089
6090 pub async fn send(self) -> Result<()> {
6092 (*self.0.stub)
6093 .delete_operation(self.0.request, self.0.options)
6094 .await
6095 .map(gax::response::Response::into_body)
6096 }
6097
6098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6100 self.0.request.name = v.into();
6101 self
6102 }
6103 }
6104
6105 #[doc(hidden)]
6106 impl gax::options::internal::RequestBuilder for DeleteOperation {
6107 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6108 &mut self.0.options
6109 }
6110 }
6111
6112 #[derive(Clone, Debug)]
6129 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6130
6131 impl CancelOperation {
6132 pub(crate) fn new(
6133 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6134 ) -> Self {
6135 Self(RequestBuilder::new(stub))
6136 }
6137
6138 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6140 mut self,
6141 v: V,
6142 ) -> Self {
6143 self.0.request = v.into();
6144 self
6145 }
6146
6147 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6149 self.0.options = v.into();
6150 self
6151 }
6152
6153 pub async fn send(self) -> Result<()> {
6155 (*self.0.stub)
6156 .cancel_operation(self.0.request, self.0.options)
6157 .await
6158 .map(gax::response::Response::into_body)
6159 }
6160
6161 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6163 self.0.request.name = v.into();
6164 self
6165 }
6166 }
6167
6168 #[doc(hidden)]
6169 impl gax::options::internal::RequestBuilder for CancelOperation {
6170 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6171 &mut self.0.options
6172 }
6173 }
6174}