1pub mod autokey {
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::Autokey;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Autokey;
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::Autokey>,
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(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
90 pub struct CreateKeyHandle(RequestBuilder<crate::model::CreateKeyHandleRequest>);
91
92 impl CreateKeyHandle {
93 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
94 Self(RequestBuilder::new(stub))
95 }
96
97 pub fn with_request<V: Into<crate::model::CreateKeyHandleRequest>>(mut self, v: V) -> Self {
99 self.0.request = v.into();
100 self
101 }
102
103 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
105 self.0.options = v.into();
106 self
107 }
108
109 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
116 (*self.0.stub)
117 .create_key_handle(self.0.request, self.0.options)
118 .await
119 .map(crate::Response::into_body)
120 }
121
122 pub fn poller(
124 self,
125 ) -> impl google_cloud_lro::Poller<crate::model::KeyHandle, crate::model::CreateKeyHandleMetadata>
126 {
127 type Operation = google_cloud_lro::internal::Operation<
128 crate::model::KeyHandle,
129 crate::model::CreateKeyHandleMetadata,
130 >;
131 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
132 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
133 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
134 if let Some(ref mut details) = poller_options.tracing {
135 details.method_name =
136 "google_cloud_kms_v1::client::Autokey::create_key_handle::until_done";
137 }
138
139 let stub = self.0.stub.clone();
140 let mut options = self.0.options.clone();
141 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
142 let query = move |name| {
143 let stub = stub.clone();
144 let options = options.clone();
145 async {
146 let op = GetOperation::new(stub)
147 .set_name(name)
148 .with_options(options)
149 .send()
150 .await?;
151 Ok(Operation::new(op))
152 }
153 };
154
155 let start = move || async {
156 let op = self.send().await?;
157 Ok(Operation::new(op))
158 };
159
160 use google_cloud_lro::internal::PollerExt;
161 {
162 google_cloud_lro::internal::new_poller(
163 polling_error_policy,
164 polling_backoff_policy,
165 start,
166 query,
167 )
168 }
169 .with_options(poller_options)
170 }
171
172 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.parent = v.into();
177 self
178 }
179
180 pub fn set_key_handle_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
182 self.0.request.key_handle_id = v.into();
183 self
184 }
185
186 pub fn set_key_handle<T>(mut self, v: T) -> Self
190 where
191 T: std::convert::Into<crate::model::KeyHandle>,
192 {
193 self.0.request.key_handle = std::option::Option::Some(v.into());
194 self
195 }
196
197 pub fn set_or_clear_key_handle<T>(mut self, v: std::option::Option<T>) -> Self
201 where
202 T: std::convert::Into<crate::model::KeyHandle>,
203 {
204 self.0.request.key_handle = v.map(|x| x.into());
205 self
206 }
207 }
208
209 #[doc(hidden)]
210 impl crate::RequestBuilder for CreateKeyHandle {
211 fn request_options(&mut self) -> &mut crate::RequestOptions {
212 &mut self.0.options
213 }
214 }
215
216 #[derive(Clone, Debug)]
233 pub struct GetKeyHandle(RequestBuilder<crate::model::GetKeyHandleRequest>);
234
235 impl GetKeyHandle {
236 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
237 Self(RequestBuilder::new(stub))
238 }
239
240 pub fn with_request<V: Into<crate::model::GetKeyHandleRequest>>(mut self, v: V) -> Self {
242 self.0.request = v.into();
243 self
244 }
245
246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
248 self.0.options = v.into();
249 self
250 }
251
252 pub async fn send(self) -> Result<crate::model::KeyHandle> {
254 (*self.0.stub)
255 .get_key_handle(self.0.request, self.0.options)
256 .await
257 .map(crate::Response::into_body)
258 }
259
260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
264 self.0.request.name = v.into();
265 self
266 }
267 }
268
269 #[doc(hidden)]
270 impl crate::RequestBuilder for GetKeyHandle {
271 fn request_options(&mut self) -> &mut crate::RequestOptions {
272 &mut self.0.options
273 }
274 }
275
276 #[derive(Clone, Debug)]
297 pub struct ListKeyHandles(RequestBuilder<crate::model::ListKeyHandlesRequest>);
298
299 impl ListKeyHandles {
300 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
301 Self(RequestBuilder::new(stub))
302 }
303
304 pub fn with_request<V: Into<crate::model::ListKeyHandlesRequest>>(mut self, v: V) -> Self {
306 self.0.request = v.into();
307 self
308 }
309
310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
312 self.0.options = v.into();
313 self
314 }
315
316 pub async fn send(self) -> Result<crate::model::ListKeyHandlesResponse> {
318 (*self.0.stub)
319 .list_key_handles(self.0.request, self.0.options)
320 .await
321 .map(crate::Response::into_body)
322 }
323
324 pub fn by_page(
326 self,
327 ) -> impl google_cloud_gax::paginator::Paginator<
328 crate::model::ListKeyHandlesResponse,
329 crate::Error,
330 > {
331 use std::clone::Clone;
332 let token = self.0.request.page_token.clone();
333 let execute = move |token: String| {
334 let mut builder = self.clone();
335 builder.0.request = builder.0.request.set_page_token(token);
336 builder.send()
337 };
338 google_cloud_gax::paginator::internal::new_paginator(token, execute)
339 }
340
341 pub fn by_item(
343 self,
344 ) -> impl google_cloud_gax::paginator::ItemPaginator<
345 crate::model::ListKeyHandlesResponse,
346 crate::Error,
347 > {
348 use google_cloud_gax::paginator::Paginator;
349 self.by_page().items()
350 }
351
352 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.parent = v.into();
357 self
358 }
359
360 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
362 self.0.request.page_size = v.into();
363 self
364 }
365
366 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
368 self.0.request.page_token = v.into();
369 self
370 }
371
372 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
374 self.0.request.filter = v.into();
375 self
376 }
377 }
378
379 #[doc(hidden)]
380 impl crate::RequestBuilder for ListKeyHandles {
381 fn request_options(&mut self) -> &mut crate::RequestOptions {
382 &mut self.0.options
383 }
384 }
385
386 #[derive(Clone, Debug)]
407 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
408
409 impl ListLocations {
410 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
411 Self(RequestBuilder::new(stub))
412 }
413
414 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
416 mut self,
417 v: V,
418 ) -> Self {
419 self.0.request = v.into();
420 self
421 }
422
423 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
425 self.0.options = v.into();
426 self
427 }
428
429 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
431 (*self.0.stub)
432 .list_locations(self.0.request, self.0.options)
433 .await
434 .map(crate::Response::into_body)
435 }
436
437 pub fn by_page(
439 self,
440 ) -> impl google_cloud_gax::paginator::Paginator<
441 google_cloud_location::model::ListLocationsResponse,
442 crate::Error,
443 > {
444 use std::clone::Clone;
445 let token = self.0.request.page_token.clone();
446 let execute = move |token: String| {
447 let mut builder = self.clone();
448 builder.0.request = builder.0.request.set_page_token(token);
449 builder.send()
450 };
451 google_cloud_gax::paginator::internal::new_paginator(token, execute)
452 }
453
454 pub fn by_item(
456 self,
457 ) -> impl google_cloud_gax::paginator::ItemPaginator<
458 google_cloud_location::model::ListLocationsResponse,
459 crate::Error,
460 > {
461 use google_cloud_gax::paginator::Paginator;
462 self.by_page().items()
463 }
464
465 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
467 self.0.request.name = v.into();
468 self
469 }
470
471 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
473 self.0.request.filter = v.into();
474 self
475 }
476
477 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
479 self.0.request.page_size = v.into();
480 self
481 }
482
483 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
485 self.0.request.page_token = v.into();
486 self
487 }
488 }
489
490 #[doc(hidden)]
491 impl crate::RequestBuilder for ListLocations {
492 fn request_options(&mut self) -> &mut crate::RequestOptions {
493 &mut self.0.options
494 }
495 }
496
497 #[derive(Clone, Debug)]
514 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
515
516 impl GetLocation {
517 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
518 Self(RequestBuilder::new(stub))
519 }
520
521 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
523 mut self,
524 v: V,
525 ) -> Self {
526 self.0.request = v.into();
527 self
528 }
529
530 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
532 self.0.options = v.into();
533 self
534 }
535
536 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
538 (*self.0.stub)
539 .get_location(self.0.request, self.0.options)
540 .await
541 .map(crate::Response::into_body)
542 }
543
544 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
546 self.0.request.name = v.into();
547 self
548 }
549 }
550
551 #[doc(hidden)]
552 impl crate::RequestBuilder for GetLocation {
553 fn request_options(&mut self) -> &mut crate::RequestOptions {
554 &mut self.0.options
555 }
556 }
557
558 #[derive(Clone, Debug)]
575 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
576
577 impl SetIamPolicy {
578 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
579 Self(RequestBuilder::new(stub))
580 }
581
582 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
584 mut self,
585 v: V,
586 ) -> Self {
587 self.0.request = v.into();
588 self
589 }
590
591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
593 self.0.options = v.into();
594 self
595 }
596
597 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
599 (*self.0.stub)
600 .set_iam_policy(self.0.request, self.0.options)
601 .await
602 .map(crate::Response::into_body)
603 }
604
605 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
609 self.0.request.resource = v.into();
610 self
611 }
612
613 pub fn set_policy<T>(mut self, v: T) -> Self
617 where
618 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
619 {
620 self.0.request.policy = std::option::Option::Some(v.into());
621 self
622 }
623
624 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
628 where
629 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
630 {
631 self.0.request.policy = v.map(|x| x.into());
632 self
633 }
634
635 pub fn set_update_mask<T>(mut self, v: T) -> Self
637 where
638 T: std::convert::Into<wkt::FieldMask>,
639 {
640 self.0.request.update_mask = std::option::Option::Some(v.into());
641 self
642 }
643
644 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
646 where
647 T: std::convert::Into<wkt::FieldMask>,
648 {
649 self.0.request.update_mask = v.map(|x| x.into());
650 self
651 }
652 }
653
654 #[doc(hidden)]
655 impl crate::RequestBuilder for SetIamPolicy {
656 fn request_options(&mut self) -> &mut crate::RequestOptions {
657 &mut self.0.options
658 }
659 }
660
661 #[derive(Clone, Debug)]
678 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
679
680 impl GetIamPolicy {
681 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
682 Self(RequestBuilder::new(stub))
683 }
684
685 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
687 mut self,
688 v: V,
689 ) -> Self {
690 self.0.request = v.into();
691 self
692 }
693
694 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
696 self.0.options = v.into();
697 self
698 }
699
700 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
702 (*self.0.stub)
703 .get_iam_policy(self.0.request, self.0.options)
704 .await
705 .map(crate::Response::into_body)
706 }
707
708 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
712 self.0.request.resource = v.into();
713 self
714 }
715
716 pub fn set_options<T>(mut self, v: T) -> Self
718 where
719 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
720 {
721 self.0.request.options = std::option::Option::Some(v.into());
722 self
723 }
724
725 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
727 where
728 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
729 {
730 self.0.request.options = v.map(|x| x.into());
731 self
732 }
733 }
734
735 #[doc(hidden)]
736 impl crate::RequestBuilder for GetIamPolicy {
737 fn request_options(&mut self) -> &mut crate::RequestOptions {
738 &mut self.0.options
739 }
740 }
741
742 #[derive(Clone, Debug)]
759 pub struct TestIamPermissions(
760 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
761 );
762
763 impl TestIamPermissions {
764 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
765 Self(RequestBuilder::new(stub))
766 }
767
768 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
770 mut self,
771 v: V,
772 ) -> Self {
773 self.0.request = v.into();
774 self
775 }
776
777 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
779 self.0.options = v.into();
780 self
781 }
782
783 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
785 (*self.0.stub)
786 .test_iam_permissions(self.0.request, self.0.options)
787 .await
788 .map(crate::Response::into_body)
789 }
790
791 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
795 self.0.request.resource = v.into();
796 self
797 }
798
799 pub fn set_permissions<T, V>(mut self, v: T) -> Self
803 where
804 T: std::iter::IntoIterator<Item = V>,
805 V: std::convert::Into<std::string::String>,
806 {
807 use std::iter::Iterator;
808 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
809 self
810 }
811 }
812
813 #[doc(hidden)]
814 impl crate::RequestBuilder for TestIamPermissions {
815 fn request_options(&mut self) -> &mut crate::RequestOptions {
816 &mut self.0.options
817 }
818 }
819
820 #[derive(Clone, Debug)]
837 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
838
839 impl GetOperation {
840 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
841 Self(RequestBuilder::new(stub))
842 }
843
844 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
846 mut self,
847 v: V,
848 ) -> Self {
849 self.0.request = v.into();
850 self
851 }
852
853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
855 self.0.options = v.into();
856 self
857 }
858
859 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
861 (*self.0.stub)
862 .get_operation(self.0.request, self.0.options)
863 .await
864 .map(crate::Response::into_body)
865 }
866
867 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
869 self.0.request.name = v.into();
870 self
871 }
872 }
873
874 #[doc(hidden)]
875 impl crate::RequestBuilder for GetOperation {
876 fn request_options(&mut self) -> &mut crate::RequestOptions {
877 &mut self.0.options
878 }
879 }
880}
881
882pub mod autokey_admin {
884 use crate::Result;
885
886 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
900
901 pub(crate) mod client {
902 use super::super::super::client::AutokeyAdmin;
903 pub struct Factory;
904 impl crate::ClientFactory for Factory {
905 type Client = AutokeyAdmin;
906 type Credentials = gaxi::options::Credentials;
907 async fn build(
908 self,
909 config: gaxi::options::ClientConfig,
910 ) -> crate::ClientBuilderResult<Self::Client> {
911 Self::Client::new(config).await
912 }
913 }
914 }
915
916 #[derive(Clone, Debug)]
918 pub(crate) struct RequestBuilder<R: std::default::Default> {
919 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
920 request: R,
921 options: crate::RequestOptions,
922 }
923
924 impl<R> RequestBuilder<R>
925 where
926 R: std::default::Default,
927 {
928 pub(crate) fn new(
929 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
930 ) -> Self {
931 Self {
932 stub,
933 request: R::default(),
934 options: crate::RequestOptions::default(),
935 }
936 }
937 }
938
939 #[derive(Clone, Debug)]
956 pub struct UpdateAutokeyConfig(RequestBuilder<crate::model::UpdateAutokeyConfigRequest>);
957
958 impl UpdateAutokeyConfig {
959 pub(crate) fn new(
960 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
961 ) -> Self {
962 Self(RequestBuilder::new(stub))
963 }
964
965 pub fn with_request<V: Into<crate::model::UpdateAutokeyConfigRequest>>(
967 mut self,
968 v: V,
969 ) -> Self {
970 self.0.request = v.into();
971 self
972 }
973
974 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
976 self.0.options = v.into();
977 self
978 }
979
980 pub async fn send(self) -> Result<crate::model::AutokeyConfig> {
982 (*self.0.stub)
983 .update_autokey_config(self.0.request, self.0.options)
984 .await
985 .map(crate::Response::into_body)
986 }
987
988 pub fn set_autokey_config<T>(mut self, v: T) -> Self
992 where
993 T: std::convert::Into<crate::model::AutokeyConfig>,
994 {
995 self.0.request.autokey_config = std::option::Option::Some(v.into());
996 self
997 }
998
999 pub fn set_or_clear_autokey_config<T>(mut self, v: std::option::Option<T>) -> Self
1003 where
1004 T: std::convert::Into<crate::model::AutokeyConfig>,
1005 {
1006 self.0.request.autokey_config = v.map(|x| x.into());
1007 self
1008 }
1009
1010 pub fn set_update_mask<T>(mut self, v: T) -> Self
1014 where
1015 T: std::convert::Into<wkt::FieldMask>,
1016 {
1017 self.0.request.update_mask = std::option::Option::Some(v.into());
1018 self
1019 }
1020
1021 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1025 where
1026 T: std::convert::Into<wkt::FieldMask>,
1027 {
1028 self.0.request.update_mask = v.map(|x| x.into());
1029 self
1030 }
1031 }
1032
1033 #[doc(hidden)]
1034 impl crate::RequestBuilder for UpdateAutokeyConfig {
1035 fn request_options(&mut self) -> &mut crate::RequestOptions {
1036 &mut self.0.options
1037 }
1038 }
1039
1040 #[derive(Clone, Debug)]
1057 pub struct GetAutokeyConfig(RequestBuilder<crate::model::GetAutokeyConfigRequest>);
1058
1059 impl GetAutokeyConfig {
1060 pub(crate) fn new(
1061 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1062 ) -> Self {
1063 Self(RequestBuilder::new(stub))
1064 }
1065
1066 pub fn with_request<V: Into<crate::model::GetAutokeyConfigRequest>>(
1068 mut self,
1069 v: V,
1070 ) -> Self {
1071 self.0.request = v.into();
1072 self
1073 }
1074
1075 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1077 self.0.options = v.into();
1078 self
1079 }
1080
1081 pub async fn send(self) -> Result<crate::model::AutokeyConfig> {
1083 (*self.0.stub)
1084 .get_autokey_config(self.0.request, self.0.options)
1085 .await
1086 .map(crate::Response::into_body)
1087 }
1088
1089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1093 self.0.request.name = v.into();
1094 self
1095 }
1096 }
1097
1098 #[doc(hidden)]
1099 impl crate::RequestBuilder for GetAutokeyConfig {
1100 fn request_options(&mut self) -> &mut crate::RequestOptions {
1101 &mut self.0.options
1102 }
1103 }
1104
1105 #[derive(Clone, Debug)]
1122 pub struct ShowEffectiveAutokeyConfig(
1123 RequestBuilder<crate::model::ShowEffectiveAutokeyConfigRequest>,
1124 );
1125
1126 impl ShowEffectiveAutokeyConfig {
1127 pub(crate) fn new(
1128 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1129 ) -> Self {
1130 Self(RequestBuilder::new(stub))
1131 }
1132
1133 pub fn with_request<V: Into<crate::model::ShowEffectiveAutokeyConfigRequest>>(
1135 mut self,
1136 v: V,
1137 ) -> Self {
1138 self.0.request = v.into();
1139 self
1140 }
1141
1142 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1144 self.0.options = v.into();
1145 self
1146 }
1147
1148 pub async fn send(self) -> Result<crate::model::ShowEffectiveAutokeyConfigResponse> {
1150 (*self.0.stub)
1151 .show_effective_autokey_config(self.0.request, self.0.options)
1152 .await
1153 .map(crate::Response::into_body)
1154 }
1155
1156 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1160 self.0.request.parent = v.into();
1161 self
1162 }
1163 }
1164
1165 #[doc(hidden)]
1166 impl crate::RequestBuilder for ShowEffectiveAutokeyConfig {
1167 fn request_options(&mut self) -> &mut crate::RequestOptions {
1168 &mut self.0.options
1169 }
1170 }
1171
1172 #[derive(Clone, Debug)]
1193 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1194
1195 impl ListLocations {
1196 pub(crate) fn new(
1197 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1198 ) -> Self {
1199 Self(RequestBuilder::new(stub))
1200 }
1201
1202 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1204 mut self,
1205 v: V,
1206 ) -> Self {
1207 self.0.request = v.into();
1208 self
1209 }
1210
1211 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1213 self.0.options = v.into();
1214 self
1215 }
1216
1217 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1219 (*self.0.stub)
1220 .list_locations(self.0.request, self.0.options)
1221 .await
1222 .map(crate::Response::into_body)
1223 }
1224
1225 pub fn by_page(
1227 self,
1228 ) -> impl google_cloud_gax::paginator::Paginator<
1229 google_cloud_location::model::ListLocationsResponse,
1230 crate::Error,
1231 > {
1232 use std::clone::Clone;
1233 let token = self.0.request.page_token.clone();
1234 let execute = move |token: String| {
1235 let mut builder = self.clone();
1236 builder.0.request = builder.0.request.set_page_token(token);
1237 builder.send()
1238 };
1239 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1240 }
1241
1242 pub fn by_item(
1244 self,
1245 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1246 google_cloud_location::model::ListLocationsResponse,
1247 crate::Error,
1248 > {
1249 use google_cloud_gax::paginator::Paginator;
1250 self.by_page().items()
1251 }
1252
1253 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1255 self.0.request.name = v.into();
1256 self
1257 }
1258
1259 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1261 self.0.request.filter = v.into();
1262 self
1263 }
1264
1265 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1267 self.0.request.page_size = v.into();
1268 self
1269 }
1270
1271 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1273 self.0.request.page_token = v.into();
1274 self
1275 }
1276 }
1277
1278 #[doc(hidden)]
1279 impl crate::RequestBuilder for ListLocations {
1280 fn request_options(&mut self) -> &mut crate::RequestOptions {
1281 &mut self.0.options
1282 }
1283 }
1284
1285 #[derive(Clone, Debug)]
1302 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1303
1304 impl GetLocation {
1305 pub(crate) fn new(
1306 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1307 ) -> Self {
1308 Self(RequestBuilder::new(stub))
1309 }
1310
1311 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1313 mut self,
1314 v: V,
1315 ) -> Self {
1316 self.0.request = v.into();
1317 self
1318 }
1319
1320 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1322 self.0.options = v.into();
1323 self
1324 }
1325
1326 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1328 (*self.0.stub)
1329 .get_location(self.0.request, self.0.options)
1330 .await
1331 .map(crate::Response::into_body)
1332 }
1333
1334 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.0.request.name = v.into();
1337 self
1338 }
1339 }
1340
1341 #[doc(hidden)]
1342 impl crate::RequestBuilder for GetLocation {
1343 fn request_options(&mut self) -> &mut crate::RequestOptions {
1344 &mut self.0.options
1345 }
1346 }
1347
1348 #[derive(Clone, Debug)]
1365 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1366
1367 impl SetIamPolicy {
1368 pub(crate) fn new(
1369 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1370 ) -> Self {
1371 Self(RequestBuilder::new(stub))
1372 }
1373
1374 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1376 mut self,
1377 v: V,
1378 ) -> Self {
1379 self.0.request = v.into();
1380 self
1381 }
1382
1383 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1385 self.0.options = v.into();
1386 self
1387 }
1388
1389 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1391 (*self.0.stub)
1392 .set_iam_policy(self.0.request, self.0.options)
1393 .await
1394 .map(crate::Response::into_body)
1395 }
1396
1397 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1401 self.0.request.resource = v.into();
1402 self
1403 }
1404
1405 pub fn set_policy<T>(mut self, v: T) -> Self
1409 where
1410 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1411 {
1412 self.0.request.policy = std::option::Option::Some(v.into());
1413 self
1414 }
1415
1416 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1420 where
1421 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1422 {
1423 self.0.request.policy = v.map(|x| x.into());
1424 self
1425 }
1426
1427 pub fn set_update_mask<T>(mut self, v: T) -> Self
1429 where
1430 T: std::convert::Into<wkt::FieldMask>,
1431 {
1432 self.0.request.update_mask = std::option::Option::Some(v.into());
1433 self
1434 }
1435
1436 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1438 where
1439 T: std::convert::Into<wkt::FieldMask>,
1440 {
1441 self.0.request.update_mask = v.map(|x| x.into());
1442 self
1443 }
1444 }
1445
1446 #[doc(hidden)]
1447 impl crate::RequestBuilder for SetIamPolicy {
1448 fn request_options(&mut self) -> &mut crate::RequestOptions {
1449 &mut self.0.options
1450 }
1451 }
1452
1453 #[derive(Clone, Debug)]
1470 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1471
1472 impl GetIamPolicy {
1473 pub(crate) fn new(
1474 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1475 ) -> Self {
1476 Self(RequestBuilder::new(stub))
1477 }
1478
1479 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1481 mut self,
1482 v: V,
1483 ) -> Self {
1484 self.0.request = v.into();
1485 self
1486 }
1487
1488 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1490 self.0.options = v.into();
1491 self
1492 }
1493
1494 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1496 (*self.0.stub)
1497 .get_iam_policy(self.0.request, self.0.options)
1498 .await
1499 .map(crate::Response::into_body)
1500 }
1501
1502 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1506 self.0.request.resource = v.into();
1507 self
1508 }
1509
1510 pub fn set_options<T>(mut self, v: T) -> Self
1512 where
1513 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1514 {
1515 self.0.request.options = std::option::Option::Some(v.into());
1516 self
1517 }
1518
1519 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1521 where
1522 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1523 {
1524 self.0.request.options = v.map(|x| x.into());
1525 self
1526 }
1527 }
1528
1529 #[doc(hidden)]
1530 impl crate::RequestBuilder for GetIamPolicy {
1531 fn request_options(&mut self) -> &mut crate::RequestOptions {
1532 &mut self.0.options
1533 }
1534 }
1535
1536 #[derive(Clone, Debug)]
1553 pub struct TestIamPermissions(
1554 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1555 );
1556
1557 impl TestIamPermissions {
1558 pub(crate) fn new(
1559 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1560 ) -> Self {
1561 Self(RequestBuilder::new(stub))
1562 }
1563
1564 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1566 mut self,
1567 v: V,
1568 ) -> Self {
1569 self.0.request = v.into();
1570 self
1571 }
1572
1573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1575 self.0.options = v.into();
1576 self
1577 }
1578
1579 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1581 (*self.0.stub)
1582 .test_iam_permissions(self.0.request, self.0.options)
1583 .await
1584 .map(crate::Response::into_body)
1585 }
1586
1587 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1591 self.0.request.resource = v.into();
1592 self
1593 }
1594
1595 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1599 where
1600 T: std::iter::IntoIterator<Item = V>,
1601 V: std::convert::Into<std::string::String>,
1602 {
1603 use std::iter::Iterator;
1604 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1605 self
1606 }
1607 }
1608
1609 #[doc(hidden)]
1610 impl crate::RequestBuilder for TestIamPermissions {
1611 fn request_options(&mut self) -> &mut crate::RequestOptions {
1612 &mut self.0.options
1613 }
1614 }
1615
1616 #[derive(Clone, Debug)]
1633 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1634
1635 impl GetOperation {
1636 pub(crate) fn new(
1637 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1638 ) -> Self {
1639 Self(RequestBuilder::new(stub))
1640 }
1641
1642 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1644 mut self,
1645 v: V,
1646 ) -> Self {
1647 self.0.request = v.into();
1648 self
1649 }
1650
1651 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1653 self.0.options = v.into();
1654 self
1655 }
1656
1657 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1659 (*self.0.stub)
1660 .get_operation(self.0.request, self.0.options)
1661 .await
1662 .map(crate::Response::into_body)
1663 }
1664
1665 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1667 self.0.request.name = v.into();
1668 self
1669 }
1670 }
1671
1672 #[doc(hidden)]
1673 impl crate::RequestBuilder for GetOperation {
1674 fn request_options(&mut self) -> &mut crate::RequestOptions {
1675 &mut self.0.options
1676 }
1677 }
1678}
1679
1680pub mod ekm_service {
1682 use crate::Result;
1683
1684 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1698
1699 pub(crate) mod client {
1700 use super::super::super::client::EkmService;
1701 pub struct Factory;
1702 impl crate::ClientFactory for Factory {
1703 type Client = EkmService;
1704 type Credentials = gaxi::options::Credentials;
1705 async fn build(
1706 self,
1707 config: gaxi::options::ClientConfig,
1708 ) -> crate::ClientBuilderResult<Self::Client> {
1709 Self::Client::new(config).await
1710 }
1711 }
1712 }
1713
1714 #[derive(Clone, Debug)]
1716 pub(crate) struct RequestBuilder<R: std::default::Default> {
1717 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1718 request: R,
1719 options: crate::RequestOptions,
1720 }
1721
1722 impl<R> RequestBuilder<R>
1723 where
1724 R: std::default::Default,
1725 {
1726 pub(crate) fn new(
1727 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1728 ) -> Self {
1729 Self {
1730 stub,
1731 request: R::default(),
1732 options: crate::RequestOptions::default(),
1733 }
1734 }
1735 }
1736
1737 #[derive(Clone, Debug)]
1758 pub struct ListEkmConnections(RequestBuilder<crate::model::ListEkmConnectionsRequest>);
1759
1760 impl ListEkmConnections {
1761 pub(crate) fn new(
1762 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1763 ) -> Self {
1764 Self(RequestBuilder::new(stub))
1765 }
1766
1767 pub fn with_request<V: Into<crate::model::ListEkmConnectionsRequest>>(
1769 mut self,
1770 v: V,
1771 ) -> Self {
1772 self.0.request = v.into();
1773 self
1774 }
1775
1776 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1778 self.0.options = v.into();
1779 self
1780 }
1781
1782 pub async fn send(self) -> Result<crate::model::ListEkmConnectionsResponse> {
1784 (*self.0.stub)
1785 .list_ekm_connections(self.0.request, self.0.options)
1786 .await
1787 .map(crate::Response::into_body)
1788 }
1789
1790 pub fn by_page(
1792 self,
1793 ) -> impl google_cloud_gax::paginator::Paginator<
1794 crate::model::ListEkmConnectionsResponse,
1795 crate::Error,
1796 > {
1797 use std::clone::Clone;
1798 let token = self.0.request.page_token.clone();
1799 let execute = move |token: String| {
1800 let mut builder = self.clone();
1801 builder.0.request = builder.0.request.set_page_token(token);
1802 builder.send()
1803 };
1804 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1805 }
1806
1807 pub fn by_item(
1809 self,
1810 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1811 crate::model::ListEkmConnectionsResponse,
1812 crate::Error,
1813 > {
1814 use google_cloud_gax::paginator::Paginator;
1815 self.by_page().items()
1816 }
1817
1818 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1822 self.0.request.parent = v.into();
1823 self
1824 }
1825
1826 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1828 self.0.request.page_size = v.into();
1829 self
1830 }
1831
1832 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1834 self.0.request.page_token = v.into();
1835 self
1836 }
1837
1838 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1840 self.0.request.filter = v.into();
1841 self
1842 }
1843
1844 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1846 self.0.request.order_by = v.into();
1847 self
1848 }
1849 }
1850
1851 #[doc(hidden)]
1852 impl crate::RequestBuilder for ListEkmConnections {
1853 fn request_options(&mut self) -> &mut crate::RequestOptions {
1854 &mut self.0.options
1855 }
1856 }
1857
1858 #[derive(Clone, Debug)]
1875 pub struct GetEkmConnection(RequestBuilder<crate::model::GetEkmConnectionRequest>);
1876
1877 impl GetEkmConnection {
1878 pub(crate) fn new(
1879 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1880 ) -> Self {
1881 Self(RequestBuilder::new(stub))
1882 }
1883
1884 pub fn with_request<V: Into<crate::model::GetEkmConnectionRequest>>(
1886 mut self,
1887 v: V,
1888 ) -> Self {
1889 self.0.request = v.into();
1890 self
1891 }
1892
1893 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1895 self.0.options = v.into();
1896 self
1897 }
1898
1899 pub async fn send(self) -> Result<crate::model::EkmConnection> {
1901 (*self.0.stub)
1902 .get_ekm_connection(self.0.request, self.0.options)
1903 .await
1904 .map(crate::Response::into_body)
1905 }
1906
1907 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1911 self.0.request.name = v.into();
1912 self
1913 }
1914 }
1915
1916 #[doc(hidden)]
1917 impl crate::RequestBuilder for GetEkmConnection {
1918 fn request_options(&mut self) -> &mut crate::RequestOptions {
1919 &mut self.0.options
1920 }
1921 }
1922
1923 #[derive(Clone, Debug)]
1940 pub struct CreateEkmConnection(RequestBuilder<crate::model::CreateEkmConnectionRequest>);
1941
1942 impl CreateEkmConnection {
1943 pub(crate) fn new(
1944 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1945 ) -> Self {
1946 Self(RequestBuilder::new(stub))
1947 }
1948
1949 pub fn with_request<V: Into<crate::model::CreateEkmConnectionRequest>>(
1951 mut self,
1952 v: V,
1953 ) -> Self {
1954 self.0.request = v.into();
1955 self
1956 }
1957
1958 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1960 self.0.options = v.into();
1961 self
1962 }
1963
1964 pub async fn send(self) -> Result<crate::model::EkmConnection> {
1966 (*self.0.stub)
1967 .create_ekm_connection(self.0.request, self.0.options)
1968 .await
1969 .map(crate::Response::into_body)
1970 }
1971
1972 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.0.request.parent = v.into();
1977 self
1978 }
1979
1980 pub fn set_ekm_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1984 self.0.request.ekm_connection_id = v.into();
1985 self
1986 }
1987
1988 pub fn set_ekm_connection<T>(mut self, v: T) -> Self
1992 where
1993 T: std::convert::Into<crate::model::EkmConnection>,
1994 {
1995 self.0.request.ekm_connection = std::option::Option::Some(v.into());
1996 self
1997 }
1998
1999 pub fn set_or_clear_ekm_connection<T>(mut self, v: std::option::Option<T>) -> Self
2003 where
2004 T: std::convert::Into<crate::model::EkmConnection>,
2005 {
2006 self.0.request.ekm_connection = v.map(|x| x.into());
2007 self
2008 }
2009 }
2010
2011 #[doc(hidden)]
2012 impl crate::RequestBuilder for CreateEkmConnection {
2013 fn request_options(&mut self) -> &mut crate::RequestOptions {
2014 &mut self.0.options
2015 }
2016 }
2017
2018 #[derive(Clone, Debug)]
2035 pub struct UpdateEkmConnection(RequestBuilder<crate::model::UpdateEkmConnectionRequest>);
2036
2037 impl UpdateEkmConnection {
2038 pub(crate) fn new(
2039 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2040 ) -> Self {
2041 Self(RequestBuilder::new(stub))
2042 }
2043
2044 pub fn with_request<V: Into<crate::model::UpdateEkmConnectionRequest>>(
2046 mut self,
2047 v: V,
2048 ) -> Self {
2049 self.0.request = v.into();
2050 self
2051 }
2052
2053 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2055 self.0.options = v.into();
2056 self
2057 }
2058
2059 pub async fn send(self) -> Result<crate::model::EkmConnection> {
2061 (*self.0.stub)
2062 .update_ekm_connection(self.0.request, self.0.options)
2063 .await
2064 .map(crate::Response::into_body)
2065 }
2066
2067 pub fn set_ekm_connection<T>(mut self, v: T) -> Self
2071 where
2072 T: std::convert::Into<crate::model::EkmConnection>,
2073 {
2074 self.0.request.ekm_connection = std::option::Option::Some(v.into());
2075 self
2076 }
2077
2078 pub fn set_or_clear_ekm_connection<T>(mut self, v: std::option::Option<T>) -> Self
2082 where
2083 T: std::convert::Into<crate::model::EkmConnection>,
2084 {
2085 self.0.request.ekm_connection = v.map(|x| x.into());
2086 self
2087 }
2088
2089 pub fn set_update_mask<T>(mut self, v: T) -> Self
2093 where
2094 T: std::convert::Into<wkt::FieldMask>,
2095 {
2096 self.0.request.update_mask = std::option::Option::Some(v.into());
2097 self
2098 }
2099
2100 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2104 where
2105 T: std::convert::Into<wkt::FieldMask>,
2106 {
2107 self.0.request.update_mask = v.map(|x| x.into());
2108 self
2109 }
2110 }
2111
2112 #[doc(hidden)]
2113 impl crate::RequestBuilder for UpdateEkmConnection {
2114 fn request_options(&mut self) -> &mut crate::RequestOptions {
2115 &mut self.0.options
2116 }
2117 }
2118
2119 #[derive(Clone, Debug)]
2136 pub struct GetEkmConfig(RequestBuilder<crate::model::GetEkmConfigRequest>);
2137
2138 impl GetEkmConfig {
2139 pub(crate) fn new(
2140 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2141 ) -> Self {
2142 Self(RequestBuilder::new(stub))
2143 }
2144
2145 pub fn with_request<V: Into<crate::model::GetEkmConfigRequest>>(mut self, v: V) -> Self {
2147 self.0.request = v.into();
2148 self
2149 }
2150
2151 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2153 self.0.options = v.into();
2154 self
2155 }
2156
2157 pub async fn send(self) -> Result<crate::model::EkmConfig> {
2159 (*self.0.stub)
2160 .get_ekm_config(self.0.request, self.0.options)
2161 .await
2162 .map(crate::Response::into_body)
2163 }
2164
2165 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2169 self.0.request.name = v.into();
2170 self
2171 }
2172 }
2173
2174 #[doc(hidden)]
2175 impl crate::RequestBuilder for GetEkmConfig {
2176 fn request_options(&mut self) -> &mut crate::RequestOptions {
2177 &mut self.0.options
2178 }
2179 }
2180
2181 #[derive(Clone, Debug)]
2198 pub struct UpdateEkmConfig(RequestBuilder<crate::model::UpdateEkmConfigRequest>);
2199
2200 impl UpdateEkmConfig {
2201 pub(crate) fn new(
2202 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2203 ) -> Self {
2204 Self(RequestBuilder::new(stub))
2205 }
2206
2207 pub fn with_request<V: Into<crate::model::UpdateEkmConfigRequest>>(mut self, v: V) -> Self {
2209 self.0.request = v.into();
2210 self
2211 }
2212
2213 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2215 self.0.options = v.into();
2216 self
2217 }
2218
2219 pub async fn send(self) -> Result<crate::model::EkmConfig> {
2221 (*self.0.stub)
2222 .update_ekm_config(self.0.request, self.0.options)
2223 .await
2224 .map(crate::Response::into_body)
2225 }
2226
2227 pub fn set_ekm_config<T>(mut self, v: T) -> Self
2231 where
2232 T: std::convert::Into<crate::model::EkmConfig>,
2233 {
2234 self.0.request.ekm_config = std::option::Option::Some(v.into());
2235 self
2236 }
2237
2238 pub fn set_or_clear_ekm_config<T>(mut self, v: std::option::Option<T>) -> Self
2242 where
2243 T: std::convert::Into<crate::model::EkmConfig>,
2244 {
2245 self.0.request.ekm_config = v.map(|x| x.into());
2246 self
2247 }
2248
2249 pub fn set_update_mask<T>(mut self, v: T) -> Self
2253 where
2254 T: std::convert::Into<wkt::FieldMask>,
2255 {
2256 self.0.request.update_mask = std::option::Option::Some(v.into());
2257 self
2258 }
2259
2260 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2264 where
2265 T: std::convert::Into<wkt::FieldMask>,
2266 {
2267 self.0.request.update_mask = v.map(|x| x.into());
2268 self
2269 }
2270 }
2271
2272 #[doc(hidden)]
2273 impl crate::RequestBuilder for UpdateEkmConfig {
2274 fn request_options(&mut self) -> &mut crate::RequestOptions {
2275 &mut self.0.options
2276 }
2277 }
2278
2279 #[derive(Clone, Debug)]
2296 pub struct VerifyConnectivity(RequestBuilder<crate::model::VerifyConnectivityRequest>);
2297
2298 impl VerifyConnectivity {
2299 pub(crate) fn new(
2300 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2301 ) -> Self {
2302 Self(RequestBuilder::new(stub))
2303 }
2304
2305 pub fn with_request<V: Into<crate::model::VerifyConnectivityRequest>>(
2307 mut self,
2308 v: V,
2309 ) -> Self {
2310 self.0.request = v.into();
2311 self
2312 }
2313
2314 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2316 self.0.options = v.into();
2317 self
2318 }
2319
2320 pub async fn send(self) -> Result<crate::model::VerifyConnectivityResponse> {
2322 (*self.0.stub)
2323 .verify_connectivity(self.0.request, self.0.options)
2324 .await
2325 .map(crate::Response::into_body)
2326 }
2327
2328 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2332 self.0.request.name = v.into();
2333 self
2334 }
2335 }
2336
2337 #[doc(hidden)]
2338 impl crate::RequestBuilder for VerifyConnectivity {
2339 fn request_options(&mut self) -> &mut crate::RequestOptions {
2340 &mut self.0.options
2341 }
2342 }
2343
2344 #[derive(Clone, Debug)]
2365 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2366
2367 impl ListLocations {
2368 pub(crate) fn new(
2369 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2370 ) -> Self {
2371 Self(RequestBuilder::new(stub))
2372 }
2373
2374 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2376 mut self,
2377 v: V,
2378 ) -> Self {
2379 self.0.request = v.into();
2380 self
2381 }
2382
2383 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2385 self.0.options = v.into();
2386 self
2387 }
2388
2389 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2391 (*self.0.stub)
2392 .list_locations(self.0.request, self.0.options)
2393 .await
2394 .map(crate::Response::into_body)
2395 }
2396
2397 pub fn by_page(
2399 self,
2400 ) -> impl google_cloud_gax::paginator::Paginator<
2401 google_cloud_location::model::ListLocationsResponse,
2402 crate::Error,
2403 > {
2404 use std::clone::Clone;
2405 let token = self.0.request.page_token.clone();
2406 let execute = move |token: String| {
2407 let mut builder = self.clone();
2408 builder.0.request = builder.0.request.set_page_token(token);
2409 builder.send()
2410 };
2411 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2412 }
2413
2414 pub fn by_item(
2416 self,
2417 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2418 google_cloud_location::model::ListLocationsResponse,
2419 crate::Error,
2420 > {
2421 use google_cloud_gax::paginator::Paginator;
2422 self.by_page().items()
2423 }
2424
2425 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.0.request.name = v.into();
2428 self
2429 }
2430
2431 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2433 self.0.request.filter = v.into();
2434 self
2435 }
2436
2437 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2439 self.0.request.page_size = v.into();
2440 self
2441 }
2442
2443 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2445 self.0.request.page_token = v.into();
2446 self
2447 }
2448 }
2449
2450 #[doc(hidden)]
2451 impl crate::RequestBuilder for ListLocations {
2452 fn request_options(&mut self) -> &mut crate::RequestOptions {
2453 &mut self.0.options
2454 }
2455 }
2456
2457 #[derive(Clone, Debug)]
2474 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2475
2476 impl GetLocation {
2477 pub(crate) fn new(
2478 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2479 ) -> Self {
2480 Self(RequestBuilder::new(stub))
2481 }
2482
2483 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2485 mut self,
2486 v: V,
2487 ) -> Self {
2488 self.0.request = v.into();
2489 self
2490 }
2491
2492 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2494 self.0.options = v.into();
2495 self
2496 }
2497
2498 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2500 (*self.0.stub)
2501 .get_location(self.0.request, self.0.options)
2502 .await
2503 .map(crate::Response::into_body)
2504 }
2505
2506 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2508 self.0.request.name = v.into();
2509 self
2510 }
2511 }
2512
2513 #[doc(hidden)]
2514 impl crate::RequestBuilder for GetLocation {
2515 fn request_options(&mut self) -> &mut crate::RequestOptions {
2516 &mut self.0.options
2517 }
2518 }
2519
2520 #[derive(Clone, Debug)]
2537 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2538
2539 impl SetIamPolicy {
2540 pub(crate) fn new(
2541 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2542 ) -> Self {
2543 Self(RequestBuilder::new(stub))
2544 }
2545
2546 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2548 mut self,
2549 v: V,
2550 ) -> Self {
2551 self.0.request = v.into();
2552 self
2553 }
2554
2555 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2557 self.0.options = v.into();
2558 self
2559 }
2560
2561 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2563 (*self.0.stub)
2564 .set_iam_policy(self.0.request, self.0.options)
2565 .await
2566 .map(crate::Response::into_body)
2567 }
2568
2569 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573 self.0.request.resource = v.into();
2574 self
2575 }
2576
2577 pub fn set_policy<T>(mut self, v: T) -> Self
2581 where
2582 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2583 {
2584 self.0.request.policy = std::option::Option::Some(v.into());
2585 self
2586 }
2587
2588 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2592 where
2593 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2594 {
2595 self.0.request.policy = v.map(|x| x.into());
2596 self
2597 }
2598
2599 pub fn set_update_mask<T>(mut self, v: T) -> Self
2601 where
2602 T: std::convert::Into<wkt::FieldMask>,
2603 {
2604 self.0.request.update_mask = std::option::Option::Some(v.into());
2605 self
2606 }
2607
2608 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2610 where
2611 T: std::convert::Into<wkt::FieldMask>,
2612 {
2613 self.0.request.update_mask = v.map(|x| x.into());
2614 self
2615 }
2616 }
2617
2618 #[doc(hidden)]
2619 impl crate::RequestBuilder for SetIamPolicy {
2620 fn request_options(&mut self) -> &mut crate::RequestOptions {
2621 &mut self.0.options
2622 }
2623 }
2624
2625 #[derive(Clone, Debug)]
2642 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2643
2644 impl GetIamPolicy {
2645 pub(crate) fn new(
2646 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2647 ) -> Self {
2648 Self(RequestBuilder::new(stub))
2649 }
2650
2651 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2653 mut self,
2654 v: V,
2655 ) -> Self {
2656 self.0.request = v.into();
2657 self
2658 }
2659
2660 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2662 self.0.options = v.into();
2663 self
2664 }
2665
2666 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2668 (*self.0.stub)
2669 .get_iam_policy(self.0.request, self.0.options)
2670 .await
2671 .map(crate::Response::into_body)
2672 }
2673
2674 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2678 self.0.request.resource = v.into();
2679 self
2680 }
2681
2682 pub fn set_options<T>(mut self, v: T) -> Self
2684 where
2685 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2686 {
2687 self.0.request.options = std::option::Option::Some(v.into());
2688 self
2689 }
2690
2691 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2693 where
2694 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2695 {
2696 self.0.request.options = v.map(|x| x.into());
2697 self
2698 }
2699 }
2700
2701 #[doc(hidden)]
2702 impl crate::RequestBuilder for GetIamPolicy {
2703 fn request_options(&mut self) -> &mut crate::RequestOptions {
2704 &mut self.0.options
2705 }
2706 }
2707
2708 #[derive(Clone, Debug)]
2725 pub struct TestIamPermissions(
2726 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2727 );
2728
2729 impl TestIamPermissions {
2730 pub(crate) fn new(
2731 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2732 ) -> Self {
2733 Self(RequestBuilder::new(stub))
2734 }
2735
2736 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2738 mut self,
2739 v: V,
2740 ) -> Self {
2741 self.0.request = v.into();
2742 self
2743 }
2744
2745 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2747 self.0.options = v.into();
2748 self
2749 }
2750
2751 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2753 (*self.0.stub)
2754 .test_iam_permissions(self.0.request, self.0.options)
2755 .await
2756 .map(crate::Response::into_body)
2757 }
2758
2759 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2763 self.0.request.resource = v.into();
2764 self
2765 }
2766
2767 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2771 where
2772 T: std::iter::IntoIterator<Item = V>,
2773 V: std::convert::Into<std::string::String>,
2774 {
2775 use std::iter::Iterator;
2776 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2777 self
2778 }
2779 }
2780
2781 #[doc(hidden)]
2782 impl crate::RequestBuilder for TestIamPermissions {
2783 fn request_options(&mut self) -> &mut crate::RequestOptions {
2784 &mut self.0.options
2785 }
2786 }
2787
2788 #[derive(Clone, Debug)]
2805 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2806
2807 impl GetOperation {
2808 pub(crate) fn new(
2809 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2810 ) -> Self {
2811 Self(RequestBuilder::new(stub))
2812 }
2813
2814 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2816 mut self,
2817 v: V,
2818 ) -> Self {
2819 self.0.request = v.into();
2820 self
2821 }
2822
2823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2825 self.0.options = v.into();
2826 self
2827 }
2828
2829 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2831 (*self.0.stub)
2832 .get_operation(self.0.request, self.0.options)
2833 .await
2834 .map(crate::Response::into_body)
2835 }
2836
2837 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2839 self.0.request.name = v.into();
2840 self
2841 }
2842 }
2843
2844 #[doc(hidden)]
2845 impl crate::RequestBuilder for GetOperation {
2846 fn request_options(&mut self) -> &mut crate::RequestOptions {
2847 &mut self.0.options
2848 }
2849 }
2850}
2851
2852pub mod hsm_management {
2854 use crate::Result;
2855
2856 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2870
2871 pub(crate) mod client {
2872 use super::super::super::client::HsmManagement;
2873 pub struct Factory;
2874 impl crate::ClientFactory for Factory {
2875 type Client = HsmManagement;
2876 type Credentials = gaxi::options::Credentials;
2877 async fn build(
2878 self,
2879 config: gaxi::options::ClientConfig,
2880 ) -> crate::ClientBuilderResult<Self::Client> {
2881 Self::Client::new(config).await
2882 }
2883 }
2884 }
2885
2886 #[derive(Clone, Debug)]
2888 pub(crate) struct RequestBuilder<R: std::default::Default> {
2889 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
2890 request: R,
2891 options: crate::RequestOptions,
2892 }
2893
2894 impl<R> RequestBuilder<R>
2895 where
2896 R: std::default::Default,
2897 {
2898 pub(crate) fn new(
2899 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
2900 ) -> Self {
2901 Self {
2902 stub,
2903 request: R::default(),
2904 options: crate::RequestOptions::default(),
2905 }
2906 }
2907 }
2908
2909 #[derive(Clone, Debug)]
2930 pub struct ListSingleTenantHsmInstances(
2931 RequestBuilder<crate::model::ListSingleTenantHsmInstancesRequest>,
2932 );
2933
2934 impl ListSingleTenantHsmInstances {
2935 pub(crate) fn new(
2936 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
2937 ) -> Self {
2938 Self(RequestBuilder::new(stub))
2939 }
2940
2941 pub fn with_request<V: Into<crate::model::ListSingleTenantHsmInstancesRequest>>(
2943 mut self,
2944 v: V,
2945 ) -> Self {
2946 self.0.request = v.into();
2947 self
2948 }
2949
2950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2952 self.0.options = v.into();
2953 self
2954 }
2955
2956 pub async fn send(self) -> Result<crate::model::ListSingleTenantHsmInstancesResponse> {
2958 (*self.0.stub)
2959 .list_single_tenant_hsm_instances(self.0.request, self.0.options)
2960 .await
2961 .map(crate::Response::into_body)
2962 }
2963
2964 pub fn by_page(
2966 self,
2967 ) -> impl google_cloud_gax::paginator::Paginator<
2968 crate::model::ListSingleTenantHsmInstancesResponse,
2969 crate::Error,
2970 > {
2971 use std::clone::Clone;
2972 let token = self.0.request.page_token.clone();
2973 let execute = move |token: String| {
2974 let mut builder = self.clone();
2975 builder.0.request = builder.0.request.set_page_token(token);
2976 builder.send()
2977 };
2978 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2979 }
2980
2981 pub fn by_item(
2983 self,
2984 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2985 crate::model::ListSingleTenantHsmInstancesResponse,
2986 crate::Error,
2987 > {
2988 use google_cloud_gax::paginator::Paginator;
2989 self.by_page().items()
2990 }
2991
2992 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2996 self.0.request.parent = v.into();
2997 self
2998 }
2999
3000 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3002 self.0.request.page_size = v.into();
3003 self
3004 }
3005
3006 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3008 self.0.request.page_token = v.into();
3009 self
3010 }
3011
3012 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3014 self.0.request.filter = v.into();
3015 self
3016 }
3017
3018 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3020 self.0.request.order_by = v.into();
3021 self
3022 }
3023
3024 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
3026 self.0.request.show_deleted = v.into();
3027 self
3028 }
3029 }
3030
3031 #[doc(hidden)]
3032 impl crate::RequestBuilder for ListSingleTenantHsmInstances {
3033 fn request_options(&mut self) -> &mut crate::RequestOptions {
3034 &mut self.0.options
3035 }
3036 }
3037
3038 #[derive(Clone, Debug)]
3055 pub struct GetSingleTenantHsmInstance(
3056 RequestBuilder<crate::model::GetSingleTenantHsmInstanceRequest>,
3057 );
3058
3059 impl GetSingleTenantHsmInstance {
3060 pub(crate) fn new(
3061 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3062 ) -> Self {
3063 Self(RequestBuilder::new(stub))
3064 }
3065
3066 pub fn with_request<V: Into<crate::model::GetSingleTenantHsmInstanceRequest>>(
3068 mut self,
3069 v: V,
3070 ) -> Self {
3071 self.0.request = v.into();
3072 self
3073 }
3074
3075 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3077 self.0.options = v.into();
3078 self
3079 }
3080
3081 pub async fn send(self) -> Result<crate::model::SingleTenantHsmInstance> {
3083 (*self.0.stub)
3084 .get_single_tenant_hsm_instance(self.0.request, self.0.options)
3085 .await
3086 .map(crate::Response::into_body)
3087 }
3088
3089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3093 self.0.request.name = v.into();
3094 self
3095 }
3096 }
3097
3098 #[doc(hidden)]
3099 impl crate::RequestBuilder for GetSingleTenantHsmInstance {
3100 fn request_options(&mut self) -> &mut crate::RequestOptions {
3101 &mut self.0.options
3102 }
3103 }
3104
3105 #[derive(Clone, Debug)]
3123 pub struct CreateSingleTenantHsmInstance(
3124 RequestBuilder<crate::model::CreateSingleTenantHsmInstanceRequest>,
3125 );
3126
3127 impl CreateSingleTenantHsmInstance {
3128 pub(crate) fn new(
3129 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3130 ) -> Self {
3131 Self(RequestBuilder::new(stub))
3132 }
3133
3134 pub fn with_request<V: Into<crate::model::CreateSingleTenantHsmInstanceRequest>>(
3136 mut self,
3137 v: V,
3138 ) -> Self {
3139 self.0.request = v.into();
3140 self
3141 }
3142
3143 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3145 self.0.options = v.into();
3146 self
3147 }
3148
3149 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3156 (*self.0.stub)
3157 .create_single_tenant_hsm_instance(self.0.request, self.0.options)
3158 .await
3159 .map(crate::Response::into_body)
3160 }
3161
3162 pub fn poller(
3164 self,
3165 ) -> impl google_cloud_lro::Poller<
3166 crate::model::SingleTenantHsmInstance,
3167 crate::model::CreateSingleTenantHsmInstanceMetadata,
3168 > {
3169 type Operation = google_cloud_lro::internal::Operation<
3170 crate::model::SingleTenantHsmInstance,
3171 crate::model::CreateSingleTenantHsmInstanceMetadata,
3172 >;
3173 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3174 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3175 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3176 if let Some(ref mut details) = poller_options.tracing {
3177 details.method_name = "google_cloud_kms_v1::client::HsmManagement::create_single_tenant_hsm_instance::until_done";
3178 }
3179
3180 let stub = self.0.stub.clone();
3181 let mut options = self.0.options.clone();
3182 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3183 let query = move |name| {
3184 let stub = stub.clone();
3185 let options = options.clone();
3186 async {
3187 let op = GetOperation::new(stub)
3188 .set_name(name)
3189 .with_options(options)
3190 .send()
3191 .await?;
3192 Ok(Operation::new(op))
3193 }
3194 };
3195
3196 let start = move || async {
3197 let op = self.send().await?;
3198 Ok(Operation::new(op))
3199 };
3200
3201 use google_cloud_lro::internal::PollerExt;
3202 {
3203 google_cloud_lro::internal::new_poller(
3204 polling_error_policy,
3205 polling_backoff_policy,
3206 start,
3207 query,
3208 )
3209 }
3210 .with_options(poller_options)
3211 }
3212
3213 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3217 self.0.request.parent = v.into();
3218 self
3219 }
3220
3221 pub fn set_single_tenant_hsm_instance_id<T: Into<std::string::String>>(
3223 mut self,
3224 v: T,
3225 ) -> Self {
3226 self.0.request.single_tenant_hsm_instance_id = v.into();
3227 self
3228 }
3229
3230 pub fn set_single_tenant_hsm_instance<T>(mut self, v: T) -> Self
3234 where
3235 T: std::convert::Into<crate::model::SingleTenantHsmInstance>,
3236 {
3237 self.0.request.single_tenant_hsm_instance = std::option::Option::Some(v.into());
3238 self
3239 }
3240
3241 pub fn set_or_clear_single_tenant_hsm_instance<T>(
3245 mut self,
3246 v: std::option::Option<T>,
3247 ) -> Self
3248 where
3249 T: std::convert::Into<crate::model::SingleTenantHsmInstance>,
3250 {
3251 self.0.request.single_tenant_hsm_instance = v.map(|x| x.into());
3252 self
3253 }
3254 }
3255
3256 #[doc(hidden)]
3257 impl crate::RequestBuilder for CreateSingleTenantHsmInstance {
3258 fn request_options(&mut self) -> &mut crate::RequestOptions {
3259 &mut self.0.options
3260 }
3261 }
3262
3263 #[derive(Clone, Debug)]
3281 pub struct CreateSingleTenantHsmInstanceProposal(
3282 RequestBuilder<crate::model::CreateSingleTenantHsmInstanceProposalRequest>,
3283 );
3284
3285 impl CreateSingleTenantHsmInstanceProposal {
3286 pub(crate) fn new(
3287 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3288 ) -> Self {
3289 Self(RequestBuilder::new(stub))
3290 }
3291
3292 pub fn with_request<V: Into<crate::model::CreateSingleTenantHsmInstanceProposalRequest>>(
3294 mut self,
3295 v: V,
3296 ) -> Self {
3297 self.0.request = v.into();
3298 self
3299 }
3300
3301 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3303 self.0.options = v.into();
3304 self
3305 }
3306
3307 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3314 (*self.0.stub)
3315 .create_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3316 .await
3317 .map(crate::Response::into_body)
3318 }
3319
3320 pub fn poller(
3322 self,
3323 ) -> impl google_cloud_lro::Poller<
3324 crate::model::SingleTenantHsmInstanceProposal,
3325 crate::model::CreateSingleTenantHsmInstanceProposalMetadata,
3326 > {
3327 type Operation = google_cloud_lro::internal::Operation<
3328 crate::model::SingleTenantHsmInstanceProposal,
3329 crate::model::CreateSingleTenantHsmInstanceProposalMetadata,
3330 >;
3331 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3332 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3333 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3334 if let Some(ref mut details) = poller_options.tracing {
3335 details.method_name = "google_cloud_kms_v1::client::HsmManagement::create_single_tenant_hsm_instance_proposal::until_done";
3336 }
3337
3338 let stub = self.0.stub.clone();
3339 let mut options = self.0.options.clone();
3340 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3341 let query = move |name| {
3342 let stub = stub.clone();
3343 let options = options.clone();
3344 async {
3345 let op = GetOperation::new(stub)
3346 .set_name(name)
3347 .with_options(options)
3348 .send()
3349 .await?;
3350 Ok(Operation::new(op))
3351 }
3352 };
3353
3354 let start = move || async {
3355 let op = self.send().await?;
3356 Ok(Operation::new(op))
3357 };
3358
3359 use google_cloud_lro::internal::PollerExt;
3360 {
3361 google_cloud_lro::internal::new_poller(
3362 polling_error_policy,
3363 polling_backoff_policy,
3364 start,
3365 query,
3366 )
3367 }
3368 .with_options(poller_options)
3369 }
3370
3371 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3375 self.0.request.parent = v.into();
3376 self
3377 }
3378
3379 pub fn set_single_tenant_hsm_instance_proposal_id<T: Into<std::string::String>>(
3381 mut self,
3382 v: T,
3383 ) -> Self {
3384 self.0.request.single_tenant_hsm_instance_proposal_id = v.into();
3385 self
3386 }
3387
3388 pub fn set_single_tenant_hsm_instance_proposal<T>(mut self, v: T) -> Self
3392 where
3393 T: std::convert::Into<crate::model::SingleTenantHsmInstanceProposal>,
3394 {
3395 self.0.request.single_tenant_hsm_instance_proposal =
3396 std::option::Option::Some(v.into());
3397 self
3398 }
3399
3400 pub fn set_or_clear_single_tenant_hsm_instance_proposal<T>(
3404 mut self,
3405 v: std::option::Option<T>,
3406 ) -> Self
3407 where
3408 T: std::convert::Into<crate::model::SingleTenantHsmInstanceProposal>,
3409 {
3410 self.0.request.single_tenant_hsm_instance_proposal = v.map(|x| x.into());
3411 self
3412 }
3413 }
3414
3415 #[doc(hidden)]
3416 impl crate::RequestBuilder for CreateSingleTenantHsmInstanceProposal {
3417 fn request_options(&mut self) -> &mut crate::RequestOptions {
3418 &mut self.0.options
3419 }
3420 }
3421
3422 #[derive(Clone, Debug)]
3439 pub struct ApproveSingleTenantHsmInstanceProposal(
3440 RequestBuilder<crate::model::ApproveSingleTenantHsmInstanceProposalRequest>,
3441 );
3442
3443 impl ApproveSingleTenantHsmInstanceProposal {
3444 pub(crate) fn new(
3445 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3446 ) -> Self {
3447 Self(RequestBuilder::new(stub))
3448 }
3449
3450 pub fn with_request<
3452 V: Into<crate::model::ApproveSingleTenantHsmInstanceProposalRequest>,
3453 >(
3454 mut self,
3455 v: V,
3456 ) -> Self {
3457 self.0.request = v.into();
3458 self
3459 }
3460
3461 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3463 self.0.options = v.into();
3464 self
3465 }
3466
3467 pub async fn send(
3469 self,
3470 ) -> Result<crate::model::ApproveSingleTenantHsmInstanceProposalResponse> {
3471 (*self.0.stub)
3472 .approve_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3473 .await
3474 .map(crate::Response::into_body)
3475 }
3476
3477 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3481 self.0.request.name = v.into();
3482 self
3483 }
3484
3485 pub fn set_approval_payload<T: Into<Option<crate::model::approve_single_tenant_hsm_instance_proposal_request::ApprovalPayload>>>(mut self, v: T) ->Self{
3490 self.0.request.approval_payload = v.into();
3491 self
3492 }
3493
3494 pub fn set_quorum_reply<T: std::convert::Into<std::boxed::Box<crate::model::approve_single_tenant_hsm_instance_proposal_request::QuorumReply>>>(mut self, v: T) -> Self{
3500 self.0.request = self.0.request.set_quorum_reply(v);
3501 self
3502 }
3503
3504 pub fn set_required_action_quorum_reply<T: std::convert::Into<std::boxed::Box<crate::model::approve_single_tenant_hsm_instance_proposal_request::RequiredActionQuorumReply>>>(mut self, v: T) -> Self{
3510 self.0.request = self.0.request.set_required_action_quorum_reply(v);
3511 self
3512 }
3513 }
3514
3515 #[doc(hidden)]
3516 impl crate::RequestBuilder for ApproveSingleTenantHsmInstanceProposal {
3517 fn request_options(&mut self) -> &mut crate::RequestOptions {
3518 &mut self.0.options
3519 }
3520 }
3521
3522 #[derive(Clone, Debug)]
3540 pub struct ExecuteSingleTenantHsmInstanceProposal(
3541 RequestBuilder<crate::model::ExecuteSingleTenantHsmInstanceProposalRequest>,
3542 );
3543
3544 impl ExecuteSingleTenantHsmInstanceProposal {
3545 pub(crate) fn new(
3546 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3547 ) -> Self {
3548 Self(RequestBuilder::new(stub))
3549 }
3550
3551 pub fn with_request<
3553 V: Into<crate::model::ExecuteSingleTenantHsmInstanceProposalRequest>,
3554 >(
3555 mut self,
3556 v: V,
3557 ) -> Self {
3558 self.0.request = v.into();
3559 self
3560 }
3561
3562 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3564 self.0.options = v.into();
3565 self
3566 }
3567
3568 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3575 (*self.0.stub)
3576 .execute_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3577 .await
3578 .map(crate::Response::into_body)
3579 }
3580
3581 pub fn poller(
3583 self,
3584 ) -> impl google_cloud_lro::Poller<
3585 crate::model::ExecuteSingleTenantHsmInstanceProposalResponse,
3586 crate::model::ExecuteSingleTenantHsmInstanceProposalMetadata,
3587 > {
3588 type Operation = google_cloud_lro::internal::Operation<
3589 crate::model::ExecuteSingleTenantHsmInstanceProposalResponse,
3590 crate::model::ExecuteSingleTenantHsmInstanceProposalMetadata,
3591 >;
3592 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3593 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3594 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3595 if let Some(ref mut details) = poller_options.tracing {
3596 details.method_name = "google_cloud_kms_v1::client::HsmManagement::execute_single_tenant_hsm_instance_proposal::until_done";
3597 }
3598
3599 let stub = self.0.stub.clone();
3600 let mut options = self.0.options.clone();
3601 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3602 let query = move |name| {
3603 let stub = stub.clone();
3604 let options = options.clone();
3605 async {
3606 let op = GetOperation::new(stub)
3607 .set_name(name)
3608 .with_options(options)
3609 .send()
3610 .await?;
3611 Ok(Operation::new(op))
3612 }
3613 };
3614
3615 let start = move || async {
3616 let op = self.send().await?;
3617 Ok(Operation::new(op))
3618 };
3619
3620 use google_cloud_lro::internal::PollerExt;
3621 {
3622 google_cloud_lro::internal::new_poller(
3623 polling_error_policy,
3624 polling_backoff_policy,
3625 start,
3626 query,
3627 )
3628 }
3629 .with_options(poller_options)
3630 }
3631
3632 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3636 self.0.request.name = v.into();
3637 self
3638 }
3639 }
3640
3641 #[doc(hidden)]
3642 impl crate::RequestBuilder for ExecuteSingleTenantHsmInstanceProposal {
3643 fn request_options(&mut self) -> &mut crate::RequestOptions {
3644 &mut self.0.options
3645 }
3646 }
3647
3648 #[derive(Clone, Debug)]
3665 pub struct GetSingleTenantHsmInstanceProposal(
3666 RequestBuilder<crate::model::GetSingleTenantHsmInstanceProposalRequest>,
3667 );
3668
3669 impl GetSingleTenantHsmInstanceProposal {
3670 pub(crate) fn new(
3671 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3672 ) -> Self {
3673 Self(RequestBuilder::new(stub))
3674 }
3675
3676 pub fn with_request<V: Into<crate::model::GetSingleTenantHsmInstanceProposalRequest>>(
3678 mut self,
3679 v: V,
3680 ) -> Self {
3681 self.0.request = v.into();
3682 self
3683 }
3684
3685 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3687 self.0.options = v.into();
3688 self
3689 }
3690
3691 pub async fn send(self) -> Result<crate::model::SingleTenantHsmInstanceProposal> {
3693 (*self.0.stub)
3694 .get_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3695 .await
3696 .map(crate::Response::into_body)
3697 }
3698
3699 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3703 self.0.request.name = v.into();
3704 self
3705 }
3706 }
3707
3708 #[doc(hidden)]
3709 impl crate::RequestBuilder for GetSingleTenantHsmInstanceProposal {
3710 fn request_options(&mut self) -> &mut crate::RequestOptions {
3711 &mut self.0.options
3712 }
3713 }
3714
3715 #[derive(Clone, Debug)]
3736 pub struct ListSingleTenantHsmInstanceProposals(
3737 RequestBuilder<crate::model::ListSingleTenantHsmInstanceProposalsRequest>,
3738 );
3739
3740 impl ListSingleTenantHsmInstanceProposals {
3741 pub(crate) fn new(
3742 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3743 ) -> Self {
3744 Self(RequestBuilder::new(stub))
3745 }
3746
3747 pub fn with_request<V: Into<crate::model::ListSingleTenantHsmInstanceProposalsRequest>>(
3749 mut self,
3750 v: V,
3751 ) -> Self {
3752 self.0.request = v.into();
3753 self
3754 }
3755
3756 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3758 self.0.options = v.into();
3759 self
3760 }
3761
3762 pub async fn send(
3764 self,
3765 ) -> Result<crate::model::ListSingleTenantHsmInstanceProposalsResponse> {
3766 (*self.0.stub)
3767 .list_single_tenant_hsm_instance_proposals(self.0.request, self.0.options)
3768 .await
3769 .map(crate::Response::into_body)
3770 }
3771
3772 pub fn by_page(
3774 self,
3775 ) -> impl google_cloud_gax::paginator::Paginator<
3776 crate::model::ListSingleTenantHsmInstanceProposalsResponse,
3777 crate::Error,
3778 > {
3779 use std::clone::Clone;
3780 let token = self.0.request.page_token.clone();
3781 let execute = move |token: String| {
3782 let mut builder = self.clone();
3783 builder.0.request = builder.0.request.set_page_token(token);
3784 builder.send()
3785 };
3786 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3787 }
3788
3789 pub fn by_item(
3791 self,
3792 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3793 crate::model::ListSingleTenantHsmInstanceProposalsResponse,
3794 crate::Error,
3795 > {
3796 use google_cloud_gax::paginator::Paginator;
3797 self.by_page().items()
3798 }
3799
3800 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3804 self.0.request.parent = v.into();
3805 self
3806 }
3807
3808 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3810 self.0.request.page_size = v.into();
3811 self
3812 }
3813
3814 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3816 self.0.request.page_token = v.into();
3817 self
3818 }
3819
3820 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.0.request.filter = v.into();
3823 self
3824 }
3825
3826 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3828 self.0.request.order_by = v.into();
3829 self
3830 }
3831
3832 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
3834 self.0.request.show_deleted = v.into();
3835 self
3836 }
3837 }
3838
3839 #[doc(hidden)]
3840 impl crate::RequestBuilder for ListSingleTenantHsmInstanceProposals {
3841 fn request_options(&mut self) -> &mut crate::RequestOptions {
3842 &mut self.0.options
3843 }
3844 }
3845
3846 #[derive(Clone, Debug)]
3863 pub struct DeleteSingleTenantHsmInstanceProposal(
3864 RequestBuilder<crate::model::DeleteSingleTenantHsmInstanceProposalRequest>,
3865 );
3866
3867 impl DeleteSingleTenantHsmInstanceProposal {
3868 pub(crate) fn new(
3869 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3870 ) -> Self {
3871 Self(RequestBuilder::new(stub))
3872 }
3873
3874 pub fn with_request<V: Into<crate::model::DeleteSingleTenantHsmInstanceProposalRequest>>(
3876 mut self,
3877 v: V,
3878 ) -> Self {
3879 self.0.request = v.into();
3880 self
3881 }
3882
3883 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3885 self.0.options = v.into();
3886 self
3887 }
3888
3889 pub async fn send(self) -> Result<()> {
3891 (*self.0.stub)
3892 .delete_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3893 .await
3894 .map(crate::Response::into_body)
3895 }
3896
3897 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3901 self.0.request.name = v.into();
3902 self
3903 }
3904 }
3905
3906 #[doc(hidden)]
3907 impl crate::RequestBuilder for DeleteSingleTenantHsmInstanceProposal {
3908 fn request_options(&mut self) -> &mut crate::RequestOptions {
3909 &mut self.0.options
3910 }
3911 }
3912
3913 #[derive(Clone, Debug)]
3934 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3935
3936 impl ListLocations {
3937 pub(crate) fn new(
3938 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3939 ) -> Self {
3940 Self(RequestBuilder::new(stub))
3941 }
3942
3943 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3945 mut self,
3946 v: V,
3947 ) -> Self {
3948 self.0.request = v.into();
3949 self
3950 }
3951
3952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3954 self.0.options = v.into();
3955 self
3956 }
3957
3958 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3960 (*self.0.stub)
3961 .list_locations(self.0.request, self.0.options)
3962 .await
3963 .map(crate::Response::into_body)
3964 }
3965
3966 pub fn by_page(
3968 self,
3969 ) -> impl google_cloud_gax::paginator::Paginator<
3970 google_cloud_location::model::ListLocationsResponse,
3971 crate::Error,
3972 > {
3973 use std::clone::Clone;
3974 let token = self.0.request.page_token.clone();
3975 let execute = move |token: String| {
3976 let mut builder = self.clone();
3977 builder.0.request = builder.0.request.set_page_token(token);
3978 builder.send()
3979 };
3980 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3981 }
3982
3983 pub fn by_item(
3985 self,
3986 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3987 google_cloud_location::model::ListLocationsResponse,
3988 crate::Error,
3989 > {
3990 use google_cloud_gax::paginator::Paginator;
3991 self.by_page().items()
3992 }
3993
3994 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3996 self.0.request.name = v.into();
3997 self
3998 }
3999
4000 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4002 self.0.request.filter = v.into();
4003 self
4004 }
4005
4006 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4008 self.0.request.page_size = v.into();
4009 self
4010 }
4011
4012 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4014 self.0.request.page_token = v.into();
4015 self
4016 }
4017 }
4018
4019 #[doc(hidden)]
4020 impl crate::RequestBuilder for ListLocations {
4021 fn request_options(&mut self) -> &mut crate::RequestOptions {
4022 &mut self.0.options
4023 }
4024 }
4025
4026 #[derive(Clone, Debug)]
4043 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4044
4045 impl GetLocation {
4046 pub(crate) fn new(
4047 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4048 ) -> Self {
4049 Self(RequestBuilder::new(stub))
4050 }
4051
4052 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4054 mut self,
4055 v: V,
4056 ) -> Self {
4057 self.0.request = v.into();
4058 self
4059 }
4060
4061 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4063 self.0.options = v.into();
4064 self
4065 }
4066
4067 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4069 (*self.0.stub)
4070 .get_location(self.0.request, self.0.options)
4071 .await
4072 .map(crate::Response::into_body)
4073 }
4074
4075 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4077 self.0.request.name = v.into();
4078 self
4079 }
4080 }
4081
4082 #[doc(hidden)]
4083 impl crate::RequestBuilder for GetLocation {
4084 fn request_options(&mut self) -> &mut crate::RequestOptions {
4085 &mut self.0.options
4086 }
4087 }
4088
4089 #[derive(Clone, Debug)]
4106 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4107
4108 impl SetIamPolicy {
4109 pub(crate) fn new(
4110 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4111 ) -> Self {
4112 Self(RequestBuilder::new(stub))
4113 }
4114
4115 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
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<google_cloud_iam_v1::model::Policy> {
4132 (*self.0.stub)
4133 .set_iam_policy(self.0.request, self.0.options)
4134 .await
4135 .map(crate::Response::into_body)
4136 }
4137
4138 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4142 self.0.request.resource = v.into();
4143 self
4144 }
4145
4146 pub fn set_policy<T>(mut self, v: T) -> Self
4150 where
4151 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4152 {
4153 self.0.request.policy = std::option::Option::Some(v.into());
4154 self
4155 }
4156
4157 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4161 where
4162 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4163 {
4164 self.0.request.policy = v.map(|x| x.into());
4165 self
4166 }
4167
4168 pub fn set_update_mask<T>(mut self, v: T) -> Self
4170 where
4171 T: std::convert::Into<wkt::FieldMask>,
4172 {
4173 self.0.request.update_mask = std::option::Option::Some(v.into());
4174 self
4175 }
4176
4177 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4179 where
4180 T: std::convert::Into<wkt::FieldMask>,
4181 {
4182 self.0.request.update_mask = v.map(|x| x.into());
4183 self
4184 }
4185 }
4186
4187 #[doc(hidden)]
4188 impl crate::RequestBuilder for SetIamPolicy {
4189 fn request_options(&mut self) -> &mut crate::RequestOptions {
4190 &mut self.0.options
4191 }
4192 }
4193
4194 #[derive(Clone, Debug)]
4211 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4212
4213 impl GetIamPolicy {
4214 pub(crate) fn new(
4215 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4216 ) -> Self {
4217 Self(RequestBuilder::new(stub))
4218 }
4219
4220 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4222 mut self,
4223 v: V,
4224 ) -> Self {
4225 self.0.request = v.into();
4226 self
4227 }
4228
4229 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4231 self.0.options = v.into();
4232 self
4233 }
4234
4235 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4237 (*self.0.stub)
4238 .get_iam_policy(self.0.request, self.0.options)
4239 .await
4240 .map(crate::Response::into_body)
4241 }
4242
4243 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4247 self.0.request.resource = v.into();
4248 self
4249 }
4250
4251 pub fn set_options<T>(mut self, v: T) -> Self
4253 where
4254 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4255 {
4256 self.0.request.options = std::option::Option::Some(v.into());
4257 self
4258 }
4259
4260 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4262 where
4263 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4264 {
4265 self.0.request.options = v.map(|x| x.into());
4266 self
4267 }
4268 }
4269
4270 #[doc(hidden)]
4271 impl crate::RequestBuilder for GetIamPolicy {
4272 fn request_options(&mut self) -> &mut crate::RequestOptions {
4273 &mut self.0.options
4274 }
4275 }
4276
4277 #[derive(Clone, Debug)]
4294 pub struct TestIamPermissions(
4295 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4296 );
4297
4298 impl TestIamPermissions {
4299 pub(crate) fn new(
4300 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4301 ) -> Self {
4302 Self(RequestBuilder::new(stub))
4303 }
4304
4305 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4307 mut self,
4308 v: V,
4309 ) -> Self {
4310 self.0.request = v.into();
4311 self
4312 }
4313
4314 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4316 self.0.options = v.into();
4317 self
4318 }
4319
4320 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4322 (*self.0.stub)
4323 .test_iam_permissions(self.0.request, self.0.options)
4324 .await
4325 .map(crate::Response::into_body)
4326 }
4327
4328 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4332 self.0.request.resource = v.into();
4333 self
4334 }
4335
4336 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4340 where
4341 T: std::iter::IntoIterator<Item = V>,
4342 V: std::convert::Into<std::string::String>,
4343 {
4344 use std::iter::Iterator;
4345 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4346 self
4347 }
4348 }
4349
4350 #[doc(hidden)]
4351 impl crate::RequestBuilder for TestIamPermissions {
4352 fn request_options(&mut self) -> &mut crate::RequestOptions {
4353 &mut self.0.options
4354 }
4355 }
4356
4357 #[derive(Clone, Debug)]
4374 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4375
4376 impl GetOperation {
4377 pub(crate) fn new(
4378 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4379 ) -> Self {
4380 Self(RequestBuilder::new(stub))
4381 }
4382
4383 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4385 mut self,
4386 v: V,
4387 ) -> Self {
4388 self.0.request = v.into();
4389 self
4390 }
4391
4392 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4394 self.0.options = v.into();
4395 self
4396 }
4397
4398 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4400 (*self.0.stub)
4401 .get_operation(self.0.request, self.0.options)
4402 .await
4403 .map(crate::Response::into_body)
4404 }
4405
4406 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4408 self.0.request.name = v.into();
4409 self
4410 }
4411 }
4412
4413 #[doc(hidden)]
4414 impl crate::RequestBuilder for GetOperation {
4415 fn request_options(&mut self) -> &mut crate::RequestOptions {
4416 &mut self.0.options
4417 }
4418 }
4419}
4420
4421pub mod key_management_service {
4423 use crate::Result;
4424
4425 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4439
4440 pub(crate) mod client {
4441 use super::super::super::client::KeyManagementService;
4442 pub struct Factory;
4443 impl crate::ClientFactory for Factory {
4444 type Client = KeyManagementService;
4445 type Credentials = gaxi::options::Credentials;
4446 async fn build(
4447 self,
4448 config: gaxi::options::ClientConfig,
4449 ) -> crate::ClientBuilderResult<Self::Client> {
4450 Self::Client::new(config).await
4451 }
4452 }
4453 }
4454
4455 #[derive(Clone, Debug)]
4457 pub(crate) struct RequestBuilder<R: std::default::Default> {
4458 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4459 request: R,
4460 options: crate::RequestOptions,
4461 }
4462
4463 impl<R> RequestBuilder<R>
4464 where
4465 R: std::default::Default,
4466 {
4467 pub(crate) fn new(
4468 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4469 ) -> Self {
4470 Self {
4471 stub,
4472 request: R::default(),
4473 options: crate::RequestOptions::default(),
4474 }
4475 }
4476 }
4477
4478 #[derive(Clone, Debug)]
4499 pub struct ListKeyRings(RequestBuilder<crate::model::ListKeyRingsRequest>);
4500
4501 impl ListKeyRings {
4502 pub(crate) fn new(
4503 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4504 ) -> Self {
4505 Self(RequestBuilder::new(stub))
4506 }
4507
4508 pub fn with_request<V: Into<crate::model::ListKeyRingsRequest>>(mut self, v: V) -> Self {
4510 self.0.request = v.into();
4511 self
4512 }
4513
4514 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4516 self.0.options = v.into();
4517 self
4518 }
4519
4520 pub async fn send(self) -> Result<crate::model::ListKeyRingsResponse> {
4522 (*self.0.stub)
4523 .list_key_rings(self.0.request, self.0.options)
4524 .await
4525 .map(crate::Response::into_body)
4526 }
4527
4528 pub fn by_page(
4530 self,
4531 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListKeyRingsResponse, crate::Error>
4532 {
4533 use std::clone::Clone;
4534 let token = self.0.request.page_token.clone();
4535 let execute = move |token: String| {
4536 let mut builder = self.clone();
4537 builder.0.request = builder.0.request.set_page_token(token);
4538 builder.send()
4539 };
4540 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4541 }
4542
4543 pub fn by_item(
4545 self,
4546 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4547 crate::model::ListKeyRingsResponse,
4548 crate::Error,
4549 > {
4550 use google_cloud_gax::paginator::Paginator;
4551 self.by_page().items()
4552 }
4553
4554 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4558 self.0.request.parent = v.into();
4559 self
4560 }
4561
4562 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4564 self.0.request.page_size = v.into();
4565 self
4566 }
4567
4568 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4570 self.0.request.page_token = v.into();
4571 self
4572 }
4573
4574 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4576 self.0.request.filter = v.into();
4577 self
4578 }
4579
4580 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4582 self.0.request.order_by = v.into();
4583 self
4584 }
4585 }
4586
4587 #[doc(hidden)]
4588 impl crate::RequestBuilder for ListKeyRings {
4589 fn request_options(&mut self) -> &mut crate::RequestOptions {
4590 &mut self.0.options
4591 }
4592 }
4593
4594 #[derive(Clone, Debug)]
4615 pub struct ListCryptoKeys(RequestBuilder<crate::model::ListCryptoKeysRequest>);
4616
4617 impl ListCryptoKeys {
4618 pub(crate) fn new(
4619 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4620 ) -> Self {
4621 Self(RequestBuilder::new(stub))
4622 }
4623
4624 pub fn with_request<V: Into<crate::model::ListCryptoKeysRequest>>(mut self, v: V) -> Self {
4626 self.0.request = v.into();
4627 self
4628 }
4629
4630 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4632 self.0.options = v.into();
4633 self
4634 }
4635
4636 pub async fn send(self) -> Result<crate::model::ListCryptoKeysResponse> {
4638 (*self.0.stub)
4639 .list_crypto_keys(self.0.request, self.0.options)
4640 .await
4641 .map(crate::Response::into_body)
4642 }
4643
4644 pub fn by_page(
4646 self,
4647 ) -> impl google_cloud_gax::paginator::Paginator<
4648 crate::model::ListCryptoKeysResponse,
4649 crate::Error,
4650 > {
4651 use std::clone::Clone;
4652 let token = self.0.request.page_token.clone();
4653 let execute = move |token: String| {
4654 let mut builder = self.clone();
4655 builder.0.request = builder.0.request.set_page_token(token);
4656 builder.send()
4657 };
4658 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4659 }
4660
4661 pub fn by_item(
4663 self,
4664 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4665 crate::model::ListCryptoKeysResponse,
4666 crate::Error,
4667 > {
4668 use google_cloud_gax::paginator::Paginator;
4669 self.by_page().items()
4670 }
4671
4672 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4676 self.0.request.parent = v.into();
4677 self
4678 }
4679
4680 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4682 self.0.request.page_size = v.into();
4683 self
4684 }
4685
4686 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4688 self.0.request.page_token = v.into();
4689 self
4690 }
4691
4692 pub fn set_version_view<T: Into<crate::model::crypto_key_version::CryptoKeyVersionView>>(
4694 mut self,
4695 v: T,
4696 ) -> Self {
4697 self.0.request.version_view = v.into();
4698 self
4699 }
4700
4701 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4703 self.0.request.filter = v.into();
4704 self
4705 }
4706
4707 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4709 self.0.request.order_by = v.into();
4710 self
4711 }
4712 }
4713
4714 #[doc(hidden)]
4715 impl crate::RequestBuilder for ListCryptoKeys {
4716 fn request_options(&mut self) -> &mut crate::RequestOptions {
4717 &mut self.0.options
4718 }
4719 }
4720
4721 #[derive(Clone, Debug)]
4742 pub struct ListCryptoKeyVersions(RequestBuilder<crate::model::ListCryptoKeyVersionsRequest>);
4743
4744 impl ListCryptoKeyVersions {
4745 pub(crate) fn new(
4746 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4747 ) -> Self {
4748 Self(RequestBuilder::new(stub))
4749 }
4750
4751 pub fn with_request<V: Into<crate::model::ListCryptoKeyVersionsRequest>>(
4753 mut self,
4754 v: V,
4755 ) -> Self {
4756 self.0.request = v.into();
4757 self
4758 }
4759
4760 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4762 self.0.options = v.into();
4763 self
4764 }
4765
4766 pub async fn send(self) -> Result<crate::model::ListCryptoKeyVersionsResponse> {
4768 (*self.0.stub)
4769 .list_crypto_key_versions(self.0.request, self.0.options)
4770 .await
4771 .map(crate::Response::into_body)
4772 }
4773
4774 pub fn by_page(
4776 self,
4777 ) -> impl google_cloud_gax::paginator::Paginator<
4778 crate::model::ListCryptoKeyVersionsResponse,
4779 crate::Error,
4780 > {
4781 use std::clone::Clone;
4782 let token = self.0.request.page_token.clone();
4783 let execute = move |token: String| {
4784 let mut builder = self.clone();
4785 builder.0.request = builder.0.request.set_page_token(token);
4786 builder.send()
4787 };
4788 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4789 }
4790
4791 pub fn by_item(
4793 self,
4794 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4795 crate::model::ListCryptoKeyVersionsResponse,
4796 crate::Error,
4797 > {
4798 use google_cloud_gax::paginator::Paginator;
4799 self.by_page().items()
4800 }
4801
4802 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4806 self.0.request.parent = v.into();
4807 self
4808 }
4809
4810 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4812 self.0.request.page_size = v.into();
4813 self
4814 }
4815
4816 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4818 self.0.request.page_token = v.into();
4819 self
4820 }
4821
4822 pub fn set_view<T: Into<crate::model::crypto_key_version::CryptoKeyVersionView>>(
4824 mut self,
4825 v: T,
4826 ) -> Self {
4827 self.0.request.view = v.into();
4828 self
4829 }
4830
4831 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4833 self.0.request.filter = v.into();
4834 self
4835 }
4836
4837 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4839 self.0.request.order_by = v.into();
4840 self
4841 }
4842 }
4843
4844 #[doc(hidden)]
4845 impl crate::RequestBuilder for ListCryptoKeyVersions {
4846 fn request_options(&mut self) -> &mut crate::RequestOptions {
4847 &mut self.0.options
4848 }
4849 }
4850
4851 #[derive(Clone, Debug)]
4872 pub struct ListImportJobs(RequestBuilder<crate::model::ListImportJobsRequest>);
4873
4874 impl ListImportJobs {
4875 pub(crate) fn new(
4876 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4877 ) -> Self {
4878 Self(RequestBuilder::new(stub))
4879 }
4880
4881 pub fn with_request<V: Into<crate::model::ListImportJobsRequest>>(mut self, v: V) -> Self {
4883 self.0.request = v.into();
4884 self
4885 }
4886
4887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4889 self.0.options = v.into();
4890 self
4891 }
4892
4893 pub async fn send(self) -> Result<crate::model::ListImportJobsResponse> {
4895 (*self.0.stub)
4896 .list_import_jobs(self.0.request, self.0.options)
4897 .await
4898 .map(crate::Response::into_body)
4899 }
4900
4901 pub fn by_page(
4903 self,
4904 ) -> impl google_cloud_gax::paginator::Paginator<
4905 crate::model::ListImportJobsResponse,
4906 crate::Error,
4907 > {
4908 use std::clone::Clone;
4909 let token = self.0.request.page_token.clone();
4910 let execute = move |token: String| {
4911 let mut builder = self.clone();
4912 builder.0.request = builder.0.request.set_page_token(token);
4913 builder.send()
4914 };
4915 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4916 }
4917
4918 pub fn by_item(
4920 self,
4921 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4922 crate::model::ListImportJobsResponse,
4923 crate::Error,
4924 > {
4925 use google_cloud_gax::paginator::Paginator;
4926 self.by_page().items()
4927 }
4928
4929 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4933 self.0.request.parent = v.into();
4934 self
4935 }
4936
4937 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4939 self.0.request.page_size = v.into();
4940 self
4941 }
4942
4943 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4945 self.0.request.page_token = v.into();
4946 self
4947 }
4948
4949 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4951 self.0.request.filter = v.into();
4952 self
4953 }
4954
4955 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4957 self.0.request.order_by = v.into();
4958 self
4959 }
4960 }
4961
4962 #[doc(hidden)]
4963 impl crate::RequestBuilder for ListImportJobs {
4964 fn request_options(&mut self) -> &mut crate::RequestOptions {
4965 &mut self.0.options
4966 }
4967 }
4968
4969 #[derive(Clone, Debug)]
4990 pub struct ListRetiredResources(RequestBuilder<crate::model::ListRetiredResourcesRequest>);
4991
4992 impl ListRetiredResources {
4993 pub(crate) fn new(
4994 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4995 ) -> Self {
4996 Self(RequestBuilder::new(stub))
4997 }
4998
4999 pub fn with_request<V: Into<crate::model::ListRetiredResourcesRequest>>(
5001 mut self,
5002 v: V,
5003 ) -> Self {
5004 self.0.request = v.into();
5005 self
5006 }
5007
5008 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5010 self.0.options = v.into();
5011 self
5012 }
5013
5014 pub async fn send(self) -> Result<crate::model::ListRetiredResourcesResponse> {
5016 (*self.0.stub)
5017 .list_retired_resources(self.0.request, self.0.options)
5018 .await
5019 .map(crate::Response::into_body)
5020 }
5021
5022 pub fn by_page(
5024 self,
5025 ) -> impl google_cloud_gax::paginator::Paginator<
5026 crate::model::ListRetiredResourcesResponse,
5027 crate::Error,
5028 > {
5029 use std::clone::Clone;
5030 let token = self.0.request.page_token.clone();
5031 let execute = move |token: String| {
5032 let mut builder = self.clone();
5033 builder.0.request = builder.0.request.set_page_token(token);
5034 builder.send()
5035 };
5036 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5037 }
5038
5039 pub fn by_item(
5041 self,
5042 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5043 crate::model::ListRetiredResourcesResponse,
5044 crate::Error,
5045 > {
5046 use google_cloud_gax::paginator::Paginator;
5047 self.by_page().items()
5048 }
5049
5050 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5054 self.0.request.parent = v.into();
5055 self
5056 }
5057
5058 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5060 self.0.request.page_size = v.into();
5061 self
5062 }
5063
5064 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5066 self.0.request.page_token = v.into();
5067 self
5068 }
5069 }
5070
5071 #[doc(hidden)]
5072 impl crate::RequestBuilder for ListRetiredResources {
5073 fn request_options(&mut self) -> &mut crate::RequestOptions {
5074 &mut self.0.options
5075 }
5076 }
5077
5078 #[derive(Clone, Debug)]
5095 pub struct GetKeyRing(RequestBuilder<crate::model::GetKeyRingRequest>);
5096
5097 impl GetKeyRing {
5098 pub(crate) fn new(
5099 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5100 ) -> Self {
5101 Self(RequestBuilder::new(stub))
5102 }
5103
5104 pub fn with_request<V: Into<crate::model::GetKeyRingRequest>>(mut self, v: V) -> Self {
5106 self.0.request = v.into();
5107 self
5108 }
5109
5110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5112 self.0.options = v.into();
5113 self
5114 }
5115
5116 pub async fn send(self) -> Result<crate::model::KeyRing> {
5118 (*self.0.stub)
5119 .get_key_ring(self.0.request, self.0.options)
5120 .await
5121 .map(crate::Response::into_body)
5122 }
5123
5124 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5128 self.0.request.name = v.into();
5129 self
5130 }
5131 }
5132
5133 #[doc(hidden)]
5134 impl crate::RequestBuilder for GetKeyRing {
5135 fn request_options(&mut self) -> &mut crate::RequestOptions {
5136 &mut self.0.options
5137 }
5138 }
5139
5140 #[derive(Clone, Debug)]
5157 pub struct GetCryptoKey(RequestBuilder<crate::model::GetCryptoKeyRequest>);
5158
5159 impl GetCryptoKey {
5160 pub(crate) fn new(
5161 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5162 ) -> Self {
5163 Self(RequestBuilder::new(stub))
5164 }
5165
5166 pub fn with_request<V: Into<crate::model::GetCryptoKeyRequest>>(mut self, v: V) -> Self {
5168 self.0.request = v.into();
5169 self
5170 }
5171
5172 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5174 self.0.options = v.into();
5175 self
5176 }
5177
5178 pub async fn send(self) -> Result<crate::model::CryptoKey> {
5180 (*self.0.stub)
5181 .get_crypto_key(self.0.request, self.0.options)
5182 .await
5183 .map(crate::Response::into_body)
5184 }
5185
5186 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5190 self.0.request.name = v.into();
5191 self
5192 }
5193 }
5194
5195 #[doc(hidden)]
5196 impl crate::RequestBuilder for GetCryptoKey {
5197 fn request_options(&mut self) -> &mut crate::RequestOptions {
5198 &mut self.0.options
5199 }
5200 }
5201
5202 #[derive(Clone, Debug)]
5219 pub struct GetCryptoKeyVersion(RequestBuilder<crate::model::GetCryptoKeyVersionRequest>);
5220
5221 impl GetCryptoKeyVersion {
5222 pub(crate) fn new(
5223 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5224 ) -> Self {
5225 Self(RequestBuilder::new(stub))
5226 }
5227
5228 pub fn with_request<V: Into<crate::model::GetCryptoKeyVersionRequest>>(
5230 mut self,
5231 v: V,
5232 ) -> Self {
5233 self.0.request = v.into();
5234 self
5235 }
5236
5237 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5239 self.0.options = v.into();
5240 self
5241 }
5242
5243 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
5245 (*self.0.stub)
5246 .get_crypto_key_version(self.0.request, self.0.options)
5247 .await
5248 .map(crate::Response::into_body)
5249 }
5250
5251 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5255 self.0.request.name = v.into();
5256 self
5257 }
5258 }
5259
5260 #[doc(hidden)]
5261 impl crate::RequestBuilder for GetCryptoKeyVersion {
5262 fn request_options(&mut self) -> &mut crate::RequestOptions {
5263 &mut self.0.options
5264 }
5265 }
5266
5267 #[derive(Clone, Debug)]
5284 pub struct GetPublicKey(RequestBuilder<crate::model::GetPublicKeyRequest>);
5285
5286 impl GetPublicKey {
5287 pub(crate) fn new(
5288 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5289 ) -> Self {
5290 Self(RequestBuilder::new(stub))
5291 }
5292
5293 pub fn with_request<V: Into<crate::model::GetPublicKeyRequest>>(mut self, v: V) -> Self {
5295 self.0.request = v.into();
5296 self
5297 }
5298
5299 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5301 self.0.options = v.into();
5302 self
5303 }
5304
5305 pub async fn send(self) -> Result<crate::model::PublicKey> {
5307 (*self.0.stub)
5308 .get_public_key(self.0.request, self.0.options)
5309 .await
5310 .map(crate::Response::into_body)
5311 }
5312
5313 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5317 self.0.request.name = v.into();
5318 self
5319 }
5320
5321 pub fn set_public_key_format<T: Into<crate::model::public_key::PublicKeyFormat>>(
5323 mut self,
5324 v: T,
5325 ) -> Self {
5326 self.0.request.public_key_format = v.into();
5327 self
5328 }
5329 }
5330
5331 #[doc(hidden)]
5332 impl crate::RequestBuilder for GetPublicKey {
5333 fn request_options(&mut self) -> &mut crate::RequestOptions {
5334 &mut self.0.options
5335 }
5336 }
5337
5338 #[derive(Clone, Debug)]
5355 pub struct GetImportJob(RequestBuilder<crate::model::GetImportJobRequest>);
5356
5357 impl GetImportJob {
5358 pub(crate) fn new(
5359 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5360 ) -> Self {
5361 Self(RequestBuilder::new(stub))
5362 }
5363
5364 pub fn with_request<V: Into<crate::model::GetImportJobRequest>>(mut self, v: V) -> Self {
5366 self.0.request = v.into();
5367 self
5368 }
5369
5370 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5372 self.0.options = v.into();
5373 self
5374 }
5375
5376 pub async fn send(self) -> Result<crate::model::ImportJob> {
5378 (*self.0.stub)
5379 .get_import_job(self.0.request, self.0.options)
5380 .await
5381 .map(crate::Response::into_body)
5382 }
5383
5384 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5388 self.0.request.name = v.into();
5389 self
5390 }
5391
5392 pub fn set_public_key_format<T: Into<crate::model::public_key::PublicKeyFormat>>(
5394 mut self,
5395 v: T,
5396 ) -> Self {
5397 self.0.request.public_key_format = v.into();
5398 self
5399 }
5400 }
5401
5402 #[doc(hidden)]
5403 impl crate::RequestBuilder for GetImportJob {
5404 fn request_options(&mut self) -> &mut crate::RequestOptions {
5405 &mut self.0.options
5406 }
5407 }
5408
5409 #[derive(Clone, Debug)]
5426 pub struct GetRetiredResource(RequestBuilder<crate::model::GetRetiredResourceRequest>);
5427
5428 impl GetRetiredResource {
5429 pub(crate) fn new(
5430 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5431 ) -> Self {
5432 Self(RequestBuilder::new(stub))
5433 }
5434
5435 pub fn with_request<V: Into<crate::model::GetRetiredResourceRequest>>(
5437 mut self,
5438 v: V,
5439 ) -> Self {
5440 self.0.request = v.into();
5441 self
5442 }
5443
5444 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5446 self.0.options = v.into();
5447 self
5448 }
5449
5450 pub async fn send(self) -> Result<crate::model::RetiredResource> {
5452 (*self.0.stub)
5453 .get_retired_resource(self.0.request, self.0.options)
5454 .await
5455 .map(crate::Response::into_body)
5456 }
5457
5458 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5462 self.0.request.name = v.into();
5463 self
5464 }
5465 }
5466
5467 #[doc(hidden)]
5468 impl crate::RequestBuilder for GetRetiredResource {
5469 fn request_options(&mut self) -> &mut crate::RequestOptions {
5470 &mut self.0.options
5471 }
5472 }
5473
5474 #[derive(Clone, Debug)]
5491 pub struct CreateKeyRing(RequestBuilder<crate::model::CreateKeyRingRequest>);
5492
5493 impl CreateKeyRing {
5494 pub(crate) fn new(
5495 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5496 ) -> Self {
5497 Self(RequestBuilder::new(stub))
5498 }
5499
5500 pub fn with_request<V: Into<crate::model::CreateKeyRingRequest>>(mut self, v: V) -> Self {
5502 self.0.request = v.into();
5503 self
5504 }
5505
5506 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5508 self.0.options = v.into();
5509 self
5510 }
5511
5512 pub async fn send(self) -> Result<crate::model::KeyRing> {
5514 (*self.0.stub)
5515 .create_key_ring(self.0.request, self.0.options)
5516 .await
5517 .map(crate::Response::into_body)
5518 }
5519
5520 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5524 self.0.request.parent = v.into();
5525 self
5526 }
5527
5528 pub fn set_key_ring_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5532 self.0.request.key_ring_id = v.into();
5533 self
5534 }
5535
5536 pub fn set_key_ring<T>(mut self, v: T) -> Self
5540 where
5541 T: std::convert::Into<crate::model::KeyRing>,
5542 {
5543 self.0.request.key_ring = std::option::Option::Some(v.into());
5544 self
5545 }
5546
5547 pub fn set_or_clear_key_ring<T>(mut self, v: std::option::Option<T>) -> Self
5551 where
5552 T: std::convert::Into<crate::model::KeyRing>,
5553 {
5554 self.0.request.key_ring = v.map(|x| x.into());
5555 self
5556 }
5557 }
5558
5559 #[doc(hidden)]
5560 impl crate::RequestBuilder for CreateKeyRing {
5561 fn request_options(&mut self) -> &mut crate::RequestOptions {
5562 &mut self.0.options
5563 }
5564 }
5565
5566 #[derive(Clone, Debug)]
5583 pub struct CreateCryptoKey(RequestBuilder<crate::model::CreateCryptoKeyRequest>);
5584
5585 impl CreateCryptoKey {
5586 pub(crate) fn new(
5587 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5588 ) -> Self {
5589 Self(RequestBuilder::new(stub))
5590 }
5591
5592 pub fn with_request<V: Into<crate::model::CreateCryptoKeyRequest>>(mut self, v: V) -> Self {
5594 self.0.request = v.into();
5595 self
5596 }
5597
5598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5600 self.0.options = v.into();
5601 self
5602 }
5603
5604 pub async fn send(self) -> Result<crate::model::CryptoKey> {
5606 (*self.0.stub)
5607 .create_crypto_key(self.0.request, self.0.options)
5608 .await
5609 .map(crate::Response::into_body)
5610 }
5611
5612 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5616 self.0.request.parent = v.into();
5617 self
5618 }
5619
5620 pub fn set_crypto_key_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5624 self.0.request.crypto_key_id = v.into();
5625 self
5626 }
5627
5628 pub fn set_crypto_key<T>(mut self, v: T) -> Self
5632 where
5633 T: std::convert::Into<crate::model::CryptoKey>,
5634 {
5635 self.0.request.crypto_key = std::option::Option::Some(v.into());
5636 self
5637 }
5638
5639 pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
5643 where
5644 T: std::convert::Into<crate::model::CryptoKey>,
5645 {
5646 self.0.request.crypto_key = v.map(|x| x.into());
5647 self
5648 }
5649
5650 pub fn set_skip_initial_version_creation<T: Into<bool>>(mut self, v: T) -> Self {
5652 self.0.request.skip_initial_version_creation = v.into();
5653 self
5654 }
5655 }
5656
5657 #[doc(hidden)]
5658 impl crate::RequestBuilder for CreateCryptoKey {
5659 fn request_options(&mut self) -> &mut crate::RequestOptions {
5660 &mut self.0.options
5661 }
5662 }
5663
5664 #[derive(Clone, Debug)]
5681 pub struct CreateCryptoKeyVersion(RequestBuilder<crate::model::CreateCryptoKeyVersionRequest>);
5682
5683 impl CreateCryptoKeyVersion {
5684 pub(crate) fn new(
5685 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5686 ) -> Self {
5687 Self(RequestBuilder::new(stub))
5688 }
5689
5690 pub fn with_request<V: Into<crate::model::CreateCryptoKeyVersionRequest>>(
5692 mut self,
5693 v: V,
5694 ) -> Self {
5695 self.0.request = v.into();
5696 self
5697 }
5698
5699 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5701 self.0.options = v.into();
5702 self
5703 }
5704
5705 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
5707 (*self.0.stub)
5708 .create_crypto_key_version(self.0.request, self.0.options)
5709 .await
5710 .map(crate::Response::into_body)
5711 }
5712
5713 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5717 self.0.request.parent = v.into();
5718 self
5719 }
5720
5721 pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
5725 where
5726 T: std::convert::Into<crate::model::CryptoKeyVersion>,
5727 {
5728 self.0.request.crypto_key_version = std::option::Option::Some(v.into());
5729 self
5730 }
5731
5732 pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
5736 where
5737 T: std::convert::Into<crate::model::CryptoKeyVersion>,
5738 {
5739 self.0.request.crypto_key_version = v.map(|x| x.into());
5740 self
5741 }
5742 }
5743
5744 #[doc(hidden)]
5745 impl crate::RequestBuilder for CreateCryptoKeyVersion {
5746 fn request_options(&mut self) -> &mut crate::RequestOptions {
5747 &mut self.0.options
5748 }
5749 }
5750
5751 #[derive(Clone, Debug)]
5769 pub struct DeleteCryptoKey(RequestBuilder<crate::model::DeleteCryptoKeyRequest>);
5770
5771 impl DeleteCryptoKey {
5772 pub(crate) fn new(
5773 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5774 ) -> Self {
5775 Self(RequestBuilder::new(stub))
5776 }
5777
5778 pub fn with_request<V: Into<crate::model::DeleteCryptoKeyRequest>>(mut self, v: V) -> Self {
5780 self.0.request = v.into();
5781 self
5782 }
5783
5784 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5786 self.0.options = v.into();
5787 self
5788 }
5789
5790 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5797 (*self.0.stub)
5798 .delete_crypto_key(self.0.request, self.0.options)
5799 .await
5800 .map(crate::Response::into_body)
5801 }
5802
5803 pub fn poller(
5805 self,
5806 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteCryptoKeyMetadata> {
5807 type Operation = google_cloud_lro::internal::Operation<
5808 wkt::Empty,
5809 crate::model::DeleteCryptoKeyMetadata,
5810 >;
5811 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5812 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5813 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5814 if let Some(ref mut details) = poller_options.tracing {
5815 details.method_name = "google_cloud_kms_v1::client::KeyManagementService::delete_crypto_key::until_done";
5816 }
5817
5818 let stub = self.0.stub.clone();
5819 let mut options = self.0.options.clone();
5820 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5821 let query = move |name| {
5822 let stub = stub.clone();
5823 let options = options.clone();
5824 async {
5825 let op = GetOperation::new(stub)
5826 .set_name(name)
5827 .with_options(options)
5828 .send()
5829 .await?;
5830 Ok(Operation::new(op))
5831 }
5832 };
5833
5834 let start = move || async {
5835 let op = self.send().await?;
5836 Ok(Operation::new(op))
5837 };
5838
5839 use google_cloud_lro::internal::PollerExt;
5840 {
5841 google_cloud_lro::internal::new_unit_response_poller(
5842 polling_error_policy,
5843 polling_backoff_policy,
5844 start,
5845 query,
5846 )
5847 }
5848 .with_options(poller_options)
5849 }
5850
5851 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5855 self.0.request.name = v.into();
5856 self
5857 }
5858 }
5859
5860 #[doc(hidden)]
5861 impl crate::RequestBuilder for DeleteCryptoKey {
5862 fn request_options(&mut self) -> &mut crate::RequestOptions {
5863 &mut self.0.options
5864 }
5865 }
5866
5867 #[derive(Clone, Debug)]
5885 pub struct DeleteCryptoKeyVersion(RequestBuilder<crate::model::DeleteCryptoKeyVersionRequest>);
5886
5887 impl DeleteCryptoKeyVersion {
5888 pub(crate) fn new(
5889 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5890 ) -> Self {
5891 Self(RequestBuilder::new(stub))
5892 }
5893
5894 pub fn with_request<V: Into<crate::model::DeleteCryptoKeyVersionRequest>>(
5896 mut self,
5897 v: V,
5898 ) -> Self {
5899 self.0.request = v.into();
5900 self
5901 }
5902
5903 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5905 self.0.options = v.into();
5906 self
5907 }
5908
5909 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5916 (*self.0.stub)
5917 .delete_crypto_key_version(self.0.request, self.0.options)
5918 .await
5919 .map(crate::Response::into_body)
5920 }
5921
5922 pub fn poller(
5924 self,
5925 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteCryptoKeyVersionMetadata>
5926 {
5927 type Operation = google_cloud_lro::internal::Operation<
5928 wkt::Empty,
5929 crate::model::DeleteCryptoKeyVersionMetadata,
5930 >;
5931 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5932 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5933 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5934 if let Some(ref mut details) = poller_options.tracing {
5935 details.method_name = "google_cloud_kms_v1::client::KeyManagementService::delete_crypto_key_version::until_done";
5936 }
5937
5938 let stub = self.0.stub.clone();
5939 let mut options = self.0.options.clone();
5940 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5941 let query = move |name| {
5942 let stub = stub.clone();
5943 let options = options.clone();
5944 async {
5945 let op = GetOperation::new(stub)
5946 .set_name(name)
5947 .with_options(options)
5948 .send()
5949 .await?;
5950 Ok(Operation::new(op))
5951 }
5952 };
5953
5954 let start = move || async {
5955 let op = self.send().await?;
5956 Ok(Operation::new(op))
5957 };
5958
5959 use google_cloud_lro::internal::PollerExt;
5960 {
5961 google_cloud_lro::internal::new_unit_response_poller(
5962 polling_error_policy,
5963 polling_backoff_policy,
5964 start,
5965 query,
5966 )
5967 }
5968 .with_options(poller_options)
5969 }
5970
5971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5975 self.0.request.name = v.into();
5976 self
5977 }
5978 }
5979
5980 #[doc(hidden)]
5981 impl crate::RequestBuilder for DeleteCryptoKeyVersion {
5982 fn request_options(&mut self) -> &mut crate::RequestOptions {
5983 &mut self.0.options
5984 }
5985 }
5986
5987 #[derive(Clone, Debug)]
6004 pub struct ImportCryptoKeyVersion(RequestBuilder<crate::model::ImportCryptoKeyVersionRequest>);
6005
6006 impl ImportCryptoKeyVersion {
6007 pub(crate) fn new(
6008 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6009 ) -> Self {
6010 Self(RequestBuilder::new(stub))
6011 }
6012
6013 pub fn with_request<V: Into<crate::model::ImportCryptoKeyVersionRequest>>(
6015 mut self,
6016 v: V,
6017 ) -> Self {
6018 self.0.request = v.into();
6019 self
6020 }
6021
6022 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6024 self.0.options = v.into();
6025 self
6026 }
6027
6028 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6030 (*self.0.stub)
6031 .import_crypto_key_version(self.0.request, self.0.options)
6032 .await
6033 .map(crate::Response::into_body)
6034 }
6035
6036 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6040 self.0.request.parent = v.into();
6041 self
6042 }
6043
6044 pub fn set_crypto_key_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
6046 self.0.request.crypto_key_version = v.into();
6047 self
6048 }
6049
6050 pub fn set_algorithm<
6054 T: Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
6055 >(
6056 mut self,
6057 v: T,
6058 ) -> Self {
6059 self.0.request.algorithm = v.into();
6060 self
6061 }
6062
6063 pub fn set_import_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
6067 self.0.request.import_job = v.into();
6068 self
6069 }
6070
6071 pub fn set_wrapped_key<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6073 self.0.request.wrapped_key = v.into();
6074 self
6075 }
6076
6077 pub fn set_wrapped_key_material<
6082 T: Into<Option<crate::model::import_crypto_key_version_request::WrappedKeyMaterial>>,
6083 >(
6084 mut self,
6085 v: T,
6086 ) -> Self {
6087 self.0.request.wrapped_key_material = v.into();
6088 self
6089 }
6090
6091 pub fn set_rsa_aes_wrapped_key<T: std::convert::Into<::bytes::Bytes>>(
6097 mut self,
6098 v: T,
6099 ) -> Self {
6100 self.0.request = self.0.request.set_rsa_aes_wrapped_key(v);
6101 self
6102 }
6103 }
6104
6105 #[doc(hidden)]
6106 impl crate::RequestBuilder for ImportCryptoKeyVersion {
6107 fn request_options(&mut self) -> &mut crate::RequestOptions {
6108 &mut self.0.options
6109 }
6110 }
6111
6112 #[derive(Clone, Debug)]
6129 pub struct CreateImportJob(RequestBuilder<crate::model::CreateImportJobRequest>);
6130
6131 impl CreateImportJob {
6132 pub(crate) fn new(
6133 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6134 ) -> Self {
6135 Self(RequestBuilder::new(stub))
6136 }
6137
6138 pub fn with_request<V: Into<crate::model::CreateImportJobRequest>>(mut self, v: V) -> Self {
6140 self.0.request = v.into();
6141 self
6142 }
6143
6144 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6146 self.0.options = v.into();
6147 self
6148 }
6149
6150 pub async fn send(self) -> Result<crate::model::ImportJob> {
6152 (*self.0.stub)
6153 .create_import_job(self.0.request, self.0.options)
6154 .await
6155 .map(crate::Response::into_body)
6156 }
6157
6158 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6162 self.0.request.parent = v.into();
6163 self
6164 }
6165
6166 pub fn set_import_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6170 self.0.request.import_job_id = v.into();
6171 self
6172 }
6173
6174 pub fn set_import_job<T>(mut self, v: T) -> Self
6178 where
6179 T: std::convert::Into<crate::model::ImportJob>,
6180 {
6181 self.0.request.import_job = std::option::Option::Some(v.into());
6182 self
6183 }
6184
6185 pub fn set_or_clear_import_job<T>(mut self, v: std::option::Option<T>) -> Self
6189 where
6190 T: std::convert::Into<crate::model::ImportJob>,
6191 {
6192 self.0.request.import_job = v.map(|x| x.into());
6193 self
6194 }
6195 }
6196
6197 #[doc(hidden)]
6198 impl crate::RequestBuilder for CreateImportJob {
6199 fn request_options(&mut self) -> &mut crate::RequestOptions {
6200 &mut self.0.options
6201 }
6202 }
6203
6204 #[derive(Clone, Debug)]
6221 pub struct UpdateCryptoKey(RequestBuilder<crate::model::UpdateCryptoKeyRequest>);
6222
6223 impl UpdateCryptoKey {
6224 pub(crate) fn new(
6225 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6226 ) -> Self {
6227 Self(RequestBuilder::new(stub))
6228 }
6229
6230 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyRequest>>(mut self, v: V) -> Self {
6232 self.0.request = v.into();
6233 self
6234 }
6235
6236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6238 self.0.options = v.into();
6239 self
6240 }
6241
6242 pub async fn send(self) -> Result<crate::model::CryptoKey> {
6244 (*self.0.stub)
6245 .update_crypto_key(self.0.request, self.0.options)
6246 .await
6247 .map(crate::Response::into_body)
6248 }
6249
6250 pub fn set_crypto_key<T>(mut self, v: T) -> Self
6254 where
6255 T: std::convert::Into<crate::model::CryptoKey>,
6256 {
6257 self.0.request.crypto_key = std::option::Option::Some(v.into());
6258 self
6259 }
6260
6261 pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
6265 where
6266 T: std::convert::Into<crate::model::CryptoKey>,
6267 {
6268 self.0.request.crypto_key = v.map(|x| x.into());
6269 self
6270 }
6271
6272 pub fn set_update_mask<T>(mut self, v: T) -> Self
6276 where
6277 T: std::convert::Into<wkt::FieldMask>,
6278 {
6279 self.0.request.update_mask = std::option::Option::Some(v.into());
6280 self
6281 }
6282
6283 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6287 where
6288 T: std::convert::Into<wkt::FieldMask>,
6289 {
6290 self.0.request.update_mask = v.map(|x| x.into());
6291 self
6292 }
6293 }
6294
6295 #[doc(hidden)]
6296 impl crate::RequestBuilder for UpdateCryptoKey {
6297 fn request_options(&mut self) -> &mut crate::RequestOptions {
6298 &mut self.0.options
6299 }
6300 }
6301
6302 #[derive(Clone, Debug)]
6319 pub struct UpdateCryptoKeyVersion(RequestBuilder<crate::model::UpdateCryptoKeyVersionRequest>);
6320
6321 impl UpdateCryptoKeyVersion {
6322 pub(crate) fn new(
6323 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6324 ) -> Self {
6325 Self(RequestBuilder::new(stub))
6326 }
6327
6328 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyVersionRequest>>(
6330 mut self,
6331 v: V,
6332 ) -> Self {
6333 self.0.request = v.into();
6334 self
6335 }
6336
6337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6339 self.0.options = v.into();
6340 self
6341 }
6342
6343 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6345 (*self.0.stub)
6346 .update_crypto_key_version(self.0.request, self.0.options)
6347 .await
6348 .map(crate::Response::into_body)
6349 }
6350
6351 pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
6355 where
6356 T: std::convert::Into<crate::model::CryptoKeyVersion>,
6357 {
6358 self.0.request.crypto_key_version = std::option::Option::Some(v.into());
6359 self
6360 }
6361
6362 pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
6366 where
6367 T: std::convert::Into<crate::model::CryptoKeyVersion>,
6368 {
6369 self.0.request.crypto_key_version = v.map(|x| x.into());
6370 self
6371 }
6372
6373 pub fn set_update_mask<T>(mut self, v: T) -> Self
6377 where
6378 T: std::convert::Into<wkt::FieldMask>,
6379 {
6380 self.0.request.update_mask = std::option::Option::Some(v.into());
6381 self
6382 }
6383
6384 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6388 where
6389 T: std::convert::Into<wkt::FieldMask>,
6390 {
6391 self.0.request.update_mask = v.map(|x| x.into());
6392 self
6393 }
6394 }
6395
6396 #[doc(hidden)]
6397 impl crate::RequestBuilder for UpdateCryptoKeyVersion {
6398 fn request_options(&mut self) -> &mut crate::RequestOptions {
6399 &mut self.0.options
6400 }
6401 }
6402
6403 #[derive(Clone, Debug)]
6420 pub struct UpdateCryptoKeyPrimaryVersion(
6421 RequestBuilder<crate::model::UpdateCryptoKeyPrimaryVersionRequest>,
6422 );
6423
6424 impl UpdateCryptoKeyPrimaryVersion {
6425 pub(crate) fn new(
6426 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6427 ) -> Self {
6428 Self(RequestBuilder::new(stub))
6429 }
6430
6431 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyPrimaryVersionRequest>>(
6433 mut self,
6434 v: V,
6435 ) -> Self {
6436 self.0.request = v.into();
6437 self
6438 }
6439
6440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6442 self.0.options = v.into();
6443 self
6444 }
6445
6446 pub async fn send(self) -> Result<crate::model::CryptoKey> {
6448 (*self.0.stub)
6449 .update_crypto_key_primary_version(self.0.request, self.0.options)
6450 .await
6451 .map(crate::Response::into_body)
6452 }
6453
6454 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6458 self.0.request.name = v.into();
6459 self
6460 }
6461
6462 pub fn set_crypto_key_version_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6466 self.0.request.crypto_key_version_id = v.into();
6467 self
6468 }
6469 }
6470
6471 #[doc(hidden)]
6472 impl crate::RequestBuilder for UpdateCryptoKeyPrimaryVersion {
6473 fn request_options(&mut self) -> &mut crate::RequestOptions {
6474 &mut self.0.options
6475 }
6476 }
6477
6478 #[derive(Clone, Debug)]
6495 pub struct DestroyCryptoKeyVersion(
6496 RequestBuilder<crate::model::DestroyCryptoKeyVersionRequest>,
6497 );
6498
6499 impl DestroyCryptoKeyVersion {
6500 pub(crate) fn new(
6501 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6502 ) -> Self {
6503 Self(RequestBuilder::new(stub))
6504 }
6505
6506 pub fn with_request<V: Into<crate::model::DestroyCryptoKeyVersionRequest>>(
6508 mut self,
6509 v: V,
6510 ) -> Self {
6511 self.0.request = v.into();
6512 self
6513 }
6514
6515 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6517 self.0.options = v.into();
6518 self
6519 }
6520
6521 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6523 (*self.0.stub)
6524 .destroy_crypto_key_version(self.0.request, self.0.options)
6525 .await
6526 .map(crate::Response::into_body)
6527 }
6528
6529 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6533 self.0.request.name = v.into();
6534 self
6535 }
6536 }
6537
6538 #[doc(hidden)]
6539 impl crate::RequestBuilder for DestroyCryptoKeyVersion {
6540 fn request_options(&mut self) -> &mut crate::RequestOptions {
6541 &mut self.0.options
6542 }
6543 }
6544
6545 #[derive(Clone, Debug)]
6562 pub struct RestoreCryptoKeyVersion(
6563 RequestBuilder<crate::model::RestoreCryptoKeyVersionRequest>,
6564 );
6565
6566 impl RestoreCryptoKeyVersion {
6567 pub(crate) fn new(
6568 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6569 ) -> Self {
6570 Self(RequestBuilder::new(stub))
6571 }
6572
6573 pub fn with_request<V: Into<crate::model::RestoreCryptoKeyVersionRequest>>(
6575 mut self,
6576 v: V,
6577 ) -> Self {
6578 self.0.request = v.into();
6579 self
6580 }
6581
6582 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6584 self.0.options = v.into();
6585 self
6586 }
6587
6588 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6590 (*self.0.stub)
6591 .restore_crypto_key_version(self.0.request, self.0.options)
6592 .await
6593 .map(crate::Response::into_body)
6594 }
6595
6596 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6600 self.0.request.name = v.into();
6601 self
6602 }
6603 }
6604
6605 #[doc(hidden)]
6606 impl crate::RequestBuilder for RestoreCryptoKeyVersion {
6607 fn request_options(&mut self) -> &mut crate::RequestOptions {
6608 &mut self.0.options
6609 }
6610 }
6611
6612 #[derive(Clone, Debug)]
6629 pub struct Encrypt(RequestBuilder<crate::model::EncryptRequest>);
6630
6631 impl Encrypt {
6632 pub(crate) fn new(
6633 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6634 ) -> Self {
6635 Self(RequestBuilder::new(stub))
6636 }
6637
6638 pub fn with_request<V: Into<crate::model::EncryptRequest>>(mut self, v: V) -> Self {
6640 self.0.request = v.into();
6641 self
6642 }
6643
6644 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6646 self.0.options = v.into();
6647 self
6648 }
6649
6650 pub async fn send(self) -> Result<crate::model::EncryptResponse> {
6652 (*self.0.stub)
6653 .encrypt(self.0.request, self.0.options)
6654 .await
6655 .map(crate::Response::into_body)
6656 }
6657
6658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6662 self.0.request.name = v.into();
6663 self
6664 }
6665
6666 pub fn set_plaintext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6670 self.0.request.plaintext = v.into();
6671 self
6672 }
6673
6674 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6676 self.0.request.additional_authenticated_data = v.into();
6677 self
6678 }
6679
6680 pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
6682 where
6683 T: std::convert::Into<wkt::Int64Value>,
6684 {
6685 self.0.request.plaintext_crc32c = std::option::Option::Some(v.into());
6686 self
6687 }
6688
6689 pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6691 where
6692 T: std::convert::Into<wkt::Int64Value>,
6693 {
6694 self.0.request.plaintext_crc32c = v.map(|x| x.into());
6695 self
6696 }
6697
6698 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
6700 where
6701 T: std::convert::Into<wkt::Int64Value>,
6702 {
6703 self.0.request.additional_authenticated_data_crc32c =
6704 std::option::Option::Some(v.into());
6705 self
6706 }
6707
6708 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
6710 mut self,
6711 v: std::option::Option<T>,
6712 ) -> Self
6713 where
6714 T: std::convert::Into<wkt::Int64Value>,
6715 {
6716 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
6717 self
6718 }
6719 }
6720
6721 #[doc(hidden)]
6722 impl crate::RequestBuilder for Encrypt {
6723 fn request_options(&mut self) -> &mut crate::RequestOptions {
6724 &mut self.0.options
6725 }
6726 }
6727
6728 #[derive(Clone, Debug)]
6745 pub struct Decrypt(RequestBuilder<crate::model::DecryptRequest>);
6746
6747 impl Decrypt {
6748 pub(crate) fn new(
6749 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6750 ) -> Self {
6751 Self(RequestBuilder::new(stub))
6752 }
6753
6754 pub fn with_request<V: Into<crate::model::DecryptRequest>>(mut self, v: V) -> Self {
6756 self.0.request = v.into();
6757 self
6758 }
6759
6760 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6762 self.0.options = v.into();
6763 self
6764 }
6765
6766 pub async fn send(self) -> Result<crate::model::DecryptResponse> {
6768 (*self.0.stub)
6769 .decrypt(self.0.request, self.0.options)
6770 .await
6771 .map(crate::Response::into_body)
6772 }
6773
6774 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6778 self.0.request.name = v.into();
6779 self
6780 }
6781
6782 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6786 self.0.request.ciphertext = v.into();
6787 self
6788 }
6789
6790 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6792 self.0.request.additional_authenticated_data = v.into();
6793 self
6794 }
6795
6796 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
6798 where
6799 T: std::convert::Into<wkt::Int64Value>,
6800 {
6801 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
6802 self
6803 }
6804
6805 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6807 where
6808 T: std::convert::Into<wkt::Int64Value>,
6809 {
6810 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
6811 self
6812 }
6813
6814 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
6816 where
6817 T: std::convert::Into<wkt::Int64Value>,
6818 {
6819 self.0.request.additional_authenticated_data_crc32c =
6820 std::option::Option::Some(v.into());
6821 self
6822 }
6823
6824 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
6826 mut self,
6827 v: std::option::Option<T>,
6828 ) -> Self
6829 where
6830 T: std::convert::Into<wkt::Int64Value>,
6831 {
6832 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
6833 self
6834 }
6835 }
6836
6837 #[doc(hidden)]
6838 impl crate::RequestBuilder for Decrypt {
6839 fn request_options(&mut self) -> &mut crate::RequestOptions {
6840 &mut self.0.options
6841 }
6842 }
6843
6844 #[derive(Clone, Debug)]
6861 pub struct RawEncrypt(RequestBuilder<crate::model::RawEncryptRequest>);
6862
6863 impl RawEncrypt {
6864 pub(crate) fn new(
6865 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6866 ) -> Self {
6867 Self(RequestBuilder::new(stub))
6868 }
6869
6870 pub fn with_request<V: Into<crate::model::RawEncryptRequest>>(mut self, v: V) -> Self {
6872 self.0.request = v.into();
6873 self
6874 }
6875
6876 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6878 self.0.options = v.into();
6879 self
6880 }
6881
6882 pub async fn send(self) -> Result<crate::model::RawEncryptResponse> {
6884 (*self.0.stub)
6885 .raw_encrypt(self.0.request, self.0.options)
6886 .await
6887 .map(crate::Response::into_body)
6888 }
6889
6890 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6894 self.0.request.name = v.into();
6895 self
6896 }
6897
6898 pub fn set_plaintext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6902 self.0.request.plaintext = v.into();
6903 self
6904 }
6905
6906 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6908 self.0.request.additional_authenticated_data = v.into();
6909 self
6910 }
6911
6912 pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
6914 where
6915 T: std::convert::Into<wkt::Int64Value>,
6916 {
6917 self.0.request.plaintext_crc32c = std::option::Option::Some(v.into());
6918 self
6919 }
6920
6921 pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6923 where
6924 T: std::convert::Into<wkt::Int64Value>,
6925 {
6926 self.0.request.plaintext_crc32c = v.map(|x| x.into());
6927 self
6928 }
6929
6930 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
6932 where
6933 T: std::convert::Into<wkt::Int64Value>,
6934 {
6935 self.0.request.additional_authenticated_data_crc32c =
6936 std::option::Option::Some(v.into());
6937 self
6938 }
6939
6940 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
6942 mut self,
6943 v: std::option::Option<T>,
6944 ) -> Self
6945 where
6946 T: std::convert::Into<wkt::Int64Value>,
6947 {
6948 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
6949 self
6950 }
6951
6952 pub fn set_initialization_vector<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6954 self.0.request.initialization_vector = v.into();
6955 self
6956 }
6957
6958 pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
6960 where
6961 T: std::convert::Into<wkt::Int64Value>,
6962 {
6963 self.0.request.initialization_vector_crc32c = std::option::Option::Some(v.into());
6964 self
6965 }
6966
6967 pub fn set_or_clear_initialization_vector_crc32c<T>(
6969 mut self,
6970 v: std::option::Option<T>,
6971 ) -> Self
6972 where
6973 T: std::convert::Into<wkt::Int64Value>,
6974 {
6975 self.0.request.initialization_vector_crc32c = v.map(|x| x.into());
6976 self
6977 }
6978 }
6979
6980 #[doc(hidden)]
6981 impl crate::RequestBuilder for RawEncrypt {
6982 fn request_options(&mut self) -> &mut crate::RequestOptions {
6983 &mut self.0.options
6984 }
6985 }
6986
6987 #[derive(Clone, Debug)]
7004 pub struct RawDecrypt(RequestBuilder<crate::model::RawDecryptRequest>);
7005
7006 impl RawDecrypt {
7007 pub(crate) fn new(
7008 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7009 ) -> Self {
7010 Self(RequestBuilder::new(stub))
7011 }
7012
7013 pub fn with_request<V: Into<crate::model::RawDecryptRequest>>(mut self, v: V) -> Self {
7015 self.0.request = v.into();
7016 self
7017 }
7018
7019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7021 self.0.options = v.into();
7022 self
7023 }
7024
7025 pub async fn send(self) -> Result<crate::model::RawDecryptResponse> {
7027 (*self.0.stub)
7028 .raw_decrypt(self.0.request, self.0.options)
7029 .await
7030 .map(crate::Response::into_body)
7031 }
7032
7033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7037 self.0.request.name = v.into();
7038 self
7039 }
7040
7041 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7045 self.0.request.ciphertext = v.into();
7046 self
7047 }
7048
7049 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7051 self.0.request.additional_authenticated_data = v.into();
7052 self
7053 }
7054
7055 pub fn set_initialization_vector<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7059 self.0.request.initialization_vector = v.into();
7060 self
7061 }
7062
7063 pub fn set_tag_length<T: Into<i32>>(mut self, v: T) -> Self {
7065 self.0.request.tag_length = v.into();
7066 self
7067 }
7068
7069 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
7071 where
7072 T: std::convert::Into<wkt::Int64Value>,
7073 {
7074 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
7075 self
7076 }
7077
7078 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7080 where
7081 T: std::convert::Into<wkt::Int64Value>,
7082 {
7083 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
7084 self
7085 }
7086
7087 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
7089 where
7090 T: std::convert::Into<wkt::Int64Value>,
7091 {
7092 self.0.request.additional_authenticated_data_crc32c =
7093 std::option::Option::Some(v.into());
7094 self
7095 }
7096
7097 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
7099 mut self,
7100 v: std::option::Option<T>,
7101 ) -> Self
7102 where
7103 T: std::convert::Into<wkt::Int64Value>,
7104 {
7105 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
7106 self
7107 }
7108
7109 pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
7111 where
7112 T: std::convert::Into<wkt::Int64Value>,
7113 {
7114 self.0.request.initialization_vector_crc32c = std::option::Option::Some(v.into());
7115 self
7116 }
7117
7118 pub fn set_or_clear_initialization_vector_crc32c<T>(
7120 mut self,
7121 v: std::option::Option<T>,
7122 ) -> Self
7123 where
7124 T: std::convert::Into<wkt::Int64Value>,
7125 {
7126 self.0.request.initialization_vector_crc32c = v.map(|x| x.into());
7127 self
7128 }
7129 }
7130
7131 #[doc(hidden)]
7132 impl crate::RequestBuilder for RawDecrypt {
7133 fn request_options(&mut self) -> &mut crate::RequestOptions {
7134 &mut self.0.options
7135 }
7136 }
7137
7138 #[derive(Clone, Debug)]
7155 pub struct AsymmetricSign(RequestBuilder<crate::model::AsymmetricSignRequest>);
7156
7157 impl AsymmetricSign {
7158 pub(crate) fn new(
7159 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7160 ) -> Self {
7161 Self(RequestBuilder::new(stub))
7162 }
7163
7164 pub fn with_request<V: Into<crate::model::AsymmetricSignRequest>>(mut self, v: V) -> Self {
7166 self.0.request = v.into();
7167 self
7168 }
7169
7170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7172 self.0.options = v.into();
7173 self
7174 }
7175
7176 pub async fn send(self) -> Result<crate::model::AsymmetricSignResponse> {
7178 (*self.0.stub)
7179 .asymmetric_sign(self.0.request, self.0.options)
7180 .await
7181 .map(crate::Response::into_body)
7182 }
7183
7184 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7188 self.0.request.name = v.into();
7189 self
7190 }
7191
7192 pub fn set_digest<T>(mut self, v: T) -> Self
7194 where
7195 T: std::convert::Into<crate::model::Digest>,
7196 {
7197 self.0.request.digest = std::option::Option::Some(v.into());
7198 self
7199 }
7200
7201 pub fn set_or_clear_digest<T>(mut self, v: std::option::Option<T>) -> Self
7203 where
7204 T: std::convert::Into<crate::model::Digest>,
7205 {
7206 self.0.request.digest = v.map(|x| x.into());
7207 self
7208 }
7209
7210 pub fn set_digest_crc32c<T>(mut self, v: T) -> Self
7212 where
7213 T: std::convert::Into<wkt::Int64Value>,
7214 {
7215 self.0.request.digest_crc32c = std::option::Option::Some(v.into());
7216 self
7217 }
7218
7219 pub fn set_or_clear_digest_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7221 where
7222 T: std::convert::Into<wkt::Int64Value>,
7223 {
7224 self.0.request.digest_crc32c = v.map(|x| x.into());
7225 self
7226 }
7227
7228 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7230 self.0.request.data = v.into();
7231 self
7232 }
7233
7234 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
7236 where
7237 T: std::convert::Into<wkt::Int64Value>,
7238 {
7239 self.0.request.data_crc32c = std::option::Option::Some(v.into());
7240 self
7241 }
7242
7243 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7245 where
7246 T: std::convert::Into<wkt::Int64Value>,
7247 {
7248 self.0.request.data_crc32c = v.map(|x| x.into());
7249 self
7250 }
7251 }
7252
7253 #[doc(hidden)]
7254 impl crate::RequestBuilder for AsymmetricSign {
7255 fn request_options(&mut self) -> &mut crate::RequestOptions {
7256 &mut self.0.options
7257 }
7258 }
7259
7260 #[derive(Clone, Debug)]
7277 pub struct AsymmetricDecrypt(RequestBuilder<crate::model::AsymmetricDecryptRequest>);
7278
7279 impl AsymmetricDecrypt {
7280 pub(crate) fn new(
7281 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7282 ) -> Self {
7283 Self(RequestBuilder::new(stub))
7284 }
7285
7286 pub fn with_request<V: Into<crate::model::AsymmetricDecryptRequest>>(
7288 mut self,
7289 v: V,
7290 ) -> Self {
7291 self.0.request = v.into();
7292 self
7293 }
7294
7295 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7297 self.0.options = v.into();
7298 self
7299 }
7300
7301 pub async fn send(self) -> Result<crate::model::AsymmetricDecryptResponse> {
7303 (*self.0.stub)
7304 .asymmetric_decrypt(self.0.request, self.0.options)
7305 .await
7306 .map(crate::Response::into_body)
7307 }
7308
7309 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7313 self.0.request.name = v.into();
7314 self
7315 }
7316
7317 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7321 self.0.request.ciphertext = v.into();
7322 self
7323 }
7324
7325 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
7327 where
7328 T: std::convert::Into<wkt::Int64Value>,
7329 {
7330 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
7331 self
7332 }
7333
7334 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7336 where
7337 T: std::convert::Into<wkt::Int64Value>,
7338 {
7339 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
7340 self
7341 }
7342 }
7343
7344 #[doc(hidden)]
7345 impl crate::RequestBuilder for AsymmetricDecrypt {
7346 fn request_options(&mut self) -> &mut crate::RequestOptions {
7347 &mut self.0.options
7348 }
7349 }
7350
7351 #[derive(Clone, Debug)]
7368 pub struct MacSign(RequestBuilder<crate::model::MacSignRequest>);
7369
7370 impl MacSign {
7371 pub(crate) fn new(
7372 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7373 ) -> Self {
7374 Self(RequestBuilder::new(stub))
7375 }
7376
7377 pub fn with_request<V: Into<crate::model::MacSignRequest>>(mut self, v: V) -> Self {
7379 self.0.request = v.into();
7380 self
7381 }
7382
7383 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7385 self.0.options = v.into();
7386 self
7387 }
7388
7389 pub async fn send(self) -> Result<crate::model::MacSignResponse> {
7391 (*self.0.stub)
7392 .mac_sign(self.0.request, self.0.options)
7393 .await
7394 .map(crate::Response::into_body)
7395 }
7396
7397 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7401 self.0.request.name = v.into();
7402 self
7403 }
7404
7405 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7409 self.0.request.data = v.into();
7410 self
7411 }
7412
7413 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
7415 where
7416 T: std::convert::Into<wkt::Int64Value>,
7417 {
7418 self.0.request.data_crc32c = std::option::Option::Some(v.into());
7419 self
7420 }
7421
7422 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7424 where
7425 T: std::convert::Into<wkt::Int64Value>,
7426 {
7427 self.0.request.data_crc32c = v.map(|x| x.into());
7428 self
7429 }
7430 }
7431
7432 #[doc(hidden)]
7433 impl crate::RequestBuilder for MacSign {
7434 fn request_options(&mut self) -> &mut crate::RequestOptions {
7435 &mut self.0.options
7436 }
7437 }
7438
7439 #[derive(Clone, Debug)]
7456 pub struct MacVerify(RequestBuilder<crate::model::MacVerifyRequest>);
7457
7458 impl MacVerify {
7459 pub(crate) fn new(
7460 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7461 ) -> Self {
7462 Self(RequestBuilder::new(stub))
7463 }
7464
7465 pub fn with_request<V: Into<crate::model::MacVerifyRequest>>(mut self, v: V) -> Self {
7467 self.0.request = v.into();
7468 self
7469 }
7470
7471 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7473 self.0.options = v.into();
7474 self
7475 }
7476
7477 pub async fn send(self) -> Result<crate::model::MacVerifyResponse> {
7479 (*self.0.stub)
7480 .mac_verify(self.0.request, self.0.options)
7481 .await
7482 .map(crate::Response::into_body)
7483 }
7484
7485 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7489 self.0.request.name = v.into();
7490 self
7491 }
7492
7493 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7497 self.0.request.data = v.into();
7498 self
7499 }
7500
7501 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
7503 where
7504 T: std::convert::Into<wkt::Int64Value>,
7505 {
7506 self.0.request.data_crc32c = std::option::Option::Some(v.into());
7507 self
7508 }
7509
7510 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7512 where
7513 T: std::convert::Into<wkt::Int64Value>,
7514 {
7515 self.0.request.data_crc32c = v.map(|x| x.into());
7516 self
7517 }
7518
7519 pub fn set_mac<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7523 self.0.request.mac = v.into();
7524 self
7525 }
7526
7527 pub fn set_mac_crc32c<T>(mut self, v: T) -> Self
7529 where
7530 T: std::convert::Into<wkt::Int64Value>,
7531 {
7532 self.0.request.mac_crc32c = std::option::Option::Some(v.into());
7533 self
7534 }
7535
7536 pub fn set_or_clear_mac_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7538 where
7539 T: std::convert::Into<wkt::Int64Value>,
7540 {
7541 self.0.request.mac_crc32c = v.map(|x| x.into());
7542 self
7543 }
7544 }
7545
7546 #[doc(hidden)]
7547 impl crate::RequestBuilder for MacVerify {
7548 fn request_options(&mut self) -> &mut crate::RequestOptions {
7549 &mut self.0.options
7550 }
7551 }
7552
7553 #[derive(Clone, Debug)]
7570 pub struct Decapsulate(RequestBuilder<crate::model::DecapsulateRequest>);
7571
7572 impl Decapsulate {
7573 pub(crate) fn new(
7574 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7575 ) -> Self {
7576 Self(RequestBuilder::new(stub))
7577 }
7578
7579 pub fn with_request<V: Into<crate::model::DecapsulateRequest>>(mut self, v: V) -> Self {
7581 self.0.request = v.into();
7582 self
7583 }
7584
7585 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7587 self.0.options = v.into();
7588 self
7589 }
7590
7591 pub async fn send(self) -> Result<crate::model::DecapsulateResponse> {
7593 (*self.0.stub)
7594 .decapsulate(self.0.request, self.0.options)
7595 .await
7596 .map(crate::Response::into_body)
7597 }
7598
7599 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7603 self.0.request.name = v.into();
7604 self
7605 }
7606
7607 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7611 self.0.request.ciphertext = v.into();
7612 self
7613 }
7614
7615 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
7617 where
7618 T: std::convert::Into<wkt::Int64Value>,
7619 {
7620 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
7621 self
7622 }
7623
7624 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7626 where
7627 T: std::convert::Into<wkt::Int64Value>,
7628 {
7629 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
7630 self
7631 }
7632 }
7633
7634 #[doc(hidden)]
7635 impl crate::RequestBuilder for Decapsulate {
7636 fn request_options(&mut self) -> &mut crate::RequestOptions {
7637 &mut self.0.options
7638 }
7639 }
7640
7641 #[derive(Clone, Debug)]
7658 pub struct GenerateRandomBytes(RequestBuilder<crate::model::GenerateRandomBytesRequest>);
7659
7660 impl GenerateRandomBytes {
7661 pub(crate) fn new(
7662 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7663 ) -> Self {
7664 Self(RequestBuilder::new(stub))
7665 }
7666
7667 pub fn with_request<V: Into<crate::model::GenerateRandomBytesRequest>>(
7669 mut self,
7670 v: V,
7671 ) -> Self {
7672 self.0.request = v.into();
7673 self
7674 }
7675
7676 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7678 self.0.options = v.into();
7679 self
7680 }
7681
7682 pub async fn send(self) -> Result<crate::model::GenerateRandomBytesResponse> {
7684 (*self.0.stub)
7685 .generate_random_bytes(self.0.request, self.0.options)
7686 .await
7687 .map(crate::Response::into_body)
7688 }
7689
7690 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7692 self.0.request.location = v.into();
7693 self
7694 }
7695
7696 pub fn set_length_bytes<T: Into<i32>>(mut self, v: T) -> Self {
7698 self.0.request.length_bytes = v.into();
7699 self
7700 }
7701
7702 pub fn set_protection_level<T: Into<crate::model::ProtectionLevel>>(
7704 mut self,
7705 v: T,
7706 ) -> Self {
7707 self.0.request.protection_level = v.into();
7708 self
7709 }
7710 }
7711
7712 #[doc(hidden)]
7713 impl crate::RequestBuilder for GenerateRandomBytes {
7714 fn request_options(&mut self) -> &mut crate::RequestOptions {
7715 &mut self.0.options
7716 }
7717 }
7718
7719 #[derive(Clone, Debug)]
7740 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7741
7742 impl ListLocations {
7743 pub(crate) fn new(
7744 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7745 ) -> Self {
7746 Self(RequestBuilder::new(stub))
7747 }
7748
7749 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7751 mut self,
7752 v: V,
7753 ) -> Self {
7754 self.0.request = v.into();
7755 self
7756 }
7757
7758 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7760 self.0.options = v.into();
7761 self
7762 }
7763
7764 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7766 (*self.0.stub)
7767 .list_locations(self.0.request, self.0.options)
7768 .await
7769 .map(crate::Response::into_body)
7770 }
7771
7772 pub fn by_page(
7774 self,
7775 ) -> impl google_cloud_gax::paginator::Paginator<
7776 google_cloud_location::model::ListLocationsResponse,
7777 crate::Error,
7778 > {
7779 use std::clone::Clone;
7780 let token = self.0.request.page_token.clone();
7781 let execute = move |token: String| {
7782 let mut builder = self.clone();
7783 builder.0.request = builder.0.request.set_page_token(token);
7784 builder.send()
7785 };
7786 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7787 }
7788
7789 pub fn by_item(
7791 self,
7792 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7793 google_cloud_location::model::ListLocationsResponse,
7794 crate::Error,
7795 > {
7796 use google_cloud_gax::paginator::Paginator;
7797 self.by_page().items()
7798 }
7799
7800 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7802 self.0.request.name = v.into();
7803 self
7804 }
7805
7806 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7808 self.0.request.filter = v.into();
7809 self
7810 }
7811
7812 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7814 self.0.request.page_size = v.into();
7815 self
7816 }
7817
7818 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7820 self.0.request.page_token = v.into();
7821 self
7822 }
7823 }
7824
7825 #[doc(hidden)]
7826 impl crate::RequestBuilder for ListLocations {
7827 fn request_options(&mut self) -> &mut crate::RequestOptions {
7828 &mut self.0.options
7829 }
7830 }
7831
7832 #[derive(Clone, Debug)]
7849 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7850
7851 impl GetLocation {
7852 pub(crate) fn new(
7853 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7854 ) -> Self {
7855 Self(RequestBuilder::new(stub))
7856 }
7857
7858 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7860 mut self,
7861 v: V,
7862 ) -> Self {
7863 self.0.request = v.into();
7864 self
7865 }
7866
7867 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7869 self.0.options = v.into();
7870 self
7871 }
7872
7873 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7875 (*self.0.stub)
7876 .get_location(self.0.request, self.0.options)
7877 .await
7878 .map(crate::Response::into_body)
7879 }
7880
7881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7883 self.0.request.name = v.into();
7884 self
7885 }
7886 }
7887
7888 #[doc(hidden)]
7889 impl crate::RequestBuilder for GetLocation {
7890 fn request_options(&mut self) -> &mut crate::RequestOptions {
7891 &mut self.0.options
7892 }
7893 }
7894
7895 #[derive(Clone, Debug)]
7912 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
7913
7914 impl SetIamPolicy {
7915 pub(crate) fn new(
7916 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7917 ) -> Self {
7918 Self(RequestBuilder::new(stub))
7919 }
7920
7921 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
7923 mut self,
7924 v: V,
7925 ) -> Self {
7926 self.0.request = v.into();
7927 self
7928 }
7929
7930 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7932 self.0.options = v.into();
7933 self
7934 }
7935
7936 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7938 (*self.0.stub)
7939 .set_iam_policy(self.0.request, self.0.options)
7940 .await
7941 .map(crate::Response::into_body)
7942 }
7943
7944 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7948 self.0.request.resource = v.into();
7949 self
7950 }
7951
7952 pub fn set_policy<T>(mut self, v: T) -> Self
7956 where
7957 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7958 {
7959 self.0.request.policy = std::option::Option::Some(v.into());
7960 self
7961 }
7962
7963 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7967 where
7968 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7969 {
7970 self.0.request.policy = v.map(|x| x.into());
7971 self
7972 }
7973
7974 pub fn set_update_mask<T>(mut self, v: T) -> Self
7976 where
7977 T: std::convert::Into<wkt::FieldMask>,
7978 {
7979 self.0.request.update_mask = std::option::Option::Some(v.into());
7980 self
7981 }
7982
7983 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7985 where
7986 T: std::convert::Into<wkt::FieldMask>,
7987 {
7988 self.0.request.update_mask = v.map(|x| x.into());
7989 self
7990 }
7991 }
7992
7993 #[doc(hidden)]
7994 impl crate::RequestBuilder for SetIamPolicy {
7995 fn request_options(&mut self) -> &mut crate::RequestOptions {
7996 &mut self.0.options
7997 }
7998 }
7999
8000 #[derive(Clone, Debug)]
8017 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8018
8019 impl GetIamPolicy {
8020 pub(crate) fn new(
8021 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
8022 ) -> Self {
8023 Self(RequestBuilder::new(stub))
8024 }
8025
8026 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8028 mut self,
8029 v: V,
8030 ) -> Self {
8031 self.0.request = v.into();
8032 self
8033 }
8034
8035 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8037 self.0.options = v.into();
8038 self
8039 }
8040
8041 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8043 (*self.0.stub)
8044 .get_iam_policy(self.0.request, self.0.options)
8045 .await
8046 .map(crate::Response::into_body)
8047 }
8048
8049 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8053 self.0.request.resource = v.into();
8054 self
8055 }
8056
8057 pub fn set_options<T>(mut self, v: T) -> Self
8059 where
8060 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8061 {
8062 self.0.request.options = std::option::Option::Some(v.into());
8063 self
8064 }
8065
8066 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8068 where
8069 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8070 {
8071 self.0.request.options = v.map(|x| x.into());
8072 self
8073 }
8074 }
8075
8076 #[doc(hidden)]
8077 impl crate::RequestBuilder for GetIamPolicy {
8078 fn request_options(&mut self) -> &mut crate::RequestOptions {
8079 &mut self.0.options
8080 }
8081 }
8082
8083 #[derive(Clone, Debug)]
8100 pub struct TestIamPermissions(
8101 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8102 );
8103
8104 impl TestIamPermissions {
8105 pub(crate) fn new(
8106 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
8107 ) -> Self {
8108 Self(RequestBuilder::new(stub))
8109 }
8110
8111 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8113 mut self,
8114 v: V,
8115 ) -> Self {
8116 self.0.request = v.into();
8117 self
8118 }
8119
8120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8122 self.0.options = v.into();
8123 self
8124 }
8125
8126 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8128 (*self.0.stub)
8129 .test_iam_permissions(self.0.request, self.0.options)
8130 .await
8131 .map(crate::Response::into_body)
8132 }
8133
8134 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8138 self.0.request.resource = v.into();
8139 self
8140 }
8141
8142 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8146 where
8147 T: std::iter::IntoIterator<Item = V>,
8148 V: std::convert::Into<std::string::String>,
8149 {
8150 use std::iter::Iterator;
8151 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8152 self
8153 }
8154 }
8155
8156 #[doc(hidden)]
8157 impl crate::RequestBuilder for TestIamPermissions {
8158 fn request_options(&mut self) -> &mut crate::RequestOptions {
8159 &mut self.0.options
8160 }
8161 }
8162
8163 #[derive(Clone, Debug)]
8180 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8181
8182 impl GetOperation {
8183 pub(crate) fn new(
8184 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
8185 ) -> Self {
8186 Self(RequestBuilder::new(stub))
8187 }
8188
8189 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8191 mut self,
8192 v: V,
8193 ) -> Self {
8194 self.0.request = v.into();
8195 self
8196 }
8197
8198 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8200 self.0.options = v.into();
8201 self
8202 }
8203
8204 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8206 (*self.0.stub)
8207 .get_operation(self.0.request, self.0.options)
8208 .await
8209 .map(crate::Response::into_body)
8210 }
8211
8212 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8214 self.0.request.name = v.into();
8215 self
8216 }
8217 }
8218
8219 #[doc(hidden)]
8220 impl crate::RequestBuilder for GetOperation {
8221 fn request_options(&mut self) -> &mut crate::RequestOptions {
8222 &mut self.0.options
8223 }
8224 }
8225}