1pub mod address_group_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::AddressGroupService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = AddressGroupService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
96
97 impl ListAddressGroups {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
106 mut self,
107 v: V,
108 ) -> Self {
109 self.0.request = v.into();
110 self
111 }
112
113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
115 self.0.options = v.into();
116 self
117 }
118
119 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
121 (*self.0.stub)
122 .list_address_groups(self.0.request, self.0.options)
123 .await
124 .map(crate::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl google_cloud_gax::paginator::Paginator<
131 crate::model::ListAddressGroupsResponse,
132 crate::Error,
133 > {
134 use std::clone::Clone;
135 let token = self.0.request.page_token.clone();
136 let execute = move |token: String| {
137 let mut builder = self.clone();
138 builder.0.request = builder.0.request.set_page_token(token);
139 builder.send()
140 };
141 google_cloud_gax::paginator::internal::new_paginator(token, execute)
142 }
143
144 pub fn by_item(
146 self,
147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
148 crate::model::ListAddressGroupsResponse,
149 crate::Error,
150 > {
151 use google_cloud_gax::paginator::Paginator;
152 self.by_page().items()
153 }
154
155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159 self.0.request.parent = v.into();
160 self
161 }
162
163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165 self.0.request.page_size = v.into();
166 self
167 }
168
169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.page_token = v.into();
172 self
173 }
174
175 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
177 self.0.request.return_partial_success = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl crate::RequestBuilder for ListAddressGroups {
184 fn request_options(&mut self) -> &mut crate::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
206 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
207
208 impl GetAddressGroup {
209 pub(crate) fn new(
210 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
211 ) -> Self {
212 Self(RequestBuilder::new(stub))
213 }
214
215 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
217 self.0.request = v.into();
218 self
219 }
220
221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223 self.0.options = v.into();
224 self
225 }
226
227 pub async fn send(self) -> Result<crate::model::AddressGroup> {
229 (*self.0.stub)
230 .get_address_group(self.0.request, self.0.options)
231 .await
232 .map(crate::Response::into_body)
233 }
234
235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239 self.0.request.name = v.into();
240 self
241 }
242 }
243
244 #[doc(hidden)]
245 impl crate::RequestBuilder for GetAddressGroup {
246 fn request_options(&mut self) -> &mut crate::RequestOptions {
247 &mut self.0.options
248 }
249 }
250
251 #[derive(Clone, Debug)]
269 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
270
271 impl CreateAddressGroup {
272 pub(crate) fn new(
273 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
274 ) -> Self {
275 Self(RequestBuilder::new(stub))
276 }
277
278 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
280 mut self,
281 v: V,
282 ) -> Self {
283 self.0.request = v.into();
284 self
285 }
286
287 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
289 self.0.options = v.into();
290 self
291 }
292
293 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
300 (*self.0.stub)
301 .create_address_group(self.0.request, self.0.options)
302 .await
303 .map(crate::Response::into_body)
304 }
305
306 pub fn poller(
308 self,
309 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
310 {
311 type Operation = google_cloud_lro::internal::Operation<
312 crate::model::AddressGroup,
313 crate::model::OperationMetadata,
314 >;
315 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
316 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
317 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
318 if let Some(ref mut details) = poller_options.tracing {
319 details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::create_address_group::until_done";
320 }
321
322 let stub = self.0.stub.clone();
323 let mut options = self.0.options.clone();
324 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
325 let query = move |name| {
326 let stub = stub.clone();
327 let options = options.clone();
328 async {
329 let op = GetOperation::new(stub)
330 .set_name(name)
331 .with_options(options)
332 .send()
333 .await?;
334 Ok(Operation::new(op))
335 }
336 };
337
338 let start = move || async {
339 let op = self.send().await?;
340 Ok(Operation::new(op))
341 };
342
343 use google_cloud_lro::internal::PollerExt;
344 {
345 google_cloud_lro::internal::new_poller(
346 polling_error_policy,
347 polling_backoff_policy,
348 start,
349 query,
350 )
351 }
352 .with_options(poller_options)
353 }
354
355 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
359 self.0.request.parent = v.into();
360 self
361 }
362
363 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
367 self.0.request.address_group_id = v.into();
368 self
369 }
370
371 pub fn set_address_group<T>(mut self, v: T) -> Self
375 where
376 T: std::convert::Into<crate::model::AddressGroup>,
377 {
378 self.0.request.address_group = std::option::Option::Some(v.into());
379 self
380 }
381
382 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
386 where
387 T: std::convert::Into<crate::model::AddressGroup>,
388 {
389 self.0.request.address_group = v.map(|x| x.into());
390 self
391 }
392
393 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
395 self.0.request.request_id = v.into();
396 self
397 }
398 }
399
400 #[doc(hidden)]
401 impl crate::RequestBuilder for CreateAddressGroup {
402 fn request_options(&mut self) -> &mut crate::RequestOptions {
403 &mut self.0.options
404 }
405 }
406
407 #[derive(Clone, Debug)]
425 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
426
427 impl UpdateAddressGroup {
428 pub(crate) fn new(
429 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
430 ) -> Self {
431 Self(RequestBuilder::new(stub))
432 }
433
434 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
436 mut self,
437 v: V,
438 ) -> Self {
439 self.0.request = v.into();
440 self
441 }
442
443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
445 self.0.options = v.into();
446 self
447 }
448
449 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
456 (*self.0.stub)
457 .update_address_group(self.0.request, self.0.options)
458 .await
459 .map(crate::Response::into_body)
460 }
461
462 pub fn poller(
464 self,
465 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
466 {
467 type Operation = google_cloud_lro::internal::Operation<
468 crate::model::AddressGroup,
469 crate::model::OperationMetadata,
470 >;
471 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
472 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
473 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
474 if let Some(ref mut details) = poller_options.tracing {
475 details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::update_address_group::until_done";
476 }
477
478 let stub = self.0.stub.clone();
479 let mut options = self.0.options.clone();
480 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
481 let query = move |name| {
482 let stub = stub.clone();
483 let options = options.clone();
484 async {
485 let op = GetOperation::new(stub)
486 .set_name(name)
487 .with_options(options)
488 .send()
489 .await?;
490 Ok(Operation::new(op))
491 }
492 };
493
494 let start = move || async {
495 let op = self.send().await?;
496 Ok(Operation::new(op))
497 };
498
499 use google_cloud_lro::internal::PollerExt;
500 {
501 google_cloud_lro::internal::new_poller(
502 polling_error_policy,
503 polling_backoff_policy,
504 start,
505 query,
506 )
507 }
508 .with_options(poller_options)
509 }
510
511 pub fn set_update_mask<T>(mut self, v: T) -> Self
513 where
514 T: std::convert::Into<wkt::FieldMask>,
515 {
516 self.0.request.update_mask = std::option::Option::Some(v.into());
517 self
518 }
519
520 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
522 where
523 T: std::convert::Into<wkt::FieldMask>,
524 {
525 self.0.request.update_mask = v.map(|x| x.into());
526 self
527 }
528
529 pub fn set_address_group<T>(mut self, v: T) -> Self
533 where
534 T: std::convert::Into<crate::model::AddressGroup>,
535 {
536 self.0.request.address_group = std::option::Option::Some(v.into());
537 self
538 }
539
540 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
544 where
545 T: std::convert::Into<crate::model::AddressGroup>,
546 {
547 self.0.request.address_group = v.map(|x| x.into());
548 self
549 }
550
551 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
553 self.0.request.request_id = v.into();
554 self
555 }
556 }
557
558 #[doc(hidden)]
559 impl crate::RequestBuilder for UpdateAddressGroup {
560 fn request_options(&mut self) -> &mut crate::RequestOptions {
561 &mut self.0.options
562 }
563 }
564
565 #[derive(Clone, Debug)]
583 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
584
585 impl AddAddressGroupItems {
586 pub(crate) fn new(
587 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
588 ) -> Self {
589 Self(RequestBuilder::new(stub))
590 }
591
592 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
594 mut self,
595 v: V,
596 ) -> Self {
597 self.0.request = v.into();
598 self
599 }
600
601 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
603 self.0.options = v.into();
604 self
605 }
606
607 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
614 (*self.0.stub)
615 .add_address_group_items(self.0.request, self.0.options)
616 .await
617 .map(crate::Response::into_body)
618 }
619
620 pub fn poller(
622 self,
623 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
624 {
625 type Operation = google_cloud_lro::internal::Operation<
626 crate::model::AddressGroup,
627 crate::model::OperationMetadata,
628 >;
629 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
630 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
631 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
632 if let Some(ref mut details) = poller_options.tracing {
633 details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::add_address_group_items::until_done";
634 }
635
636 let stub = self.0.stub.clone();
637 let mut options = self.0.options.clone();
638 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
639 let query = move |name| {
640 let stub = stub.clone();
641 let options = options.clone();
642 async {
643 let op = GetOperation::new(stub)
644 .set_name(name)
645 .with_options(options)
646 .send()
647 .await?;
648 Ok(Operation::new(op))
649 }
650 };
651
652 let start = move || async {
653 let op = self.send().await?;
654 Ok(Operation::new(op))
655 };
656
657 use google_cloud_lro::internal::PollerExt;
658 {
659 google_cloud_lro::internal::new_poller(
660 polling_error_policy,
661 polling_backoff_policy,
662 start,
663 query,
664 )
665 }
666 .with_options(poller_options)
667 }
668
669 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
673 self.0.request.address_group = v.into();
674 self
675 }
676
677 pub fn set_items<T, V>(mut self, v: T) -> Self
681 where
682 T: std::iter::IntoIterator<Item = V>,
683 V: std::convert::Into<std::string::String>,
684 {
685 use std::iter::Iterator;
686 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
687 self
688 }
689
690 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
692 self.0.request.request_id = v.into();
693 self
694 }
695 }
696
697 #[doc(hidden)]
698 impl crate::RequestBuilder for AddAddressGroupItems {
699 fn request_options(&mut self) -> &mut crate::RequestOptions {
700 &mut self.0.options
701 }
702 }
703
704 #[derive(Clone, Debug)]
722 pub struct RemoveAddressGroupItems(
723 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
724 );
725
726 impl RemoveAddressGroupItems {
727 pub(crate) fn new(
728 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
729 ) -> Self {
730 Self(RequestBuilder::new(stub))
731 }
732
733 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
735 mut self,
736 v: V,
737 ) -> Self {
738 self.0.request = v.into();
739 self
740 }
741
742 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
744 self.0.options = v.into();
745 self
746 }
747
748 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
755 (*self.0.stub)
756 .remove_address_group_items(self.0.request, self.0.options)
757 .await
758 .map(crate::Response::into_body)
759 }
760
761 pub fn poller(
763 self,
764 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
765 {
766 type Operation = google_cloud_lro::internal::Operation<
767 crate::model::AddressGroup,
768 crate::model::OperationMetadata,
769 >;
770 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
771 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
772 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
773 if let Some(ref mut details) = poller_options.tracing {
774 details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::remove_address_group_items::until_done";
775 }
776
777 let stub = self.0.stub.clone();
778 let mut options = self.0.options.clone();
779 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
780 let query = move |name| {
781 let stub = stub.clone();
782 let options = options.clone();
783 async {
784 let op = GetOperation::new(stub)
785 .set_name(name)
786 .with_options(options)
787 .send()
788 .await?;
789 Ok(Operation::new(op))
790 }
791 };
792
793 let start = move || async {
794 let op = self.send().await?;
795 Ok(Operation::new(op))
796 };
797
798 use google_cloud_lro::internal::PollerExt;
799 {
800 google_cloud_lro::internal::new_poller(
801 polling_error_policy,
802 polling_backoff_policy,
803 start,
804 query,
805 )
806 }
807 .with_options(poller_options)
808 }
809
810 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
814 self.0.request.address_group = v.into();
815 self
816 }
817
818 pub fn set_items<T, V>(mut self, v: T) -> Self
822 where
823 T: std::iter::IntoIterator<Item = V>,
824 V: std::convert::Into<std::string::String>,
825 {
826 use std::iter::Iterator;
827 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
828 self
829 }
830
831 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
833 self.0.request.request_id = v.into();
834 self
835 }
836 }
837
838 #[doc(hidden)]
839 impl crate::RequestBuilder for RemoveAddressGroupItems {
840 fn request_options(&mut self) -> &mut crate::RequestOptions {
841 &mut self.0.options
842 }
843 }
844
845 #[derive(Clone, Debug)]
863 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
864
865 impl CloneAddressGroupItems {
866 pub(crate) fn new(
867 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
868 ) -> Self {
869 Self(RequestBuilder::new(stub))
870 }
871
872 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
874 mut self,
875 v: V,
876 ) -> Self {
877 self.0.request = v.into();
878 self
879 }
880
881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
883 self.0.options = v.into();
884 self
885 }
886
887 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
894 (*self.0.stub)
895 .clone_address_group_items(self.0.request, self.0.options)
896 .await
897 .map(crate::Response::into_body)
898 }
899
900 pub fn poller(
902 self,
903 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
904 {
905 type Operation = google_cloud_lro::internal::Operation<
906 crate::model::AddressGroup,
907 crate::model::OperationMetadata,
908 >;
909 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
910 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
911 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
912 if let Some(ref mut details) = poller_options.tracing {
913 details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::clone_address_group_items::until_done";
914 }
915
916 let stub = self.0.stub.clone();
917 let mut options = self.0.options.clone();
918 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
919 let query = move |name| {
920 let stub = stub.clone();
921 let options = options.clone();
922 async {
923 let op = GetOperation::new(stub)
924 .set_name(name)
925 .with_options(options)
926 .send()
927 .await?;
928 Ok(Operation::new(op))
929 }
930 };
931
932 let start = move || async {
933 let op = self.send().await?;
934 Ok(Operation::new(op))
935 };
936
937 use google_cloud_lro::internal::PollerExt;
938 {
939 google_cloud_lro::internal::new_poller(
940 polling_error_policy,
941 polling_backoff_policy,
942 start,
943 query,
944 )
945 }
946 .with_options(poller_options)
947 }
948
949 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
953 self.0.request.address_group = v.into();
954 self
955 }
956
957 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
961 self.0.request.source_address_group = v.into();
962 self
963 }
964
965 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
967 self.0.request.request_id = v.into();
968 self
969 }
970 }
971
972 #[doc(hidden)]
973 impl crate::RequestBuilder for CloneAddressGroupItems {
974 fn request_options(&mut self) -> &mut crate::RequestOptions {
975 &mut self.0.options
976 }
977 }
978
979 #[derive(Clone, Debug)]
997 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
998
999 impl DeleteAddressGroup {
1000 pub(crate) fn new(
1001 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1002 ) -> Self {
1003 Self(RequestBuilder::new(stub))
1004 }
1005
1006 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
1008 mut self,
1009 v: V,
1010 ) -> Self {
1011 self.0.request = v.into();
1012 self
1013 }
1014
1015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1017 self.0.options = v.into();
1018 self
1019 }
1020
1021 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1028 (*self.0.stub)
1029 .delete_address_group(self.0.request, self.0.options)
1030 .await
1031 .map(crate::Response::into_body)
1032 }
1033
1034 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1036 type Operation =
1037 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1038 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1039 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1040 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1041 if let Some(ref mut details) = poller_options.tracing {
1042 details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::delete_address_group::until_done";
1043 }
1044
1045 let stub = self.0.stub.clone();
1046 let mut options = self.0.options.clone();
1047 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1048 let query = move |name| {
1049 let stub = stub.clone();
1050 let options = options.clone();
1051 async {
1052 let op = GetOperation::new(stub)
1053 .set_name(name)
1054 .with_options(options)
1055 .send()
1056 .await?;
1057 Ok(Operation::new(op))
1058 }
1059 };
1060
1061 let start = move || async {
1062 let op = self.send().await?;
1063 Ok(Operation::new(op))
1064 };
1065
1066 use google_cloud_lro::internal::PollerExt;
1067 {
1068 google_cloud_lro::internal::new_unit_response_poller(
1069 polling_error_policy,
1070 polling_backoff_policy,
1071 start,
1072 query,
1073 )
1074 }
1075 .with_options(poller_options)
1076 }
1077
1078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082 self.0.request.name = v.into();
1083 self
1084 }
1085
1086 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1088 self.0.request.request_id = v.into();
1089 self
1090 }
1091 }
1092
1093 #[doc(hidden)]
1094 impl crate::RequestBuilder for DeleteAddressGroup {
1095 fn request_options(&mut self) -> &mut crate::RequestOptions {
1096 &mut self.0.options
1097 }
1098 }
1099
1100 #[derive(Clone, Debug)]
1121 pub struct ListAddressGroupReferences(
1122 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1123 );
1124
1125 impl ListAddressGroupReferences {
1126 pub(crate) fn new(
1127 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1128 ) -> Self {
1129 Self(RequestBuilder::new(stub))
1130 }
1131
1132 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1134 mut self,
1135 v: V,
1136 ) -> Self {
1137 self.0.request = v.into();
1138 self
1139 }
1140
1141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1143 self.0.options = v.into();
1144 self
1145 }
1146
1147 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1149 (*self.0.stub)
1150 .list_address_group_references(self.0.request, self.0.options)
1151 .await
1152 .map(crate::Response::into_body)
1153 }
1154
1155 pub fn by_page(
1157 self,
1158 ) -> impl google_cloud_gax::paginator::Paginator<
1159 crate::model::ListAddressGroupReferencesResponse,
1160 crate::Error,
1161 > {
1162 use std::clone::Clone;
1163 let token = self.0.request.page_token.clone();
1164 let execute = move |token: String| {
1165 let mut builder = self.clone();
1166 builder.0.request = builder.0.request.set_page_token(token);
1167 builder.send()
1168 };
1169 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1170 }
1171
1172 pub fn by_item(
1174 self,
1175 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1176 crate::model::ListAddressGroupReferencesResponse,
1177 crate::Error,
1178 > {
1179 use google_cloud_gax::paginator::Paginator;
1180 self.by_page().items()
1181 }
1182
1183 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1187 self.0.request.address_group = v.into();
1188 self
1189 }
1190
1191 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1193 self.0.request.page_size = v.into();
1194 self
1195 }
1196
1197 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1199 self.0.request.page_token = v.into();
1200 self
1201 }
1202 }
1203
1204 #[doc(hidden)]
1205 impl crate::RequestBuilder for ListAddressGroupReferences {
1206 fn request_options(&mut self) -> &mut crate::RequestOptions {
1207 &mut self.0.options
1208 }
1209 }
1210
1211 #[derive(Clone, Debug)]
1232 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1233
1234 impl ListLocations {
1235 pub(crate) fn new(
1236 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1237 ) -> Self {
1238 Self(RequestBuilder::new(stub))
1239 }
1240
1241 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1243 mut self,
1244 v: V,
1245 ) -> Self {
1246 self.0.request = v.into();
1247 self
1248 }
1249
1250 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1252 self.0.options = v.into();
1253 self
1254 }
1255
1256 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1258 (*self.0.stub)
1259 .list_locations(self.0.request, self.0.options)
1260 .await
1261 .map(crate::Response::into_body)
1262 }
1263
1264 pub fn by_page(
1266 self,
1267 ) -> impl google_cloud_gax::paginator::Paginator<
1268 google_cloud_location::model::ListLocationsResponse,
1269 crate::Error,
1270 > {
1271 use std::clone::Clone;
1272 let token = self.0.request.page_token.clone();
1273 let execute = move |token: String| {
1274 let mut builder = self.clone();
1275 builder.0.request = builder.0.request.set_page_token(token);
1276 builder.send()
1277 };
1278 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1279 }
1280
1281 pub fn by_item(
1283 self,
1284 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1285 google_cloud_location::model::ListLocationsResponse,
1286 crate::Error,
1287 > {
1288 use google_cloud_gax::paginator::Paginator;
1289 self.by_page().items()
1290 }
1291
1292 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1294 self.0.request.name = v.into();
1295 self
1296 }
1297
1298 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1300 self.0.request.filter = v.into();
1301 self
1302 }
1303
1304 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1306 self.0.request.page_size = v.into();
1307 self
1308 }
1309
1310 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1312 self.0.request.page_token = v.into();
1313 self
1314 }
1315 }
1316
1317 #[doc(hidden)]
1318 impl crate::RequestBuilder for ListLocations {
1319 fn request_options(&mut self) -> &mut crate::RequestOptions {
1320 &mut self.0.options
1321 }
1322 }
1323
1324 #[derive(Clone, Debug)]
1341 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1342
1343 impl GetLocation {
1344 pub(crate) fn new(
1345 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1346 ) -> Self {
1347 Self(RequestBuilder::new(stub))
1348 }
1349
1350 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1352 mut self,
1353 v: V,
1354 ) -> Self {
1355 self.0.request = v.into();
1356 self
1357 }
1358
1359 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1361 self.0.options = v.into();
1362 self
1363 }
1364
1365 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1367 (*self.0.stub)
1368 .get_location(self.0.request, self.0.options)
1369 .await
1370 .map(crate::Response::into_body)
1371 }
1372
1373 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1375 self.0.request.name = v.into();
1376 self
1377 }
1378 }
1379
1380 #[doc(hidden)]
1381 impl crate::RequestBuilder for GetLocation {
1382 fn request_options(&mut self) -> &mut crate::RequestOptions {
1383 &mut self.0.options
1384 }
1385 }
1386
1387 #[derive(Clone, Debug)]
1404 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1405
1406 impl SetIamPolicy {
1407 pub(crate) fn new(
1408 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1409 ) -> Self {
1410 Self(RequestBuilder::new(stub))
1411 }
1412
1413 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1415 mut self,
1416 v: V,
1417 ) -> Self {
1418 self.0.request = v.into();
1419 self
1420 }
1421
1422 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1424 self.0.options = v.into();
1425 self
1426 }
1427
1428 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1430 (*self.0.stub)
1431 .set_iam_policy(self.0.request, self.0.options)
1432 .await
1433 .map(crate::Response::into_body)
1434 }
1435
1436 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440 self.0.request.resource = v.into();
1441 self
1442 }
1443
1444 pub fn set_policy<T>(mut self, v: T) -> Self
1448 where
1449 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1450 {
1451 self.0.request.policy = std::option::Option::Some(v.into());
1452 self
1453 }
1454
1455 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1459 where
1460 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1461 {
1462 self.0.request.policy = v.map(|x| x.into());
1463 self
1464 }
1465
1466 pub fn set_update_mask<T>(mut self, v: T) -> Self
1468 where
1469 T: std::convert::Into<wkt::FieldMask>,
1470 {
1471 self.0.request.update_mask = std::option::Option::Some(v.into());
1472 self
1473 }
1474
1475 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1477 where
1478 T: std::convert::Into<wkt::FieldMask>,
1479 {
1480 self.0.request.update_mask = v.map(|x| x.into());
1481 self
1482 }
1483 }
1484
1485 #[doc(hidden)]
1486 impl crate::RequestBuilder for SetIamPolicy {
1487 fn request_options(&mut self) -> &mut crate::RequestOptions {
1488 &mut self.0.options
1489 }
1490 }
1491
1492 #[derive(Clone, Debug)]
1509 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1510
1511 impl GetIamPolicy {
1512 pub(crate) fn new(
1513 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1514 ) -> Self {
1515 Self(RequestBuilder::new(stub))
1516 }
1517
1518 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1520 mut self,
1521 v: V,
1522 ) -> Self {
1523 self.0.request = v.into();
1524 self
1525 }
1526
1527 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1529 self.0.options = v.into();
1530 self
1531 }
1532
1533 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1535 (*self.0.stub)
1536 .get_iam_policy(self.0.request, self.0.options)
1537 .await
1538 .map(crate::Response::into_body)
1539 }
1540
1541 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1545 self.0.request.resource = v.into();
1546 self
1547 }
1548
1549 pub fn set_options<T>(mut self, v: T) -> Self
1551 where
1552 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1553 {
1554 self.0.request.options = std::option::Option::Some(v.into());
1555 self
1556 }
1557
1558 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1560 where
1561 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1562 {
1563 self.0.request.options = v.map(|x| x.into());
1564 self
1565 }
1566 }
1567
1568 #[doc(hidden)]
1569 impl crate::RequestBuilder for GetIamPolicy {
1570 fn request_options(&mut self) -> &mut crate::RequestOptions {
1571 &mut self.0.options
1572 }
1573 }
1574
1575 #[derive(Clone, Debug)]
1592 pub struct TestIamPermissions(
1593 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1594 );
1595
1596 impl TestIamPermissions {
1597 pub(crate) fn new(
1598 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1599 ) -> Self {
1600 Self(RequestBuilder::new(stub))
1601 }
1602
1603 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1605 mut self,
1606 v: V,
1607 ) -> Self {
1608 self.0.request = v.into();
1609 self
1610 }
1611
1612 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1614 self.0.options = v.into();
1615 self
1616 }
1617
1618 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1620 (*self.0.stub)
1621 .test_iam_permissions(self.0.request, self.0.options)
1622 .await
1623 .map(crate::Response::into_body)
1624 }
1625
1626 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1630 self.0.request.resource = v.into();
1631 self
1632 }
1633
1634 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1638 where
1639 T: std::iter::IntoIterator<Item = V>,
1640 V: std::convert::Into<std::string::String>,
1641 {
1642 use std::iter::Iterator;
1643 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1644 self
1645 }
1646 }
1647
1648 #[doc(hidden)]
1649 impl crate::RequestBuilder for TestIamPermissions {
1650 fn request_options(&mut self) -> &mut crate::RequestOptions {
1651 &mut self.0.options
1652 }
1653 }
1654
1655 #[derive(Clone, Debug)]
1676 pub struct ListOperations(
1677 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1678 );
1679
1680 impl ListOperations {
1681 pub(crate) fn new(
1682 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1683 ) -> Self {
1684 Self(RequestBuilder::new(stub))
1685 }
1686
1687 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1689 mut self,
1690 v: V,
1691 ) -> Self {
1692 self.0.request = v.into();
1693 self
1694 }
1695
1696 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1698 self.0.options = v.into();
1699 self
1700 }
1701
1702 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1704 (*self.0.stub)
1705 .list_operations(self.0.request, self.0.options)
1706 .await
1707 .map(crate::Response::into_body)
1708 }
1709
1710 pub fn by_page(
1712 self,
1713 ) -> impl google_cloud_gax::paginator::Paginator<
1714 google_cloud_longrunning::model::ListOperationsResponse,
1715 crate::Error,
1716 > {
1717 use std::clone::Clone;
1718 let token = self.0.request.page_token.clone();
1719 let execute = move |token: String| {
1720 let mut builder = self.clone();
1721 builder.0.request = builder.0.request.set_page_token(token);
1722 builder.send()
1723 };
1724 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1725 }
1726
1727 pub fn by_item(
1729 self,
1730 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1731 google_cloud_longrunning::model::ListOperationsResponse,
1732 crate::Error,
1733 > {
1734 use google_cloud_gax::paginator::Paginator;
1735 self.by_page().items()
1736 }
1737
1738 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740 self.0.request.name = v.into();
1741 self
1742 }
1743
1744 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746 self.0.request.filter = v.into();
1747 self
1748 }
1749
1750 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1752 self.0.request.page_size = v.into();
1753 self
1754 }
1755
1756 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1758 self.0.request.page_token = v.into();
1759 self
1760 }
1761
1762 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1764 self.0.request.return_partial_success = v.into();
1765 self
1766 }
1767 }
1768
1769 #[doc(hidden)]
1770 impl crate::RequestBuilder for ListOperations {
1771 fn request_options(&mut self) -> &mut crate::RequestOptions {
1772 &mut self.0.options
1773 }
1774 }
1775
1776 #[derive(Clone, Debug)]
1793 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1794
1795 impl GetOperation {
1796 pub(crate) fn new(
1797 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1798 ) -> Self {
1799 Self(RequestBuilder::new(stub))
1800 }
1801
1802 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1804 mut self,
1805 v: V,
1806 ) -> Self {
1807 self.0.request = v.into();
1808 self
1809 }
1810
1811 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1813 self.0.options = v.into();
1814 self
1815 }
1816
1817 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1819 (*self.0.stub)
1820 .get_operation(self.0.request, self.0.options)
1821 .await
1822 .map(crate::Response::into_body)
1823 }
1824
1825 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1827 self.0.request.name = v.into();
1828 self
1829 }
1830 }
1831
1832 #[doc(hidden)]
1833 impl crate::RequestBuilder for GetOperation {
1834 fn request_options(&mut self) -> &mut crate::RequestOptions {
1835 &mut self.0.options
1836 }
1837 }
1838
1839 #[derive(Clone, Debug)]
1856 pub struct DeleteOperation(
1857 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1858 );
1859
1860 impl DeleteOperation {
1861 pub(crate) fn new(
1862 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1863 ) -> Self {
1864 Self(RequestBuilder::new(stub))
1865 }
1866
1867 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1869 mut self,
1870 v: V,
1871 ) -> Self {
1872 self.0.request = v.into();
1873 self
1874 }
1875
1876 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1878 self.0.options = v.into();
1879 self
1880 }
1881
1882 pub async fn send(self) -> Result<()> {
1884 (*self.0.stub)
1885 .delete_operation(self.0.request, self.0.options)
1886 .await
1887 .map(crate::Response::into_body)
1888 }
1889
1890 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1892 self.0.request.name = v.into();
1893 self
1894 }
1895 }
1896
1897 #[doc(hidden)]
1898 impl crate::RequestBuilder for DeleteOperation {
1899 fn request_options(&mut self) -> &mut crate::RequestOptions {
1900 &mut self.0.options
1901 }
1902 }
1903
1904 #[derive(Clone, Debug)]
1921 pub struct CancelOperation(
1922 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1923 );
1924
1925 impl CancelOperation {
1926 pub(crate) fn new(
1927 stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1928 ) -> Self {
1929 Self(RequestBuilder::new(stub))
1930 }
1931
1932 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1934 mut self,
1935 v: V,
1936 ) -> Self {
1937 self.0.request = v.into();
1938 self
1939 }
1940
1941 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1943 self.0.options = v.into();
1944 self
1945 }
1946
1947 pub async fn send(self) -> Result<()> {
1949 (*self.0.stub)
1950 .cancel_operation(self.0.request, self.0.options)
1951 .await
1952 .map(crate::Response::into_body)
1953 }
1954
1955 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1957 self.0.request.name = v.into();
1958 self
1959 }
1960 }
1961
1962 #[doc(hidden)]
1963 impl crate::RequestBuilder for CancelOperation {
1964 fn request_options(&mut self) -> &mut crate::RequestOptions {
1965 &mut self.0.options
1966 }
1967 }
1968}
1969
1970pub mod organization_address_group_service {
1972 use crate::Result;
1973
1974 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1988
1989 pub(crate) mod client {
1990 use super::super::super::client::OrganizationAddressGroupService;
1991 pub struct Factory;
1992 impl crate::ClientFactory for Factory {
1993 type Client = OrganizationAddressGroupService;
1994 type Credentials = gaxi::options::Credentials;
1995 async fn build(
1996 self,
1997 config: gaxi::options::ClientConfig,
1998 ) -> crate::ClientBuilderResult<Self::Client> {
1999 Self::Client::new(config).await
2000 }
2001 }
2002 }
2003
2004 #[derive(Clone, Debug)]
2006 pub(crate) struct RequestBuilder<R: std::default::Default> {
2007 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2008 request: R,
2009 options: crate::RequestOptions,
2010 }
2011
2012 impl<R> RequestBuilder<R>
2013 where
2014 R: std::default::Default,
2015 {
2016 pub(crate) fn new(
2017 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2018 ) -> Self {
2019 Self {
2020 stub,
2021 request: R::default(),
2022 options: crate::RequestOptions::default(),
2023 }
2024 }
2025 }
2026
2027 #[derive(Clone, Debug)]
2048 pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
2049
2050 impl ListAddressGroups {
2051 pub(crate) fn new(
2052 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2053 ) -> Self {
2054 Self(RequestBuilder::new(stub))
2055 }
2056
2057 pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
2059 mut self,
2060 v: V,
2061 ) -> Self {
2062 self.0.request = v.into();
2063 self
2064 }
2065
2066 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2068 self.0.options = v.into();
2069 self
2070 }
2071
2072 pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
2074 (*self.0.stub)
2075 .list_address_groups(self.0.request, self.0.options)
2076 .await
2077 .map(crate::Response::into_body)
2078 }
2079
2080 pub fn by_page(
2082 self,
2083 ) -> impl google_cloud_gax::paginator::Paginator<
2084 crate::model::ListAddressGroupsResponse,
2085 crate::Error,
2086 > {
2087 use std::clone::Clone;
2088 let token = self.0.request.page_token.clone();
2089 let execute = move |token: String| {
2090 let mut builder = self.clone();
2091 builder.0.request = builder.0.request.set_page_token(token);
2092 builder.send()
2093 };
2094 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2095 }
2096
2097 pub fn by_item(
2099 self,
2100 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2101 crate::model::ListAddressGroupsResponse,
2102 crate::Error,
2103 > {
2104 use google_cloud_gax::paginator::Paginator;
2105 self.by_page().items()
2106 }
2107
2108 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2112 self.0.request.parent = v.into();
2113 self
2114 }
2115
2116 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2118 self.0.request.page_size = v.into();
2119 self
2120 }
2121
2122 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2124 self.0.request.page_token = v.into();
2125 self
2126 }
2127
2128 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2130 self.0.request.return_partial_success = v.into();
2131 self
2132 }
2133 }
2134
2135 #[doc(hidden)]
2136 impl crate::RequestBuilder for ListAddressGroups {
2137 fn request_options(&mut self) -> &mut crate::RequestOptions {
2138 &mut self.0.options
2139 }
2140 }
2141
2142 #[derive(Clone, Debug)]
2159 pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2160
2161 impl GetAddressGroup {
2162 pub(crate) fn new(
2163 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2164 ) -> Self {
2165 Self(RequestBuilder::new(stub))
2166 }
2167
2168 pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2170 self.0.request = v.into();
2171 self
2172 }
2173
2174 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2176 self.0.options = v.into();
2177 self
2178 }
2179
2180 pub async fn send(self) -> Result<crate::model::AddressGroup> {
2182 (*self.0.stub)
2183 .get_address_group(self.0.request, self.0.options)
2184 .await
2185 .map(crate::Response::into_body)
2186 }
2187
2188 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2192 self.0.request.name = v.into();
2193 self
2194 }
2195 }
2196
2197 #[doc(hidden)]
2198 impl crate::RequestBuilder for GetAddressGroup {
2199 fn request_options(&mut self) -> &mut crate::RequestOptions {
2200 &mut self.0.options
2201 }
2202 }
2203
2204 #[derive(Clone, Debug)]
2222 pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2223
2224 impl CreateAddressGroup {
2225 pub(crate) fn new(
2226 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2227 ) -> Self {
2228 Self(RequestBuilder::new(stub))
2229 }
2230
2231 pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2233 mut self,
2234 v: V,
2235 ) -> Self {
2236 self.0.request = v.into();
2237 self
2238 }
2239
2240 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2242 self.0.options = v.into();
2243 self
2244 }
2245
2246 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2253 (*self.0.stub)
2254 .create_address_group(self.0.request, self.0.options)
2255 .await
2256 .map(crate::Response::into_body)
2257 }
2258
2259 pub fn poller(
2261 self,
2262 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2263 {
2264 type Operation = google_cloud_lro::internal::Operation<
2265 crate::model::AddressGroup,
2266 crate::model::OperationMetadata,
2267 >;
2268 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2269 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2270 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2271 if let Some(ref mut details) = poller_options.tracing {
2272 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::create_address_group::until_done";
2273 }
2274
2275 let stub = self.0.stub.clone();
2276 let mut options = self.0.options.clone();
2277 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2278 let query = move |name| {
2279 let stub = stub.clone();
2280 let options = options.clone();
2281 async {
2282 let op = GetOperation::new(stub)
2283 .set_name(name)
2284 .with_options(options)
2285 .send()
2286 .await?;
2287 Ok(Operation::new(op))
2288 }
2289 };
2290
2291 let start = move || async {
2292 let op = self.send().await?;
2293 Ok(Operation::new(op))
2294 };
2295
2296 use google_cloud_lro::internal::PollerExt;
2297 {
2298 google_cloud_lro::internal::new_poller(
2299 polling_error_policy,
2300 polling_backoff_policy,
2301 start,
2302 query,
2303 )
2304 }
2305 .with_options(poller_options)
2306 }
2307
2308 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312 self.0.request.parent = v.into();
2313 self
2314 }
2315
2316 pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2320 self.0.request.address_group_id = v.into();
2321 self
2322 }
2323
2324 pub fn set_address_group<T>(mut self, v: T) -> Self
2328 where
2329 T: std::convert::Into<crate::model::AddressGroup>,
2330 {
2331 self.0.request.address_group = std::option::Option::Some(v.into());
2332 self
2333 }
2334
2335 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2339 where
2340 T: std::convert::Into<crate::model::AddressGroup>,
2341 {
2342 self.0.request.address_group = v.map(|x| x.into());
2343 self
2344 }
2345
2346 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2348 self.0.request.request_id = v.into();
2349 self
2350 }
2351 }
2352
2353 #[doc(hidden)]
2354 impl crate::RequestBuilder for CreateAddressGroup {
2355 fn request_options(&mut self) -> &mut crate::RequestOptions {
2356 &mut self.0.options
2357 }
2358 }
2359
2360 #[derive(Clone, Debug)]
2378 pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2379
2380 impl UpdateAddressGroup {
2381 pub(crate) fn new(
2382 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2383 ) -> Self {
2384 Self(RequestBuilder::new(stub))
2385 }
2386
2387 pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2389 mut self,
2390 v: V,
2391 ) -> Self {
2392 self.0.request = v.into();
2393 self
2394 }
2395
2396 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2398 self.0.options = v.into();
2399 self
2400 }
2401
2402 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2409 (*self.0.stub)
2410 .update_address_group(self.0.request, self.0.options)
2411 .await
2412 .map(crate::Response::into_body)
2413 }
2414
2415 pub fn poller(
2417 self,
2418 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2419 {
2420 type Operation = google_cloud_lro::internal::Operation<
2421 crate::model::AddressGroup,
2422 crate::model::OperationMetadata,
2423 >;
2424 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2425 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2426 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2427 if let Some(ref mut details) = poller_options.tracing {
2428 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::update_address_group::until_done";
2429 }
2430
2431 let stub = self.0.stub.clone();
2432 let mut options = self.0.options.clone();
2433 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2434 let query = move |name| {
2435 let stub = stub.clone();
2436 let options = options.clone();
2437 async {
2438 let op = GetOperation::new(stub)
2439 .set_name(name)
2440 .with_options(options)
2441 .send()
2442 .await?;
2443 Ok(Operation::new(op))
2444 }
2445 };
2446
2447 let start = move || async {
2448 let op = self.send().await?;
2449 Ok(Operation::new(op))
2450 };
2451
2452 use google_cloud_lro::internal::PollerExt;
2453 {
2454 google_cloud_lro::internal::new_poller(
2455 polling_error_policy,
2456 polling_backoff_policy,
2457 start,
2458 query,
2459 )
2460 }
2461 .with_options(poller_options)
2462 }
2463
2464 pub fn set_update_mask<T>(mut self, v: T) -> Self
2466 where
2467 T: std::convert::Into<wkt::FieldMask>,
2468 {
2469 self.0.request.update_mask = std::option::Option::Some(v.into());
2470 self
2471 }
2472
2473 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2475 where
2476 T: std::convert::Into<wkt::FieldMask>,
2477 {
2478 self.0.request.update_mask = v.map(|x| x.into());
2479 self
2480 }
2481
2482 pub fn set_address_group<T>(mut self, v: T) -> Self
2486 where
2487 T: std::convert::Into<crate::model::AddressGroup>,
2488 {
2489 self.0.request.address_group = std::option::Option::Some(v.into());
2490 self
2491 }
2492
2493 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2497 where
2498 T: std::convert::Into<crate::model::AddressGroup>,
2499 {
2500 self.0.request.address_group = v.map(|x| x.into());
2501 self
2502 }
2503
2504 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2506 self.0.request.request_id = v.into();
2507 self
2508 }
2509 }
2510
2511 #[doc(hidden)]
2512 impl crate::RequestBuilder for UpdateAddressGroup {
2513 fn request_options(&mut self) -> &mut crate::RequestOptions {
2514 &mut self.0.options
2515 }
2516 }
2517
2518 #[derive(Clone, Debug)]
2536 pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2537
2538 impl AddAddressGroupItems {
2539 pub(crate) fn new(
2540 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2541 ) -> Self {
2542 Self(RequestBuilder::new(stub))
2543 }
2544
2545 pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2547 mut self,
2548 v: V,
2549 ) -> Self {
2550 self.0.request = v.into();
2551 self
2552 }
2553
2554 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2556 self.0.options = v.into();
2557 self
2558 }
2559
2560 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2567 (*self.0.stub)
2568 .add_address_group_items(self.0.request, self.0.options)
2569 .await
2570 .map(crate::Response::into_body)
2571 }
2572
2573 pub fn poller(
2575 self,
2576 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2577 {
2578 type Operation = google_cloud_lro::internal::Operation<
2579 crate::model::AddressGroup,
2580 crate::model::OperationMetadata,
2581 >;
2582 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2583 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2584 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2585 if let Some(ref mut details) = poller_options.tracing {
2586 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::add_address_group_items::until_done";
2587 }
2588
2589 let stub = self.0.stub.clone();
2590 let mut options = self.0.options.clone();
2591 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2592 let query = move |name| {
2593 let stub = stub.clone();
2594 let options = options.clone();
2595 async {
2596 let op = GetOperation::new(stub)
2597 .set_name(name)
2598 .with_options(options)
2599 .send()
2600 .await?;
2601 Ok(Operation::new(op))
2602 }
2603 };
2604
2605 let start = move || async {
2606 let op = self.send().await?;
2607 Ok(Operation::new(op))
2608 };
2609
2610 use google_cloud_lro::internal::PollerExt;
2611 {
2612 google_cloud_lro::internal::new_poller(
2613 polling_error_policy,
2614 polling_backoff_policy,
2615 start,
2616 query,
2617 )
2618 }
2619 .with_options(poller_options)
2620 }
2621
2622 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2626 self.0.request.address_group = v.into();
2627 self
2628 }
2629
2630 pub fn set_items<T, V>(mut self, v: T) -> Self
2634 where
2635 T: std::iter::IntoIterator<Item = V>,
2636 V: std::convert::Into<std::string::String>,
2637 {
2638 use std::iter::Iterator;
2639 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2640 self
2641 }
2642
2643 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2645 self.0.request.request_id = v.into();
2646 self
2647 }
2648 }
2649
2650 #[doc(hidden)]
2651 impl crate::RequestBuilder for AddAddressGroupItems {
2652 fn request_options(&mut self) -> &mut crate::RequestOptions {
2653 &mut self.0.options
2654 }
2655 }
2656
2657 #[derive(Clone, Debug)]
2675 pub struct RemoveAddressGroupItems(
2676 RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2677 );
2678
2679 impl RemoveAddressGroupItems {
2680 pub(crate) fn new(
2681 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2682 ) -> Self {
2683 Self(RequestBuilder::new(stub))
2684 }
2685
2686 pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2688 mut self,
2689 v: V,
2690 ) -> Self {
2691 self.0.request = v.into();
2692 self
2693 }
2694
2695 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2697 self.0.options = v.into();
2698 self
2699 }
2700
2701 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2708 (*self.0.stub)
2709 .remove_address_group_items(self.0.request, self.0.options)
2710 .await
2711 .map(crate::Response::into_body)
2712 }
2713
2714 pub fn poller(
2716 self,
2717 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2718 {
2719 type Operation = google_cloud_lro::internal::Operation<
2720 crate::model::AddressGroup,
2721 crate::model::OperationMetadata,
2722 >;
2723 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2724 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2725 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2726 if let Some(ref mut details) = poller_options.tracing {
2727 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::remove_address_group_items::until_done";
2728 }
2729
2730 let stub = self.0.stub.clone();
2731 let mut options = self.0.options.clone();
2732 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2733 let query = move |name| {
2734 let stub = stub.clone();
2735 let options = options.clone();
2736 async {
2737 let op = GetOperation::new(stub)
2738 .set_name(name)
2739 .with_options(options)
2740 .send()
2741 .await?;
2742 Ok(Operation::new(op))
2743 }
2744 };
2745
2746 let start = move || async {
2747 let op = self.send().await?;
2748 Ok(Operation::new(op))
2749 };
2750
2751 use google_cloud_lro::internal::PollerExt;
2752 {
2753 google_cloud_lro::internal::new_poller(
2754 polling_error_policy,
2755 polling_backoff_policy,
2756 start,
2757 query,
2758 )
2759 }
2760 .with_options(poller_options)
2761 }
2762
2763 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2767 self.0.request.address_group = v.into();
2768 self
2769 }
2770
2771 pub fn set_items<T, V>(mut self, v: T) -> Self
2775 where
2776 T: std::iter::IntoIterator<Item = V>,
2777 V: std::convert::Into<std::string::String>,
2778 {
2779 use std::iter::Iterator;
2780 self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2781 self
2782 }
2783
2784 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2786 self.0.request.request_id = v.into();
2787 self
2788 }
2789 }
2790
2791 #[doc(hidden)]
2792 impl crate::RequestBuilder for RemoveAddressGroupItems {
2793 fn request_options(&mut self) -> &mut crate::RequestOptions {
2794 &mut self.0.options
2795 }
2796 }
2797
2798 #[derive(Clone, Debug)]
2816 pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2817
2818 impl CloneAddressGroupItems {
2819 pub(crate) fn new(
2820 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2821 ) -> Self {
2822 Self(RequestBuilder::new(stub))
2823 }
2824
2825 pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2827 mut self,
2828 v: V,
2829 ) -> Self {
2830 self.0.request = v.into();
2831 self
2832 }
2833
2834 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2836 self.0.options = v.into();
2837 self
2838 }
2839
2840 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2847 (*self.0.stub)
2848 .clone_address_group_items(self.0.request, self.0.options)
2849 .await
2850 .map(crate::Response::into_body)
2851 }
2852
2853 pub fn poller(
2855 self,
2856 ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2857 {
2858 type Operation = google_cloud_lro::internal::Operation<
2859 crate::model::AddressGroup,
2860 crate::model::OperationMetadata,
2861 >;
2862 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2863 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2864 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2865 if let Some(ref mut details) = poller_options.tracing {
2866 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::clone_address_group_items::until_done";
2867 }
2868
2869 let stub = self.0.stub.clone();
2870 let mut options = self.0.options.clone();
2871 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2872 let query = move |name| {
2873 let stub = stub.clone();
2874 let options = options.clone();
2875 async {
2876 let op = GetOperation::new(stub)
2877 .set_name(name)
2878 .with_options(options)
2879 .send()
2880 .await?;
2881 Ok(Operation::new(op))
2882 }
2883 };
2884
2885 let start = move || async {
2886 let op = self.send().await?;
2887 Ok(Operation::new(op))
2888 };
2889
2890 use google_cloud_lro::internal::PollerExt;
2891 {
2892 google_cloud_lro::internal::new_poller(
2893 polling_error_policy,
2894 polling_backoff_policy,
2895 start,
2896 query,
2897 )
2898 }
2899 .with_options(poller_options)
2900 }
2901
2902 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2906 self.0.request.address_group = v.into();
2907 self
2908 }
2909
2910 pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2914 self.0.request.source_address_group = v.into();
2915 self
2916 }
2917
2918 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920 self.0.request.request_id = v.into();
2921 self
2922 }
2923 }
2924
2925 #[doc(hidden)]
2926 impl crate::RequestBuilder for CloneAddressGroupItems {
2927 fn request_options(&mut self) -> &mut crate::RequestOptions {
2928 &mut self.0.options
2929 }
2930 }
2931
2932 #[derive(Clone, Debug)]
2950 pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2951
2952 impl DeleteAddressGroup {
2953 pub(crate) fn new(
2954 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2955 ) -> Self {
2956 Self(RequestBuilder::new(stub))
2957 }
2958
2959 pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2961 mut self,
2962 v: V,
2963 ) -> Self {
2964 self.0.request = v.into();
2965 self
2966 }
2967
2968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2970 self.0.options = v.into();
2971 self
2972 }
2973
2974 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2981 (*self.0.stub)
2982 .delete_address_group(self.0.request, self.0.options)
2983 .await
2984 .map(crate::Response::into_body)
2985 }
2986
2987 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2989 type Operation =
2990 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2991 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2992 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2993 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2994 if let Some(ref mut details) = poller_options.tracing {
2995 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::delete_address_group::until_done";
2996 }
2997
2998 let stub = self.0.stub.clone();
2999 let mut options = self.0.options.clone();
3000 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3001 let query = move |name| {
3002 let stub = stub.clone();
3003 let options = options.clone();
3004 async {
3005 let op = GetOperation::new(stub)
3006 .set_name(name)
3007 .with_options(options)
3008 .send()
3009 .await?;
3010 Ok(Operation::new(op))
3011 }
3012 };
3013
3014 let start = move || async {
3015 let op = self.send().await?;
3016 Ok(Operation::new(op))
3017 };
3018
3019 use google_cloud_lro::internal::PollerExt;
3020 {
3021 google_cloud_lro::internal::new_unit_response_poller(
3022 polling_error_policy,
3023 polling_backoff_policy,
3024 start,
3025 query,
3026 )
3027 }
3028 .with_options(poller_options)
3029 }
3030
3031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3035 self.0.request.name = v.into();
3036 self
3037 }
3038
3039 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3041 self.0.request.request_id = v.into();
3042 self
3043 }
3044 }
3045
3046 #[doc(hidden)]
3047 impl crate::RequestBuilder for DeleteAddressGroup {
3048 fn request_options(&mut self) -> &mut crate::RequestOptions {
3049 &mut self.0.options
3050 }
3051 }
3052
3053 #[derive(Clone, Debug)]
3074 pub struct ListAddressGroupReferences(
3075 RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
3076 );
3077
3078 impl ListAddressGroupReferences {
3079 pub(crate) fn new(
3080 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3081 ) -> Self {
3082 Self(RequestBuilder::new(stub))
3083 }
3084
3085 pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
3087 mut self,
3088 v: V,
3089 ) -> Self {
3090 self.0.request = v.into();
3091 self
3092 }
3093
3094 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3096 self.0.options = v.into();
3097 self
3098 }
3099
3100 pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
3102 (*self.0.stub)
3103 .list_address_group_references(self.0.request, self.0.options)
3104 .await
3105 .map(crate::Response::into_body)
3106 }
3107
3108 pub fn by_page(
3110 self,
3111 ) -> impl google_cloud_gax::paginator::Paginator<
3112 crate::model::ListAddressGroupReferencesResponse,
3113 crate::Error,
3114 > {
3115 use std::clone::Clone;
3116 let token = self.0.request.page_token.clone();
3117 let execute = move |token: String| {
3118 let mut builder = self.clone();
3119 builder.0.request = builder.0.request.set_page_token(token);
3120 builder.send()
3121 };
3122 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3123 }
3124
3125 pub fn by_item(
3127 self,
3128 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3129 crate::model::ListAddressGroupReferencesResponse,
3130 crate::Error,
3131 > {
3132 use google_cloud_gax::paginator::Paginator;
3133 self.by_page().items()
3134 }
3135
3136 pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
3140 self.0.request.address_group = v.into();
3141 self
3142 }
3143
3144 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3146 self.0.request.page_size = v.into();
3147 self
3148 }
3149
3150 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3152 self.0.request.page_token = v.into();
3153 self
3154 }
3155 }
3156
3157 #[doc(hidden)]
3158 impl crate::RequestBuilder for ListAddressGroupReferences {
3159 fn request_options(&mut self) -> &mut crate::RequestOptions {
3160 &mut self.0.options
3161 }
3162 }
3163
3164 #[derive(Clone, Debug)]
3185 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3186
3187 impl ListLocations {
3188 pub(crate) fn new(
3189 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3190 ) -> Self {
3191 Self(RequestBuilder::new(stub))
3192 }
3193
3194 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3196 mut self,
3197 v: V,
3198 ) -> Self {
3199 self.0.request = v.into();
3200 self
3201 }
3202
3203 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3205 self.0.options = v.into();
3206 self
3207 }
3208
3209 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3211 (*self.0.stub)
3212 .list_locations(self.0.request, self.0.options)
3213 .await
3214 .map(crate::Response::into_body)
3215 }
3216
3217 pub fn by_page(
3219 self,
3220 ) -> impl google_cloud_gax::paginator::Paginator<
3221 google_cloud_location::model::ListLocationsResponse,
3222 crate::Error,
3223 > {
3224 use std::clone::Clone;
3225 let token = self.0.request.page_token.clone();
3226 let execute = move |token: String| {
3227 let mut builder = self.clone();
3228 builder.0.request = builder.0.request.set_page_token(token);
3229 builder.send()
3230 };
3231 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3232 }
3233
3234 pub fn by_item(
3236 self,
3237 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3238 google_cloud_location::model::ListLocationsResponse,
3239 crate::Error,
3240 > {
3241 use google_cloud_gax::paginator::Paginator;
3242 self.by_page().items()
3243 }
3244
3245 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3247 self.0.request.name = v.into();
3248 self
3249 }
3250
3251 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3253 self.0.request.filter = v.into();
3254 self
3255 }
3256
3257 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3259 self.0.request.page_size = v.into();
3260 self
3261 }
3262
3263 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3265 self.0.request.page_token = v.into();
3266 self
3267 }
3268 }
3269
3270 #[doc(hidden)]
3271 impl crate::RequestBuilder for ListLocations {
3272 fn request_options(&mut self) -> &mut crate::RequestOptions {
3273 &mut self.0.options
3274 }
3275 }
3276
3277 #[derive(Clone, Debug)]
3294 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3295
3296 impl GetLocation {
3297 pub(crate) fn new(
3298 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3299 ) -> Self {
3300 Self(RequestBuilder::new(stub))
3301 }
3302
3303 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3305 mut self,
3306 v: V,
3307 ) -> Self {
3308 self.0.request = v.into();
3309 self
3310 }
3311
3312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3314 self.0.options = v.into();
3315 self
3316 }
3317
3318 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3320 (*self.0.stub)
3321 .get_location(self.0.request, self.0.options)
3322 .await
3323 .map(crate::Response::into_body)
3324 }
3325
3326 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3328 self.0.request.name = v.into();
3329 self
3330 }
3331 }
3332
3333 #[doc(hidden)]
3334 impl crate::RequestBuilder for GetLocation {
3335 fn request_options(&mut self) -> &mut crate::RequestOptions {
3336 &mut self.0.options
3337 }
3338 }
3339
3340 #[derive(Clone, Debug)]
3357 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3358
3359 impl SetIamPolicy {
3360 pub(crate) fn new(
3361 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3362 ) -> Self {
3363 Self(RequestBuilder::new(stub))
3364 }
3365
3366 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3368 mut self,
3369 v: V,
3370 ) -> Self {
3371 self.0.request = v.into();
3372 self
3373 }
3374
3375 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3377 self.0.options = v.into();
3378 self
3379 }
3380
3381 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3383 (*self.0.stub)
3384 .set_iam_policy(self.0.request, self.0.options)
3385 .await
3386 .map(crate::Response::into_body)
3387 }
3388
3389 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3393 self.0.request.resource = v.into();
3394 self
3395 }
3396
3397 pub fn set_policy<T>(mut self, v: T) -> Self
3401 where
3402 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3403 {
3404 self.0.request.policy = std::option::Option::Some(v.into());
3405 self
3406 }
3407
3408 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3412 where
3413 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3414 {
3415 self.0.request.policy = v.map(|x| x.into());
3416 self
3417 }
3418
3419 pub fn set_update_mask<T>(mut self, v: T) -> Self
3421 where
3422 T: std::convert::Into<wkt::FieldMask>,
3423 {
3424 self.0.request.update_mask = std::option::Option::Some(v.into());
3425 self
3426 }
3427
3428 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3430 where
3431 T: std::convert::Into<wkt::FieldMask>,
3432 {
3433 self.0.request.update_mask = v.map(|x| x.into());
3434 self
3435 }
3436 }
3437
3438 #[doc(hidden)]
3439 impl crate::RequestBuilder for SetIamPolicy {
3440 fn request_options(&mut self) -> &mut crate::RequestOptions {
3441 &mut self.0.options
3442 }
3443 }
3444
3445 #[derive(Clone, Debug)]
3462 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3463
3464 impl GetIamPolicy {
3465 pub(crate) fn new(
3466 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3467 ) -> Self {
3468 Self(RequestBuilder::new(stub))
3469 }
3470
3471 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3473 mut self,
3474 v: V,
3475 ) -> Self {
3476 self.0.request = v.into();
3477 self
3478 }
3479
3480 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3482 self.0.options = v.into();
3483 self
3484 }
3485
3486 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3488 (*self.0.stub)
3489 .get_iam_policy(self.0.request, self.0.options)
3490 .await
3491 .map(crate::Response::into_body)
3492 }
3493
3494 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3498 self.0.request.resource = v.into();
3499 self
3500 }
3501
3502 pub fn set_options<T>(mut self, v: T) -> Self
3504 where
3505 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3506 {
3507 self.0.request.options = std::option::Option::Some(v.into());
3508 self
3509 }
3510
3511 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3513 where
3514 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3515 {
3516 self.0.request.options = v.map(|x| x.into());
3517 self
3518 }
3519 }
3520
3521 #[doc(hidden)]
3522 impl crate::RequestBuilder for GetIamPolicy {
3523 fn request_options(&mut self) -> &mut crate::RequestOptions {
3524 &mut self.0.options
3525 }
3526 }
3527
3528 #[derive(Clone, Debug)]
3545 pub struct TestIamPermissions(
3546 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3547 );
3548
3549 impl TestIamPermissions {
3550 pub(crate) fn new(
3551 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3552 ) -> Self {
3553 Self(RequestBuilder::new(stub))
3554 }
3555
3556 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3558 mut self,
3559 v: V,
3560 ) -> Self {
3561 self.0.request = v.into();
3562 self
3563 }
3564
3565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3567 self.0.options = v.into();
3568 self
3569 }
3570
3571 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3573 (*self.0.stub)
3574 .test_iam_permissions(self.0.request, self.0.options)
3575 .await
3576 .map(crate::Response::into_body)
3577 }
3578
3579 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3583 self.0.request.resource = v.into();
3584 self
3585 }
3586
3587 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3591 where
3592 T: std::iter::IntoIterator<Item = V>,
3593 V: std::convert::Into<std::string::String>,
3594 {
3595 use std::iter::Iterator;
3596 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3597 self
3598 }
3599 }
3600
3601 #[doc(hidden)]
3602 impl crate::RequestBuilder for TestIamPermissions {
3603 fn request_options(&mut self) -> &mut crate::RequestOptions {
3604 &mut self.0.options
3605 }
3606 }
3607
3608 #[derive(Clone, Debug)]
3629 pub struct ListOperations(
3630 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3631 );
3632
3633 impl ListOperations {
3634 pub(crate) fn new(
3635 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3636 ) -> Self {
3637 Self(RequestBuilder::new(stub))
3638 }
3639
3640 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3642 mut self,
3643 v: V,
3644 ) -> Self {
3645 self.0.request = v.into();
3646 self
3647 }
3648
3649 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3651 self.0.options = v.into();
3652 self
3653 }
3654
3655 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3657 (*self.0.stub)
3658 .list_operations(self.0.request, self.0.options)
3659 .await
3660 .map(crate::Response::into_body)
3661 }
3662
3663 pub fn by_page(
3665 self,
3666 ) -> impl google_cloud_gax::paginator::Paginator<
3667 google_cloud_longrunning::model::ListOperationsResponse,
3668 crate::Error,
3669 > {
3670 use std::clone::Clone;
3671 let token = self.0.request.page_token.clone();
3672 let execute = move |token: String| {
3673 let mut builder = self.clone();
3674 builder.0.request = builder.0.request.set_page_token(token);
3675 builder.send()
3676 };
3677 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3678 }
3679
3680 pub fn by_item(
3682 self,
3683 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3684 google_cloud_longrunning::model::ListOperationsResponse,
3685 crate::Error,
3686 > {
3687 use google_cloud_gax::paginator::Paginator;
3688 self.by_page().items()
3689 }
3690
3691 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3693 self.0.request.name = v.into();
3694 self
3695 }
3696
3697 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3699 self.0.request.filter = v.into();
3700 self
3701 }
3702
3703 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3705 self.0.request.page_size = v.into();
3706 self
3707 }
3708
3709 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3711 self.0.request.page_token = v.into();
3712 self
3713 }
3714
3715 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3717 self.0.request.return_partial_success = v.into();
3718 self
3719 }
3720 }
3721
3722 #[doc(hidden)]
3723 impl crate::RequestBuilder for ListOperations {
3724 fn request_options(&mut self) -> &mut crate::RequestOptions {
3725 &mut self.0.options
3726 }
3727 }
3728
3729 #[derive(Clone, Debug)]
3746 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3747
3748 impl GetOperation {
3749 pub(crate) fn new(
3750 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3751 ) -> Self {
3752 Self(RequestBuilder::new(stub))
3753 }
3754
3755 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3757 mut self,
3758 v: V,
3759 ) -> Self {
3760 self.0.request = v.into();
3761 self
3762 }
3763
3764 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3766 self.0.options = v.into();
3767 self
3768 }
3769
3770 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3772 (*self.0.stub)
3773 .get_operation(self.0.request, self.0.options)
3774 .await
3775 .map(crate::Response::into_body)
3776 }
3777
3778 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3780 self.0.request.name = v.into();
3781 self
3782 }
3783 }
3784
3785 #[doc(hidden)]
3786 impl crate::RequestBuilder for GetOperation {
3787 fn request_options(&mut self) -> &mut crate::RequestOptions {
3788 &mut self.0.options
3789 }
3790 }
3791
3792 #[derive(Clone, Debug)]
3809 pub struct DeleteOperation(
3810 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3811 );
3812
3813 impl DeleteOperation {
3814 pub(crate) fn new(
3815 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3816 ) -> Self {
3817 Self(RequestBuilder::new(stub))
3818 }
3819
3820 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3822 mut self,
3823 v: V,
3824 ) -> Self {
3825 self.0.request = v.into();
3826 self
3827 }
3828
3829 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3831 self.0.options = v.into();
3832 self
3833 }
3834
3835 pub async fn send(self) -> Result<()> {
3837 (*self.0.stub)
3838 .delete_operation(self.0.request, self.0.options)
3839 .await
3840 .map(crate::Response::into_body)
3841 }
3842
3843 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3845 self.0.request.name = v.into();
3846 self
3847 }
3848 }
3849
3850 #[doc(hidden)]
3851 impl crate::RequestBuilder for DeleteOperation {
3852 fn request_options(&mut self) -> &mut crate::RequestOptions {
3853 &mut self.0.options
3854 }
3855 }
3856
3857 #[derive(Clone, Debug)]
3874 pub struct CancelOperation(
3875 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3876 );
3877
3878 impl CancelOperation {
3879 pub(crate) fn new(
3880 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3881 ) -> Self {
3882 Self(RequestBuilder::new(stub))
3883 }
3884
3885 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3887 mut self,
3888 v: V,
3889 ) -> Self {
3890 self.0.request = v.into();
3891 self
3892 }
3893
3894 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3896 self.0.options = v.into();
3897 self
3898 }
3899
3900 pub async fn send(self) -> Result<()> {
3902 (*self.0.stub)
3903 .cancel_operation(self.0.request, self.0.options)
3904 .await
3905 .map(crate::Response::into_body)
3906 }
3907
3908 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3910 self.0.request.name = v.into();
3911 self
3912 }
3913 }
3914
3915 #[doc(hidden)]
3916 impl crate::RequestBuilder for CancelOperation {
3917 fn request_options(&mut self) -> &mut crate::RequestOptions {
3918 &mut self.0.options
3919 }
3920 }
3921}
3922
3923pub mod dns_threat_detector_service {
3925 use crate::Result;
3926
3927 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3941
3942 pub(crate) mod client {
3943 use super::super::super::client::DnsThreatDetectorService;
3944 pub struct Factory;
3945 impl crate::ClientFactory for Factory {
3946 type Client = DnsThreatDetectorService;
3947 type Credentials = gaxi::options::Credentials;
3948 async fn build(
3949 self,
3950 config: gaxi::options::ClientConfig,
3951 ) -> crate::ClientBuilderResult<Self::Client> {
3952 Self::Client::new(config).await
3953 }
3954 }
3955 }
3956
3957 #[derive(Clone, Debug)]
3959 pub(crate) struct RequestBuilder<R: std::default::Default> {
3960 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3961 request: R,
3962 options: crate::RequestOptions,
3963 }
3964
3965 impl<R> RequestBuilder<R>
3966 where
3967 R: std::default::Default,
3968 {
3969 pub(crate) fn new(
3970 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3971 ) -> Self {
3972 Self {
3973 stub,
3974 request: R::default(),
3975 options: crate::RequestOptions::default(),
3976 }
3977 }
3978 }
3979
3980 #[derive(Clone, Debug)]
4001 pub struct ListDnsThreatDetectors(RequestBuilder<crate::model::ListDnsThreatDetectorsRequest>);
4002
4003 impl ListDnsThreatDetectors {
4004 pub(crate) fn new(
4005 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4006 ) -> Self {
4007 Self(RequestBuilder::new(stub))
4008 }
4009
4010 pub fn with_request<V: Into<crate::model::ListDnsThreatDetectorsRequest>>(
4012 mut self,
4013 v: V,
4014 ) -> Self {
4015 self.0.request = v.into();
4016 self
4017 }
4018
4019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4021 self.0.options = v.into();
4022 self
4023 }
4024
4025 pub async fn send(self) -> Result<crate::model::ListDnsThreatDetectorsResponse> {
4027 (*self.0.stub)
4028 .list_dns_threat_detectors(self.0.request, self.0.options)
4029 .await
4030 .map(crate::Response::into_body)
4031 }
4032
4033 pub fn by_page(
4035 self,
4036 ) -> impl google_cloud_gax::paginator::Paginator<
4037 crate::model::ListDnsThreatDetectorsResponse,
4038 crate::Error,
4039 > {
4040 use std::clone::Clone;
4041 let token = self.0.request.page_token.clone();
4042 let execute = move |token: String| {
4043 let mut builder = self.clone();
4044 builder.0.request = builder.0.request.set_page_token(token);
4045 builder.send()
4046 };
4047 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4048 }
4049
4050 pub fn by_item(
4052 self,
4053 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4054 crate::model::ListDnsThreatDetectorsResponse,
4055 crate::Error,
4056 > {
4057 use google_cloud_gax::paginator::Paginator;
4058 self.by_page().items()
4059 }
4060
4061 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4065 self.0.request.parent = v.into();
4066 self
4067 }
4068
4069 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4071 self.0.request.page_size = v.into();
4072 self
4073 }
4074
4075 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4077 self.0.request.page_token = v.into();
4078 self
4079 }
4080 }
4081
4082 #[doc(hidden)]
4083 impl crate::RequestBuilder for ListDnsThreatDetectors {
4084 fn request_options(&mut self) -> &mut crate::RequestOptions {
4085 &mut self.0.options
4086 }
4087 }
4088
4089 #[derive(Clone, Debug)]
4106 pub struct GetDnsThreatDetector(RequestBuilder<crate::model::GetDnsThreatDetectorRequest>);
4107
4108 impl GetDnsThreatDetector {
4109 pub(crate) fn new(
4110 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4111 ) -> Self {
4112 Self(RequestBuilder::new(stub))
4113 }
4114
4115 pub fn with_request<V: Into<crate::model::GetDnsThreatDetectorRequest>>(
4117 mut self,
4118 v: V,
4119 ) -> Self {
4120 self.0.request = v.into();
4121 self
4122 }
4123
4124 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4126 self.0.options = v.into();
4127 self
4128 }
4129
4130 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4132 (*self.0.stub)
4133 .get_dns_threat_detector(self.0.request, self.0.options)
4134 .await
4135 .map(crate::Response::into_body)
4136 }
4137
4138 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4142 self.0.request.name = v.into();
4143 self
4144 }
4145 }
4146
4147 #[doc(hidden)]
4148 impl crate::RequestBuilder for GetDnsThreatDetector {
4149 fn request_options(&mut self) -> &mut crate::RequestOptions {
4150 &mut self.0.options
4151 }
4152 }
4153
4154 #[derive(Clone, Debug)]
4171 pub struct CreateDnsThreatDetector(
4172 RequestBuilder<crate::model::CreateDnsThreatDetectorRequest>,
4173 );
4174
4175 impl CreateDnsThreatDetector {
4176 pub(crate) fn new(
4177 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4178 ) -> Self {
4179 Self(RequestBuilder::new(stub))
4180 }
4181
4182 pub fn with_request<V: Into<crate::model::CreateDnsThreatDetectorRequest>>(
4184 mut self,
4185 v: V,
4186 ) -> Self {
4187 self.0.request = v.into();
4188 self
4189 }
4190
4191 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4193 self.0.options = v.into();
4194 self
4195 }
4196
4197 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4199 (*self.0.stub)
4200 .create_dns_threat_detector(self.0.request, self.0.options)
4201 .await
4202 .map(crate::Response::into_body)
4203 }
4204
4205 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4209 self.0.request.parent = v.into();
4210 self
4211 }
4212
4213 pub fn set_dns_threat_detector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4215 self.0.request.dns_threat_detector_id = v.into();
4216 self
4217 }
4218
4219 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4223 where
4224 T: std::convert::Into<crate::model::DnsThreatDetector>,
4225 {
4226 self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4227 self
4228 }
4229
4230 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4234 where
4235 T: std::convert::Into<crate::model::DnsThreatDetector>,
4236 {
4237 self.0.request.dns_threat_detector = v.map(|x| x.into());
4238 self
4239 }
4240 }
4241
4242 #[doc(hidden)]
4243 impl crate::RequestBuilder for CreateDnsThreatDetector {
4244 fn request_options(&mut self) -> &mut crate::RequestOptions {
4245 &mut self.0.options
4246 }
4247 }
4248
4249 #[derive(Clone, Debug)]
4266 pub struct UpdateDnsThreatDetector(
4267 RequestBuilder<crate::model::UpdateDnsThreatDetectorRequest>,
4268 );
4269
4270 impl UpdateDnsThreatDetector {
4271 pub(crate) fn new(
4272 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4273 ) -> Self {
4274 Self(RequestBuilder::new(stub))
4275 }
4276
4277 pub fn with_request<V: Into<crate::model::UpdateDnsThreatDetectorRequest>>(
4279 mut self,
4280 v: V,
4281 ) -> Self {
4282 self.0.request = v.into();
4283 self
4284 }
4285
4286 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4288 self.0.options = v.into();
4289 self
4290 }
4291
4292 pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4294 (*self.0.stub)
4295 .update_dns_threat_detector(self.0.request, self.0.options)
4296 .await
4297 .map(crate::Response::into_body)
4298 }
4299
4300 pub fn set_update_mask<T>(mut self, v: T) -> Self
4302 where
4303 T: std::convert::Into<wkt::FieldMask>,
4304 {
4305 self.0.request.update_mask = std::option::Option::Some(v.into());
4306 self
4307 }
4308
4309 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4311 where
4312 T: std::convert::Into<wkt::FieldMask>,
4313 {
4314 self.0.request.update_mask = v.map(|x| x.into());
4315 self
4316 }
4317
4318 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4322 where
4323 T: std::convert::Into<crate::model::DnsThreatDetector>,
4324 {
4325 self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4326 self
4327 }
4328
4329 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4333 where
4334 T: std::convert::Into<crate::model::DnsThreatDetector>,
4335 {
4336 self.0.request.dns_threat_detector = v.map(|x| x.into());
4337 self
4338 }
4339 }
4340
4341 #[doc(hidden)]
4342 impl crate::RequestBuilder for UpdateDnsThreatDetector {
4343 fn request_options(&mut self) -> &mut crate::RequestOptions {
4344 &mut self.0.options
4345 }
4346 }
4347
4348 #[derive(Clone, Debug)]
4365 pub struct DeleteDnsThreatDetector(
4366 RequestBuilder<crate::model::DeleteDnsThreatDetectorRequest>,
4367 );
4368
4369 impl DeleteDnsThreatDetector {
4370 pub(crate) fn new(
4371 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4372 ) -> Self {
4373 Self(RequestBuilder::new(stub))
4374 }
4375
4376 pub fn with_request<V: Into<crate::model::DeleteDnsThreatDetectorRequest>>(
4378 mut self,
4379 v: V,
4380 ) -> Self {
4381 self.0.request = v.into();
4382 self
4383 }
4384
4385 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4387 self.0.options = v.into();
4388 self
4389 }
4390
4391 pub async fn send(self) -> Result<()> {
4393 (*self.0.stub)
4394 .delete_dns_threat_detector(self.0.request, self.0.options)
4395 .await
4396 .map(crate::Response::into_body)
4397 }
4398
4399 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4403 self.0.request.name = v.into();
4404 self
4405 }
4406 }
4407
4408 #[doc(hidden)]
4409 impl crate::RequestBuilder for DeleteDnsThreatDetector {
4410 fn request_options(&mut self) -> &mut crate::RequestOptions {
4411 &mut self.0.options
4412 }
4413 }
4414
4415 #[derive(Clone, Debug)]
4436 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4437
4438 impl ListLocations {
4439 pub(crate) fn new(
4440 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4441 ) -> Self {
4442 Self(RequestBuilder::new(stub))
4443 }
4444
4445 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4447 mut self,
4448 v: V,
4449 ) -> Self {
4450 self.0.request = v.into();
4451 self
4452 }
4453
4454 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4456 self.0.options = v.into();
4457 self
4458 }
4459
4460 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4462 (*self.0.stub)
4463 .list_locations(self.0.request, self.0.options)
4464 .await
4465 .map(crate::Response::into_body)
4466 }
4467
4468 pub fn by_page(
4470 self,
4471 ) -> impl google_cloud_gax::paginator::Paginator<
4472 google_cloud_location::model::ListLocationsResponse,
4473 crate::Error,
4474 > {
4475 use std::clone::Clone;
4476 let token = self.0.request.page_token.clone();
4477 let execute = move |token: String| {
4478 let mut builder = self.clone();
4479 builder.0.request = builder.0.request.set_page_token(token);
4480 builder.send()
4481 };
4482 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4483 }
4484
4485 pub fn by_item(
4487 self,
4488 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4489 google_cloud_location::model::ListLocationsResponse,
4490 crate::Error,
4491 > {
4492 use google_cloud_gax::paginator::Paginator;
4493 self.by_page().items()
4494 }
4495
4496 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4498 self.0.request.name = v.into();
4499 self
4500 }
4501
4502 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504 self.0.request.filter = v.into();
4505 self
4506 }
4507
4508 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4510 self.0.request.page_size = v.into();
4511 self
4512 }
4513
4514 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4516 self.0.request.page_token = v.into();
4517 self
4518 }
4519 }
4520
4521 #[doc(hidden)]
4522 impl crate::RequestBuilder for ListLocations {
4523 fn request_options(&mut self) -> &mut crate::RequestOptions {
4524 &mut self.0.options
4525 }
4526 }
4527
4528 #[derive(Clone, Debug)]
4545 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4546
4547 impl GetLocation {
4548 pub(crate) fn new(
4549 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4550 ) -> Self {
4551 Self(RequestBuilder::new(stub))
4552 }
4553
4554 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4556 mut self,
4557 v: V,
4558 ) -> Self {
4559 self.0.request = v.into();
4560 self
4561 }
4562
4563 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4565 self.0.options = v.into();
4566 self
4567 }
4568
4569 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4571 (*self.0.stub)
4572 .get_location(self.0.request, self.0.options)
4573 .await
4574 .map(crate::Response::into_body)
4575 }
4576
4577 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4579 self.0.request.name = v.into();
4580 self
4581 }
4582 }
4583
4584 #[doc(hidden)]
4585 impl crate::RequestBuilder for GetLocation {
4586 fn request_options(&mut self) -> &mut crate::RequestOptions {
4587 &mut self.0.options
4588 }
4589 }
4590
4591 #[derive(Clone, Debug)]
4608 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4609
4610 impl SetIamPolicy {
4611 pub(crate) fn new(
4612 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4613 ) -> Self {
4614 Self(RequestBuilder::new(stub))
4615 }
4616
4617 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4619 mut self,
4620 v: V,
4621 ) -> Self {
4622 self.0.request = v.into();
4623 self
4624 }
4625
4626 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4628 self.0.options = v.into();
4629 self
4630 }
4631
4632 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4634 (*self.0.stub)
4635 .set_iam_policy(self.0.request, self.0.options)
4636 .await
4637 .map(crate::Response::into_body)
4638 }
4639
4640 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4644 self.0.request.resource = v.into();
4645 self
4646 }
4647
4648 pub fn set_policy<T>(mut self, v: T) -> Self
4652 where
4653 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4654 {
4655 self.0.request.policy = std::option::Option::Some(v.into());
4656 self
4657 }
4658
4659 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4663 where
4664 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4665 {
4666 self.0.request.policy = v.map(|x| x.into());
4667 self
4668 }
4669
4670 pub fn set_update_mask<T>(mut self, v: T) -> Self
4672 where
4673 T: std::convert::Into<wkt::FieldMask>,
4674 {
4675 self.0.request.update_mask = std::option::Option::Some(v.into());
4676 self
4677 }
4678
4679 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4681 where
4682 T: std::convert::Into<wkt::FieldMask>,
4683 {
4684 self.0.request.update_mask = v.map(|x| x.into());
4685 self
4686 }
4687 }
4688
4689 #[doc(hidden)]
4690 impl crate::RequestBuilder for SetIamPolicy {
4691 fn request_options(&mut self) -> &mut crate::RequestOptions {
4692 &mut self.0.options
4693 }
4694 }
4695
4696 #[derive(Clone, Debug)]
4713 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4714
4715 impl GetIamPolicy {
4716 pub(crate) fn new(
4717 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4718 ) -> Self {
4719 Self(RequestBuilder::new(stub))
4720 }
4721
4722 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4724 mut self,
4725 v: V,
4726 ) -> Self {
4727 self.0.request = v.into();
4728 self
4729 }
4730
4731 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4733 self.0.options = v.into();
4734 self
4735 }
4736
4737 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4739 (*self.0.stub)
4740 .get_iam_policy(self.0.request, self.0.options)
4741 .await
4742 .map(crate::Response::into_body)
4743 }
4744
4745 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4749 self.0.request.resource = v.into();
4750 self
4751 }
4752
4753 pub fn set_options<T>(mut self, v: T) -> Self
4755 where
4756 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4757 {
4758 self.0.request.options = std::option::Option::Some(v.into());
4759 self
4760 }
4761
4762 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4764 where
4765 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4766 {
4767 self.0.request.options = v.map(|x| x.into());
4768 self
4769 }
4770 }
4771
4772 #[doc(hidden)]
4773 impl crate::RequestBuilder for GetIamPolicy {
4774 fn request_options(&mut self) -> &mut crate::RequestOptions {
4775 &mut self.0.options
4776 }
4777 }
4778
4779 #[derive(Clone, Debug)]
4796 pub struct TestIamPermissions(
4797 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4798 );
4799
4800 impl TestIamPermissions {
4801 pub(crate) fn new(
4802 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4803 ) -> Self {
4804 Self(RequestBuilder::new(stub))
4805 }
4806
4807 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
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<crate::RequestOptions>>(mut self, v: V) -> Self {
4818 self.0.options = v.into();
4819 self
4820 }
4821
4822 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4824 (*self.0.stub)
4825 .test_iam_permissions(self.0.request, self.0.options)
4826 .await
4827 .map(crate::Response::into_body)
4828 }
4829
4830 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4834 self.0.request.resource = v.into();
4835 self
4836 }
4837
4838 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4842 where
4843 T: std::iter::IntoIterator<Item = V>,
4844 V: std::convert::Into<std::string::String>,
4845 {
4846 use std::iter::Iterator;
4847 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4848 self
4849 }
4850 }
4851
4852 #[doc(hidden)]
4853 impl crate::RequestBuilder for TestIamPermissions {
4854 fn request_options(&mut self) -> &mut crate::RequestOptions {
4855 &mut self.0.options
4856 }
4857 }
4858
4859 #[derive(Clone, Debug)]
4880 pub struct ListOperations(
4881 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4882 );
4883
4884 impl ListOperations {
4885 pub(crate) fn new(
4886 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4887 ) -> Self {
4888 Self(RequestBuilder::new(stub))
4889 }
4890
4891 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4893 mut self,
4894 v: V,
4895 ) -> Self {
4896 self.0.request = v.into();
4897 self
4898 }
4899
4900 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4902 self.0.options = v.into();
4903 self
4904 }
4905
4906 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4908 (*self.0.stub)
4909 .list_operations(self.0.request, self.0.options)
4910 .await
4911 .map(crate::Response::into_body)
4912 }
4913
4914 pub fn by_page(
4916 self,
4917 ) -> impl google_cloud_gax::paginator::Paginator<
4918 google_cloud_longrunning::model::ListOperationsResponse,
4919 crate::Error,
4920 > {
4921 use std::clone::Clone;
4922 let token = self.0.request.page_token.clone();
4923 let execute = move |token: String| {
4924 let mut builder = self.clone();
4925 builder.0.request = builder.0.request.set_page_token(token);
4926 builder.send()
4927 };
4928 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4929 }
4930
4931 pub fn by_item(
4933 self,
4934 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4935 google_cloud_longrunning::model::ListOperationsResponse,
4936 crate::Error,
4937 > {
4938 use google_cloud_gax::paginator::Paginator;
4939 self.by_page().items()
4940 }
4941
4942 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4944 self.0.request.name = v.into();
4945 self
4946 }
4947
4948 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4950 self.0.request.filter = v.into();
4951 self
4952 }
4953
4954 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4956 self.0.request.page_size = v.into();
4957 self
4958 }
4959
4960 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4962 self.0.request.page_token = v.into();
4963 self
4964 }
4965
4966 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4968 self.0.request.return_partial_success = v.into();
4969 self
4970 }
4971 }
4972
4973 #[doc(hidden)]
4974 impl crate::RequestBuilder for ListOperations {
4975 fn request_options(&mut self) -> &mut crate::RequestOptions {
4976 &mut self.0.options
4977 }
4978 }
4979
4980 #[derive(Clone, Debug)]
4997 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4998
4999 impl GetOperation {
5000 pub(crate) fn new(
5001 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5002 ) -> Self {
5003 Self(RequestBuilder::new(stub))
5004 }
5005
5006 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5008 mut self,
5009 v: V,
5010 ) -> Self {
5011 self.0.request = v.into();
5012 self
5013 }
5014
5015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5017 self.0.options = v.into();
5018 self
5019 }
5020
5021 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5023 (*self.0.stub)
5024 .get_operation(self.0.request, self.0.options)
5025 .await
5026 .map(crate::Response::into_body)
5027 }
5028
5029 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5031 self.0.request.name = v.into();
5032 self
5033 }
5034 }
5035
5036 #[doc(hidden)]
5037 impl crate::RequestBuilder for GetOperation {
5038 fn request_options(&mut self) -> &mut crate::RequestOptions {
5039 &mut self.0.options
5040 }
5041 }
5042
5043 #[derive(Clone, Debug)]
5060 pub struct DeleteOperation(
5061 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5062 );
5063
5064 impl DeleteOperation {
5065 pub(crate) fn new(
5066 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5067 ) -> Self {
5068 Self(RequestBuilder::new(stub))
5069 }
5070
5071 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5073 mut self,
5074 v: V,
5075 ) -> Self {
5076 self.0.request = v.into();
5077 self
5078 }
5079
5080 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5082 self.0.options = v.into();
5083 self
5084 }
5085
5086 pub async fn send(self) -> Result<()> {
5088 (*self.0.stub)
5089 .delete_operation(self.0.request, self.0.options)
5090 .await
5091 .map(crate::Response::into_body)
5092 }
5093
5094 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5096 self.0.request.name = v.into();
5097 self
5098 }
5099 }
5100
5101 #[doc(hidden)]
5102 impl crate::RequestBuilder for DeleteOperation {
5103 fn request_options(&mut self) -> &mut crate::RequestOptions {
5104 &mut self.0.options
5105 }
5106 }
5107
5108 #[derive(Clone, Debug)]
5125 pub struct CancelOperation(
5126 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5127 );
5128
5129 impl CancelOperation {
5130 pub(crate) fn new(
5131 stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5132 ) -> Self {
5133 Self(RequestBuilder::new(stub))
5134 }
5135
5136 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5138 mut self,
5139 v: V,
5140 ) -> Self {
5141 self.0.request = v.into();
5142 self
5143 }
5144
5145 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5147 self.0.options = v.into();
5148 self
5149 }
5150
5151 pub async fn send(self) -> Result<()> {
5153 (*self.0.stub)
5154 .cancel_operation(self.0.request, self.0.options)
5155 .await
5156 .map(crate::Response::into_body)
5157 }
5158
5159 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5161 self.0.request.name = v.into();
5162 self
5163 }
5164 }
5165
5166 #[doc(hidden)]
5167 impl crate::RequestBuilder for CancelOperation {
5168 fn request_options(&mut self) -> &mut crate::RequestOptions {
5169 &mut self.0.options
5170 }
5171 }
5172}
5173
5174pub mod firewall_activation {
5176 use crate::Result;
5177
5178 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5192
5193 pub(crate) mod client {
5194 use super::super::super::client::FirewallActivation;
5195 pub struct Factory;
5196 impl crate::ClientFactory for Factory {
5197 type Client = FirewallActivation;
5198 type Credentials = gaxi::options::Credentials;
5199 async fn build(
5200 self,
5201 config: gaxi::options::ClientConfig,
5202 ) -> crate::ClientBuilderResult<Self::Client> {
5203 Self::Client::new(config).await
5204 }
5205 }
5206 }
5207
5208 #[derive(Clone, Debug)]
5210 pub(crate) struct RequestBuilder<R: std::default::Default> {
5211 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5212 request: R,
5213 options: crate::RequestOptions,
5214 }
5215
5216 impl<R> RequestBuilder<R>
5217 where
5218 R: std::default::Default,
5219 {
5220 pub(crate) fn new(
5221 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5222 ) -> Self {
5223 Self {
5224 stub,
5225 request: R::default(),
5226 options: crate::RequestOptions::default(),
5227 }
5228 }
5229 }
5230
5231 #[derive(Clone, Debug)]
5252 pub struct ListFirewallEndpoints(RequestBuilder<crate::model::ListFirewallEndpointsRequest>);
5253
5254 impl ListFirewallEndpoints {
5255 pub(crate) fn new(
5256 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5257 ) -> Self {
5258 Self(RequestBuilder::new(stub))
5259 }
5260
5261 pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5263 mut self,
5264 v: V,
5265 ) -> Self {
5266 self.0.request = v.into();
5267 self
5268 }
5269
5270 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5272 self.0.options = v.into();
5273 self
5274 }
5275
5276 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5278 (*self.0.stub)
5279 .list_firewall_endpoints(self.0.request, self.0.options)
5280 .await
5281 .map(crate::Response::into_body)
5282 }
5283
5284 pub fn by_page(
5286 self,
5287 ) -> impl google_cloud_gax::paginator::Paginator<
5288 crate::model::ListFirewallEndpointsResponse,
5289 crate::Error,
5290 > {
5291 use std::clone::Clone;
5292 let token = self.0.request.page_token.clone();
5293 let execute = move |token: String| {
5294 let mut builder = self.clone();
5295 builder.0.request = builder.0.request.set_page_token(token);
5296 builder.send()
5297 };
5298 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5299 }
5300
5301 pub fn by_item(
5303 self,
5304 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5305 crate::model::ListFirewallEndpointsResponse,
5306 crate::Error,
5307 > {
5308 use google_cloud_gax::paginator::Paginator;
5309 self.by_page().items()
5310 }
5311
5312 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5316 self.0.request.parent = v.into();
5317 self
5318 }
5319
5320 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5322 self.0.request.page_size = v.into();
5323 self
5324 }
5325
5326 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5328 self.0.request.page_token = v.into();
5329 self
5330 }
5331
5332 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5334 self.0.request.filter = v.into();
5335 self
5336 }
5337
5338 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5340 self.0.request.order_by = v.into();
5341 self
5342 }
5343 }
5344
5345 #[doc(hidden)]
5346 impl crate::RequestBuilder for ListFirewallEndpoints {
5347 fn request_options(&mut self) -> &mut crate::RequestOptions {
5348 &mut self.0.options
5349 }
5350 }
5351
5352 #[derive(Clone, Debug)]
5373 pub struct ListProjectFirewallEndpoints(
5374 RequestBuilder<crate::model::ListFirewallEndpointsRequest>,
5375 );
5376
5377 impl ListProjectFirewallEndpoints {
5378 pub(crate) fn new(
5379 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5380 ) -> Self {
5381 Self(RequestBuilder::new(stub))
5382 }
5383
5384 pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5386 mut self,
5387 v: V,
5388 ) -> Self {
5389 self.0.request = v.into();
5390 self
5391 }
5392
5393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5395 self.0.options = v.into();
5396 self
5397 }
5398
5399 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5401 (*self.0.stub)
5402 .list_project_firewall_endpoints(self.0.request, self.0.options)
5403 .await
5404 .map(crate::Response::into_body)
5405 }
5406
5407 pub fn by_page(
5409 self,
5410 ) -> impl google_cloud_gax::paginator::Paginator<
5411 crate::model::ListFirewallEndpointsResponse,
5412 crate::Error,
5413 > {
5414 use std::clone::Clone;
5415 let token = self.0.request.page_token.clone();
5416 let execute = move |token: String| {
5417 let mut builder = self.clone();
5418 builder.0.request = builder.0.request.set_page_token(token);
5419 builder.send()
5420 };
5421 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5422 }
5423
5424 pub fn by_item(
5426 self,
5427 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5428 crate::model::ListFirewallEndpointsResponse,
5429 crate::Error,
5430 > {
5431 use google_cloud_gax::paginator::Paginator;
5432 self.by_page().items()
5433 }
5434
5435 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5439 self.0.request.parent = v.into();
5440 self
5441 }
5442
5443 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5445 self.0.request.page_size = v.into();
5446 self
5447 }
5448
5449 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5451 self.0.request.page_token = v.into();
5452 self
5453 }
5454
5455 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5457 self.0.request.filter = v.into();
5458 self
5459 }
5460
5461 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5463 self.0.request.order_by = v.into();
5464 self
5465 }
5466 }
5467
5468 #[doc(hidden)]
5469 impl crate::RequestBuilder for ListProjectFirewallEndpoints {
5470 fn request_options(&mut self) -> &mut crate::RequestOptions {
5471 &mut self.0.options
5472 }
5473 }
5474
5475 #[derive(Clone, Debug)]
5492 pub struct GetFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5493
5494 impl GetFirewallEndpoint {
5495 pub(crate) fn new(
5496 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5497 ) -> Self {
5498 Self(RequestBuilder::new(stub))
5499 }
5500
5501 pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5503 mut self,
5504 v: V,
5505 ) -> Self {
5506 self.0.request = v.into();
5507 self
5508 }
5509
5510 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5512 self.0.options = v.into();
5513 self
5514 }
5515
5516 pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5518 (*self.0.stub)
5519 .get_firewall_endpoint(self.0.request, self.0.options)
5520 .await
5521 .map(crate::Response::into_body)
5522 }
5523
5524 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5528 self.0.request.name = v.into();
5529 self
5530 }
5531 }
5532
5533 #[doc(hidden)]
5534 impl crate::RequestBuilder for GetFirewallEndpoint {
5535 fn request_options(&mut self) -> &mut crate::RequestOptions {
5536 &mut self.0.options
5537 }
5538 }
5539
5540 #[derive(Clone, Debug)]
5557 pub struct GetProjectFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5558
5559 impl GetProjectFirewallEndpoint {
5560 pub(crate) fn new(
5561 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5562 ) -> Self {
5563 Self(RequestBuilder::new(stub))
5564 }
5565
5566 pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5568 mut self,
5569 v: V,
5570 ) -> Self {
5571 self.0.request = v.into();
5572 self
5573 }
5574
5575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5577 self.0.options = v.into();
5578 self
5579 }
5580
5581 pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5583 (*self.0.stub)
5584 .get_project_firewall_endpoint(self.0.request, self.0.options)
5585 .await
5586 .map(crate::Response::into_body)
5587 }
5588
5589 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5593 self.0.request.name = v.into();
5594 self
5595 }
5596 }
5597
5598 #[doc(hidden)]
5599 impl crate::RequestBuilder for GetProjectFirewallEndpoint {
5600 fn request_options(&mut self) -> &mut crate::RequestOptions {
5601 &mut self.0.options
5602 }
5603 }
5604
5605 #[derive(Clone, Debug)]
5623 pub struct CreateFirewallEndpoint(RequestBuilder<crate::model::CreateFirewallEndpointRequest>);
5624
5625 impl CreateFirewallEndpoint {
5626 pub(crate) fn new(
5627 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5628 ) -> Self {
5629 Self(RequestBuilder::new(stub))
5630 }
5631
5632 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5634 mut self,
5635 v: V,
5636 ) -> Self {
5637 self.0.request = v.into();
5638 self
5639 }
5640
5641 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5643 self.0.options = v.into();
5644 self
5645 }
5646
5647 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5654 (*self.0.stub)
5655 .create_firewall_endpoint(self.0.request, self.0.options)
5656 .await
5657 .map(crate::Response::into_body)
5658 }
5659
5660 pub fn poller(
5662 self,
5663 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5664 {
5665 type Operation = google_cloud_lro::internal::Operation<
5666 crate::model::FirewallEndpoint,
5667 crate::model::OperationMetadata,
5668 >;
5669 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5670 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5671 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5672 if let Some(ref mut details) = poller_options.tracing {
5673 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::create_firewall_endpoint::until_done";
5674 }
5675
5676 let stub = self.0.stub.clone();
5677 let mut options = self.0.options.clone();
5678 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5679 let query = move |name| {
5680 let stub = stub.clone();
5681 let options = options.clone();
5682 async {
5683 let op = GetOperation::new(stub)
5684 .set_name(name)
5685 .with_options(options)
5686 .send()
5687 .await?;
5688 Ok(Operation::new(op))
5689 }
5690 };
5691
5692 let start = move || async {
5693 let op = self.send().await?;
5694 Ok(Operation::new(op))
5695 };
5696
5697 use google_cloud_lro::internal::PollerExt;
5698 {
5699 google_cloud_lro::internal::new_poller(
5700 polling_error_policy,
5701 polling_backoff_policy,
5702 start,
5703 query,
5704 )
5705 }
5706 .with_options(poller_options)
5707 }
5708
5709 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5713 self.0.request.parent = v.into();
5714 self
5715 }
5716
5717 pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5721 self.0.request.firewall_endpoint_id = v.into();
5722 self
5723 }
5724
5725 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5729 where
5730 T: std::convert::Into<crate::model::FirewallEndpoint>,
5731 {
5732 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5733 self
5734 }
5735
5736 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5740 where
5741 T: std::convert::Into<crate::model::FirewallEndpoint>,
5742 {
5743 self.0.request.firewall_endpoint = v.map(|x| x.into());
5744 self
5745 }
5746
5747 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5749 self.0.request.request_id = v.into();
5750 self
5751 }
5752 }
5753
5754 #[doc(hidden)]
5755 impl crate::RequestBuilder for CreateFirewallEndpoint {
5756 fn request_options(&mut self) -> &mut crate::RequestOptions {
5757 &mut self.0.options
5758 }
5759 }
5760
5761 #[derive(Clone, Debug)]
5779 pub struct CreateProjectFirewallEndpoint(
5780 RequestBuilder<crate::model::CreateFirewallEndpointRequest>,
5781 );
5782
5783 impl CreateProjectFirewallEndpoint {
5784 pub(crate) fn new(
5785 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5786 ) -> Self {
5787 Self(RequestBuilder::new(stub))
5788 }
5789
5790 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5792 mut self,
5793 v: V,
5794 ) -> Self {
5795 self.0.request = v.into();
5796 self
5797 }
5798
5799 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5801 self.0.options = v.into();
5802 self
5803 }
5804
5805 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5812 (*self.0.stub)
5813 .create_project_firewall_endpoint(self.0.request, self.0.options)
5814 .await
5815 .map(crate::Response::into_body)
5816 }
5817
5818 pub fn poller(
5820 self,
5821 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5822 {
5823 type Operation = google_cloud_lro::internal::Operation<
5824 crate::model::FirewallEndpoint,
5825 crate::model::OperationMetadata,
5826 >;
5827 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5828 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5829 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5830 if let Some(ref mut details) = poller_options.tracing {
5831 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::create_project_firewall_endpoint::until_done";
5832 }
5833
5834 let stub = self.0.stub.clone();
5835 let mut options = self.0.options.clone();
5836 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5837 let query = move |name| {
5838 let stub = stub.clone();
5839 let options = options.clone();
5840 async {
5841 let op = GetOperation::new(stub)
5842 .set_name(name)
5843 .with_options(options)
5844 .send()
5845 .await?;
5846 Ok(Operation::new(op))
5847 }
5848 };
5849
5850 let start = move || async {
5851 let op = self.send().await?;
5852 Ok(Operation::new(op))
5853 };
5854
5855 use google_cloud_lro::internal::PollerExt;
5856 {
5857 google_cloud_lro::internal::new_poller(
5858 polling_error_policy,
5859 polling_backoff_policy,
5860 start,
5861 query,
5862 )
5863 }
5864 .with_options(poller_options)
5865 }
5866
5867 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5871 self.0.request.parent = v.into();
5872 self
5873 }
5874
5875 pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5879 self.0.request.firewall_endpoint_id = v.into();
5880 self
5881 }
5882
5883 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5887 where
5888 T: std::convert::Into<crate::model::FirewallEndpoint>,
5889 {
5890 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5891 self
5892 }
5893
5894 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5898 where
5899 T: std::convert::Into<crate::model::FirewallEndpoint>,
5900 {
5901 self.0.request.firewall_endpoint = v.map(|x| x.into());
5902 self
5903 }
5904
5905 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5907 self.0.request.request_id = v.into();
5908 self
5909 }
5910 }
5911
5912 #[doc(hidden)]
5913 impl crate::RequestBuilder for CreateProjectFirewallEndpoint {
5914 fn request_options(&mut self) -> &mut crate::RequestOptions {
5915 &mut self.0.options
5916 }
5917 }
5918
5919 #[derive(Clone, Debug)]
5937 pub struct DeleteFirewallEndpoint(RequestBuilder<crate::model::DeleteFirewallEndpointRequest>);
5938
5939 impl DeleteFirewallEndpoint {
5940 pub(crate) fn new(
5941 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5942 ) -> Self {
5943 Self(RequestBuilder::new(stub))
5944 }
5945
5946 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5948 mut self,
5949 v: V,
5950 ) -> Self {
5951 self.0.request = v.into();
5952 self
5953 }
5954
5955 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5957 self.0.options = v.into();
5958 self
5959 }
5960
5961 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5968 (*self.0.stub)
5969 .delete_firewall_endpoint(self.0.request, self.0.options)
5970 .await
5971 .map(crate::Response::into_body)
5972 }
5973
5974 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5976 type Operation =
5977 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5978 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5979 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5980 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5981 if let Some(ref mut details) = poller_options.tracing {
5982 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::delete_firewall_endpoint::until_done";
5983 }
5984
5985 let stub = self.0.stub.clone();
5986 let mut options = self.0.options.clone();
5987 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5988 let query = move |name| {
5989 let stub = stub.clone();
5990 let options = options.clone();
5991 async {
5992 let op = GetOperation::new(stub)
5993 .set_name(name)
5994 .with_options(options)
5995 .send()
5996 .await?;
5997 Ok(Operation::new(op))
5998 }
5999 };
6000
6001 let start = move || async {
6002 let op = self.send().await?;
6003 Ok(Operation::new(op))
6004 };
6005
6006 use google_cloud_lro::internal::PollerExt;
6007 {
6008 google_cloud_lro::internal::new_unit_response_poller(
6009 polling_error_policy,
6010 polling_backoff_policy,
6011 start,
6012 query,
6013 )
6014 }
6015 .with_options(poller_options)
6016 }
6017
6018 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6022 self.0.request.name = v.into();
6023 self
6024 }
6025
6026 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6028 self.0.request.request_id = v.into();
6029 self
6030 }
6031 }
6032
6033 #[doc(hidden)]
6034 impl crate::RequestBuilder for DeleteFirewallEndpoint {
6035 fn request_options(&mut self) -> &mut crate::RequestOptions {
6036 &mut self.0.options
6037 }
6038 }
6039
6040 #[derive(Clone, Debug)]
6058 pub struct DeleteProjectFirewallEndpoint(
6059 RequestBuilder<crate::model::DeleteFirewallEndpointRequest>,
6060 );
6061
6062 impl DeleteProjectFirewallEndpoint {
6063 pub(crate) fn new(
6064 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6065 ) -> Self {
6066 Self(RequestBuilder::new(stub))
6067 }
6068
6069 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
6071 mut self,
6072 v: V,
6073 ) -> Self {
6074 self.0.request = v.into();
6075 self
6076 }
6077
6078 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6080 self.0.options = v.into();
6081 self
6082 }
6083
6084 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6091 (*self.0.stub)
6092 .delete_project_firewall_endpoint(self.0.request, self.0.options)
6093 .await
6094 .map(crate::Response::into_body)
6095 }
6096
6097 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6099 type Operation =
6100 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6101 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6102 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6103 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6104 if let Some(ref mut details) = poller_options.tracing {
6105 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::delete_project_firewall_endpoint::until_done";
6106 }
6107
6108 let stub = self.0.stub.clone();
6109 let mut options = self.0.options.clone();
6110 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6111 let query = move |name| {
6112 let stub = stub.clone();
6113 let options = options.clone();
6114 async {
6115 let op = GetOperation::new(stub)
6116 .set_name(name)
6117 .with_options(options)
6118 .send()
6119 .await?;
6120 Ok(Operation::new(op))
6121 }
6122 };
6123
6124 let start = move || async {
6125 let op = self.send().await?;
6126 Ok(Operation::new(op))
6127 };
6128
6129 use google_cloud_lro::internal::PollerExt;
6130 {
6131 google_cloud_lro::internal::new_unit_response_poller(
6132 polling_error_policy,
6133 polling_backoff_policy,
6134 start,
6135 query,
6136 )
6137 }
6138 .with_options(poller_options)
6139 }
6140
6141 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6145 self.0.request.name = v.into();
6146 self
6147 }
6148
6149 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6151 self.0.request.request_id = v.into();
6152 self
6153 }
6154 }
6155
6156 #[doc(hidden)]
6157 impl crate::RequestBuilder for DeleteProjectFirewallEndpoint {
6158 fn request_options(&mut self) -> &mut crate::RequestOptions {
6159 &mut self.0.options
6160 }
6161 }
6162
6163 #[derive(Clone, Debug)]
6181 pub struct UpdateFirewallEndpoint(RequestBuilder<crate::model::UpdateFirewallEndpointRequest>);
6182
6183 impl UpdateFirewallEndpoint {
6184 pub(crate) fn new(
6185 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6186 ) -> Self {
6187 Self(RequestBuilder::new(stub))
6188 }
6189
6190 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
6192 mut self,
6193 v: V,
6194 ) -> Self {
6195 self.0.request = v.into();
6196 self
6197 }
6198
6199 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6201 self.0.options = v.into();
6202 self
6203 }
6204
6205 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6212 (*self.0.stub)
6213 .update_firewall_endpoint(self.0.request, self.0.options)
6214 .await
6215 .map(crate::Response::into_body)
6216 }
6217
6218 pub fn poller(
6220 self,
6221 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
6222 {
6223 type Operation = google_cloud_lro::internal::Operation<
6224 crate::model::FirewallEndpoint,
6225 crate::model::OperationMetadata,
6226 >;
6227 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6228 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6229 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6230 if let Some(ref mut details) = poller_options.tracing {
6231 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::update_firewall_endpoint::until_done";
6232 }
6233
6234 let stub = self.0.stub.clone();
6235 let mut options = self.0.options.clone();
6236 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6237 let query = move |name| {
6238 let stub = stub.clone();
6239 let options = options.clone();
6240 async {
6241 let op = GetOperation::new(stub)
6242 .set_name(name)
6243 .with_options(options)
6244 .send()
6245 .await?;
6246 Ok(Operation::new(op))
6247 }
6248 };
6249
6250 let start = move || async {
6251 let op = self.send().await?;
6252 Ok(Operation::new(op))
6253 };
6254
6255 use google_cloud_lro::internal::PollerExt;
6256 {
6257 google_cloud_lro::internal::new_poller(
6258 polling_error_policy,
6259 polling_backoff_policy,
6260 start,
6261 query,
6262 )
6263 }
6264 .with_options(poller_options)
6265 }
6266
6267 pub fn set_update_mask<T>(mut self, v: T) -> Self
6271 where
6272 T: std::convert::Into<wkt::FieldMask>,
6273 {
6274 self.0.request.update_mask = std::option::Option::Some(v.into());
6275 self
6276 }
6277
6278 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6282 where
6283 T: std::convert::Into<wkt::FieldMask>,
6284 {
6285 self.0.request.update_mask = v.map(|x| x.into());
6286 self
6287 }
6288
6289 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
6293 where
6294 T: std::convert::Into<crate::model::FirewallEndpoint>,
6295 {
6296 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
6297 self
6298 }
6299
6300 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
6304 where
6305 T: std::convert::Into<crate::model::FirewallEndpoint>,
6306 {
6307 self.0.request.firewall_endpoint = v.map(|x| x.into());
6308 self
6309 }
6310
6311 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6313 self.0.request.request_id = v.into();
6314 self
6315 }
6316 }
6317
6318 #[doc(hidden)]
6319 impl crate::RequestBuilder for UpdateFirewallEndpoint {
6320 fn request_options(&mut self) -> &mut crate::RequestOptions {
6321 &mut self.0.options
6322 }
6323 }
6324
6325 #[derive(Clone, Debug)]
6343 pub struct UpdateProjectFirewallEndpoint(
6344 RequestBuilder<crate::model::UpdateFirewallEndpointRequest>,
6345 );
6346
6347 impl UpdateProjectFirewallEndpoint {
6348 pub(crate) fn new(
6349 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6350 ) -> Self {
6351 Self(RequestBuilder::new(stub))
6352 }
6353
6354 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
6356 mut self,
6357 v: V,
6358 ) -> Self {
6359 self.0.request = v.into();
6360 self
6361 }
6362
6363 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6365 self.0.options = v.into();
6366 self
6367 }
6368
6369 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6376 (*self.0.stub)
6377 .update_project_firewall_endpoint(self.0.request, self.0.options)
6378 .await
6379 .map(crate::Response::into_body)
6380 }
6381
6382 pub fn poller(
6384 self,
6385 ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
6386 {
6387 type Operation = google_cloud_lro::internal::Operation<
6388 crate::model::FirewallEndpoint,
6389 crate::model::OperationMetadata,
6390 >;
6391 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6392 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6393 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6394 if let Some(ref mut details) = poller_options.tracing {
6395 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::update_project_firewall_endpoint::until_done";
6396 }
6397
6398 let stub = self.0.stub.clone();
6399 let mut options = self.0.options.clone();
6400 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6401 let query = move |name| {
6402 let stub = stub.clone();
6403 let options = options.clone();
6404 async {
6405 let op = GetOperation::new(stub)
6406 .set_name(name)
6407 .with_options(options)
6408 .send()
6409 .await?;
6410 Ok(Operation::new(op))
6411 }
6412 };
6413
6414 let start = move || async {
6415 let op = self.send().await?;
6416 Ok(Operation::new(op))
6417 };
6418
6419 use google_cloud_lro::internal::PollerExt;
6420 {
6421 google_cloud_lro::internal::new_poller(
6422 polling_error_policy,
6423 polling_backoff_policy,
6424 start,
6425 query,
6426 )
6427 }
6428 .with_options(poller_options)
6429 }
6430
6431 pub fn set_update_mask<T>(mut self, v: T) -> Self
6435 where
6436 T: std::convert::Into<wkt::FieldMask>,
6437 {
6438 self.0.request.update_mask = std::option::Option::Some(v.into());
6439 self
6440 }
6441
6442 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6446 where
6447 T: std::convert::Into<wkt::FieldMask>,
6448 {
6449 self.0.request.update_mask = v.map(|x| x.into());
6450 self
6451 }
6452
6453 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
6457 where
6458 T: std::convert::Into<crate::model::FirewallEndpoint>,
6459 {
6460 self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
6461 self
6462 }
6463
6464 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
6468 where
6469 T: std::convert::Into<crate::model::FirewallEndpoint>,
6470 {
6471 self.0.request.firewall_endpoint = v.map(|x| x.into());
6472 self
6473 }
6474
6475 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6477 self.0.request.request_id = v.into();
6478 self
6479 }
6480 }
6481
6482 #[doc(hidden)]
6483 impl crate::RequestBuilder for UpdateProjectFirewallEndpoint {
6484 fn request_options(&mut self) -> &mut crate::RequestOptions {
6485 &mut self.0.options
6486 }
6487 }
6488
6489 #[derive(Clone, Debug)]
6510 pub struct ListFirewallEndpointAssociations(
6511 RequestBuilder<crate::model::ListFirewallEndpointAssociationsRequest>,
6512 );
6513
6514 impl ListFirewallEndpointAssociations {
6515 pub(crate) fn new(
6516 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6517 ) -> Self {
6518 Self(RequestBuilder::new(stub))
6519 }
6520
6521 pub fn with_request<V: Into<crate::model::ListFirewallEndpointAssociationsRequest>>(
6523 mut self,
6524 v: V,
6525 ) -> Self {
6526 self.0.request = v.into();
6527 self
6528 }
6529
6530 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6532 self.0.options = v.into();
6533 self
6534 }
6535
6536 pub async fn send(self) -> Result<crate::model::ListFirewallEndpointAssociationsResponse> {
6538 (*self.0.stub)
6539 .list_firewall_endpoint_associations(self.0.request, self.0.options)
6540 .await
6541 .map(crate::Response::into_body)
6542 }
6543
6544 pub fn by_page(
6546 self,
6547 ) -> impl google_cloud_gax::paginator::Paginator<
6548 crate::model::ListFirewallEndpointAssociationsResponse,
6549 crate::Error,
6550 > {
6551 use std::clone::Clone;
6552 let token = self.0.request.page_token.clone();
6553 let execute = move |token: String| {
6554 let mut builder = self.clone();
6555 builder.0.request = builder.0.request.set_page_token(token);
6556 builder.send()
6557 };
6558 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6559 }
6560
6561 pub fn by_item(
6563 self,
6564 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6565 crate::model::ListFirewallEndpointAssociationsResponse,
6566 crate::Error,
6567 > {
6568 use google_cloud_gax::paginator::Paginator;
6569 self.by_page().items()
6570 }
6571
6572 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6576 self.0.request.parent = v.into();
6577 self
6578 }
6579
6580 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6582 self.0.request.page_size = v.into();
6583 self
6584 }
6585
6586 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6588 self.0.request.page_token = v.into();
6589 self
6590 }
6591
6592 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6594 self.0.request.filter = v.into();
6595 self
6596 }
6597
6598 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6600 self.0.request.order_by = v.into();
6601 self
6602 }
6603 }
6604
6605 #[doc(hidden)]
6606 impl crate::RequestBuilder for ListFirewallEndpointAssociations {
6607 fn request_options(&mut self) -> &mut crate::RequestOptions {
6608 &mut self.0.options
6609 }
6610 }
6611
6612 #[derive(Clone, Debug)]
6629 pub struct GetFirewallEndpointAssociation(
6630 RequestBuilder<crate::model::GetFirewallEndpointAssociationRequest>,
6631 );
6632
6633 impl GetFirewallEndpointAssociation {
6634 pub(crate) fn new(
6635 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6636 ) -> Self {
6637 Self(RequestBuilder::new(stub))
6638 }
6639
6640 pub fn with_request<V: Into<crate::model::GetFirewallEndpointAssociationRequest>>(
6642 mut self,
6643 v: V,
6644 ) -> Self {
6645 self.0.request = v.into();
6646 self
6647 }
6648
6649 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6651 self.0.options = v.into();
6652 self
6653 }
6654
6655 pub async fn send(self) -> Result<crate::model::FirewallEndpointAssociation> {
6657 (*self.0.stub)
6658 .get_firewall_endpoint_association(self.0.request, self.0.options)
6659 .await
6660 .map(crate::Response::into_body)
6661 }
6662
6663 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6667 self.0.request.name = v.into();
6668 self
6669 }
6670 }
6671
6672 #[doc(hidden)]
6673 impl crate::RequestBuilder for GetFirewallEndpointAssociation {
6674 fn request_options(&mut self) -> &mut crate::RequestOptions {
6675 &mut self.0.options
6676 }
6677 }
6678
6679 #[derive(Clone, Debug)]
6697 pub struct CreateFirewallEndpointAssociation(
6698 RequestBuilder<crate::model::CreateFirewallEndpointAssociationRequest>,
6699 );
6700
6701 impl CreateFirewallEndpointAssociation {
6702 pub(crate) fn new(
6703 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6704 ) -> Self {
6705 Self(RequestBuilder::new(stub))
6706 }
6707
6708 pub fn with_request<V: Into<crate::model::CreateFirewallEndpointAssociationRequest>>(
6710 mut self,
6711 v: V,
6712 ) -> Self {
6713 self.0.request = v.into();
6714 self
6715 }
6716
6717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6719 self.0.options = v.into();
6720 self
6721 }
6722
6723 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6730 (*self.0.stub)
6731 .create_firewall_endpoint_association(self.0.request, self.0.options)
6732 .await
6733 .map(crate::Response::into_body)
6734 }
6735
6736 pub fn poller(
6738 self,
6739 ) -> impl google_cloud_lro::Poller<
6740 crate::model::FirewallEndpointAssociation,
6741 crate::model::OperationMetadata,
6742 > {
6743 type Operation = google_cloud_lro::internal::Operation<
6744 crate::model::FirewallEndpointAssociation,
6745 crate::model::OperationMetadata,
6746 >;
6747 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6748 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6749 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6750 if let Some(ref mut details) = poller_options.tracing {
6751 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::create_firewall_endpoint_association::until_done";
6752 }
6753
6754 let stub = self.0.stub.clone();
6755 let mut options = self.0.options.clone();
6756 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6757 let query = move |name| {
6758 let stub = stub.clone();
6759 let options = options.clone();
6760 async {
6761 let op = GetOperation::new(stub)
6762 .set_name(name)
6763 .with_options(options)
6764 .send()
6765 .await?;
6766 Ok(Operation::new(op))
6767 }
6768 };
6769
6770 let start = move || async {
6771 let op = self.send().await?;
6772 Ok(Operation::new(op))
6773 };
6774
6775 use google_cloud_lro::internal::PollerExt;
6776 {
6777 google_cloud_lro::internal::new_poller(
6778 polling_error_policy,
6779 polling_backoff_policy,
6780 start,
6781 query,
6782 )
6783 }
6784 .with_options(poller_options)
6785 }
6786
6787 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6791 self.0.request.parent = v.into();
6792 self
6793 }
6794
6795 pub fn set_firewall_endpoint_association_id<T: Into<std::string::String>>(
6797 mut self,
6798 v: T,
6799 ) -> Self {
6800 self.0.request.firewall_endpoint_association_id = v.into();
6801 self
6802 }
6803
6804 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6808 where
6809 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6810 {
6811 self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6812 self
6813 }
6814
6815 pub fn set_or_clear_firewall_endpoint_association<T>(
6819 mut self,
6820 v: std::option::Option<T>,
6821 ) -> Self
6822 where
6823 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6824 {
6825 self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6826 self
6827 }
6828
6829 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6831 self.0.request.request_id = v.into();
6832 self
6833 }
6834 }
6835
6836 #[doc(hidden)]
6837 impl crate::RequestBuilder for CreateFirewallEndpointAssociation {
6838 fn request_options(&mut self) -> &mut crate::RequestOptions {
6839 &mut self.0.options
6840 }
6841 }
6842
6843 #[derive(Clone, Debug)]
6861 pub struct DeleteFirewallEndpointAssociation(
6862 RequestBuilder<crate::model::DeleteFirewallEndpointAssociationRequest>,
6863 );
6864
6865 impl DeleteFirewallEndpointAssociation {
6866 pub(crate) fn new(
6867 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6868 ) -> Self {
6869 Self(RequestBuilder::new(stub))
6870 }
6871
6872 pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointAssociationRequest>>(
6874 mut self,
6875 v: V,
6876 ) -> Self {
6877 self.0.request = v.into();
6878 self
6879 }
6880
6881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6883 self.0.options = v.into();
6884 self
6885 }
6886
6887 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6894 (*self.0.stub)
6895 .delete_firewall_endpoint_association(self.0.request, self.0.options)
6896 .await
6897 .map(crate::Response::into_body)
6898 }
6899
6900 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6902 type Operation =
6903 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6904 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6905 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6906 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6907 if let Some(ref mut details) = poller_options.tracing {
6908 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::delete_firewall_endpoint_association::until_done";
6909 }
6910
6911 let stub = self.0.stub.clone();
6912 let mut options = self.0.options.clone();
6913 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6914 let query = move |name| {
6915 let stub = stub.clone();
6916 let options = options.clone();
6917 async {
6918 let op = GetOperation::new(stub)
6919 .set_name(name)
6920 .with_options(options)
6921 .send()
6922 .await?;
6923 Ok(Operation::new(op))
6924 }
6925 };
6926
6927 let start = move || async {
6928 let op = self.send().await?;
6929 Ok(Operation::new(op))
6930 };
6931
6932 use google_cloud_lro::internal::PollerExt;
6933 {
6934 google_cloud_lro::internal::new_unit_response_poller(
6935 polling_error_policy,
6936 polling_backoff_policy,
6937 start,
6938 query,
6939 )
6940 }
6941 .with_options(poller_options)
6942 }
6943
6944 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6948 self.0.request.name = v.into();
6949 self
6950 }
6951
6952 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6954 self.0.request.request_id = v.into();
6955 self
6956 }
6957 }
6958
6959 #[doc(hidden)]
6960 impl crate::RequestBuilder for DeleteFirewallEndpointAssociation {
6961 fn request_options(&mut self) -> &mut crate::RequestOptions {
6962 &mut self.0.options
6963 }
6964 }
6965
6966 #[derive(Clone, Debug)]
6984 pub struct UpdateFirewallEndpointAssociation(
6985 RequestBuilder<crate::model::UpdateFirewallEndpointAssociationRequest>,
6986 );
6987
6988 impl UpdateFirewallEndpointAssociation {
6989 pub(crate) fn new(
6990 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6991 ) -> Self {
6992 Self(RequestBuilder::new(stub))
6993 }
6994
6995 pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointAssociationRequest>>(
6997 mut self,
6998 v: V,
6999 ) -> Self {
7000 self.0.request = v.into();
7001 self
7002 }
7003
7004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7006 self.0.options = v.into();
7007 self
7008 }
7009
7010 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7017 (*self.0.stub)
7018 .update_firewall_endpoint_association(self.0.request, self.0.options)
7019 .await
7020 .map(crate::Response::into_body)
7021 }
7022
7023 pub fn poller(
7025 self,
7026 ) -> impl google_cloud_lro::Poller<
7027 crate::model::FirewallEndpointAssociation,
7028 crate::model::OperationMetadata,
7029 > {
7030 type Operation = google_cloud_lro::internal::Operation<
7031 crate::model::FirewallEndpointAssociation,
7032 crate::model::OperationMetadata,
7033 >;
7034 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7035 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7036 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7037 if let Some(ref mut details) = poller_options.tracing {
7038 details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::update_firewall_endpoint_association::until_done";
7039 }
7040
7041 let stub = self.0.stub.clone();
7042 let mut options = self.0.options.clone();
7043 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7044 let query = move |name| {
7045 let stub = stub.clone();
7046 let options = options.clone();
7047 async {
7048 let op = GetOperation::new(stub)
7049 .set_name(name)
7050 .with_options(options)
7051 .send()
7052 .await?;
7053 Ok(Operation::new(op))
7054 }
7055 };
7056
7057 let start = move || async {
7058 let op = self.send().await?;
7059 Ok(Operation::new(op))
7060 };
7061
7062 use google_cloud_lro::internal::PollerExt;
7063 {
7064 google_cloud_lro::internal::new_poller(
7065 polling_error_policy,
7066 polling_backoff_policy,
7067 start,
7068 query,
7069 )
7070 }
7071 .with_options(poller_options)
7072 }
7073
7074 pub fn set_update_mask<T>(mut self, v: T) -> Self
7078 where
7079 T: std::convert::Into<wkt::FieldMask>,
7080 {
7081 self.0.request.update_mask = std::option::Option::Some(v.into());
7082 self
7083 }
7084
7085 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7089 where
7090 T: std::convert::Into<wkt::FieldMask>,
7091 {
7092 self.0.request.update_mask = v.map(|x| x.into());
7093 self
7094 }
7095
7096 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
7100 where
7101 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
7102 {
7103 self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
7104 self
7105 }
7106
7107 pub fn set_or_clear_firewall_endpoint_association<T>(
7111 mut self,
7112 v: std::option::Option<T>,
7113 ) -> Self
7114 where
7115 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
7116 {
7117 self.0.request.firewall_endpoint_association = v.map(|x| x.into());
7118 self
7119 }
7120
7121 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7123 self.0.request.request_id = v.into();
7124 self
7125 }
7126 }
7127
7128 #[doc(hidden)]
7129 impl crate::RequestBuilder for UpdateFirewallEndpointAssociation {
7130 fn request_options(&mut self) -> &mut crate::RequestOptions {
7131 &mut self.0.options
7132 }
7133 }
7134
7135 #[derive(Clone, Debug)]
7156 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7157
7158 impl ListLocations {
7159 pub(crate) fn new(
7160 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7161 ) -> Self {
7162 Self(RequestBuilder::new(stub))
7163 }
7164
7165 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7167 mut self,
7168 v: V,
7169 ) -> Self {
7170 self.0.request = v.into();
7171 self
7172 }
7173
7174 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7176 self.0.options = v.into();
7177 self
7178 }
7179
7180 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7182 (*self.0.stub)
7183 .list_locations(self.0.request, self.0.options)
7184 .await
7185 .map(crate::Response::into_body)
7186 }
7187
7188 pub fn by_page(
7190 self,
7191 ) -> impl google_cloud_gax::paginator::Paginator<
7192 google_cloud_location::model::ListLocationsResponse,
7193 crate::Error,
7194 > {
7195 use std::clone::Clone;
7196 let token = self.0.request.page_token.clone();
7197 let execute = move |token: String| {
7198 let mut builder = self.clone();
7199 builder.0.request = builder.0.request.set_page_token(token);
7200 builder.send()
7201 };
7202 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7203 }
7204
7205 pub fn by_item(
7207 self,
7208 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7209 google_cloud_location::model::ListLocationsResponse,
7210 crate::Error,
7211 > {
7212 use google_cloud_gax::paginator::Paginator;
7213 self.by_page().items()
7214 }
7215
7216 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7218 self.0.request.name = v.into();
7219 self
7220 }
7221
7222 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7224 self.0.request.filter = v.into();
7225 self
7226 }
7227
7228 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7230 self.0.request.page_size = v.into();
7231 self
7232 }
7233
7234 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7236 self.0.request.page_token = v.into();
7237 self
7238 }
7239 }
7240
7241 #[doc(hidden)]
7242 impl crate::RequestBuilder for ListLocations {
7243 fn request_options(&mut self) -> &mut crate::RequestOptions {
7244 &mut self.0.options
7245 }
7246 }
7247
7248 #[derive(Clone, Debug)]
7265 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7266
7267 impl GetLocation {
7268 pub(crate) fn new(
7269 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7270 ) -> Self {
7271 Self(RequestBuilder::new(stub))
7272 }
7273
7274 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7276 mut self,
7277 v: V,
7278 ) -> Self {
7279 self.0.request = v.into();
7280 self
7281 }
7282
7283 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7285 self.0.options = v.into();
7286 self
7287 }
7288
7289 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7291 (*self.0.stub)
7292 .get_location(self.0.request, self.0.options)
7293 .await
7294 .map(crate::Response::into_body)
7295 }
7296
7297 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7299 self.0.request.name = v.into();
7300 self
7301 }
7302 }
7303
7304 #[doc(hidden)]
7305 impl crate::RequestBuilder for GetLocation {
7306 fn request_options(&mut self) -> &mut crate::RequestOptions {
7307 &mut self.0.options
7308 }
7309 }
7310
7311 #[derive(Clone, Debug)]
7328 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
7329
7330 impl SetIamPolicy {
7331 pub(crate) fn new(
7332 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7333 ) -> Self {
7334 Self(RequestBuilder::new(stub))
7335 }
7336
7337 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
7339 mut self,
7340 v: V,
7341 ) -> Self {
7342 self.0.request = v.into();
7343 self
7344 }
7345
7346 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7348 self.0.options = v.into();
7349 self
7350 }
7351
7352 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7354 (*self.0.stub)
7355 .set_iam_policy(self.0.request, self.0.options)
7356 .await
7357 .map(crate::Response::into_body)
7358 }
7359
7360 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7364 self.0.request.resource = v.into();
7365 self
7366 }
7367
7368 pub fn set_policy<T>(mut self, v: T) -> Self
7372 where
7373 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7374 {
7375 self.0.request.policy = std::option::Option::Some(v.into());
7376 self
7377 }
7378
7379 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7383 where
7384 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7385 {
7386 self.0.request.policy = v.map(|x| x.into());
7387 self
7388 }
7389
7390 pub fn set_update_mask<T>(mut self, v: T) -> Self
7392 where
7393 T: std::convert::Into<wkt::FieldMask>,
7394 {
7395 self.0.request.update_mask = std::option::Option::Some(v.into());
7396 self
7397 }
7398
7399 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7401 where
7402 T: std::convert::Into<wkt::FieldMask>,
7403 {
7404 self.0.request.update_mask = v.map(|x| x.into());
7405 self
7406 }
7407 }
7408
7409 #[doc(hidden)]
7410 impl crate::RequestBuilder for SetIamPolicy {
7411 fn request_options(&mut self) -> &mut crate::RequestOptions {
7412 &mut self.0.options
7413 }
7414 }
7415
7416 #[derive(Clone, Debug)]
7433 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
7434
7435 impl GetIamPolicy {
7436 pub(crate) fn new(
7437 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7438 ) -> Self {
7439 Self(RequestBuilder::new(stub))
7440 }
7441
7442 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
7444 mut self,
7445 v: V,
7446 ) -> Self {
7447 self.0.request = v.into();
7448 self
7449 }
7450
7451 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7453 self.0.options = v.into();
7454 self
7455 }
7456
7457 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7459 (*self.0.stub)
7460 .get_iam_policy(self.0.request, self.0.options)
7461 .await
7462 .map(crate::Response::into_body)
7463 }
7464
7465 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7469 self.0.request.resource = v.into();
7470 self
7471 }
7472
7473 pub fn set_options<T>(mut self, v: T) -> Self
7475 where
7476 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7477 {
7478 self.0.request.options = std::option::Option::Some(v.into());
7479 self
7480 }
7481
7482 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7484 where
7485 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7486 {
7487 self.0.request.options = v.map(|x| x.into());
7488 self
7489 }
7490 }
7491
7492 #[doc(hidden)]
7493 impl crate::RequestBuilder for GetIamPolicy {
7494 fn request_options(&mut self) -> &mut crate::RequestOptions {
7495 &mut self.0.options
7496 }
7497 }
7498
7499 #[derive(Clone, Debug)]
7516 pub struct TestIamPermissions(
7517 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
7518 );
7519
7520 impl TestIamPermissions {
7521 pub(crate) fn new(
7522 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7523 ) -> Self {
7524 Self(RequestBuilder::new(stub))
7525 }
7526
7527 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
7529 mut self,
7530 v: V,
7531 ) -> Self {
7532 self.0.request = v.into();
7533 self
7534 }
7535
7536 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7538 self.0.options = v.into();
7539 self
7540 }
7541
7542 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
7544 (*self.0.stub)
7545 .test_iam_permissions(self.0.request, self.0.options)
7546 .await
7547 .map(crate::Response::into_body)
7548 }
7549
7550 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7554 self.0.request.resource = v.into();
7555 self
7556 }
7557
7558 pub fn set_permissions<T, V>(mut self, v: T) -> Self
7562 where
7563 T: std::iter::IntoIterator<Item = V>,
7564 V: std::convert::Into<std::string::String>,
7565 {
7566 use std::iter::Iterator;
7567 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7568 self
7569 }
7570 }
7571
7572 #[doc(hidden)]
7573 impl crate::RequestBuilder for TestIamPermissions {
7574 fn request_options(&mut self) -> &mut crate::RequestOptions {
7575 &mut self.0.options
7576 }
7577 }
7578
7579 #[derive(Clone, Debug)]
7600 pub struct ListOperations(
7601 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7602 );
7603
7604 impl ListOperations {
7605 pub(crate) fn new(
7606 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7607 ) -> Self {
7608 Self(RequestBuilder::new(stub))
7609 }
7610
7611 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7613 mut self,
7614 v: V,
7615 ) -> Self {
7616 self.0.request = v.into();
7617 self
7618 }
7619
7620 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7622 self.0.options = v.into();
7623 self
7624 }
7625
7626 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7628 (*self.0.stub)
7629 .list_operations(self.0.request, self.0.options)
7630 .await
7631 .map(crate::Response::into_body)
7632 }
7633
7634 pub fn by_page(
7636 self,
7637 ) -> impl google_cloud_gax::paginator::Paginator<
7638 google_cloud_longrunning::model::ListOperationsResponse,
7639 crate::Error,
7640 > {
7641 use std::clone::Clone;
7642 let token = self.0.request.page_token.clone();
7643 let execute = move |token: String| {
7644 let mut builder = self.clone();
7645 builder.0.request = builder.0.request.set_page_token(token);
7646 builder.send()
7647 };
7648 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7649 }
7650
7651 pub fn by_item(
7653 self,
7654 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7655 google_cloud_longrunning::model::ListOperationsResponse,
7656 crate::Error,
7657 > {
7658 use google_cloud_gax::paginator::Paginator;
7659 self.by_page().items()
7660 }
7661
7662 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7664 self.0.request.name = v.into();
7665 self
7666 }
7667
7668 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7670 self.0.request.filter = v.into();
7671 self
7672 }
7673
7674 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7676 self.0.request.page_size = v.into();
7677 self
7678 }
7679
7680 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7682 self.0.request.page_token = v.into();
7683 self
7684 }
7685
7686 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7688 self.0.request.return_partial_success = v.into();
7689 self
7690 }
7691 }
7692
7693 #[doc(hidden)]
7694 impl crate::RequestBuilder for ListOperations {
7695 fn request_options(&mut self) -> &mut crate::RequestOptions {
7696 &mut self.0.options
7697 }
7698 }
7699
7700 #[derive(Clone, Debug)]
7717 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7718
7719 impl GetOperation {
7720 pub(crate) fn new(
7721 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7722 ) -> Self {
7723 Self(RequestBuilder::new(stub))
7724 }
7725
7726 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7728 mut self,
7729 v: V,
7730 ) -> Self {
7731 self.0.request = v.into();
7732 self
7733 }
7734
7735 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7737 self.0.options = v.into();
7738 self
7739 }
7740
7741 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7743 (*self.0.stub)
7744 .get_operation(self.0.request, self.0.options)
7745 .await
7746 .map(crate::Response::into_body)
7747 }
7748
7749 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7751 self.0.request.name = v.into();
7752 self
7753 }
7754 }
7755
7756 #[doc(hidden)]
7757 impl crate::RequestBuilder for GetOperation {
7758 fn request_options(&mut self) -> &mut crate::RequestOptions {
7759 &mut self.0.options
7760 }
7761 }
7762
7763 #[derive(Clone, Debug)]
7780 pub struct DeleteOperation(
7781 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7782 );
7783
7784 impl DeleteOperation {
7785 pub(crate) fn new(
7786 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7787 ) -> Self {
7788 Self(RequestBuilder::new(stub))
7789 }
7790
7791 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7793 mut self,
7794 v: V,
7795 ) -> Self {
7796 self.0.request = v.into();
7797 self
7798 }
7799
7800 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7802 self.0.options = v.into();
7803 self
7804 }
7805
7806 pub async fn send(self) -> Result<()> {
7808 (*self.0.stub)
7809 .delete_operation(self.0.request, self.0.options)
7810 .await
7811 .map(crate::Response::into_body)
7812 }
7813
7814 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7816 self.0.request.name = v.into();
7817 self
7818 }
7819 }
7820
7821 #[doc(hidden)]
7822 impl crate::RequestBuilder for DeleteOperation {
7823 fn request_options(&mut self) -> &mut crate::RequestOptions {
7824 &mut self.0.options
7825 }
7826 }
7827
7828 #[derive(Clone, Debug)]
7845 pub struct CancelOperation(
7846 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7847 );
7848
7849 impl CancelOperation {
7850 pub(crate) fn new(
7851 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7852 ) -> Self {
7853 Self(RequestBuilder::new(stub))
7854 }
7855
7856 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7858 mut self,
7859 v: V,
7860 ) -> Self {
7861 self.0.request = v.into();
7862 self
7863 }
7864
7865 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7867 self.0.options = v.into();
7868 self
7869 }
7870
7871 pub async fn send(self) -> Result<()> {
7873 (*self.0.stub)
7874 .cancel_operation(self.0.request, self.0.options)
7875 .await
7876 .map(crate::Response::into_body)
7877 }
7878
7879 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7881 self.0.request.name = v.into();
7882 self
7883 }
7884 }
7885
7886 #[doc(hidden)]
7887 impl crate::RequestBuilder for CancelOperation {
7888 fn request_options(&mut self) -> &mut crate::RequestOptions {
7889 &mut self.0.options
7890 }
7891 }
7892}
7893
7894pub mod intercept {
7896 use crate::Result;
7897
7898 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7912
7913 pub(crate) mod client {
7914 use super::super::super::client::Intercept;
7915 pub struct Factory;
7916 impl crate::ClientFactory for Factory {
7917 type Client = Intercept;
7918 type Credentials = gaxi::options::Credentials;
7919 async fn build(
7920 self,
7921 config: gaxi::options::ClientConfig,
7922 ) -> crate::ClientBuilderResult<Self::Client> {
7923 Self::Client::new(config).await
7924 }
7925 }
7926 }
7927
7928 #[derive(Clone, Debug)]
7930 pub(crate) struct RequestBuilder<R: std::default::Default> {
7931 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7932 request: R,
7933 options: crate::RequestOptions,
7934 }
7935
7936 impl<R> RequestBuilder<R>
7937 where
7938 R: std::default::Default,
7939 {
7940 pub(crate) fn new(
7941 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7942 ) -> Self {
7943 Self {
7944 stub,
7945 request: R::default(),
7946 options: crate::RequestOptions::default(),
7947 }
7948 }
7949 }
7950
7951 #[derive(Clone, Debug)]
7972 pub struct ListInterceptEndpointGroups(
7973 RequestBuilder<crate::model::ListInterceptEndpointGroupsRequest>,
7974 );
7975
7976 impl ListInterceptEndpointGroups {
7977 pub(crate) fn new(
7978 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7979 ) -> Self {
7980 Self(RequestBuilder::new(stub))
7981 }
7982
7983 pub fn with_request<V: Into<crate::model::ListInterceptEndpointGroupsRequest>>(
7985 mut self,
7986 v: V,
7987 ) -> Self {
7988 self.0.request = v.into();
7989 self
7990 }
7991
7992 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7994 self.0.options = v.into();
7995 self
7996 }
7997
7998 pub async fn send(self) -> Result<crate::model::ListInterceptEndpointGroupsResponse> {
8000 (*self.0.stub)
8001 .list_intercept_endpoint_groups(self.0.request, self.0.options)
8002 .await
8003 .map(crate::Response::into_body)
8004 }
8005
8006 pub fn by_page(
8008 self,
8009 ) -> impl google_cloud_gax::paginator::Paginator<
8010 crate::model::ListInterceptEndpointGroupsResponse,
8011 crate::Error,
8012 > {
8013 use std::clone::Clone;
8014 let token = self.0.request.page_token.clone();
8015 let execute = move |token: String| {
8016 let mut builder = self.clone();
8017 builder.0.request = builder.0.request.set_page_token(token);
8018 builder.send()
8019 };
8020 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8021 }
8022
8023 pub fn by_item(
8025 self,
8026 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8027 crate::model::ListInterceptEndpointGroupsResponse,
8028 crate::Error,
8029 > {
8030 use google_cloud_gax::paginator::Paginator;
8031 self.by_page().items()
8032 }
8033
8034 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8038 self.0.request.parent = v.into();
8039 self
8040 }
8041
8042 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8044 self.0.request.page_size = v.into();
8045 self
8046 }
8047
8048 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8050 self.0.request.page_token = v.into();
8051 self
8052 }
8053
8054 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8056 self.0.request.filter = v.into();
8057 self
8058 }
8059
8060 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8062 self.0.request.order_by = v.into();
8063 self
8064 }
8065 }
8066
8067 #[doc(hidden)]
8068 impl crate::RequestBuilder for ListInterceptEndpointGroups {
8069 fn request_options(&mut self) -> &mut crate::RequestOptions {
8070 &mut self.0.options
8071 }
8072 }
8073
8074 #[derive(Clone, Debug)]
8091 pub struct GetInterceptEndpointGroup(
8092 RequestBuilder<crate::model::GetInterceptEndpointGroupRequest>,
8093 );
8094
8095 impl GetInterceptEndpointGroup {
8096 pub(crate) fn new(
8097 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8098 ) -> Self {
8099 Self(RequestBuilder::new(stub))
8100 }
8101
8102 pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupRequest>>(
8104 mut self,
8105 v: V,
8106 ) -> Self {
8107 self.0.request = v.into();
8108 self
8109 }
8110
8111 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8113 self.0.options = v.into();
8114 self
8115 }
8116
8117 pub async fn send(self) -> Result<crate::model::InterceptEndpointGroup> {
8119 (*self.0.stub)
8120 .get_intercept_endpoint_group(self.0.request, self.0.options)
8121 .await
8122 .map(crate::Response::into_body)
8123 }
8124
8125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8129 self.0.request.name = v.into();
8130 self
8131 }
8132 }
8133
8134 #[doc(hidden)]
8135 impl crate::RequestBuilder for GetInterceptEndpointGroup {
8136 fn request_options(&mut self) -> &mut crate::RequestOptions {
8137 &mut self.0.options
8138 }
8139 }
8140
8141 #[derive(Clone, Debug)]
8159 pub struct CreateInterceptEndpointGroup(
8160 RequestBuilder<crate::model::CreateInterceptEndpointGroupRequest>,
8161 );
8162
8163 impl CreateInterceptEndpointGroup {
8164 pub(crate) fn new(
8165 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8166 ) -> Self {
8167 Self(RequestBuilder::new(stub))
8168 }
8169
8170 pub fn with_request<V: Into<crate::model::CreateInterceptEndpointGroupRequest>>(
8172 mut self,
8173 v: V,
8174 ) -> Self {
8175 self.0.request = v.into();
8176 self
8177 }
8178
8179 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8181 self.0.options = v.into();
8182 self
8183 }
8184
8185 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8192 (*self.0.stub)
8193 .create_intercept_endpoint_group(self.0.request, self.0.options)
8194 .await
8195 .map(crate::Response::into_body)
8196 }
8197
8198 pub fn poller(
8200 self,
8201 ) -> impl google_cloud_lro::Poller<
8202 crate::model::InterceptEndpointGroup,
8203 crate::model::OperationMetadata,
8204 > {
8205 type Operation = google_cloud_lro::internal::Operation<
8206 crate::model::InterceptEndpointGroup,
8207 crate::model::OperationMetadata,
8208 >;
8209 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8210 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8211 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8212 if let Some(ref mut details) = poller_options.tracing {
8213 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::create_intercept_endpoint_group::until_done";
8214 }
8215
8216 let stub = self.0.stub.clone();
8217 let mut options = self.0.options.clone();
8218 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8219 let query = move |name| {
8220 let stub = stub.clone();
8221 let options = options.clone();
8222 async {
8223 let op = GetOperation::new(stub)
8224 .set_name(name)
8225 .with_options(options)
8226 .send()
8227 .await?;
8228 Ok(Operation::new(op))
8229 }
8230 };
8231
8232 let start = move || async {
8233 let op = self.send().await?;
8234 Ok(Operation::new(op))
8235 };
8236
8237 use google_cloud_lro::internal::PollerExt;
8238 {
8239 google_cloud_lro::internal::new_poller(
8240 polling_error_policy,
8241 polling_backoff_policy,
8242 start,
8243 query,
8244 )
8245 }
8246 .with_options(poller_options)
8247 }
8248
8249 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8253 self.0.request.parent = v.into();
8254 self
8255 }
8256
8257 pub fn set_intercept_endpoint_group_id<T: Into<std::string::String>>(
8261 mut self,
8262 v: T,
8263 ) -> Self {
8264 self.0.request.intercept_endpoint_group_id = v.into();
8265 self
8266 }
8267
8268 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
8272 where
8273 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8274 {
8275 self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
8276 self
8277 }
8278
8279 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
8283 where
8284 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8285 {
8286 self.0.request.intercept_endpoint_group = v.map(|x| x.into());
8287 self
8288 }
8289
8290 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8292 self.0.request.request_id = v.into();
8293 self
8294 }
8295 }
8296
8297 #[doc(hidden)]
8298 impl crate::RequestBuilder for CreateInterceptEndpointGroup {
8299 fn request_options(&mut self) -> &mut crate::RequestOptions {
8300 &mut self.0.options
8301 }
8302 }
8303
8304 #[derive(Clone, Debug)]
8322 pub struct UpdateInterceptEndpointGroup(
8323 RequestBuilder<crate::model::UpdateInterceptEndpointGroupRequest>,
8324 );
8325
8326 impl UpdateInterceptEndpointGroup {
8327 pub(crate) fn new(
8328 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8329 ) -> Self {
8330 Self(RequestBuilder::new(stub))
8331 }
8332
8333 pub fn with_request<V: Into<crate::model::UpdateInterceptEndpointGroupRequest>>(
8335 mut self,
8336 v: V,
8337 ) -> Self {
8338 self.0.request = v.into();
8339 self
8340 }
8341
8342 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8344 self.0.options = v.into();
8345 self
8346 }
8347
8348 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8355 (*self.0.stub)
8356 .update_intercept_endpoint_group(self.0.request, self.0.options)
8357 .await
8358 .map(crate::Response::into_body)
8359 }
8360
8361 pub fn poller(
8363 self,
8364 ) -> impl google_cloud_lro::Poller<
8365 crate::model::InterceptEndpointGroup,
8366 crate::model::OperationMetadata,
8367 > {
8368 type Operation = google_cloud_lro::internal::Operation<
8369 crate::model::InterceptEndpointGroup,
8370 crate::model::OperationMetadata,
8371 >;
8372 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8373 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8374 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8375 if let Some(ref mut details) = poller_options.tracing {
8376 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::update_intercept_endpoint_group::until_done";
8377 }
8378
8379 let stub = self.0.stub.clone();
8380 let mut options = self.0.options.clone();
8381 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8382 let query = move |name| {
8383 let stub = stub.clone();
8384 let options = options.clone();
8385 async {
8386 let op = GetOperation::new(stub)
8387 .set_name(name)
8388 .with_options(options)
8389 .send()
8390 .await?;
8391 Ok(Operation::new(op))
8392 }
8393 };
8394
8395 let start = move || async {
8396 let op = self.send().await?;
8397 Ok(Operation::new(op))
8398 };
8399
8400 use google_cloud_lro::internal::PollerExt;
8401 {
8402 google_cloud_lro::internal::new_poller(
8403 polling_error_policy,
8404 polling_backoff_policy,
8405 start,
8406 query,
8407 )
8408 }
8409 .with_options(poller_options)
8410 }
8411
8412 pub fn set_update_mask<T>(mut self, v: T) -> Self
8414 where
8415 T: std::convert::Into<wkt::FieldMask>,
8416 {
8417 self.0.request.update_mask = std::option::Option::Some(v.into());
8418 self
8419 }
8420
8421 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8423 where
8424 T: std::convert::Into<wkt::FieldMask>,
8425 {
8426 self.0.request.update_mask = v.map(|x| x.into());
8427 self
8428 }
8429
8430 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
8434 where
8435 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8436 {
8437 self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
8438 self
8439 }
8440
8441 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
8445 where
8446 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8447 {
8448 self.0.request.intercept_endpoint_group = v.map(|x| x.into());
8449 self
8450 }
8451
8452 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8454 self.0.request.request_id = v.into();
8455 self
8456 }
8457 }
8458
8459 #[doc(hidden)]
8460 impl crate::RequestBuilder for UpdateInterceptEndpointGroup {
8461 fn request_options(&mut self) -> &mut crate::RequestOptions {
8462 &mut self.0.options
8463 }
8464 }
8465
8466 #[derive(Clone, Debug)]
8484 pub struct DeleteInterceptEndpointGroup(
8485 RequestBuilder<crate::model::DeleteInterceptEndpointGroupRequest>,
8486 );
8487
8488 impl DeleteInterceptEndpointGroup {
8489 pub(crate) fn new(
8490 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8491 ) -> Self {
8492 Self(RequestBuilder::new(stub))
8493 }
8494
8495 pub fn with_request<V: Into<crate::model::DeleteInterceptEndpointGroupRequest>>(
8497 mut self,
8498 v: V,
8499 ) -> Self {
8500 self.0.request = v.into();
8501 self
8502 }
8503
8504 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8506 self.0.options = v.into();
8507 self
8508 }
8509
8510 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8517 (*self.0.stub)
8518 .delete_intercept_endpoint_group(self.0.request, self.0.options)
8519 .await
8520 .map(crate::Response::into_body)
8521 }
8522
8523 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8525 type Operation =
8526 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8527 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8528 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8529 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8530 if let Some(ref mut details) = poller_options.tracing {
8531 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::delete_intercept_endpoint_group::until_done";
8532 }
8533
8534 let stub = self.0.stub.clone();
8535 let mut options = self.0.options.clone();
8536 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8537 let query = move |name| {
8538 let stub = stub.clone();
8539 let options = options.clone();
8540 async {
8541 let op = GetOperation::new(stub)
8542 .set_name(name)
8543 .with_options(options)
8544 .send()
8545 .await?;
8546 Ok(Operation::new(op))
8547 }
8548 };
8549
8550 let start = move || async {
8551 let op = self.send().await?;
8552 Ok(Operation::new(op))
8553 };
8554
8555 use google_cloud_lro::internal::PollerExt;
8556 {
8557 google_cloud_lro::internal::new_unit_response_poller(
8558 polling_error_policy,
8559 polling_backoff_policy,
8560 start,
8561 query,
8562 )
8563 }
8564 .with_options(poller_options)
8565 }
8566
8567 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8571 self.0.request.name = v.into();
8572 self
8573 }
8574
8575 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8577 self.0.request.request_id = v.into();
8578 self
8579 }
8580 }
8581
8582 #[doc(hidden)]
8583 impl crate::RequestBuilder for DeleteInterceptEndpointGroup {
8584 fn request_options(&mut self) -> &mut crate::RequestOptions {
8585 &mut self.0.options
8586 }
8587 }
8588
8589 #[derive(Clone, Debug)]
8610 pub struct ListInterceptEndpointGroupAssociations(
8611 RequestBuilder<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
8612 );
8613
8614 impl ListInterceptEndpointGroupAssociations {
8615 pub(crate) fn new(
8616 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8617 ) -> Self {
8618 Self(RequestBuilder::new(stub))
8619 }
8620
8621 pub fn with_request<
8623 V: Into<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
8624 >(
8625 mut self,
8626 v: V,
8627 ) -> Self {
8628 self.0.request = v.into();
8629 self
8630 }
8631
8632 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8634 self.0.options = v.into();
8635 self
8636 }
8637
8638 pub async fn send(
8640 self,
8641 ) -> Result<crate::model::ListInterceptEndpointGroupAssociationsResponse> {
8642 (*self.0.stub)
8643 .list_intercept_endpoint_group_associations(self.0.request, self.0.options)
8644 .await
8645 .map(crate::Response::into_body)
8646 }
8647
8648 pub fn by_page(
8650 self,
8651 ) -> impl google_cloud_gax::paginator::Paginator<
8652 crate::model::ListInterceptEndpointGroupAssociationsResponse,
8653 crate::Error,
8654 > {
8655 use std::clone::Clone;
8656 let token = self.0.request.page_token.clone();
8657 let execute = move |token: String| {
8658 let mut builder = self.clone();
8659 builder.0.request = builder.0.request.set_page_token(token);
8660 builder.send()
8661 };
8662 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8663 }
8664
8665 pub fn by_item(
8667 self,
8668 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8669 crate::model::ListInterceptEndpointGroupAssociationsResponse,
8670 crate::Error,
8671 > {
8672 use google_cloud_gax::paginator::Paginator;
8673 self.by_page().items()
8674 }
8675
8676 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8680 self.0.request.parent = v.into();
8681 self
8682 }
8683
8684 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8686 self.0.request.page_size = v.into();
8687 self
8688 }
8689
8690 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8692 self.0.request.page_token = v.into();
8693 self
8694 }
8695
8696 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8698 self.0.request.filter = v.into();
8699 self
8700 }
8701
8702 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8704 self.0.request.order_by = v.into();
8705 self
8706 }
8707 }
8708
8709 #[doc(hidden)]
8710 impl crate::RequestBuilder for ListInterceptEndpointGroupAssociations {
8711 fn request_options(&mut self) -> &mut crate::RequestOptions {
8712 &mut self.0.options
8713 }
8714 }
8715
8716 #[derive(Clone, Debug)]
8733 pub struct GetInterceptEndpointGroupAssociation(
8734 RequestBuilder<crate::model::GetInterceptEndpointGroupAssociationRequest>,
8735 );
8736
8737 impl GetInterceptEndpointGroupAssociation {
8738 pub(crate) fn new(
8739 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8740 ) -> Self {
8741 Self(RequestBuilder::new(stub))
8742 }
8743
8744 pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupAssociationRequest>>(
8746 mut self,
8747 v: V,
8748 ) -> Self {
8749 self.0.request = v.into();
8750 self
8751 }
8752
8753 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8755 self.0.options = v.into();
8756 self
8757 }
8758
8759 pub async fn send(self) -> Result<crate::model::InterceptEndpointGroupAssociation> {
8761 (*self.0.stub)
8762 .get_intercept_endpoint_group_association(self.0.request, self.0.options)
8763 .await
8764 .map(crate::Response::into_body)
8765 }
8766
8767 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8771 self.0.request.name = v.into();
8772 self
8773 }
8774 }
8775
8776 #[doc(hidden)]
8777 impl crate::RequestBuilder for GetInterceptEndpointGroupAssociation {
8778 fn request_options(&mut self) -> &mut crate::RequestOptions {
8779 &mut self.0.options
8780 }
8781 }
8782
8783 #[derive(Clone, Debug)]
8801 pub struct CreateInterceptEndpointGroupAssociation(
8802 RequestBuilder<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8803 );
8804
8805 impl CreateInterceptEndpointGroupAssociation {
8806 pub(crate) fn new(
8807 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8808 ) -> Self {
8809 Self(RequestBuilder::new(stub))
8810 }
8811
8812 pub fn with_request<
8814 V: Into<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8815 >(
8816 mut self,
8817 v: V,
8818 ) -> Self {
8819 self.0.request = v.into();
8820 self
8821 }
8822
8823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8825 self.0.options = v.into();
8826 self
8827 }
8828
8829 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8836 (*self.0.stub)
8837 .create_intercept_endpoint_group_association(self.0.request, self.0.options)
8838 .await
8839 .map(crate::Response::into_body)
8840 }
8841
8842 pub fn poller(
8844 self,
8845 ) -> impl google_cloud_lro::Poller<
8846 crate::model::InterceptEndpointGroupAssociation,
8847 crate::model::OperationMetadata,
8848 > {
8849 type Operation = google_cloud_lro::internal::Operation<
8850 crate::model::InterceptEndpointGroupAssociation,
8851 crate::model::OperationMetadata,
8852 >;
8853 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8854 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8855 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8856 if let Some(ref mut details) = poller_options.tracing {
8857 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::create_intercept_endpoint_group_association::until_done";
8858 }
8859
8860 let stub = self.0.stub.clone();
8861 let mut options = self.0.options.clone();
8862 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8863 let query = move |name| {
8864 let stub = stub.clone();
8865 let options = options.clone();
8866 async {
8867 let op = GetOperation::new(stub)
8868 .set_name(name)
8869 .with_options(options)
8870 .send()
8871 .await?;
8872 Ok(Operation::new(op))
8873 }
8874 };
8875
8876 let start = move || async {
8877 let op = self.send().await?;
8878 Ok(Operation::new(op))
8879 };
8880
8881 use google_cloud_lro::internal::PollerExt;
8882 {
8883 google_cloud_lro::internal::new_poller(
8884 polling_error_policy,
8885 polling_backoff_policy,
8886 start,
8887 query,
8888 )
8889 }
8890 .with_options(poller_options)
8891 }
8892
8893 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8897 self.0.request.parent = v.into();
8898 self
8899 }
8900
8901 pub fn set_intercept_endpoint_group_association_id<T: Into<std::string::String>>(
8903 mut self,
8904 v: T,
8905 ) -> Self {
8906 self.0.request.intercept_endpoint_group_association_id = v.into();
8907 self
8908 }
8909
8910 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8914 where
8915 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8916 {
8917 self.0.request.intercept_endpoint_group_association =
8918 std::option::Option::Some(v.into());
8919 self
8920 }
8921
8922 pub fn set_or_clear_intercept_endpoint_group_association<T>(
8926 mut self,
8927 v: std::option::Option<T>,
8928 ) -> Self
8929 where
8930 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8931 {
8932 self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8933 self
8934 }
8935
8936 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8938 self.0.request.request_id = v.into();
8939 self
8940 }
8941 }
8942
8943 #[doc(hidden)]
8944 impl crate::RequestBuilder for CreateInterceptEndpointGroupAssociation {
8945 fn request_options(&mut self) -> &mut crate::RequestOptions {
8946 &mut self.0.options
8947 }
8948 }
8949
8950 #[derive(Clone, Debug)]
8968 pub struct UpdateInterceptEndpointGroupAssociation(
8969 RequestBuilder<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8970 );
8971
8972 impl UpdateInterceptEndpointGroupAssociation {
8973 pub(crate) fn new(
8974 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8975 ) -> Self {
8976 Self(RequestBuilder::new(stub))
8977 }
8978
8979 pub fn with_request<
8981 V: Into<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8982 >(
8983 mut self,
8984 v: V,
8985 ) -> Self {
8986 self.0.request = v.into();
8987 self
8988 }
8989
8990 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8992 self.0.options = v.into();
8993 self
8994 }
8995
8996 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9003 (*self.0.stub)
9004 .update_intercept_endpoint_group_association(self.0.request, self.0.options)
9005 .await
9006 .map(crate::Response::into_body)
9007 }
9008
9009 pub fn poller(
9011 self,
9012 ) -> impl google_cloud_lro::Poller<
9013 crate::model::InterceptEndpointGroupAssociation,
9014 crate::model::OperationMetadata,
9015 > {
9016 type Operation = google_cloud_lro::internal::Operation<
9017 crate::model::InterceptEndpointGroupAssociation,
9018 crate::model::OperationMetadata,
9019 >;
9020 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9021 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9022 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9023 if let Some(ref mut details) = poller_options.tracing {
9024 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::update_intercept_endpoint_group_association::until_done";
9025 }
9026
9027 let stub = self.0.stub.clone();
9028 let mut options = self.0.options.clone();
9029 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9030 let query = move |name| {
9031 let stub = stub.clone();
9032 let options = options.clone();
9033 async {
9034 let op = GetOperation::new(stub)
9035 .set_name(name)
9036 .with_options(options)
9037 .send()
9038 .await?;
9039 Ok(Operation::new(op))
9040 }
9041 };
9042
9043 let start = move || async {
9044 let op = self.send().await?;
9045 Ok(Operation::new(op))
9046 };
9047
9048 use google_cloud_lro::internal::PollerExt;
9049 {
9050 google_cloud_lro::internal::new_poller(
9051 polling_error_policy,
9052 polling_backoff_policy,
9053 start,
9054 query,
9055 )
9056 }
9057 .with_options(poller_options)
9058 }
9059
9060 pub fn set_update_mask<T>(mut self, v: T) -> Self
9062 where
9063 T: std::convert::Into<wkt::FieldMask>,
9064 {
9065 self.0.request.update_mask = std::option::Option::Some(v.into());
9066 self
9067 }
9068
9069 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9071 where
9072 T: std::convert::Into<wkt::FieldMask>,
9073 {
9074 self.0.request.update_mask = v.map(|x| x.into());
9075 self
9076 }
9077
9078 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
9082 where
9083 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
9084 {
9085 self.0.request.intercept_endpoint_group_association =
9086 std::option::Option::Some(v.into());
9087 self
9088 }
9089
9090 pub fn set_or_clear_intercept_endpoint_group_association<T>(
9094 mut self,
9095 v: std::option::Option<T>,
9096 ) -> Self
9097 where
9098 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
9099 {
9100 self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
9101 self
9102 }
9103
9104 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9106 self.0.request.request_id = v.into();
9107 self
9108 }
9109 }
9110
9111 #[doc(hidden)]
9112 impl crate::RequestBuilder for UpdateInterceptEndpointGroupAssociation {
9113 fn request_options(&mut self) -> &mut crate::RequestOptions {
9114 &mut self.0.options
9115 }
9116 }
9117
9118 #[derive(Clone, Debug)]
9136 pub struct DeleteInterceptEndpointGroupAssociation(
9137 RequestBuilder<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
9138 );
9139
9140 impl DeleteInterceptEndpointGroupAssociation {
9141 pub(crate) fn new(
9142 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9143 ) -> Self {
9144 Self(RequestBuilder::new(stub))
9145 }
9146
9147 pub fn with_request<
9149 V: Into<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
9150 >(
9151 mut self,
9152 v: V,
9153 ) -> Self {
9154 self.0.request = v.into();
9155 self
9156 }
9157
9158 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9160 self.0.options = v.into();
9161 self
9162 }
9163
9164 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9171 (*self.0.stub)
9172 .delete_intercept_endpoint_group_association(self.0.request, self.0.options)
9173 .await
9174 .map(crate::Response::into_body)
9175 }
9176
9177 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9179 type Operation =
9180 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9181 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9182 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9183 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9184 if let Some(ref mut details) = poller_options.tracing {
9185 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::delete_intercept_endpoint_group_association::until_done";
9186 }
9187
9188 let stub = self.0.stub.clone();
9189 let mut options = self.0.options.clone();
9190 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9191 let query = move |name| {
9192 let stub = stub.clone();
9193 let options = options.clone();
9194 async {
9195 let op = GetOperation::new(stub)
9196 .set_name(name)
9197 .with_options(options)
9198 .send()
9199 .await?;
9200 Ok(Operation::new(op))
9201 }
9202 };
9203
9204 let start = move || async {
9205 let op = self.send().await?;
9206 Ok(Operation::new(op))
9207 };
9208
9209 use google_cloud_lro::internal::PollerExt;
9210 {
9211 google_cloud_lro::internal::new_unit_response_poller(
9212 polling_error_policy,
9213 polling_backoff_policy,
9214 start,
9215 query,
9216 )
9217 }
9218 .with_options(poller_options)
9219 }
9220
9221 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9225 self.0.request.name = v.into();
9226 self
9227 }
9228
9229 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9231 self.0.request.request_id = v.into();
9232 self
9233 }
9234 }
9235
9236 #[doc(hidden)]
9237 impl crate::RequestBuilder for DeleteInterceptEndpointGroupAssociation {
9238 fn request_options(&mut self) -> &mut crate::RequestOptions {
9239 &mut self.0.options
9240 }
9241 }
9242
9243 #[derive(Clone, Debug)]
9264 pub struct ListInterceptDeploymentGroups(
9265 RequestBuilder<crate::model::ListInterceptDeploymentGroupsRequest>,
9266 );
9267
9268 impl ListInterceptDeploymentGroups {
9269 pub(crate) fn new(
9270 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9271 ) -> Self {
9272 Self(RequestBuilder::new(stub))
9273 }
9274
9275 pub fn with_request<V: Into<crate::model::ListInterceptDeploymentGroupsRequest>>(
9277 mut self,
9278 v: V,
9279 ) -> Self {
9280 self.0.request = v.into();
9281 self
9282 }
9283
9284 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9286 self.0.options = v.into();
9287 self
9288 }
9289
9290 pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentGroupsResponse> {
9292 (*self.0.stub)
9293 .list_intercept_deployment_groups(self.0.request, self.0.options)
9294 .await
9295 .map(crate::Response::into_body)
9296 }
9297
9298 pub fn by_page(
9300 self,
9301 ) -> impl google_cloud_gax::paginator::Paginator<
9302 crate::model::ListInterceptDeploymentGroupsResponse,
9303 crate::Error,
9304 > {
9305 use std::clone::Clone;
9306 let token = self.0.request.page_token.clone();
9307 let execute = move |token: String| {
9308 let mut builder = self.clone();
9309 builder.0.request = builder.0.request.set_page_token(token);
9310 builder.send()
9311 };
9312 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9313 }
9314
9315 pub fn by_item(
9317 self,
9318 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9319 crate::model::ListInterceptDeploymentGroupsResponse,
9320 crate::Error,
9321 > {
9322 use google_cloud_gax::paginator::Paginator;
9323 self.by_page().items()
9324 }
9325
9326 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9330 self.0.request.parent = v.into();
9331 self
9332 }
9333
9334 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9336 self.0.request.page_size = v.into();
9337 self
9338 }
9339
9340 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9342 self.0.request.page_token = v.into();
9343 self
9344 }
9345
9346 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9348 self.0.request.filter = v.into();
9349 self
9350 }
9351
9352 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9354 self.0.request.order_by = v.into();
9355 self
9356 }
9357 }
9358
9359 #[doc(hidden)]
9360 impl crate::RequestBuilder for ListInterceptDeploymentGroups {
9361 fn request_options(&mut self) -> &mut crate::RequestOptions {
9362 &mut self.0.options
9363 }
9364 }
9365
9366 #[derive(Clone, Debug)]
9383 pub struct GetInterceptDeploymentGroup(
9384 RequestBuilder<crate::model::GetInterceptDeploymentGroupRequest>,
9385 );
9386
9387 impl GetInterceptDeploymentGroup {
9388 pub(crate) fn new(
9389 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9390 ) -> Self {
9391 Self(RequestBuilder::new(stub))
9392 }
9393
9394 pub fn with_request<V: Into<crate::model::GetInterceptDeploymentGroupRequest>>(
9396 mut self,
9397 v: V,
9398 ) -> Self {
9399 self.0.request = v.into();
9400 self
9401 }
9402
9403 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9405 self.0.options = v.into();
9406 self
9407 }
9408
9409 pub async fn send(self) -> Result<crate::model::InterceptDeploymentGroup> {
9411 (*self.0.stub)
9412 .get_intercept_deployment_group(self.0.request, self.0.options)
9413 .await
9414 .map(crate::Response::into_body)
9415 }
9416
9417 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9421 self.0.request.name = v.into();
9422 self
9423 }
9424 }
9425
9426 #[doc(hidden)]
9427 impl crate::RequestBuilder for GetInterceptDeploymentGroup {
9428 fn request_options(&mut self) -> &mut crate::RequestOptions {
9429 &mut self.0.options
9430 }
9431 }
9432
9433 #[derive(Clone, Debug)]
9451 pub struct CreateInterceptDeploymentGroup(
9452 RequestBuilder<crate::model::CreateInterceptDeploymentGroupRequest>,
9453 );
9454
9455 impl CreateInterceptDeploymentGroup {
9456 pub(crate) fn new(
9457 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9458 ) -> Self {
9459 Self(RequestBuilder::new(stub))
9460 }
9461
9462 pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentGroupRequest>>(
9464 mut self,
9465 v: V,
9466 ) -> Self {
9467 self.0.request = v.into();
9468 self
9469 }
9470
9471 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9473 self.0.options = v.into();
9474 self
9475 }
9476
9477 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9484 (*self.0.stub)
9485 .create_intercept_deployment_group(self.0.request, self.0.options)
9486 .await
9487 .map(crate::Response::into_body)
9488 }
9489
9490 pub fn poller(
9492 self,
9493 ) -> impl google_cloud_lro::Poller<
9494 crate::model::InterceptDeploymentGroup,
9495 crate::model::OperationMetadata,
9496 > {
9497 type Operation = google_cloud_lro::internal::Operation<
9498 crate::model::InterceptDeploymentGroup,
9499 crate::model::OperationMetadata,
9500 >;
9501 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9502 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9503 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9504 if let Some(ref mut details) = poller_options.tracing {
9505 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::create_intercept_deployment_group::until_done";
9506 }
9507
9508 let stub = self.0.stub.clone();
9509 let mut options = self.0.options.clone();
9510 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9511 let query = move |name| {
9512 let stub = stub.clone();
9513 let options = options.clone();
9514 async {
9515 let op = GetOperation::new(stub)
9516 .set_name(name)
9517 .with_options(options)
9518 .send()
9519 .await?;
9520 Ok(Operation::new(op))
9521 }
9522 };
9523
9524 let start = move || async {
9525 let op = self.send().await?;
9526 Ok(Operation::new(op))
9527 };
9528
9529 use google_cloud_lro::internal::PollerExt;
9530 {
9531 google_cloud_lro::internal::new_poller(
9532 polling_error_policy,
9533 polling_backoff_policy,
9534 start,
9535 query,
9536 )
9537 }
9538 .with_options(poller_options)
9539 }
9540
9541 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9545 self.0.request.parent = v.into();
9546 self
9547 }
9548
9549 pub fn set_intercept_deployment_group_id<T: Into<std::string::String>>(
9553 mut self,
9554 v: T,
9555 ) -> Self {
9556 self.0.request.intercept_deployment_group_id = v.into();
9557 self
9558 }
9559
9560 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
9564 where
9565 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9566 {
9567 self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
9568 self
9569 }
9570
9571 pub fn set_or_clear_intercept_deployment_group<T>(
9575 mut self,
9576 v: std::option::Option<T>,
9577 ) -> Self
9578 where
9579 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9580 {
9581 self.0.request.intercept_deployment_group = v.map(|x| x.into());
9582 self
9583 }
9584
9585 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9587 self.0.request.request_id = v.into();
9588 self
9589 }
9590 }
9591
9592 #[doc(hidden)]
9593 impl crate::RequestBuilder for CreateInterceptDeploymentGroup {
9594 fn request_options(&mut self) -> &mut crate::RequestOptions {
9595 &mut self.0.options
9596 }
9597 }
9598
9599 #[derive(Clone, Debug)]
9617 pub struct UpdateInterceptDeploymentGroup(
9618 RequestBuilder<crate::model::UpdateInterceptDeploymentGroupRequest>,
9619 );
9620
9621 impl UpdateInterceptDeploymentGroup {
9622 pub(crate) fn new(
9623 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9624 ) -> Self {
9625 Self(RequestBuilder::new(stub))
9626 }
9627
9628 pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentGroupRequest>>(
9630 mut self,
9631 v: V,
9632 ) -> Self {
9633 self.0.request = v.into();
9634 self
9635 }
9636
9637 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9639 self.0.options = v.into();
9640 self
9641 }
9642
9643 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9650 (*self.0.stub)
9651 .update_intercept_deployment_group(self.0.request, self.0.options)
9652 .await
9653 .map(crate::Response::into_body)
9654 }
9655
9656 pub fn poller(
9658 self,
9659 ) -> impl google_cloud_lro::Poller<
9660 crate::model::InterceptDeploymentGroup,
9661 crate::model::OperationMetadata,
9662 > {
9663 type Operation = google_cloud_lro::internal::Operation<
9664 crate::model::InterceptDeploymentGroup,
9665 crate::model::OperationMetadata,
9666 >;
9667 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9668 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9669 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9670 if let Some(ref mut details) = poller_options.tracing {
9671 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::update_intercept_deployment_group::until_done";
9672 }
9673
9674 let stub = self.0.stub.clone();
9675 let mut options = self.0.options.clone();
9676 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9677 let query = move |name| {
9678 let stub = stub.clone();
9679 let options = options.clone();
9680 async {
9681 let op = GetOperation::new(stub)
9682 .set_name(name)
9683 .with_options(options)
9684 .send()
9685 .await?;
9686 Ok(Operation::new(op))
9687 }
9688 };
9689
9690 let start = move || async {
9691 let op = self.send().await?;
9692 Ok(Operation::new(op))
9693 };
9694
9695 use google_cloud_lro::internal::PollerExt;
9696 {
9697 google_cloud_lro::internal::new_poller(
9698 polling_error_policy,
9699 polling_backoff_policy,
9700 start,
9701 query,
9702 )
9703 }
9704 .with_options(poller_options)
9705 }
9706
9707 pub fn set_update_mask<T>(mut self, v: T) -> Self
9709 where
9710 T: std::convert::Into<wkt::FieldMask>,
9711 {
9712 self.0.request.update_mask = std::option::Option::Some(v.into());
9713 self
9714 }
9715
9716 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9718 where
9719 T: std::convert::Into<wkt::FieldMask>,
9720 {
9721 self.0.request.update_mask = v.map(|x| x.into());
9722 self
9723 }
9724
9725 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
9729 where
9730 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9731 {
9732 self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
9733 self
9734 }
9735
9736 pub fn set_or_clear_intercept_deployment_group<T>(
9740 mut self,
9741 v: std::option::Option<T>,
9742 ) -> Self
9743 where
9744 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9745 {
9746 self.0.request.intercept_deployment_group = v.map(|x| x.into());
9747 self
9748 }
9749
9750 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9752 self.0.request.request_id = v.into();
9753 self
9754 }
9755 }
9756
9757 #[doc(hidden)]
9758 impl crate::RequestBuilder for UpdateInterceptDeploymentGroup {
9759 fn request_options(&mut self) -> &mut crate::RequestOptions {
9760 &mut self.0.options
9761 }
9762 }
9763
9764 #[derive(Clone, Debug)]
9782 pub struct DeleteInterceptDeploymentGroup(
9783 RequestBuilder<crate::model::DeleteInterceptDeploymentGroupRequest>,
9784 );
9785
9786 impl DeleteInterceptDeploymentGroup {
9787 pub(crate) fn new(
9788 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9789 ) -> Self {
9790 Self(RequestBuilder::new(stub))
9791 }
9792
9793 pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentGroupRequest>>(
9795 mut self,
9796 v: V,
9797 ) -> Self {
9798 self.0.request = v.into();
9799 self
9800 }
9801
9802 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9804 self.0.options = v.into();
9805 self
9806 }
9807
9808 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9815 (*self.0.stub)
9816 .delete_intercept_deployment_group(self.0.request, self.0.options)
9817 .await
9818 .map(crate::Response::into_body)
9819 }
9820
9821 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9823 type Operation =
9824 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9825 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9826 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9827 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9828 if let Some(ref mut details) = poller_options.tracing {
9829 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::delete_intercept_deployment_group::until_done";
9830 }
9831
9832 let stub = self.0.stub.clone();
9833 let mut options = self.0.options.clone();
9834 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9835 let query = move |name| {
9836 let stub = stub.clone();
9837 let options = options.clone();
9838 async {
9839 let op = GetOperation::new(stub)
9840 .set_name(name)
9841 .with_options(options)
9842 .send()
9843 .await?;
9844 Ok(Operation::new(op))
9845 }
9846 };
9847
9848 let start = move || async {
9849 let op = self.send().await?;
9850 Ok(Operation::new(op))
9851 };
9852
9853 use google_cloud_lro::internal::PollerExt;
9854 {
9855 google_cloud_lro::internal::new_unit_response_poller(
9856 polling_error_policy,
9857 polling_backoff_policy,
9858 start,
9859 query,
9860 )
9861 }
9862 .with_options(poller_options)
9863 }
9864
9865 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9869 self.0.request.name = v.into();
9870 self
9871 }
9872
9873 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9875 self.0.request.request_id = v.into();
9876 self
9877 }
9878 }
9879
9880 #[doc(hidden)]
9881 impl crate::RequestBuilder for DeleteInterceptDeploymentGroup {
9882 fn request_options(&mut self) -> &mut crate::RequestOptions {
9883 &mut self.0.options
9884 }
9885 }
9886
9887 #[derive(Clone, Debug)]
9908 pub struct ListInterceptDeployments(
9909 RequestBuilder<crate::model::ListInterceptDeploymentsRequest>,
9910 );
9911
9912 impl ListInterceptDeployments {
9913 pub(crate) fn new(
9914 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9915 ) -> Self {
9916 Self(RequestBuilder::new(stub))
9917 }
9918
9919 pub fn with_request<V: Into<crate::model::ListInterceptDeploymentsRequest>>(
9921 mut self,
9922 v: V,
9923 ) -> Self {
9924 self.0.request = v.into();
9925 self
9926 }
9927
9928 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9930 self.0.options = v.into();
9931 self
9932 }
9933
9934 pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentsResponse> {
9936 (*self.0.stub)
9937 .list_intercept_deployments(self.0.request, self.0.options)
9938 .await
9939 .map(crate::Response::into_body)
9940 }
9941
9942 pub fn by_page(
9944 self,
9945 ) -> impl google_cloud_gax::paginator::Paginator<
9946 crate::model::ListInterceptDeploymentsResponse,
9947 crate::Error,
9948 > {
9949 use std::clone::Clone;
9950 let token = self.0.request.page_token.clone();
9951 let execute = move |token: String| {
9952 let mut builder = self.clone();
9953 builder.0.request = builder.0.request.set_page_token(token);
9954 builder.send()
9955 };
9956 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9957 }
9958
9959 pub fn by_item(
9961 self,
9962 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9963 crate::model::ListInterceptDeploymentsResponse,
9964 crate::Error,
9965 > {
9966 use google_cloud_gax::paginator::Paginator;
9967 self.by_page().items()
9968 }
9969
9970 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9974 self.0.request.parent = v.into();
9975 self
9976 }
9977
9978 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9980 self.0.request.page_size = v.into();
9981 self
9982 }
9983
9984 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9986 self.0.request.page_token = v.into();
9987 self
9988 }
9989
9990 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9992 self.0.request.filter = v.into();
9993 self
9994 }
9995
9996 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9998 self.0.request.order_by = v.into();
9999 self
10000 }
10001 }
10002
10003 #[doc(hidden)]
10004 impl crate::RequestBuilder for ListInterceptDeployments {
10005 fn request_options(&mut self) -> &mut crate::RequestOptions {
10006 &mut self.0.options
10007 }
10008 }
10009
10010 #[derive(Clone, Debug)]
10027 pub struct GetInterceptDeployment(RequestBuilder<crate::model::GetInterceptDeploymentRequest>);
10028
10029 impl GetInterceptDeployment {
10030 pub(crate) fn new(
10031 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10032 ) -> Self {
10033 Self(RequestBuilder::new(stub))
10034 }
10035
10036 pub fn with_request<V: Into<crate::model::GetInterceptDeploymentRequest>>(
10038 mut self,
10039 v: V,
10040 ) -> Self {
10041 self.0.request = v.into();
10042 self
10043 }
10044
10045 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10047 self.0.options = v.into();
10048 self
10049 }
10050
10051 pub async fn send(self) -> Result<crate::model::InterceptDeployment> {
10053 (*self.0.stub)
10054 .get_intercept_deployment(self.0.request, self.0.options)
10055 .await
10056 .map(crate::Response::into_body)
10057 }
10058
10059 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10063 self.0.request.name = v.into();
10064 self
10065 }
10066 }
10067
10068 #[doc(hidden)]
10069 impl crate::RequestBuilder for GetInterceptDeployment {
10070 fn request_options(&mut self) -> &mut crate::RequestOptions {
10071 &mut self.0.options
10072 }
10073 }
10074
10075 #[derive(Clone, Debug)]
10093 pub struct CreateInterceptDeployment(
10094 RequestBuilder<crate::model::CreateInterceptDeploymentRequest>,
10095 );
10096
10097 impl CreateInterceptDeployment {
10098 pub(crate) fn new(
10099 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10100 ) -> Self {
10101 Self(RequestBuilder::new(stub))
10102 }
10103
10104 pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentRequest>>(
10106 mut self,
10107 v: V,
10108 ) -> Self {
10109 self.0.request = v.into();
10110 self
10111 }
10112
10113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10115 self.0.options = v.into();
10116 self
10117 }
10118
10119 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10126 (*self.0.stub)
10127 .create_intercept_deployment(self.0.request, self.0.options)
10128 .await
10129 .map(crate::Response::into_body)
10130 }
10131
10132 pub fn poller(
10134 self,
10135 ) -> impl google_cloud_lro::Poller<
10136 crate::model::InterceptDeployment,
10137 crate::model::OperationMetadata,
10138 > {
10139 type Operation = google_cloud_lro::internal::Operation<
10140 crate::model::InterceptDeployment,
10141 crate::model::OperationMetadata,
10142 >;
10143 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10144 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10145 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10146 if let Some(ref mut details) = poller_options.tracing {
10147 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::create_intercept_deployment::until_done";
10148 }
10149
10150 let stub = self.0.stub.clone();
10151 let mut options = self.0.options.clone();
10152 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10153 let query = move |name| {
10154 let stub = stub.clone();
10155 let options = options.clone();
10156 async {
10157 let op = GetOperation::new(stub)
10158 .set_name(name)
10159 .with_options(options)
10160 .send()
10161 .await?;
10162 Ok(Operation::new(op))
10163 }
10164 };
10165
10166 let start = move || async {
10167 let op = self.send().await?;
10168 Ok(Operation::new(op))
10169 };
10170
10171 use google_cloud_lro::internal::PollerExt;
10172 {
10173 google_cloud_lro::internal::new_poller(
10174 polling_error_policy,
10175 polling_backoff_policy,
10176 start,
10177 query,
10178 )
10179 }
10180 .with_options(poller_options)
10181 }
10182
10183 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10187 self.0.request.parent = v.into();
10188 self
10189 }
10190
10191 pub fn set_intercept_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10195 self.0.request.intercept_deployment_id = v.into();
10196 self
10197 }
10198
10199 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
10203 where
10204 T: std::convert::Into<crate::model::InterceptDeployment>,
10205 {
10206 self.0.request.intercept_deployment = std::option::Option::Some(v.into());
10207 self
10208 }
10209
10210 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
10214 where
10215 T: std::convert::Into<crate::model::InterceptDeployment>,
10216 {
10217 self.0.request.intercept_deployment = v.map(|x| x.into());
10218 self
10219 }
10220
10221 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10223 self.0.request.request_id = v.into();
10224 self
10225 }
10226 }
10227
10228 #[doc(hidden)]
10229 impl crate::RequestBuilder for CreateInterceptDeployment {
10230 fn request_options(&mut self) -> &mut crate::RequestOptions {
10231 &mut self.0.options
10232 }
10233 }
10234
10235 #[derive(Clone, Debug)]
10253 pub struct UpdateInterceptDeployment(
10254 RequestBuilder<crate::model::UpdateInterceptDeploymentRequest>,
10255 );
10256
10257 impl UpdateInterceptDeployment {
10258 pub(crate) fn new(
10259 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10260 ) -> Self {
10261 Self(RequestBuilder::new(stub))
10262 }
10263
10264 pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentRequest>>(
10266 mut self,
10267 v: V,
10268 ) -> Self {
10269 self.0.request = v.into();
10270 self
10271 }
10272
10273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10275 self.0.options = v.into();
10276 self
10277 }
10278
10279 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10286 (*self.0.stub)
10287 .update_intercept_deployment(self.0.request, self.0.options)
10288 .await
10289 .map(crate::Response::into_body)
10290 }
10291
10292 pub fn poller(
10294 self,
10295 ) -> impl google_cloud_lro::Poller<
10296 crate::model::InterceptDeployment,
10297 crate::model::OperationMetadata,
10298 > {
10299 type Operation = google_cloud_lro::internal::Operation<
10300 crate::model::InterceptDeployment,
10301 crate::model::OperationMetadata,
10302 >;
10303 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10304 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10305 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10306 if let Some(ref mut details) = poller_options.tracing {
10307 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::update_intercept_deployment::until_done";
10308 }
10309
10310 let stub = self.0.stub.clone();
10311 let mut options = self.0.options.clone();
10312 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10313 let query = move |name| {
10314 let stub = stub.clone();
10315 let options = options.clone();
10316 async {
10317 let op = GetOperation::new(stub)
10318 .set_name(name)
10319 .with_options(options)
10320 .send()
10321 .await?;
10322 Ok(Operation::new(op))
10323 }
10324 };
10325
10326 let start = move || async {
10327 let op = self.send().await?;
10328 Ok(Operation::new(op))
10329 };
10330
10331 use google_cloud_lro::internal::PollerExt;
10332 {
10333 google_cloud_lro::internal::new_poller(
10334 polling_error_policy,
10335 polling_backoff_policy,
10336 start,
10337 query,
10338 )
10339 }
10340 .with_options(poller_options)
10341 }
10342
10343 pub fn set_update_mask<T>(mut self, v: T) -> Self
10345 where
10346 T: std::convert::Into<wkt::FieldMask>,
10347 {
10348 self.0.request.update_mask = std::option::Option::Some(v.into());
10349 self
10350 }
10351
10352 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10354 where
10355 T: std::convert::Into<wkt::FieldMask>,
10356 {
10357 self.0.request.update_mask = v.map(|x| x.into());
10358 self
10359 }
10360
10361 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
10365 where
10366 T: std::convert::Into<crate::model::InterceptDeployment>,
10367 {
10368 self.0.request.intercept_deployment = std::option::Option::Some(v.into());
10369 self
10370 }
10371
10372 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
10376 where
10377 T: std::convert::Into<crate::model::InterceptDeployment>,
10378 {
10379 self.0.request.intercept_deployment = v.map(|x| x.into());
10380 self
10381 }
10382
10383 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10385 self.0.request.request_id = v.into();
10386 self
10387 }
10388 }
10389
10390 #[doc(hidden)]
10391 impl crate::RequestBuilder for UpdateInterceptDeployment {
10392 fn request_options(&mut self) -> &mut crate::RequestOptions {
10393 &mut self.0.options
10394 }
10395 }
10396
10397 #[derive(Clone, Debug)]
10415 pub struct DeleteInterceptDeployment(
10416 RequestBuilder<crate::model::DeleteInterceptDeploymentRequest>,
10417 );
10418
10419 impl DeleteInterceptDeployment {
10420 pub(crate) fn new(
10421 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10422 ) -> Self {
10423 Self(RequestBuilder::new(stub))
10424 }
10425
10426 pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentRequest>>(
10428 mut self,
10429 v: V,
10430 ) -> Self {
10431 self.0.request = v.into();
10432 self
10433 }
10434
10435 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10437 self.0.options = v.into();
10438 self
10439 }
10440
10441 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10448 (*self.0.stub)
10449 .delete_intercept_deployment(self.0.request, self.0.options)
10450 .await
10451 .map(crate::Response::into_body)
10452 }
10453
10454 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10456 type Operation =
10457 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10458 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10459 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10460 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10461 if let Some(ref mut details) = poller_options.tracing {
10462 details.method_name = "google_cloud_networksecurity_v1::client::Intercept::delete_intercept_deployment::until_done";
10463 }
10464
10465 let stub = self.0.stub.clone();
10466 let mut options = self.0.options.clone();
10467 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10468 let query = move |name| {
10469 let stub = stub.clone();
10470 let options = options.clone();
10471 async {
10472 let op = GetOperation::new(stub)
10473 .set_name(name)
10474 .with_options(options)
10475 .send()
10476 .await?;
10477 Ok(Operation::new(op))
10478 }
10479 };
10480
10481 let start = move || async {
10482 let op = self.send().await?;
10483 Ok(Operation::new(op))
10484 };
10485
10486 use google_cloud_lro::internal::PollerExt;
10487 {
10488 google_cloud_lro::internal::new_unit_response_poller(
10489 polling_error_policy,
10490 polling_backoff_policy,
10491 start,
10492 query,
10493 )
10494 }
10495 .with_options(poller_options)
10496 }
10497
10498 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10502 self.0.request.name = v.into();
10503 self
10504 }
10505
10506 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10508 self.0.request.request_id = v.into();
10509 self
10510 }
10511 }
10512
10513 #[doc(hidden)]
10514 impl crate::RequestBuilder for DeleteInterceptDeployment {
10515 fn request_options(&mut self) -> &mut crate::RequestOptions {
10516 &mut self.0.options
10517 }
10518 }
10519
10520 #[derive(Clone, Debug)]
10541 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10542
10543 impl ListLocations {
10544 pub(crate) fn new(
10545 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10546 ) -> Self {
10547 Self(RequestBuilder::new(stub))
10548 }
10549
10550 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10552 mut self,
10553 v: V,
10554 ) -> Self {
10555 self.0.request = v.into();
10556 self
10557 }
10558
10559 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10561 self.0.options = v.into();
10562 self
10563 }
10564
10565 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10567 (*self.0.stub)
10568 .list_locations(self.0.request, self.0.options)
10569 .await
10570 .map(crate::Response::into_body)
10571 }
10572
10573 pub fn by_page(
10575 self,
10576 ) -> impl google_cloud_gax::paginator::Paginator<
10577 google_cloud_location::model::ListLocationsResponse,
10578 crate::Error,
10579 > {
10580 use std::clone::Clone;
10581 let token = self.0.request.page_token.clone();
10582 let execute = move |token: String| {
10583 let mut builder = self.clone();
10584 builder.0.request = builder.0.request.set_page_token(token);
10585 builder.send()
10586 };
10587 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10588 }
10589
10590 pub fn by_item(
10592 self,
10593 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10594 google_cloud_location::model::ListLocationsResponse,
10595 crate::Error,
10596 > {
10597 use google_cloud_gax::paginator::Paginator;
10598 self.by_page().items()
10599 }
10600
10601 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10603 self.0.request.name = v.into();
10604 self
10605 }
10606
10607 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10609 self.0.request.filter = v.into();
10610 self
10611 }
10612
10613 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10615 self.0.request.page_size = v.into();
10616 self
10617 }
10618
10619 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10621 self.0.request.page_token = v.into();
10622 self
10623 }
10624 }
10625
10626 #[doc(hidden)]
10627 impl crate::RequestBuilder for ListLocations {
10628 fn request_options(&mut self) -> &mut crate::RequestOptions {
10629 &mut self.0.options
10630 }
10631 }
10632
10633 #[derive(Clone, Debug)]
10650 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10651
10652 impl GetLocation {
10653 pub(crate) fn new(
10654 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10655 ) -> Self {
10656 Self(RequestBuilder::new(stub))
10657 }
10658
10659 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10661 mut self,
10662 v: V,
10663 ) -> Self {
10664 self.0.request = v.into();
10665 self
10666 }
10667
10668 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10670 self.0.options = v.into();
10671 self
10672 }
10673
10674 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10676 (*self.0.stub)
10677 .get_location(self.0.request, self.0.options)
10678 .await
10679 .map(crate::Response::into_body)
10680 }
10681
10682 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10684 self.0.request.name = v.into();
10685 self
10686 }
10687 }
10688
10689 #[doc(hidden)]
10690 impl crate::RequestBuilder for GetLocation {
10691 fn request_options(&mut self) -> &mut crate::RequestOptions {
10692 &mut self.0.options
10693 }
10694 }
10695
10696 #[derive(Clone, Debug)]
10713 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10714
10715 impl SetIamPolicy {
10716 pub(crate) fn new(
10717 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10718 ) -> Self {
10719 Self(RequestBuilder::new(stub))
10720 }
10721
10722 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10724 mut self,
10725 v: V,
10726 ) -> Self {
10727 self.0.request = v.into();
10728 self
10729 }
10730
10731 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10733 self.0.options = v.into();
10734 self
10735 }
10736
10737 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10739 (*self.0.stub)
10740 .set_iam_policy(self.0.request, self.0.options)
10741 .await
10742 .map(crate::Response::into_body)
10743 }
10744
10745 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10749 self.0.request.resource = v.into();
10750 self
10751 }
10752
10753 pub fn set_policy<T>(mut self, v: T) -> Self
10757 where
10758 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10759 {
10760 self.0.request.policy = std::option::Option::Some(v.into());
10761 self
10762 }
10763
10764 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10768 where
10769 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10770 {
10771 self.0.request.policy = v.map(|x| x.into());
10772 self
10773 }
10774
10775 pub fn set_update_mask<T>(mut self, v: T) -> Self
10777 where
10778 T: std::convert::Into<wkt::FieldMask>,
10779 {
10780 self.0.request.update_mask = std::option::Option::Some(v.into());
10781 self
10782 }
10783
10784 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10786 where
10787 T: std::convert::Into<wkt::FieldMask>,
10788 {
10789 self.0.request.update_mask = v.map(|x| x.into());
10790 self
10791 }
10792 }
10793
10794 #[doc(hidden)]
10795 impl crate::RequestBuilder for SetIamPolicy {
10796 fn request_options(&mut self) -> &mut crate::RequestOptions {
10797 &mut self.0.options
10798 }
10799 }
10800
10801 #[derive(Clone, Debug)]
10818 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10819
10820 impl GetIamPolicy {
10821 pub(crate) fn new(
10822 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10823 ) -> Self {
10824 Self(RequestBuilder::new(stub))
10825 }
10826
10827 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10829 mut self,
10830 v: V,
10831 ) -> Self {
10832 self.0.request = v.into();
10833 self
10834 }
10835
10836 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10838 self.0.options = v.into();
10839 self
10840 }
10841
10842 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10844 (*self.0.stub)
10845 .get_iam_policy(self.0.request, self.0.options)
10846 .await
10847 .map(crate::Response::into_body)
10848 }
10849
10850 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10854 self.0.request.resource = v.into();
10855 self
10856 }
10857
10858 pub fn set_options<T>(mut self, v: T) -> Self
10860 where
10861 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10862 {
10863 self.0.request.options = std::option::Option::Some(v.into());
10864 self
10865 }
10866
10867 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10869 where
10870 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10871 {
10872 self.0.request.options = v.map(|x| x.into());
10873 self
10874 }
10875 }
10876
10877 #[doc(hidden)]
10878 impl crate::RequestBuilder for GetIamPolicy {
10879 fn request_options(&mut self) -> &mut crate::RequestOptions {
10880 &mut self.0.options
10881 }
10882 }
10883
10884 #[derive(Clone, Debug)]
10901 pub struct TestIamPermissions(
10902 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10903 );
10904
10905 impl TestIamPermissions {
10906 pub(crate) fn new(
10907 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10908 ) -> Self {
10909 Self(RequestBuilder::new(stub))
10910 }
10911
10912 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10914 mut self,
10915 v: V,
10916 ) -> Self {
10917 self.0.request = v.into();
10918 self
10919 }
10920
10921 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10923 self.0.options = v.into();
10924 self
10925 }
10926
10927 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10929 (*self.0.stub)
10930 .test_iam_permissions(self.0.request, self.0.options)
10931 .await
10932 .map(crate::Response::into_body)
10933 }
10934
10935 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10939 self.0.request.resource = v.into();
10940 self
10941 }
10942
10943 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10947 where
10948 T: std::iter::IntoIterator<Item = V>,
10949 V: std::convert::Into<std::string::String>,
10950 {
10951 use std::iter::Iterator;
10952 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10953 self
10954 }
10955 }
10956
10957 #[doc(hidden)]
10958 impl crate::RequestBuilder for TestIamPermissions {
10959 fn request_options(&mut self) -> &mut crate::RequestOptions {
10960 &mut self.0.options
10961 }
10962 }
10963
10964 #[derive(Clone, Debug)]
10985 pub struct ListOperations(
10986 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10987 );
10988
10989 impl ListOperations {
10990 pub(crate) fn new(
10991 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10992 ) -> Self {
10993 Self(RequestBuilder::new(stub))
10994 }
10995
10996 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10998 mut self,
10999 v: V,
11000 ) -> Self {
11001 self.0.request = v.into();
11002 self
11003 }
11004
11005 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11007 self.0.options = v.into();
11008 self
11009 }
11010
11011 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11013 (*self.0.stub)
11014 .list_operations(self.0.request, self.0.options)
11015 .await
11016 .map(crate::Response::into_body)
11017 }
11018
11019 pub fn by_page(
11021 self,
11022 ) -> impl google_cloud_gax::paginator::Paginator<
11023 google_cloud_longrunning::model::ListOperationsResponse,
11024 crate::Error,
11025 > {
11026 use std::clone::Clone;
11027 let token = self.0.request.page_token.clone();
11028 let execute = move |token: String| {
11029 let mut builder = self.clone();
11030 builder.0.request = builder.0.request.set_page_token(token);
11031 builder.send()
11032 };
11033 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11034 }
11035
11036 pub fn by_item(
11038 self,
11039 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11040 google_cloud_longrunning::model::ListOperationsResponse,
11041 crate::Error,
11042 > {
11043 use google_cloud_gax::paginator::Paginator;
11044 self.by_page().items()
11045 }
11046
11047 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11049 self.0.request.name = v.into();
11050 self
11051 }
11052
11053 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11055 self.0.request.filter = v.into();
11056 self
11057 }
11058
11059 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11061 self.0.request.page_size = v.into();
11062 self
11063 }
11064
11065 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11067 self.0.request.page_token = v.into();
11068 self
11069 }
11070
11071 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11073 self.0.request.return_partial_success = v.into();
11074 self
11075 }
11076 }
11077
11078 #[doc(hidden)]
11079 impl crate::RequestBuilder for ListOperations {
11080 fn request_options(&mut self) -> &mut crate::RequestOptions {
11081 &mut self.0.options
11082 }
11083 }
11084
11085 #[derive(Clone, Debug)]
11102 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11103
11104 impl GetOperation {
11105 pub(crate) fn new(
11106 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
11107 ) -> Self {
11108 Self(RequestBuilder::new(stub))
11109 }
11110
11111 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11113 mut self,
11114 v: V,
11115 ) -> Self {
11116 self.0.request = v.into();
11117 self
11118 }
11119
11120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11122 self.0.options = v.into();
11123 self
11124 }
11125
11126 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11128 (*self.0.stub)
11129 .get_operation(self.0.request, self.0.options)
11130 .await
11131 .map(crate::Response::into_body)
11132 }
11133
11134 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11136 self.0.request.name = v.into();
11137 self
11138 }
11139 }
11140
11141 #[doc(hidden)]
11142 impl crate::RequestBuilder for GetOperation {
11143 fn request_options(&mut self) -> &mut crate::RequestOptions {
11144 &mut self.0.options
11145 }
11146 }
11147
11148 #[derive(Clone, Debug)]
11165 pub struct DeleteOperation(
11166 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11167 );
11168
11169 impl DeleteOperation {
11170 pub(crate) fn new(
11171 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
11172 ) -> Self {
11173 Self(RequestBuilder::new(stub))
11174 }
11175
11176 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11178 mut self,
11179 v: V,
11180 ) -> Self {
11181 self.0.request = v.into();
11182 self
11183 }
11184
11185 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11187 self.0.options = v.into();
11188 self
11189 }
11190
11191 pub async fn send(self) -> Result<()> {
11193 (*self.0.stub)
11194 .delete_operation(self.0.request, self.0.options)
11195 .await
11196 .map(crate::Response::into_body)
11197 }
11198
11199 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11201 self.0.request.name = v.into();
11202 self
11203 }
11204 }
11205
11206 #[doc(hidden)]
11207 impl crate::RequestBuilder for DeleteOperation {
11208 fn request_options(&mut self) -> &mut crate::RequestOptions {
11209 &mut self.0.options
11210 }
11211 }
11212
11213 #[derive(Clone, Debug)]
11230 pub struct CancelOperation(
11231 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11232 );
11233
11234 impl CancelOperation {
11235 pub(crate) fn new(
11236 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
11237 ) -> Self {
11238 Self(RequestBuilder::new(stub))
11239 }
11240
11241 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11243 mut self,
11244 v: V,
11245 ) -> Self {
11246 self.0.request = v.into();
11247 self
11248 }
11249
11250 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11252 self.0.options = v.into();
11253 self
11254 }
11255
11256 pub async fn send(self) -> Result<()> {
11258 (*self.0.stub)
11259 .cancel_operation(self.0.request, self.0.options)
11260 .await
11261 .map(crate::Response::into_body)
11262 }
11263
11264 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11266 self.0.request.name = v.into();
11267 self
11268 }
11269 }
11270
11271 #[doc(hidden)]
11272 impl crate::RequestBuilder for CancelOperation {
11273 fn request_options(&mut self) -> &mut crate::RequestOptions {
11274 &mut self.0.options
11275 }
11276 }
11277}
11278
11279pub mod mirroring {
11281 use crate::Result;
11282
11283 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11297
11298 pub(crate) mod client {
11299 use super::super::super::client::Mirroring;
11300 pub struct Factory;
11301 impl crate::ClientFactory for Factory {
11302 type Client = Mirroring;
11303 type Credentials = gaxi::options::Credentials;
11304 async fn build(
11305 self,
11306 config: gaxi::options::ClientConfig,
11307 ) -> crate::ClientBuilderResult<Self::Client> {
11308 Self::Client::new(config).await
11309 }
11310 }
11311 }
11312
11313 #[derive(Clone, Debug)]
11315 pub(crate) struct RequestBuilder<R: std::default::Default> {
11316 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11317 request: R,
11318 options: crate::RequestOptions,
11319 }
11320
11321 impl<R> RequestBuilder<R>
11322 where
11323 R: std::default::Default,
11324 {
11325 pub(crate) fn new(
11326 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11327 ) -> Self {
11328 Self {
11329 stub,
11330 request: R::default(),
11331 options: crate::RequestOptions::default(),
11332 }
11333 }
11334 }
11335
11336 #[derive(Clone, Debug)]
11357 pub struct ListMirroringEndpointGroups(
11358 RequestBuilder<crate::model::ListMirroringEndpointGroupsRequest>,
11359 );
11360
11361 impl ListMirroringEndpointGroups {
11362 pub(crate) fn new(
11363 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11364 ) -> Self {
11365 Self(RequestBuilder::new(stub))
11366 }
11367
11368 pub fn with_request<V: Into<crate::model::ListMirroringEndpointGroupsRequest>>(
11370 mut self,
11371 v: V,
11372 ) -> Self {
11373 self.0.request = v.into();
11374 self
11375 }
11376
11377 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11379 self.0.options = v.into();
11380 self
11381 }
11382
11383 pub async fn send(self) -> Result<crate::model::ListMirroringEndpointGroupsResponse> {
11385 (*self.0.stub)
11386 .list_mirroring_endpoint_groups(self.0.request, self.0.options)
11387 .await
11388 .map(crate::Response::into_body)
11389 }
11390
11391 pub fn by_page(
11393 self,
11394 ) -> impl google_cloud_gax::paginator::Paginator<
11395 crate::model::ListMirroringEndpointGroupsResponse,
11396 crate::Error,
11397 > {
11398 use std::clone::Clone;
11399 let token = self.0.request.page_token.clone();
11400 let execute = move |token: String| {
11401 let mut builder = self.clone();
11402 builder.0.request = builder.0.request.set_page_token(token);
11403 builder.send()
11404 };
11405 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11406 }
11407
11408 pub fn by_item(
11410 self,
11411 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11412 crate::model::ListMirroringEndpointGroupsResponse,
11413 crate::Error,
11414 > {
11415 use google_cloud_gax::paginator::Paginator;
11416 self.by_page().items()
11417 }
11418
11419 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11423 self.0.request.parent = v.into();
11424 self
11425 }
11426
11427 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11429 self.0.request.page_size = v.into();
11430 self
11431 }
11432
11433 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11435 self.0.request.page_token = v.into();
11436 self
11437 }
11438
11439 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11441 self.0.request.filter = v.into();
11442 self
11443 }
11444
11445 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11447 self.0.request.order_by = v.into();
11448 self
11449 }
11450 }
11451
11452 #[doc(hidden)]
11453 impl crate::RequestBuilder for ListMirroringEndpointGroups {
11454 fn request_options(&mut self) -> &mut crate::RequestOptions {
11455 &mut self.0.options
11456 }
11457 }
11458
11459 #[derive(Clone, Debug)]
11476 pub struct GetMirroringEndpointGroup(
11477 RequestBuilder<crate::model::GetMirroringEndpointGroupRequest>,
11478 );
11479
11480 impl GetMirroringEndpointGroup {
11481 pub(crate) fn new(
11482 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11483 ) -> Self {
11484 Self(RequestBuilder::new(stub))
11485 }
11486
11487 pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupRequest>>(
11489 mut self,
11490 v: V,
11491 ) -> Self {
11492 self.0.request = v.into();
11493 self
11494 }
11495
11496 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11498 self.0.options = v.into();
11499 self
11500 }
11501
11502 pub async fn send(self) -> Result<crate::model::MirroringEndpointGroup> {
11504 (*self.0.stub)
11505 .get_mirroring_endpoint_group(self.0.request, self.0.options)
11506 .await
11507 .map(crate::Response::into_body)
11508 }
11509
11510 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11514 self.0.request.name = v.into();
11515 self
11516 }
11517 }
11518
11519 #[doc(hidden)]
11520 impl crate::RequestBuilder for GetMirroringEndpointGroup {
11521 fn request_options(&mut self) -> &mut crate::RequestOptions {
11522 &mut self.0.options
11523 }
11524 }
11525
11526 #[derive(Clone, Debug)]
11544 pub struct CreateMirroringEndpointGroup(
11545 RequestBuilder<crate::model::CreateMirroringEndpointGroupRequest>,
11546 );
11547
11548 impl CreateMirroringEndpointGroup {
11549 pub(crate) fn new(
11550 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11551 ) -> Self {
11552 Self(RequestBuilder::new(stub))
11553 }
11554
11555 pub fn with_request<V: Into<crate::model::CreateMirroringEndpointGroupRequest>>(
11557 mut self,
11558 v: V,
11559 ) -> Self {
11560 self.0.request = v.into();
11561 self
11562 }
11563
11564 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11566 self.0.options = v.into();
11567 self
11568 }
11569
11570 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11577 (*self.0.stub)
11578 .create_mirroring_endpoint_group(self.0.request, self.0.options)
11579 .await
11580 .map(crate::Response::into_body)
11581 }
11582
11583 pub fn poller(
11585 self,
11586 ) -> impl google_cloud_lro::Poller<
11587 crate::model::MirroringEndpointGroup,
11588 crate::model::OperationMetadata,
11589 > {
11590 type Operation = google_cloud_lro::internal::Operation<
11591 crate::model::MirroringEndpointGroup,
11592 crate::model::OperationMetadata,
11593 >;
11594 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11595 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11596 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11597 if let Some(ref mut details) = poller_options.tracing {
11598 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::create_mirroring_endpoint_group::until_done";
11599 }
11600
11601 let stub = self.0.stub.clone();
11602 let mut options = self.0.options.clone();
11603 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11604 let query = move |name| {
11605 let stub = stub.clone();
11606 let options = options.clone();
11607 async {
11608 let op = GetOperation::new(stub)
11609 .set_name(name)
11610 .with_options(options)
11611 .send()
11612 .await?;
11613 Ok(Operation::new(op))
11614 }
11615 };
11616
11617 let start = move || async {
11618 let op = self.send().await?;
11619 Ok(Operation::new(op))
11620 };
11621
11622 use google_cloud_lro::internal::PollerExt;
11623 {
11624 google_cloud_lro::internal::new_poller(
11625 polling_error_policy,
11626 polling_backoff_policy,
11627 start,
11628 query,
11629 )
11630 }
11631 .with_options(poller_options)
11632 }
11633
11634 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11638 self.0.request.parent = v.into();
11639 self
11640 }
11641
11642 pub fn set_mirroring_endpoint_group_id<T: Into<std::string::String>>(
11646 mut self,
11647 v: T,
11648 ) -> Self {
11649 self.0.request.mirroring_endpoint_group_id = v.into();
11650 self
11651 }
11652
11653 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
11657 where
11658 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11659 {
11660 self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
11661 self
11662 }
11663
11664 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
11668 where
11669 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11670 {
11671 self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
11672 self
11673 }
11674
11675 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11677 self.0.request.request_id = v.into();
11678 self
11679 }
11680 }
11681
11682 #[doc(hidden)]
11683 impl crate::RequestBuilder for CreateMirroringEndpointGroup {
11684 fn request_options(&mut self) -> &mut crate::RequestOptions {
11685 &mut self.0.options
11686 }
11687 }
11688
11689 #[derive(Clone, Debug)]
11707 pub struct UpdateMirroringEndpointGroup(
11708 RequestBuilder<crate::model::UpdateMirroringEndpointGroupRequest>,
11709 );
11710
11711 impl UpdateMirroringEndpointGroup {
11712 pub(crate) fn new(
11713 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11714 ) -> Self {
11715 Self(RequestBuilder::new(stub))
11716 }
11717
11718 pub fn with_request<V: Into<crate::model::UpdateMirroringEndpointGroupRequest>>(
11720 mut self,
11721 v: V,
11722 ) -> Self {
11723 self.0.request = v.into();
11724 self
11725 }
11726
11727 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11729 self.0.options = v.into();
11730 self
11731 }
11732
11733 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11740 (*self.0.stub)
11741 .update_mirroring_endpoint_group(self.0.request, self.0.options)
11742 .await
11743 .map(crate::Response::into_body)
11744 }
11745
11746 pub fn poller(
11748 self,
11749 ) -> impl google_cloud_lro::Poller<
11750 crate::model::MirroringEndpointGroup,
11751 crate::model::OperationMetadata,
11752 > {
11753 type Operation = google_cloud_lro::internal::Operation<
11754 crate::model::MirroringEndpointGroup,
11755 crate::model::OperationMetadata,
11756 >;
11757 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11758 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11759 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11760 if let Some(ref mut details) = poller_options.tracing {
11761 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::update_mirroring_endpoint_group::until_done";
11762 }
11763
11764 let stub = self.0.stub.clone();
11765 let mut options = self.0.options.clone();
11766 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11767 let query = move |name| {
11768 let stub = stub.clone();
11769 let options = options.clone();
11770 async {
11771 let op = GetOperation::new(stub)
11772 .set_name(name)
11773 .with_options(options)
11774 .send()
11775 .await?;
11776 Ok(Operation::new(op))
11777 }
11778 };
11779
11780 let start = move || async {
11781 let op = self.send().await?;
11782 Ok(Operation::new(op))
11783 };
11784
11785 use google_cloud_lro::internal::PollerExt;
11786 {
11787 google_cloud_lro::internal::new_poller(
11788 polling_error_policy,
11789 polling_backoff_policy,
11790 start,
11791 query,
11792 )
11793 }
11794 .with_options(poller_options)
11795 }
11796
11797 pub fn set_update_mask<T>(mut self, v: T) -> Self
11799 where
11800 T: std::convert::Into<wkt::FieldMask>,
11801 {
11802 self.0.request.update_mask = std::option::Option::Some(v.into());
11803 self
11804 }
11805
11806 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11808 where
11809 T: std::convert::Into<wkt::FieldMask>,
11810 {
11811 self.0.request.update_mask = v.map(|x| x.into());
11812 self
11813 }
11814
11815 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
11819 where
11820 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11821 {
11822 self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
11823 self
11824 }
11825
11826 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
11830 where
11831 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11832 {
11833 self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
11834 self
11835 }
11836
11837 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11839 self.0.request.request_id = v.into();
11840 self
11841 }
11842 }
11843
11844 #[doc(hidden)]
11845 impl crate::RequestBuilder for UpdateMirroringEndpointGroup {
11846 fn request_options(&mut self) -> &mut crate::RequestOptions {
11847 &mut self.0.options
11848 }
11849 }
11850
11851 #[derive(Clone, Debug)]
11869 pub struct DeleteMirroringEndpointGroup(
11870 RequestBuilder<crate::model::DeleteMirroringEndpointGroupRequest>,
11871 );
11872
11873 impl DeleteMirroringEndpointGroup {
11874 pub(crate) fn new(
11875 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11876 ) -> Self {
11877 Self(RequestBuilder::new(stub))
11878 }
11879
11880 pub fn with_request<V: Into<crate::model::DeleteMirroringEndpointGroupRequest>>(
11882 mut self,
11883 v: V,
11884 ) -> Self {
11885 self.0.request = v.into();
11886 self
11887 }
11888
11889 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11891 self.0.options = v.into();
11892 self
11893 }
11894
11895 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11902 (*self.0.stub)
11903 .delete_mirroring_endpoint_group(self.0.request, self.0.options)
11904 .await
11905 .map(crate::Response::into_body)
11906 }
11907
11908 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11910 type Operation =
11911 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11912 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11913 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11914 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11915 if let Some(ref mut details) = poller_options.tracing {
11916 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::delete_mirroring_endpoint_group::until_done";
11917 }
11918
11919 let stub = self.0.stub.clone();
11920 let mut options = self.0.options.clone();
11921 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11922 let query = move |name| {
11923 let stub = stub.clone();
11924 let options = options.clone();
11925 async {
11926 let op = GetOperation::new(stub)
11927 .set_name(name)
11928 .with_options(options)
11929 .send()
11930 .await?;
11931 Ok(Operation::new(op))
11932 }
11933 };
11934
11935 let start = move || async {
11936 let op = self.send().await?;
11937 Ok(Operation::new(op))
11938 };
11939
11940 use google_cloud_lro::internal::PollerExt;
11941 {
11942 google_cloud_lro::internal::new_unit_response_poller(
11943 polling_error_policy,
11944 polling_backoff_policy,
11945 start,
11946 query,
11947 )
11948 }
11949 .with_options(poller_options)
11950 }
11951
11952 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11956 self.0.request.name = v.into();
11957 self
11958 }
11959
11960 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11962 self.0.request.request_id = v.into();
11963 self
11964 }
11965 }
11966
11967 #[doc(hidden)]
11968 impl crate::RequestBuilder for DeleteMirroringEndpointGroup {
11969 fn request_options(&mut self) -> &mut crate::RequestOptions {
11970 &mut self.0.options
11971 }
11972 }
11973
11974 #[derive(Clone, Debug)]
11995 pub struct ListMirroringEndpointGroupAssociations(
11996 RequestBuilder<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11997 );
11998
11999 impl ListMirroringEndpointGroupAssociations {
12000 pub(crate) fn new(
12001 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12002 ) -> Self {
12003 Self(RequestBuilder::new(stub))
12004 }
12005
12006 pub fn with_request<
12008 V: Into<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
12009 >(
12010 mut self,
12011 v: V,
12012 ) -> Self {
12013 self.0.request = v.into();
12014 self
12015 }
12016
12017 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12019 self.0.options = v.into();
12020 self
12021 }
12022
12023 pub async fn send(
12025 self,
12026 ) -> Result<crate::model::ListMirroringEndpointGroupAssociationsResponse> {
12027 (*self.0.stub)
12028 .list_mirroring_endpoint_group_associations(self.0.request, self.0.options)
12029 .await
12030 .map(crate::Response::into_body)
12031 }
12032
12033 pub fn by_page(
12035 self,
12036 ) -> impl google_cloud_gax::paginator::Paginator<
12037 crate::model::ListMirroringEndpointGroupAssociationsResponse,
12038 crate::Error,
12039 > {
12040 use std::clone::Clone;
12041 let token = self.0.request.page_token.clone();
12042 let execute = move |token: String| {
12043 let mut builder = self.clone();
12044 builder.0.request = builder.0.request.set_page_token(token);
12045 builder.send()
12046 };
12047 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12048 }
12049
12050 pub fn by_item(
12052 self,
12053 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12054 crate::model::ListMirroringEndpointGroupAssociationsResponse,
12055 crate::Error,
12056 > {
12057 use google_cloud_gax::paginator::Paginator;
12058 self.by_page().items()
12059 }
12060
12061 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12065 self.0.request.parent = v.into();
12066 self
12067 }
12068
12069 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12071 self.0.request.page_size = v.into();
12072 self
12073 }
12074
12075 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12077 self.0.request.page_token = v.into();
12078 self
12079 }
12080
12081 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12083 self.0.request.filter = v.into();
12084 self
12085 }
12086
12087 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12089 self.0.request.order_by = v.into();
12090 self
12091 }
12092 }
12093
12094 #[doc(hidden)]
12095 impl crate::RequestBuilder for ListMirroringEndpointGroupAssociations {
12096 fn request_options(&mut self) -> &mut crate::RequestOptions {
12097 &mut self.0.options
12098 }
12099 }
12100
12101 #[derive(Clone, Debug)]
12118 pub struct GetMirroringEndpointGroupAssociation(
12119 RequestBuilder<crate::model::GetMirroringEndpointGroupAssociationRequest>,
12120 );
12121
12122 impl GetMirroringEndpointGroupAssociation {
12123 pub(crate) fn new(
12124 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12125 ) -> Self {
12126 Self(RequestBuilder::new(stub))
12127 }
12128
12129 pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupAssociationRequest>>(
12131 mut self,
12132 v: V,
12133 ) -> Self {
12134 self.0.request = v.into();
12135 self
12136 }
12137
12138 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12140 self.0.options = v.into();
12141 self
12142 }
12143
12144 pub async fn send(self) -> Result<crate::model::MirroringEndpointGroupAssociation> {
12146 (*self.0.stub)
12147 .get_mirroring_endpoint_group_association(self.0.request, self.0.options)
12148 .await
12149 .map(crate::Response::into_body)
12150 }
12151
12152 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12156 self.0.request.name = v.into();
12157 self
12158 }
12159 }
12160
12161 #[doc(hidden)]
12162 impl crate::RequestBuilder for GetMirroringEndpointGroupAssociation {
12163 fn request_options(&mut self) -> &mut crate::RequestOptions {
12164 &mut self.0.options
12165 }
12166 }
12167
12168 #[derive(Clone, Debug)]
12186 pub struct CreateMirroringEndpointGroupAssociation(
12187 RequestBuilder<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
12188 );
12189
12190 impl CreateMirroringEndpointGroupAssociation {
12191 pub(crate) fn new(
12192 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12193 ) -> Self {
12194 Self(RequestBuilder::new(stub))
12195 }
12196
12197 pub fn with_request<
12199 V: Into<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
12200 >(
12201 mut self,
12202 v: V,
12203 ) -> Self {
12204 self.0.request = v.into();
12205 self
12206 }
12207
12208 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12210 self.0.options = v.into();
12211 self
12212 }
12213
12214 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12221 (*self.0.stub)
12222 .create_mirroring_endpoint_group_association(self.0.request, self.0.options)
12223 .await
12224 .map(crate::Response::into_body)
12225 }
12226
12227 pub fn poller(
12229 self,
12230 ) -> impl google_cloud_lro::Poller<
12231 crate::model::MirroringEndpointGroupAssociation,
12232 crate::model::OperationMetadata,
12233 > {
12234 type Operation = google_cloud_lro::internal::Operation<
12235 crate::model::MirroringEndpointGroupAssociation,
12236 crate::model::OperationMetadata,
12237 >;
12238 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12239 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12240 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
12241 if let Some(ref mut details) = poller_options.tracing {
12242 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::create_mirroring_endpoint_group_association::until_done";
12243 }
12244
12245 let stub = self.0.stub.clone();
12246 let mut options = self.0.options.clone();
12247 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12248 let query = move |name| {
12249 let stub = stub.clone();
12250 let options = options.clone();
12251 async {
12252 let op = GetOperation::new(stub)
12253 .set_name(name)
12254 .with_options(options)
12255 .send()
12256 .await?;
12257 Ok(Operation::new(op))
12258 }
12259 };
12260
12261 let start = move || async {
12262 let op = self.send().await?;
12263 Ok(Operation::new(op))
12264 };
12265
12266 use google_cloud_lro::internal::PollerExt;
12267 {
12268 google_cloud_lro::internal::new_poller(
12269 polling_error_policy,
12270 polling_backoff_policy,
12271 start,
12272 query,
12273 )
12274 }
12275 .with_options(poller_options)
12276 }
12277
12278 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12282 self.0.request.parent = v.into();
12283 self
12284 }
12285
12286 pub fn set_mirroring_endpoint_group_association_id<T: Into<std::string::String>>(
12288 mut self,
12289 v: T,
12290 ) -> Self {
12291 self.0.request.mirroring_endpoint_group_association_id = v.into();
12292 self
12293 }
12294
12295 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
12299 where
12300 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12301 {
12302 self.0.request.mirroring_endpoint_group_association =
12303 std::option::Option::Some(v.into());
12304 self
12305 }
12306
12307 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
12311 mut self,
12312 v: std::option::Option<T>,
12313 ) -> Self
12314 where
12315 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12316 {
12317 self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
12318 self
12319 }
12320
12321 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12323 self.0.request.request_id = v.into();
12324 self
12325 }
12326 }
12327
12328 #[doc(hidden)]
12329 impl crate::RequestBuilder for CreateMirroringEndpointGroupAssociation {
12330 fn request_options(&mut self) -> &mut crate::RequestOptions {
12331 &mut self.0.options
12332 }
12333 }
12334
12335 #[derive(Clone, Debug)]
12353 pub struct UpdateMirroringEndpointGroupAssociation(
12354 RequestBuilder<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
12355 );
12356
12357 impl UpdateMirroringEndpointGroupAssociation {
12358 pub(crate) fn new(
12359 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12360 ) -> Self {
12361 Self(RequestBuilder::new(stub))
12362 }
12363
12364 pub fn with_request<
12366 V: Into<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
12367 >(
12368 mut self,
12369 v: V,
12370 ) -> Self {
12371 self.0.request = v.into();
12372 self
12373 }
12374
12375 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12377 self.0.options = v.into();
12378 self
12379 }
12380
12381 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12388 (*self.0.stub)
12389 .update_mirroring_endpoint_group_association(self.0.request, self.0.options)
12390 .await
12391 .map(crate::Response::into_body)
12392 }
12393
12394 pub fn poller(
12396 self,
12397 ) -> impl google_cloud_lro::Poller<
12398 crate::model::MirroringEndpointGroupAssociation,
12399 crate::model::OperationMetadata,
12400 > {
12401 type Operation = google_cloud_lro::internal::Operation<
12402 crate::model::MirroringEndpointGroupAssociation,
12403 crate::model::OperationMetadata,
12404 >;
12405 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12406 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12407 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
12408 if let Some(ref mut details) = poller_options.tracing {
12409 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::update_mirroring_endpoint_group_association::until_done";
12410 }
12411
12412 let stub = self.0.stub.clone();
12413 let mut options = self.0.options.clone();
12414 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12415 let query = move |name| {
12416 let stub = stub.clone();
12417 let options = options.clone();
12418 async {
12419 let op = GetOperation::new(stub)
12420 .set_name(name)
12421 .with_options(options)
12422 .send()
12423 .await?;
12424 Ok(Operation::new(op))
12425 }
12426 };
12427
12428 let start = move || async {
12429 let op = self.send().await?;
12430 Ok(Operation::new(op))
12431 };
12432
12433 use google_cloud_lro::internal::PollerExt;
12434 {
12435 google_cloud_lro::internal::new_poller(
12436 polling_error_policy,
12437 polling_backoff_policy,
12438 start,
12439 query,
12440 )
12441 }
12442 .with_options(poller_options)
12443 }
12444
12445 pub fn set_update_mask<T>(mut self, v: T) -> Self
12447 where
12448 T: std::convert::Into<wkt::FieldMask>,
12449 {
12450 self.0.request.update_mask = std::option::Option::Some(v.into());
12451 self
12452 }
12453
12454 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12456 where
12457 T: std::convert::Into<wkt::FieldMask>,
12458 {
12459 self.0.request.update_mask = v.map(|x| x.into());
12460 self
12461 }
12462
12463 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
12467 where
12468 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12469 {
12470 self.0.request.mirroring_endpoint_group_association =
12471 std::option::Option::Some(v.into());
12472 self
12473 }
12474
12475 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
12479 mut self,
12480 v: std::option::Option<T>,
12481 ) -> Self
12482 where
12483 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12484 {
12485 self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
12486 self
12487 }
12488
12489 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12491 self.0.request.request_id = v.into();
12492 self
12493 }
12494 }
12495
12496 #[doc(hidden)]
12497 impl crate::RequestBuilder for UpdateMirroringEndpointGroupAssociation {
12498 fn request_options(&mut self) -> &mut crate::RequestOptions {
12499 &mut self.0.options
12500 }
12501 }
12502
12503 #[derive(Clone, Debug)]
12521 pub struct DeleteMirroringEndpointGroupAssociation(
12522 RequestBuilder<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
12523 );
12524
12525 impl DeleteMirroringEndpointGroupAssociation {
12526 pub(crate) fn new(
12527 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12528 ) -> Self {
12529 Self(RequestBuilder::new(stub))
12530 }
12531
12532 pub fn with_request<
12534 V: Into<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
12535 >(
12536 mut self,
12537 v: V,
12538 ) -> Self {
12539 self.0.request = v.into();
12540 self
12541 }
12542
12543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12545 self.0.options = v.into();
12546 self
12547 }
12548
12549 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12556 (*self.0.stub)
12557 .delete_mirroring_endpoint_group_association(self.0.request, self.0.options)
12558 .await
12559 .map(crate::Response::into_body)
12560 }
12561
12562 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12564 type Operation =
12565 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12566 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12567 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12568 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
12569 if let Some(ref mut details) = poller_options.tracing {
12570 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::delete_mirroring_endpoint_group_association::until_done";
12571 }
12572
12573 let stub = self.0.stub.clone();
12574 let mut options = self.0.options.clone();
12575 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12576 let query = move |name| {
12577 let stub = stub.clone();
12578 let options = options.clone();
12579 async {
12580 let op = GetOperation::new(stub)
12581 .set_name(name)
12582 .with_options(options)
12583 .send()
12584 .await?;
12585 Ok(Operation::new(op))
12586 }
12587 };
12588
12589 let start = move || async {
12590 let op = self.send().await?;
12591 Ok(Operation::new(op))
12592 };
12593
12594 use google_cloud_lro::internal::PollerExt;
12595 {
12596 google_cloud_lro::internal::new_unit_response_poller(
12597 polling_error_policy,
12598 polling_backoff_policy,
12599 start,
12600 query,
12601 )
12602 }
12603 .with_options(poller_options)
12604 }
12605
12606 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12610 self.0.request.name = v.into();
12611 self
12612 }
12613
12614 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12616 self.0.request.request_id = v.into();
12617 self
12618 }
12619 }
12620
12621 #[doc(hidden)]
12622 impl crate::RequestBuilder for DeleteMirroringEndpointGroupAssociation {
12623 fn request_options(&mut self) -> &mut crate::RequestOptions {
12624 &mut self.0.options
12625 }
12626 }
12627
12628 #[derive(Clone, Debug)]
12649 pub struct ListMirroringDeploymentGroups(
12650 RequestBuilder<crate::model::ListMirroringDeploymentGroupsRequest>,
12651 );
12652
12653 impl ListMirroringDeploymentGroups {
12654 pub(crate) fn new(
12655 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12656 ) -> Self {
12657 Self(RequestBuilder::new(stub))
12658 }
12659
12660 pub fn with_request<V: Into<crate::model::ListMirroringDeploymentGroupsRequest>>(
12662 mut self,
12663 v: V,
12664 ) -> Self {
12665 self.0.request = v.into();
12666 self
12667 }
12668
12669 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12671 self.0.options = v.into();
12672 self
12673 }
12674
12675 pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentGroupsResponse> {
12677 (*self.0.stub)
12678 .list_mirroring_deployment_groups(self.0.request, self.0.options)
12679 .await
12680 .map(crate::Response::into_body)
12681 }
12682
12683 pub fn by_page(
12685 self,
12686 ) -> impl google_cloud_gax::paginator::Paginator<
12687 crate::model::ListMirroringDeploymentGroupsResponse,
12688 crate::Error,
12689 > {
12690 use std::clone::Clone;
12691 let token = self.0.request.page_token.clone();
12692 let execute = move |token: String| {
12693 let mut builder = self.clone();
12694 builder.0.request = builder.0.request.set_page_token(token);
12695 builder.send()
12696 };
12697 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12698 }
12699
12700 pub fn by_item(
12702 self,
12703 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12704 crate::model::ListMirroringDeploymentGroupsResponse,
12705 crate::Error,
12706 > {
12707 use google_cloud_gax::paginator::Paginator;
12708 self.by_page().items()
12709 }
12710
12711 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12715 self.0.request.parent = v.into();
12716 self
12717 }
12718
12719 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12721 self.0.request.page_size = v.into();
12722 self
12723 }
12724
12725 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12727 self.0.request.page_token = v.into();
12728 self
12729 }
12730
12731 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12733 self.0.request.filter = v.into();
12734 self
12735 }
12736
12737 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12739 self.0.request.order_by = v.into();
12740 self
12741 }
12742 }
12743
12744 #[doc(hidden)]
12745 impl crate::RequestBuilder for ListMirroringDeploymentGroups {
12746 fn request_options(&mut self) -> &mut crate::RequestOptions {
12747 &mut self.0.options
12748 }
12749 }
12750
12751 #[derive(Clone, Debug)]
12768 pub struct GetMirroringDeploymentGroup(
12769 RequestBuilder<crate::model::GetMirroringDeploymentGroupRequest>,
12770 );
12771
12772 impl GetMirroringDeploymentGroup {
12773 pub(crate) fn new(
12774 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12775 ) -> Self {
12776 Self(RequestBuilder::new(stub))
12777 }
12778
12779 pub fn with_request<V: Into<crate::model::GetMirroringDeploymentGroupRequest>>(
12781 mut self,
12782 v: V,
12783 ) -> Self {
12784 self.0.request = v.into();
12785 self
12786 }
12787
12788 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12790 self.0.options = v.into();
12791 self
12792 }
12793
12794 pub async fn send(self) -> Result<crate::model::MirroringDeploymentGroup> {
12796 (*self.0.stub)
12797 .get_mirroring_deployment_group(self.0.request, self.0.options)
12798 .await
12799 .map(crate::Response::into_body)
12800 }
12801
12802 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12806 self.0.request.name = v.into();
12807 self
12808 }
12809 }
12810
12811 #[doc(hidden)]
12812 impl crate::RequestBuilder for GetMirroringDeploymentGroup {
12813 fn request_options(&mut self) -> &mut crate::RequestOptions {
12814 &mut self.0.options
12815 }
12816 }
12817
12818 #[derive(Clone, Debug)]
12836 pub struct CreateMirroringDeploymentGroup(
12837 RequestBuilder<crate::model::CreateMirroringDeploymentGroupRequest>,
12838 );
12839
12840 impl CreateMirroringDeploymentGroup {
12841 pub(crate) fn new(
12842 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12843 ) -> Self {
12844 Self(RequestBuilder::new(stub))
12845 }
12846
12847 pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentGroupRequest>>(
12849 mut self,
12850 v: V,
12851 ) -> Self {
12852 self.0.request = v.into();
12853 self
12854 }
12855
12856 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12858 self.0.options = v.into();
12859 self
12860 }
12861
12862 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12869 (*self.0.stub)
12870 .create_mirroring_deployment_group(self.0.request, self.0.options)
12871 .await
12872 .map(crate::Response::into_body)
12873 }
12874
12875 pub fn poller(
12877 self,
12878 ) -> impl google_cloud_lro::Poller<
12879 crate::model::MirroringDeploymentGroup,
12880 crate::model::OperationMetadata,
12881 > {
12882 type Operation = google_cloud_lro::internal::Operation<
12883 crate::model::MirroringDeploymentGroup,
12884 crate::model::OperationMetadata,
12885 >;
12886 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12887 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12888 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
12889 if let Some(ref mut details) = poller_options.tracing {
12890 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::create_mirroring_deployment_group::until_done";
12891 }
12892
12893 let stub = self.0.stub.clone();
12894 let mut options = self.0.options.clone();
12895 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12896 let query = move |name| {
12897 let stub = stub.clone();
12898 let options = options.clone();
12899 async {
12900 let op = GetOperation::new(stub)
12901 .set_name(name)
12902 .with_options(options)
12903 .send()
12904 .await?;
12905 Ok(Operation::new(op))
12906 }
12907 };
12908
12909 let start = move || async {
12910 let op = self.send().await?;
12911 Ok(Operation::new(op))
12912 };
12913
12914 use google_cloud_lro::internal::PollerExt;
12915 {
12916 google_cloud_lro::internal::new_poller(
12917 polling_error_policy,
12918 polling_backoff_policy,
12919 start,
12920 query,
12921 )
12922 }
12923 .with_options(poller_options)
12924 }
12925
12926 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12930 self.0.request.parent = v.into();
12931 self
12932 }
12933
12934 pub fn set_mirroring_deployment_group_id<T: Into<std::string::String>>(
12938 mut self,
12939 v: T,
12940 ) -> Self {
12941 self.0.request.mirroring_deployment_group_id = v.into();
12942 self
12943 }
12944
12945 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12949 where
12950 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12951 {
12952 self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12953 self
12954 }
12955
12956 pub fn set_or_clear_mirroring_deployment_group<T>(
12960 mut self,
12961 v: std::option::Option<T>,
12962 ) -> Self
12963 where
12964 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12965 {
12966 self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12967 self
12968 }
12969
12970 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12972 self.0.request.request_id = v.into();
12973 self
12974 }
12975 }
12976
12977 #[doc(hidden)]
12978 impl crate::RequestBuilder for CreateMirroringDeploymentGroup {
12979 fn request_options(&mut self) -> &mut crate::RequestOptions {
12980 &mut self.0.options
12981 }
12982 }
12983
12984 #[derive(Clone, Debug)]
13002 pub struct UpdateMirroringDeploymentGroup(
13003 RequestBuilder<crate::model::UpdateMirroringDeploymentGroupRequest>,
13004 );
13005
13006 impl UpdateMirroringDeploymentGroup {
13007 pub(crate) fn new(
13008 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13009 ) -> Self {
13010 Self(RequestBuilder::new(stub))
13011 }
13012
13013 pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentGroupRequest>>(
13015 mut self,
13016 v: V,
13017 ) -> Self {
13018 self.0.request = v.into();
13019 self
13020 }
13021
13022 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13024 self.0.options = v.into();
13025 self
13026 }
13027
13028 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13035 (*self.0.stub)
13036 .update_mirroring_deployment_group(self.0.request, self.0.options)
13037 .await
13038 .map(crate::Response::into_body)
13039 }
13040
13041 pub fn poller(
13043 self,
13044 ) -> impl google_cloud_lro::Poller<
13045 crate::model::MirroringDeploymentGroup,
13046 crate::model::OperationMetadata,
13047 > {
13048 type Operation = google_cloud_lro::internal::Operation<
13049 crate::model::MirroringDeploymentGroup,
13050 crate::model::OperationMetadata,
13051 >;
13052 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13053 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13054 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13055 if let Some(ref mut details) = poller_options.tracing {
13056 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::update_mirroring_deployment_group::until_done";
13057 }
13058
13059 let stub = self.0.stub.clone();
13060 let mut options = self.0.options.clone();
13061 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13062 let query = move |name| {
13063 let stub = stub.clone();
13064 let options = options.clone();
13065 async {
13066 let op = GetOperation::new(stub)
13067 .set_name(name)
13068 .with_options(options)
13069 .send()
13070 .await?;
13071 Ok(Operation::new(op))
13072 }
13073 };
13074
13075 let start = move || async {
13076 let op = self.send().await?;
13077 Ok(Operation::new(op))
13078 };
13079
13080 use google_cloud_lro::internal::PollerExt;
13081 {
13082 google_cloud_lro::internal::new_poller(
13083 polling_error_policy,
13084 polling_backoff_policy,
13085 start,
13086 query,
13087 )
13088 }
13089 .with_options(poller_options)
13090 }
13091
13092 pub fn set_update_mask<T>(mut self, v: T) -> Self
13094 where
13095 T: std::convert::Into<wkt::FieldMask>,
13096 {
13097 self.0.request.update_mask = std::option::Option::Some(v.into());
13098 self
13099 }
13100
13101 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13103 where
13104 T: std::convert::Into<wkt::FieldMask>,
13105 {
13106 self.0.request.update_mask = v.map(|x| x.into());
13107 self
13108 }
13109
13110 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
13114 where
13115 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
13116 {
13117 self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
13118 self
13119 }
13120
13121 pub fn set_or_clear_mirroring_deployment_group<T>(
13125 mut self,
13126 v: std::option::Option<T>,
13127 ) -> Self
13128 where
13129 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
13130 {
13131 self.0.request.mirroring_deployment_group = v.map(|x| x.into());
13132 self
13133 }
13134
13135 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13137 self.0.request.request_id = v.into();
13138 self
13139 }
13140 }
13141
13142 #[doc(hidden)]
13143 impl crate::RequestBuilder for UpdateMirroringDeploymentGroup {
13144 fn request_options(&mut self) -> &mut crate::RequestOptions {
13145 &mut self.0.options
13146 }
13147 }
13148
13149 #[derive(Clone, Debug)]
13167 pub struct DeleteMirroringDeploymentGroup(
13168 RequestBuilder<crate::model::DeleteMirroringDeploymentGroupRequest>,
13169 );
13170
13171 impl DeleteMirroringDeploymentGroup {
13172 pub(crate) fn new(
13173 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13174 ) -> Self {
13175 Self(RequestBuilder::new(stub))
13176 }
13177
13178 pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentGroupRequest>>(
13180 mut self,
13181 v: V,
13182 ) -> Self {
13183 self.0.request = v.into();
13184 self
13185 }
13186
13187 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13189 self.0.options = v.into();
13190 self
13191 }
13192
13193 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13200 (*self.0.stub)
13201 .delete_mirroring_deployment_group(self.0.request, self.0.options)
13202 .await
13203 .map(crate::Response::into_body)
13204 }
13205
13206 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
13208 type Operation =
13209 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13210 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13211 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13212 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13213 if let Some(ref mut details) = poller_options.tracing {
13214 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::delete_mirroring_deployment_group::until_done";
13215 }
13216
13217 let stub = self.0.stub.clone();
13218 let mut options = self.0.options.clone();
13219 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13220 let query = move |name| {
13221 let stub = stub.clone();
13222 let options = options.clone();
13223 async {
13224 let op = GetOperation::new(stub)
13225 .set_name(name)
13226 .with_options(options)
13227 .send()
13228 .await?;
13229 Ok(Operation::new(op))
13230 }
13231 };
13232
13233 let start = move || async {
13234 let op = self.send().await?;
13235 Ok(Operation::new(op))
13236 };
13237
13238 use google_cloud_lro::internal::PollerExt;
13239 {
13240 google_cloud_lro::internal::new_unit_response_poller(
13241 polling_error_policy,
13242 polling_backoff_policy,
13243 start,
13244 query,
13245 )
13246 }
13247 .with_options(poller_options)
13248 }
13249
13250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13254 self.0.request.name = v.into();
13255 self
13256 }
13257
13258 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13260 self.0.request.request_id = v.into();
13261 self
13262 }
13263 }
13264
13265 #[doc(hidden)]
13266 impl crate::RequestBuilder for DeleteMirroringDeploymentGroup {
13267 fn request_options(&mut self) -> &mut crate::RequestOptions {
13268 &mut self.0.options
13269 }
13270 }
13271
13272 #[derive(Clone, Debug)]
13293 pub struct ListMirroringDeployments(
13294 RequestBuilder<crate::model::ListMirroringDeploymentsRequest>,
13295 );
13296
13297 impl ListMirroringDeployments {
13298 pub(crate) fn new(
13299 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13300 ) -> Self {
13301 Self(RequestBuilder::new(stub))
13302 }
13303
13304 pub fn with_request<V: Into<crate::model::ListMirroringDeploymentsRequest>>(
13306 mut self,
13307 v: V,
13308 ) -> Self {
13309 self.0.request = v.into();
13310 self
13311 }
13312
13313 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13315 self.0.options = v.into();
13316 self
13317 }
13318
13319 pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentsResponse> {
13321 (*self.0.stub)
13322 .list_mirroring_deployments(self.0.request, self.0.options)
13323 .await
13324 .map(crate::Response::into_body)
13325 }
13326
13327 pub fn by_page(
13329 self,
13330 ) -> impl google_cloud_gax::paginator::Paginator<
13331 crate::model::ListMirroringDeploymentsResponse,
13332 crate::Error,
13333 > {
13334 use std::clone::Clone;
13335 let token = self.0.request.page_token.clone();
13336 let execute = move |token: String| {
13337 let mut builder = self.clone();
13338 builder.0.request = builder.0.request.set_page_token(token);
13339 builder.send()
13340 };
13341 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13342 }
13343
13344 pub fn by_item(
13346 self,
13347 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13348 crate::model::ListMirroringDeploymentsResponse,
13349 crate::Error,
13350 > {
13351 use google_cloud_gax::paginator::Paginator;
13352 self.by_page().items()
13353 }
13354
13355 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13359 self.0.request.parent = v.into();
13360 self
13361 }
13362
13363 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13365 self.0.request.page_size = v.into();
13366 self
13367 }
13368
13369 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13371 self.0.request.page_token = v.into();
13372 self
13373 }
13374
13375 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13377 self.0.request.filter = v.into();
13378 self
13379 }
13380
13381 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13383 self.0.request.order_by = v.into();
13384 self
13385 }
13386 }
13387
13388 #[doc(hidden)]
13389 impl crate::RequestBuilder for ListMirroringDeployments {
13390 fn request_options(&mut self) -> &mut crate::RequestOptions {
13391 &mut self.0.options
13392 }
13393 }
13394
13395 #[derive(Clone, Debug)]
13412 pub struct GetMirroringDeployment(RequestBuilder<crate::model::GetMirroringDeploymentRequest>);
13413
13414 impl GetMirroringDeployment {
13415 pub(crate) fn new(
13416 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13417 ) -> Self {
13418 Self(RequestBuilder::new(stub))
13419 }
13420
13421 pub fn with_request<V: Into<crate::model::GetMirroringDeploymentRequest>>(
13423 mut self,
13424 v: V,
13425 ) -> Self {
13426 self.0.request = v.into();
13427 self
13428 }
13429
13430 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13432 self.0.options = v.into();
13433 self
13434 }
13435
13436 pub async fn send(self) -> Result<crate::model::MirroringDeployment> {
13438 (*self.0.stub)
13439 .get_mirroring_deployment(self.0.request, self.0.options)
13440 .await
13441 .map(crate::Response::into_body)
13442 }
13443
13444 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13448 self.0.request.name = v.into();
13449 self
13450 }
13451 }
13452
13453 #[doc(hidden)]
13454 impl crate::RequestBuilder for GetMirroringDeployment {
13455 fn request_options(&mut self) -> &mut crate::RequestOptions {
13456 &mut self.0.options
13457 }
13458 }
13459
13460 #[derive(Clone, Debug)]
13478 pub struct CreateMirroringDeployment(
13479 RequestBuilder<crate::model::CreateMirroringDeploymentRequest>,
13480 );
13481
13482 impl CreateMirroringDeployment {
13483 pub(crate) fn new(
13484 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13485 ) -> Self {
13486 Self(RequestBuilder::new(stub))
13487 }
13488
13489 pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentRequest>>(
13491 mut self,
13492 v: V,
13493 ) -> Self {
13494 self.0.request = v.into();
13495 self
13496 }
13497
13498 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13500 self.0.options = v.into();
13501 self
13502 }
13503
13504 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13511 (*self.0.stub)
13512 .create_mirroring_deployment(self.0.request, self.0.options)
13513 .await
13514 .map(crate::Response::into_body)
13515 }
13516
13517 pub fn poller(
13519 self,
13520 ) -> impl google_cloud_lro::Poller<
13521 crate::model::MirroringDeployment,
13522 crate::model::OperationMetadata,
13523 > {
13524 type Operation = google_cloud_lro::internal::Operation<
13525 crate::model::MirroringDeployment,
13526 crate::model::OperationMetadata,
13527 >;
13528 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13529 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13530 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13531 if let Some(ref mut details) = poller_options.tracing {
13532 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::create_mirroring_deployment::until_done";
13533 }
13534
13535 let stub = self.0.stub.clone();
13536 let mut options = self.0.options.clone();
13537 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13538 let query = move |name| {
13539 let stub = stub.clone();
13540 let options = options.clone();
13541 async {
13542 let op = GetOperation::new(stub)
13543 .set_name(name)
13544 .with_options(options)
13545 .send()
13546 .await?;
13547 Ok(Operation::new(op))
13548 }
13549 };
13550
13551 let start = move || async {
13552 let op = self.send().await?;
13553 Ok(Operation::new(op))
13554 };
13555
13556 use google_cloud_lro::internal::PollerExt;
13557 {
13558 google_cloud_lro::internal::new_poller(
13559 polling_error_policy,
13560 polling_backoff_policy,
13561 start,
13562 query,
13563 )
13564 }
13565 .with_options(poller_options)
13566 }
13567
13568 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13572 self.0.request.parent = v.into();
13573 self
13574 }
13575
13576 pub fn set_mirroring_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13580 self.0.request.mirroring_deployment_id = v.into();
13581 self
13582 }
13583
13584 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
13588 where
13589 T: std::convert::Into<crate::model::MirroringDeployment>,
13590 {
13591 self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
13592 self
13593 }
13594
13595 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
13599 where
13600 T: std::convert::Into<crate::model::MirroringDeployment>,
13601 {
13602 self.0.request.mirroring_deployment = v.map(|x| x.into());
13603 self
13604 }
13605
13606 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13608 self.0.request.request_id = v.into();
13609 self
13610 }
13611 }
13612
13613 #[doc(hidden)]
13614 impl crate::RequestBuilder for CreateMirroringDeployment {
13615 fn request_options(&mut self) -> &mut crate::RequestOptions {
13616 &mut self.0.options
13617 }
13618 }
13619
13620 #[derive(Clone, Debug)]
13638 pub struct UpdateMirroringDeployment(
13639 RequestBuilder<crate::model::UpdateMirroringDeploymentRequest>,
13640 );
13641
13642 impl UpdateMirroringDeployment {
13643 pub(crate) fn new(
13644 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13645 ) -> Self {
13646 Self(RequestBuilder::new(stub))
13647 }
13648
13649 pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentRequest>>(
13651 mut self,
13652 v: V,
13653 ) -> Self {
13654 self.0.request = v.into();
13655 self
13656 }
13657
13658 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13660 self.0.options = v.into();
13661 self
13662 }
13663
13664 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13671 (*self.0.stub)
13672 .update_mirroring_deployment(self.0.request, self.0.options)
13673 .await
13674 .map(crate::Response::into_body)
13675 }
13676
13677 pub fn poller(
13679 self,
13680 ) -> impl google_cloud_lro::Poller<
13681 crate::model::MirroringDeployment,
13682 crate::model::OperationMetadata,
13683 > {
13684 type Operation = google_cloud_lro::internal::Operation<
13685 crate::model::MirroringDeployment,
13686 crate::model::OperationMetadata,
13687 >;
13688 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13689 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13690 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13691 if let Some(ref mut details) = poller_options.tracing {
13692 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::update_mirroring_deployment::until_done";
13693 }
13694
13695 let stub = self.0.stub.clone();
13696 let mut options = self.0.options.clone();
13697 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13698 let query = move |name| {
13699 let stub = stub.clone();
13700 let options = options.clone();
13701 async {
13702 let op = GetOperation::new(stub)
13703 .set_name(name)
13704 .with_options(options)
13705 .send()
13706 .await?;
13707 Ok(Operation::new(op))
13708 }
13709 };
13710
13711 let start = move || async {
13712 let op = self.send().await?;
13713 Ok(Operation::new(op))
13714 };
13715
13716 use google_cloud_lro::internal::PollerExt;
13717 {
13718 google_cloud_lro::internal::new_poller(
13719 polling_error_policy,
13720 polling_backoff_policy,
13721 start,
13722 query,
13723 )
13724 }
13725 .with_options(poller_options)
13726 }
13727
13728 pub fn set_update_mask<T>(mut self, v: T) -> Self
13730 where
13731 T: std::convert::Into<wkt::FieldMask>,
13732 {
13733 self.0.request.update_mask = std::option::Option::Some(v.into());
13734 self
13735 }
13736
13737 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13739 where
13740 T: std::convert::Into<wkt::FieldMask>,
13741 {
13742 self.0.request.update_mask = v.map(|x| x.into());
13743 self
13744 }
13745
13746 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
13750 where
13751 T: std::convert::Into<crate::model::MirroringDeployment>,
13752 {
13753 self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
13754 self
13755 }
13756
13757 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
13761 where
13762 T: std::convert::Into<crate::model::MirroringDeployment>,
13763 {
13764 self.0.request.mirroring_deployment = v.map(|x| x.into());
13765 self
13766 }
13767
13768 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13770 self.0.request.request_id = v.into();
13771 self
13772 }
13773 }
13774
13775 #[doc(hidden)]
13776 impl crate::RequestBuilder for UpdateMirroringDeployment {
13777 fn request_options(&mut self) -> &mut crate::RequestOptions {
13778 &mut self.0.options
13779 }
13780 }
13781
13782 #[derive(Clone, Debug)]
13800 pub struct DeleteMirroringDeployment(
13801 RequestBuilder<crate::model::DeleteMirroringDeploymentRequest>,
13802 );
13803
13804 impl DeleteMirroringDeployment {
13805 pub(crate) fn new(
13806 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13807 ) -> Self {
13808 Self(RequestBuilder::new(stub))
13809 }
13810
13811 pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentRequest>>(
13813 mut self,
13814 v: V,
13815 ) -> Self {
13816 self.0.request = v.into();
13817 self
13818 }
13819
13820 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13822 self.0.options = v.into();
13823 self
13824 }
13825
13826 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13833 (*self.0.stub)
13834 .delete_mirroring_deployment(self.0.request, self.0.options)
13835 .await
13836 .map(crate::Response::into_body)
13837 }
13838
13839 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
13841 type Operation =
13842 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13843 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13844 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13845 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13846 if let Some(ref mut details) = poller_options.tracing {
13847 details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::delete_mirroring_deployment::until_done";
13848 }
13849
13850 let stub = self.0.stub.clone();
13851 let mut options = self.0.options.clone();
13852 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13853 let query = move |name| {
13854 let stub = stub.clone();
13855 let options = options.clone();
13856 async {
13857 let op = GetOperation::new(stub)
13858 .set_name(name)
13859 .with_options(options)
13860 .send()
13861 .await?;
13862 Ok(Operation::new(op))
13863 }
13864 };
13865
13866 let start = move || async {
13867 let op = self.send().await?;
13868 Ok(Operation::new(op))
13869 };
13870
13871 use google_cloud_lro::internal::PollerExt;
13872 {
13873 google_cloud_lro::internal::new_unit_response_poller(
13874 polling_error_policy,
13875 polling_backoff_policy,
13876 start,
13877 query,
13878 )
13879 }
13880 .with_options(poller_options)
13881 }
13882
13883 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13887 self.0.request.name = v.into();
13888 self
13889 }
13890
13891 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13893 self.0.request.request_id = v.into();
13894 self
13895 }
13896 }
13897
13898 #[doc(hidden)]
13899 impl crate::RequestBuilder for DeleteMirroringDeployment {
13900 fn request_options(&mut self) -> &mut crate::RequestOptions {
13901 &mut self.0.options
13902 }
13903 }
13904
13905 #[derive(Clone, Debug)]
13926 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13927
13928 impl ListLocations {
13929 pub(crate) fn new(
13930 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13931 ) -> Self {
13932 Self(RequestBuilder::new(stub))
13933 }
13934
13935 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13937 mut self,
13938 v: V,
13939 ) -> Self {
13940 self.0.request = v.into();
13941 self
13942 }
13943
13944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13946 self.0.options = v.into();
13947 self
13948 }
13949
13950 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13952 (*self.0.stub)
13953 .list_locations(self.0.request, self.0.options)
13954 .await
13955 .map(crate::Response::into_body)
13956 }
13957
13958 pub fn by_page(
13960 self,
13961 ) -> impl google_cloud_gax::paginator::Paginator<
13962 google_cloud_location::model::ListLocationsResponse,
13963 crate::Error,
13964 > {
13965 use std::clone::Clone;
13966 let token = self.0.request.page_token.clone();
13967 let execute = move |token: String| {
13968 let mut builder = self.clone();
13969 builder.0.request = builder.0.request.set_page_token(token);
13970 builder.send()
13971 };
13972 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13973 }
13974
13975 pub fn by_item(
13977 self,
13978 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13979 google_cloud_location::model::ListLocationsResponse,
13980 crate::Error,
13981 > {
13982 use google_cloud_gax::paginator::Paginator;
13983 self.by_page().items()
13984 }
13985
13986 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13988 self.0.request.name = v.into();
13989 self
13990 }
13991
13992 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13994 self.0.request.filter = v.into();
13995 self
13996 }
13997
13998 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14000 self.0.request.page_size = v.into();
14001 self
14002 }
14003
14004 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14006 self.0.request.page_token = v.into();
14007 self
14008 }
14009 }
14010
14011 #[doc(hidden)]
14012 impl crate::RequestBuilder for ListLocations {
14013 fn request_options(&mut self) -> &mut crate::RequestOptions {
14014 &mut self.0.options
14015 }
14016 }
14017
14018 #[derive(Clone, Debug)]
14035 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14036
14037 impl GetLocation {
14038 pub(crate) fn new(
14039 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14040 ) -> Self {
14041 Self(RequestBuilder::new(stub))
14042 }
14043
14044 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14046 mut self,
14047 v: V,
14048 ) -> Self {
14049 self.0.request = v.into();
14050 self
14051 }
14052
14053 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14055 self.0.options = v.into();
14056 self
14057 }
14058
14059 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14061 (*self.0.stub)
14062 .get_location(self.0.request, self.0.options)
14063 .await
14064 .map(crate::Response::into_body)
14065 }
14066
14067 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14069 self.0.request.name = v.into();
14070 self
14071 }
14072 }
14073
14074 #[doc(hidden)]
14075 impl crate::RequestBuilder for GetLocation {
14076 fn request_options(&mut self) -> &mut crate::RequestOptions {
14077 &mut self.0.options
14078 }
14079 }
14080
14081 #[derive(Clone, Debug)]
14098 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
14099
14100 impl SetIamPolicy {
14101 pub(crate) fn new(
14102 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14103 ) -> Self {
14104 Self(RequestBuilder::new(stub))
14105 }
14106
14107 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
14109 mut self,
14110 v: V,
14111 ) -> Self {
14112 self.0.request = v.into();
14113 self
14114 }
14115
14116 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14118 self.0.options = v.into();
14119 self
14120 }
14121
14122 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
14124 (*self.0.stub)
14125 .set_iam_policy(self.0.request, self.0.options)
14126 .await
14127 .map(crate::Response::into_body)
14128 }
14129
14130 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14134 self.0.request.resource = v.into();
14135 self
14136 }
14137
14138 pub fn set_policy<T>(mut self, v: T) -> Self
14142 where
14143 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
14144 {
14145 self.0.request.policy = std::option::Option::Some(v.into());
14146 self
14147 }
14148
14149 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
14153 where
14154 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
14155 {
14156 self.0.request.policy = v.map(|x| x.into());
14157 self
14158 }
14159
14160 pub fn set_update_mask<T>(mut self, v: T) -> Self
14162 where
14163 T: std::convert::Into<wkt::FieldMask>,
14164 {
14165 self.0.request.update_mask = std::option::Option::Some(v.into());
14166 self
14167 }
14168
14169 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14171 where
14172 T: std::convert::Into<wkt::FieldMask>,
14173 {
14174 self.0.request.update_mask = v.map(|x| x.into());
14175 self
14176 }
14177 }
14178
14179 #[doc(hidden)]
14180 impl crate::RequestBuilder for SetIamPolicy {
14181 fn request_options(&mut self) -> &mut crate::RequestOptions {
14182 &mut self.0.options
14183 }
14184 }
14185
14186 #[derive(Clone, Debug)]
14203 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
14204
14205 impl GetIamPolicy {
14206 pub(crate) fn new(
14207 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14208 ) -> Self {
14209 Self(RequestBuilder::new(stub))
14210 }
14211
14212 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
14214 mut self,
14215 v: V,
14216 ) -> Self {
14217 self.0.request = v.into();
14218 self
14219 }
14220
14221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14223 self.0.options = v.into();
14224 self
14225 }
14226
14227 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
14229 (*self.0.stub)
14230 .get_iam_policy(self.0.request, self.0.options)
14231 .await
14232 .map(crate::Response::into_body)
14233 }
14234
14235 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14239 self.0.request.resource = v.into();
14240 self
14241 }
14242
14243 pub fn set_options<T>(mut self, v: T) -> Self
14245 where
14246 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
14247 {
14248 self.0.request.options = std::option::Option::Some(v.into());
14249 self
14250 }
14251
14252 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
14254 where
14255 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
14256 {
14257 self.0.request.options = v.map(|x| x.into());
14258 self
14259 }
14260 }
14261
14262 #[doc(hidden)]
14263 impl crate::RequestBuilder for GetIamPolicy {
14264 fn request_options(&mut self) -> &mut crate::RequestOptions {
14265 &mut self.0.options
14266 }
14267 }
14268
14269 #[derive(Clone, Debug)]
14286 pub struct TestIamPermissions(
14287 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
14288 );
14289
14290 impl TestIamPermissions {
14291 pub(crate) fn new(
14292 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14293 ) -> Self {
14294 Self(RequestBuilder::new(stub))
14295 }
14296
14297 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
14299 mut self,
14300 v: V,
14301 ) -> Self {
14302 self.0.request = v.into();
14303 self
14304 }
14305
14306 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14308 self.0.options = v.into();
14309 self
14310 }
14311
14312 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
14314 (*self.0.stub)
14315 .test_iam_permissions(self.0.request, self.0.options)
14316 .await
14317 .map(crate::Response::into_body)
14318 }
14319
14320 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14324 self.0.request.resource = v.into();
14325 self
14326 }
14327
14328 pub fn set_permissions<T, V>(mut self, v: T) -> Self
14332 where
14333 T: std::iter::IntoIterator<Item = V>,
14334 V: std::convert::Into<std::string::String>,
14335 {
14336 use std::iter::Iterator;
14337 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
14338 self
14339 }
14340 }
14341
14342 #[doc(hidden)]
14343 impl crate::RequestBuilder for TestIamPermissions {
14344 fn request_options(&mut self) -> &mut crate::RequestOptions {
14345 &mut self.0.options
14346 }
14347 }
14348
14349 #[derive(Clone, Debug)]
14370 pub struct ListOperations(
14371 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14372 );
14373
14374 impl ListOperations {
14375 pub(crate) fn new(
14376 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14377 ) -> Self {
14378 Self(RequestBuilder::new(stub))
14379 }
14380
14381 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14383 mut self,
14384 v: V,
14385 ) -> Self {
14386 self.0.request = v.into();
14387 self
14388 }
14389
14390 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14392 self.0.options = v.into();
14393 self
14394 }
14395
14396 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14398 (*self.0.stub)
14399 .list_operations(self.0.request, self.0.options)
14400 .await
14401 .map(crate::Response::into_body)
14402 }
14403
14404 pub fn by_page(
14406 self,
14407 ) -> impl google_cloud_gax::paginator::Paginator<
14408 google_cloud_longrunning::model::ListOperationsResponse,
14409 crate::Error,
14410 > {
14411 use std::clone::Clone;
14412 let token = self.0.request.page_token.clone();
14413 let execute = move |token: String| {
14414 let mut builder = self.clone();
14415 builder.0.request = builder.0.request.set_page_token(token);
14416 builder.send()
14417 };
14418 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14419 }
14420
14421 pub fn by_item(
14423 self,
14424 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14425 google_cloud_longrunning::model::ListOperationsResponse,
14426 crate::Error,
14427 > {
14428 use google_cloud_gax::paginator::Paginator;
14429 self.by_page().items()
14430 }
14431
14432 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14434 self.0.request.name = v.into();
14435 self
14436 }
14437
14438 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14440 self.0.request.filter = v.into();
14441 self
14442 }
14443
14444 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14446 self.0.request.page_size = v.into();
14447 self
14448 }
14449
14450 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14452 self.0.request.page_token = v.into();
14453 self
14454 }
14455
14456 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14458 self.0.request.return_partial_success = v.into();
14459 self
14460 }
14461 }
14462
14463 #[doc(hidden)]
14464 impl crate::RequestBuilder for ListOperations {
14465 fn request_options(&mut self) -> &mut crate::RequestOptions {
14466 &mut self.0.options
14467 }
14468 }
14469
14470 #[derive(Clone, Debug)]
14487 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14488
14489 impl GetOperation {
14490 pub(crate) fn new(
14491 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14492 ) -> Self {
14493 Self(RequestBuilder::new(stub))
14494 }
14495
14496 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14498 mut self,
14499 v: V,
14500 ) -> Self {
14501 self.0.request = v.into();
14502 self
14503 }
14504
14505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14507 self.0.options = v.into();
14508 self
14509 }
14510
14511 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14513 (*self.0.stub)
14514 .get_operation(self.0.request, self.0.options)
14515 .await
14516 .map(crate::Response::into_body)
14517 }
14518
14519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14521 self.0.request.name = v.into();
14522 self
14523 }
14524 }
14525
14526 #[doc(hidden)]
14527 impl crate::RequestBuilder for GetOperation {
14528 fn request_options(&mut self) -> &mut crate::RequestOptions {
14529 &mut self.0.options
14530 }
14531 }
14532
14533 #[derive(Clone, Debug)]
14550 pub struct DeleteOperation(
14551 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
14552 );
14553
14554 impl DeleteOperation {
14555 pub(crate) fn new(
14556 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14557 ) -> Self {
14558 Self(RequestBuilder::new(stub))
14559 }
14560
14561 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
14563 mut self,
14564 v: V,
14565 ) -> Self {
14566 self.0.request = v.into();
14567 self
14568 }
14569
14570 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14572 self.0.options = v.into();
14573 self
14574 }
14575
14576 pub async fn send(self) -> Result<()> {
14578 (*self.0.stub)
14579 .delete_operation(self.0.request, self.0.options)
14580 .await
14581 .map(crate::Response::into_body)
14582 }
14583
14584 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14586 self.0.request.name = v.into();
14587 self
14588 }
14589 }
14590
14591 #[doc(hidden)]
14592 impl crate::RequestBuilder for DeleteOperation {
14593 fn request_options(&mut self) -> &mut crate::RequestOptions {
14594 &mut self.0.options
14595 }
14596 }
14597
14598 #[derive(Clone, Debug)]
14615 pub struct CancelOperation(
14616 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14617 );
14618
14619 impl CancelOperation {
14620 pub(crate) fn new(
14621 stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14622 ) -> Self {
14623 Self(RequestBuilder::new(stub))
14624 }
14625
14626 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14628 mut self,
14629 v: V,
14630 ) -> Self {
14631 self.0.request = v.into();
14632 self
14633 }
14634
14635 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14637 self.0.options = v.into();
14638 self
14639 }
14640
14641 pub async fn send(self) -> Result<()> {
14643 (*self.0.stub)
14644 .cancel_operation(self.0.request, self.0.options)
14645 .await
14646 .map(crate::Response::into_body)
14647 }
14648
14649 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14651 self.0.request.name = v.into();
14652 self
14653 }
14654 }
14655
14656 #[doc(hidden)]
14657 impl crate::RequestBuilder for CancelOperation {
14658 fn request_options(&mut self) -> &mut crate::RequestOptions {
14659 &mut self.0.options
14660 }
14661 }
14662}
14663
14664pub mod network_security {
14666 use crate::Result;
14667
14668 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14682
14683 pub(crate) mod client {
14684 use super::super::super::client::NetworkSecurity;
14685 pub struct Factory;
14686 impl crate::ClientFactory for Factory {
14687 type Client = NetworkSecurity;
14688 type Credentials = gaxi::options::Credentials;
14689 async fn build(
14690 self,
14691 config: gaxi::options::ClientConfig,
14692 ) -> crate::ClientBuilderResult<Self::Client> {
14693 Self::Client::new(config).await
14694 }
14695 }
14696 }
14697
14698 #[derive(Clone, Debug)]
14700 pub(crate) struct RequestBuilder<R: std::default::Default> {
14701 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14702 request: R,
14703 options: crate::RequestOptions,
14704 }
14705
14706 impl<R> RequestBuilder<R>
14707 where
14708 R: std::default::Default,
14709 {
14710 pub(crate) fn new(
14711 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14712 ) -> Self {
14713 Self {
14714 stub,
14715 request: R::default(),
14716 options: crate::RequestOptions::default(),
14717 }
14718 }
14719 }
14720
14721 #[derive(Clone, Debug)]
14742 pub struct ListAuthorizationPolicies(
14743 RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
14744 );
14745
14746 impl ListAuthorizationPolicies {
14747 pub(crate) fn new(
14748 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14749 ) -> Self {
14750 Self(RequestBuilder::new(stub))
14751 }
14752
14753 pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
14755 mut self,
14756 v: V,
14757 ) -> Self {
14758 self.0.request = v.into();
14759 self
14760 }
14761
14762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14764 self.0.options = v.into();
14765 self
14766 }
14767
14768 pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
14770 (*self.0.stub)
14771 .list_authorization_policies(self.0.request, self.0.options)
14772 .await
14773 .map(crate::Response::into_body)
14774 }
14775
14776 pub fn by_page(
14778 self,
14779 ) -> impl google_cloud_gax::paginator::Paginator<
14780 crate::model::ListAuthorizationPoliciesResponse,
14781 crate::Error,
14782 > {
14783 use std::clone::Clone;
14784 let token = self.0.request.page_token.clone();
14785 let execute = move |token: String| {
14786 let mut builder = self.clone();
14787 builder.0.request = builder.0.request.set_page_token(token);
14788 builder.send()
14789 };
14790 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14791 }
14792
14793 pub fn by_item(
14795 self,
14796 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14797 crate::model::ListAuthorizationPoliciesResponse,
14798 crate::Error,
14799 > {
14800 use google_cloud_gax::paginator::Paginator;
14801 self.by_page().items()
14802 }
14803
14804 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14808 self.0.request.parent = v.into();
14809 self
14810 }
14811
14812 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14814 self.0.request.page_size = v.into();
14815 self
14816 }
14817
14818 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14820 self.0.request.page_token = v.into();
14821 self
14822 }
14823 }
14824
14825 #[doc(hidden)]
14826 impl crate::RequestBuilder for ListAuthorizationPolicies {
14827 fn request_options(&mut self) -> &mut crate::RequestOptions {
14828 &mut self.0.options
14829 }
14830 }
14831
14832 #[derive(Clone, Debug)]
14849 pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
14850
14851 impl GetAuthorizationPolicy {
14852 pub(crate) fn new(
14853 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14854 ) -> Self {
14855 Self(RequestBuilder::new(stub))
14856 }
14857
14858 pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
14860 mut self,
14861 v: V,
14862 ) -> Self {
14863 self.0.request = v.into();
14864 self
14865 }
14866
14867 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14869 self.0.options = v.into();
14870 self
14871 }
14872
14873 pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
14875 (*self.0.stub)
14876 .get_authorization_policy(self.0.request, self.0.options)
14877 .await
14878 .map(crate::Response::into_body)
14879 }
14880
14881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14885 self.0.request.name = v.into();
14886 self
14887 }
14888 }
14889
14890 #[doc(hidden)]
14891 impl crate::RequestBuilder for GetAuthorizationPolicy {
14892 fn request_options(&mut self) -> &mut crate::RequestOptions {
14893 &mut self.0.options
14894 }
14895 }
14896
14897 #[derive(Clone, Debug)]
14915 pub struct CreateAuthorizationPolicy(
14916 RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
14917 );
14918
14919 impl CreateAuthorizationPolicy {
14920 pub(crate) fn new(
14921 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14922 ) -> Self {
14923 Self(RequestBuilder::new(stub))
14924 }
14925
14926 pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
14928 mut self,
14929 v: V,
14930 ) -> Self {
14931 self.0.request = v.into();
14932 self
14933 }
14934
14935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14937 self.0.options = v.into();
14938 self
14939 }
14940
14941 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14948 (*self.0.stub)
14949 .create_authorization_policy(self.0.request, self.0.options)
14950 .await
14951 .map(crate::Response::into_body)
14952 }
14953
14954 pub fn poller(
14956 self,
14957 ) -> impl google_cloud_lro::Poller<
14958 crate::model::AuthorizationPolicy,
14959 crate::model::OperationMetadata,
14960 > {
14961 type Operation = google_cloud_lro::internal::Operation<
14962 crate::model::AuthorizationPolicy,
14963 crate::model::OperationMetadata,
14964 >;
14965 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14966 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14967 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
14968 if let Some(ref mut details) = poller_options.tracing {
14969 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_authorization_policy::until_done";
14970 }
14971
14972 let stub = self.0.stub.clone();
14973 let mut options = self.0.options.clone();
14974 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14975 let query = move |name| {
14976 let stub = stub.clone();
14977 let options = options.clone();
14978 async {
14979 let op = GetOperation::new(stub)
14980 .set_name(name)
14981 .with_options(options)
14982 .send()
14983 .await?;
14984 Ok(Operation::new(op))
14985 }
14986 };
14987
14988 let start = move || async {
14989 let op = self.send().await?;
14990 Ok(Operation::new(op))
14991 };
14992
14993 use google_cloud_lro::internal::PollerExt;
14994 {
14995 google_cloud_lro::internal::new_poller(
14996 polling_error_policy,
14997 polling_backoff_policy,
14998 start,
14999 query,
15000 )
15001 }
15002 .with_options(poller_options)
15003 }
15004
15005 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15009 self.0.request.parent = v.into();
15010 self
15011 }
15012
15013 pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15017 self.0.request.authorization_policy_id = v.into();
15018 self
15019 }
15020
15021 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
15025 where
15026 T: std::convert::Into<crate::model::AuthorizationPolicy>,
15027 {
15028 self.0.request.authorization_policy = std::option::Option::Some(v.into());
15029 self
15030 }
15031
15032 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
15036 where
15037 T: std::convert::Into<crate::model::AuthorizationPolicy>,
15038 {
15039 self.0.request.authorization_policy = v.map(|x| x.into());
15040 self
15041 }
15042 }
15043
15044 #[doc(hidden)]
15045 impl crate::RequestBuilder for CreateAuthorizationPolicy {
15046 fn request_options(&mut self) -> &mut crate::RequestOptions {
15047 &mut self.0.options
15048 }
15049 }
15050
15051 #[derive(Clone, Debug)]
15069 pub struct UpdateAuthorizationPolicy(
15070 RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
15071 );
15072
15073 impl UpdateAuthorizationPolicy {
15074 pub(crate) fn new(
15075 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15076 ) -> Self {
15077 Self(RequestBuilder::new(stub))
15078 }
15079
15080 pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
15082 mut self,
15083 v: V,
15084 ) -> Self {
15085 self.0.request = v.into();
15086 self
15087 }
15088
15089 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15091 self.0.options = v.into();
15092 self
15093 }
15094
15095 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15102 (*self.0.stub)
15103 .update_authorization_policy(self.0.request, self.0.options)
15104 .await
15105 .map(crate::Response::into_body)
15106 }
15107
15108 pub fn poller(
15110 self,
15111 ) -> impl google_cloud_lro::Poller<
15112 crate::model::AuthorizationPolicy,
15113 crate::model::OperationMetadata,
15114 > {
15115 type Operation = google_cloud_lro::internal::Operation<
15116 crate::model::AuthorizationPolicy,
15117 crate::model::OperationMetadata,
15118 >;
15119 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15120 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15121 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15122 if let Some(ref mut details) = poller_options.tracing {
15123 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_authorization_policy::until_done";
15124 }
15125
15126 let stub = self.0.stub.clone();
15127 let mut options = self.0.options.clone();
15128 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15129 let query = move |name| {
15130 let stub = stub.clone();
15131 let options = options.clone();
15132 async {
15133 let op = GetOperation::new(stub)
15134 .set_name(name)
15135 .with_options(options)
15136 .send()
15137 .await?;
15138 Ok(Operation::new(op))
15139 }
15140 };
15141
15142 let start = move || async {
15143 let op = self.send().await?;
15144 Ok(Operation::new(op))
15145 };
15146
15147 use google_cloud_lro::internal::PollerExt;
15148 {
15149 google_cloud_lro::internal::new_poller(
15150 polling_error_policy,
15151 polling_backoff_policy,
15152 start,
15153 query,
15154 )
15155 }
15156 .with_options(poller_options)
15157 }
15158
15159 pub fn set_update_mask<T>(mut self, v: T) -> Self
15161 where
15162 T: std::convert::Into<wkt::FieldMask>,
15163 {
15164 self.0.request.update_mask = std::option::Option::Some(v.into());
15165 self
15166 }
15167
15168 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15170 where
15171 T: std::convert::Into<wkt::FieldMask>,
15172 {
15173 self.0.request.update_mask = v.map(|x| x.into());
15174 self
15175 }
15176
15177 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
15181 where
15182 T: std::convert::Into<crate::model::AuthorizationPolicy>,
15183 {
15184 self.0.request.authorization_policy = std::option::Option::Some(v.into());
15185 self
15186 }
15187
15188 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
15192 where
15193 T: std::convert::Into<crate::model::AuthorizationPolicy>,
15194 {
15195 self.0.request.authorization_policy = v.map(|x| x.into());
15196 self
15197 }
15198 }
15199
15200 #[doc(hidden)]
15201 impl crate::RequestBuilder for UpdateAuthorizationPolicy {
15202 fn request_options(&mut self) -> &mut crate::RequestOptions {
15203 &mut self.0.options
15204 }
15205 }
15206
15207 #[derive(Clone, Debug)]
15225 pub struct DeleteAuthorizationPolicy(
15226 RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
15227 );
15228
15229 impl DeleteAuthorizationPolicy {
15230 pub(crate) fn new(
15231 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15232 ) -> Self {
15233 Self(RequestBuilder::new(stub))
15234 }
15235
15236 pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
15238 mut self,
15239 v: V,
15240 ) -> Self {
15241 self.0.request = v.into();
15242 self
15243 }
15244
15245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15247 self.0.options = v.into();
15248 self
15249 }
15250
15251 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15258 (*self.0.stub)
15259 .delete_authorization_policy(self.0.request, self.0.options)
15260 .await
15261 .map(crate::Response::into_body)
15262 }
15263
15264 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15266 type Operation =
15267 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15268 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15269 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15270 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15271 if let Some(ref mut details) = poller_options.tracing {
15272 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_authorization_policy::until_done";
15273 }
15274
15275 let stub = self.0.stub.clone();
15276 let mut options = self.0.options.clone();
15277 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15278 let query = move |name| {
15279 let stub = stub.clone();
15280 let options = options.clone();
15281 async {
15282 let op = GetOperation::new(stub)
15283 .set_name(name)
15284 .with_options(options)
15285 .send()
15286 .await?;
15287 Ok(Operation::new(op))
15288 }
15289 };
15290
15291 let start = move || async {
15292 let op = self.send().await?;
15293 Ok(Operation::new(op))
15294 };
15295
15296 use google_cloud_lro::internal::PollerExt;
15297 {
15298 google_cloud_lro::internal::new_unit_response_poller(
15299 polling_error_policy,
15300 polling_backoff_policy,
15301 start,
15302 query,
15303 )
15304 }
15305 .with_options(poller_options)
15306 }
15307
15308 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15312 self.0.request.name = v.into();
15313 self
15314 }
15315 }
15316
15317 #[doc(hidden)]
15318 impl crate::RequestBuilder for DeleteAuthorizationPolicy {
15319 fn request_options(&mut self) -> &mut crate::RequestOptions {
15320 &mut self.0.options
15321 }
15322 }
15323
15324 #[derive(Clone, Debug)]
15345 pub struct ListBackendAuthenticationConfigs(
15346 RequestBuilder<crate::model::ListBackendAuthenticationConfigsRequest>,
15347 );
15348
15349 impl ListBackendAuthenticationConfigs {
15350 pub(crate) fn new(
15351 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15352 ) -> Self {
15353 Self(RequestBuilder::new(stub))
15354 }
15355
15356 pub fn with_request<V: Into<crate::model::ListBackendAuthenticationConfigsRequest>>(
15358 mut self,
15359 v: V,
15360 ) -> Self {
15361 self.0.request = v.into();
15362 self
15363 }
15364
15365 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15367 self.0.options = v.into();
15368 self
15369 }
15370
15371 pub async fn send(self) -> Result<crate::model::ListBackendAuthenticationConfigsResponse> {
15373 (*self.0.stub)
15374 .list_backend_authentication_configs(self.0.request, self.0.options)
15375 .await
15376 .map(crate::Response::into_body)
15377 }
15378
15379 pub fn by_page(
15381 self,
15382 ) -> impl google_cloud_gax::paginator::Paginator<
15383 crate::model::ListBackendAuthenticationConfigsResponse,
15384 crate::Error,
15385 > {
15386 use std::clone::Clone;
15387 let token = self.0.request.page_token.clone();
15388 let execute = move |token: String| {
15389 let mut builder = self.clone();
15390 builder.0.request = builder.0.request.set_page_token(token);
15391 builder.send()
15392 };
15393 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15394 }
15395
15396 pub fn by_item(
15398 self,
15399 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15400 crate::model::ListBackendAuthenticationConfigsResponse,
15401 crate::Error,
15402 > {
15403 use google_cloud_gax::paginator::Paginator;
15404 self.by_page().items()
15405 }
15406
15407 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15411 self.0.request.parent = v.into();
15412 self
15413 }
15414
15415 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15417 self.0.request.page_size = v.into();
15418 self
15419 }
15420
15421 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15423 self.0.request.page_token = v.into();
15424 self
15425 }
15426 }
15427
15428 #[doc(hidden)]
15429 impl crate::RequestBuilder for ListBackendAuthenticationConfigs {
15430 fn request_options(&mut self) -> &mut crate::RequestOptions {
15431 &mut self.0.options
15432 }
15433 }
15434
15435 #[derive(Clone, Debug)]
15452 pub struct GetBackendAuthenticationConfig(
15453 RequestBuilder<crate::model::GetBackendAuthenticationConfigRequest>,
15454 );
15455
15456 impl GetBackendAuthenticationConfig {
15457 pub(crate) fn new(
15458 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15459 ) -> Self {
15460 Self(RequestBuilder::new(stub))
15461 }
15462
15463 pub fn with_request<V: Into<crate::model::GetBackendAuthenticationConfigRequest>>(
15465 mut self,
15466 v: V,
15467 ) -> Self {
15468 self.0.request = v.into();
15469 self
15470 }
15471
15472 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15474 self.0.options = v.into();
15475 self
15476 }
15477
15478 pub async fn send(self) -> Result<crate::model::BackendAuthenticationConfig> {
15480 (*self.0.stub)
15481 .get_backend_authentication_config(self.0.request, self.0.options)
15482 .await
15483 .map(crate::Response::into_body)
15484 }
15485
15486 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15490 self.0.request.name = v.into();
15491 self
15492 }
15493 }
15494
15495 #[doc(hidden)]
15496 impl crate::RequestBuilder for GetBackendAuthenticationConfig {
15497 fn request_options(&mut self) -> &mut crate::RequestOptions {
15498 &mut self.0.options
15499 }
15500 }
15501
15502 #[derive(Clone, Debug)]
15520 pub struct CreateBackendAuthenticationConfig(
15521 RequestBuilder<crate::model::CreateBackendAuthenticationConfigRequest>,
15522 );
15523
15524 impl CreateBackendAuthenticationConfig {
15525 pub(crate) fn new(
15526 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15527 ) -> Self {
15528 Self(RequestBuilder::new(stub))
15529 }
15530
15531 pub fn with_request<V: Into<crate::model::CreateBackendAuthenticationConfigRequest>>(
15533 mut self,
15534 v: V,
15535 ) -> Self {
15536 self.0.request = v.into();
15537 self
15538 }
15539
15540 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15542 self.0.options = v.into();
15543 self
15544 }
15545
15546 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15553 (*self.0.stub)
15554 .create_backend_authentication_config(self.0.request, self.0.options)
15555 .await
15556 .map(crate::Response::into_body)
15557 }
15558
15559 pub fn poller(
15561 self,
15562 ) -> impl google_cloud_lro::Poller<
15563 crate::model::BackendAuthenticationConfig,
15564 crate::model::OperationMetadata,
15565 > {
15566 type Operation = google_cloud_lro::internal::Operation<
15567 crate::model::BackendAuthenticationConfig,
15568 crate::model::OperationMetadata,
15569 >;
15570 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15571 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15572 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15573 if let Some(ref mut details) = poller_options.tracing {
15574 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_backend_authentication_config::until_done";
15575 }
15576
15577 let stub = self.0.stub.clone();
15578 let mut options = self.0.options.clone();
15579 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15580 let query = move |name| {
15581 let stub = stub.clone();
15582 let options = options.clone();
15583 async {
15584 let op = GetOperation::new(stub)
15585 .set_name(name)
15586 .with_options(options)
15587 .send()
15588 .await?;
15589 Ok(Operation::new(op))
15590 }
15591 };
15592
15593 let start = move || async {
15594 let op = self.send().await?;
15595 Ok(Operation::new(op))
15596 };
15597
15598 use google_cloud_lro::internal::PollerExt;
15599 {
15600 google_cloud_lro::internal::new_poller(
15601 polling_error_policy,
15602 polling_backoff_policy,
15603 start,
15604 query,
15605 )
15606 }
15607 .with_options(poller_options)
15608 }
15609
15610 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15614 self.0.request.parent = v.into();
15615 self
15616 }
15617
15618 pub fn set_backend_authentication_config_id<T: Into<std::string::String>>(
15622 mut self,
15623 v: T,
15624 ) -> Self {
15625 self.0.request.backend_authentication_config_id = v.into();
15626 self
15627 }
15628
15629 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
15633 where
15634 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15635 {
15636 self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
15637 self
15638 }
15639
15640 pub fn set_or_clear_backend_authentication_config<T>(
15644 mut self,
15645 v: std::option::Option<T>,
15646 ) -> Self
15647 where
15648 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15649 {
15650 self.0.request.backend_authentication_config = v.map(|x| x.into());
15651 self
15652 }
15653 }
15654
15655 #[doc(hidden)]
15656 impl crate::RequestBuilder for CreateBackendAuthenticationConfig {
15657 fn request_options(&mut self) -> &mut crate::RequestOptions {
15658 &mut self.0.options
15659 }
15660 }
15661
15662 #[derive(Clone, Debug)]
15680 pub struct UpdateBackendAuthenticationConfig(
15681 RequestBuilder<crate::model::UpdateBackendAuthenticationConfigRequest>,
15682 );
15683
15684 impl UpdateBackendAuthenticationConfig {
15685 pub(crate) fn new(
15686 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15687 ) -> Self {
15688 Self(RequestBuilder::new(stub))
15689 }
15690
15691 pub fn with_request<V: Into<crate::model::UpdateBackendAuthenticationConfigRequest>>(
15693 mut self,
15694 v: V,
15695 ) -> Self {
15696 self.0.request = v.into();
15697 self
15698 }
15699
15700 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15702 self.0.options = v.into();
15703 self
15704 }
15705
15706 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15713 (*self.0.stub)
15714 .update_backend_authentication_config(self.0.request, self.0.options)
15715 .await
15716 .map(crate::Response::into_body)
15717 }
15718
15719 pub fn poller(
15721 self,
15722 ) -> impl google_cloud_lro::Poller<
15723 crate::model::BackendAuthenticationConfig,
15724 crate::model::OperationMetadata,
15725 > {
15726 type Operation = google_cloud_lro::internal::Operation<
15727 crate::model::BackendAuthenticationConfig,
15728 crate::model::OperationMetadata,
15729 >;
15730 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15731 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15732 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15733 if let Some(ref mut details) = poller_options.tracing {
15734 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_backend_authentication_config::until_done";
15735 }
15736
15737 let stub = self.0.stub.clone();
15738 let mut options = self.0.options.clone();
15739 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15740 let query = move |name| {
15741 let stub = stub.clone();
15742 let options = options.clone();
15743 async {
15744 let op = GetOperation::new(stub)
15745 .set_name(name)
15746 .with_options(options)
15747 .send()
15748 .await?;
15749 Ok(Operation::new(op))
15750 }
15751 };
15752
15753 let start = move || async {
15754 let op = self.send().await?;
15755 Ok(Operation::new(op))
15756 };
15757
15758 use google_cloud_lro::internal::PollerExt;
15759 {
15760 google_cloud_lro::internal::new_poller(
15761 polling_error_policy,
15762 polling_backoff_policy,
15763 start,
15764 query,
15765 )
15766 }
15767 .with_options(poller_options)
15768 }
15769
15770 pub fn set_update_mask<T>(mut self, v: T) -> Self
15772 where
15773 T: std::convert::Into<wkt::FieldMask>,
15774 {
15775 self.0.request.update_mask = std::option::Option::Some(v.into());
15776 self
15777 }
15778
15779 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15781 where
15782 T: std::convert::Into<wkt::FieldMask>,
15783 {
15784 self.0.request.update_mask = v.map(|x| x.into());
15785 self
15786 }
15787
15788 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
15792 where
15793 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15794 {
15795 self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
15796 self
15797 }
15798
15799 pub fn set_or_clear_backend_authentication_config<T>(
15803 mut self,
15804 v: std::option::Option<T>,
15805 ) -> Self
15806 where
15807 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15808 {
15809 self.0.request.backend_authentication_config = v.map(|x| x.into());
15810 self
15811 }
15812 }
15813
15814 #[doc(hidden)]
15815 impl crate::RequestBuilder for UpdateBackendAuthenticationConfig {
15816 fn request_options(&mut self) -> &mut crate::RequestOptions {
15817 &mut self.0.options
15818 }
15819 }
15820
15821 #[derive(Clone, Debug)]
15839 pub struct DeleteBackendAuthenticationConfig(
15840 RequestBuilder<crate::model::DeleteBackendAuthenticationConfigRequest>,
15841 );
15842
15843 impl DeleteBackendAuthenticationConfig {
15844 pub(crate) fn new(
15845 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15846 ) -> Self {
15847 Self(RequestBuilder::new(stub))
15848 }
15849
15850 pub fn with_request<V: Into<crate::model::DeleteBackendAuthenticationConfigRequest>>(
15852 mut self,
15853 v: V,
15854 ) -> Self {
15855 self.0.request = v.into();
15856 self
15857 }
15858
15859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15861 self.0.options = v.into();
15862 self
15863 }
15864
15865 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15872 (*self.0.stub)
15873 .delete_backend_authentication_config(self.0.request, self.0.options)
15874 .await
15875 .map(crate::Response::into_body)
15876 }
15877
15878 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15880 type Operation =
15881 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15882 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15883 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15884 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15885 if let Some(ref mut details) = poller_options.tracing {
15886 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_backend_authentication_config::until_done";
15887 }
15888
15889 let stub = self.0.stub.clone();
15890 let mut options = self.0.options.clone();
15891 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15892 let query = move |name| {
15893 let stub = stub.clone();
15894 let options = options.clone();
15895 async {
15896 let op = GetOperation::new(stub)
15897 .set_name(name)
15898 .with_options(options)
15899 .send()
15900 .await?;
15901 Ok(Operation::new(op))
15902 }
15903 };
15904
15905 let start = move || async {
15906 let op = self.send().await?;
15907 Ok(Operation::new(op))
15908 };
15909
15910 use google_cloud_lro::internal::PollerExt;
15911 {
15912 google_cloud_lro::internal::new_unit_response_poller(
15913 polling_error_policy,
15914 polling_backoff_policy,
15915 start,
15916 query,
15917 )
15918 }
15919 .with_options(poller_options)
15920 }
15921
15922 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15926 self.0.request.name = v.into();
15927 self
15928 }
15929
15930 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
15932 self.0.request.etag = v.into();
15933 self
15934 }
15935 }
15936
15937 #[doc(hidden)]
15938 impl crate::RequestBuilder for DeleteBackendAuthenticationConfig {
15939 fn request_options(&mut self) -> &mut crate::RequestOptions {
15940 &mut self.0.options
15941 }
15942 }
15943
15944 #[derive(Clone, Debug)]
15965 pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
15966
15967 impl ListServerTlsPolicies {
15968 pub(crate) fn new(
15969 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15970 ) -> Self {
15971 Self(RequestBuilder::new(stub))
15972 }
15973
15974 pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
15976 mut self,
15977 v: V,
15978 ) -> Self {
15979 self.0.request = v.into();
15980 self
15981 }
15982
15983 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15985 self.0.options = v.into();
15986 self
15987 }
15988
15989 pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
15991 (*self.0.stub)
15992 .list_server_tls_policies(self.0.request, self.0.options)
15993 .await
15994 .map(crate::Response::into_body)
15995 }
15996
15997 pub fn by_page(
15999 self,
16000 ) -> impl google_cloud_gax::paginator::Paginator<
16001 crate::model::ListServerTlsPoliciesResponse,
16002 crate::Error,
16003 > {
16004 use std::clone::Clone;
16005 let token = self.0.request.page_token.clone();
16006 let execute = move |token: String| {
16007 let mut builder = self.clone();
16008 builder.0.request = builder.0.request.set_page_token(token);
16009 builder.send()
16010 };
16011 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16012 }
16013
16014 pub fn by_item(
16016 self,
16017 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16018 crate::model::ListServerTlsPoliciesResponse,
16019 crate::Error,
16020 > {
16021 use google_cloud_gax::paginator::Paginator;
16022 self.by_page().items()
16023 }
16024
16025 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16029 self.0.request.parent = v.into();
16030 self
16031 }
16032
16033 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16035 self.0.request.page_size = v.into();
16036 self
16037 }
16038
16039 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16041 self.0.request.page_token = v.into();
16042 self
16043 }
16044
16045 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16047 self.0.request.return_partial_success = v.into();
16048 self
16049 }
16050 }
16051
16052 #[doc(hidden)]
16053 impl crate::RequestBuilder for ListServerTlsPolicies {
16054 fn request_options(&mut self) -> &mut crate::RequestOptions {
16055 &mut self.0.options
16056 }
16057 }
16058
16059 #[derive(Clone, Debug)]
16076 pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
16077
16078 impl GetServerTlsPolicy {
16079 pub(crate) fn new(
16080 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16081 ) -> Self {
16082 Self(RequestBuilder::new(stub))
16083 }
16084
16085 pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
16087 mut self,
16088 v: V,
16089 ) -> Self {
16090 self.0.request = v.into();
16091 self
16092 }
16093
16094 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16096 self.0.options = v.into();
16097 self
16098 }
16099
16100 pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
16102 (*self.0.stub)
16103 .get_server_tls_policy(self.0.request, self.0.options)
16104 .await
16105 .map(crate::Response::into_body)
16106 }
16107
16108 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16112 self.0.request.name = v.into();
16113 self
16114 }
16115 }
16116
16117 #[doc(hidden)]
16118 impl crate::RequestBuilder for GetServerTlsPolicy {
16119 fn request_options(&mut self) -> &mut crate::RequestOptions {
16120 &mut self.0.options
16121 }
16122 }
16123
16124 #[derive(Clone, Debug)]
16142 pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
16143
16144 impl CreateServerTlsPolicy {
16145 pub(crate) fn new(
16146 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16147 ) -> Self {
16148 Self(RequestBuilder::new(stub))
16149 }
16150
16151 pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
16153 mut self,
16154 v: V,
16155 ) -> Self {
16156 self.0.request = v.into();
16157 self
16158 }
16159
16160 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16162 self.0.options = v.into();
16163 self
16164 }
16165
16166 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16173 (*self.0.stub)
16174 .create_server_tls_policy(self.0.request, self.0.options)
16175 .await
16176 .map(crate::Response::into_body)
16177 }
16178
16179 pub fn poller(
16181 self,
16182 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
16183 {
16184 type Operation = google_cloud_lro::internal::Operation<
16185 crate::model::ServerTlsPolicy,
16186 crate::model::OperationMetadata,
16187 >;
16188 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16189 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16190 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16191 if let Some(ref mut details) = poller_options.tracing {
16192 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_server_tls_policy::until_done";
16193 }
16194
16195 let stub = self.0.stub.clone();
16196 let mut options = self.0.options.clone();
16197 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16198 let query = move |name| {
16199 let stub = stub.clone();
16200 let options = options.clone();
16201 async {
16202 let op = GetOperation::new(stub)
16203 .set_name(name)
16204 .with_options(options)
16205 .send()
16206 .await?;
16207 Ok(Operation::new(op))
16208 }
16209 };
16210
16211 let start = move || async {
16212 let op = self.send().await?;
16213 Ok(Operation::new(op))
16214 };
16215
16216 use google_cloud_lro::internal::PollerExt;
16217 {
16218 google_cloud_lro::internal::new_poller(
16219 polling_error_policy,
16220 polling_backoff_policy,
16221 start,
16222 query,
16223 )
16224 }
16225 .with_options(poller_options)
16226 }
16227
16228 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16232 self.0.request.parent = v.into();
16233 self
16234 }
16235
16236 pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16240 self.0.request.server_tls_policy_id = v.into();
16241 self
16242 }
16243
16244 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
16248 where
16249 T: std::convert::Into<crate::model::ServerTlsPolicy>,
16250 {
16251 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
16252 self
16253 }
16254
16255 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16259 where
16260 T: std::convert::Into<crate::model::ServerTlsPolicy>,
16261 {
16262 self.0.request.server_tls_policy = v.map(|x| x.into());
16263 self
16264 }
16265 }
16266
16267 #[doc(hidden)]
16268 impl crate::RequestBuilder for CreateServerTlsPolicy {
16269 fn request_options(&mut self) -> &mut crate::RequestOptions {
16270 &mut self.0.options
16271 }
16272 }
16273
16274 #[derive(Clone, Debug)]
16292 pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
16293
16294 impl UpdateServerTlsPolicy {
16295 pub(crate) fn new(
16296 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16297 ) -> Self {
16298 Self(RequestBuilder::new(stub))
16299 }
16300
16301 pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
16303 mut self,
16304 v: V,
16305 ) -> Self {
16306 self.0.request = v.into();
16307 self
16308 }
16309
16310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16312 self.0.options = v.into();
16313 self
16314 }
16315
16316 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16323 (*self.0.stub)
16324 .update_server_tls_policy(self.0.request, self.0.options)
16325 .await
16326 .map(crate::Response::into_body)
16327 }
16328
16329 pub fn poller(
16331 self,
16332 ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
16333 {
16334 type Operation = google_cloud_lro::internal::Operation<
16335 crate::model::ServerTlsPolicy,
16336 crate::model::OperationMetadata,
16337 >;
16338 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16339 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16340 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16341 if let Some(ref mut details) = poller_options.tracing {
16342 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_server_tls_policy::until_done";
16343 }
16344
16345 let stub = self.0.stub.clone();
16346 let mut options = self.0.options.clone();
16347 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16348 let query = move |name| {
16349 let stub = stub.clone();
16350 let options = options.clone();
16351 async {
16352 let op = GetOperation::new(stub)
16353 .set_name(name)
16354 .with_options(options)
16355 .send()
16356 .await?;
16357 Ok(Operation::new(op))
16358 }
16359 };
16360
16361 let start = move || async {
16362 let op = self.send().await?;
16363 Ok(Operation::new(op))
16364 };
16365
16366 use google_cloud_lro::internal::PollerExt;
16367 {
16368 google_cloud_lro::internal::new_poller(
16369 polling_error_policy,
16370 polling_backoff_policy,
16371 start,
16372 query,
16373 )
16374 }
16375 .with_options(poller_options)
16376 }
16377
16378 pub fn set_update_mask<T>(mut self, v: T) -> Self
16380 where
16381 T: std::convert::Into<wkt::FieldMask>,
16382 {
16383 self.0.request.update_mask = std::option::Option::Some(v.into());
16384 self
16385 }
16386
16387 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16389 where
16390 T: std::convert::Into<wkt::FieldMask>,
16391 {
16392 self.0.request.update_mask = v.map(|x| x.into());
16393 self
16394 }
16395
16396 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
16400 where
16401 T: std::convert::Into<crate::model::ServerTlsPolicy>,
16402 {
16403 self.0.request.server_tls_policy = std::option::Option::Some(v.into());
16404 self
16405 }
16406
16407 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16411 where
16412 T: std::convert::Into<crate::model::ServerTlsPolicy>,
16413 {
16414 self.0.request.server_tls_policy = v.map(|x| x.into());
16415 self
16416 }
16417 }
16418
16419 #[doc(hidden)]
16420 impl crate::RequestBuilder for UpdateServerTlsPolicy {
16421 fn request_options(&mut self) -> &mut crate::RequestOptions {
16422 &mut self.0.options
16423 }
16424 }
16425
16426 #[derive(Clone, Debug)]
16444 pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
16445
16446 impl DeleteServerTlsPolicy {
16447 pub(crate) fn new(
16448 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16449 ) -> Self {
16450 Self(RequestBuilder::new(stub))
16451 }
16452
16453 pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
16455 mut self,
16456 v: V,
16457 ) -> Self {
16458 self.0.request = v.into();
16459 self
16460 }
16461
16462 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16464 self.0.options = v.into();
16465 self
16466 }
16467
16468 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16475 (*self.0.stub)
16476 .delete_server_tls_policy(self.0.request, self.0.options)
16477 .await
16478 .map(crate::Response::into_body)
16479 }
16480
16481 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16483 type Operation =
16484 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16485 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16486 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16487 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16488 if let Some(ref mut details) = poller_options.tracing {
16489 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_server_tls_policy::until_done";
16490 }
16491
16492 let stub = self.0.stub.clone();
16493 let mut options = self.0.options.clone();
16494 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16495 let query = move |name| {
16496 let stub = stub.clone();
16497 let options = options.clone();
16498 async {
16499 let op = GetOperation::new(stub)
16500 .set_name(name)
16501 .with_options(options)
16502 .send()
16503 .await?;
16504 Ok(Operation::new(op))
16505 }
16506 };
16507
16508 let start = move || async {
16509 let op = self.send().await?;
16510 Ok(Operation::new(op))
16511 };
16512
16513 use google_cloud_lro::internal::PollerExt;
16514 {
16515 google_cloud_lro::internal::new_unit_response_poller(
16516 polling_error_policy,
16517 polling_backoff_policy,
16518 start,
16519 query,
16520 )
16521 }
16522 .with_options(poller_options)
16523 }
16524
16525 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16529 self.0.request.name = v.into();
16530 self
16531 }
16532 }
16533
16534 #[doc(hidden)]
16535 impl crate::RequestBuilder for DeleteServerTlsPolicy {
16536 fn request_options(&mut self) -> &mut crate::RequestOptions {
16537 &mut self.0.options
16538 }
16539 }
16540
16541 #[derive(Clone, Debug)]
16562 pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
16563
16564 impl ListClientTlsPolicies {
16565 pub(crate) fn new(
16566 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16567 ) -> Self {
16568 Self(RequestBuilder::new(stub))
16569 }
16570
16571 pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
16573 mut self,
16574 v: V,
16575 ) -> Self {
16576 self.0.request = v.into();
16577 self
16578 }
16579
16580 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16582 self.0.options = v.into();
16583 self
16584 }
16585
16586 pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
16588 (*self.0.stub)
16589 .list_client_tls_policies(self.0.request, self.0.options)
16590 .await
16591 .map(crate::Response::into_body)
16592 }
16593
16594 pub fn by_page(
16596 self,
16597 ) -> impl google_cloud_gax::paginator::Paginator<
16598 crate::model::ListClientTlsPoliciesResponse,
16599 crate::Error,
16600 > {
16601 use std::clone::Clone;
16602 let token = self.0.request.page_token.clone();
16603 let execute = move |token: String| {
16604 let mut builder = self.clone();
16605 builder.0.request = builder.0.request.set_page_token(token);
16606 builder.send()
16607 };
16608 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16609 }
16610
16611 pub fn by_item(
16613 self,
16614 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16615 crate::model::ListClientTlsPoliciesResponse,
16616 crate::Error,
16617 > {
16618 use google_cloud_gax::paginator::Paginator;
16619 self.by_page().items()
16620 }
16621
16622 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16626 self.0.request.parent = v.into();
16627 self
16628 }
16629
16630 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16632 self.0.request.page_size = v.into();
16633 self
16634 }
16635
16636 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16638 self.0.request.page_token = v.into();
16639 self
16640 }
16641 }
16642
16643 #[doc(hidden)]
16644 impl crate::RequestBuilder for ListClientTlsPolicies {
16645 fn request_options(&mut self) -> &mut crate::RequestOptions {
16646 &mut self.0.options
16647 }
16648 }
16649
16650 #[derive(Clone, Debug)]
16667 pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
16668
16669 impl GetClientTlsPolicy {
16670 pub(crate) fn new(
16671 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16672 ) -> Self {
16673 Self(RequestBuilder::new(stub))
16674 }
16675
16676 pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
16678 mut self,
16679 v: V,
16680 ) -> Self {
16681 self.0.request = v.into();
16682 self
16683 }
16684
16685 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16687 self.0.options = v.into();
16688 self
16689 }
16690
16691 pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
16693 (*self.0.stub)
16694 .get_client_tls_policy(self.0.request, self.0.options)
16695 .await
16696 .map(crate::Response::into_body)
16697 }
16698
16699 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16703 self.0.request.name = v.into();
16704 self
16705 }
16706 }
16707
16708 #[doc(hidden)]
16709 impl crate::RequestBuilder for GetClientTlsPolicy {
16710 fn request_options(&mut self) -> &mut crate::RequestOptions {
16711 &mut self.0.options
16712 }
16713 }
16714
16715 #[derive(Clone, Debug)]
16733 pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
16734
16735 impl CreateClientTlsPolicy {
16736 pub(crate) fn new(
16737 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16738 ) -> Self {
16739 Self(RequestBuilder::new(stub))
16740 }
16741
16742 pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
16744 mut self,
16745 v: V,
16746 ) -> Self {
16747 self.0.request = v.into();
16748 self
16749 }
16750
16751 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16753 self.0.options = v.into();
16754 self
16755 }
16756
16757 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16764 (*self.0.stub)
16765 .create_client_tls_policy(self.0.request, self.0.options)
16766 .await
16767 .map(crate::Response::into_body)
16768 }
16769
16770 pub fn poller(
16772 self,
16773 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
16774 {
16775 type Operation = google_cloud_lro::internal::Operation<
16776 crate::model::ClientTlsPolicy,
16777 crate::model::OperationMetadata,
16778 >;
16779 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16780 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16781 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16782 if let Some(ref mut details) = poller_options.tracing {
16783 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_client_tls_policy::until_done";
16784 }
16785
16786 let stub = self.0.stub.clone();
16787 let mut options = self.0.options.clone();
16788 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16789 let query = move |name| {
16790 let stub = stub.clone();
16791 let options = options.clone();
16792 async {
16793 let op = GetOperation::new(stub)
16794 .set_name(name)
16795 .with_options(options)
16796 .send()
16797 .await?;
16798 Ok(Operation::new(op))
16799 }
16800 };
16801
16802 let start = move || async {
16803 let op = self.send().await?;
16804 Ok(Operation::new(op))
16805 };
16806
16807 use google_cloud_lro::internal::PollerExt;
16808 {
16809 google_cloud_lro::internal::new_poller(
16810 polling_error_policy,
16811 polling_backoff_policy,
16812 start,
16813 query,
16814 )
16815 }
16816 .with_options(poller_options)
16817 }
16818
16819 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16823 self.0.request.parent = v.into();
16824 self
16825 }
16826
16827 pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16831 self.0.request.client_tls_policy_id = v.into();
16832 self
16833 }
16834
16835 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
16839 where
16840 T: std::convert::Into<crate::model::ClientTlsPolicy>,
16841 {
16842 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
16843 self
16844 }
16845
16846 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16850 where
16851 T: std::convert::Into<crate::model::ClientTlsPolicy>,
16852 {
16853 self.0.request.client_tls_policy = v.map(|x| x.into());
16854 self
16855 }
16856 }
16857
16858 #[doc(hidden)]
16859 impl crate::RequestBuilder for CreateClientTlsPolicy {
16860 fn request_options(&mut self) -> &mut crate::RequestOptions {
16861 &mut self.0.options
16862 }
16863 }
16864
16865 #[derive(Clone, Debug)]
16883 pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
16884
16885 impl UpdateClientTlsPolicy {
16886 pub(crate) fn new(
16887 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16888 ) -> Self {
16889 Self(RequestBuilder::new(stub))
16890 }
16891
16892 pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
16894 mut self,
16895 v: V,
16896 ) -> Self {
16897 self.0.request = v.into();
16898 self
16899 }
16900
16901 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16903 self.0.options = v.into();
16904 self
16905 }
16906
16907 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16914 (*self.0.stub)
16915 .update_client_tls_policy(self.0.request, self.0.options)
16916 .await
16917 .map(crate::Response::into_body)
16918 }
16919
16920 pub fn poller(
16922 self,
16923 ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
16924 {
16925 type Operation = google_cloud_lro::internal::Operation<
16926 crate::model::ClientTlsPolicy,
16927 crate::model::OperationMetadata,
16928 >;
16929 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16930 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16931 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16932 if let Some(ref mut details) = poller_options.tracing {
16933 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_client_tls_policy::until_done";
16934 }
16935
16936 let stub = self.0.stub.clone();
16937 let mut options = self.0.options.clone();
16938 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16939 let query = move |name| {
16940 let stub = stub.clone();
16941 let options = options.clone();
16942 async {
16943 let op = GetOperation::new(stub)
16944 .set_name(name)
16945 .with_options(options)
16946 .send()
16947 .await?;
16948 Ok(Operation::new(op))
16949 }
16950 };
16951
16952 let start = move || async {
16953 let op = self.send().await?;
16954 Ok(Operation::new(op))
16955 };
16956
16957 use google_cloud_lro::internal::PollerExt;
16958 {
16959 google_cloud_lro::internal::new_poller(
16960 polling_error_policy,
16961 polling_backoff_policy,
16962 start,
16963 query,
16964 )
16965 }
16966 .with_options(poller_options)
16967 }
16968
16969 pub fn set_update_mask<T>(mut self, v: T) -> Self
16971 where
16972 T: std::convert::Into<wkt::FieldMask>,
16973 {
16974 self.0.request.update_mask = std::option::Option::Some(v.into());
16975 self
16976 }
16977
16978 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16980 where
16981 T: std::convert::Into<wkt::FieldMask>,
16982 {
16983 self.0.request.update_mask = v.map(|x| x.into());
16984 self
16985 }
16986
16987 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
16991 where
16992 T: std::convert::Into<crate::model::ClientTlsPolicy>,
16993 {
16994 self.0.request.client_tls_policy = std::option::Option::Some(v.into());
16995 self
16996 }
16997
16998 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
17002 where
17003 T: std::convert::Into<crate::model::ClientTlsPolicy>,
17004 {
17005 self.0.request.client_tls_policy = v.map(|x| x.into());
17006 self
17007 }
17008 }
17009
17010 #[doc(hidden)]
17011 impl crate::RequestBuilder for UpdateClientTlsPolicy {
17012 fn request_options(&mut self) -> &mut crate::RequestOptions {
17013 &mut self.0.options
17014 }
17015 }
17016
17017 #[derive(Clone, Debug)]
17035 pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
17036
17037 impl DeleteClientTlsPolicy {
17038 pub(crate) fn new(
17039 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17040 ) -> Self {
17041 Self(RequestBuilder::new(stub))
17042 }
17043
17044 pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
17046 mut self,
17047 v: V,
17048 ) -> Self {
17049 self.0.request = v.into();
17050 self
17051 }
17052
17053 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17055 self.0.options = v.into();
17056 self
17057 }
17058
17059 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17066 (*self.0.stub)
17067 .delete_client_tls_policy(self.0.request, self.0.options)
17068 .await
17069 .map(crate::Response::into_body)
17070 }
17071
17072 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17074 type Operation =
17075 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17076 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17077 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17078 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17079 if let Some(ref mut details) = poller_options.tracing {
17080 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_client_tls_policy::until_done";
17081 }
17082
17083 let stub = self.0.stub.clone();
17084 let mut options = self.0.options.clone();
17085 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17086 let query = move |name| {
17087 let stub = stub.clone();
17088 let options = options.clone();
17089 async {
17090 let op = GetOperation::new(stub)
17091 .set_name(name)
17092 .with_options(options)
17093 .send()
17094 .await?;
17095 Ok(Operation::new(op))
17096 }
17097 };
17098
17099 let start = move || async {
17100 let op = self.send().await?;
17101 Ok(Operation::new(op))
17102 };
17103
17104 use google_cloud_lro::internal::PollerExt;
17105 {
17106 google_cloud_lro::internal::new_unit_response_poller(
17107 polling_error_policy,
17108 polling_backoff_policy,
17109 start,
17110 query,
17111 )
17112 }
17113 .with_options(poller_options)
17114 }
17115
17116 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17120 self.0.request.name = v.into();
17121 self
17122 }
17123 }
17124
17125 #[doc(hidden)]
17126 impl crate::RequestBuilder for DeleteClientTlsPolicy {
17127 fn request_options(&mut self) -> &mut crate::RequestOptions {
17128 &mut self.0.options
17129 }
17130 }
17131
17132 #[derive(Clone, Debug)]
17153 pub struct ListGatewaySecurityPolicies(
17154 RequestBuilder<crate::model::ListGatewaySecurityPoliciesRequest>,
17155 );
17156
17157 impl ListGatewaySecurityPolicies {
17158 pub(crate) fn new(
17159 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17160 ) -> Self {
17161 Self(RequestBuilder::new(stub))
17162 }
17163
17164 pub fn with_request<V: Into<crate::model::ListGatewaySecurityPoliciesRequest>>(
17166 mut self,
17167 v: V,
17168 ) -> Self {
17169 self.0.request = v.into();
17170 self
17171 }
17172
17173 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17175 self.0.options = v.into();
17176 self
17177 }
17178
17179 pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPoliciesResponse> {
17181 (*self.0.stub)
17182 .list_gateway_security_policies(self.0.request, self.0.options)
17183 .await
17184 .map(crate::Response::into_body)
17185 }
17186
17187 pub fn by_page(
17189 self,
17190 ) -> impl google_cloud_gax::paginator::Paginator<
17191 crate::model::ListGatewaySecurityPoliciesResponse,
17192 crate::Error,
17193 > {
17194 use std::clone::Clone;
17195 let token = self.0.request.page_token.clone();
17196 let execute = move |token: String| {
17197 let mut builder = self.clone();
17198 builder.0.request = builder.0.request.set_page_token(token);
17199 builder.send()
17200 };
17201 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17202 }
17203
17204 pub fn by_item(
17206 self,
17207 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17208 crate::model::ListGatewaySecurityPoliciesResponse,
17209 crate::Error,
17210 > {
17211 use google_cloud_gax::paginator::Paginator;
17212 self.by_page().items()
17213 }
17214
17215 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17219 self.0.request.parent = v.into();
17220 self
17221 }
17222
17223 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17225 self.0.request.page_size = v.into();
17226 self
17227 }
17228
17229 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17231 self.0.request.page_token = v.into();
17232 self
17233 }
17234 }
17235
17236 #[doc(hidden)]
17237 impl crate::RequestBuilder for ListGatewaySecurityPolicies {
17238 fn request_options(&mut self) -> &mut crate::RequestOptions {
17239 &mut self.0.options
17240 }
17241 }
17242
17243 #[derive(Clone, Debug)]
17260 pub struct GetGatewaySecurityPolicy(
17261 RequestBuilder<crate::model::GetGatewaySecurityPolicyRequest>,
17262 );
17263
17264 impl GetGatewaySecurityPolicy {
17265 pub(crate) fn new(
17266 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17267 ) -> Self {
17268 Self(RequestBuilder::new(stub))
17269 }
17270
17271 pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRequest>>(
17273 mut self,
17274 v: V,
17275 ) -> Self {
17276 self.0.request = v.into();
17277 self
17278 }
17279
17280 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17282 self.0.options = v.into();
17283 self
17284 }
17285
17286 pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicy> {
17288 (*self.0.stub)
17289 .get_gateway_security_policy(self.0.request, self.0.options)
17290 .await
17291 .map(crate::Response::into_body)
17292 }
17293
17294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17298 self.0.request.name = v.into();
17299 self
17300 }
17301 }
17302
17303 #[doc(hidden)]
17304 impl crate::RequestBuilder for GetGatewaySecurityPolicy {
17305 fn request_options(&mut self) -> &mut crate::RequestOptions {
17306 &mut self.0.options
17307 }
17308 }
17309
17310 #[derive(Clone, Debug)]
17328 pub struct CreateGatewaySecurityPolicy(
17329 RequestBuilder<crate::model::CreateGatewaySecurityPolicyRequest>,
17330 );
17331
17332 impl CreateGatewaySecurityPolicy {
17333 pub(crate) fn new(
17334 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17335 ) -> Self {
17336 Self(RequestBuilder::new(stub))
17337 }
17338
17339 pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRequest>>(
17341 mut self,
17342 v: V,
17343 ) -> Self {
17344 self.0.request = v.into();
17345 self
17346 }
17347
17348 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17350 self.0.options = v.into();
17351 self
17352 }
17353
17354 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17361 (*self.0.stub)
17362 .create_gateway_security_policy(self.0.request, self.0.options)
17363 .await
17364 .map(crate::Response::into_body)
17365 }
17366
17367 pub fn poller(
17369 self,
17370 ) -> impl google_cloud_lro::Poller<
17371 crate::model::GatewaySecurityPolicy,
17372 crate::model::OperationMetadata,
17373 > {
17374 type Operation = google_cloud_lro::internal::Operation<
17375 crate::model::GatewaySecurityPolicy,
17376 crate::model::OperationMetadata,
17377 >;
17378 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17379 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17380 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17381 if let Some(ref mut details) = poller_options.tracing {
17382 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_gateway_security_policy::until_done";
17383 }
17384
17385 let stub = self.0.stub.clone();
17386 let mut options = self.0.options.clone();
17387 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17388 let query = move |name| {
17389 let stub = stub.clone();
17390 let options = options.clone();
17391 async {
17392 let op = GetOperation::new(stub)
17393 .set_name(name)
17394 .with_options(options)
17395 .send()
17396 .await?;
17397 Ok(Operation::new(op))
17398 }
17399 };
17400
17401 let start = move || async {
17402 let op = self.send().await?;
17403 Ok(Operation::new(op))
17404 };
17405
17406 use google_cloud_lro::internal::PollerExt;
17407 {
17408 google_cloud_lro::internal::new_poller(
17409 polling_error_policy,
17410 polling_backoff_policy,
17411 start,
17412 query,
17413 )
17414 }
17415 .with_options(poller_options)
17416 }
17417
17418 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17422 self.0.request.parent = v.into();
17423 self
17424 }
17425
17426 pub fn set_gateway_security_policy_id<T: Into<std::string::String>>(
17430 mut self,
17431 v: T,
17432 ) -> Self {
17433 self.0.request.gateway_security_policy_id = v.into();
17434 self
17435 }
17436
17437 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
17441 where
17442 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17443 {
17444 self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
17445 self
17446 }
17447
17448 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
17452 where
17453 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17454 {
17455 self.0.request.gateway_security_policy = v.map(|x| x.into());
17456 self
17457 }
17458 }
17459
17460 #[doc(hidden)]
17461 impl crate::RequestBuilder for CreateGatewaySecurityPolicy {
17462 fn request_options(&mut self) -> &mut crate::RequestOptions {
17463 &mut self.0.options
17464 }
17465 }
17466
17467 #[derive(Clone, Debug)]
17485 pub struct UpdateGatewaySecurityPolicy(
17486 RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRequest>,
17487 );
17488
17489 impl UpdateGatewaySecurityPolicy {
17490 pub(crate) fn new(
17491 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17492 ) -> Self {
17493 Self(RequestBuilder::new(stub))
17494 }
17495
17496 pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRequest>>(
17498 mut self,
17499 v: V,
17500 ) -> Self {
17501 self.0.request = v.into();
17502 self
17503 }
17504
17505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17507 self.0.options = v.into();
17508 self
17509 }
17510
17511 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17518 (*self.0.stub)
17519 .update_gateway_security_policy(self.0.request, self.0.options)
17520 .await
17521 .map(crate::Response::into_body)
17522 }
17523
17524 pub fn poller(
17526 self,
17527 ) -> impl google_cloud_lro::Poller<
17528 crate::model::GatewaySecurityPolicy,
17529 crate::model::OperationMetadata,
17530 > {
17531 type Operation = google_cloud_lro::internal::Operation<
17532 crate::model::GatewaySecurityPolicy,
17533 crate::model::OperationMetadata,
17534 >;
17535 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17536 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17537 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17538 if let Some(ref mut details) = poller_options.tracing {
17539 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_gateway_security_policy::until_done";
17540 }
17541
17542 let stub = self.0.stub.clone();
17543 let mut options = self.0.options.clone();
17544 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17545 let query = move |name| {
17546 let stub = stub.clone();
17547 let options = options.clone();
17548 async {
17549 let op = GetOperation::new(stub)
17550 .set_name(name)
17551 .with_options(options)
17552 .send()
17553 .await?;
17554 Ok(Operation::new(op))
17555 }
17556 };
17557
17558 let start = move || async {
17559 let op = self.send().await?;
17560 Ok(Operation::new(op))
17561 };
17562
17563 use google_cloud_lro::internal::PollerExt;
17564 {
17565 google_cloud_lro::internal::new_poller(
17566 polling_error_policy,
17567 polling_backoff_policy,
17568 start,
17569 query,
17570 )
17571 }
17572 .with_options(poller_options)
17573 }
17574
17575 pub fn set_update_mask<T>(mut self, v: T) -> Self
17577 where
17578 T: std::convert::Into<wkt::FieldMask>,
17579 {
17580 self.0.request.update_mask = std::option::Option::Some(v.into());
17581 self
17582 }
17583
17584 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17586 where
17587 T: std::convert::Into<wkt::FieldMask>,
17588 {
17589 self.0.request.update_mask = v.map(|x| x.into());
17590 self
17591 }
17592
17593 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
17597 where
17598 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17599 {
17600 self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
17601 self
17602 }
17603
17604 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
17608 where
17609 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17610 {
17611 self.0.request.gateway_security_policy = v.map(|x| x.into());
17612 self
17613 }
17614 }
17615
17616 #[doc(hidden)]
17617 impl crate::RequestBuilder for UpdateGatewaySecurityPolicy {
17618 fn request_options(&mut self) -> &mut crate::RequestOptions {
17619 &mut self.0.options
17620 }
17621 }
17622
17623 #[derive(Clone, Debug)]
17641 pub struct DeleteGatewaySecurityPolicy(
17642 RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRequest>,
17643 );
17644
17645 impl DeleteGatewaySecurityPolicy {
17646 pub(crate) fn new(
17647 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17648 ) -> Self {
17649 Self(RequestBuilder::new(stub))
17650 }
17651
17652 pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRequest>>(
17654 mut self,
17655 v: V,
17656 ) -> Self {
17657 self.0.request = v.into();
17658 self
17659 }
17660
17661 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17663 self.0.options = v.into();
17664 self
17665 }
17666
17667 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17674 (*self.0.stub)
17675 .delete_gateway_security_policy(self.0.request, self.0.options)
17676 .await
17677 .map(crate::Response::into_body)
17678 }
17679
17680 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17682 type Operation =
17683 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17684 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17685 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17686 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17687 if let Some(ref mut details) = poller_options.tracing {
17688 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_gateway_security_policy::until_done";
17689 }
17690
17691 let stub = self.0.stub.clone();
17692 let mut options = self.0.options.clone();
17693 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17694 let query = move |name| {
17695 let stub = stub.clone();
17696 let options = options.clone();
17697 async {
17698 let op = GetOperation::new(stub)
17699 .set_name(name)
17700 .with_options(options)
17701 .send()
17702 .await?;
17703 Ok(Operation::new(op))
17704 }
17705 };
17706
17707 let start = move || async {
17708 let op = self.send().await?;
17709 Ok(Operation::new(op))
17710 };
17711
17712 use google_cloud_lro::internal::PollerExt;
17713 {
17714 google_cloud_lro::internal::new_unit_response_poller(
17715 polling_error_policy,
17716 polling_backoff_policy,
17717 start,
17718 query,
17719 )
17720 }
17721 .with_options(poller_options)
17722 }
17723
17724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17728 self.0.request.name = v.into();
17729 self
17730 }
17731 }
17732
17733 #[doc(hidden)]
17734 impl crate::RequestBuilder for DeleteGatewaySecurityPolicy {
17735 fn request_options(&mut self) -> &mut crate::RequestOptions {
17736 &mut self.0.options
17737 }
17738 }
17739
17740 #[derive(Clone, Debug)]
17761 pub struct ListGatewaySecurityPolicyRules(
17762 RequestBuilder<crate::model::ListGatewaySecurityPolicyRulesRequest>,
17763 );
17764
17765 impl ListGatewaySecurityPolicyRules {
17766 pub(crate) fn new(
17767 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17768 ) -> Self {
17769 Self(RequestBuilder::new(stub))
17770 }
17771
17772 pub fn with_request<V: Into<crate::model::ListGatewaySecurityPolicyRulesRequest>>(
17774 mut self,
17775 v: V,
17776 ) -> Self {
17777 self.0.request = v.into();
17778 self
17779 }
17780
17781 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17783 self.0.options = v.into();
17784 self
17785 }
17786
17787 pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPolicyRulesResponse> {
17789 (*self.0.stub)
17790 .list_gateway_security_policy_rules(self.0.request, self.0.options)
17791 .await
17792 .map(crate::Response::into_body)
17793 }
17794
17795 pub fn by_page(
17797 self,
17798 ) -> impl google_cloud_gax::paginator::Paginator<
17799 crate::model::ListGatewaySecurityPolicyRulesResponse,
17800 crate::Error,
17801 > {
17802 use std::clone::Clone;
17803 let token = self.0.request.page_token.clone();
17804 let execute = move |token: String| {
17805 let mut builder = self.clone();
17806 builder.0.request = builder.0.request.set_page_token(token);
17807 builder.send()
17808 };
17809 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17810 }
17811
17812 pub fn by_item(
17814 self,
17815 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17816 crate::model::ListGatewaySecurityPolicyRulesResponse,
17817 crate::Error,
17818 > {
17819 use google_cloud_gax::paginator::Paginator;
17820 self.by_page().items()
17821 }
17822
17823 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17827 self.0.request.parent = v.into();
17828 self
17829 }
17830
17831 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17833 self.0.request.page_size = v.into();
17834 self
17835 }
17836
17837 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17839 self.0.request.page_token = v.into();
17840 self
17841 }
17842 }
17843
17844 #[doc(hidden)]
17845 impl crate::RequestBuilder for ListGatewaySecurityPolicyRules {
17846 fn request_options(&mut self) -> &mut crate::RequestOptions {
17847 &mut self.0.options
17848 }
17849 }
17850
17851 #[derive(Clone, Debug)]
17868 pub struct GetGatewaySecurityPolicyRule(
17869 RequestBuilder<crate::model::GetGatewaySecurityPolicyRuleRequest>,
17870 );
17871
17872 impl GetGatewaySecurityPolicyRule {
17873 pub(crate) fn new(
17874 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17875 ) -> Self {
17876 Self(RequestBuilder::new(stub))
17877 }
17878
17879 pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRuleRequest>>(
17881 mut self,
17882 v: V,
17883 ) -> Self {
17884 self.0.request = v.into();
17885 self
17886 }
17887
17888 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17890 self.0.options = v.into();
17891 self
17892 }
17893
17894 pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicyRule> {
17896 (*self.0.stub)
17897 .get_gateway_security_policy_rule(self.0.request, self.0.options)
17898 .await
17899 .map(crate::Response::into_body)
17900 }
17901
17902 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17906 self.0.request.name = v.into();
17907 self
17908 }
17909 }
17910
17911 #[doc(hidden)]
17912 impl crate::RequestBuilder for GetGatewaySecurityPolicyRule {
17913 fn request_options(&mut self) -> &mut crate::RequestOptions {
17914 &mut self.0.options
17915 }
17916 }
17917
17918 #[derive(Clone, Debug)]
17936 pub struct CreateGatewaySecurityPolicyRule(
17937 RequestBuilder<crate::model::CreateGatewaySecurityPolicyRuleRequest>,
17938 );
17939
17940 impl CreateGatewaySecurityPolicyRule {
17941 pub(crate) fn new(
17942 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17943 ) -> Self {
17944 Self(RequestBuilder::new(stub))
17945 }
17946
17947 pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRuleRequest>>(
17949 mut self,
17950 v: V,
17951 ) -> Self {
17952 self.0.request = v.into();
17953 self
17954 }
17955
17956 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17958 self.0.options = v.into();
17959 self
17960 }
17961
17962 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17969 (*self.0.stub)
17970 .create_gateway_security_policy_rule(self.0.request, self.0.options)
17971 .await
17972 .map(crate::Response::into_body)
17973 }
17974
17975 pub fn poller(
17977 self,
17978 ) -> impl google_cloud_lro::Poller<
17979 crate::model::GatewaySecurityPolicyRule,
17980 crate::model::OperationMetadata,
17981 > {
17982 type Operation = google_cloud_lro::internal::Operation<
17983 crate::model::GatewaySecurityPolicyRule,
17984 crate::model::OperationMetadata,
17985 >;
17986 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17987 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17988 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17989 if let Some(ref mut details) = poller_options.tracing {
17990 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_gateway_security_policy_rule::until_done";
17991 }
17992
17993 let stub = self.0.stub.clone();
17994 let mut options = self.0.options.clone();
17995 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17996 let query = move |name| {
17997 let stub = stub.clone();
17998 let options = options.clone();
17999 async {
18000 let op = GetOperation::new(stub)
18001 .set_name(name)
18002 .with_options(options)
18003 .send()
18004 .await?;
18005 Ok(Operation::new(op))
18006 }
18007 };
18008
18009 let start = move || async {
18010 let op = self.send().await?;
18011 Ok(Operation::new(op))
18012 };
18013
18014 use google_cloud_lro::internal::PollerExt;
18015 {
18016 google_cloud_lro::internal::new_poller(
18017 polling_error_policy,
18018 polling_backoff_policy,
18019 start,
18020 query,
18021 )
18022 }
18023 .with_options(poller_options)
18024 }
18025
18026 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18030 self.0.request.parent = v.into();
18031 self
18032 }
18033
18034 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
18038 where
18039 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
18040 {
18041 self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
18042 self
18043 }
18044
18045 pub fn set_or_clear_gateway_security_policy_rule<T>(
18049 mut self,
18050 v: std::option::Option<T>,
18051 ) -> Self
18052 where
18053 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
18054 {
18055 self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
18056 self
18057 }
18058
18059 pub fn set_gateway_security_policy_rule_id<T: Into<std::string::String>>(
18061 mut self,
18062 v: T,
18063 ) -> Self {
18064 self.0.request.gateway_security_policy_rule_id = v.into();
18065 self
18066 }
18067 }
18068
18069 #[doc(hidden)]
18070 impl crate::RequestBuilder for CreateGatewaySecurityPolicyRule {
18071 fn request_options(&mut self) -> &mut crate::RequestOptions {
18072 &mut self.0.options
18073 }
18074 }
18075
18076 #[derive(Clone, Debug)]
18094 pub struct UpdateGatewaySecurityPolicyRule(
18095 RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRuleRequest>,
18096 );
18097
18098 impl UpdateGatewaySecurityPolicyRule {
18099 pub(crate) fn new(
18100 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18101 ) -> Self {
18102 Self(RequestBuilder::new(stub))
18103 }
18104
18105 pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRuleRequest>>(
18107 mut self,
18108 v: V,
18109 ) -> Self {
18110 self.0.request = v.into();
18111 self
18112 }
18113
18114 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18116 self.0.options = v.into();
18117 self
18118 }
18119
18120 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18127 (*self.0.stub)
18128 .update_gateway_security_policy_rule(self.0.request, self.0.options)
18129 .await
18130 .map(crate::Response::into_body)
18131 }
18132
18133 pub fn poller(
18135 self,
18136 ) -> impl google_cloud_lro::Poller<
18137 crate::model::GatewaySecurityPolicyRule,
18138 crate::model::OperationMetadata,
18139 > {
18140 type Operation = google_cloud_lro::internal::Operation<
18141 crate::model::GatewaySecurityPolicyRule,
18142 crate::model::OperationMetadata,
18143 >;
18144 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18145 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18146 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18147 if let Some(ref mut details) = poller_options.tracing {
18148 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_gateway_security_policy_rule::until_done";
18149 }
18150
18151 let stub = self.0.stub.clone();
18152 let mut options = self.0.options.clone();
18153 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18154 let query = move |name| {
18155 let stub = stub.clone();
18156 let options = options.clone();
18157 async {
18158 let op = GetOperation::new(stub)
18159 .set_name(name)
18160 .with_options(options)
18161 .send()
18162 .await?;
18163 Ok(Operation::new(op))
18164 }
18165 };
18166
18167 let start = move || async {
18168 let op = self.send().await?;
18169 Ok(Operation::new(op))
18170 };
18171
18172 use google_cloud_lro::internal::PollerExt;
18173 {
18174 google_cloud_lro::internal::new_poller(
18175 polling_error_policy,
18176 polling_backoff_policy,
18177 start,
18178 query,
18179 )
18180 }
18181 .with_options(poller_options)
18182 }
18183
18184 pub fn set_update_mask<T>(mut self, v: T) -> Self
18186 where
18187 T: std::convert::Into<wkt::FieldMask>,
18188 {
18189 self.0.request.update_mask = std::option::Option::Some(v.into());
18190 self
18191 }
18192
18193 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18195 where
18196 T: std::convert::Into<wkt::FieldMask>,
18197 {
18198 self.0.request.update_mask = v.map(|x| x.into());
18199 self
18200 }
18201
18202 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
18206 where
18207 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
18208 {
18209 self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
18210 self
18211 }
18212
18213 pub fn set_or_clear_gateway_security_policy_rule<T>(
18217 mut self,
18218 v: std::option::Option<T>,
18219 ) -> Self
18220 where
18221 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
18222 {
18223 self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
18224 self
18225 }
18226 }
18227
18228 #[doc(hidden)]
18229 impl crate::RequestBuilder for UpdateGatewaySecurityPolicyRule {
18230 fn request_options(&mut self) -> &mut crate::RequestOptions {
18231 &mut self.0.options
18232 }
18233 }
18234
18235 #[derive(Clone, Debug)]
18253 pub struct DeleteGatewaySecurityPolicyRule(
18254 RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRuleRequest>,
18255 );
18256
18257 impl DeleteGatewaySecurityPolicyRule {
18258 pub(crate) fn new(
18259 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18260 ) -> Self {
18261 Self(RequestBuilder::new(stub))
18262 }
18263
18264 pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRuleRequest>>(
18266 mut self,
18267 v: V,
18268 ) -> Self {
18269 self.0.request = v.into();
18270 self
18271 }
18272
18273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18275 self.0.options = v.into();
18276 self
18277 }
18278
18279 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18286 (*self.0.stub)
18287 .delete_gateway_security_policy_rule(self.0.request, self.0.options)
18288 .await
18289 .map(crate::Response::into_body)
18290 }
18291
18292 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18294 type Operation =
18295 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18296 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18297 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18298 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18299 if let Some(ref mut details) = poller_options.tracing {
18300 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_gateway_security_policy_rule::until_done";
18301 }
18302
18303 let stub = self.0.stub.clone();
18304 let mut options = self.0.options.clone();
18305 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18306 let query = move |name| {
18307 let stub = stub.clone();
18308 let options = options.clone();
18309 async {
18310 let op = GetOperation::new(stub)
18311 .set_name(name)
18312 .with_options(options)
18313 .send()
18314 .await?;
18315 Ok(Operation::new(op))
18316 }
18317 };
18318
18319 let start = move || async {
18320 let op = self.send().await?;
18321 Ok(Operation::new(op))
18322 };
18323
18324 use google_cloud_lro::internal::PollerExt;
18325 {
18326 google_cloud_lro::internal::new_unit_response_poller(
18327 polling_error_policy,
18328 polling_backoff_policy,
18329 start,
18330 query,
18331 )
18332 }
18333 .with_options(poller_options)
18334 }
18335
18336 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18340 self.0.request.name = v.into();
18341 self
18342 }
18343 }
18344
18345 #[doc(hidden)]
18346 impl crate::RequestBuilder for DeleteGatewaySecurityPolicyRule {
18347 fn request_options(&mut self) -> &mut crate::RequestOptions {
18348 &mut self.0.options
18349 }
18350 }
18351
18352 #[derive(Clone, Debug)]
18373 pub struct ListUrlLists(RequestBuilder<crate::model::ListUrlListsRequest>);
18374
18375 impl ListUrlLists {
18376 pub(crate) fn new(
18377 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18378 ) -> Self {
18379 Self(RequestBuilder::new(stub))
18380 }
18381
18382 pub fn with_request<V: Into<crate::model::ListUrlListsRequest>>(mut self, v: V) -> Self {
18384 self.0.request = v.into();
18385 self
18386 }
18387
18388 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18390 self.0.options = v.into();
18391 self
18392 }
18393
18394 pub async fn send(self) -> Result<crate::model::ListUrlListsResponse> {
18396 (*self.0.stub)
18397 .list_url_lists(self.0.request, self.0.options)
18398 .await
18399 .map(crate::Response::into_body)
18400 }
18401
18402 pub fn by_page(
18404 self,
18405 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUrlListsResponse, crate::Error>
18406 {
18407 use std::clone::Clone;
18408 let token = self.0.request.page_token.clone();
18409 let execute = move |token: String| {
18410 let mut builder = self.clone();
18411 builder.0.request = builder.0.request.set_page_token(token);
18412 builder.send()
18413 };
18414 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18415 }
18416
18417 pub fn by_item(
18419 self,
18420 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18421 crate::model::ListUrlListsResponse,
18422 crate::Error,
18423 > {
18424 use google_cloud_gax::paginator::Paginator;
18425 self.by_page().items()
18426 }
18427
18428 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18432 self.0.request.parent = v.into();
18433 self
18434 }
18435
18436 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18438 self.0.request.page_size = v.into();
18439 self
18440 }
18441
18442 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18444 self.0.request.page_token = v.into();
18445 self
18446 }
18447 }
18448
18449 #[doc(hidden)]
18450 impl crate::RequestBuilder for ListUrlLists {
18451 fn request_options(&mut self) -> &mut crate::RequestOptions {
18452 &mut self.0.options
18453 }
18454 }
18455
18456 #[derive(Clone, Debug)]
18473 pub struct GetUrlList(RequestBuilder<crate::model::GetUrlListRequest>);
18474
18475 impl GetUrlList {
18476 pub(crate) fn new(
18477 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18478 ) -> Self {
18479 Self(RequestBuilder::new(stub))
18480 }
18481
18482 pub fn with_request<V: Into<crate::model::GetUrlListRequest>>(mut self, v: V) -> Self {
18484 self.0.request = v.into();
18485 self
18486 }
18487
18488 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18490 self.0.options = v.into();
18491 self
18492 }
18493
18494 pub async fn send(self) -> Result<crate::model::UrlList> {
18496 (*self.0.stub)
18497 .get_url_list(self.0.request, self.0.options)
18498 .await
18499 .map(crate::Response::into_body)
18500 }
18501
18502 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18506 self.0.request.name = v.into();
18507 self
18508 }
18509 }
18510
18511 #[doc(hidden)]
18512 impl crate::RequestBuilder for GetUrlList {
18513 fn request_options(&mut self) -> &mut crate::RequestOptions {
18514 &mut self.0.options
18515 }
18516 }
18517
18518 #[derive(Clone, Debug)]
18536 pub struct CreateUrlList(RequestBuilder<crate::model::CreateUrlListRequest>);
18537
18538 impl CreateUrlList {
18539 pub(crate) fn new(
18540 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18541 ) -> Self {
18542 Self(RequestBuilder::new(stub))
18543 }
18544
18545 pub fn with_request<V: Into<crate::model::CreateUrlListRequest>>(mut self, v: V) -> Self {
18547 self.0.request = v.into();
18548 self
18549 }
18550
18551 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18553 self.0.options = v.into();
18554 self
18555 }
18556
18557 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18564 (*self.0.stub)
18565 .create_url_list(self.0.request, self.0.options)
18566 .await
18567 .map(crate::Response::into_body)
18568 }
18569
18570 pub fn poller(
18572 self,
18573 ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
18574 {
18575 type Operation = google_cloud_lro::internal::Operation<
18576 crate::model::UrlList,
18577 crate::model::OperationMetadata,
18578 >;
18579 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18580 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18581 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18582 if let Some(ref mut details) = poller_options.tracing {
18583 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_url_list::until_done";
18584 }
18585
18586 let stub = self.0.stub.clone();
18587 let mut options = self.0.options.clone();
18588 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18589 let query = move |name| {
18590 let stub = stub.clone();
18591 let options = options.clone();
18592 async {
18593 let op = GetOperation::new(stub)
18594 .set_name(name)
18595 .with_options(options)
18596 .send()
18597 .await?;
18598 Ok(Operation::new(op))
18599 }
18600 };
18601
18602 let start = move || async {
18603 let op = self.send().await?;
18604 Ok(Operation::new(op))
18605 };
18606
18607 use google_cloud_lro::internal::PollerExt;
18608 {
18609 google_cloud_lro::internal::new_poller(
18610 polling_error_policy,
18611 polling_backoff_policy,
18612 start,
18613 query,
18614 )
18615 }
18616 .with_options(poller_options)
18617 }
18618
18619 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18623 self.0.request.parent = v.into();
18624 self
18625 }
18626
18627 pub fn set_url_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18631 self.0.request.url_list_id = v.into();
18632 self
18633 }
18634
18635 pub fn set_url_list<T>(mut self, v: T) -> Self
18639 where
18640 T: std::convert::Into<crate::model::UrlList>,
18641 {
18642 self.0.request.url_list = std::option::Option::Some(v.into());
18643 self
18644 }
18645
18646 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
18650 where
18651 T: std::convert::Into<crate::model::UrlList>,
18652 {
18653 self.0.request.url_list = v.map(|x| x.into());
18654 self
18655 }
18656 }
18657
18658 #[doc(hidden)]
18659 impl crate::RequestBuilder for CreateUrlList {
18660 fn request_options(&mut self) -> &mut crate::RequestOptions {
18661 &mut self.0.options
18662 }
18663 }
18664
18665 #[derive(Clone, Debug)]
18683 pub struct UpdateUrlList(RequestBuilder<crate::model::UpdateUrlListRequest>);
18684
18685 impl UpdateUrlList {
18686 pub(crate) fn new(
18687 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18688 ) -> Self {
18689 Self(RequestBuilder::new(stub))
18690 }
18691
18692 pub fn with_request<V: Into<crate::model::UpdateUrlListRequest>>(mut self, v: V) -> Self {
18694 self.0.request = v.into();
18695 self
18696 }
18697
18698 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18700 self.0.options = v.into();
18701 self
18702 }
18703
18704 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18711 (*self.0.stub)
18712 .update_url_list(self.0.request, self.0.options)
18713 .await
18714 .map(crate::Response::into_body)
18715 }
18716
18717 pub fn poller(
18719 self,
18720 ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
18721 {
18722 type Operation = google_cloud_lro::internal::Operation<
18723 crate::model::UrlList,
18724 crate::model::OperationMetadata,
18725 >;
18726 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18727 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18728 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18729 if let Some(ref mut details) = poller_options.tracing {
18730 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_url_list::until_done";
18731 }
18732
18733 let stub = self.0.stub.clone();
18734 let mut options = self.0.options.clone();
18735 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18736 let query = move |name| {
18737 let stub = stub.clone();
18738 let options = options.clone();
18739 async {
18740 let op = GetOperation::new(stub)
18741 .set_name(name)
18742 .with_options(options)
18743 .send()
18744 .await?;
18745 Ok(Operation::new(op))
18746 }
18747 };
18748
18749 let start = move || async {
18750 let op = self.send().await?;
18751 Ok(Operation::new(op))
18752 };
18753
18754 use google_cloud_lro::internal::PollerExt;
18755 {
18756 google_cloud_lro::internal::new_poller(
18757 polling_error_policy,
18758 polling_backoff_policy,
18759 start,
18760 query,
18761 )
18762 }
18763 .with_options(poller_options)
18764 }
18765
18766 pub fn set_update_mask<T>(mut self, v: T) -> Self
18768 where
18769 T: std::convert::Into<wkt::FieldMask>,
18770 {
18771 self.0.request.update_mask = std::option::Option::Some(v.into());
18772 self
18773 }
18774
18775 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18777 where
18778 T: std::convert::Into<wkt::FieldMask>,
18779 {
18780 self.0.request.update_mask = v.map(|x| x.into());
18781 self
18782 }
18783
18784 pub fn set_url_list<T>(mut self, v: T) -> Self
18788 where
18789 T: std::convert::Into<crate::model::UrlList>,
18790 {
18791 self.0.request.url_list = std::option::Option::Some(v.into());
18792 self
18793 }
18794
18795 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
18799 where
18800 T: std::convert::Into<crate::model::UrlList>,
18801 {
18802 self.0.request.url_list = v.map(|x| x.into());
18803 self
18804 }
18805 }
18806
18807 #[doc(hidden)]
18808 impl crate::RequestBuilder for UpdateUrlList {
18809 fn request_options(&mut self) -> &mut crate::RequestOptions {
18810 &mut self.0.options
18811 }
18812 }
18813
18814 #[derive(Clone, Debug)]
18832 pub struct DeleteUrlList(RequestBuilder<crate::model::DeleteUrlListRequest>);
18833
18834 impl DeleteUrlList {
18835 pub(crate) fn new(
18836 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18837 ) -> Self {
18838 Self(RequestBuilder::new(stub))
18839 }
18840
18841 pub fn with_request<V: Into<crate::model::DeleteUrlListRequest>>(mut self, v: V) -> Self {
18843 self.0.request = v.into();
18844 self
18845 }
18846
18847 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18849 self.0.options = v.into();
18850 self
18851 }
18852
18853 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18860 (*self.0.stub)
18861 .delete_url_list(self.0.request, self.0.options)
18862 .await
18863 .map(crate::Response::into_body)
18864 }
18865
18866 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18868 type Operation =
18869 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18870 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18871 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18872 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18873 if let Some(ref mut details) = poller_options.tracing {
18874 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_url_list::until_done";
18875 }
18876
18877 let stub = self.0.stub.clone();
18878 let mut options = self.0.options.clone();
18879 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18880 let query = move |name| {
18881 let stub = stub.clone();
18882 let options = options.clone();
18883 async {
18884 let op = GetOperation::new(stub)
18885 .set_name(name)
18886 .with_options(options)
18887 .send()
18888 .await?;
18889 Ok(Operation::new(op))
18890 }
18891 };
18892
18893 let start = move || async {
18894 let op = self.send().await?;
18895 Ok(Operation::new(op))
18896 };
18897
18898 use google_cloud_lro::internal::PollerExt;
18899 {
18900 google_cloud_lro::internal::new_unit_response_poller(
18901 polling_error_policy,
18902 polling_backoff_policy,
18903 start,
18904 query,
18905 )
18906 }
18907 .with_options(poller_options)
18908 }
18909
18910 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18914 self.0.request.name = v.into();
18915 self
18916 }
18917 }
18918
18919 #[doc(hidden)]
18920 impl crate::RequestBuilder for DeleteUrlList {
18921 fn request_options(&mut self) -> &mut crate::RequestOptions {
18922 &mut self.0.options
18923 }
18924 }
18925
18926 #[derive(Clone, Debug)]
18947 pub struct ListTlsInspectionPolicies(
18948 RequestBuilder<crate::model::ListTlsInspectionPoliciesRequest>,
18949 );
18950
18951 impl ListTlsInspectionPolicies {
18952 pub(crate) fn new(
18953 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18954 ) -> Self {
18955 Self(RequestBuilder::new(stub))
18956 }
18957
18958 pub fn with_request<V: Into<crate::model::ListTlsInspectionPoliciesRequest>>(
18960 mut self,
18961 v: V,
18962 ) -> Self {
18963 self.0.request = v.into();
18964 self
18965 }
18966
18967 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18969 self.0.options = v.into();
18970 self
18971 }
18972
18973 pub async fn send(self) -> Result<crate::model::ListTlsInspectionPoliciesResponse> {
18975 (*self.0.stub)
18976 .list_tls_inspection_policies(self.0.request, self.0.options)
18977 .await
18978 .map(crate::Response::into_body)
18979 }
18980
18981 pub fn by_page(
18983 self,
18984 ) -> impl google_cloud_gax::paginator::Paginator<
18985 crate::model::ListTlsInspectionPoliciesResponse,
18986 crate::Error,
18987 > {
18988 use std::clone::Clone;
18989 let token = self.0.request.page_token.clone();
18990 let execute = move |token: String| {
18991 let mut builder = self.clone();
18992 builder.0.request = builder.0.request.set_page_token(token);
18993 builder.send()
18994 };
18995 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18996 }
18997
18998 pub fn by_item(
19000 self,
19001 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19002 crate::model::ListTlsInspectionPoliciesResponse,
19003 crate::Error,
19004 > {
19005 use google_cloud_gax::paginator::Paginator;
19006 self.by_page().items()
19007 }
19008
19009 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19013 self.0.request.parent = v.into();
19014 self
19015 }
19016
19017 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19019 self.0.request.page_size = v.into();
19020 self
19021 }
19022
19023 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19025 self.0.request.page_token = v.into();
19026 self
19027 }
19028 }
19029
19030 #[doc(hidden)]
19031 impl crate::RequestBuilder for ListTlsInspectionPolicies {
19032 fn request_options(&mut self) -> &mut crate::RequestOptions {
19033 &mut self.0.options
19034 }
19035 }
19036
19037 #[derive(Clone, Debug)]
19054 pub struct GetTlsInspectionPolicy(RequestBuilder<crate::model::GetTlsInspectionPolicyRequest>);
19055
19056 impl GetTlsInspectionPolicy {
19057 pub(crate) fn new(
19058 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19059 ) -> Self {
19060 Self(RequestBuilder::new(stub))
19061 }
19062
19063 pub fn with_request<V: Into<crate::model::GetTlsInspectionPolicyRequest>>(
19065 mut self,
19066 v: V,
19067 ) -> Self {
19068 self.0.request = v.into();
19069 self
19070 }
19071
19072 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19074 self.0.options = v.into();
19075 self
19076 }
19077
19078 pub async fn send(self) -> Result<crate::model::TlsInspectionPolicy> {
19080 (*self.0.stub)
19081 .get_tls_inspection_policy(self.0.request, self.0.options)
19082 .await
19083 .map(crate::Response::into_body)
19084 }
19085
19086 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19090 self.0.request.name = v.into();
19091 self
19092 }
19093 }
19094
19095 #[doc(hidden)]
19096 impl crate::RequestBuilder for GetTlsInspectionPolicy {
19097 fn request_options(&mut self) -> &mut crate::RequestOptions {
19098 &mut self.0.options
19099 }
19100 }
19101
19102 #[derive(Clone, Debug)]
19120 pub struct CreateTlsInspectionPolicy(
19121 RequestBuilder<crate::model::CreateTlsInspectionPolicyRequest>,
19122 );
19123
19124 impl CreateTlsInspectionPolicy {
19125 pub(crate) fn new(
19126 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19127 ) -> Self {
19128 Self(RequestBuilder::new(stub))
19129 }
19130
19131 pub fn with_request<V: Into<crate::model::CreateTlsInspectionPolicyRequest>>(
19133 mut self,
19134 v: V,
19135 ) -> Self {
19136 self.0.request = v.into();
19137 self
19138 }
19139
19140 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19142 self.0.options = v.into();
19143 self
19144 }
19145
19146 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19153 (*self.0.stub)
19154 .create_tls_inspection_policy(self.0.request, self.0.options)
19155 .await
19156 .map(crate::Response::into_body)
19157 }
19158
19159 pub fn poller(
19161 self,
19162 ) -> impl google_cloud_lro::Poller<
19163 crate::model::TlsInspectionPolicy,
19164 crate::model::OperationMetadata,
19165 > {
19166 type Operation = google_cloud_lro::internal::Operation<
19167 crate::model::TlsInspectionPolicy,
19168 crate::model::OperationMetadata,
19169 >;
19170 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19171 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19172 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19173 if let Some(ref mut details) = poller_options.tracing {
19174 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_tls_inspection_policy::until_done";
19175 }
19176
19177 let stub = self.0.stub.clone();
19178 let mut options = self.0.options.clone();
19179 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19180 let query = move |name| {
19181 let stub = stub.clone();
19182 let options = options.clone();
19183 async {
19184 let op = GetOperation::new(stub)
19185 .set_name(name)
19186 .with_options(options)
19187 .send()
19188 .await?;
19189 Ok(Operation::new(op))
19190 }
19191 };
19192
19193 let start = move || async {
19194 let op = self.send().await?;
19195 Ok(Operation::new(op))
19196 };
19197
19198 use google_cloud_lro::internal::PollerExt;
19199 {
19200 google_cloud_lro::internal::new_poller(
19201 polling_error_policy,
19202 polling_backoff_policy,
19203 start,
19204 query,
19205 )
19206 }
19207 .with_options(poller_options)
19208 }
19209
19210 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19214 self.0.request.parent = v.into();
19215 self
19216 }
19217
19218 pub fn set_tls_inspection_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19222 self.0.request.tls_inspection_policy_id = v.into();
19223 self
19224 }
19225
19226 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
19230 where
19231 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
19232 {
19233 self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
19234 self
19235 }
19236
19237 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
19241 where
19242 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
19243 {
19244 self.0.request.tls_inspection_policy = v.map(|x| x.into());
19245 self
19246 }
19247 }
19248
19249 #[doc(hidden)]
19250 impl crate::RequestBuilder for CreateTlsInspectionPolicy {
19251 fn request_options(&mut self) -> &mut crate::RequestOptions {
19252 &mut self.0.options
19253 }
19254 }
19255
19256 #[derive(Clone, Debug)]
19274 pub struct UpdateTlsInspectionPolicy(
19275 RequestBuilder<crate::model::UpdateTlsInspectionPolicyRequest>,
19276 );
19277
19278 impl UpdateTlsInspectionPolicy {
19279 pub(crate) fn new(
19280 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19281 ) -> Self {
19282 Self(RequestBuilder::new(stub))
19283 }
19284
19285 pub fn with_request<V: Into<crate::model::UpdateTlsInspectionPolicyRequest>>(
19287 mut self,
19288 v: V,
19289 ) -> Self {
19290 self.0.request = v.into();
19291 self
19292 }
19293
19294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19296 self.0.options = v.into();
19297 self
19298 }
19299
19300 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19307 (*self.0.stub)
19308 .update_tls_inspection_policy(self.0.request, self.0.options)
19309 .await
19310 .map(crate::Response::into_body)
19311 }
19312
19313 pub fn poller(
19315 self,
19316 ) -> impl google_cloud_lro::Poller<
19317 crate::model::TlsInspectionPolicy,
19318 crate::model::OperationMetadata,
19319 > {
19320 type Operation = google_cloud_lro::internal::Operation<
19321 crate::model::TlsInspectionPolicy,
19322 crate::model::OperationMetadata,
19323 >;
19324 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19325 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19326 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19327 if let Some(ref mut details) = poller_options.tracing {
19328 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_tls_inspection_policy::until_done";
19329 }
19330
19331 let stub = self.0.stub.clone();
19332 let mut options = self.0.options.clone();
19333 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19334 let query = move |name| {
19335 let stub = stub.clone();
19336 let options = options.clone();
19337 async {
19338 let op = GetOperation::new(stub)
19339 .set_name(name)
19340 .with_options(options)
19341 .send()
19342 .await?;
19343 Ok(Operation::new(op))
19344 }
19345 };
19346
19347 let start = move || async {
19348 let op = self.send().await?;
19349 Ok(Operation::new(op))
19350 };
19351
19352 use google_cloud_lro::internal::PollerExt;
19353 {
19354 google_cloud_lro::internal::new_poller(
19355 polling_error_policy,
19356 polling_backoff_policy,
19357 start,
19358 query,
19359 )
19360 }
19361 .with_options(poller_options)
19362 }
19363
19364 pub fn set_update_mask<T>(mut self, v: T) -> Self
19366 where
19367 T: std::convert::Into<wkt::FieldMask>,
19368 {
19369 self.0.request.update_mask = std::option::Option::Some(v.into());
19370 self
19371 }
19372
19373 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19375 where
19376 T: std::convert::Into<wkt::FieldMask>,
19377 {
19378 self.0.request.update_mask = v.map(|x| x.into());
19379 self
19380 }
19381
19382 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
19386 where
19387 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
19388 {
19389 self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
19390 self
19391 }
19392
19393 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
19397 where
19398 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
19399 {
19400 self.0.request.tls_inspection_policy = v.map(|x| x.into());
19401 self
19402 }
19403 }
19404
19405 #[doc(hidden)]
19406 impl crate::RequestBuilder for UpdateTlsInspectionPolicy {
19407 fn request_options(&mut self) -> &mut crate::RequestOptions {
19408 &mut self.0.options
19409 }
19410 }
19411
19412 #[derive(Clone, Debug)]
19430 pub struct DeleteTlsInspectionPolicy(
19431 RequestBuilder<crate::model::DeleteTlsInspectionPolicyRequest>,
19432 );
19433
19434 impl DeleteTlsInspectionPolicy {
19435 pub(crate) fn new(
19436 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19437 ) -> Self {
19438 Self(RequestBuilder::new(stub))
19439 }
19440
19441 pub fn with_request<V: Into<crate::model::DeleteTlsInspectionPolicyRequest>>(
19443 mut self,
19444 v: V,
19445 ) -> Self {
19446 self.0.request = v.into();
19447 self
19448 }
19449
19450 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19452 self.0.options = v.into();
19453 self
19454 }
19455
19456 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19463 (*self.0.stub)
19464 .delete_tls_inspection_policy(self.0.request, self.0.options)
19465 .await
19466 .map(crate::Response::into_body)
19467 }
19468
19469 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19471 type Operation =
19472 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19473 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19474 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19475 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19476 if let Some(ref mut details) = poller_options.tracing {
19477 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_tls_inspection_policy::until_done";
19478 }
19479
19480 let stub = self.0.stub.clone();
19481 let mut options = self.0.options.clone();
19482 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19483 let query = move |name| {
19484 let stub = stub.clone();
19485 let options = options.clone();
19486 async {
19487 let op = GetOperation::new(stub)
19488 .set_name(name)
19489 .with_options(options)
19490 .send()
19491 .await?;
19492 Ok(Operation::new(op))
19493 }
19494 };
19495
19496 let start = move || async {
19497 let op = self.send().await?;
19498 Ok(Operation::new(op))
19499 };
19500
19501 use google_cloud_lro::internal::PollerExt;
19502 {
19503 google_cloud_lro::internal::new_unit_response_poller(
19504 polling_error_policy,
19505 polling_backoff_policy,
19506 start,
19507 query,
19508 )
19509 }
19510 .with_options(poller_options)
19511 }
19512
19513 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19517 self.0.request.name = v.into();
19518 self
19519 }
19520
19521 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
19523 self.0.request.force = v.into();
19524 self
19525 }
19526 }
19527
19528 #[doc(hidden)]
19529 impl crate::RequestBuilder for DeleteTlsInspectionPolicy {
19530 fn request_options(&mut self) -> &mut crate::RequestOptions {
19531 &mut self.0.options
19532 }
19533 }
19534
19535 #[derive(Clone, Debug)]
19556 pub struct ListAuthzPolicies(RequestBuilder<crate::model::ListAuthzPoliciesRequest>);
19557
19558 impl ListAuthzPolicies {
19559 pub(crate) fn new(
19560 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19561 ) -> Self {
19562 Self(RequestBuilder::new(stub))
19563 }
19564
19565 pub fn with_request<V: Into<crate::model::ListAuthzPoliciesRequest>>(
19567 mut self,
19568 v: V,
19569 ) -> Self {
19570 self.0.request = v.into();
19571 self
19572 }
19573
19574 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19576 self.0.options = v.into();
19577 self
19578 }
19579
19580 pub async fn send(self) -> Result<crate::model::ListAuthzPoliciesResponse> {
19582 (*self.0.stub)
19583 .list_authz_policies(self.0.request, self.0.options)
19584 .await
19585 .map(crate::Response::into_body)
19586 }
19587
19588 pub fn by_page(
19590 self,
19591 ) -> impl google_cloud_gax::paginator::Paginator<
19592 crate::model::ListAuthzPoliciesResponse,
19593 crate::Error,
19594 > {
19595 use std::clone::Clone;
19596 let token = self.0.request.page_token.clone();
19597 let execute = move |token: String| {
19598 let mut builder = self.clone();
19599 builder.0.request = builder.0.request.set_page_token(token);
19600 builder.send()
19601 };
19602 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19603 }
19604
19605 pub fn by_item(
19607 self,
19608 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19609 crate::model::ListAuthzPoliciesResponse,
19610 crate::Error,
19611 > {
19612 use google_cloud_gax::paginator::Paginator;
19613 self.by_page().items()
19614 }
19615
19616 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19620 self.0.request.parent = v.into();
19621 self
19622 }
19623
19624 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19626 self.0.request.page_size = v.into();
19627 self
19628 }
19629
19630 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19632 self.0.request.page_token = v.into();
19633 self
19634 }
19635
19636 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19638 self.0.request.filter = v.into();
19639 self
19640 }
19641
19642 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19644 self.0.request.order_by = v.into();
19645 self
19646 }
19647 }
19648
19649 #[doc(hidden)]
19650 impl crate::RequestBuilder for ListAuthzPolicies {
19651 fn request_options(&mut self) -> &mut crate::RequestOptions {
19652 &mut self.0.options
19653 }
19654 }
19655
19656 #[derive(Clone, Debug)]
19673 pub struct GetAuthzPolicy(RequestBuilder<crate::model::GetAuthzPolicyRequest>);
19674
19675 impl GetAuthzPolicy {
19676 pub(crate) fn new(
19677 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19678 ) -> Self {
19679 Self(RequestBuilder::new(stub))
19680 }
19681
19682 pub fn with_request<V: Into<crate::model::GetAuthzPolicyRequest>>(mut self, v: V) -> Self {
19684 self.0.request = v.into();
19685 self
19686 }
19687
19688 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19690 self.0.options = v.into();
19691 self
19692 }
19693
19694 pub async fn send(self) -> Result<crate::model::AuthzPolicy> {
19696 (*self.0.stub)
19697 .get_authz_policy(self.0.request, self.0.options)
19698 .await
19699 .map(crate::Response::into_body)
19700 }
19701
19702 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19706 self.0.request.name = v.into();
19707 self
19708 }
19709 }
19710
19711 #[doc(hidden)]
19712 impl crate::RequestBuilder for GetAuthzPolicy {
19713 fn request_options(&mut self) -> &mut crate::RequestOptions {
19714 &mut self.0.options
19715 }
19716 }
19717
19718 #[derive(Clone, Debug)]
19736 pub struct CreateAuthzPolicy(RequestBuilder<crate::model::CreateAuthzPolicyRequest>);
19737
19738 impl CreateAuthzPolicy {
19739 pub(crate) fn new(
19740 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19741 ) -> Self {
19742 Self(RequestBuilder::new(stub))
19743 }
19744
19745 pub fn with_request<V: Into<crate::model::CreateAuthzPolicyRequest>>(
19747 mut self,
19748 v: V,
19749 ) -> Self {
19750 self.0.request = v.into();
19751 self
19752 }
19753
19754 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19756 self.0.options = v.into();
19757 self
19758 }
19759
19760 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19767 (*self.0.stub)
19768 .create_authz_policy(self.0.request, self.0.options)
19769 .await
19770 .map(crate::Response::into_body)
19771 }
19772
19773 pub fn poller(
19775 self,
19776 ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
19777 {
19778 type Operation = google_cloud_lro::internal::Operation<
19779 crate::model::AuthzPolicy,
19780 crate::model::OperationMetadata,
19781 >;
19782 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19783 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19784 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19785 if let Some(ref mut details) = poller_options.tracing {
19786 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_authz_policy::until_done";
19787 }
19788
19789 let stub = self.0.stub.clone();
19790 let mut options = self.0.options.clone();
19791 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19792 let query = move |name| {
19793 let stub = stub.clone();
19794 let options = options.clone();
19795 async {
19796 let op = GetOperation::new(stub)
19797 .set_name(name)
19798 .with_options(options)
19799 .send()
19800 .await?;
19801 Ok(Operation::new(op))
19802 }
19803 };
19804
19805 let start = move || async {
19806 let op = self.send().await?;
19807 Ok(Operation::new(op))
19808 };
19809
19810 use google_cloud_lro::internal::PollerExt;
19811 {
19812 google_cloud_lro::internal::new_poller(
19813 polling_error_policy,
19814 polling_backoff_policy,
19815 start,
19816 query,
19817 )
19818 }
19819 .with_options(poller_options)
19820 }
19821
19822 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19826 self.0.request.parent = v.into();
19827 self
19828 }
19829
19830 pub fn set_authz_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19834 self.0.request.authz_policy_id = v.into();
19835 self
19836 }
19837
19838 pub fn set_authz_policy<T>(mut self, v: T) -> Self
19842 where
19843 T: std::convert::Into<crate::model::AuthzPolicy>,
19844 {
19845 self.0.request.authz_policy = std::option::Option::Some(v.into());
19846 self
19847 }
19848
19849 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
19853 where
19854 T: std::convert::Into<crate::model::AuthzPolicy>,
19855 {
19856 self.0.request.authz_policy = v.map(|x| x.into());
19857 self
19858 }
19859
19860 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19862 self.0.request.request_id = v.into();
19863 self
19864 }
19865 }
19866
19867 #[doc(hidden)]
19868 impl crate::RequestBuilder for CreateAuthzPolicy {
19869 fn request_options(&mut self) -> &mut crate::RequestOptions {
19870 &mut self.0.options
19871 }
19872 }
19873
19874 #[derive(Clone, Debug)]
19892 pub struct UpdateAuthzPolicy(RequestBuilder<crate::model::UpdateAuthzPolicyRequest>);
19893
19894 impl UpdateAuthzPolicy {
19895 pub(crate) fn new(
19896 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19897 ) -> Self {
19898 Self(RequestBuilder::new(stub))
19899 }
19900
19901 pub fn with_request<V: Into<crate::model::UpdateAuthzPolicyRequest>>(
19903 mut self,
19904 v: V,
19905 ) -> Self {
19906 self.0.request = v.into();
19907 self
19908 }
19909
19910 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19912 self.0.options = v.into();
19913 self
19914 }
19915
19916 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19923 (*self.0.stub)
19924 .update_authz_policy(self.0.request, self.0.options)
19925 .await
19926 .map(crate::Response::into_body)
19927 }
19928
19929 pub fn poller(
19931 self,
19932 ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
19933 {
19934 type Operation = google_cloud_lro::internal::Operation<
19935 crate::model::AuthzPolicy,
19936 crate::model::OperationMetadata,
19937 >;
19938 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19939 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19940 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19941 if let Some(ref mut details) = poller_options.tracing {
19942 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_authz_policy::until_done";
19943 }
19944
19945 let stub = self.0.stub.clone();
19946 let mut options = self.0.options.clone();
19947 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19948 let query = move |name| {
19949 let stub = stub.clone();
19950 let options = options.clone();
19951 async {
19952 let op = GetOperation::new(stub)
19953 .set_name(name)
19954 .with_options(options)
19955 .send()
19956 .await?;
19957 Ok(Operation::new(op))
19958 }
19959 };
19960
19961 let start = move || async {
19962 let op = self.send().await?;
19963 Ok(Operation::new(op))
19964 };
19965
19966 use google_cloud_lro::internal::PollerExt;
19967 {
19968 google_cloud_lro::internal::new_poller(
19969 polling_error_policy,
19970 polling_backoff_policy,
19971 start,
19972 query,
19973 )
19974 }
19975 .with_options(poller_options)
19976 }
19977
19978 pub fn set_update_mask<T>(mut self, v: T) -> Self
19982 where
19983 T: std::convert::Into<wkt::FieldMask>,
19984 {
19985 self.0.request.update_mask = std::option::Option::Some(v.into());
19986 self
19987 }
19988
19989 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19993 where
19994 T: std::convert::Into<wkt::FieldMask>,
19995 {
19996 self.0.request.update_mask = v.map(|x| x.into());
19997 self
19998 }
19999
20000 pub fn set_authz_policy<T>(mut self, v: T) -> Self
20004 where
20005 T: std::convert::Into<crate::model::AuthzPolicy>,
20006 {
20007 self.0.request.authz_policy = std::option::Option::Some(v.into());
20008 self
20009 }
20010
20011 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
20015 where
20016 T: std::convert::Into<crate::model::AuthzPolicy>,
20017 {
20018 self.0.request.authz_policy = v.map(|x| x.into());
20019 self
20020 }
20021
20022 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20024 self.0.request.request_id = v.into();
20025 self
20026 }
20027 }
20028
20029 #[doc(hidden)]
20030 impl crate::RequestBuilder for UpdateAuthzPolicy {
20031 fn request_options(&mut self) -> &mut crate::RequestOptions {
20032 &mut self.0.options
20033 }
20034 }
20035
20036 #[derive(Clone, Debug)]
20054 pub struct DeleteAuthzPolicy(RequestBuilder<crate::model::DeleteAuthzPolicyRequest>);
20055
20056 impl DeleteAuthzPolicy {
20057 pub(crate) fn new(
20058 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20059 ) -> Self {
20060 Self(RequestBuilder::new(stub))
20061 }
20062
20063 pub fn with_request<V: Into<crate::model::DeleteAuthzPolicyRequest>>(
20065 mut self,
20066 v: V,
20067 ) -> Self {
20068 self.0.request = v.into();
20069 self
20070 }
20071
20072 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20074 self.0.options = v.into();
20075 self
20076 }
20077
20078 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20085 (*self.0.stub)
20086 .delete_authz_policy(self.0.request, self.0.options)
20087 .await
20088 .map(crate::Response::into_body)
20089 }
20090
20091 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20093 type Operation =
20094 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20095 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20096 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20097 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
20098 if let Some(ref mut details) = poller_options.tracing {
20099 details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_authz_policy::until_done";
20100 }
20101
20102 let stub = self.0.stub.clone();
20103 let mut options = self.0.options.clone();
20104 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20105 let query = move |name| {
20106 let stub = stub.clone();
20107 let options = options.clone();
20108 async {
20109 let op = GetOperation::new(stub)
20110 .set_name(name)
20111 .with_options(options)
20112 .send()
20113 .await?;
20114 Ok(Operation::new(op))
20115 }
20116 };
20117
20118 let start = move || async {
20119 let op = self.send().await?;
20120 Ok(Operation::new(op))
20121 };
20122
20123 use google_cloud_lro::internal::PollerExt;
20124 {
20125 google_cloud_lro::internal::new_unit_response_poller(
20126 polling_error_policy,
20127 polling_backoff_policy,
20128 start,
20129 query,
20130 )
20131 }
20132 .with_options(poller_options)
20133 }
20134
20135 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20139 self.0.request.name = v.into();
20140 self
20141 }
20142
20143 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20145 self.0.request.request_id = v.into();
20146 self
20147 }
20148 }
20149
20150 #[doc(hidden)]
20151 impl crate::RequestBuilder for DeleteAuthzPolicy {
20152 fn request_options(&mut self) -> &mut crate::RequestOptions {
20153 &mut self.0.options
20154 }
20155 }
20156
20157 #[derive(Clone, Debug)]
20178 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20179
20180 impl ListLocations {
20181 pub(crate) fn new(
20182 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20183 ) -> Self {
20184 Self(RequestBuilder::new(stub))
20185 }
20186
20187 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20189 mut self,
20190 v: V,
20191 ) -> Self {
20192 self.0.request = v.into();
20193 self
20194 }
20195
20196 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20198 self.0.options = v.into();
20199 self
20200 }
20201
20202 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20204 (*self.0.stub)
20205 .list_locations(self.0.request, self.0.options)
20206 .await
20207 .map(crate::Response::into_body)
20208 }
20209
20210 pub fn by_page(
20212 self,
20213 ) -> impl google_cloud_gax::paginator::Paginator<
20214 google_cloud_location::model::ListLocationsResponse,
20215 crate::Error,
20216 > {
20217 use std::clone::Clone;
20218 let token = self.0.request.page_token.clone();
20219 let execute = move |token: String| {
20220 let mut builder = self.clone();
20221 builder.0.request = builder.0.request.set_page_token(token);
20222 builder.send()
20223 };
20224 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20225 }
20226
20227 pub fn by_item(
20229 self,
20230 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20231 google_cloud_location::model::ListLocationsResponse,
20232 crate::Error,
20233 > {
20234 use google_cloud_gax::paginator::Paginator;
20235 self.by_page().items()
20236 }
20237
20238 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20240 self.0.request.name = v.into();
20241 self
20242 }
20243
20244 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20246 self.0.request.filter = v.into();
20247 self
20248 }
20249
20250 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20252 self.0.request.page_size = v.into();
20253 self
20254 }
20255
20256 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20258 self.0.request.page_token = v.into();
20259 self
20260 }
20261 }
20262
20263 #[doc(hidden)]
20264 impl crate::RequestBuilder for ListLocations {
20265 fn request_options(&mut self) -> &mut crate::RequestOptions {
20266 &mut self.0.options
20267 }
20268 }
20269
20270 #[derive(Clone, Debug)]
20287 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20288
20289 impl GetLocation {
20290 pub(crate) fn new(
20291 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20292 ) -> Self {
20293 Self(RequestBuilder::new(stub))
20294 }
20295
20296 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20298 mut self,
20299 v: V,
20300 ) -> Self {
20301 self.0.request = v.into();
20302 self
20303 }
20304
20305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20307 self.0.options = v.into();
20308 self
20309 }
20310
20311 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20313 (*self.0.stub)
20314 .get_location(self.0.request, self.0.options)
20315 .await
20316 .map(crate::Response::into_body)
20317 }
20318
20319 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20321 self.0.request.name = v.into();
20322 self
20323 }
20324 }
20325
20326 #[doc(hidden)]
20327 impl crate::RequestBuilder for GetLocation {
20328 fn request_options(&mut self) -> &mut crate::RequestOptions {
20329 &mut self.0.options
20330 }
20331 }
20332
20333 #[derive(Clone, Debug)]
20350 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
20351
20352 impl SetIamPolicy {
20353 pub(crate) fn new(
20354 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20355 ) -> Self {
20356 Self(RequestBuilder::new(stub))
20357 }
20358
20359 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
20361 mut self,
20362 v: V,
20363 ) -> Self {
20364 self.0.request = v.into();
20365 self
20366 }
20367
20368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20370 self.0.options = v.into();
20371 self
20372 }
20373
20374 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20376 (*self.0.stub)
20377 .set_iam_policy(self.0.request, self.0.options)
20378 .await
20379 .map(crate::Response::into_body)
20380 }
20381
20382 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20386 self.0.request.resource = v.into();
20387 self
20388 }
20389
20390 pub fn set_policy<T>(mut self, v: T) -> Self
20394 where
20395 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20396 {
20397 self.0.request.policy = std::option::Option::Some(v.into());
20398 self
20399 }
20400
20401 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
20405 where
20406 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20407 {
20408 self.0.request.policy = v.map(|x| x.into());
20409 self
20410 }
20411
20412 pub fn set_update_mask<T>(mut self, v: T) -> Self
20414 where
20415 T: std::convert::Into<wkt::FieldMask>,
20416 {
20417 self.0.request.update_mask = std::option::Option::Some(v.into());
20418 self
20419 }
20420
20421 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20423 where
20424 T: std::convert::Into<wkt::FieldMask>,
20425 {
20426 self.0.request.update_mask = v.map(|x| x.into());
20427 self
20428 }
20429 }
20430
20431 #[doc(hidden)]
20432 impl crate::RequestBuilder for SetIamPolicy {
20433 fn request_options(&mut self) -> &mut crate::RequestOptions {
20434 &mut self.0.options
20435 }
20436 }
20437
20438 #[derive(Clone, Debug)]
20455 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
20456
20457 impl GetIamPolicy {
20458 pub(crate) fn new(
20459 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20460 ) -> Self {
20461 Self(RequestBuilder::new(stub))
20462 }
20463
20464 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
20466 mut self,
20467 v: V,
20468 ) -> Self {
20469 self.0.request = v.into();
20470 self
20471 }
20472
20473 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20475 self.0.options = v.into();
20476 self
20477 }
20478
20479 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20481 (*self.0.stub)
20482 .get_iam_policy(self.0.request, self.0.options)
20483 .await
20484 .map(crate::Response::into_body)
20485 }
20486
20487 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20491 self.0.request.resource = v.into();
20492 self
20493 }
20494
20495 pub fn set_options<T>(mut self, v: T) -> Self
20497 where
20498 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20499 {
20500 self.0.request.options = std::option::Option::Some(v.into());
20501 self
20502 }
20503
20504 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
20506 where
20507 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20508 {
20509 self.0.request.options = v.map(|x| x.into());
20510 self
20511 }
20512 }
20513
20514 #[doc(hidden)]
20515 impl crate::RequestBuilder for GetIamPolicy {
20516 fn request_options(&mut self) -> &mut crate::RequestOptions {
20517 &mut self.0.options
20518 }
20519 }
20520
20521 #[derive(Clone, Debug)]
20538 pub struct TestIamPermissions(
20539 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
20540 );
20541
20542 impl TestIamPermissions {
20543 pub(crate) fn new(
20544 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20545 ) -> Self {
20546 Self(RequestBuilder::new(stub))
20547 }
20548
20549 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
20551 mut self,
20552 v: V,
20553 ) -> Self {
20554 self.0.request = v.into();
20555 self
20556 }
20557
20558 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20560 self.0.options = v.into();
20561 self
20562 }
20563
20564 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
20566 (*self.0.stub)
20567 .test_iam_permissions(self.0.request, self.0.options)
20568 .await
20569 .map(crate::Response::into_body)
20570 }
20571
20572 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20576 self.0.request.resource = v.into();
20577 self
20578 }
20579
20580 pub fn set_permissions<T, V>(mut self, v: T) -> Self
20584 where
20585 T: std::iter::IntoIterator<Item = V>,
20586 V: std::convert::Into<std::string::String>,
20587 {
20588 use std::iter::Iterator;
20589 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
20590 self
20591 }
20592 }
20593
20594 #[doc(hidden)]
20595 impl crate::RequestBuilder for TestIamPermissions {
20596 fn request_options(&mut self) -> &mut crate::RequestOptions {
20597 &mut self.0.options
20598 }
20599 }
20600
20601 #[derive(Clone, Debug)]
20622 pub struct ListOperations(
20623 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20624 );
20625
20626 impl ListOperations {
20627 pub(crate) fn new(
20628 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20629 ) -> Self {
20630 Self(RequestBuilder::new(stub))
20631 }
20632
20633 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20635 mut self,
20636 v: V,
20637 ) -> Self {
20638 self.0.request = v.into();
20639 self
20640 }
20641
20642 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20644 self.0.options = v.into();
20645 self
20646 }
20647
20648 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20650 (*self.0.stub)
20651 .list_operations(self.0.request, self.0.options)
20652 .await
20653 .map(crate::Response::into_body)
20654 }
20655
20656 pub fn by_page(
20658 self,
20659 ) -> impl google_cloud_gax::paginator::Paginator<
20660 google_cloud_longrunning::model::ListOperationsResponse,
20661 crate::Error,
20662 > {
20663 use std::clone::Clone;
20664 let token = self.0.request.page_token.clone();
20665 let execute = move |token: String| {
20666 let mut builder = self.clone();
20667 builder.0.request = builder.0.request.set_page_token(token);
20668 builder.send()
20669 };
20670 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20671 }
20672
20673 pub fn by_item(
20675 self,
20676 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20677 google_cloud_longrunning::model::ListOperationsResponse,
20678 crate::Error,
20679 > {
20680 use google_cloud_gax::paginator::Paginator;
20681 self.by_page().items()
20682 }
20683
20684 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20686 self.0.request.name = v.into();
20687 self
20688 }
20689
20690 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20692 self.0.request.filter = v.into();
20693 self
20694 }
20695
20696 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20698 self.0.request.page_size = v.into();
20699 self
20700 }
20701
20702 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20704 self.0.request.page_token = v.into();
20705 self
20706 }
20707
20708 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20710 self.0.request.return_partial_success = v.into();
20711 self
20712 }
20713 }
20714
20715 #[doc(hidden)]
20716 impl crate::RequestBuilder for ListOperations {
20717 fn request_options(&mut self) -> &mut crate::RequestOptions {
20718 &mut self.0.options
20719 }
20720 }
20721
20722 #[derive(Clone, Debug)]
20739 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20740
20741 impl GetOperation {
20742 pub(crate) fn new(
20743 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20744 ) -> Self {
20745 Self(RequestBuilder::new(stub))
20746 }
20747
20748 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20750 mut self,
20751 v: V,
20752 ) -> Self {
20753 self.0.request = v.into();
20754 self
20755 }
20756
20757 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20759 self.0.options = v.into();
20760 self
20761 }
20762
20763 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20765 (*self.0.stub)
20766 .get_operation(self.0.request, self.0.options)
20767 .await
20768 .map(crate::Response::into_body)
20769 }
20770
20771 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20773 self.0.request.name = v.into();
20774 self
20775 }
20776 }
20777
20778 #[doc(hidden)]
20779 impl crate::RequestBuilder for GetOperation {
20780 fn request_options(&mut self) -> &mut crate::RequestOptions {
20781 &mut self.0.options
20782 }
20783 }
20784
20785 #[derive(Clone, Debug)]
20802 pub struct DeleteOperation(
20803 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
20804 );
20805
20806 impl DeleteOperation {
20807 pub(crate) fn new(
20808 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20809 ) -> Self {
20810 Self(RequestBuilder::new(stub))
20811 }
20812
20813 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
20815 mut self,
20816 v: V,
20817 ) -> Self {
20818 self.0.request = v.into();
20819 self
20820 }
20821
20822 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20824 self.0.options = v.into();
20825 self
20826 }
20827
20828 pub async fn send(self) -> Result<()> {
20830 (*self.0.stub)
20831 .delete_operation(self.0.request, self.0.options)
20832 .await
20833 .map(crate::Response::into_body)
20834 }
20835
20836 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20838 self.0.request.name = v.into();
20839 self
20840 }
20841 }
20842
20843 #[doc(hidden)]
20844 impl crate::RequestBuilder for DeleteOperation {
20845 fn request_options(&mut self) -> &mut crate::RequestOptions {
20846 &mut self.0.options
20847 }
20848 }
20849
20850 #[derive(Clone, Debug)]
20867 pub struct CancelOperation(
20868 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20869 );
20870
20871 impl CancelOperation {
20872 pub(crate) fn new(
20873 stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20874 ) -> Self {
20875 Self(RequestBuilder::new(stub))
20876 }
20877
20878 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20880 mut self,
20881 v: V,
20882 ) -> Self {
20883 self.0.request = v.into();
20884 self
20885 }
20886
20887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20889 self.0.options = v.into();
20890 self
20891 }
20892
20893 pub async fn send(self) -> Result<()> {
20895 (*self.0.stub)
20896 .cancel_operation(self.0.request, self.0.options)
20897 .await
20898 .map(crate::Response::into_body)
20899 }
20900
20901 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20903 self.0.request.name = v.into();
20904 self
20905 }
20906 }
20907
20908 #[doc(hidden)]
20909 impl crate::RequestBuilder for CancelOperation {
20910 fn request_options(&mut self) -> &mut crate::RequestOptions {
20911 &mut self.0.options
20912 }
20913 }
20914}
20915
20916pub mod security_profile_group_service {
20918 use crate::Result;
20919
20920 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20934
20935 pub(crate) mod client {
20936 use super::super::super::client::SecurityProfileGroupService;
20937 pub struct Factory;
20938 impl crate::ClientFactory for Factory {
20939 type Client = SecurityProfileGroupService;
20940 type Credentials = gaxi::options::Credentials;
20941 async fn build(
20942 self,
20943 config: gaxi::options::ClientConfig,
20944 ) -> crate::ClientBuilderResult<Self::Client> {
20945 Self::Client::new(config).await
20946 }
20947 }
20948 }
20949
20950 #[derive(Clone, Debug)]
20952 pub(crate) struct RequestBuilder<R: std::default::Default> {
20953 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20954 request: R,
20955 options: crate::RequestOptions,
20956 }
20957
20958 impl<R> RequestBuilder<R>
20959 where
20960 R: std::default::Default,
20961 {
20962 pub(crate) fn new(
20963 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20964 ) -> Self {
20965 Self {
20966 stub,
20967 request: R::default(),
20968 options: crate::RequestOptions::default(),
20969 }
20970 }
20971 }
20972
20973 #[derive(Clone, Debug)]
20994 pub struct ListSecurityProfileGroups(
20995 RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
20996 );
20997
20998 impl ListSecurityProfileGroups {
20999 pub(crate) fn new(
21000 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21001 ) -> Self {
21002 Self(RequestBuilder::new(stub))
21003 }
21004
21005 pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
21007 mut self,
21008 v: V,
21009 ) -> Self {
21010 self.0.request = v.into();
21011 self
21012 }
21013
21014 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21016 self.0.options = v.into();
21017 self
21018 }
21019
21020 pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
21022 (*self.0.stub)
21023 .list_security_profile_groups(self.0.request, self.0.options)
21024 .await
21025 .map(crate::Response::into_body)
21026 }
21027
21028 pub fn by_page(
21030 self,
21031 ) -> impl google_cloud_gax::paginator::Paginator<
21032 crate::model::ListSecurityProfileGroupsResponse,
21033 crate::Error,
21034 > {
21035 use std::clone::Clone;
21036 let token = self.0.request.page_token.clone();
21037 let execute = move |token: String| {
21038 let mut builder = self.clone();
21039 builder.0.request = builder.0.request.set_page_token(token);
21040 builder.send()
21041 };
21042 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21043 }
21044
21045 pub fn by_item(
21047 self,
21048 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21049 crate::model::ListSecurityProfileGroupsResponse,
21050 crate::Error,
21051 > {
21052 use google_cloud_gax::paginator::Paginator;
21053 self.by_page().items()
21054 }
21055
21056 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21060 self.0.request.parent = v.into();
21061 self
21062 }
21063
21064 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21066 self.0.request.page_size = v.into();
21067 self
21068 }
21069
21070 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21072 self.0.request.page_token = v.into();
21073 self
21074 }
21075 }
21076
21077 #[doc(hidden)]
21078 impl crate::RequestBuilder for ListSecurityProfileGroups {
21079 fn request_options(&mut self) -> &mut crate::RequestOptions {
21080 &mut self.0.options
21081 }
21082 }
21083
21084 #[derive(Clone, Debug)]
21101 pub struct GetSecurityProfileGroup(
21102 RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
21103 );
21104
21105 impl GetSecurityProfileGroup {
21106 pub(crate) fn new(
21107 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21108 ) -> Self {
21109 Self(RequestBuilder::new(stub))
21110 }
21111
21112 pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
21114 mut self,
21115 v: V,
21116 ) -> Self {
21117 self.0.request = v.into();
21118 self
21119 }
21120
21121 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21123 self.0.options = v.into();
21124 self
21125 }
21126
21127 pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
21129 (*self.0.stub)
21130 .get_security_profile_group(self.0.request, self.0.options)
21131 .await
21132 .map(crate::Response::into_body)
21133 }
21134
21135 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21139 self.0.request.name = v.into();
21140 self
21141 }
21142 }
21143
21144 #[doc(hidden)]
21145 impl crate::RequestBuilder for GetSecurityProfileGroup {
21146 fn request_options(&mut self) -> &mut crate::RequestOptions {
21147 &mut self.0.options
21148 }
21149 }
21150
21151 #[derive(Clone, Debug)]
21169 pub struct CreateSecurityProfileGroup(
21170 RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
21171 );
21172
21173 impl CreateSecurityProfileGroup {
21174 pub(crate) fn new(
21175 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21176 ) -> Self {
21177 Self(RequestBuilder::new(stub))
21178 }
21179
21180 pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
21182 mut self,
21183 v: V,
21184 ) -> Self {
21185 self.0.request = v.into();
21186 self
21187 }
21188
21189 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21191 self.0.options = v.into();
21192 self
21193 }
21194
21195 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21202 (*self.0.stub)
21203 .create_security_profile_group(self.0.request, self.0.options)
21204 .await
21205 .map(crate::Response::into_body)
21206 }
21207
21208 pub fn poller(
21210 self,
21211 ) -> impl google_cloud_lro::Poller<
21212 crate::model::SecurityProfileGroup,
21213 crate::model::OperationMetadata,
21214 > {
21215 type Operation = google_cloud_lro::internal::Operation<
21216 crate::model::SecurityProfileGroup,
21217 crate::model::OperationMetadata,
21218 >;
21219 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21220 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21221 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21222 if let Some(ref mut details) = poller_options.tracing {
21223 details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::create_security_profile_group::until_done";
21224 }
21225
21226 let stub = self.0.stub.clone();
21227 let mut options = self.0.options.clone();
21228 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21229 let query = move |name| {
21230 let stub = stub.clone();
21231 let options = options.clone();
21232 async {
21233 let op = GetOperation::new(stub)
21234 .set_name(name)
21235 .with_options(options)
21236 .send()
21237 .await?;
21238 Ok(Operation::new(op))
21239 }
21240 };
21241
21242 let start = move || async {
21243 let op = self.send().await?;
21244 Ok(Operation::new(op))
21245 };
21246
21247 use google_cloud_lro::internal::PollerExt;
21248 {
21249 google_cloud_lro::internal::new_poller(
21250 polling_error_policy,
21251 polling_backoff_policy,
21252 start,
21253 query,
21254 )
21255 }
21256 .with_options(poller_options)
21257 }
21258
21259 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21263 self.0.request.parent = v.into();
21264 self
21265 }
21266
21267 pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21271 self.0.request.security_profile_group_id = v.into();
21272 self
21273 }
21274
21275 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
21279 where
21280 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21281 {
21282 self.0.request.security_profile_group = std::option::Option::Some(v.into());
21283 self
21284 }
21285
21286 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
21290 where
21291 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21292 {
21293 self.0.request.security_profile_group = v.map(|x| x.into());
21294 self
21295 }
21296 }
21297
21298 #[doc(hidden)]
21299 impl crate::RequestBuilder for CreateSecurityProfileGroup {
21300 fn request_options(&mut self) -> &mut crate::RequestOptions {
21301 &mut self.0.options
21302 }
21303 }
21304
21305 #[derive(Clone, Debug)]
21323 pub struct UpdateSecurityProfileGroup(
21324 RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
21325 );
21326
21327 impl UpdateSecurityProfileGroup {
21328 pub(crate) fn new(
21329 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21330 ) -> Self {
21331 Self(RequestBuilder::new(stub))
21332 }
21333
21334 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
21336 mut self,
21337 v: V,
21338 ) -> Self {
21339 self.0.request = v.into();
21340 self
21341 }
21342
21343 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21345 self.0.options = v.into();
21346 self
21347 }
21348
21349 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21356 (*self.0.stub)
21357 .update_security_profile_group(self.0.request, self.0.options)
21358 .await
21359 .map(crate::Response::into_body)
21360 }
21361
21362 pub fn poller(
21364 self,
21365 ) -> impl google_cloud_lro::Poller<
21366 crate::model::SecurityProfileGroup,
21367 crate::model::OperationMetadata,
21368 > {
21369 type Operation = google_cloud_lro::internal::Operation<
21370 crate::model::SecurityProfileGroup,
21371 crate::model::OperationMetadata,
21372 >;
21373 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21374 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21375 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21376 if let Some(ref mut details) = poller_options.tracing {
21377 details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::update_security_profile_group::until_done";
21378 }
21379
21380 let stub = self.0.stub.clone();
21381 let mut options = self.0.options.clone();
21382 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21383 let query = move |name| {
21384 let stub = stub.clone();
21385 let options = options.clone();
21386 async {
21387 let op = GetOperation::new(stub)
21388 .set_name(name)
21389 .with_options(options)
21390 .send()
21391 .await?;
21392 Ok(Operation::new(op))
21393 }
21394 };
21395
21396 let start = move || async {
21397 let op = self.send().await?;
21398 Ok(Operation::new(op))
21399 };
21400
21401 use google_cloud_lro::internal::PollerExt;
21402 {
21403 google_cloud_lro::internal::new_poller(
21404 polling_error_policy,
21405 polling_backoff_policy,
21406 start,
21407 query,
21408 )
21409 }
21410 .with_options(poller_options)
21411 }
21412
21413 pub fn set_update_mask<T>(mut self, v: T) -> Self
21417 where
21418 T: std::convert::Into<wkt::FieldMask>,
21419 {
21420 self.0.request.update_mask = std::option::Option::Some(v.into());
21421 self
21422 }
21423
21424 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21428 where
21429 T: std::convert::Into<wkt::FieldMask>,
21430 {
21431 self.0.request.update_mask = v.map(|x| x.into());
21432 self
21433 }
21434
21435 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
21439 where
21440 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21441 {
21442 self.0.request.security_profile_group = std::option::Option::Some(v.into());
21443 self
21444 }
21445
21446 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
21450 where
21451 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21452 {
21453 self.0.request.security_profile_group = v.map(|x| x.into());
21454 self
21455 }
21456 }
21457
21458 #[doc(hidden)]
21459 impl crate::RequestBuilder for UpdateSecurityProfileGroup {
21460 fn request_options(&mut self) -> &mut crate::RequestOptions {
21461 &mut self.0.options
21462 }
21463 }
21464
21465 #[derive(Clone, Debug)]
21483 pub struct DeleteSecurityProfileGroup(
21484 RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
21485 );
21486
21487 impl DeleteSecurityProfileGroup {
21488 pub(crate) fn new(
21489 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21490 ) -> Self {
21491 Self(RequestBuilder::new(stub))
21492 }
21493
21494 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
21496 mut self,
21497 v: V,
21498 ) -> Self {
21499 self.0.request = v.into();
21500 self
21501 }
21502
21503 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21505 self.0.options = v.into();
21506 self
21507 }
21508
21509 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21516 (*self.0.stub)
21517 .delete_security_profile_group(self.0.request, self.0.options)
21518 .await
21519 .map(crate::Response::into_body)
21520 }
21521
21522 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
21524 type Operation =
21525 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
21526 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21527 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21528 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21529 if let Some(ref mut details) = poller_options.tracing {
21530 details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::delete_security_profile_group::until_done";
21531 }
21532
21533 let stub = self.0.stub.clone();
21534 let mut options = self.0.options.clone();
21535 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21536 let query = move |name| {
21537 let stub = stub.clone();
21538 let options = options.clone();
21539 async {
21540 let op = GetOperation::new(stub)
21541 .set_name(name)
21542 .with_options(options)
21543 .send()
21544 .await?;
21545 Ok(Operation::new(op))
21546 }
21547 };
21548
21549 let start = move || async {
21550 let op = self.send().await?;
21551 Ok(Operation::new(op))
21552 };
21553
21554 use google_cloud_lro::internal::PollerExt;
21555 {
21556 google_cloud_lro::internal::new_unit_response_poller(
21557 polling_error_policy,
21558 polling_backoff_policy,
21559 start,
21560 query,
21561 )
21562 }
21563 .with_options(poller_options)
21564 }
21565
21566 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21570 self.0.request.name = v.into();
21571 self
21572 }
21573
21574 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
21576 self.0.request.etag = v.into();
21577 self
21578 }
21579 }
21580
21581 #[doc(hidden)]
21582 impl crate::RequestBuilder for DeleteSecurityProfileGroup {
21583 fn request_options(&mut self) -> &mut crate::RequestOptions {
21584 &mut self.0.options
21585 }
21586 }
21587
21588 #[derive(Clone, Debug)]
21609 pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
21610
21611 impl ListSecurityProfiles {
21612 pub(crate) fn new(
21613 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21614 ) -> Self {
21615 Self(RequestBuilder::new(stub))
21616 }
21617
21618 pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
21620 mut self,
21621 v: V,
21622 ) -> Self {
21623 self.0.request = v.into();
21624 self
21625 }
21626
21627 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21629 self.0.options = v.into();
21630 self
21631 }
21632
21633 pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
21635 (*self.0.stub)
21636 .list_security_profiles(self.0.request, self.0.options)
21637 .await
21638 .map(crate::Response::into_body)
21639 }
21640
21641 pub fn by_page(
21643 self,
21644 ) -> impl google_cloud_gax::paginator::Paginator<
21645 crate::model::ListSecurityProfilesResponse,
21646 crate::Error,
21647 > {
21648 use std::clone::Clone;
21649 let token = self.0.request.page_token.clone();
21650 let execute = move |token: String| {
21651 let mut builder = self.clone();
21652 builder.0.request = builder.0.request.set_page_token(token);
21653 builder.send()
21654 };
21655 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21656 }
21657
21658 pub fn by_item(
21660 self,
21661 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21662 crate::model::ListSecurityProfilesResponse,
21663 crate::Error,
21664 > {
21665 use google_cloud_gax::paginator::Paginator;
21666 self.by_page().items()
21667 }
21668
21669 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21673 self.0.request.parent = v.into();
21674 self
21675 }
21676
21677 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21679 self.0.request.page_size = v.into();
21680 self
21681 }
21682
21683 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21685 self.0.request.page_token = v.into();
21686 self
21687 }
21688 }
21689
21690 #[doc(hidden)]
21691 impl crate::RequestBuilder for ListSecurityProfiles {
21692 fn request_options(&mut self) -> &mut crate::RequestOptions {
21693 &mut self.0.options
21694 }
21695 }
21696
21697 #[derive(Clone, Debug)]
21714 pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
21715
21716 impl GetSecurityProfile {
21717 pub(crate) fn new(
21718 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21719 ) -> Self {
21720 Self(RequestBuilder::new(stub))
21721 }
21722
21723 pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
21725 mut self,
21726 v: V,
21727 ) -> Self {
21728 self.0.request = v.into();
21729 self
21730 }
21731
21732 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21734 self.0.options = v.into();
21735 self
21736 }
21737
21738 pub async fn send(self) -> Result<crate::model::SecurityProfile> {
21740 (*self.0.stub)
21741 .get_security_profile(self.0.request, self.0.options)
21742 .await
21743 .map(crate::Response::into_body)
21744 }
21745
21746 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21750 self.0.request.name = v.into();
21751 self
21752 }
21753 }
21754
21755 #[doc(hidden)]
21756 impl crate::RequestBuilder for GetSecurityProfile {
21757 fn request_options(&mut self) -> &mut crate::RequestOptions {
21758 &mut self.0.options
21759 }
21760 }
21761
21762 #[derive(Clone, Debug)]
21780 pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
21781
21782 impl CreateSecurityProfile {
21783 pub(crate) fn new(
21784 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21785 ) -> Self {
21786 Self(RequestBuilder::new(stub))
21787 }
21788
21789 pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
21791 mut self,
21792 v: V,
21793 ) -> Self {
21794 self.0.request = v.into();
21795 self
21796 }
21797
21798 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21800 self.0.options = v.into();
21801 self
21802 }
21803
21804 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21811 (*self.0.stub)
21812 .create_security_profile(self.0.request, self.0.options)
21813 .await
21814 .map(crate::Response::into_body)
21815 }
21816
21817 pub fn poller(
21819 self,
21820 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
21821 {
21822 type Operation = google_cloud_lro::internal::Operation<
21823 crate::model::SecurityProfile,
21824 crate::model::OperationMetadata,
21825 >;
21826 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21827 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21828 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21829 if let Some(ref mut details) = poller_options.tracing {
21830 details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::create_security_profile::until_done";
21831 }
21832
21833 let stub = self.0.stub.clone();
21834 let mut options = self.0.options.clone();
21835 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21836 let query = move |name| {
21837 let stub = stub.clone();
21838 let options = options.clone();
21839 async {
21840 let op = GetOperation::new(stub)
21841 .set_name(name)
21842 .with_options(options)
21843 .send()
21844 .await?;
21845 Ok(Operation::new(op))
21846 }
21847 };
21848
21849 let start = move || async {
21850 let op = self.send().await?;
21851 Ok(Operation::new(op))
21852 };
21853
21854 use google_cloud_lro::internal::PollerExt;
21855 {
21856 google_cloud_lro::internal::new_poller(
21857 polling_error_policy,
21858 polling_backoff_policy,
21859 start,
21860 query,
21861 )
21862 }
21863 .with_options(poller_options)
21864 }
21865
21866 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21870 self.0.request.parent = v.into();
21871 self
21872 }
21873
21874 pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21878 self.0.request.security_profile_id = v.into();
21879 self
21880 }
21881
21882 pub fn set_security_profile<T>(mut self, v: T) -> Self
21886 where
21887 T: std::convert::Into<crate::model::SecurityProfile>,
21888 {
21889 self.0.request.security_profile = std::option::Option::Some(v.into());
21890 self
21891 }
21892
21893 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
21897 where
21898 T: std::convert::Into<crate::model::SecurityProfile>,
21899 {
21900 self.0.request.security_profile = v.map(|x| x.into());
21901 self
21902 }
21903 }
21904
21905 #[doc(hidden)]
21906 impl crate::RequestBuilder for CreateSecurityProfile {
21907 fn request_options(&mut self) -> &mut crate::RequestOptions {
21908 &mut self.0.options
21909 }
21910 }
21911
21912 #[derive(Clone, Debug)]
21930 pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
21931
21932 impl UpdateSecurityProfile {
21933 pub(crate) fn new(
21934 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21935 ) -> Self {
21936 Self(RequestBuilder::new(stub))
21937 }
21938
21939 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
21941 mut self,
21942 v: V,
21943 ) -> Self {
21944 self.0.request = v.into();
21945 self
21946 }
21947
21948 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21950 self.0.options = v.into();
21951 self
21952 }
21953
21954 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21961 (*self.0.stub)
21962 .update_security_profile(self.0.request, self.0.options)
21963 .await
21964 .map(crate::Response::into_body)
21965 }
21966
21967 pub fn poller(
21969 self,
21970 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
21971 {
21972 type Operation = google_cloud_lro::internal::Operation<
21973 crate::model::SecurityProfile,
21974 crate::model::OperationMetadata,
21975 >;
21976 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21977 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21978 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21979 if let Some(ref mut details) = poller_options.tracing {
21980 details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::update_security_profile::until_done";
21981 }
21982
21983 let stub = self.0.stub.clone();
21984 let mut options = self.0.options.clone();
21985 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21986 let query = move |name| {
21987 let stub = stub.clone();
21988 let options = options.clone();
21989 async {
21990 let op = GetOperation::new(stub)
21991 .set_name(name)
21992 .with_options(options)
21993 .send()
21994 .await?;
21995 Ok(Operation::new(op))
21996 }
21997 };
21998
21999 let start = move || async {
22000 let op = self.send().await?;
22001 Ok(Operation::new(op))
22002 };
22003
22004 use google_cloud_lro::internal::PollerExt;
22005 {
22006 google_cloud_lro::internal::new_poller(
22007 polling_error_policy,
22008 polling_backoff_policy,
22009 start,
22010 query,
22011 )
22012 }
22013 .with_options(poller_options)
22014 }
22015
22016 pub fn set_update_mask<T>(mut self, v: T) -> Self
22020 where
22021 T: std::convert::Into<wkt::FieldMask>,
22022 {
22023 self.0.request.update_mask = std::option::Option::Some(v.into());
22024 self
22025 }
22026
22027 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22031 where
22032 T: std::convert::Into<wkt::FieldMask>,
22033 {
22034 self.0.request.update_mask = v.map(|x| x.into());
22035 self
22036 }
22037
22038 pub fn set_security_profile<T>(mut self, v: T) -> Self
22042 where
22043 T: std::convert::Into<crate::model::SecurityProfile>,
22044 {
22045 self.0.request.security_profile = std::option::Option::Some(v.into());
22046 self
22047 }
22048
22049 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22053 where
22054 T: std::convert::Into<crate::model::SecurityProfile>,
22055 {
22056 self.0.request.security_profile = v.map(|x| x.into());
22057 self
22058 }
22059 }
22060
22061 #[doc(hidden)]
22062 impl crate::RequestBuilder for UpdateSecurityProfile {
22063 fn request_options(&mut self) -> &mut crate::RequestOptions {
22064 &mut self.0.options
22065 }
22066 }
22067
22068 #[derive(Clone, Debug)]
22086 pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
22087
22088 impl DeleteSecurityProfile {
22089 pub(crate) fn new(
22090 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22091 ) -> Self {
22092 Self(RequestBuilder::new(stub))
22093 }
22094
22095 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
22097 mut self,
22098 v: V,
22099 ) -> Self {
22100 self.0.request = v.into();
22101 self
22102 }
22103
22104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22106 self.0.options = v.into();
22107 self
22108 }
22109
22110 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22117 (*self.0.stub)
22118 .delete_security_profile(self.0.request, self.0.options)
22119 .await
22120 .map(crate::Response::into_body)
22121 }
22122
22123 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
22125 type Operation =
22126 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
22127 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
22128 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
22129 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
22130 if let Some(ref mut details) = poller_options.tracing {
22131 details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::delete_security_profile::until_done";
22132 }
22133
22134 let stub = self.0.stub.clone();
22135 let mut options = self.0.options.clone();
22136 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
22137 let query = move |name| {
22138 let stub = stub.clone();
22139 let options = options.clone();
22140 async {
22141 let op = GetOperation::new(stub)
22142 .set_name(name)
22143 .with_options(options)
22144 .send()
22145 .await?;
22146 Ok(Operation::new(op))
22147 }
22148 };
22149
22150 let start = move || async {
22151 let op = self.send().await?;
22152 Ok(Operation::new(op))
22153 };
22154
22155 use google_cloud_lro::internal::PollerExt;
22156 {
22157 google_cloud_lro::internal::new_unit_response_poller(
22158 polling_error_policy,
22159 polling_backoff_policy,
22160 start,
22161 query,
22162 )
22163 }
22164 .with_options(poller_options)
22165 }
22166
22167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22171 self.0.request.name = v.into();
22172 self
22173 }
22174
22175 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
22177 self.0.request.etag = v.into();
22178 self
22179 }
22180 }
22181
22182 #[doc(hidden)]
22183 impl crate::RequestBuilder for DeleteSecurityProfile {
22184 fn request_options(&mut self) -> &mut crate::RequestOptions {
22185 &mut self.0.options
22186 }
22187 }
22188
22189 #[derive(Clone, Debug)]
22210 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
22211
22212 impl ListLocations {
22213 pub(crate) fn new(
22214 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22215 ) -> Self {
22216 Self(RequestBuilder::new(stub))
22217 }
22218
22219 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
22221 mut self,
22222 v: V,
22223 ) -> Self {
22224 self.0.request = v.into();
22225 self
22226 }
22227
22228 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22230 self.0.options = v.into();
22231 self
22232 }
22233
22234 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
22236 (*self.0.stub)
22237 .list_locations(self.0.request, self.0.options)
22238 .await
22239 .map(crate::Response::into_body)
22240 }
22241
22242 pub fn by_page(
22244 self,
22245 ) -> impl google_cloud_gax::paginator::Paginator<
22246 google_cloud_location::model::ListLocationsResponse,
22247 crate::Error,
22248 > {
22249 use std::clone::Clone;
22250 let token = self.0.request.page_token.clone();
22251 let execute = move |token: String| {
22252 let mut builder = self.clone();
22253 builder.0.request = builder.0.request.set_page_token(token);
22254 builder.send()
22255 };
22256 google_cloud_gax::paginator::internal::new_paginator(token, execute)
22257 }
22258
22259 pub fn by_item(
22261 self,
22262 ) -> impl google_cloud_gax::paginator::ItemPaginator<
22263 google_cloud_location::model::ListLocationsResponse,
22264 crate::Error,
22265 > {
22266 use google_cloud_gax::paginator::Paginator;
22267 self.by_page().items()
22268 }
22269
22270 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22272 self.0.request.name = v.into();
22273 self
22274 }
22275
22276 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22278 self.0.request.filter = v.into();
22279 self
22280 }
22281
22282 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22284 self.0.request.page_size = v.into();
22285 self
22286 }
22287
22288 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22290 self.0.request.page_token = v.into();
22291 self
22292 }
22293 }
22294
22295 #[doc(hidden)]
22296 impl crate::RequestBuilder for ListLocations {
22297 fn request_options(&mut self) -> &mut crate::RequestOptions {
22298 &mut self.0.options
22299 }
22300 }
22301
22302 #[derive(Clone, Debug)]
22319 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
22320
22321 impl GetLocation {
22322 pub(crate) fn new(
22323 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22324 ) -> Self {
22325 Self(RequestBuilder::new(stub))
22326 }
22327
22328 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
22330 mut self,
22331 v: V,
22332 ) -> Self {
22333 self.0.request = v.into();
22334 self
22335 }
22336
22337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22339 self.0.options = v.into();
22340 self
22341 }
22342
22343 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
22345 (*self.0.stub)
22346 .get_location(self.0.request, self.0.options)
22347 .await
22348 .map(crate::Response::into_body)
22349 }
22350
22351 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22353 self.0.request.name = v.into();
22354 self
22355 }
22356 }
22357
22358 #[doc(hidden)]
22359 impl crate::RequestBuilder for GetLocation {
22360 fn request_options(&mut self) -> &mut crate::RequestOptions {
22361 &mut self.0.options
22362 }
22363 }
22364
22365 #[derive(Clone, Debug)]
22382 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
22383
22384 impl SetIamPolicy {
22385 pub(crate) fn new(
22386 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22387 ) -> Self {
22388 Self(RequestBuilder::new(stub))
22389 }
22390
22391 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
22393 mut self,
22394 v: V,
22395 ) -> Self {
22396 self.0.request = v.into();
22397 self
22398 }
22399
22400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22402 self.0.options = v.into();
22403 self
22404 }
22405
22406 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
22408 (*self.0.stub)
22409 .set_iam_policy(self.0.request, self.0.options)
22410 .await
22411 .map(crate::Response::into_body)
22412 }
22413
22414 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
22418 self.0.request.resource = v.into();
22419 self
22420 }
22421
22422 pub fn set_policy<T>(mut self, v: T) -> Self
22426 where
22427 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
22428 {
22429 self.0.request.policy = std::option::Option::Some(v.into());
22430 self
22431 }
22432
22433 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
22437 where
22438 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
22439 {
22440 self.0.request.policy = v.map(|x| x.into());
22441 self
22442 }
22443
22444 pub fn set_update_mask<T>(mut self, v: T) -> Self
22446 where
22447 T: std::convert::Into<wkt::FieldMask>,
22448 {
22449 self.0.request.update_mask = std::option::Option::Some(v.into());
22450 self
22451 }
22452
22453 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22455 where
22456 T: std::convert::Into<wkt::FieldMask>,
22457 {
22458 self.0.request.update_mask = v.map(|x| x.into());
22459 self
22460 }
22461 }
22462
22463 #[doc(hidden)]
22464 impl crate::RequestBuilder for SetIamPolicy {
22465 fn request_options(&mut self) -> &mut crate::RequestOptions {
22466 &mut self.0.options
22467 }
22468 }
22469
22470 #[derive(Clone, Debug)]
22487 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
22488
22489 impl GetIamPolicy {
22490 pub(crate) fn new(
22491 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22492 ) -> Self {
22493 Self(RequestBuilder::new(stub))
22494 }
22495
22496 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
22498 mut self,
22499 v: V,
22500 ) -> Self {
22501 self.0.request = v.into();
22502 self
22503 }
22504
22505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22507 self.0.options = v.into();
22508 self
22509 }
22510
22511 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
22513 (*self.0.stub)
22514 .get_iam_policy(self.0.request, self.0.options)
22515 .await
22516 .map(crate::Response::into_body)
22517 }
22518
22519 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
22523 self.0.request.resource = v.into();
22524 self
22525 }
22526
22527 pub fn set_options<T>(mut self, v: T) -> Self
22529 where
22530 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
22531 {
22532 self.0.request.options = std::option::Option::Some(v.into());
22533 self
22534 }
22535
22536 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
22538 where
22539 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
22540 {
22541 self.0.request.options = v.map(|x| x.into());
22542 self
22543 }
22544 }
22545
22546 #[doc(hidden)]
22547 impl crate::RequestBuilder for GetIamPolicy {
22548 fn request_options(&mut self) -> &mut crate::RequestOptions {
22549 &mut self.0.options
22550 }
22551 }
22552
22553 #[derive(Clone, Debug)]
22570 pub struct TestIamPermissions(
22571 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
22572 );
22573
22574 impl TestIamPermissions {
22575 pub(crate) fn new(
22576 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22577 ) -> Self {
22578 Self(RequestBuilder::new(stub))
22579 }
22580
22581 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
22583 mut self,
22584 v: V,
22585 ) -> Self {
22586 self.0.request = v.into();
22587 self
22588 }
22589
22590 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22592 self.0.options = v.into();
22593 self
22594 }
22595
22596 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
22598 (*self.0.stub)
22599 .test_iam_permissions(self.0.request, self.0.options)
22600 .await
22601 .map(crate::Response::into_body)
22602 }
22603
22604 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
22608 self.0.request.resource = v.into();
22609 self
22610 }
22611
22612 pub fn set_permissions<T, V>(mut self, v: T) -> Self
22616 where
22617 T: std::iter::IntoIterator<Item = V>,
22618 V: std::convert::Into<std::string::String>,
22619 {
22620 use std::iter::Iterator;
22621 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
22622 self
22623 }
22624 }
22625
22626 #[doc(hidden)]
22627 impl crate::RequestBuilder for TestIamPermissions {
22628 fn request_options(&mut self) -> &mut crate::RequestOptions {
22629 &mut self.0.options
22630 }
22631 }
22632
22633 #[derive(Clone, Debug)]
22654 pub struct ListOperations(
22655 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
22656 );
22657
22658 impl ListOperations {
22659 pub(crate) fn new(
22660 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22661 ) -> Self {
22662 Self(RequestBuilder::new(stub))
22663 }
22664
22665 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
22667 mut self,
22668 v: V,
22669 ) -> Self {
22670 self.0.request = v.into();
22671 self
22672 }
22673
22674 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22676 self.0.options = v.into();
22677 self
22678 }
22679
22680 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
22682 (*self.0.stub)
22683 .list_operations(self.0.request, self.0.options)
22684 .await
22685 .map(crate::Response::into_body)
22686 }
22687
22688 pub fn by_page(
22690 self,
22691 ) -> impl google_cloud_gax::paginator::Paginator<
22692 google_cloud_longrunning::model::ListOperationsResponse,
22693 crate::Error,
22694 > {
22695 use std::clone::Clone;
22696 let token = self.0.request.page_token.clone();
22697 let execute = move |token: String| {
22698 let mut builder = self.clone();
22699 builder.0.request = builder.0.request.set_page_token(token);
22700 builder.send()
22701 };
22702 google_cloud_gax::paginator::internal::new_paginator(token, execute)
22703 }
22704
22705 pub fn by_item(
22707 self,
22708 ) -> impl google_cloud_gax::paginator::ItemPaginator<
22709 google_cloud_longrunning::model::ListOperationsResponse,
22710 crate::Error,
22711 > {
22712 use google_cloud_gax::paginator::Paginator;
22713 self.by_page().items()
22714 }
22715
22716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22718 self.0.request.name = v.into();
22719 self
22720 }
22721
22722 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22724 self.0.request.filter = v.into();
22725 self
22726 }
22727
22728 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22730 self.0.request.page_size = v.into();
22731 self
22732 }
22733
22734 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22736 self.0.request.page_token = v.into();
22737 self
22738 }
22739
22740 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22742 self.0.request.return_partial_success = v.into();
22743 self
22744 }
22745 }
22746
22747 #[doc(hidden)]
22748 impl crate::RequestBuilder for ListOperations {
22749 fn request_options(&mut self) -> &mut crate::RequestOptions {
22750 &mut self.0.options
22751 }
22752 }
22753
22754 #[derive(Clone, Debug)]
22771 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22772
22773 impl GetOperation {
22774 pub(crate) fn new(
22775 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22776 ) -> Self {
22777 Self(RequestBuilder::new(stub))
22778 }
22779
22780 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22782 mut self,
22783 v: V,
22784 ) -> Self {
22785 self.0.request = v.into();
22786 self
22787 }
22788
22789 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22791 self.0.options = v.into();
22792 self
22793 }
22794
22795 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22797 (*self.0.stub)
22798 .get_operation(self.0.request, self.0.options)
22799 .await
22800 .map(crate::Response::into_body)
22801 }
22802
22803 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22805 self.0.request.name = v.into();
22806 self
22807 }
22808 }
22809
22810 #[doc(hidden)]
22811 impl crate::RequestBuilder for GetOperation {
22812 fn request_options(&mut self) -> &mut crate::RequestOptions {
22813 &mut self.0.options
22814 }
22815 }
22816
22817 #[derive(Clone, Debug)]
22834 pub struct DeleteOperation(
22835 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
22836 );
22837
22838 impl DeleteOperation {
22839 pub(crate) fn new(
22840 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22841 ) -> Self {
22842 Self(RequestBuilder::new(stub))
22843 }
22844
22845 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
22847 mut self,
22848 v: V,
22849 ) -> Self {
22850 self.0.request = v.into();
22851 self
22852 }
22853
22854 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22856 self.0.options = v.into();
22857 self
22858 }
22859
22860 pub async fn send(self) -> Result<()> {
22862 (*self.0.stub)
22863 .delete_operation(self.0.request, self.0.options)
22864 .await
22865 .map(crate::Response::into_body)
22866 }
22867
22868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22870 self.0.request.name = v.into();
22871 self
22872 }
22873 }
22874
22875 #[doc(hidden)]
22876 impl crate::RequestBuilder for DeleteOperation {
22877 fn request_options(&mut self) -> &mut crate::RequestOptions {
22878 &mut self.0.options
22879 }
22880 }
22881
22882 #[derive(Clone, Debug)]
22899 pub struct CancelOperation(
22900 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22901 );
22902
22903 impl CancelOperation {
22904 pub(crate) fn new(
22905 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22906 ) -> Self {
22907 Self(RequestBuilder::new(stub))
22908 }
22909
22910 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22912 mut self,
22913 v: V,
22914 ) -> Self {
22915 self.0.request = v.into();
22916 self
22917 }
22918
22919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22921 self.0.options = v.into();
22922 self
22923 }
22924
22925 pub async fn send(self) -> Result<()> {
22927 (*self.0.stub)
22928 .cancel_operation(self.0.request, self.0.options)
22929 .await
22930 .map(crate::Response::into_body)
22931 }
22932
22933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22935 self.0.request.name = v.into();
22936 self
22937 }
22938 }
22939
22940 #[doc(hidden)]
22941 impl crate::RequestBuilder for CancelOperation {
22942 fn request_options(&mut self) -> &mut crate::RequestOptions {
22943 &mut self.0.options
22944 }
22945 }
22946}
22947
22948pub mod organization_security_profile_group_service {
22950 use crate::Result;
22951
22952 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22966
22967 pub(crate) mod client {
22968 use super::super::super::client::OrganizationSecurityProfileGroupService;
22969 pub struct Factory;
22970 impl crate::ClientFactory for Factory {
22971 type Client = OrganizationSecurityProfileGroupService;
22972 type Credentials = gaxi::options::Credentials;
22973 async fn build(
22974 self,
22975 config: gaxi::options::ClientConfig,
22976 ) -> crate::ClientBuilderResult<Self::Client> {
22977 Self::Client::new(config).await
22978 }
22979 }
22980 }
22981
22982 #[derive(Clone, Debug)]
22984 pub(crate) struct RequestBuilder<R: std::default::Default> {
22985 stub: std::sync::Arc<
22986 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22987 >,
22988 request: R,
22989 options: crate::RequestOptions,
22990 }
22991
22992 impl<R> RequestBuilder<R>
22993 where
22994 R: std::default::Default,
22995 {
22996 pub(crate) fn new(
22997 stub: std::sync::Arc<
22998 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22999 >,
23000 ) -> Self {
23001 Self {
23002 stub,
23003 request: R::default(),
23004 options: crate::RequestOptions::default(),
23005 }
23006 }
23007 }
23008
23009 #[derive(Clone, Debug)]
23030 pub struct ListSecurityProfileGroups(
23031 RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
23032 );
23033
23034 impl ListSecurityProfileGroups {
23035 pub(crate) fn new(
23036 stub: std::sync::Arc<
23037 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23038 >,
23039 ) -> Self {
23040 Self(RequestBuilder::new(stub))
23041 }
23042
23043 pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
23045 mut self,
23046 v: V,
23047 ) -> Self {
23048 self.0.request = v.into();
23049 self
23050 }
23051
23052 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23054 self.0.options = v.into();
23055 self
23056 }
23057
23058 pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
23060 (*self.0.stub)
23061 .list_security_profile_groups(self.0.request, self.0.options)
23062 .await
23063 .map(crate::Response::into_body)
23064 }
23065
23066 pub fn by_page(
23068 self,
23069 ) -> impl google_cloud_gax::paginator::Paginator<
23070 crate::model::ListSecurityProfileGroupsResponse,
23071 crate::Error,
23072 > {
23073 use std::clone::Clone;
23074 let token = self.0.request.page_token.clone();
23075 let execute = move |token: String| {
23076 let mut builder = self.clone();
23077 builder.0.request = builder.0.request.set_page_token(token);
23078 builder.send()
23079 };
23080 google_cloud_gax::paginator::internal::new_paginator(token, execute)
23081 }
23082
23083 pub fn by_item(
23085 self,
23086 ) -> impl google_cloud_gax::paginator::ItemPaginator<
23087 crate::model::ListSecurityProfileGroupsResponse,
23088 crate::Error,
23089 > {
23090 use google_cloud_gax::paginator::Paginator;
23091 self.by_page().items()
23092 }
23093
23094 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23098 self.0.request.parent = v.into();
23099 self
23100 }
23101
23102 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23104 self.0.request.page_size = v.into();
23105 self
23106 }
23107
23108 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23110 self.0.request.page_token = v.into();
23111 self
23112 }
23113 }
23114
23115 #[doc(hidden)]
23116 impl crate::RequestBuilder for ListSecurityProfileGroups {
23117 fn request_options(&mut self) -> &mut crate::RequestOptions {
23118 &mut self.0.options
23119 }
23120 }
23121
23122 #[derive(Clone, Debug)]
23139 pub struct GetSecurityProfileGroup(
23140 RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
23141 );
23142
23143 impl GetSecurityProfileGroup {
23144 pub(crate) fn new(
23145 stub: std::sync::Arc<
23146 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23147 >,
23148 ) -> Self {
23149 Self(RequestBuilder::new(stub))
23150 }
23151
23152 pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
23154 mut self,
23155 v: V,
23156 ) -> Self {
23157 self.0.request = v.into();
23158 self
23159 }
23160
23161 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23163 self.0.options = v.into();
23164 self
23165 }
23166
23167 pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
23169 (*self.0.stub)
23170 .get_security_profile_group(self.0.request, self.0.options)
23171 .await
23172 .map(crate::Response::into_body)
23173 }
23174
23175 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23179 self.0.request.name = v.into();
23180 self
23181 }
23182 }
23183
23184 #[doc(hidden)]
23185 impl crate::RequestBuilder for GetSecurityProfileGroup {
23186 fn request_options(&mut self) -> &mut crate::RequestOptions {
23187 &mut self.0.options
23188 }
23189 }
23190
23191 #[derive(Clone, Debug)]
23209 pub struct CreateSecurityProfileGroup(
23210 RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
23211 );
23212
23213 impl CreateSecurityProfileGroup {
23214 pub(crate) fn new(
23215 stub: std::sync::Arc<
23216 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23217 >,
23218 ) -> Self {
23219 Self(RequestBuilder::new(stub))
23220 }
23221
23222 pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
23224 mut self,
23225 v: V,
23226 ) -> Self {
23227 self.0.request = v.into();
23228 self
23229 }
23230
23231 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23233 self.0.options = v.into();
23234 self
23235 }
23236
23237 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23244 (*self.0.stub)
23245 .create_security_profile_group(self.0.request, self.0.options)
23246 .await
23247 .map(crate::Response::into_body)
23248 }
23249
23250 pub fn poller(
23252 self,
23253 ) -> impl google_cloud_lro::Poller<
23254 crate::model::SecurityProfileGroup,
23255 crate::model::OperationMetadata,
23256 > {
23257 type Operation = google_cloud_lro::internal::Operation<
23258 crate::model::SecurityProfileGroup,
23259 crate::model::OperationMetadata,
23260 >;
23261 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23262 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23263 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
23264 if let Some(ref mut details) = poller_options.tracing {
23265 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::create_security_profile_group::until_done";
23266 }
23267
23268 let stub = self.0.stub.clone();
23269 let mut options = self.0.options.clone();
23270 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23271 let query = move |name| {
23272 let stub = stub.clone();
23273 let options = options.clone();
23274 async {
23275 let op = GetOperation::new(stub)
23276 .set_name(name)
23277 .with_options(options)
23278 .send()
23279 .await?;
23280 Ok(Operation::new(op))
23281 }
23282 };
23283
23284 let start = move || async {
23285 let op = self.send().await?;
23286 Ok(Operation::new(op))
23287 };
23288
23289 use google_cloud_lro::internal::PollerExt;
23290 {
23291 google_cloud_lro::internal::new_poller(
23292 polling_error_policy,
23293 polling_backoff_policy,
23294 start,
23295 query,
23296 )
23297 }
23298 .with_options(poller_options)
23299 }
23300
23301 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23305 self.0.request.parent = v.into();
23306 self
23307 }
23308
23309 pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
23313 self.0.request.security_profile_group_id = v.into();
23314 self
23315 }
23316
23317 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
23321 where
23322 T: std::convert::Into<crate::model::SecurityProfileGroup>,
23323 {
23324 self.0.request.security_profile_group = std::option::Option::Some(v.into());
23325 self
23326 }
23327
23328 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
23332 where
23333 T: std::convert::Into<crate::model::SecurityProfileGroup>,
23334 {
23335 self.0.request.security_profile_group = v.map(|x| x.into());
23336 self
23337 }
23338 }
23339
23340 #[doc(hidden)]
23341 impl crate::RequestBuilder for CreateSecurityProfileGroup {
23342 fn request_options(&mut self) -> &mut crate::RequestOptions {
23343 &mut self.0.options
23344 }
23345 }
23346
23347 #[derive(Clone, Debug)]
23365 pub struct UpdateSecurityProfileGroup(
23366 RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
23367 );
23368
23369 impl UpdateSecurityProfileGroup {
23370 pub(crate) fn new(
23371 stub: std::sync::Arc<
23372 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23373 >,
23374 ) -> Self {
23375 Self(RequestBuilder::new(stub))
23376 }
23377
23378 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
23380 mut self,
23381 v: V,
23382 ) -> Self {
23383 self.0.request = v.into();
23384 self
23385 }
23386
23387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23389 self.0.options = v.into();
23390 self
23391 }
23392
23393 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23400 (*self.0.stub)
23401 .update_security_profile_group(self.0.request, self.0.options)
23402 .await
23403 .map(crate::Response::into_body)
23404 }
23405
23406 pub fn poller(
23408 self,
23409 ) -> impl google_cloud_lro::Poller<
23410 crate::model::SecurityProfileGroup,
23411 crate::model::OperationMetadata,
23412 > {
23413 type Operation = google_cloud_lro::internal::Operation<
23414 crate::model::SecurityProfileGroup,
23415 crate::model::OperationMetadata,
23416 >;
23417 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23418 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23419 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
23420 if let Some(ref mut details) = poller_options.tracing {
23421 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::update_security_profile_group::until_done";
23422 }
23423
23424 let stub = self.0.stub.clone();
23425 let mut options = self.0.options.clone();
23426 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23427 let query = move |name| {
23428 let stub = stub.clone();
23429 let options = options.clone();
23430 async {
23431 let op = GetOperation::new(stub)
23432 .set_name(name)
23433 .with_options(options)
23434 .send()
23435 .await?;
23436 Ok(Operation::new(op))
23437 }
23438 };
23439
23440 let start = move || async {
23441 let op = self.send().await?;
23442 Ok(Operation::new(op))
23443 };
23444
23445 use google_cloud_lro::internal::PollerExt;
23446 {
23447 google_cloud_lro::internal::new_poller(
23448 polling_error_policy,
23449 polling_backoff_policy,
23450 start,
23451 query,
23452 )
23453 }
23454 .with_options(poller_options)
23455 }
23456
23457 pub fn set_update_mask<T>(mut self, v: T) -> Self
23461 where
23462 T: std::convert::Into<wkt::FieldMask>,
23463 {
23464 self.0.request.update_mask = std::option::Option::Some(v.into());
23465 self
23466 }
23467
23468 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23472 where
23473 T: std::convert::Into<wkt::FieldMask>,
23474 {
23475 self.0.request.update_mask = v.map(|x| x.into());
23476 self
23477 }
23478
23479 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
23483 where
23484 T: std::convert::Into<crate::model::SecurityProfileGroup>,
23485 {
23486 self.0.request.security_profile_group = std::option::Option::Some(v.into());
23487 self
23488 }
23489
23490 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
23494 where
23495 T: std::convert::Into<crate::model::SecurityProfileGroup>,
23496 {
23497 self.0.request.security_profile_group = v.map(|x| x.into());
23498 self
23499 }
23500 }
23501
23502 #[doc(hidden)]
23503 impl crate::RequestBuilder for UpdateSecurityProfileGroup {
23504 fn request_options(&mut self) -> &mut crate::RequestOptions {
23505 &mut self.0.options
23506 }
23507 }
23508
23509 #[derive(Clone, Debug)]
23527 pub struct DeleteSecurityProfileGroup(
23528 RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
23529 );
23530
23531 impl DeleteSecurityProfileGroup {
23532 pub(crate) fn new(
23533 stub: std::sync::Arc<
23534 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23535 >,
23536 ) -> Self {
23537 Self(RequestBuilder::new(stub))
23538 }
23539
23540 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
23542 mut self,
23543 v: V,
23544 ) -> Self {
23545 self.0.request = v.into();
23546 self
23547 }
23548
23549 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23551 self.0.options = v.into();
23552 self
23553 }
23554
23555 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23562 (*self.0.stub)
23563 .delete_security_profile_group(self.0.request, self.0.options)
23564 .await
23565 .map(crate::Response::into_body)
23566 }
23567
23568 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
23570 type Operation =
23571 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
23572 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23573 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23574 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
23575 if let Some(ref mut details) = poller_options.tracing {
23576 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::delete_security_profile_group::until_done";
23577 }
23578
23579 let stub = self.0.stub.clone();
23580 let mut options = self.0.options.clone();
23581 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23582 let query = move |name| {
23583 let stub = stub.clone();
23584 let options = options.clone();
23585 async {
23586 let op = GetOperation::new(stub)
23587 .set_name(name)
23588 .with_options(options)
23589 .send()
23590 .await?;
23591 Ok(Operation::new(op))
23592 }
23593 };
23594
23595 let start = move || async {
23596 let op = self.send().await?;
23597 Ok(Operation::new(op))
23598 };
23599
23600 use google_cloud_lro::internal::PollerExt;
23601 {
23602 google_cloud_lro::internal::new_unit_response_poller(
23603 polling_error_policy,
23604 polling_backoff_policy,
23605 start,
23606 query,
23607 )
23608 }
23609 .with_options(poller_options)
23610 }
23611
23612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23616 self.0.request.name = v.into();
23617 self
23618 }
23619
23620 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
23622 self.0.request.etag = v.into();
23623 self
23624 }
23625 }
23626
23627 #[doc(hidden)]
23628 impl crate::RequestBuilder for DeleteSecurityProfileGroup {
23629 fn request_options(&mut self) -> &mut crate::RequestOptions {
23630 &mut self.0.options
23631 }
23632 }
23633
23634 #[derive(Clone, Debug)]
23655 pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
23656
23657 impl ListSecurityProfiles {
23658 pub(crate) fn new(
23659 stub: std::sync::Arc<
23660 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23661 >,
23662 ) -> Self {
23663 Self(RequestBuilder::new(stub))
23664 }
23665
23666 pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
23668 mut self,
23669 v: V,
23670 ) -> Self {
23671 self.0.request = v.into();
23672 self
23673 }
23674
23675 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23677 self.0.options = v.into();
23678 self
23679 }
23680
23681 pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
23683 (*self.0.stub)
23684 .list_security_profiles(self.0.request, self.0.options)
23685 .await
23686 .map(crate::Response::into_body)
23687 }
23688
23689 pub fn by_page(
23691 self,
23692 ) -> impl google_cloud_gax::paginator::Paginator<
23693 crate::model::ListSecurityProfilesResponse,
23694 crate::Error,
23695 > {
23696 use std::clone::Clone;
23697 let token = self.0.request.page_token.clone();
23698 let execute = move |token: String| {
23699 let mut builder = self.clone();
23700 builder.0.request = builder.0.request.set_page_token(token);
23701 builder.send()
23702 };
23703 google_cloud_gax::paginator::internal::new_paginator(token, execute)
23704 }
23705
23706 pub fn by_item(
23708 self,
23709 ) -> impl google_cloud_gax::paginator::ItemPaginator<
23710 crate::model::ListSecurityProfilesResponse,
23711 crate::Error,
23712 > {
23713 use google_cloud_gax::paginator::Paginator;
23714 self.by_page().items()
23715 }
23716
23717 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23721 self.0.request.parent = v.into();
23722 self
23723 }
23724
23725 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23727 self.0.request.page_size = v.into();
23728 self
23729 }
23730
23731 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23733 self.0.request.page_token = v.into();
23734 self
23735 }
23736 }
23737
23738 #[doc(hidden)]
23739 impl crate::RequestBuilder for ListSecurityProfiles {
23740 fn request_options(&mut self) -> &mut crate::RequestOptions {
23741 &mut self.0.options
23742 }
23743 }
23744
23745 #[derive(Clone, Debug)]
23762 pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
23763
23764 impl GetSecurityProfile {
23765 pub(crate) fn new(
23766 stub: std::sync::Arc<
23767 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23768 >,
23769 ) -> Self {
23770 Self(RequestBuilder::new(stub))
23771 }
23772
23773 pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
23775 mut self,
23776 v: V,
23777 ) -> Self {
23778 self.0.request = v.into();
23779 self
23780 }
23781
23782 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23784 self.0.options = v.into();
23785 self
23786 }
23787
23788 pub async fn send(self) -> Result<crate::model::SecurityProfile> {
23790 (*self.0.stub)
23791 .get_security_profile(self.0.request, self.0.options)
23792 .await
23793 .map(crate::Response::into_body)
23794 }
23795
23796 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23800 self.0.request.name = v.into();
23801 self
23802 }
23803 }
23804
23805 #[doc(hidden)]
23806 impl crate::RequestBuilder for GetSecurityProfile {
23807 fn request_options(&mut self) -> &mut crate::RequestOptions {
23808 &mut self.0.options
23809 }
23810 }
23811
23812 #[derive(Clone, Debug)]
23830 pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
23831
23832 impl CreateSecurityProfile {
23833 pub(crate) fn new(
23834 stub: std::sync::Arc<
23835 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23836 >,
23837 ) -> Self {
23838 Self(RequestBuilder::new(stub))
23839 }
23840
23841 pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
23843 mut self,
23844 v: V,
23845 ) -> Self {
23846 self.0.request = v.into();
23847 self
23848 }
23849
23850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23852 self.0.options = v.into();
23853 self
23854 }
23855
23856 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23863 (*self.0.stub)
23864 .create_security_profile(self.0.request, self.0.options)
23865 .await
23866 .map(crate::Response::into_body)
23867 }
23868
23869 pub fn poller(
23871 self,
23872 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
23873 {
23874 type Operation = google_cloud_lro::internal::Operation<
23875 crate::model::SecurityProfile,
23876 crate::model::OperationMetadata,
23877 >;
23878 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23879 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23880 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
23881 if let Some(ref mut details) = poller_options.tracing {
23882 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::create_security_profile::until_done";
23883 }
23884
23885 let stub = self.0.stub.clone();
23886 let mut options = self.0.options.clone();
23887 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23888 let query = move |name| {
23889 let stub = stub.clone();
23890 let options = options.clone();
23891 async {
23892 let op = GetOperation::new(stub)
23893 .set_name(name)
23894 .with_options(options)
23895 .send()
23896 .await?;
23897 Ok(Operation::new(op))
23898 }
23899 };
23900
23901 let start = move || async {
23902 let op = self.send().await?;
23903 Ok(Operation::new(op))
23904 };
23905
23906 use google_cloud_lro::internal::PollerExt;
23907 {
23908 google_cloud_lro::internal::new_poller(
23909 polling_error_policy,
23910 polling_backoff_policy,
23911 start,
23912 query,
23913 )
23914 }
23915 .with_options(poller_options)
23916 }
23917
23918 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23922 self.0.request.parent = v.into();
23923 self
23924 }
23925
23926 pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
23930 self.0.request.security_profile_id = v.into();
23931 self
23932 }
23933
23934 pub fn set_security_profile<T>(mut self, v: T) -> Self
23938 where
23939 T: std::convert::Into<crate::model::SecurityProfile>,
23940 {
23941 self.0.request.security_profile = std::option::Option::Some(v.into());
23942 self
23943 }
23944
23945 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
23949 where
23950 T: std::convert::Into<crate::model::SecurityProfile>,
23951 {
23952 self.0.request.security_profile = v.map(|x| x.into());
23953 self
23954 }
23955 }
23956
23957 #[doc(hidden)]
23958 impl crate::RequestBuilder for CreateSecurityProfile {
23959 fn request_options(&mut self) -> &mut crate::RequestOptions {
23960 &mut self.0.options
23961 }
23962 }
23963
23964 #[derive(Clone, Debug)]
23982 pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
23983
23984 impl UpdateSecurityProfile {
23985 pub(crate) fn new(
23986 stub: std::sync::Arc<
23987 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23988 >,
23989 ) -> Self {
23990 Self(RequestBuilder::new(stub))
23991 }
23992
23993 pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
23995 mut self,
23996 v: V,
23997 ) -> Self {
23998 self.0.request = v.into();
23999 self
24000 }
24001
24002 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24004 self.0.options = v.into();
24005 self
24006 }
24007
24008 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24015 (*self.0.stub)
24016 .update_security_profile(self.0.request, self.0.options)
24017 .await
24018 .map(crate::Response::into_body)
24019 }
24020
24021 pub fn poller(
24023 self,
24024 ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
24025 {
24026 type Operation = google_cloud_lro::internal::Operation<
24027 crate::model::SecurityProfile,
24028 crate::model::OperationMetadata,
24029 >;
24030 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
24031 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
24032 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
24033 if let Some(ref mut details) = poller_options.tracing {
24034 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::update_security_profile::until_done";
24035 }
24036
24037 let stub = self.0.stub.clone();
24038 let mut options = self.0.options.clone();
24039 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
24040 let query = move |name| {
24041 let stub = stub.clone();
24042 let options = options.clone();
24043 async {
24044 let op = GetOperation::new(stub)
24045 .set_name(name)
24046 .with_options(options)
24047 .send()
24048 .await?;
24049 Ok(Operation::new(op))
24050 }
24051 };
24052
24053 let start = move || async {
24054 let op = self.send().await?;
24055 Ok(Operation::new(op))
24056 };
24057
24058 use google_cloud_lro::internal::PollerExt;
24059 {
24060 google_cloud_lro::internal::new_poller(
24061 polling_error_policy,
24062 polling_backoff_policy,
24063 start,
24064 query,
24065 )
24066 }
24067 .with_options(poller_options)
24068 }
24069
24070 pub fn set_update_mask<T>(mut self, v: T) -> Self
24074 where
24075 T: std::convert::Into<wkt::FieldMask>,
24076 {
24077 self.0.request.update_mask = std::option::Option::Some(v.into());
24078 self
24079 }
24080
24081 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
24085 where
24086 T: std::convert::Into<wkt::FieldMask>,
24087 {
24088 self.0.request.update_mask = v.map(|x| x.into());
24089 self
24090 }
24091
24092 pub fn set_security_profile<T>(mut self, v: T) -> Self
24096 where
24097 T: std::convert::Into<crate::model::SecurityProfile>,
24098 {
24099 self.0.request.security_profile = std::option::Option::Some(v.into());
24100 self
24101 }
24102
24103 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
24107 where
24108 T: std::convert::Into<crate::model::SecurityProfile>,
24109 {
24110 self.0.request.security_profile = v.map(|x| x.into());
24111 self
24112 }
24113 }
24114
24115 #[doc(hidden)]
24116 impl crate::RequestBuilder for UpdateSecurityProfile {
24117 fn request_options(&mut self) -> &mut crate::RequestOptions {
24118 &mut self.0.options
24119 }
24120 }
24121
24122 #[derive(Clone, Debug)]
24140 pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
24141
24142 impl DeleteSecurityProfile {
24143 pub(crate) fn new(
24144 stub: std::sync::Arc<
24145 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24146 >,
24147 ) -> Self {
24148 Self(RequestBuilder::new(stub))
24149 }
24150
24151 pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
24153 mut self,
24154 v: V,
24155 ) -> Self {
24156 self.0.request = v.into();
24157 self
24158 }
24159
24160 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24162 self.0.options = v.into();
24163 self
24164 }
24165
24166 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24173 (*self.0.stub)
24174 .delete_security_profile(self.0.request, self.0.options)
24175 .await
24176 .map(crate::Response::into_body)
24177 }
24178
24179 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
24181 type Operation =
24182 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
24183 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
24184 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
24185 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
24186 if let Some(ref mut details) = poller_options.tracing {
24187 details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::delete_security_profile::until_done";
24188 }
24189
24190 let stub = self.0.stub.clone();
24191 let mut options = self.0.options.clone();
24192 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
24193 let query = move |name| {
24194 let stub = stub.clone();
24195 let options = options.clone();
24196 async {
24197 let op = GetOperation::new(stub)
24198 .set_name(name)
24199 .with_options(options)
24200 .send()
24201 .await?;
24202 Ok(Operation::new(op))
24203 }
24204 };
24205
24206 let start = move || async {
24207 let op = self.send().await?;
24208 Ok(Operation::new(op))
24209 };
24210
24211 use google_cloud_lro::internal::PollerExt;
24212 {
24213 google_cloud_lro::internal::new_unit_response_poller(
24214 polling_error_policy,
24215 polling_backoff_policy,
24216 start,
24217 query,
24218 )
24219 }
24220 .with_options(poller_options)
24221 }
24222
24223 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24227 self.0.request.name = v.into();
24228 self
24229 }
24230
24231 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
24233 self.0.request.etag = v.into();
24234 self
24235 }
24236 }
24237
24238 #[doc(hidden)]
24239 impl crate::RequestBuilder for DeleteSecurityProfile {
24240 fn request_options(&mut self) -> &mut crate::RequestOptions {
24241 &mut self.0.options
24242 }
24243 }
24244
24245 #[derive(Clone, Debug)]
24266 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
24267
24268 impl ListLocations {
24269 pub(crate) fn new(
24270 stub: std::sync::Arc<
24271 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24272 >,
24273 ) -> Self {
24274 Self(RequestBuilder::new(stub))
24275 }
24276
24277 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
24279 mut self,
24280 v: V,
24281 ) -> Self {
24282 self.0.request = v.into();
24283 self
24284 }
24285
24286 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24288 self.0.options = v.into();
24289 self
24290 }
24291
24292 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
24294 (*self.0.stub)
24295 .list_locations(self.0.request, self.0.options)
24296 .await
24297 .map(crate::Response::into_body)
24298 }
24299
24300 pub fn by_page(
24302 self,
24303 ) -> impl google_cloud_gax::paginator::Paginator<
24304 google_cloud_location::model::ListLocationsResponse,
24305 crate::Error,
24306 > {
24307 use std::clone::Clone;
24308 let token = self.0.request.page_token.clone();
24309 let execute = move |token: String| {
24310 let mut builder = self.clone();
24311 builder.0.request = builder.0.request.set_page_token(token);
24312 builder.send()
24313 };
24314 google_cloud_gax::paginator::internal::new_paginator(token, execute)
24315 }
24316
24317 pub fn by_item(
24319 self,
24320 ) -> impl google_cloud_gax::paginator::ItemPaginator<
24321 google_cloud_location::model::ListLocationsResponse,
24322 crate::Error,
24323 > {
24324 use google_cloud_gax::paginator::Paginator;
24325 self.by_page().items()
24326 }
24327
24328 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24330 self.0.request.name = v.into();
24331 self
24332 }
24333
24334 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24336 self.0.request.filter = v.into();
24337 self
24338 }
24339
24340 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24342 self.0.request.page_size = v.into();
24343 self
24344 }
24345
24346 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24348 self.0.request.page_token = v.into();
24349 self
24350 }
24351 }
24352
24353 #[doc(hidden)]
24354 impl crate::RequestBuilder for ListLocations {
24355 fn request_options(&mut self) -> &mut crate::RequestOptions {
24356 &mut self.0.options
24357 }
24358 }
24359
24360 #[derive(Clone, Debug)]
24377 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
24378
24379 impl GetLocation {
24380 pub(crate) fn new(
24381 stub: std::sync::Arc<
24382 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24383 >,
24384 ) -> Self {
24385 Self(RequestBuilder::new(stub))
24386 }
24387
24388 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
24390 mut self,
24391 v: V,
24392 ) -> Self {
24393 self.0.request = v.into();
24394 self
24395 }
24396
24397 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24399 self.0.options = v.into();
24400 self
24401 }
24402
24403 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
24405 (*self.0.stub)
24406 .get_location(self.0.request, self.0.options)
24407 .await
24408 .map(crate::Response::into_body)
24409 }
24410
24411 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24413 self.0.request.name = v.into();
24414 self
24415 }
24416 }
24417
24418 #[doc(hidden)]
24419 impl crate::RequestBuilder for GetLocation {
24420 fn request_options(&mut self) -> &mut crate::RequestOptions {
24421 &mut self.0.options
24422 }
24423 }
24424
24425 #[derive(Clone, Debug)]
24442 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
24443
24444 impl SetIamPolicy {
24445 pub(crate) fn new(
24446 stub: std::sync::Arc<
24447 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24448 >,
24449 ) -> Self {
24450 Self(RequestBuilder::new(stub))
24451 }
24452
24453 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
24455 mut self,
24456 v: V,
24457 ) -> Self {
24458 self.0.request = v.into();
24459 self
24460 }
24461
24462 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24464 self.0.options = v.into();
24465 self
24466 }
24467
24468 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
24470 (*self.0.stub)
24471 .set_iam_policy(self.0.request, self.0.options)
24472 .await
24473 .map(crate::Response::into_body)
24474 }
24475
24476 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
24480 self.0.request.resource = v.into();
24481 self
24482 }
24483
24484 pub fn set_policy<T>(mut self, v: T) -> Self
24488 where
24489 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
24490 {
24491 self.0.request.policy = std::option::Option::Some(v.into());
24492 self
24493 }
24494
24495 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
24499 where
24500 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
24501 {
24502 self.0.request.policy = v.map(|x| x.into());
24503 self
24504 }
24505
24506 pub fn set_update_mask<T>(mut self, v: T) -> Self
24508 where
24509 T: std::convert::Into<wkt::FieldMask>,
24510 {
24511 self.0.request.update_mask = std::option::Option::Some(v.into());
24512 self
24513 }
24514
24515 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
24517 where
24518 T: std::convert::Into<wkt::FieldMask>,
24519 {
24520 self.0.request.update_mask = v.map(|x| x.into());
24521 self
24522 }
24523 }
24524
24525 #[doc(hidden)]
24526 impl crate::RequestBuilder for SetIamPolicy {
24527 fn request_options(&mut self) -> &mut crate::RequestOptions {
24528 &mut self.0.options
24529 }
24530 }
24531
24532 #[derive(Clone, Debug)]
24549 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
24550
24551 impl GetIamPolicy {
24552 pub(crate) fn new(
24553 stub: std::sync::Arc<
24554 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24555 >,
24556 ) -> Self {
24557 Self(RequestBuilder::new(stub))
24558 }
24559
24560 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
24562 mut self,
24563 v: V,
24564 ) -> Self {
24565 self.0.request = v.into();
24566 self
24567 }
24568
24569 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24571 self.0.options = v.into();
24572 self
24573 }
24574
24575 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
24577 (*self.0.stub)
24578 .get_iam_policy(self.0.request, self.0.options)
24579 .await
24580 .map(crate::Response::into_body)
24581 }
24582
24583 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
24587 self.0.request.resource = v.into();
24588 self
24589 }
24590
24591 pub fn set_options<T>(mut self, v: T) -> Self
24593 where
24594 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
24595 {
24596 self.0.request.options = std::option::Option::Some(v.into());
24597 self
24598 }
24599
24600 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
24602 where
24603 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
24604 {
24605 self.0.request.options = v.map(|x| x.into());
24606 self
24607 }
24608 }
24609
24610 #[doc(hidden)]
24611 impl crate::RequestBuilder for GetIamPolicy {
24612 fn request_options(&mut self) -> &mut crate::RequestOptions {
24613 &mut self.0.options
24614 }
24615 }
24616
24617 #[derive(Clone, Debug)]
24634 pub struct TestIamPermissions(
24635 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
24636 );
24637
24638 impl TestIamPermissions {
24639 pub(crate) fn new(
24640 stub: std::sync::Arc<
24641 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24642 >,
24643 ) -> Self {
24644 Self(RequestBuilder::new(stub))
24645 }
24646
24647 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
24649 mut self,
24650 v: V,
24651 ) -> Self {
24652 self.0.request = v.into();
24653 self
24654 }
24655
24656 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24658 self.0.options = v.into();
24659 self
24660 }
24661
24662 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
24664 (*self.0.stub)
24665 .test_iam_permissions(self.0.request, self.0.options)
24666 .await
24667 .map(crate::Response::into_body)
24668 }
24669
24670 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
24674 self.0.request.resource = v.into();
24675 self
24676 }
24677
24678 pub fn set_permissions<T, V>(mut self, v: T) -> Self
24682 where
24683 T: std::iter::IntoIterator<Item = V>,
24684 V: std::convert::Into<std::string::String>,
24685 {
24686 use std::iter::Iterator;
24687 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
24688 self
24689 }
24690 }
24691
24692 #[doc(hidden)]
24693 impl crate::RequestBuilder for TestIamPermissions {
24694 fn request_options(&mut self) -> &mut crate::RequestOptions {
24695 &mut self.0.options
24696 }
24697 }
24698
24699 #[derive(Clone, Debug)]
24720 pub struct ListOperations(
24721 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
24722 );
24723
24724 impl ListOperations {
24725 pub(crate) fn new(
24726 stub: std::sync::Arc<
24727 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24728 >,
24729 ) -> Self {
24730 Self(RequestBuilder::new(stub))
24731 }
24732
24733 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
24735 mut self,
24736 v: V,
24737 ) -> Self {
24738 self.0.request = v.into();
24739 self
24740 }
24741
24742 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24744 self.0.options = v.into();
24745 self
24746 }
24747
24748 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
24750 (*self.0.stub)
24751 .list_operations(self.0.request, self.0.options)
24752 .await
24753 .map(crate::Response::into_body)
24754 }
24755
24756 pub fn by_page(
24758 self,
24759 ) -> impl google_cloud_gax::paginator::Paginator<
24760 google_cloud_longrunning::model::ListOperationsResponse,
24761 crate::Error,
24762 > {
24763 use std::clone::Clone;
24764 let token = self.0.request.page_token.clone();
24765 let execute = move |token: String| {
24766 let mut builder = self.clone();
24767 builder.0.request = builder.0.request.set_page_token(token);
24768 builder.send()
24769 };
24770 google_cloud_gax::paginator::internal::new_paginator(token, execute)
24771 }
24772
24773 pub fn by_item(
24775 self,
24776 ) -> impl google_cloud_gax::paginator::ItemPaginator<
24777 google_cloud_longrunning::model::ListOperationsResponse,
24778 crate::Error,
24779 > {
24780 use google_cloud_gax::paginator::Paginator;
24781 self.by_page().items()
24782 }
24783
24784 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24786 self.0.request.name = v.into();
24787 self
24788 }
24789
24790 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24792 self.0.request.filter = v.into();
24793 self
24794 }
24795
24796 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24798 self.0.request.page_size = v.into();
24799 self
24800 }
24801
24802 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24804 self.0.request.page_token = v.into();
24805 self
24806 }
24807
24808 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
24810 self.0.request.return_partial_success = v.into();
24811 self
24812 }
24813 }
24814
24815 #[doc(hidden)]
24816 impl crate::RequestBuilder for ListOperations {
24817 fn request_options(&mut self) -> &mut crate::RequestOptions {
24818 &mut self.0.options
24819 }
24820 }
24821
24822 #[derive(Clone, Debug)]
24839 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
24840
24841 impl GetOperation {
24842 pub(crate) fn new(
24843 stub: std::sync::Arc<
24844 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24845 >,
24846 ) -> Self {
24847 Self(RequestBuilder::new(stub))
24848 }
24849
24850 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
24852 mut self,
24853 v: V,
24854 ) -> Self {
24855 self.0.request = v.into();
24856 self
24857 }
24858
24859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24861 self.0.options = v.into();
24862 self
24863 }
24864
24865 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24867 (*self.0.stub)
24868 .get_operation(self.0.request, self.0.options)
24869 .await
24870 .map(crate::Response::into_body)
24871 }
24872
24873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24875 self.0.request.name = v.into();
24876 self
24877 }
24878 }
24879
24880 #[doc(hidden)]
24881 impl crate::RequestBuilder for GetOperation {
24882 fn request_options(&mut self) -> &mut crate::RequestOptions {
24883 &mut self.0.options
24884 }
24885 }
24886
24887 #[derive(Clone, Debug)]
24904 pub struct DeleteOperation(
24905 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
24906 );
24907
24908 impl DeleteOperation {
24909 pub(crate) fn new(
24910 stub: std::sync::Arc<
24911 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24912 >,
24913 ) -> Self {
24914 Self(RequestBuilder::new(stub))
24915 }
24916
24917 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
24919 mut self,
24920 v: V,
24921 ) -> Self {
24922 self.0.request = v.into();
24923 self
24924 }
24925
24926 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24928 self.0.options = v.into();
24929 self
24930 }
24931
24932 pub async fn send(self) -> Result<()> {
24934 (*self.0.stub)
24935 .delete_operation(self.0.request, self.0.options)
24936 .await
24937 .map(crate::Response::into_body)
24938 }
24939
24940 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24942 self.0.request.name = v.into();
24943 self
24944 }
24945 }
24946
24947 #[doc(hidden)]
24948 impl crate::RequestBuilder for DeleteOperation {
24949 fn request_options(&mut self) -> &mut crate::RequestOptions {
24950 &mut self.0.options
24951 }
24952 }
24953
24954 #[derive(Clone, Debug)]
24971 pub struct CancelOperation(
24972 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
24973 );
24974
24975 impl CancelOperation {
24976 pub(crate) fn new(
24977 stub: std::sync::Arc<
24978 dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24979 >,
24980 ) -> Self {
24981 Self(RequestBuilder::new(stub))
24982 }
24983
24984 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
24986 mut self,
24987 v: V,
24988 ) -> Self {
24989 self.0.request = v.into();
24990 self
24991 }
24992
24993 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24995 self.0.options = v.into();
24996 self
24997 }
24998
24999 pub async fn send(self) -> Result<()> {
25001 (*self.0.stub)
25002 .cancel_operation(self.0.request, self.0.options)
25003 .await
25004 .map(crate::Response::into_body)
25005 }
25006
25007 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25009 self.0.request.name = v.into();
25010 self
25011 }
25012 }
25013
25014 #[doc(hidden)]
25015 impl crate::RequestBuilder for CancelOperation {
25016 fn request_options(&mut self) -> &mut crate::RequestOptions {
25017 &mut self.0.options
25018 }
25019 }
25020}
25021
25022pub mod sse_realm_service {
25024 use crate::Result;
25025
25026 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
25040
25041 pub(crate) mod client {
25042 use super::super::super::client::SSERealmService;
25043 pub struct Factory;
25044 impl crate::ClientFactory for Factory {
25045 type Client = SSERealmService;
25046 type Credentials = gaxi::options::Credentials;
25047 async fn build(
25048 self,
25049 config: gaxi::options::ClientConfig,
25050 ) -> crate::ClientBuilderResult<Self::Client> {
25051 Self::Client::new(config).await
25052 }
25053 }
25054 }
25055
25056 #[derive(Clone, Debug)]
25058 pub(crate) struct RequestBuilder<R: std::default::Default> {
25059 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25060 request: R,
25061 options: crate::RequestOptions,
25062 }
25063
25064 impl<R> RequestBuilder<R>
25065 where
25066 R: std::default::Default,
25067 {
25068 pub(crate) fn new(
25069 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25070 ) -> Self {
25071 Self {
25072 stub,
25073 request: R::default(),
25074 options: crate::RequestOptions::default(),
25075 }
25076 }
25077 }
25078
25079 #[derive(Clone, Debug)]
25100 pub struct ListSACRealms(RequestBuilder<crate::model::ListSACRealmsRequest>);
25101
25102 impl ListSACRealms {
25103 pub(crate) fn new(
25104 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25105 ) -> Self {
25106 Self(RequestBuilder::new(stub))
25107 }
25108
25109 pub fn with_request<V: Into<crate::model::ListSACRealmsRequest>>(mut self, v: V) -> Self {
25111 self.0.request = v.into();
25112 self
25113 }
25114
25115 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25117 self.0.options = v.into();
25118 self
25119 }
25120
25121 pub async fn send(self) -> Result<crate::model::ListSACRealmsResponse> {
25123 (*self.0.stub)
25124 .list_sac_realms(self.0.request, self.0.options)
25125 .await
25126 .map(crate::Response::into_body)
25127 }
25128
25129 pub fn by_page(
25131 self,
25132 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSACRealmsResponse, crate::Error>
25133 {
25134 use std::clone::Clone;
25135 let token = self.0.request.page_token.clone();
25136 let execute = move |token: String| {
25137 let mut builder = self.clone();
25138 builder.0.request = builder.0.request.set_page_token(token);
25139 builder.send()
25140 };
25141 google_cloud_gax::paginator::internal::new_paginator(token, execute)
25142 }
25143
25144 pub fn by_item(
25146 self,
25147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
25148 crate::model::ListSACRealmsResponse,
25149 crate::Error,
25150 > {
25151 use google_cloud_gax::paginator::Paginator;
25152 self.by_page().items()
25153 }
25154
25155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25159 self.0.request.parent = v.into();
25160 self
25161 }
25162
25163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
25165 self.0.request.page_size = v.into();
25166 self
25167 }
25168
25169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
25171 self.0.request.page_token = v.into();
25172 self
25173 }
25174
25175 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
25177 self.0.request.filter = v.into();
25178 self
25179 }
25180
25181 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
25183 self.0.request.order_by = v.into();
25184 self
25185 }
25186 }
25187
25188 #[doc(hidden)]
25189 impl crate::RequestBuilder for ListSACRealms {
25190 fn request_options(&mut self) -> &mut crate::RequestOptions {
25191 &mut self.0.options
25192 }
25193 }
25194
25195 #[derive(Clone, Debug)]
25212 pub struct GetSACRealm(RequestBuilder<crate::model::GetSACRealmRequest>);
25213
25214 impl GetSACRealm {
25215 pub(crate) fn new(
25216 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25217 ) -> Self {
25218 Self(RequestBuilder::new(stub))
25219 }
25220
25221 pub fn with_request<V: Into<crate::model::GetSACRealmRequest>>(mut self, v: V) -> Self {
25223 self.0.request = v.into();
25224 self
25225 }
25226
25227 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25229 self.0.options = v.into();
25230 self
25231 }
25232
25233 pub async fn send(self) -> Result<crate::model::SACRealm> {
25235 (*self.0.stub)
25236 .get_sac_realm(self.0.request, self.0.options)
25237 .await
25238 .map(crate::Response::into_body)
25239 }
25240
25241 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25245 self.0.request.name = v.into();
25246 self
25247 }
25248 }
25249
25250 #[doc(hidden)]
25251 impl crate::RequestBuilder for GetSACRealm {
25252 fn request_options(&mut self) -> &mut crate::RequestOptions {
25253 &mut self.0.options
25254 }
25255 }
25256
25257 #[derive(Clone, Debug)]
25275 pub struct CreateSACRealm(RequestBuilder<crate::model::CreateSACRealmRequest>);
25276
25277 impl CreateSACRealm {
25278 pub(crate) fn new(
25279 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25280 ) -> Self {
25281 Self(RequestBuilder::new(stub))
25282 }
25283
25284 pub fn with_request<V: Into<crate::model::CreateSACRealmRequest>>(mut self, v: V) -> Self {
25286 self.0.request = v.into();
25287 self
25288 }
25289
25290 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25292 self.0.options = v.into();
25293 self
25294 }
25295
25296 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25303 (*self.0.stub)
25304 .create_sac_realm(self.0.request, self.0.options)
25305 .await
25306 .map(crate::Response::into_body)
25307 }
25308
25309 pub fn poller(
25311 self,
25312 ) -> impl google_cloud_lro::Poller<crate::model::SACRealm, crate::model::OperationMetadata>
25313 {
25314 type Operation = google_cloud_lro::internal::Operation<
25315 crate::model::SACRealm,
25316 crate::model::OperationMetadata,
25317 >;
25318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25320 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
25321 if let Some(ref mut details) = poller_options.tracing {
25322 details.method_name = "google_cloud_networksecurity_v1::client::SSERealmService::create_sac_realm::until_done";
25323 }
25324
25325 let stub = self.0.stub.clone();
25326 let mut options = self.0.options.clone();
25327 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25328 let query = move |name| {
25329 let stub = stub.clone();
25330 let options = options.clone();
25331 async {
25332 let op = GetOperation::new(stub)
25333 .set_name(name)
25334 .with_options(options)
25335 .send()
25336 .await?;
25337 Ok(Operation::new(op))
25338 }
25339 };
25340
25341 let start = move || async {
25342 let op = self.send().await?;
25343 Ok(Operation::new(op))
25344 };
25345
25346 use google_cloud_lro::internal::PollerExt;
25347 {
25348 google_cloud_lro::internal::new_poller(
25349 polling_error_policy,
25350 polling_backoff_policy,
25351 start,
25352 query,
25353 )
25354 }
25355 .with_options(poller_options)
25356 }
25357
25358 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25362 self.0.request.parent = v.into();
25363 self
25364 }
25365
25366 pub fn set_sac_realm_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25370 self.0.request.sac_realm_id = v.into();
25371 self
25372 }
25373
25374 pub fn set_sac_realm<T>(mut self, v: T) -> Self
25378 where
25379 T: std::convert::Into<crate::model::SACRealm>,
25380 {
25381 self.0.request.sac_realm = std::option::Option::Some(v.into());
25382 self
25383 }
25384
25385 pub fn set_or_clear_sac_realm<T>(mut self, v: std::option::Option<T>) -> Self
25389 where
25390 T: std::convert::Into<crate::model::SACRealm>,
25391 {
25392 self.0.request.sac_realm = v.map(|x| x.into());
25393 self
25394 }
25395
25396 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25398 self.0.request.request_id = v.into();
25399 self
25400 }
25401 }
25402
25403 #[doc(hidden)]
25404 impl crate::RequestBuilder for CreateSACRealm {
25405 fn request_options(&mut self) -> &mut crate::RequestOptions {
25406 &mut self.0.options
25407 }
25408 }
25409
25410 #[derive(Clone, Debug)]
25428 pub struct DeleteSACRealm(RequestBuilder<crate::model::DeleteSACRealmRequest>);
25429
25430 impl DeleteSACRealm {
25431 pub(crate) fn new(
25432 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25433 ) -> Self {
25434 Self(RequestBuilder::new(stub))
25435 }
25436
25437 pub fn with_request<V: Into<crate::model::DeleteSACRealmRequest>>(mut self, v: V) -> Self {
25439 self.0.request = v.into();
25440 self
25441 }
25442
25443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25445 self.0.options = v.into();
25446 self
25447 }
25448
25449 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25456 (*self.0.stub)
25457 .delete_sac_realm(self.0.request, self.0.options)
25458 .await
25459 .map(crate::Response::into_body)
25460 }
25461
25462 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
25464 type Operation =
25465 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
25466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25468 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
25469 if let Some(ref mut details) = poller_options.tracing {
25470 details.method_name = "google_cloud_networksecurity_v1::client::SSERealmService::delete_sac_realm::until_done";
25471 }
25472
25473 let stub = self.0.stub.clone();
25474 let mut options = self.0.options.clone();
25475 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25476 let query = move |name| {
25477 let stub = stub.clone();
25478 let options = options.clone();
25479 async {
25480 let op = GetOperation::new(stub)
25481 .set_name(name)
25482 .with_options(options)
25483 .send()
25484 .await?;
25485 Ok(Operation::new(op))
25486 }
25487 };
25488
25489 let start = move || async {
25490 let op = self.send().await?;
25491 Ok(Operation::new(op))
25492 };
25493
25494 use google_cloud_lro::internal::PollerExt;
25495 {
25496 google_cloud_lro::internal::new_unit_response_poller(
25497 polling_error_policy,
25498 polling_backoff_policy,
25499 start,
25500 query,
25501 )
25502 }
25503 .with_options(poller_options)
25504 }
25505
25506 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25510 self.0.request.name = v.into();
25511 self
25512 }
25513
25514 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25516 self.0.request.request_id = v.into();
25517 self
25518 }
25519 }
25520
25521 #[doc(hidden)]
25522 impl crate::RequestBuilder for DeleteSACRealm {
25523 fn request_options(&mut self) -> &mut crate::RequestOptions {
25524 &mut self.0.options
25525 }
25526 }
25527
25528 #[derive(Clone, Debug)]
25549 pub struct ListSACAttachments(RequestBuilder<crate::model::ListSACAttachmentsRequest>);
25550
25551 impl ListSACAttachments {
25552 pub(crate) fn new(
25553 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25554 ) -> Self {
25555 Self(RequestBuilder::new(stub))
25556 }
25557
25558 pub fn with_request<V: Into<crate::model::ListSACAttachmentsRequest>>(
25560 mut self,
25561 v: V,
25562 ) -> Self {
25563 self.0.request = v.into();
25564 self
25565 }
25566
25567 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25569 self.0.options = v.into();
25570 self
25571 }
25572
25573 pub async fn send(self) -> Result<crate::model::ListSACAttachmentsResponse> {
25575 (*self.0.stub)
25576 .list_sac_attachments(self.0.request, self.0.options)
25577 .await
25578 .map(crate::Response::into_body)
25579 }
25580
25581 pub fn by_page(
25583 self,
25584 ) -> impl google_cloud_gax::paginator::Paginator<
25585 crate::model::ListSACAttachmentsResponse,
25586 crate::Error,
25587 > {
25588 use std::clone::Clone;
25589 let token = self.0.request.page_token.clone();
25590 let execute = move |token: String| {
25591 let mut builder = self.clone();
25592 builder.0.request = builder.0.request.set_page_token(token);
25593 builder.send()
25594 };
25595 google_cloud_gax::paginator::internal::new_paginator(token, execute)
25596 }
25597
25598 pub fn by_item(
25600 self,
25601 ) -> impl google_cloud_gax::paginator::ItemPaginator<
25602 crate::model::ListSACAttachmentsResponse,
25603 crate::Error,
25604 > {
25605 use google_cloud_gax::paginator::Paginator;
25606 self.by_page().items()
25607 }
25608
25609 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25613 self.0.request.parent = v.into();
25614 self
25615 }
25616
25617 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
25619 self.0.request.page_size = v.into();
25620 self
25621 }
25622
25623 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
25625 self.0.request.page_token = v.into();
25626 self
25627 }
25628
25629 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
25631 self.0.request.filter = v.into();
25632 self
25633 }
25634
25635 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
25637 self.0.request.order_by = v.into();
25638 self
25639 }
25640 }
25641
25642 #[doc(hidden)]
25643 impl crate::RequestBuilder for ListSACAttachments {
25644 fn request_options(&mut self) -> &mut crate::RequestOptions {
25645 &mut self.0.options
25646 }
25647 }
25648
25649 #[derive(Clone, Debug)]
25666 pub struct GetSACAttachment(RequestBuilder<crate::model::GetSACAttachmentRequest>);
25667
25668 impl GetSACAttachment {
25669 pub(crate) fn new(
25670 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25671 ) -> Self {
25672 Self(RequestBuilder::new(stub))
25673 }
25674
25675 pub fn with_request<V: Into<crate::model::GetSACAttachmentRequest>>(
25677 mut self,
25678 v: V,
25679 ) -> Self {
25680 self.0.request = v.into();
25681 self
25682 }
25683
25684 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25686 self.0.options = v.into();
25687 self
25688 }
25689
25690 pub async fn send(self) -> Result<crate::model::SACAttachment> {
25692 (*self.0.stub)
25693 .get_sac_attachment(self.0.request, self.0.options)
25694 .await
25695 .map(crate::Response::into_body)
25696 }
25697
25698 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25702 self.0.request.name = v.into();
25703 self
25704 }
25705 }
25706
25707 #[doc(hidden)]
25708 impl crate::RequestBuilder for GetSACAttachment {
25709 fn request_options(&mut self) -> &mut crate::RequestOptions {
25710 &mut self.0.options
25711 }
25712 }
25713
25714 #[derive(Clone, Debug)]
25732 pub struct CreateSACAttachment(RequestBuilder<crate::model::CreateSACAttachmentRequest>);
25733
25734 impl CreateSACAttachment {
25735 pub(crate) fn new(
25736 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25737 ) -> Self {
25738 Self(RequestBuilder::new(stub))
25739 }
25740
25741 pub fn with_request<V: Into<crate::model::CreateSACAttachmentRequest>>(
25743 mut self,
25744 v: V,
25745 ) -> Self {
25746 self.0.request = v.into();
25747 self
25748 }
25749
25750 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25752 self.0.options = v.into();
25753 self
25754 }
25755
25756 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25763 (*self.0.stub)
25764 .create_sac_attachment(self.0.request, self.0.options)
25765 .await
25766 .map(crate::Response::into_body)
25767 }
25768
25769 pub fn poller(
25771 self,
25772 ) -> impl google_cloud_lro::Poller<crate::model::SACAttachment, crate::model::OperationMetadata>
25773 {
25774 type Operation = google_cloud_lro::internal::Operation<
25775 crate::model::SACAttachment,
25776 crate::model::OperationMetadata,
25777 >;
25778 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25779 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25780 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
25781 if let Some(ref mut details) = poller_options.tracing {
25782 details.method_name = "google_cloud_networksecurity_v1::client::SSERealmService::create_sac_attachment::until_done";
25783 }
25784
25785 let stub = self.0.stub.clone();
25786 let mut options = self.0.options.clone();
25787 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25788 let query = move |name| {
25789 let stub = stub.clone();
25790 let options = options.clone();
25791 async {
25792 let op = GetOperation::new(stub)
25793 .set_name(name)
25794 .with_options(options)
25795 .send()
25796 .await?;
25797 Ok(Operation::new(op))
25798 }
25799 };
25800
25801 let start = move || async {
25802 let op = self.send().await?;
25803 Ok(Operation::new(op))
25804 };
25805
25806 use google_cloud_lro::internal::PollerExt;
25807 {
25808 google_cloud_lro::internal::new_poller(
25809 polling_error_policy,
25810 polling_backoff_policy,
25811 start,
25812 query,
25813 )
25814 }
25815 .with_options(poller_options)
25816 }
25817
25818 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25822 self.0.request.parent = v.into();
25823 self
25824 }
25825
25826 pub fn set_sac_attachment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25830 self.0.request.sac_attachment_id = v.into();
25831 self
25832 }
25833
25834 pub fn set_sac_attachment<T>(mut self, v: T) -> Self
25838 where
25839 T: std::convert::Into<crate::model::SACAttachment>,
25840 {
25841 self.0.request.sac_attachment = std::option::Option::Some(v.into());
25842 self
25843 }
25844
25845 pub fn set_or_clear_sac_attachment<T>(mut self, v: std::option::Option<T>) -> Self
25849 where
25850 T: std::convert::Into<crate::model::SACAttachment>,
25851 {
25852 self.0.request.sac_attachment = v.map(|x| x.into());
25853 self
25854 }
25855
25856 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25858 self.0.request.request_id = v.into();
25859 self
25860 }
25861 }
25862
25863 #[doc(hidden)]
25864 impl crate::RequestBuilder for CreateSACAttachment {
25865 fn request_options(&mut self) -> &mut crate::RequestOptions {
25866 &mut self.0.options
25867 }
25868 }
25869
25870 #[derive(Clone, Debug)]
25888 pub struct DeleteSACAttachment(RequestBuilder<crate::model::DeleteSACAttachmentRequest>);
25889
25890 impl DeleteSACAttachment {
25891 pub(crate) fn new(
25892 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25893 ) -> Self {
25894 Self(RequestBuilder::new(stub))
25895 }
25896
25897 pub fn with_request<V: Into<crate::model::DeleteSACAttachmentRequest>>(
25899 mut self,
25900 v: V,
25901 ) -> Self {
25902 self.0.request = v.into();
25903 self
25904 }
25905
25906 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25908 self.0.options = v.into();
25909 self
25910 }
25911
25912 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25919 (*self.0.stub)
25920 .delete_sac_attachment(self.0.request, self.0.options)
25921 .await
25922 .map(crate::Response::into_body)
25923 }
25924
25925 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
25927 type Operation =
25928 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
25929 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25930 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25931 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
25932 if let Some(ref mut details) = poller_options.tracing {
25933 details.method_name = "google_cloud_networksecurity_v1::client::SSERealmService::delete_sac_attachment::until_done";
25934 }
25935
25936 let stub = self.0.stub.clone();
25937 let mut options = self.0.options.clone();
25938 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25939 let query = move |name| {
25940 let stub = stub.clone();
25941 let options = options.clone();
25942 async {
25943 let op = GetOperation::new(stub)
25944 .set_name(name)
25945 .with_options(options)
25946 .send()
25947 .await?;
25948 Ok(Operation::new(op))
25949 }
25950 };
25951
25952 let start = move || async {
25953 let op = self.send().await?;
25954 Ok(Operation::new(op))
25955 };
25956
25957 use google_cloud_lro::internal::PollerExt;
25958 {
25959 google_cloud_lro::internal::new_unit_response_poller(
25960 polling_error_policy,
25961 polling_backoff_policy,
25962 start,
25963 query,
25964 )
25965 }
25966 .with_options(poller_options)
25967 }
25968
25969 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25973 self.0.request.name = v.into();
25974 self
25975 }
25976
25977 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25979 self.0.request.request_id = v.into();
25980 self
25981 }
25982 }
25983
25984 #[doc(hidden)]
25985 impl crate::RequestBuilder for DeleteSACAttachment {
25986 fn request_options(&mut self) -> &mut crate::RequestOptions {
25987 &mut self.0.options
25988 }
25989 }
25990
25991 #[derive(Clone, Debug)]
26012 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
26013
26014 impl ListLocations {
26015 pub(crate) fn new(
26016 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26017 ) -> Self {
26018 Self(RequestBuilder::new(stub))
26019 }
26020
26021 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
26023 mut self,
26024 v: V,
26025 ) -> Self {
26026 self.0.request = v.into();
26027 self
26028 }
26029
26030 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26032 self.0.options = v.into();
26033 self
26034 }
26035
26036 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
26038 (*self.0.stub)
26039 .list_locations(self.0.request, self.0.options)
26040 .await
26041 .map(crate::Response::into_body)
26042 }
26043
26044 pub fn by_page(
26046 self,
26047 ) -> impl google_cloud_gax::paginator::Paginator<
26048 google_cloud_location::model::ListLocationsResponse,
26049 crate::Error,
26050 > {
26051 use std::clone::Clone;
26052 let token = self.0.request.page_token.clone();
26053 let execute = move |token: String| {
26054 let mut builder = self.clone();
26055 builder.0.request = builder.0.request.set_page_token(token);
26056 builder.send()
26057 };
26058 google_cloud_gax::paginator::internal::new_paginator(token, execute)
26059 }
26060
26061 pub fn by_item(
26063 self,
26064 ) -> impl google_cloud_gax::paginator::ItemPaginator<
26065 google_cloud_location::model::ListLocationsResponse,
26066 crate::Error,
26067 > {
26068 use google_cloud_gax::paginator::Paginator;
26069 self.by_page().items()
26070 }
26071
26072 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26074 self.0.request.name = v.into();
26075 self
26076 }
26077
26078 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
26080 self.0.request.filter = v.into();
26081 self
26082 }
26083
26084 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
26086 self.0.request.page_size = v.into();
26087 self
26088 }
26089
26090 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
26092 self.0.request.page_token = v.into();
26093 self
26094 }
26095 }
26096
26097 #[doc(hidden)]
26098 impl crate::RequestBuilder for ListLocations {
26099 fn request_options(&mut self) -> &mut crate::RequestOptions {
26100 &mut self.0.options
26101 }
26102 }
26103
26104 #[derive(Clone, Debug)]
26121 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
26122
26123 impl GetLocation {
26124 pub(crate) fn new(
26125 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26126 ) -> Self {
26127 Self(RequestBuilder::new(stub))
26128 }
26129
26130 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
26132 mut self,
26133 v: V,
26134 ) -> Self {
26135 self.0.request = v.into();
26136 self
26137 }
26138
26139 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26141 self.0.options = v.into();
26142 self
26143 }
26144
26145 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
26147 (*self.0.stub)
26148 .get_location(self.0.request, self.0.options)
26149 .await
26150 .map(crate::Response::into_body)
26151 }
26152
26153 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26155 self.0.request.name = v.into();
26156 self
26157 }
26158 }
26159
26160 #[doc(hidden)]
26161 impl crate::RequestBuilder for GetLocation {
26162 fn request_options(&mut self) -> &mut crate::RequestOptions {
26163 &mut self.0.options
26164 }
26165 }
26166
26167 #[derive(Clone, Debug)]
26184 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
26185
26186 impl SetIamPolicy {
26187 pub(crate) fn new(
26188 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26189 ) -> Self {
26190 Self(RequestBuilder::new(stub))
26191 }
26192
26193 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
26195 mut self,
26196 v: V,
26197 ) -> Self {
26198 self.0.request = v.into();
26199 self
26200 }
26201
26202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26204 self.0.options = v.into();
26205 self
26206 }
26207
26208 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
26210 (*self.0.stub)
26211 .set_iam_policy(self.0.request, self.0.options)
26212 .await
26213 .map(crate::Response::into_body)
26214 }
26215
26216 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
26220 self.0.request.resource = v.into();
26221 self
26222 }
26223
26224 pub fn set_policy<T>(mut self, v: T) -> Self
26228 where
26229 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
26230 {
26231 self.0.request.policy = std::option::Option::Some(v.into());
26232 self
26233 }
26234
26235 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
26239 where
26240 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
26241 {
26242 self.0.request.policy = v.map(|x| x.into());
26243 self
26244 }
26245
26246 pub fn set_update_mask<T>(mut self, v: T) -> Self
26248 where
26249 T: std::convert::Into<wkt::FieldMask>,
26250 {
26251 self.0.request.update_mask = std::option::Option::Some(v.into());
26252 self
26253 }
26254
26255 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
26257 where
26258 T: std::convert::Into<wkt::FieldMask>,
26259 {
26260 self.0.request.update_mask = v.map(|x| x.into());
26261 self
26262 }
26263 }
26264
26265 #[doc(hidden)]
26266 impl crate::RequestBuilder for SetIamPolicy {
26267 fn request_options(&mut self) -> &mut crate::RequestOptions {
26268 &mut self.0.options
26269 }
26270 }
26271
26272 #[derive(Clone, Debug)]
26289 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
26290
26291 impl GetIamPolicy {
26292 pub(crate) fn new(
26293 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26294 ) -> Self {
26295 Self(RequestBuilder::new(stub))
26296 }
26297
26298 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
26300 mut self,
26301 v: V,
26302 ) -> Self {
26303 self.0.request = v.into();
26304 self
26305 }
26306
26307 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26309 self.0.options = v.into();
26310 self
26311 }
26312
26313 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
26315 (*self.0.stub)
26316 .get_iam_policy(self.0.request, self.0.options)
26317 .await
26318 .map(crate::Response::into_body)
26319 }
26320
26321 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
26325 self.0.request.resource = v.into();
26326 self
26327 }
26328
26329 pub fn set_options<T>(mut self, v: T) -> Self
26331 where
26332 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
26333 {
26334 self.0.request.options = std::option::Option::Some(v.into());
26335 self
26336 }
26337
26338 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
26340 where
26341 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
26342 {
26343 self.0.request.options = v.map(|x| x.into());
26344 self
26345 }
26346 }
26347
26348 #[doc(hidden)]
26349 impl crate::RequestBuilder for GetIamPolicy {
26350 fn request_options(&mut self) -> &mut crate::RequestOptions {
26351 &mut self.0.options
26352 }
26353 }
26354
26355 #[derive(Clone, Debug)]
26372 pub struct TestIamPermissions(
26373 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
26374 );
26375
26376 impl TestIamPermissions {
26377 pub(crate) fn new(
26378 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26379 ) -> Self {
26380 Self(RequestBuilder::new(stub))
26381 }
26382
26383 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
26385 mut self,
26386 v: V,
26387 ) -> Self {
26388 self.0.request = v.into();
26389 self
26390 }
26391
26392 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26394 self.0.options = v.into();
26395 self
26396 }
26397
26398 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
26400 (*self.0.stub)
26401 .test_iam_permissions(self.0.request, self.0.options)
26402 .await
26403 .map(crate::Response::into_body)
26404 }
26405
26406 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
26410 self.0.request.resource = v.into();
26411 self
26412 }
26413
26414 pub fn set_permissions<T, V>(mut self, v: T) -> Self
26418 where
26419 T: std::iter::IntoIterator<Item = V>,
26420 V: std::convert::Into<std::string::String>,
26421 {
26422 use std::iter::Iterator;
26423 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
26424 self
26425 }
26426 }
26427
26428 #[doc(hidden)]
26429 impl crate::RequestBuilder for TestIamPermissions {
26430 fn request_options(&mut self) -> &mut crate::RequestOptions {
26431 &mut self.0.options
26432 }
26433 }
26434
26435 #[derive(Clone, Debug)]
26456 pub struct ListOperations(
26457 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
26458 );
26459
26460 impl ListOperations {
26461 pub(crate) fn new(
26462 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26463 ) -> Self {
26464 Self(RequestBuilder::new(stub))
26465 }
26466
26467 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
26469 mut self,
26470 v: V,
26471 ) -> Self {
26472 self.0.request = v.into();
26473 self
26474 }
26475
26476 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26478 self.0.options = v.into();
26479 self
26480 }
26481
26482 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
26484 (*self.0.stub)
26485 .list_operations(self.0.request, self.0.options)
26486 .await
26487 .map(crate::Response::into_body)
26488 }
26489
26490 pub fn by_page(
26492 self,
26493 ) -> impl google_cloud_gax::paginator::Paginator<
26494 google_cloud_longrunning::model::ListOperationsResponse,
26495 crate::Error,
26496 > {
26497 use std::clone::Clone;
26498 let token = self.0.request.page_token.clone();
26499 let execute = move |token: String| {
26500 let mut builder = self.clone();
26501 builder.0.request = builder.0.request.set_page_token(token);
26502 builder.send()
26503 };
26504 google_cloud_gax::paginator::internal::new_paginator(token, execute)
26505 }
26506
26507 pub fn by_item(
26509 self,
26510 ) -> impl google_cloud_gax::paginator::ItemPaginator<
26511 google_cloud_longrunning::model::ListOperationsResponse,
26512 crate::Error,
26513 > {
26514 use google_cloud_gax::paginator::Paginator;
26515 self.by_page().items()
26516 }
26517
26518 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26520 self.0.request.name = v.into();
26521 self
26522 }
26523
26524 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
26526 self.0.request.filter = v.into();
26527 self
26528 }
26529
26530 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
26532 self.0.request.page_size = v.into();
26533 self
26534 }
26535
26536 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
26538 self.0.request.page_token = v.into();
26539 self
26540 }
26541
26542 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
26544 self.0.request.return_partial_success = v.into();
26545 self
26546 }
26547 }
26548
26549 #[doc(hidden)]
26550 impl crate::RequestBuilder for ListOperations {
26551 fn request_options(&mut self) -> &mut crate::RequestOptions {
26552 &mut self.0.options
26553 }
26554 }
26555
26556 #[derive(Clone, Debug)]
26573 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
26574
26575 impl GetOperation {
26576 pub(crate) fn new(
26577 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26578 ) -> Self {
26579 Self(RequestBuilder::new(stub))
26580 }
26581
26582 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
26584 mut self,
26585 v: V,
26586 ) -> Self {
26587 self.0.request = v.into();
26588 self
26589 }
26590
26591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26593 self.0.options = v.into();
26594 self
26595 }
26596
26597 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
26599 (*self.0.stub)
26600 .get_operation(self.0.request, self.0.options)
26601 .await
26602 .map(crate::Response::into_body)
26603 }
26604
26605 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26607 self.0.request.name = v.into();
26608 self
26609 }
26610 }
26611
26612 #[doc(hidden)]
26613 impl crate::RequestBuilder for GetOperation {
26614 fn request_options(&mut self) -> &mut crate::RequestOptions {
26615 &mut self.0.options
26616 }
26617 }
26618
26619 #[derive(Clone, Debug)]
26636 pub struct DeleteOperation(
26637 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
26638 );
26639
26640 impl DeleteOperation {
26641 pub(crate) fn new(
26642 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26643 ) -> Self {
26644 Self(RequestBuilder::new(stub))
26645 }
26646
26647 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
26649 mut self,
26650 v: V,
26651 ) -> Self {
26652 self.0.request = v.into();
26653 self
26654 }
26655
26656 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26658 self.0.options = v.into();
26659 self
26660 }
26661
26662 pub async fn send(self) -> Result<()> {
26664 (*self.0.stub)
26665 .delete_operation(self.0.request, self.0.options)
26666 .await
26667 .map(crate::Response::into_body)
26668 }
26669
26670 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26672 self.0.request.name = v.into();
26673 self
26674 }
26675 }
26676
26677 #[doc(hidden)]
26678 impl crate::RequestBuilder for DeleteOperation {
26679 fn request_options(&mut self) -> &mut crate::RequestOptions {
26680 &mut self.0.options
26681 }
26682 }
26683
26684 #[derive(Clone, Debug)]
26701 pub struct CancelOperation(
26702 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
26703 );
26704
26705 impl CancelOperation {
26706 pub(crate) fn new(
26707 stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26708 ) -> Self {
26709 Self(RequestBuilder::new(stub))
26710 }
26711
26712 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
26714 mut self,
26715 v: V,
26716 ) -> Self {
26717 self.0.request = v.into();
26718 self
26719 }
26720
26721 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26723 self.0.options = v.into();
26724 self
26725 }
26726
26727 pub async fn send(self) -> Result<()> {
26729 (*self.0.stub)
26730 .cancel_operation(self.0.request, self.0.options)
26731 .await
26732 .map(crate::Response::into_body)
26733 }
26734
26735 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26737 self.0.request.name = v.into();
26738 self
26739 }
26740 }
26741
26742 #[doc(hidden)]
26743 impl crate::RequestBuilder for CancelOperation {
26744 fn request_options(&mut self) -> &mut crate::RequestOptions {
26745 &mut self.0.options
26746 }
26747 }
26748}