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 pub fn set_trusted_wrapping_enabled<T: Into<bool>>(mut self, v: T) -> Self {
5658 self.0.request.trusted_wrapping_enabled = v.into();
5659 self
5660 }
5661 }
5662
5663 #[doc(hidden)]
5664 impl crate::RequestBuilder for CreateCryptoKey {
5665 fn request_options(&mut self) -> &mut crate::RequestOptions {
5666 &mut self.0.options
5667 }
5668 }
5669
5670 #[derive(Clone, Debug)]
5687 pub struct CreateCryptoKeyVersion(RequestBuilder<crate::model::CreateCryptoKeyVersionRequest>);
5688
5689 impl CreateCryptoKeyVersion {
5690 pub(crate) fn new(
5691 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5692 ) -> Self {
5693 Self(RequestBuilder::new(stub))
5694 }
5695
5696 pub fn with_request<V: Into<crate::model::CreateCryptoKeyVersionRequest>>(
5698 mut self,
5699 v: V,
5700 ) -> Self {
5701 self.0.request = v.into();
5702 self
5703 }
5704
5705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5707 self.0.options = v.into();
5708 self
5709 }
5710
5711 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
5713 (*self.0.stub)
5714 .create_crypto_key_version(self.0.request, self.0.options)
5715 .await
5716 .map(crate::Response::into_body)
5717 }
5718
5719 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5723 self.0.request.parent = v.into();
5724 self
5725 }
5726
5727 pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
5731 where
5732 T: std::convert::Into<crate::model::CryptoKeyVersion>,
5733 {
5734 self.0.request.crypto_key_version = std::option::Option::Some(v.into());
5735 self
5736 }
5737
5738 pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
5742 where
5743 T: std::convert::Into<crate::model::CryptoKeyVersion>,
5744 {
5745 self.0.request.crypto_key_version = v.map(|x| x.into());
5746 self
5747 }
5748 }
5749
5750 #[doc(hidden)]
5751 impl crate::RequestBuilder for CreateCryptoKeyVersion {
5752 fn request_options(&mut self) -> &mut crate::RequestOptions {
5753 &mut self.0.options
5754 }
5755 }
5756
5757 #[derive(Clone, Debug)]
5775 pub struct DeleteCryptoKey(RequestBuilder<crate::model::DeleteCryptoKeyRequest>);
5776
5777 impl DeleteCryptoKey {
5778 pub(crate) fn new(
5779 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5780 ) -> Self {
5781 Self(RequestBuilder::new(stub))
5782 }
5783
5784 pub fn with_request<V: Into<crate::model::DeleteCryptoKeyRequest>>(mut self, v: V) -> Self {
5786 self.0.request = v.into();
5787 self
5788 }
5789
5790 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5792 self.0.options = v.into();
5793 self
5794 }
5795
5796 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5803 (*self.0.stub)
5804 .delete_crypto_key(self.0.request, self.0.options)
5805 .await
5806 .map(crate::Response::into_body)
5807 }
5808
5809 pub fn poller(
5811 self,
5812 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteCryptoKeyMetadata> {
5813 type Operation = google_cloud_lro::internal::Operation<
5814 wkt::Empty,
5815 crate::model::DeleteCryptoKeyMetadata,
5816 >;
5817 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5818 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5819 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5820 if let Some(ref mut details) = poller_options.tracing {
5821 details.method_name = "google_cloud_kms_v1::client::KeyManagementService::delete_crypto_key::until_done";
5822 }
5823
5824 let stub = self.0.stub.clone();
5825 let mut options = self.0.options.clone();
5826 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5827 let query = move |name| {
5828 let stub = stub.clone();
5829 let options = options.clone();
5830 async {
5831 let op = GetOperation::new(stub)
5832 .set_name(name)
5833 .with_options(options)
5834 .send()
5835 .await?;
5836 Ok(Operation::new(op))
5837 }
5838 };
5839
5840 let start = move || async {
5841 let op = self.send().await?;
5842 Ok(Operation::new(op))
5843 };
5844
5845 use google_cloud_lro::internal::PollerExt;
5846 {
5847 google_cloud_lro::internal::new_unit_response_poller(
5848 polling_error_policy,
5849 polling_backoff_policy,
5850 start,
5851 query,
5852 )
5853 }
5854 .with_options(poller_options)
5855 }
5856
5857 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5861 self.0.request.name = v.into();
5862 self
5863 }
5864 }
5865
5866 #[doc(hidden)]
5867 impl crate::RequestBuilder for DeleteCryptoKey {
5868 fn request_options(&mut self) -> &mut crate::RequestOptions {
5869 &mut self.0.options
5870 }
5871 }
5872
5873 #[derive(Clone, Debug)]
5891 pub struct DeleteCryptoKeyVersion(RequestBuilder<crate::model::DeleteCryptoKeyVersionRequest>);
5892
5893 impl DeleteCryptoKeyVersion {
5894 pub(crate) fn new(
5895 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5896 ) -> Self {
5897 Self(RequestBuilder::new(stub))
5898 }
5899
5900 pub fn with_request<V: Into<crate::model::DeleteCryptoKeyVersionRequest>>(
5902 mut self,
5903 v: V,
5904 ) -> Self {
5905 self.0.request = v.into();
5906 self
5907 }
5908
5909 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5911 self.0.options = v.into();
5912 self
5913 }
5914
5915 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5922 (*self.0.stub)
5923 .delete_crypto_key_version(self.0.request, self.0.options)
5924 .await
5925 .map(crate::Response::into_body)
5926 }
5927
5928 pub fn poller(
5930 self,
5931 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteCryptoKeyVersionMetadata>
5932 {
5933 type Operation = google_cloud_lro::internal::Operation<
5934 wkt::Empty,
5935 crate::model::DeleteCryptoKeyVersionMetadata,
5936 >;
5937 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5938 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5939 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5940 if let Some(ref mut details) = poller_options.tracing {
5941 details.method_name = "google_cloud_kms_v1::client::KeyManagementService::delete_crypto_key_version::until_done";
5942 }
5943
5944 let stub = self.0.stub.clone();
5945 let mut options = self.0.options.clone();
5946 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5947 let query = move |name| {
5948 let stub = stub.clone();
5949 let options = options.clone();
5950 async {
5951 let op = GetOperation::new(stub)
5952 .set_name(name)
5953 .with_options(options)
5954 .send()
5955 .await?;
5956 Ok(Operation::new(op))
5957 }
5958 };
5959
5960 let start = move || async {
5961 let op = self.send().await?;
5962 Ok(Operation::new(op))
5963 };
5964
5965 use google_cloud_lro::internal::PollerExt;
5966 {
5967 google_cloud_lro::internal::new_unit_response_poller(
5968 polling_error_policy,
5969 polling_backoff_policy,
5970 start,
5971 query,
5972 )
5973 }
5974 .with_options(poller_options)
5975 }
5976
5977 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5981 self.0.request.name = v.into();
5982 self
5983 }
5984 }
5985
5986 #[doc(hidden)]
5987 impl crate::RequestBuilder for DeleteCryptoKeyVersion {
5988 fn request_options(&mut self) -> &mut crate::RequestOptions {
5989 &mut self.0.options
5990 }
5991 }
5992
5993 #[derive(Clone, Debug)]
6010 pub struct ImportCryptoKeyVersion(RequestBuilder<crate::model::ImportCryptoKeyVersionRequest>);
6011
6012 impl ImportCryptoKeyVersion {
6013 pub(crate) fn new(
6014 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6015 ) -> Self {
6016 Self(RequestBuilder::new(stub))
6017 }
6018
6019 pub fn with_request<V: Into<crate::model::ImportCryptoKeyVersionRequest>>(
6021 mut self,
6022 v: V,
6023 ) -> Self {
6024 self.0.request = v.into();
6025 self
6026 }
6027
6028 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6030 self.0.options = v.into();
6031 self
6032 }
6033
6034 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6036 (*self.0.stub)
6037 .import_crypto_key_version(self.0.request, self.0.options)
6038 .await
6039 .map(crate::Response::into_body)
6040 }
6041
6042 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6046 self.0.request.parent = v.into();
6047 self
6048 }
6049
6050 pub fn set_crypto_key_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
6052 self.0.request.crypto_key_version = v.into();
6053 self
6054 }
6055
6056 pub fn set_algorithm<
6060 T: Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
6061 >(
6062 mut self,
6063 v: T,
6064 ) -> Self {
6065 self.0.request.algorithm = v.into();
6066 self
6067 }
6068
6069 pub fn set_import_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
6073 self.0.request.import_job = v.into();
6074 self
6075 }
6076
6077 pub fn set_wrapped_key<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6079 self.0.request.wrapped_key = v.into();
6080 self
6081 }
6082
6083 pub fn set_trusted_wrapping_enabled<T: Into<bool>>(mut self, v: T) -> Self {
6085 self.0.request.trusted_wrapping_enabled = v.into();
6086 self
6087 }
6088
6089 pub fn set_wrapped_key_material<
6094 T: Into<Option<crate::model::import_crypto_key_version_request::WrappedKeyMaterial>>,
6095 >(
6096 mut self,
6097 v: T,
6098 ) -> Self {
6099 self.0.request.wrapped_key_material = v.into();
6100 self
6101 }
6102
6103 pub fn set_rsa_aes_wrapped_key<T: std::convert::Into<::bytes::Bytes>>(
6109 mut self,
6110 v: T,
6111 ) -> Self {
6112 self.0.request = self.0.request.set_rsa_aes_wrapped_key(v);
6113 self
6114 }
6115 }
6116
6117 #[doc(hidden)]
6118 impl crate::RequestBuilder for ImportCryptoKeyVersion {
6119 fn request_options(&mut self) -> &mut crate::RequestOptions {
6120 &mut self.0.options
6121 }
6122 }
6123
6124 #[derive(Clone, Debug)]
6141 pub struct ImportTrustedKeyWrappedCryptoKeyVersion(
6142 RequestBuilder<crate::model::ImportTrustedKeyWrappedCryptoKeyVersionRequest>,
6143 );
6144
6145 impl ImportTrustedKeyWrappedCryptoKeyVersion {
6146 pub(crate) fn new(
6147 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6148 ) -> Self {
6149 Self(RequestBuilder::new(stub))
6150 }
6151
6152 pub fn with_request<
6154 V: Into<crate::model::ImportTrustedKeyWrappedCryptoKeyVersionRequest>,
6155 >(
6156 mut self,
6157 v: V,
6158 ) -> Self {
6159 self.0.request = v.into();
6160 self
6161 }
6162
6163 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6165 self.0.options = v.into();
6166 self
6167 }
6168
6169 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6171 (*self.0.stub)
6172 .import_trusted_key_wrapped_crypto_key_version(self.0.request, self.0.options)
6173 .await
6174 .map(crate::Response::into_body)
6175 }
6176
6177 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6181 self.0.request.parent = v.into();
6182 self
6183 }
6184
6185 pub fn set_importing_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
6189 self.0.request.importing_key = v.into();
6190 self
6191 }
6192
6193 pub fn set_crypto_key_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
6195 self.0.request.crypto_key_version = v.into();
6196 self
6197 }
6198
6199 pub fn set_wrapped_key<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6203 self.0.request.wrapped_key = v.into();
6204 self
6205 }
6206
6207 pub fn set_algorithm<
6211 T: Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
6212 >(
6213 mut self,
6214 v: T,
6215 ) -> Self {
6216 self.0.request.algorithm = v.into();
6217 self
6218 }
6219 }
6220
6221 #[doc(hidden)]
6222 impl crate::RequestBuilder for ImportTrustedKeyWrappedCryptoKeyVersion {
6223 fn request_options(&mut self) -> &mut crate::RequestOptions {
6224 &mut self.0.options
6225 }
6226 }
6227
6228 #[derive(Clone, Debug)]
6245 pub struct ExportTrustedKeyWrappedCryptoKeyVersion(
6246 RequestBuilder<crate::model::ExportTrustedKeyWrappedCryptoKeyVersionRequest>,
6247 );
6248
6249 impl ExportTrustedKeyWrappedCryptoKeyVersion {
6250 pub(crate) fn new(
6251 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6252 ) -> Self {
6253 Self(RequestBuilder::new(stub))
6254 }
6255
6256 pub fn with_request<
6258 V: Into<crate::model::ExportTrustedKeyWrappedCryptoKeyVersionRequest>,
6259 >(
6260 mut self,
6261 v: V,
6262 ) -> Self {
6263 self.0.request = v.into();
6264 self
6265 }
6266
6267 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6269 self.0.options = v.into();
6270 self
6271 }
6272
6273 pub async fn send(
6275 self,
6276 ) -> Result<crate::model::ExportTrustedKeyWrappedCryptoKeyVersionResponse> {
6277 (*self.0.stub)
6278 .export_trusted_key_wrapped_crypto_key_version(self.0.request, self.0.options)
6279 .await
6280 .map(crate::Response::into_body)
6281 }
6282
6283 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6287 self.0.request.name = v.into();
6288 self
6289 }
6290
6291 pub fn set_wrapping_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
6295 self.0.request.wrapping_key = v.into();
6296 self
6297 }
6298 }
6299
6300 #[doc(hidden)]
6301 impl crate::RequestBuilder for ExportTrustedKeyWrappedCryptoKeyVersion {
6302 fn request_options(&mut self) -> &mut crate::RequestOptions {
6303 &mut self.0.options
6304 }
6305 }
6306
6307 #[derive(Clone, Debug)]
6324 pub struct CreateImportJob(RequestBuilder<crate::model::CreateImportJobRequest>);
6325
6326 impl CreateImportJob {
6327 pub(crate) fn new(
6328 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6329 ) -> Self {
6330 Self(RequestBuilder::new(stub))
6331 }
6332
6333 pub fn with_request<V: Into<crate::model::CreateImportJobRequest>>(mut self, v: V) -> Self {
6335 self.0.request = v.into();
6336 self
6337 }
6338
6339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6341 self.0.options = v.into();
6342 self
6343 }
6344
6345 pub async fn send(self) -> Result<crate::model::ImportJob> {
6347 (*self.0.stub)
6348 .create_import_job(self.0.request, self.0.options)
6349 .await
6350 .map(crate::Response::into_body)
6351 }
6352
6353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6357 self.0.request.parent = v.into();
6358 self
6359 }
6360
6361 pub fn set_import_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6365 self.0.request.import_job_id = v.into();
6366 self
6367 }
6368
6369 pub fn set_import_job<T>(mut self, v: T) -> Self
6373 where
6374 T: std::convert::Into<crate::model::ImportJob>,
6375 {
6376 self.0.request.import_job = std::option::Option::Some(v.into());
6377 self
6378 }
6379
6380 pub fn set_or_clear_import_job<T>(mut self, v: std::option::Option<T>) -> Self
6384 where
6385 T: std::convert::Into<crate::model::ImportJob>,
6386 {
6387 self.0.request.import_job = v.map(|x| x.into());
6388 self
6389 }
6390 }
6391
6392 #[doc(hidden)]
6393 impl crate::RequestBuilder for CreateImportJob {
6394 fn request_options(&mut self) -> &mut crate::RequestOptions {
6395 &mut self.0.options
6396 }
6397 }
6398
6399 #[derive(Clone, Debug)]
6416 pub struct UpdateCryptoKey(RequestBuilder<crate::model::UpdateCryptoKeyRequest>);
6417
6418 impl UpdateCryptoKey {
6419 pub(crate) fn new(
6420 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6421 ) -> Self {
6422 Self(RequestBuilder::new(stub))
6423 }
6424
6425 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyRequest>>(mut self, v: V) -> Self {
6427 self.0.request = v.into();
6428 self
6429 }
6430
6431 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6433 self.0.options = v.into();
6434 self
6435 }
6436
6437 pub async fn send(self) -> Result<crate::model::CryptoKey> {
6439 (*self.0.stub)
6440 .update_crypto_key(self.0.request, self.0.options)
6441 .await
6442 .map(crate::Response::into_body)
6443 }
6444
6445 pub fn set_crypto_key<T>(mut self, v: T) -> Self
6449 where
6450 T: std::convert::Into<crate::model::CryptoKey>,
6451 {
6452 self.0.request.crypto_key = std::option::Option::Some(v.into());
6453 self
6454 }
6455
6456 pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
6460 where
6461 T: std::convert::Into<crate::model::CryptoKey>,
6462 {
6463 self.0.request.crypto_key = v.map(|x| x.into());
6464 self
6465 }
6466
6467 pub fn set_update_mask<T>(mut self, v: T) -> Self
6471 where
6472 T: std::convert::Into<wkt::FieldMask>,
6473 {
6474 self.0.request.update_mask = std::option::Option::Some(v.into());
6475 self
6476 }
6477
6478 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6482 where
6483 T: std::convert::Into<wkt::FieldMask>,
6484 {
6485 self.0.request.update_mask = v.map(|x| x.into());
6486 self
6487 }
6488 }
6489
6490 #[doc(hidden)]
6491 impl crate::RequestBuilder for UpdateCryptoKey {
6492 fn request_options(&mut self) -> &mut crate::RequestOptions {
6493 &mut self.0.options
6494 }
6495 }
6496
6497 #[derive(Clone, Debug)]
6514 pub struct UpdateCryptoKeyVersion(RequestBuilder<crate::model::UpdateCryptoKeyVersionRequest>);
6515
6516 impl UpdateCryptoKeyVersion {
6517 pub(crate) fn new(
6518 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6519 ) -> Self {
6520 Self(RequestBuilder::new(stub))
6521 }
6522
6523 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyVersionRequest>>(
6525 mut self,
6526 v: V,
6527 ) -> Self {
6528 self.0.request = v.into();
6529 self
6530 }
6531
6532 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6534 self.0.options = v.into();
6535 self
6536 }
6537
6538 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6540 (*self.0.stub)
6541 .update_crypto_key_version(self.0.request, self.0.options)
6542 .await
6543 .map(crate::Response::into_body)
6544 }
6545
6546 pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
6550 where
6551 T: std::convert::Into<crate::model::CryptoKeyVersion>,
6552 {
6553 self.0.request.crypto_key_version = std::option::Option::Some(v.into());
6554 self
6555 }
6556
6557 pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
6561 where
6562 T: std::convert::Into<crate::model::CryptoKeyVersion>,
6563 {
6564 self.0.request.crypto_key_version = v.map(|x| x.into());
6565 self
6566 }
6567
6568 pub fn set_update_mask<T>(mut self, v: T) -> Self
6572 where
6573 T: std::convert::Into<wkt::FieldMask>,
6574 {
6575 self.0.request.update_mask = std::option::Option::Some(v.into());
6576 self
6577 }
6578
6579 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6583 where
6584 T: std::convert::Into<wkt::FieldMask>,
6585 {
6586 self.0.request.update_mask = v.map(|x| x.into());
6587 self
6588 }
6589 }
6590
6591 #[doc(hidden)]
6592 impl crate::RequestBuilder for UpdateCryptoKeyVersion {
6593 fn request_options(&mut self) -> &mut crate::RequestOptions {
6594 &mut self.0.options
6595 }
6596 }
6597
6598 #[derive(Clone, Debug)]
6615 pub struct UpdateCryptoKeyPrimaryVersion(
6616 RequestBuilder<crate::model::UpdateCryptoKeyPrimaryVersionRequest>,
6617 );
6618
6619 impl UpdateCryptoKeyPrimaryVersion {
6620 pub(crate) fn new(
6621 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6622 ) -> Self {
6623 Self(RequestBuilder::new(stub))
6624 }
6625
6626 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyPrimaryVersionRequest>>(
6628 mut self,
6629 v: V,
6630 ) -> Self {
6631 self.0.request = v.into();
6632 self
6633 }
6634
6635 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6637 self.0.options = v.into();
6638 self
6639 }
6640
6641 pub async fn send(self) -> Result<crate::model::CryptoKey> {
6643 (*self.0.stub)
6644 .update_crypto_key_primary_version(self.0.request, self.0.options)
6645 .await
6646 .map(crate::Response::into_body)
6647 }
6648
6649 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6653 self.0.request.name = v.into();
6654 self
6655 }
6656
6657 pub fn set_crypto_key_version_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6661 self.0.request.crypto_key_version_id = v.into();
6662 self
6663 }
6664 }
6665
6666 #[doc(hidden)]
6667 impl crate::RequestBuilder for UpdateCryptoKeyPrimaryVersion {
6668 fn request_options(&mut self) -> &mut crate::RequestOptions {
6669 &mut self.0.options
6670 }
6671 }
6672
6673 #[derive(Clone, Debug)]
6690 pub struct DestroyCryptoKeyVersion(
6691 RequestBuilder<crate::model::DestroyCryptoKeyVersionRequest>,
6692 );
6693
6694 impl DestroyCryptoKeyVersion {
6695 pub(crate) fn new(
6696 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6697 ) -> Self {
6698 Self(RequestBuilder::new(stub))
6699 }
6700
6701 pub fn with_request<V: Into<crate::model::DestroyCryptoKeyVersionRequest>>(
6703 mut self,
6704 v: V,
6705 ) -> Self {
6706 self.0.request = v.into();
6707 self
6708 }
6709
6710 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6712 self.0.options = v.into();
6713 self
6714 }
6715
6716 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6718 (*self.0.stub)
6719 .destroy_crypto_key_version(self.0.request, self.0.options)
6720 .await
6721 .map(crate::Response::into_body)
6722 }
6723
6724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6728 self.0.request.name = v.into();
6729 self
6730 }
6731 }
6732
6733 #[doc(hidden)]
6734 impl crate::RequestBuilder for DestroyCryptoKeyVersion {
6735 fn request_options(&mut self) -> &mut crate::RequestOptions {
6736 &mut self.0.options
6737 }
6738 }
6739
6740 #[derive(Clone, Debug)]
6757 pub struct RestoreCryptoKeyVersion(
6758 RequestBuilder<crate::model::RestoreCryptoKeyVersionRequest>,
6759 );
6760
6761 impl RestoreCryptoKeyVersion {
6762 pub(crate) fn new(
6763 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6764 ) -> Self {
6765 Self(RequestBuilder::new(stub))
6766 }
6767
6768 pub fn with_request<V: Into<crate::model::RestoreCryptoKeyVersionRequest>>(
6770 mut self,
6771 v: V,
6772 ) -> Self {
6773 self.0.request = v.into();
6774 self
6775 }
6776
6777 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6779 self.0.options = v.into();
6780 self
6781 }
6782
6783 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6785 (*self.0.stub)
6786 .restore_crypto_key_version(self.0.request, self.0.options)
6787 .await
6788 .map(crate::Response::into_body)
6789 }
6790
6791 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6795 self.0.request.name = v.into();
6796 self
6797 }
6798 }
6799
6800 #[doc(hidden)]
6801 impl crate::RequestBuilder for RestoreCryptoKeyVersion {
6802 fn request_options(&mut self) -> &mut crate::RequestOptions {
6803 &mut self.0.options
6804 }
6805 }
6806
6807 #[derive(Clone, Debug)]
6824 pub struct Encrypt(RequestBuilder<crate::model::EncryptRequest>);
6825
6826 impl Encrypt {
6827 pub(crate) fn new(
6828 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6829 ) -> Self {
6830 Self(RequestBuilder::new(stub))
6831 }
6832
6833 pub fn with_request<V: Into<crate::model::EncryptRequest>>(mut self, v: V) -> Self {
6835 self.0.request = v.into();
6836 self
6837 }
6838
6839 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6841 self.0.options = v.into();
6842 self
6843 }
6844
6845 pub async fn send(self) -> Result<crate::model::EncryptResponse> {
6847 (*self.0.stub)
6848 .encrypt(self.0.request, self.0.options)
6849 .await
6850 .map(crate::Response::into_body)
6851 }
6852
6853 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6857 self.0.request.name = v.into();
6858 self
6859 }
6860
6861 pub fn set_plaintext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6865 self.0.request.plaintext = v.into();
6866 self
6867 }
6868
6869 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6871 self.0.request.additional_authenticated_data = v.into();
6872 self
6873 }
6874
6875 pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
6877 where
6878 T: std::convert::Into<wkt::Int64Value>,
6879 {
6880 self.0.request.plaintext_crc32c = std::option::Option::Some(v.into());
6881 self
6882 }
6883
6884 pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6886 where
6887 T: std::convert::Into<wkt::Int64Value>,
6888 {
6889 self.0.request.plaintext_crc32c = v.map(|x| x.into());
6890 self
6891 }
6892
6893 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
6895 where
6896 T: std::convert::Into<wkt::Int64Value>,
6897 {
6898 self.0.request.additional_authenticated_data_crc32c =
6899 std::option::Option::Some(v.into());
6900 self
6901 }
6902
6903 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
6905 mut self,
6906 v: std::option::Option<T>,
6907 ) -> Self
6908 where
6909 T: std::convert::Into<wkt::Int64Value>,
6910 {
6911 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
6912 self
6913 }
6914 }
6915
6916 #[doc(hidden)]
6917 impl crate::RequestBuilder for Encrypt {
6918 fn request_options(&mut self) -> &mut crate::RequestOptions {
6919 &mut self.0.options
6920 }
6921 }
6922
6923 #[derive(Clone, Debug)]
6940 pub struct Decrypt(RequestBuilder<crate::model::DecryptRequest>);
6941
6942 impl Decrypt {
6943 pub(crate) fn new(
6944 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6945 ) -> Self {
6946 Self(RequestBuilder::new(stub))
6947 }
6948
6949 pub fn with_request<V: Into<crate::model::DecryptRequest>>(mut self, v: V) -> Self {
6951 self.0.request = v.into();
6952 self
6953 }
6954
6955 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6957 self.0.options = v.into();
6958 self
6959 }
6960
6961 pub async fn send(self) -> Result<crate::model::DecryptResponse> {
6963 (*self.0.stub)
6964 .decrypt(self.0.request, self.0.options)
6965 .await
6966 .map(crate::Response::into_body)
6967 }
6968
6969 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6973 self.0.request.name = v.into();
6974 self
6975 }
6976
6977 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6981 self.0.request.ciphertext = v.into();
6982 self
6983 }
6984
6985 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6987 self.0.request.additional_authenticated_data = v.into();
6988 self
6989 }
6990
6991 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
6993 where
6994 T: std::convert::Into<wkt::Int64Value>,
6995 {
6996 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
6997 self
6998 }
6999
7000 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7002 where
7003 T: std::convert::Into<wkt::Int64Value>,
7004 {
7005 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
7006 self
7007 }
7008
7009 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
7011 where
7012 T: std::convert::Into<wkt::Int64Value>,
7013 {
7014 self.0.request.additional_authenticated_data_crc32c =
7015 std::option::Option::Some(v.into());
7016 self
7017 }
7018
7019 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
7021 mut self,
7022 v: std::option::Option<T>,
7023 ) -> Self
7024 where
7025 T: std::convert::Into<wkt::Int64Value>,
7026 {
7027 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
7028 self
7029 }
7030 }
7031
7032 #[doc(hidden)]
7033 impl crate::RequestBuilder for Decrypt {
7034 fn request_options(&mut self) -> &mut crate::RequestOptions {
7035 &mut self.0.options
7036 }
7037 }
7038
7039 #[derive(Clone, Debug)]
7056 pub struct RawEncrypt(RequestBuilder<crate::model::RawEncryptRequest>);
7057
7058 impl RawEncrypt {
7059 pub(crate) fn new(
7060 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7061 ) -> Self {
7062 Self(RequestBuilder::new(stub))
7063 }
7064
7065 pub fn with_request<V: Into<crate::model::RawEncryptRequest>>(mut self, v: V) -> Self {
7067 self.0.request = v.into();
7068 self
7069 }
7070
7071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7073 self.0.options = v.into();
7074 self
7075 }
7076
7077 pub async fn send(self) -> Result<crate::model::RawEncryptResponse> {
7079 (*self.0.stub)
7080 .raw_encrypt(self.0.request, self.0.options)
7081 .await
7082 .map(crate::Response::into_body)
7083 }
7084
7085 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7089 self.0.request.name = v.into();
7090 self
7091 }
7092
7093 pub fn set_plaintext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7097 self.0.request.plaintext = v.into();
7098 self
7099 }
7100
7101 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7103 self.0.request.additional_authenticated_data = v.into();
7104 self
7105 }
7106
7107 pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
7109 where
7110 T: std::convert::Into<wkt::Int64Value>,
7111 {
7112 self.0.request.plaintext_crc32c = std::option::Option::Some(v.into());
7113 self
7114 }
7115
7116 pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7118 where
7119 T: std::convert::Into<wkt::Int64Value>,
7120 {
7121 self.0.request.plaintext_crc32c = v.map(|x| x.into());
7122 self
7123 }
7124
7125 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
7127 where
7128 T: std::convert::Into<wkt::Int64Value>,
7129 {
7130 self.0.request.additional_authenticated_data_crc32c =
7131 std::option::Option::Some(v.into());
7132 self
7133 }
7134
7135 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
7137 mut self,
7138 v: std::option::Option<T>,
7139 ) -> Self
7140 where
7141 T: std::convert::Into<wkt::Int64Value>,
7142 {
7143 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
7144 self
7145 }
7146
7147 pub fn set_initialization_vector<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7149 self.0.request.initialization_vector = v.into();
7150 self
7151 }
7152
7153 pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
7155 where
7156 T: std::convert::Into<wkt::Int64Value>,
7157 {
7158 self.0.request.initialization_vector_crc32c = std::option::Option::Some(v.into());
7159 self
7160 }
7161
7162 pub fn set_or_clear_initialization_vector_crc32c<T>(
7164 mut self,
7165 v: std::option::Option<T>,
7166 ) -> Self
7167 where
7168 T: std::convert::Into<wkt::Int64Value>,
7169 {
7170 self.0.request.initialization_vector_crc32c = v.map(|x| x.into());
7171 self
7172 }
7173 }
7174
7175 #[doc(hidden)]
7176 impl crate::RequestBuilder for RawEncrypt {
7177 fn request_options(&mut self) -> &mut crate::RequestOptions {
7178 &mut self.0.options
7179 }
7180 }
7181
7182 #[derive(Clone, Debug)]
7199 pub struct RawDecrypt(RequestBuilder<crate::model::RawDecryptRequest>);
7200
7201 impl RawDecrypt {
7202 pub(crate) fn new(
7203 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7204 ) -> Self {
7205 Self(RequestBuilder::new(stub))
7206 }
7207
7208 pub fn with_request<V: Into<crate::model::RawDecryptRequest>>(mut self, v: V) -> Self {
7210 self.0.request = v.into();
7211 self
7212 }
7213
7214 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7216 self.0.options = v.into();
7217 self
7218 }
7219
7220 pub async fn send(self) -> Result<crate::model::RawDecryptResponse> {
7222 (*self.0.stub)
7223 .raw_decrypt(self.0.request, self.0.options)
7224 .await
7225 .map(crate::Response::into_body)
7226 }
7227
7228 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7232 self.0.request.name = v.into();
7233 self
7234 }
7235
7236 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7240 self.0.request.ciphertext = v.into();
7241 self
7242 }
7243
7244 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7246 self.0.request.additional_authenticated_data = v.into();
7247 self
7248 }
7249
7250 pub fn set_initialization_vector<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7254 self.0.request.initialization_vector = v.into();
7255 self
7256 }
7257
7258 pub fn set_tag_length<T: Into<i32>>(mut self, v: T) -> Self {
7260 self.0.request.tag_length = v.into();
7261 self
7262 }
7263
7264 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
7266 where
7267 T: std::convert::Into<wkt::Int64Value>,
7268 {
7269 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
7270 self
7271 }
7272
7273 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7275 where
7276 T: std::convert::Into<wkt::Int64Value>,
7277 {
7278 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
7279 self
7280 }
7281
7282 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
7284 where
7285 T: std::convert::Into<wkt::Int64Value>,
7286 {
7287 self.0.request.additional_authenticated_data_crc32c =
7288 std::option::Option::Some(v.into());
7289 self
7290 }
7291
7292 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
7294 mut self,
7295 v: std::option::Option<T>,
7296 ) -> Self
7297 where
7298 T: std::convert::Into<wkt::Int64Value>,
7299 {
7300 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
7301 self
7302 }
7303
7304 pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
7306 where
7307 T: std::convert::Into<wkt::Int64Value>,
7308 {
7309 self.0.request.initialization_vector_crc32c = std::option::Option::Some(v.into());
7310 self
7311 }
7312
7313 pub fn set_or_clear_initialization_vector_crc32c<T>(
7315 mut self,
7316 v: std::option::Option<T>,
7317 ) -> Self
7318 where
7319 T: std::convert::Into<wkt::Int64Value>,
7320 {
7321 self.0.request.initialization_vector_crc32c = v.map(|x| x.into());
7322 self
7323 }
7324 }
7325
7326 #[doc(hidden)]
7327 impl crate::RequestBuilder for RawDecrypt {
7328 fn request_options(&mut self) -> &mut crate::RequestOptions {
7329 &mut self.0.options
7330 }
7331 }
7332
7333 #[derive(Clone, Debug)]
7350 pub struct AsymmetricSign(RequestBuilder<crate::model::AsymmetricSignRequest>);
7351
7352 impl AsymmetricSign {
7353 pub(crate) fn new(
7354 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7355 ) -> Self {
7356 Self(RequestBuilder::new(stub))
7357 }
7358
7359 pub fn with_request<V: Into<crate::model::AsymmetricSignRequest>>(mut self, v: V) -> Self {
7361 self.0.request = v.into();
7362 self
7363 }
7364
7365 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7367 self.0.options = v.into();
7368 self
7369 }
7370
7371 pub async fn send(self) -> Result<crate::model::AsymmetricSignResponse> {
7373 (*self.0.stub)
7374 .asymmetric_sign(self.0.request, self.0.options)
7375 .await
7376 .map(crate::Response::into_body)
7377 }
7378
7379 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7383 self.0.request.name = v.into();
7384 self
7385 }
7386
7387 pub fn set_digest<T>(mut self, v: T) -> Self
7389 where
7390 T: std::convert::Into<crate::model::Digest>,
7391 {
7392 self.0.request.digest = std::option::Option::Some(v.into());
7393 self
7394 }
7395
7396 pub fn set_or_clear_digest<T>(mut self, v: std::option::Option<T>) -> Self
7398 where
7399 T: std::convert::Into<crate::model::Digest>,
7400 {
7401 self.0.request.digest = v.map(|x| x.into());
7402 self
7403 }
7404
7405 pub fn set_digest_crc32c<T>(mut self, v: T) -> Self
7407 where
7408 T: std::convert::Into<wkt::Int64Value>,
7409 {
7410 self.0.request.digest_crc32c = std::option::Option::Some(v.into());
7411 self
7412 }
7413
7414 pub fn set_or_clear_digest_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7416 where
7417 T: std::convert::Into<wkt::Int64Value>,
7418 {
7419 self.0.request.digest_crc32c = v.map(|x| x.into());
7420 self
7421 }
7422
7423 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7425 self.0.request.data = v.into();
7426 self
7427 }
7428
7429 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
7431 where
7432 T: std::convert::Into<wkt::Int64Value>,
7433 {
7434 self.0.request.data_crc32c = std::option::Option::Some(v.into());
7435 self
7436 }
7437
7438 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7440 where
7441 T: std::convert::Into<wkt::Int64Value>,
7442 {
7443 self.0.request.data_crc32c = v.map(|x| x.into());
7444 self
7445 }
7446 }
7447
7448 #[doc(hidden)]
7449 impl crate::RequestBuilder for AsymmetricSign {
7450 fn request_options(&mut self) -> &mut crate::RequestOptions {
7451 &mut self.0.options
7452 }
7453 }
7454
7455 #[derive(Clone, Debug)]
7472 pub struct AsymmetricDecrypt(RequestBuilder<crate::model::AsymmetricDecryptRequest>);
7473
7474 impl AsymmetricDecrypt {
7475 pub(crate) fn new(
7476 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7477 ) -> Self {
7478 Self(RequestBuilder::new(stub))
7479 }
7480
7481 pub fn with_request<V: Into<crate::model::AsymmetricDecryptRequest>>(
7483 mut self,
7484 v: V,
7485 ) -> Self {
7486 self.0.request = v.into();
7487 self
7488 }
7489
7490 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7492 self.0.options = v.into();
7493 self
7494 }
7495
7496 pub async fn send(self) -> Result<crate::model::AsymmetricDecryptResponse> {
7498 (*self.0.stub)
7499 .asymmetric_decrypt(self.0.request, self.0.options)
7500 .await
7501 .map(crate::Response::into_body)
7502 }
7503
7504 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7508 self.0.request.name = v.into();
7509 self
7510 }
7511
7512 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7516 self.0.request.ciphertext = v.into();
7517 self
7518 }
7519
7520 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
7522 where
7523 T: std::convert::Into<wkt::Int64Value>,
7524 {
7525 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
7526 self
7527 }
7528
7529 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7531 where
7532 T: std::convert::Into<wkt::Int64Value>,
7533 {
7534 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
7535 self
7536 }
7537 }
7538
7539 #[doc(hidden)]
7540 impl crate::RequestBuilder for AsymmetricDecrypt {
7541 fn request_options(&mut self) -> &mut crate::RequestOptions {
7542 &mut self.0.options
7543 }
7544 }
7545
7546 #[derive(Clone, Debug)]
7563 pub struct MacSign(RequestBuilder<crate::model::MacSignRequest>);
7564
7565 impl MacSign {
7566 pub(crate) fn new(
7567 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7568 ) -> Self {
7569 Self(RequestBuilder::new(stub))
7570 }
7571
7572 pub fn with_request<V: Into<crate::model::MacSignRequest>>(mut self, v: V) -> Self {
7574 self.0.request = v.into();
7575 self
7576 }
7577
7578 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7580 self.0.options = v.into();
7581 self
7582 }
7583
7584 pub async fn send(self) -> Result<crate::model::MacSignResponse> {
7586 (*self.0.stub)
7587 .mac_sign(self.0.request, self.0.options)
7588 .await
7589 .map(crate::Response::into_body)
7590 }
7591
7592 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7596 self.0.request.name = v.into();
7597 self
7598 }
7599
7600 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7604 self.0.request.data = v.into();
7605 self
7606 }
7607
7608 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
7610 where
7611 T: std::convert::Into<wkt::Int64Value>,
7612 {
7613 self.0.request.data_crc32c = std::option::Option::Some(v.into());
7614 self
7615 }
7616
7617 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7619 where
7620 T: std::convert::Into<wkt::Int64Value>,
7621 {
7622 self.0.request.data_crc32c = v.map(|x| x.into());
7623 self
7624 }
7625 }
7626
7627 #[doc(hidden)]
7628 impl crate::RequestBuilder for MacSign {
7629 fn request_options(&mut self) -> &mut crate::RequestOptions {
7630 &mut self.0.options
7631 }
7632 }
7633
7634 #[derive(Clone, Debug)]
7651 pub struct MacVerify(RequestBuilder<crate::model::MacVerifyRequest>);
7652
7653 impl MacVerify {
7654 pub(crate) fn new(
7655 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7656 ) -> Self {
7657 Self(RequestBuilder::new(stub))
7658 }
7659
7660 pub fn with_request<V: Into<crate::model::MacVerifyRequest>>(mut self, v: V) -> Self {
7662 self.0.request = v.into();
7663 self
7664 }
7665
7666 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7668 self.0.options = v.into();
7669 self
7670 }
7671
7672 pub async fn send(self) -> Result<crate::model::MacVerifyResponse> {
7674 (*self.0.stub)
7675 .mac_verify(self.0.request, self.0.options)
7676 .await
7677 .map(crate::Response::into_body)
7678 }
7679
7680 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7684 self.0.request.name = v.into();
7685 self
7686 }
7687
7688 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7692 self.0.request.data = v.into();
7693 self
7694 }
7695
7696 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
7698 where
7699 T: std::convert::Into<wkt::Int64Value>,
7700 {
7701 self.0.request.data_crc32c = std::option::Option::Some(v.into());
7702 self
7703 }
7704
7705 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7707 where
7708 T: std::convert::Into<wkt::Int64Value>,
7709 {
7710 self.0.request.data_crc32c = v.map(|x| x.into());
7711 self
7712 }
7713
7714 pub fn set_mac<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7718 self.0.request.mac = v.into();
7719 self
7720 }
7721
7722 pub fn set_mac_crc32c<T>(mut self, v: T) -> Self
7724 where
7725 T: std::convert::Into<wkt::Int64Value>,
7726 {
7727 self.0.request.mac_crc32c = std::option::Option::Some(v.into());
7728 self
7729 }
7730
7731 pub fn set_or_clear_mac_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7733 where
7734 T: std::convert::Into<wkt::Int64Value>,
7735 {
7736 self.0.request.mac_crc32c = v.map(|x| x.into());
7737 self
7738 }
7739 }
7740
7741 #[doc(hidden)]
7742 impl crate::RequestBuilder for MacVerify {
7743 fn request_options(&mut self) -> &mut crate::RequestOptions {
7744 &mut self.0.options
7745 }
7746 }
7747
7748 #[derive(Clone, Debug)]
7765 pub struct Decapsulate(RequestBuilder<crate::model::DecapsulateRequest>);
7766
7767 impl Decapsulate {
7768 pub(crate) fn new(
7769 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7770 ) -> Self {
7771 Self(RequestBuilder::new(stub))
7772 }
7773
7774 pub fn with_request<V: Into<crate::model::DecapsulateRequest>>(mut self, v: V) -> Self {
7776 self.0.request = v.into();
7777 self
7778 }
7779
7780 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7782 self.0.options = v.into();
7783 self
7784 }
7785
7786 pub async fn send(self) -> Result<crate::model::DecapsulateResponse> {
7788 (*self.0.stub)
7789 .decapsulate(self.0.request, self.0.options)
7790 .await
7791 .map(crate::Response::into_body)
7792 }
7793
7794 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7798 self.0.request.name = v.into();
7799 self
7800 }
7801
7802 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7806 self.0.request.ciphertext = v.into();
7807 self
7808 }
7809
7810 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
7812 where
7813 T: std::convert::Into<wkt::Int64Value>,
7814 {
7815 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
7816 self
7817 }
7818
7819 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7821 where
7822 T: std::convert::Into<wkt::Int64Value>,
7823 {
7824 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
7825 self
7826 }
7827 }
7828
7829 #[doc(hidden)]
7830 impl crate::RequestBuilder for Decapsulate {
7831 fn request_options(&mut self) -> &mut crate::RequestOptions {
7832 &mut self.0.options
7833 }
7834 }
7835
7836 #[derive(Clone, Debug)]
7853 pub struct GenerateRandomBytes(RequestBuilder<crate::model::GenerateRandomBytesRequest>);
7854
7855 impl GenerateRandomBytes {
7856 pub(crate) fn new(
7857 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7858 ) -> Self {
7859 Self(RequestBuilder::new(stub))
7860 }
7861
7862 pub fn with_request<V: Into<crate::model::GenerateRandomBytesRequest>>(
7864 mut self,
7865 v: V,
7866 ) -> Self {
7867 self.0.request = v.into();
7868 self
7869 }
7870
7871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7873 self.0.options = v.into();
7874 self
7875 }
7876
7877 pub async fn send(self) -> Result<crate::model::GenerateRandomBytesResponse> {
7879 (*self.0.stub)
7880 .generate_random_bytes(self.0.request, self.0.options)
7881 .await
7882 .map(crate::Response::into_body)
7883 }
7884
7885 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7887 self.0.request.location = v.into();
7888 self
7889 }
7890
7891 pub fn set_length_bytes<T: Into<i32>>(mut self, v: T) -> Self {
7893 self.0.request.length_bytes = v.into();
7894 self
7895 }
7896
7897 pub fn set_protection_level<T: Into<crate::model::ProtectionLevel>>(
7899 mut self,
7900 v: T,
7901 ) -> Self {
7902 self.0.request.protection_level = v.into();
7903 self
7904 }
7905 }
7906
7907 #[doc(hidden)]
7908 impl crate::RequestBuilder for GenerateRandomBytes {
7909 fn request_options(&mut self) -> &mut crate::RequestOptions {
7910 &mut self.0.options
7911 }
7912 }
7913
7914 #[derive(Clone, Debug)]
7935 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7936
7937 impl ListLocations {
7938 pub(crate) fn new(
7939 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7940 ) -> Self {
7941 Self(RequestBuilder::new(stub))
7942 }
7943
7944 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7946 mut self,
7947 v: V,
7948 ) -> Self {
7949 self.0.request = v.into();
7950 self
7951 }
7952
7953 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7955 self.0.options = v.into();
7956 self
7957 }
7958
7959 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7961 (*self.0.stub)
7962 .list_locations(self.0.request, self.0.options)
7963 .await
7964 .map(crate::Response::into_body)
7965 }
7966
7967 pub fn by_page(
7969 self,
7970 ) -> impl google_cloud_gax::paginator::Paginator<
7971 google_cloud_location::model::ListLocationsResponse,
7972 crate::Error,
7973 > {
7974 use std::clone::Clone;
7975 let token = self.0.request.page_token.clone();
7976 let execute = move |token: String| {
7977 let mut builder = self.clone();
7978 builder.0.request = builder.0.request.set_page_token(token);
7979 builder.send()
7980 };
7981 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7982 }
7983
7984 pub fn by_item(
7986 self,
7987 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7988 google_cloud_location::model::ListLocationsResponse,
7989 crate::Error,
7990 > {
7991 use google_cloud_gax::paginator::Paginator;
7992 self.by_page().items()
7993 }
7994
7995 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7997 self.0.request.name = v.into();
7998 self
7999 }
8000
8001 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8003 self.0.request.filter = v.into();
8004 self
8005 }
8006
8007 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8009 self.0.request.page_size = v.into();
8010 self
8011 }
8012
8013 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8015 self.0.request.page_token = v.into();
8016 self
8017 }
8018 }
8019
8020 #[doc(hidden)]
8021 impl crate::RequestBuilder for ListLocations {
8022 fn request_options(&mut self) -> &mut crate::RequestOptions {
8023 &mut self.0.options
8024 }
8025 }
8026
8027 #[derive(Clone, Debug)]
8044 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8045
8046 impl GetLocation {
8047 pub(crate) fn new(
8048 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
8049 ) -> Self {
8050 Self(RequestBuilder::new(stub))
8051 }
8052
8053 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8055 mut self,
8056 v: V,
8057 ) -> Self {
8058 self.0.request = v.into();
8059 self
8060 }
8061
8062 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8064 self.0.options = v.into();
8065 self
8066 }
8067
8068 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8070 (*self.0.stub)
8071 .get_location(self.0.request, self.0.options)
8072 .await
8073 .map(crate::Response::into_body)
8074 }
8075
8076 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8078 self.0.request.name = v.into();
8079 self
8080 }
8081 }
8082
8083 #[doc(hidden)]
8084 impl crate::RequestBuilder for GetLocation {
8085 fn request_options(&mut self) -> &mut crate::RequestOptions {
8086 &mut self.0.options
8087 }
8088 }
8089
8090 #[derive(Clone, Debug)]
8107 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8108
8109 impl SetIamPolicy {
8110 pub(crate) fn new(
8111 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
8112 ) -> Self {
8113 Self(RequestBuilder::new(stub))
8114 }
8115
8116 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8118 mut self,
8119 v: V,
8120 ) -> Self {
8121 self.0.request = v.into();
8122 self
8123 }
8124
8125 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8127 self.0.options = v.into();
8128 self
8129 }
8130
8131 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8133 (*self.0.stub)
8134 .set_iam_policy(self.0.request, self.0.options)
8135 .await
8136 .map(crate::Response::into_body)
8137 }
8138
8139 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8143 self.0.request.resource = v.into();
8144 self
8145 }
8146
8147 pub fn set_policy<T>(mut self, v: T) -> Self
8151 where
8152 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8153 {
8154 self.0.request.policy = std::option::Option::Some(v.into());
8155 self
8156 }
8157
8158 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8162 where
8163 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8164 {
8165 self.0.request.policy = v.map(|x| x.into());
8166 self
8167 }
8168
8169 pub fn set_update_mask<T>(mut self, v: T) -> Self
8171 where
8172 T: std::convert::Into<wkt::FieldMask>,
8173 {
8174 self.0.request.update_mask = std::option::Option::Some(v.into());
8175 self
8176 }
8177
8178 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8180 where
8181 T: std::convert::Into<wkt::FieldMask>,
8182 {
8183 self.0.request.update_mask = v.map(|x| x.into());
8184 self
8185 }
8186 }
8187
8188 #[doc(hidden)]
8189 impl crate::RequestBuilder for SetIamPolicy {
8190 fn request_options(&mut self) -> &mut crate::RequestOptions {
8191 &mut self.0.options
8192 }
8193 }
8194
8195 #[derive(Clone, Debug)]
8212 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8213
8214 impl GetIamPolicy {
8215 pub(crate) fn new(
8216 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
8217 ) -> Self {
8218 Self(RequestBuilder::new(stub))
8219 }
8220
8221 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8223 mut self,
8224 v: V,
8225 ) -> Self {
8226 self.0.request = v.into();
8227 self
8228 }
8229
8230 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8232 self.0.options = v.into();
8233 self
8234 }
8235
8236 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8238 (*self.0.stub)
8239 .get_iam_policy(self.0.request, self.0.options)
8240 .await
8241 .map(crate::Response::into_body)
8242 }
8243
8244 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8248 self.0.request.resource = v.into();
8249 self
8250 }
8251
8252 pub fn set_options<T>(mut self, v: T) -> Self
8254 where
8255 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8256 {
8257 self.0.request.options = std::option::Option::Some(v.into());
8258 self
8259 }
8260
8261 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8263 where
8264 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8265 {
8266 self.0.request.options = v.map(|x| x.into());
8267 self
8268 }
8269 }
8270
8271 #[doc(hidden)]
8272 impl crate::RequestBuilder for GetIamPolicy {
8273 fn request_options(&mut self) -> &mut crate::RequestOptions {
8274 &mut self.0.options
8275 }
8276 }
8277
8278 #[derive(Clone, Debug)]
8295 pub struct TestIamPermissions(
8296 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8297 );
8298
8299 impl TestIamPermissions {
8300 pub(crate) fn new(
8301 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
8302 ) -> Self {
8303 Self(RequestBuilder::new(stub))
8304 }
8305
8306 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8308 mut self,
8309 v: V,
8310 ) -> Self {
8311 self.0.request = v.into();
8312 self
8313 }
8314
8315 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8317 self.0.options = v.into();
8318 self
8319 }
8320
8321 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8323 (*self.0.stub)
8324 .test_iam_permissions(self.0.request, self.0.options)
8325 .await
8326 .map(crate::Response::into_body)
8327 }
8328
8329 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8333 self.0.request.resource = v.into();
8334 self
8335 }
8336
8337 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8341 where
8342 T: std::iter::IntoIterator<Item = V>,
8343 V: std::convert::Into<std::string::String>,
8344 {
8345 use std::iter::Iterator;
8346 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8347 self
8348 }
8349 }
8350
8351 #[doc(hidden)]
8352 impl crate::RequestBuilder for TestIamPermissions {
8353 fn request_options(&mut self) -> &mut crate::RequestOptions {
8354 &mut self.0.options
8355 }
8356 }
8357
8358 #[derive(Clone, Debug)]
8375 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8376
8377 impl GetOperation {
8378 pub(crate) fn new(
8379 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
8380 ) -> Self {
8381 Self(RequestBuilder::new(stub))
8382 }
8383
8384 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8386 mut self,
8387 v: V,
8388 ) -> Self {
8389 self.0.request = v.into();
8390 self
8391 }
8392
8393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8395 self.0.options = v.into();
8396 self
8397 }
8398
8399 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8401 (*self.0.stub)
8402 .get_operation(self.0.request, self.0.options)
8403 .await
8404 .map(crate::Response::into_body)
8405 }
8406
8407 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8409 self.0.request.name = v.into();
8410 self
8411 }
8412 }
8413
8414 #[doc(hidden)]
8415 impl crate::RequestBuilder for GetOperation {
8416 fn request_options(&mut self) -> &mut crate::RequestOptions {
8417 &mut self.0.options
8418 }
8419 }
8420}