1pub mod autokey {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Autokey;
38 pub struct Factory;
39 impl gax::client_builder::internal::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 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: gax::options::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<gax::options::RequestOptions>>(mut self, v: V) -> Self {
105 self.0.options = v.into();
106 self
107 }
108
109 pub async fn send(self) -> Result<longrunning::model::Operation> {
116 (*self.0.stub)
117 .create_key_handle(self.0.request, self.0.options)
118 .await
119 .map(gax::response::Response::into_body)
120 }
121
122 pub fn poller(
124 self,
125 ) -> impl lro::Poller<crate::model::KeyHandle, crate::model::CreateKeyHandleMetadata>
126 {
127 type Operation = 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
134 let stub = self.0.stub.clone();
135 let mut options = self.0.options.clone();
136 options.set_retry_policy(gax::retry_policy::NeverRetry);
137 let query = move |name| {
138 let stub = stub.clone();
139 let options = options.clone();
140 async {
141 let op = GetOperation::new(stub)
142 .set_name(name)
143 .with_options(options)
144 .send()
145 .await?;
146 Ok(Operation::new(op))
147 }
148 };
149
150 let start = move || async {
151 let op = self.send().await?;
152 Ok(Operation::new(op))
153 };
154
155 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
156 }
157
158 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
162 self.0.request.parent = v.into();
163 self
164 }
165
166 pub fn set_key_handle_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
168 self.0.request.key_handle_id = v.into();
169 self
170 }
171
172 pub fn set_key_handle<T>(mut self, v: T) -> Self
176 where
177 T: std::convert::Into<crate::model::KeyHandle>,
178 {
179 self.0.request.key_handle = std::option::Option::Some(v.into());
180 self
181 }
182
183 pub fn set_or_clear_key_handle<T>(mut self, v: std::option::Option<T>) -> Self
187 where
188 T: std::convert::Into<crate::model::KeyHandle>,
189 {
190 self.0.request.key_handle = v.map(|x| x.into());
191 self
192 }
193 }
194
195 #[doc(hidden)]
196 impl gax::options::internal::RequestBuilder for CreateKeyHandle {
197 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
198 &mut self.0.options
199 }
200 }
201
202 #[derive(Clone, Debug)]
219 pub struct GetKeyHandle(RequestBuilder<crate::model::GetKeyHandleRequest>);
220
221 impl GetKeyHandle {
222 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
223 Self(RequestBuilder::new(stub))
224 }
225
226 pub fn with_request<V: Into<crate::model::GetKeyHandleRequest>>(mut self, v: V) -> Self {
228 self.0.request = v.into();
229 self
230 }
231
232 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
234 self.0.options = v.into();
235 self
236 }
237
238 pub async fn send(self) -> Result<crate::model::KeyHandle> {
240 (*self.0.stub)
241 .get_key_handle(self.0.request, self.0.options)
242 .await
243 .map(gax::response::Response::into_body)
244 }
245
246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
250 self.0.request.name = v.into();
251 self
252 }
253 }
254
255 #[doc(hidden)]
256 impl gax::options::internal::RequestBuilder for GetKeyHandle {
257 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
258 &mut self.0.options
259 }
260 }
261
262 #[derive(Clone, Debug)]
283 pub struct ListKeyHandles(RequestBuilder<crate::model::ListKeyHandlesRequest>);
284
285 impl ListKeyHandles {
286 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
287 Self(RequestBuilder::new(stub))
288 }
289
290 pub fn with_request<V: Into<crate::model::ListKeyHandlesRequest>>(mut self, v: V) -> Self {
292 self.0.request = v.into();
293 self
294 }
295
296 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
298 self.0.options = v.into();
299 self
300 }
301
302 pub async fn send(self) -> Result<crate::model::ListKeyHandlesResponse> {
304 (*self.0.stub)
305 .list_key_handles(self.0.request, self.0.options)
306 .await
307 .map(gax::response::Response::into_body)
308 }
309
310 pub fn by_page(
312 self,
313 ) -> impl gax::paginator::Paginator<crate::model::ListKeyHandlesResponse, gax::error::Error>
314 {
315 use std::clone::Clone;
316 let token = self.0.request.page_token.clone();
317 let execute = move |token: String| {
318 let mut builder = self.clone();
319 builder.0.request = builder.0.request.set_page_token(token);
320 builder.send()
321 };
322 gax::paginator::internal::new_paginator(token, execute)
323 }
324
325 pub fn by_item(
327 self,
328 ) -> impl gax::paginator::ItemPaginator<crate::model::ListKeyHandlesResponse, gax::error::Error>
329 {
330 use gax::paginator::Paginator;
331 self.by_page().items()
332 }
333
334 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
338 self.0.request.parent = v.into();
339 self
340 }
341
342 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
344 self.0.request.page_size = v.into();
345 self
346 }
347
348 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
350 self.0.request.page_token = v.into();
351 self
352 }
353
354 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.filter = v.into();
357 self
358 }
359 }
360
361 #[doc(hidden)]
362 impl gax::options::internal::RequestBuilder for ListKeyHandles {
363 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
364 &mut self.0.options
365 }
366 }
367
368 #[derive(Clone, Debug)]
389 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
390
391 impl ListLocations {
392 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
393 Self(RequestBuilder::new(stub))
394 }
395
396 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
398 mut self,
399 v: V,
400 ) -> Self {
401 self.0.request = v.into();
402 self
403 }
404
405 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
407 self.0.options = v.into();
408 self
409 }
410
411 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
413 (*self.0.stub)
414 .list_locations(self.0.request, self.0.options)
415 .await
416 .map(gax::response::Response::into_body)
417 }
418
419 pub fn by_page(
421 self,
422 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
423 {
424 use std::clone::Clone;
425 let token = self.0.request.page_token.clone();
426 let execute = move |token: String| {
427 let mut builder = self.clone();
428 builder.0.request = builder.0.request.set_page_token(token);
429 builder.send()
430 };
431 gax::paginator::internal::new_paginator(token, execute)
432 }
433
434 pub fn by_item(
436 self,
437 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
438 {
439 use gax::paginator::Paginator;
440 self.by_page().items()
441 }
442
443 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
445 self.0.request.name = v.into();
446 self
447 }
448
449 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
451 self.0.request.filter = v.into();
452 self
453 }
454
455 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
457 self.0.request.page_size = v.into();
458 self
459 }
460
461 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
463 self.0.request.page_token = v.into();
464 self
465 }
466 }
467
468 #[doc(hidden)]
469 impl gax::options::internal::RequestBuilder for ListLocations {
470 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
471 &mut self.0.options
472 }
473 }
474
475 #[derive(Clone, Debug)]
492 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
493
494 impl GetLocation {
495 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
496 Self(RequestBuilder::new(stub))
497 }
498
499 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
501 self.0.request = v.into();
502 self
503 }
504
505 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
507 self.0.options = v.into();
508 self
509 }
510
511 pub async fn send(self) -> Result<location::model::Location> {
513 (*self.0.stub)
514 .get_location(self.0.request, self.0.options)
515 .await
516 .map(gax::response::Response::into_body)
517 }
518
519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
521 self.0.request.name = v.into();
522 self
523 }
524 }
525
526 #[doc(hidden)]
527 impl gax::options::internal::RequestBuilder for GetLocation {
528 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
529 &mut self.0.options
530 }
531 }
532
533 #[derive(Clone, Debug)]
550 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
551
552 impl SetIamPolicy {
553 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
554 Self(RequestBuilder::new(stub))
555 }
556
557 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
559 self.0.request = v.into();
560 self
561 }
562
563 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
565 self.0.options = v.into();
566 self
567 }
568
569 pub async fn send(self) -> Result<iam_v1::model::Policy> {
571 (*self.0.stub)
572 .set_iam_policy(self.0.request, self.0.options)
573 .await
574 .map(gax::response::Response::into_body)
575 }
576
577 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
581 self.0.request.resource = v.into();
582 self
583 }
584
585 pub fn set_policy<T>(mut self, v: T) -> Self
589 where
590 T: std::convert::Into<iam_v1::model::Policy>,
591 {
592 self.0.request.policy = std::option::Option::Some(v.into());
593 self
594 }
595
596 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
600 where
601 T: std::convert::Into<iam_v1::model::Policy>,
602 {
603 self.0.request.policy = v.map(|x| x.into());
604 self
605 }
606
607 pub fn set_update_mask<T>(mut self, v: T) -> Self
609 where
610 T: std::convert::Into<wkt::FieldMask>,
611 {
612 self.0.request.update_mask = std::option::Option::Some(v.into());
613 self
614 }
615
616 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
618 where
619 T: std::convert::Into<wkt::FieldMask>,
620 {
621 self.0.request.update_mask = v.map(|x| x.into());
622 self
623 }
624 }
625
626 #[doc(hidden)]
627 impl gax::options::internal::RequestBuilder for SetIamPolicy {
628 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
629 &mut self.0.options
630 }
631 }
632
633 #[derive(Clone, Debug)]
650 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
651
652 impl GetIamPolicy {
653 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
654 Self(RequestBuilder::new(stub))
655 }
656
657 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
659 self.0.request = v.into();
660 self
661 }
662
663 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
665 self.0.options = v.into();
666 self
667 }
668
669 pub async fn send(self) -> Result<iam_v1::model::Policy> {
671 (*self.0.stub)
672 .get_iam_policy(self.0.request, self.0.options)
673 .await
674 .map(gax::response::Response::into_body)
675 }
676
677 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
681 self.0.request.resource = v.into();
682 self
683 }
684
685 pub fn set_options<T>(mut self, v: T) -> Self
687 where
688 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
689 {
690 self.0.request.options = std::option::Option::Some(v.into());
691 self
692 }
693
694 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
696 where
697 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
698 {
699 self.0.request.options = v.map(|x| x.into());
700 self
701 }
702 }
703
704 #[doc(hidden)]
705 impl gax::options::internal::RequestBuilder for GetIamPolicy {
706 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
707 &mut self.0.options
708 }
709 }
710
711 #[derive(Clone, Debug)]
728 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
729
730 impl TestIamPermissions {
731 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
732 Self(RequestBuilder::new(stub))
733 }
734
735 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
737 mut self,
738 v: V,
739 ) -> Self {
740 self.0.request = v.into();
741 self
742 }
743
744 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
746 self.0.options = v.into();
747 self
748 }
749
750 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
752 (*self.0.stub)
753 .test_iam_permissions(self.0.request, self.0.options)
754 .await
755 .map(gax::response::Response::into_body)
756 }
757
758 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
762 self.0.request.resource = v.into();
763 self
764 }
765
766 pub fn set_permissions<T, V>(mut self, v: T) -> Self
770 where
771 T: std::iter::IntoIterator<Item = V>,
772 V: std::convert::Into<std::string::String>,
773 {
774 use std::iter::Iterator;
775 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
776 self
777 }
778 }
779
780 #[doc(hidden)]
781 impl gax::options::internal::RequestBuilder for TestIamPermissions {
782 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
783 &mut self.0.options
784 }
785 }
786
787 #[derive(Clone, Debug)]
804 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
805
806 impl GetOperation {
807 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Autokey>) -> Self {
808 Self(RequestBuilder::new(stub))
809 }
810
811 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
813 mut self,
814 v: V,
815 ) -> Self {
816 self.0.request = v.into();
817 self
818 }
819
820 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
822 self.0.options = v.into();
823 self
824 }
825
826 pub async fn send(self) -> Result<longrunning::model::Operation> {
828 (*self.0.stub)
829 .get_operation(self.0.request, self.0.options)
830 .await
831 .map(gax::response::Response::into_body)
832 }
833
834 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
836 self.0.request.name = v.into();
837 self
838 }
839 }
840
841 #[doc(hidden)]
842 impl gax::options::internal::RequestBuilder for GetOperation {
843 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
844 &mut self.0.options
845 }
846 }
847}
848
849pub mod autokey_admin {
850 use crate::Result;
851
852 pub type ClientBuilder =
866 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
867
868 pub(crate) mod client {
869 use super::super::super::client::AutokeyAdmin;
870 pub struct Factory;
871 impl gax::client_builder::internal::ClientFactory for Factory {
872 type Client = AutokeyAdmin;
873 type Credentials = gaxi::options::Credentials;
874 async fn build(
875 self,
876 config: gaxi::options::ClientConfig,
877 ) -> gax::client_builder::Result<Self::Client> {
878 Self::Client::new(config).await
879 }
880 }
881 }
882
883 #[derive(Clone, Debug)]
885 pub(crate) struct RequestBuilder<R: std::default::Default> {
886 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
887 request: R,
888 options: gax::options::RequestOptions,
889 }
890
891 impl<R> RequestBuilder<R>
892 where
893 R: std::default::Default,
894 {
895 pub(crate) fn new(
896 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
897 ) -> Self {
898 Self {
899 stub,
900 request: R::default(),
901 options: gax::options::RequestOptions::default(),
902 }
903 }
904 }
905
906 #[derive(Clone, Debug)]
923 pub struct UpdateAutokeyConfig(RequestBuilder<crate::model::UpdateAutokeyConfigRequest>);
924
925 impl UpdateAutokeyConfig {
926 pub(crate) fn new(
927 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
928 ) -> Self {
929 Self(RequestBuilder::new(stub))
930 }
931
932 pub fn with_request<V: Into<crate::model::UpdateAutokeyConfigRequest>>(
934 mut self,
935 v: V,
936 ) -> Self {
937 self.0.request = v.into();
938 self
939 }
940
941 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
943 self.0.options = v.into();
944 self
945 }
946
947 pub async fn send(self) -> Result<crate::model::AutokeyConfig> {
949 (*self.0.stub)
950 .update_autokey_config(self.0.request, self.0.options)
951 .await
952 .map(gax::response::Response::into_body)
953 }
954
955 pub fn set_autokey_config<T>(mut self, v: T) -> Self
959 where
960 T: std::convert::Into<crate::model::AutokeyConfig>,
961 {
962 self.0.request.autokey_config = std::option::Option::Some(v.into());
963 self
964 }
965
966 pub fn set_or_clear_autokey_config<T>(mut self, v: std::option::Option<T>) -> Self
970 where
971 T: std::convert::Into<crate::model::AutokeyConfig>,
972 {
973 self.0.request.autokey_config = v.map(|x| x.into());
974 self
975 }
976
977 pub fn set_update_mask<T>(mut self, v: T) -> Self
981 where
982 T: std::convert::Into<wkt::FieldMask>,
983 {
984 self.0.request.update_mask = std::option::Option::Some(v.into());
985 self
986 }
987
988 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
992 where
993 T: std::convert::Into<wkt::FieldMask>,
994 {
995 self.0.request.update_mask = v.map(|x| x.into());
996 self
997 }
998 }
999
1000 #[doc(hidden)]
1001 impl gax::options::internal::RequestBuilder for UpdateAutokeyConfig {
1002 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1003 &mut self.0.options
1004 }
1005 }
1006
1007 #[derive(Clone, Debug)]
1024 pub struct GetAutokeyConfig(RequestBuilder<crate::model::GetAutokeyConfigRequest>);
1025
1026 impl GetAutokeyConfig {
1027 pub(crate) fn new(
1028 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1029 ) -> Self {
1030 Self(RequestBuilder::new(stub))
1031 }
1032
1033 pub fn with_request<V: Into<crate::model::GetAutokeyConfigRequest>>(
1035 mut self,
1036 v: V,
1037 ) -> Self {
1038 self.0.request = v.into();
1039 self
1040 }
1041
1042 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1044 self.0.options = v.into();
1045 self
1046 }
1047
1048 pub async fn send(self) -> Result<crate::model::AutokeyConfig> {
1050 (*self.0.stub)
1051 .get_autokey_config(self.0.request, self.0.options)
1052 .await
1053 .map(gax::response::Response::into_body)
1054 }
1055
1056 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.0.request.name = v.into();
1061 self
1062 }
1063 }
1064
1065 #[doc(hidden)]
1066 impl gax::options::internal::RequestBuilder for GetAutokeyConfig {
1067 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1068 &mut self.0.options
1069 }
1070 }
1071
1072 #[derive(Clone, Debug)]
1089 pub struct ShowEffectiveAutokeyConfig(
1090 RequestBuilder<crate::model::ShowEffectiveAutokeyConfigRequest>,
1091 );
1092
1093 impl ShowEffectiveAutokeyConfig {
1094 pub(crate) fn new(
1095 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1096 ) -> Self {
1097 Self(RequestBuilder::new(stub))
1098 }
1099
1100 pub fn with_request<V: Into<crate::model::ShowEffectiveAutokeyConfigRequest>>(
1102 mut self,
1103 v: V,
1104 ) -> Self {
1105 self.0.request = v.into();
1106 self
1107 }
1108
1109 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1111 self.0.options = v.into();
1112 self
1113 }
1114
1115 pub async fn send(self) -> Result<crate::model::ShowEffectiveAutokeyConfigResponse> {
1117 (*self.0.stub)
1118 .show_effective_autokey_config(self.0.request, self.0.options)
1119 .await
1120 .map(gax::response::Response::into_body)
1121 }
1122
1123 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1127 self.0.request.parent = v.into();
1128 self
1129 }
1130 }
1131
1132 #[doc(hidden)]
1133 impl gax::options::internal::RequestBuilder for ShowEffectiveAutokeyConfig {
1134 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1135 &mut self.0.options
1136 }
1137 }
1138
1139 #[derive(Clone, Debug)]
1160 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1161
1162 impl ListLocations {
1163 pub(crate) fn new(
1164 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1165 ) -> Self {
1166 Self(RequestBuilder::new(stub))
1167 }
1168
1169 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1171 mut self,
1172 v: V,
1173 ) -> Self {
1174 self.0.request = v.into();
1175 self
1176 }
1177
1178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1180 self.0.options = v.into();
1181 self
1182 }
1183
1184 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1186 (*self.0.stub)
1187 .list_locations(self.0.request, self.0.options)
1188 .await
1189 .map(gax::response::Response::into_body)
1190 }
1191
1192 pub fn by_page(
1194 self,
1195 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1196 {
1197 use std::clone::Clone;
1198 let token = self.0.request.page_token.clone();
1199 let execute = move |token: String| {
1200 let mut builder = self.clone();
1201 builder.0.request = builder.0.request.set_page_token(token);
1202 builder.send()
1203 };
1204 gax::paginator::internal::new_paginator(token, execute)
1205 }
1206
1207 pub fn by_item(
1209 self,
1210 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1211 {
1212 use gax::paginator::Paginator;
1213 self.by_page().items()
1214 }
1215
1216 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1218 self.0.request.name = v.into();
1219 self
1220 }
1221
1222 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1224 self.0.request.filter = v.into();
1225 self
1226 }
1227
1228 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1230 self.0.request.page_size = v.into();
1231 self
1232 }
1233
1234 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1236 self.0.request.page_token = v.into();
1237 self
1238 }
1239 }
1240
1241 #[doc(hidden)]
1242 impl gax::options::internal::RequestBuilder for ListLocations {
1243 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1244 &mut self.0.options
1245 }
1246 }
1247
1248 #[derive(Clone, Debug)]
1265 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1266
1267 impl GetLocation {
1268 pub(crate) fn new(
1269 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1270 ) -> Self {
1271 Self(RequestBuilder::new(stub))
1272 }
1273
1274 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1276 self.0.request = v.into();
1277 self
1278 }
1279
1280 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1282 self.0.options = v.into();
1283 self
1284 }
1285
1286 pub async fn send(self) -> Result<location::model::Location> {
1288 (*self.0.stub)
1289 .get_location(self.0.request, self.0.options)
1290 .await
1291 .map(gax::response::Response::into_body)
1292 }
1293
1294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1296 self.0.request.name = v.into();
1297 self
1298 }
1299 }
1300
1301 #[doc(hidden)]
1302 impl gax::options::internal::RequestBuilder for GetLocation {
1303 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1304 &mut self.0.options
1305 }
1306 }
1307
1308 #[derive(Clone, Debug)]
1325 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1326
1327 impl SetIamPolicy {
1328 pub(crate) fn new(
1329 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1330 ) -> Self {
1331 Self(RequestBuilder::new(stub))
1332 }
1333
1334 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1336 self.0.request = v.into();
1337 self
1338 }
1339
1340 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1342 self.0.options = v.into();
1343 self
1344 }
1345
1346 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1348 (*self.0.stub)
1349 .set_iam_policy(self.0.request, self.0.options)
1350 .await
1351 .map(gax::response::Response::into_body)
1352 }
1353
1354 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1358 self.0.request.resource = v.into();
1359 self
1360 }
1361
1362 pub fn set_policy<T>(mut self, v: T) -> Self
1366 where
1367 T: std::convert::Into<iam_v1::model::Policy>,
1368 {
1369 self.0.request.policy = std::option::Option::Some(v.into());
1370 self
1371 }
1372
1373 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1377 where
1378 T: std::convert::Into<iam_v1::model::Policy>,
1379 {
1380 self.0.request.policy = v.map(|x| x.into());
1381 self
1382 }
1383
1384 pub fn set_update_mask<T>(mut self, v: T) -> Self
1386 where
1387 T: std::convert::Into<wkt::FieldMask>,
1388 {
1389 self.0.request.update_mask = std::option::Option::Some(v.into());
1390 self
1391 }
1392
1393 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1395 where
1396 T: std::convert::Into<wkt::FieldMask>,
1397 {
1398 self.0.request.update_mask = v.map(|x| x.into());
1399 self
1400 }
1401 }
1402
1403 #[doc(hidden)]
1404 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1405 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1406 &mut self.0.options
1407 }
1408 }
1409
1410 #[derive(Clone, Debug)]
1427 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1428
1429 impl GetIamPolicy {
1430 pub(crate) fn new(
1431 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1432 ) -> Self {
1433 Self(RequestBuilder::new(stub))
1434 }
1435
1436 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1438 self.0.request = v.into();
1439 self
1440 }
1441
1442 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1444 self.0.options = v.into();
1445 self
1446 }
1447
1448 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1450 (*self.0.stub)
1451 .get_iam_policy(self.0.request, self.0.options)
1452 .await
1453 .map(gax::response::Response::into_body)
1454 }
1455
1456 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1460 self.0.request.resource = v.into();
1461 self
1462 }
1463
1464 pub fn set_options<T>(mut self, v: T) -> Self
1466 where
1467 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1468 {
1469 self.0.request.options = std::option::Option::Some(v.into());
1470 self
1471 }
1472
1473 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1475 where
1476 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1477 {
1478 self.0.request.options = v.map(|x| x.into());
1479 self
1480 }
1481 }
1482
1483 #[doc(hidden)]
1484 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1485 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1486 &mut self.0.options
1487 }
1488 }
1489
1490 #[derive(Clone, Debug)]
1507 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1508
1509 impl TestIamPermissions {
1510 pub(crate) fn new(
1511 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1512 ) -> Self {
1513 Self(RequestBuilder::new(stub))
1514 }
1515
1516 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1518 mut self,
1519 v: V,
1520 ) -> Self {
1521 self.0.request = v.into();
1522 self
1523 }
1524
1525 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1527 self.0.options = v.into();
1528 self
1529 }
1530
1531 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1533 (*self.0.stub)
1534 .test_iam_permissions(self.0.request, self.0.options)
1535 .await
1536 .map(gax::response::Response::into_body)
1537 }
1538
1539 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1543 self.0.request.resource = v.into();
1544 self
1545 }
1546
1547 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1551 where
1552 T: std::iter::IntoIterator<Item = V>,
1553 V: std::convert::Into<std::string::String>,
1554 {
1555 use std::iter::Iterator;
1556 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1557 self
1558 }
1559 }
1560
1561 #[doc(hidden)]
1562 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1563 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1564 &mut self.0.options
1565 }
1566 }
1567
1568 #[derive(Clone, Debug)]
1585 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1586
1587 impl GetOperation {
1588 pub(crate) fn new(
1589 stub: std::sync::Arc<dyn super::super::stub::dynamic::AutokeyAdmin>,
1590 ) -> Self {
1591 Self(RequestBuilder::new(stub))
1592 }
1593
1594 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1596 mut self,
1597 v: V,
1598 ) -> Self {
1599 self.0.request = v.into();
1600 self
1601 }
1602
1603 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1605 self.0.options = v.into();
1606 self
1607 }
1608
1609 pub async fn send(self) -> Result<longrunning::model::Operation> {
1611 (*self.0.stub)
1612 .get_operation(self.0.request, self.0.options)
1613 .await
1614 .map(gax::response::Response::into_body)
1615 }
1616
1617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1619 self.0.request.name = v.into();
1620 self
1621 }
1622 }
1623
1624 #[doc(hidden)]
1625 impl gax::options::internal::RequestBuilder for GetOperation {
1626 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1627 &mut self.0.options
1628 }
1629 }
1630}
1631
1632pub mod ekm_service {
1633 use crate::Result;
1634
1635 pub type ClientBuilder =
1649 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1650
1651 pub(crate) mod client {
1652 use super::super::super::client::EkmService;
1653 pub struct Factory;
1654 impl gax::client_builder::internal::ClientFactory for Factory {
1655 type Client = EkmService;
1656 type Credentials = gaxi::options::Credentials;
1657 async fn build(
1658 self,
1659 config: gaxi::options::ClientConfig,
1660 ) -> gax::client_builder::Result<Self::Client> {
1661 Self::Client::new(config).await
1662 }
1663 }
1664 }
1665
1666 #[derive(Clone, Debug)]
1668 pub(crate) struct RequestBuilder<R: std::default::Default> {
1669 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1670 request: R,
1671 options: gax::options::RequestOptions,
1672 }
1673
1674 impl<R> RequestBuilder<R>
1675 where
1676 R: std::default::Default,
1677 {
1678 pub(crate) fn new(
1679 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1680 ) -> Self {
1681 Self {
1682 stub,
1683 request: R::default(),
1684 options: gax::options::RequestOptions::default(),
1685 }
1686 }
1687 }
1688
1689 #[derive(Clone, Debug)]
1710 pub struct ListEkmConnections(RequestBuilder<crate::model::ListEkmConnectionsRequest>);
1711
1712 impl ListEkmConnections {
1713 pub(crate) fn new(
1714 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1715 ) -> Self {
1716 Self(RequestBuilder::new(stub))
1717 }
1718
1719 pub fn with_request<V: Into<crate::model::ListEkmConnectionsRequest>>(
1721 mut self,
1722 v: V,
1723 ) -> Self {
1724 self.0.request = v.into();
1725 self
1726 }
1727
1728 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1730 self.0.options = v.into();
1731 self
1732 }
1733
1734 pub async fn send(self) -> Result<crate::model::ListEkmConnectionsResponse> {
1736 (*self.0.stub)
1737 .list_ekm_connections(self.0.request, self.0.options)
1738 .await
1739 .map(gax::response::Response::into_body)
1740 }
1741
1742 pub fn by_page(
1744 self,
1745 ) -> impl gax::paginator::Paginator<crate::model::ListEkmConnectionsResponse, gax::error::Error>
1746 {
1747 use std::clone::Clone;
1748 let token = self.0.request.page_token.clone();
1749 let execute = move |token: String| {
1750 let mut builder = self.clone();
1751 builder.0.request = builder.0.request.set_page_token(token);
1752 builder.send()
1753 };
1754 gax::paginator::internal::new_paginator(token, execute)
1755 }
1756
1757 pub fn by_item(
1759 self,
1760 ) -> impl gax::paginator::ItemPaginator<
1761 crate::model::ListEkmConnectionsResponse,
1762 gax::error::Error,
1763 > {
1764 use gax::paginator::Paginator;
1765 self.by_page().items()
1766 }
1767
1768 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1772 self.0.request.parent = v.into();
1773 self
1774 }
1775
1776 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1778 self.0.request.page_size = v.into();
1779 self
1780 }
1781
1782 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1784 self.0.request.page_token = v.into();
1785 self
1786 }
1787
1788 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1790 self.0.request.filter = v.into();
1791 self
1792 }
1793
1794 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1796 self.0.request.order_by = v.into();
1797 self
1798 }
1799 }
1800
1801 #[doc(hidden)]
1802 impl gax::options::internal::RequestBuilder for ListEkmConnections {
1803 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1804 &mut self.0.options
1805 }
1806 }
1807
1808 #[derive(Clone, Debug)]
1825 pub struct GetEkmConnection(RequestBuilder<crate::model::GetEkmConnectionRequest>);
1826
1827 impl GetEkmConnection {
1828 pub(crate) fn new(
1829 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1830 ) -> Self {
1831 Self(RequestBuilder::new(stub))
1832 }
1833
1834 pub fn with_request<V: Into<crate::model::GetEkmConnectionRequest>>(
1836 mut self,
1837 v: V,
1838 ) -> Self {
1839 self.0.request = v.into();
1840 self
1841 }
1842
1843 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1845 self.0.options = v.into();
1846 self
1847 }
1848
1849 pub async fn send(self) -> Result<crate::model::EkmConnection> {
1851 (*self.0.stub)
1852 .get_ekm_connection(self.0.request, self.0.options)
1853 .await
1854 .map(gax::response::Response::into_body)
1855 }
1856
1857 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1861 self.0.request.name = v.into();
1862 self
1863 }
1864 }
1865
1866 #[doc(hidden)]
1867 impl gax::options::internal::RequestBuilder for GetEkmConnection {
1868 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1869 &mut self.0.options
1870 }
1871 }
1872
1873 #[derive(Clone, Debug)]
1890 pub struct CreateEkmConnection(RequestBuilder<crate::model::CreateEkmConnectionRequest>);
1891
1892 impl CreateEkmConnection {
1893 pub(crate) fn new(
1894 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1895 ) -> Self {
1896 Self(RequestBuilder::new(stub))
1897 }
1898
1899 pub fn with_request<V: Into<crate::model::CreateEkmConnectionRequest>>(
1901 mut self,
1902 v: V,
1903 ) -> Self {
1904 self.0.request = v.into();
1905 self
1906 }
1907
1908 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1910 self.0.options = v.into();
1911 self
1912 }
1913
1914 pub async fn send(self) -> Result<crate::model::EkmConnection> {
1916 (*self.0.stub)
1917 .create_ekm_connection(self.0.request, self.0.options)
1918 .await
1919 .map(gax::response::Response::into_body)
1920 }
1921
1922 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1926 self.0.request.parent = v.into();
1927 self
1928 }
1929
1930 pub fn set_ekm_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1934 self.0.request.ekm_connection_id = v.into();
1935 self
1936 }
1937
1938 pub fn set_ekm_connection<T>(mut self, v: T) -> Self
1942 where
1943 T: std::convert::Into<crate::model::EkmConnection>,
1944 {
1945 self.0.request.ekm_connection = std::option::Option::Some(v.into());
1946 self
1947 }
1948
1949 pub fn set_or_clear_ekm_connection<T>(mut self, v: std::option::Option<T>) -> Self
1953 where
1954 T: std::convert::Into<crate::model::EkmConnection>,
1955 {
1956 self.0.request.ekm_connection = v.map(|x| x.into());
1957 self
1958 }
1959 }
1960
1961 #[doc(hidden)]
1962 impl gax::options::internal::RequestBuilder for CreateEkmConnection {
1963 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1964 &mut self.0.options
1965 }
1966 }
1967
1968 #[derive(Clone, Debug)]
1985 pub struct UpdateEkmConnection(RequestBuilder<crate::model::UpdateEkmConnectionRequest>);
1986
1987 impl UpdateEkmConnection {
1988 pub(crate) fn new(
1989 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
1990 ) -> Self {
1991 Self(RequestBuilder::new(stub))
1992 }
1993
1994 pub fn with_request<V: Into<crate::model::UpdateEkmConnectionRequest>>(
1996 mut self,
1997 v: V,
1998 ) -> Self {
1999 self.0.request = v.into();
2000 self
2001 }
2002
2003 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2005 self.0.options = v.into();
2006 self
2007 }
2008
2009 pub async fn send(self) -> Result<crate::model::EkmConnection> {
2011 (*self.0.stub)
2012 .update_ekm_connection(self.0.request, self.0.options)
2013 .await
2014 .map(gax::response::Response::into_body)
2015 }
2016
2017 pub fn set_ekm_connection<T>(mut self, v: T) -> Self
2021 where
2022 T: std::convert::Into<crate::model::EkmConnection>,
2023 {
2024 self.0.request.ekm_connection = std::option::Option::Some(v.into());
2025 self
2026 }
2027
2028 pub fn set_or_clear_ekm_connection<T>(mut self, v: std::option::Option<T>) -> Self
2032 where
2033 T: std::convert::Into<crate::model::EkmConnection>,
2034 {
2035 self.0.request.ekm_connection = v.map(|x| x.into());
2036 self
2037 }
2038
2039 pub fn set_update_mask<T>(mut self, v: T) -> Self
2043 where
2044 T: std::convert::Into<wkt::FieldMask>,
2045 {
2046 self.0.request.update_mask = std::option::Option::Some(v.into());
2047 self
2048 }
2049
2050 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2054 where
2055 T: std::convert::Into<wkt::FieldMask>,
2056 {
2057 self.0.request.update_mask = v.map(|x| x.into());
2058 self
2059 }
2060 }
2061
2062 #[doc(hidden)]
2063 impl gax::options::internal::RequestBuilder for UpdateEkmConnection {
2064 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2065 &mut self.0.options
2066 }
2067 }
2068
2069 #[derive(Clone, Debug)]
2086 pub struct GetEkmConfig(RequestBuilder<crate::model::GetEkmConfigRequest>);
2087
2088 impl GetEkmConfig {
2089 pub(crate) fn new(
2090 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2091 ) -> Self {
2092 Self(RequestBuilder::new(stub))
2093 }
2094
2095 pub fn with_request<V: Into<crate::model::GetEkmConfigRequest>>(mut self, v: V) -> Self {
2097 self.0.request = v.into();
2098 self
2099 }
2100
2101 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2103 self.0.options = v.into();
2104 self
2105 }
2106
2107 pub async fn send(self) -> Result<crate::model::EkmConfig> {
2109 (*self.0.stub)
2110 .get_ekm_config(self.0.request, self.0.options)
2111 .await
2112 .map(gax::response::Response::into_body)
2113 }
2114
2115 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2119 self.0.request.name = v.into();
2120 self
2121 }
2122 }
2123
2124 #[doc(hidden)]
2125 impl gax::options::internal::RequestBuilder for GetEkmConfig {
2126 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2127 &mut self.0.options
2128 }
2129 }
2130
2131 #[derive(Clone, Debug)]
2148 pub struct UpdateEkmConfig(RequestBuilder<crate::model::UpdateEkmConfigRequest>);
2149
2150 impl UpdateEkmConfig {
2151 pub(crate) fn new(
2152 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2153 ) -> Self {
2154 Self(RequestBuilder::new(stub))
2155 }
2156
2157 pub fn with_request<V: Into<crate::model::UpdateEkmConfigRequest>>(mut self, v: V) -> Self {
2159 self.0.request = v.into();
2160 self
2161 }
2162
2163 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2165 self.0.options = v.into();
2166 self
2167 }
2168
2169 pub async fn send(self) -> Result<crate::model::EkmConfig> {
2171 (*self.0.stub)
2172 .update_ekm_config(self.0.request, self.0.options)
2173 .await
2174 .map(gax::response::Response::into_body)
2175 }
2176
2177 pub fn set_ekm_config<T>(mut self, v: T) -> Self
2181 where
2182 T: std::convert::Into<crate::model::EkmConfig>,
2183 {
2184 self.0.request.ekm_config = std::option::Option::Some(v.into());
2185 self
2186 }
2187
2188 pub fn set_or_clear_ekm_config<T>(mut self, v: std::option::Option<T>) -> Self
2192 where
2193 T: std::convert::Into<crate::model::EkmConfig>,
2194 {
2195 self.0.request.ekm_config = v.map(|x| x.into());
2196 self
2197 }
2198
2199 pub fn set_update_mask<T>(mut self, v: T) -> Self
2203 where
2204 T: std::convert::Into<wkt::FieldMask>,
2205 {
2206 self.0.request.update_mask = std::option::Option::Some(v.into());
2207 self
2208 }
2209
2210 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2214 where
2215 T: std::convert::Into<wkt::FieldMask>,
2216 {
2217 self.0.request.update_mask = v.map(|x| x.into());
2218 self
2219 }
2220 }
2221
2222 #[doc(hidden)]
2223 impl gax::options::internal::RequestBuilder for UpdateEkmConfig {
2224 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2225 &mut self.0.options
2226 }
2227 }
2228
2229 #[derive(Clone, Debug)]
2246 pub struct VerifyConnectivity(RequestBuilder<crate::model::VerifyConnectivityRequest>);
2247
2248 impl VerifyConnectivity {
2249 pub(crate) fn new(
2250 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2251 ) -> Self {
2252 Self(RequestBuilder::new(stub))
2253 }
2254
2255 pub fn with_request<V: Into<crate::model::VerifyConnectivityRequest>>(
2257 mut self,
2258 v: V,
2259 ) -> Self {
2260 self.0.request = v.into();
2261 self
2262 }
2263
2264 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2266 self.0.options = v.into();
2267 self
2268 }
2269
2270 pub async fn send(self) -> Result<crate::model::VerifyConnectivityResponse> {
2272 (*self.0.stub)
2273 .verify_connectivity(self.0.request, self.0.options)
2274 .await
2275 .map(gax::response::Response::into_body)
2276 }
2277
2278 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2282 self.0.request.name = v.into();
2283 self
2284 }
2285 }
2286
2287 #[doc(hidden)]
2288 impl gax::options::internal::RequestBuilder for VerifyConnectivity {
2289 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2290 &mut self.0.options
2291 }
2292 }
2293
2294 #[derive(Clone, Debug)]
2315 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2316
2317 impl ListLocations {
2318 pub(crate) fn new(
2319 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2320 ) -> Self {
2321 Self(RequestBuilder::new(stub))
2322 }
2323
2324 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2326 mut self,
2327 v: V,
2328 ) -> Self {
2329 self.0.request = v.into();
2330 self
2331 }
2332
2333 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2335 self.0.options = v.into();
2336 self
2337 }
2338
2339 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2341 (*self.0.stub)
2342 .list_locations(self.0.request, self.0.options)
2343 .await
2344 .map(gax::response::Response::into_body)
2345 }
2346
2347 pub fn by_page(
2349 self,
2350 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2351 {
2352 use std::clone::Clone;
2353 let token = self.0.request.page_token.clone();
2354 let execute = move |token: String| {
2355 let mut builder = self.clone();
2356 builder.0.request = builder.0.request.set_page_token(token);
2357 builder.send()
2358 };
2359 gax::paginator::internal::new_paginator(token, execute)
2360 }
2361
2362 pub fn by_item(
2364 self,
2365 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2366 {
2367 use gax::paginator::Paginator;
2368 self.by_page().items()
2369 }
2370
2371 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2373 self.0.request.name = v.into();
2374 self
2375 }
2376
2377 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2379 self.0.request.filter = v.into();
2380 self
2381 }
2382
2383 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2385 self.0.request.page_size = v.into();
2386 self
2387 }
2388
2389 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2391 self.0.request.page_token = v.into();
2392 self
2393 }
2394 }
2395
2396 #[doc(hidden)]
2397 impl gax::options::internal::RequestBuilder for ListLocations {
2398 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2399 &mut self.0.options
2400 }
2401 }
2402
2403 #[derive(Clone, Debug)]
2420 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2421
2422 impl GetLocation {
2423 pub(crate) fn new(
2424 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2425 ) -> Self {
2426 Self(RequestBuilder::new(stub))
2427 }
2428
2429 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2431 self.0.request = v.into();
2432 self
2433 }
2434
2435 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2437 self.0.options = v.into();
2438 self
2439 }
2440
2441 pub async fn send(self) -> Result<location::model::Location> {
2443 (*self.0.stub)
2444 .get_location(self.0.request, self.0.options)
2445 .await
2446 .map(gax::response::Response::into_body)
2447 }
2448
2449 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2451 self.0.request.name = v.into();
2452 self
2453 }
2454 }
2455
2456 #[doc(hidden)]
2457 impl gax::options::internal::RequestBuilder for GetLocation {
2458 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2459 &mut self.0.options
2460 }
2461 }
2462
2463 #[derive(Clone, Debug)]
2480 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2481
2482 impl SetIamPolicy {
2483 pub(crate) fn new(
2484 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2485 ) -> Self {
2486 Self(RequestBuilder::new(stub))
2487 }
2488
2489 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2491 self.0.request = v.into();
2492 self
2493 }
2494
2495 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2497 self.0.options = v.into();
2498 self
2499 }
2500
2501 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2503 (*self.0.stub)
2504 .set_iam_policy(self.0.request, self.0.options)
2505 .await
2506 .map(gax::response::Response::into_body)
2507 }
2508
2509 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2513 self.0.request.resource = v.into();
2514 self
2515 }
2516
2517 pub fn set_policy<T>(mut self, v: T) -> Self
2521 where
2522 T: std::convert::Into<iam_v1::model::Policy>,
2523 {
2524 self.0.request.policy = std::option::Option::Some(v.into());
2525 self
2526 }
2527
2528 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2532 where
2533 T: std::convert::Into<iam_v1::model::Policy>,
2534 {
2535 self.0.request.policy = v.map(|x| x.into());
2536 self
2537 }
2538
2539 pub fn set_update_mask<T>(mut self, v: T) -> Self
2541 where
2542 T: std::convert::Into<wkt::FieldMask>,
2543 {
2544 self.0.request.update_mask = std::option::Option::Some(v.into());
2545 self
2546 }
2547
2548 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2550 where
2551 T: std::convert::Into<wkt::FieldMask>,
2552 {
2553 self.0.request.update_mask = v.map(|x| x.into());
2554 self
2555 }
2556 }
2557
2558 #[doc(hidden)]
2559 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2560 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2561 &mut self.0.options
2562 }
2563 }
2564
2565 #[derive(Clone, Debug)]
2582 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2583
2584 impl GetIamPolicy {
2585 pub(crate) fn new(
2586 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2587 ) -> Self {
2588 Self(RequestBuilder::new(stub))
2589 }
2590
2591 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2593 self.0.request = v.into();
2594 self
2595 }
2596
2597 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2599 self.0.options = v.into();
2600 self
2601 }
2602
2603 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2605 (*self.0.stub)
2606 .get_iam_policy(self.0.request, self.0.options)
2607 .await
2608 .map(gax::response::Response::into_body)
2609 }
2610
2611 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2615 self.0.request.resource = v.into();
2616 self
2617 }
2618
2619 pub fn set_options<T>(mut self, v: T) -> Self
2621 where
2622 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2623 {
2624 self.0.request.options = std::option::Option::Some(v.into());
2625 self
2626 }
2627
2628 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2630 where
2631 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2632 {
2633 self.0.request.options = v.map(|x| x.into());
2634 self
2635 }
2636 }
2637
2638 #[doc(hidden)]
2639 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2641 &mut self.0.options
2642 }
2643 }
2644
2645 #[derive(Clone, Debug)]
2662 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2663
2664 impl TestIamPermissions {
2665 pub(crate) fn new(
2666 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2667 ) -> Self {
2668 Self(RequestBuilder::new(stub))
2669 }
2670
2671 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2673 mut self,
2674 v: V,
2675 ) -> Self {
2676 self.0.request = v.into();
2677 self
2678 }
2679
2680 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2682 self.0.options = v.into();
2683 self
2684 }
2685
2686 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2688 (*self.0.stub)
2689 .test_iam_permissions(self.0.request, self.0.options)
2690 .await
2691 .map(gax::response::Response::into_body)
2692 }
2693
2694 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2698 self.0.request.resource = v.into();
2699 self
2700 }
2701
2702 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2706 where
2707 T: std::iter::IntoIterator<Item = V>,
2708 V: std::convert::Into<std::string::String>,
2709 {
2710 use std::iter::Iterator;
2711 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2712 self
2713 }
2714 }
2715
2716 #[doc(hidden)]
2717 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2718 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2719 &mut self.0.options
2720 }
2721 }
2722
2723 #[derive(Clone, Debug)]
2740 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2741
2742 impl GetOperation {
2743 pub(crate) fn new(
2744 stub: std::sync::Arc<dyn super::super::stub::dynamic::EkmService>,
2745 ) -> Self {
2746 Self(RequestBuilder::new(stub))
2747 }
2748
2749 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2751 mut self,
2752 v: V,
2753 ) -> Self {
2754 self.0.request = v.into();
2755 self
2756 }
2757
2758 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2760 self.0.options = v.into();
2761 self
2762 }
2763
2764 pub async fn send(self) -> Result<longrunning::model::Operation> {
2766 (*self.0.stub)
2767 .get_operation(self.0.request, self.0.options)
2768 .await
2769 .map(gax::response::Response::into_body)
2770 }
2771
2772 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2774 self.0.request.name = v.into();
2775 self
2776 }
2777 }
2778
2779 #[doc(hidden)]
2780 impl gax::options::internal::RequestBuilder for GetOperation {
2781 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2782 &mut self.0.options
2783 }
2784 }
2785}
2786
2787pub mod hsm_management {
2788 use crate::Result;
2789
2790 pub type ClientBuilder =
2804 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2805
2806 pub(crate) mod client {
2807 use super::super::super::client::HsmManagement;
2808 pub struct Factory;
2809 impl gax::client_builder::internal::ClientFactory for Factory {
2810 type Client = HsmManagement;
2811 type Credentials = gaxi::options::Credentials;
2812 async fn build(
2813 self,
2814 config: gaxi::options::ClientConfig,
2815 ) -> gax::client_builder::Result<Self::Client> {
2816 Self::Client::new(config).await
2817 }
2818 }
2819 }
2820
2821 #[derive(Clone, Debug)]
2823 pub(crate) struct RequestBuilder<R: std::default::Default> {
2824 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
2825 request: R,
2826 options: gax::options::RequestOptions,
2827 }
2828
2829 impl<R> RequestBuilder<R>
2830 where
2831 R: std::default::Default,
2832 {
2833 pub(crate) fn new(
2834 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
2835 ) -> Self {
2836 Self {
2837 stub,
2838 request: R::default(),
2839 options: gax::options::RequestOptions::default(),
2840 }
2841 }
2842 }
2843
2844 #[derive(Clone, Debug)]
2865 pub struct ListSingleTenantHsmInstances(
2866 RequestBuilder<crate::model::ListSingleTenantHsmInstancesRequest>,
2867 );
2868
2869 impl ListSingleTenantHsmInstances {
2870 pub(crate) fn new(
2871 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
2872 ) -> Self {
2873 Self(RequestBuilder::new(stub))
2874 }
2875
2876 pub fn with_request<V: Into<crate::model::ListSingleTenantHsmInstancesRequest>>(
2878 mut self,
2879 v: V,
2880 ) -> Self {
2881 self.0.request = v.into();
2882 self
2883 }
2884
2885 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2887 self.0.options = v.into();
2888 self
2889 }
2890
2891 pub async fn send(self) -> Result<crate::model::ListSingleTenantHsmInstancesResponse> {
2893 (*self.0.stub)
2894 .list_single_tenant_hsm_instances(self.0.request, self.0.options)
2895 .await
2896 .map(gax::response::Response::into_body)
2897 }
2898
2899 pub fn by_page(
2901 self,
2902 ) -> impl gax::paginator::Paginator<
2903 crate::model::ListSingleTenantHsmInstancesResponse,
2904 gax::error::Error,
2905 > {
2906 use std::clone::Clone;
2907 let token = self.0.request.page_token.clone();
2908 let execute = move |token: String| {
2909 let mut builder = self.clone();
2910 builder.0.request = builder.0.request.set_page_token(token);
2911 builder.send()
2912 };
2913 gax::paginator::internal::new_paginator(token, execute)
2914 }
2915
2916 pub fn by_item(
2918 self,
2919 ) -> impl gax::paginator::ItemPaginator<
2920 crate::model::ListSingleTenantHsmInstancesResponse,
2921 gax::error::Error,
2922 > {
2923 use gax::paginator::Paginator;
2924 self.by_page().items()
2925 }
2926
2927 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2931 self.0.request.parent = v.into();
2932 self
2933 }
2934
2935 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2937 self.0.request.page_size = v.into();
2938 self
2939 }
2940
2941 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2943 self.0.request.page_token = v.into();
2944 self
2945 }
2946
2947 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2949 self.0.request.filter = v.into();
2950 self
2951 }
2952
2953 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2955 self.0.request.order_by = v.into();
2956 self
2957 }
2958
2959 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
2961 self.0.request.show_deleted = v.into();
2962 self
2963 }
2964 }
2965
2966 #[doc(hidden)]
2967 impl gax::options::internal::RequestBuilder for ListSingleTenantHsmInstances {
2968 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2969 &mut self.0.options
2970 }
2971 }
2972
2973 #[derive(Clone, Debug)]
2990 pub struct GetSingleTenantHsmInstance(
2991 RequestBuilder<crate::model::GetSingleTenantHsmInstanceRequest>,
2992 );
2993
2994 impl GetSingleTenantHsmInstance {
2995 pub(crate) fn new(
2996 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
2997 ) -> Self {
2998 Self(RequestBuilder::new(stub))
2999 }
3000
3001 pub fn with_request<V: Into<crate::model::GetSingleTenantHsmInstanceRequest>>(
3003 mut self,
3004 v: V,
3005 ) -> Self {
3006 self.0.request = v.into();
3007 self
3008 }
3009
3010 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3012 self.0.options = v.into();
3013 self
3014 }
3015
3016 pub async fn send(self) -> Result<crate::model::SingleTenantHsmInstance> {
3018 (*self.0.stub)
3019 .get_single_tenant_hsm_instance(self.0.request, self.0.options)
3020 .await
3021 .map(gax::response::Response::into_body)
3022 }
3023
3024 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3028 self.0.request.name = v.into();
3029 self
3030 }
3031 }
3032
3033 #[doc(hidden)]
3034 impl gax::options::internal::RequestBuilder for GetSingleTenantHsmInstance {
3035 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3036 &mut self.0.options
3037 }
3038 }
3039
3040 #[derive(Clone, Debug)]
3058 pub struct CreateSingleTenantHsmInstance(
3059 RequestBuilder<crate::model::CreateSingleTenantHsmInstanceRequest>,
3060 );
3061
3062 impl CreateSingleTenantHsmInstance {
3063 pub(crate) fn new(
3064 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3065 ) -> Self {
3066 Self(RequestBuilder::new(stub))
3067 }
3068
3069 pub fn with_request<V: Into<crate::model::CreateSingleTenantHsmInstanceRequest>>(
3071 mut self,
3072 v: V,
3073 ) -> Self {
3074 self.0.request = v.into();
3075 self
3076 }
3077
3078 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3080 self.0.options = v.into();
3081 self
3082 }
3083
3084 pub async fn send(self) -> Result<longrunning::model::Operation> {
3091 (*self.0.stub)
3092 .create_single_tenant_hsm_instance(self.0.request, self.0.options)
3093 .await
3094 .map(gax::response::Response::into_body)
3095 }
3096
3097 pub fn poller(
3099 self,
3100 ) -> impl lro::Poller<
3101 crate::model::SingleTenantHsmInstance,
3102 crate::model::CreateSingleTenantHsmInstanceMetadata,
3103 > {
3104 type Operation = lro::internal::Operation<
3105 crate::model::SingleTenantHsmInstance,
3106 crate::model::CreateSingleTenantHsmInstanceMetadata,
3107 >;
3108 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3109 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3110
3111 let stub = self.0.stub.clone();
3112 let mut options = self.0.options.clone();
3113 options.set_retry_policy(gax::retry_policy::NeverRetry);
3114 let query = move |name| {
3115 let stub = stub.clone();
3116 let options = options.clone();
3117 async {
3118 let op = GetOperation::new(stub)
3119 .set_name(name)
3120 .with_options(options)
3121 .send()
3122 .await?;
3123 Ok(Operation::new(op))
3124 }
3125 };
3126
3127 let start = move || async {
3128 let op = self.send().await?;
3129 Ok(Operation::new(op))
3130 };
3131
3132 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3133 }
3134
3135 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3139 self.0.request.parent = v.into();
3140 self
3141 }
3142
3143 pub fn set_single_tenant_hsm_instance_id<T: Into<std::string::String>>(
3145 mut self,
3146 v: T,
3147 ) -> Self {
3148 self.0.request.single_tenant_hsm_instance_id = v.into();
3149 self
3150 }
3151
3152 pub fn set_single_tenant_hsm_instance<T>(mut self, v: T) -> Self
3156 where
3157 T: std::convert::Into<crate::model::SingleTenantHsmInstance>,
3158 {
3159 self.0.request.single_tenant_hsm_instance = std::option::Option::Some(v.into());
3160 self
3161 }
3162
3163 pub fn set_or_clear_single_tenant_hsm_instance<T>(
3167 mut self,
3168 v: std::option::Option<T>,
3169 ) -> Self
3170 where
3171 T: std::convert::Into<crate::model::SingleTenantHsmInstance>,
3172 {
3173 self.0.request.single_tenant_hsm_instance = v.map(|x| x.into());
3174 self
3175 }
3176 }
3177
3178 #[doc(hidden)]
3179 impl gax::options::internal::RequestBuilder for CreateSingleTenantHsmInstance {
3180 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3181 &mut self.0.options
3182 }
3183 }
3184
3185 #[derive(Clone, Debug)]
3203 pub struct CreateSingleTenantHsmInstanceProposal(
3204 RequestBuilder<crate::model::CreateSingleTenantHsmInstanceProposalRequest>,
3205 );
3206
3207 impl CreateSingleTenantHsmInstanceProposal {
3208 pub(crate) fn new(
3209 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3210 ) -> Self {
3211 Self(RequestBuilder::new(stub))
3212 }
3213
3214 pub fn with_request<V: Into<crate::model::CreateSingleTenantHsmInstanceProposalRequest>>(
3216 mut self,
3217 v: V,
3218 ) -> Self {
3219 self.0.request = v.into();
3220 self
3221 }
3222
3223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3225 self.0.options = v.into();
3226 self
3227 }
3228
3229 pub async fn send(self) -> Result<longrunning::model::Operation> {
3236 (*self.0.stub)
3237 .create_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3238 .await
3239 .map(gax::response::Response::into_body)
3240 }
3241
3242 pub fn poller(
3244 self,
3245 ) -> impl lro::Poller<
3246 crate::model::SingleTenantHsmInstanceProposal,
3247 crate::model::CreateSingleTenantHsmInstanceProposalMetadata,
3248 > {
3249 type Operation = lro::internal::Operation<
3250 crate::model::SingleTenantHsmInstanceProposal,
3251 crate::model::CreateSingleTenantHsmInstanceProposalMetadata,
3252 >;
3253 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3254 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3255
3256 let stub = self.0.stub.clone();
3257 let mut options = self.0.options.clone();
3258 options.set_retry_policy(gax::retry_policy::NeverRetry);
3259 let query = move |name| {
3260 let stub = stub.clone();
3261 let options = options.clone();
3262 async {
3263 let op = GetOperation::new(stub)
3264 .set_name(name)
3265 .with_options(options)
3266 .send()
3267 .await?;
3268 Ok(Operation::new(op))
3269 }
3270 };
3271
3272 let start = move || async {
3273 let op = self.send().await?;
3274 Ok(Operation::new(op))
3275 };
3276
3277 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3278 }
3279
3280 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3284 self.0.request.parent = v.into();
3285 self
3286 }
3287
3288 pub fn set_single_tenant_hsm_instance_proposal_id<T: Into<std::string::String>>(
3290 mut self,
3291 v: T,
3292 ) -> Self {
3293 self.0.request.single_tenant_hsm_instance_proposal_id = v.into();
3294 self
3295 }
3296
3297 pub fn set_single_tenant_hsm_instance_proposal<T>(mut self, v: T) -> Self
3301 where
3302 T: std::convert::Into<crate::model::SingleTenantHsmInstanceProposal>,
3303 {
3304 self.0.request.single_tenant_hsm_instance_proposal =
3305 std::option::Option::Some(v.into());
3306 self
3307 }
3308
3309 pub fn set_or_clear_single_tenant_hsm_instance_proposal<T>(
3313 mut self,
3314 v: std::option::Option<T>,
3315 ) -> Self
3316 where
3317 T: std::convert::Into<crate::model::SingleTenantHsmInstanceProposal>,
3318 {
3319 self.0.request.single_tenant_hsm_instance_proposal = v.map(|x| x.into());
3320 self
3321 }
3322 }
3323
3324 #[doc(hidden)]
3325 impl gax::options::internal::RequestBuilder for CreateSingleTenantHsmInstanceProposal {
3326 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3327 &mut self.0.options
3328 }
3329 }
3330
3331 #[derive(Clone, Debug)]
3348 pub struct ApproveSingleTenantHsmInstanceProposal(
3349 RequestBuilder<crate::model::ApproveSingleTenantHsmInstanceProposalRequest>,
3350 );
3351
3352 impl ApproveSingleTenantHsmInstanceProposal {
3353 pub(crate) fn new(
3354 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3355 ) -> Self {
3356 Self(RequestBuilder::new(stub))
3357 }
3358
3359 pub fn with_request<
3361 V: Into<crate::model::ApproveSingleTenantHsmInstanceProposalRequest>,
3362 >(
3363 mut self,
3364 v: V,
3365 ) -> Self {
3366 self.0.request = v.into();
3367 self
3368 }
3369
3370 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3372 self.0.options = v.into();
3373 self
3374 }
3375
3376 pub async fn send(
3378 self,
3379 ) -> Result<crate::model::ApproveSingleTenantHsmInstanceProposalResponse> {
3380 (*self.0.stub)
3381 .approve_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3382 .await
3383 .map(gax::response::Response::into_body)
3384 }
3385
3386 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3390 self.0.request.name = v.into();
3391 self
3392 }
3393
3394 pub fn set_approval_payload<T: Into<Option<crate::model::approve_single_tenant_hsm_instance_proposal_request::ApprovalPayload>>>(mut self, v: T) ->Self{
3399 self.0.request.approval_payload = v.into();
3400 self
3401 }
3402
3403 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{
3409 self.0.request = self.0.request.set_quorum_reply(v);
3410 self
3411 }
3412
3413 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{
3419 self.0.request = self.0.request.set_required_action_quorum_reply(v);
3420 self
3421 }
3422 }
3423
3424 #[doc(hidden)]
3425 impl gax::options::internal::RequestBuilder for ApproveSingleTenantHsmInstanceProposal {
3426 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3427 &mut self.0.options
3428 }
3429 }
3430
3431 #[derive(Clone, Debug)]
3449 pub struct ExecuteSingleTenantHsmInstanceProposal(
3450 RequestBuilder<crate::model::ExecuteSingleTenantHsmInstanceProposalRequest>,
3451 );
3452
3453 impl ExecuteSingleTenantHsmInstanceProposal {
3454 pub(crate) fn new(
3455 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3456 ) -> Self {
3457 Self(RequestBuilder::new(stub))
3458 }
3459
3460 pub fn with_request<
3462 V: Into<crate::model::ExecuteSingleTenantHsmInstanceProposalRequest>,
3463 >(
3464 mut self,
3465 v: V,
3466 ) -> Self {
3467 self.0.request = v.into();
3468 self
3469 }
3470
3471 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3473 self.0.options = v.into();
3474 self
3475 }
3476
3477 pub async fn send(self) -> Result<longrunning::model::Operation> {
3484 (*self.0.stub)
3485 .execute_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3486 .await
3487 .map(gax::response::Response::into_body)
3488 }
3489
3490 pub fn poller(
3492 self,
3493 ) -> impl lro::Poller<
3494 crate::model::ExecuteSingleTenantHsmInstanceProposalResponse,
3495 crate::model::ExecuteSingleTenantHsmInstanceProposalMetadata,
3496 > {
3497 type Operation = lro::internal::Operation<
3498 crate::model::ExecuteSingleTenantHsmInstanceProposalResponse,
3499 crate::model::ExecuteSingleTenantHsmInstanceProposalMetadata,
3500 >;
3501 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3502 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3503
3504 let stub = self.0.stub.clone();
3505 let mut options = self.0.options.clone();
3506 options.set_retry_policy(gax::retry_policy::NeverRetry);
3507 let query = move |name| {
3508 let stub = stub.clone();
3509 let options = options.clone();
3510 async {
3511 let op = GetOperation::new(stub)
3512 .set_name(name)
3513 .with_options(options)
3514 .send()
3515 .await?;
3516 Ok(Operation::new(op))
3517 }
3518 };
3519
3520 let start = move || async {
3521 let op = self.send().await?;
3522 Ok(Operation::new(op))
3523 };
3524
3525 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3526 }
3527
3528 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3532 self.0.request.name = v.into();
3533 self
3534 }
3535 }
3536
3537 #[doc(hidden)]
3538 impl gax::options::internal::RequestBuilder for ExecuteSingleTenantHsmInstanceProposal {
3539 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3540 &mut self.0.options
3541 }
3542 }
3543
3544 #[derive(Clone, Debug)]
3561 pub struct GetSingleTenantHsmInstanceProposal(
3562 RequestBuilder<crate::model::GetSingleTenantHsmInstanceProposalRequest>,
3563 );
3564
3565 impl GetSingleTenantHsmInstanceProposal {
3566 pub(crate) fn new(
3567 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3568 ) -> Self {
3569 Self(RequestBuilder::new(stub))
3570 }
3571
3572 pub fn with_request<V: Into<crate::model::GetSingleTenantHsmInstanceProposalRequest>>(
3574 mut self,
3575 v: V,
3576 ) -> Self {
3577 self.0.request = v.into();
3578 self
3579 }
3580
3581 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3583 self.0.options = v.into();
3584 self
3585 }
3586
3587 pub async fn send(self) -> Result<crate::model::SingleTenantHsmInstanceProposal> {
3589 (*self.0.stub)
3590 .get_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3591 .await
3592 .map(gax::response::Response::into_body)
3593 }
3594
3595 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3599 self.0.request.name = v.into();
3600 self
3601 }
3602 }
3603
3604 #[doc(hidden)]
3605 impl gax::options::internal::RequestBuilder for GetSingleTenantHsmInstanceProposal {
3606 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3607 &mut self.0.options
3608 }
3609 }
3610
3611 #[derive(Clone, Debug)]
3632 pub struct ListSingleTenantHsmInstanceProposals(
3633 RequestBuilder<crate::model::ListSingleTenantHsmInstanceProposalsRequest>,
3634 );
3635
3636 impl ListSingleTenantHsmInstanceProposals {
3637 pub(crate) fn new(
3638 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3639 ) -> Self {
3640 Self(RequestBuilder::new(stub))
3641 }
3642
3643 pub fn with_request<V: Into<crate::model::ListSingleTenantHsmInstanceProposalsRequest>>(
3645 mut self,
3646 v: V,
3647 ) -> Self {
3648 self.0.request = v.into();
3649 self
3650 }
3651
3652 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3654 self.0.options = v.into();
3655 self
3656 }
3657
3658 pub async fn send(
3660 self,
3661 ) -> Result<crate::model::ListSingleTenantHsmInstanceProposalsResponse> {
3662 (*self.0.stub)
3663 .list_single_tenant_hsm_instance_proposals(self.0.request, self.0.options)
3664 .await
3665 .map(gax::response::Response::into_body)
3666 }
3667
3668 pub fn by_page(
3670 self,
3671 ) -> impl gax::paginator::Paginator<
3672 crate::model::ListSingleTenantHsmInstanceProposalsResponse,
3673 gax::error::Error,
3674 > {
3675 use std::clone::Clone;
3676 let token = self.0.request.page_token.clone();
3677 let execute = move |token: String| {
3678 let mut builder = self.clone();
3679 builder.0.request = builder.0.request.set_page_token(token);
3680 builder.send()
3681 };
3682 gax::paginator::internal::new_paginator(token, execute)
3683 }
3684
3685 pub fn by_item(
3687 self,
3688 ) -> impl gax::paginator::ItemPaginator<
3689 crate::model::ListSingleTenantHsmInstanceProposalsResponse,
3690 gax::error::Error,
3691 > {
3692 use gax::paginator::Paginator;
3693 self.by_page().items()
3694 }
3695
3696 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3700 self.0.request.parent = v.into();
3701 self
3702 }
3703
3704 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3706 self.0.request.page_size = v.into();
3707 self
3708 }
3709
3710 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3712 self.0.request.page_token = v.into();
3713 self
3714 }
3715
3716 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3718 self.0.request.filter = v.into();
3719 self
3720 }
3721
3722 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3724 self.0.request.order_by = v.into();
3725 self
3726 }
3727
3728 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
3730 self.0.request.show_deleted = v.into();
3731 self
3732 }
3733 }
3734
3735 #[doc(hidden)]
3736 impl gax::options::internal::RequestBuilder for ListSingleTenantHsmInstanceProposals {
3737 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3738 &mut self.0.options
3739 }
3740 }
3741
3742 #[derive(Clone, Debug)]
3759 pub struct DeleteSingleTenantHsmInstanceProposal(
3760 RequestBuilder<crate::model::DeleteSingleTenantHsmInstanceProposalRequest>,
3761 );
3762
3763 impl DeleteSingleTenantHsmInstanceProposal {
3764 pub(crate) fn new(
3765 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3766 ) -> Self {
3767 Self(RequestBuilder::new(stub))
3768 }
3769
3770 pub fn with_request<V: Into<crate::model::DeleteSingleTenantHsmInstanceProposalRequest>>(
3772 mut self,
3773 v: V,
3774 ) -> Self {
3775 self.0.request = v.into();
3776 self
3777 }
3778
3779 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3781 self.0.options = v.into();
3782 self
3783 }
3784
3785 pub async fn send(self) -> Result<()> {
3787 (*self.0.stub)
3788 .delete_single_tenant_hsm_instance_proposal(self.0.request, self.0.options)
3789 .await
3790 .map(gax::response::Response::into_body)
3791 }
3792
3793 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3797 self.0.request.name = v.into();
3798 self
3799 }
3800 }
3801
3802 #[doc(hidden)]
3803 impl gax::options::internal::RequestBuilder for DeleteSingleTenantHsmInstanceProposal {
3804 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3805 &mut self.0.options
3806 }
3807 }
3808
3809 #[derive(Clone, Debug)]
3830 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3831
3832 impl ListLocations {
3833 pub(crate) fn new(
3834 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3835 ) -> Self {
3836 Self(RequestBuilder::new(stub))
3837 }
3838
3839 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3841 mut self,
3842 v: V,
3843 ) -> Self {
3844 self.0.request = v.into();
3845 self
3846 }
3847
3848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3850 self.0.options = v.into();
3851 self
3852 }
3853
3854 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3856 (*self.0.stub)
3857 .list_locations(self.0.request, self.0.options)
3858 .await
3859 .map(gax::response::Response::into_body)
3860 }
3861
3862 pub fn by_page(
3864 self,
3865 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3866 {
3867 use std::clone::Clone;
3868 let token = self.0.request.page_token.clone();
3869 let execute = move |token: String| {
3870 let mut builder = self.clone();
3871 builder.0.request = builder.0.request.set_page_token(token);
3872 builder.send()
3873 };
3874 gax::paginator::internal::new_paginator(token, execute)
3875 }
3876
3877 pub fn by_item(
3879 self,
3880 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3881 {
3882 use gax::paginator::Paginator;
3883 self.by_page().items()
3884 }
3885
3886 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3888 self.0.request.name = v.into();
3889 self
3890 }
3891
3892 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3894 self.0.request.filter = v.into();
3895 self
3896 }
3897
3898 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3900 self.0.request.page_size = v.into();
3901 self
3902 }
3903
3904 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3906 self.0.request.page_token = v.into();
3907 self
3908 }
3909 }
3910
3911 #[doc(hidden)]
3912 impl gax::options::internal::RequestBuilder for ListLocations {
3913 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3914 &mut self.0.options
3915 }
3916 }
3917
3918 #[derive(Clone, Debug)]
3935 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3936
3937 impl GetLocation {
3938 pub(crate) fn new(
3939 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
3940 ) -> Self {
3941 Self(RequestBuilder::new(stub))
3942 }
3943
3944 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3946 self.0.request = v.into();
3947 self
3948 }
3949
3950 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3952 self.0.options = v.into();
3953 self
3954 }
3955
3956 pub async fn send(self) -> Result<location::model::Location> {
3958 (*self.0.stub)
3959 .get_location(self.0.request, self.0.options)
3960 .await
3961 .map(gax::response::Response::into_body)
3962 }
3963
3964 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3966 self.0.request.name = v.into();
3967 self
3968 }
3969 }
3970
3971 #[doc(hidden)]
3972 impl gax::options::internal::RequestBuilder for GetLocation {
3973 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3974 &mut self.0.options
3975 }
3976 }
3977
3978 #[derive(Clone, Debug)]
3995 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3996
3997 impl SetIamPolicy {
3998 pub(crate) fn new(
3999 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4000 ) -> Self {
4001 Self(RequestBuilder::new(stub))
4002 }
4003
4004 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4006 self.0.request = v.into();
4007 self
4008 }
4009
4010 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4012 self.0.options = v.into();
4013 self
4014 }
4015
4016 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4018 (*self.0.stub)
4019 .set_iam_policy(self.0.request, self.0.options)
4020 .await
4021 .map(gax::response::Response::into_body)
4022 }
4023
4024 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4028 self.0.request.resource = v.into();
4029 self
4030 }
4031
4032 pub fn set_policy<T>(mut self, v: T) -> Self
4036 where
4037 T: std::convert::Into<iam_v1::model::Policy>,
4038 {
4039 self.0.request.policy = std::option::Option::Some(v.into());
4040 self
4041 }
4042
4043 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4047 where
4048 T: std::convert::Into<iam_v1::model::Policy>,
4049 {
4050 self.0.request.policy = v.map(|x| x.into());
4051 self
4052 }
4053
4054 pub fn set_update_mask<T>(mut self, v: T) -> Self
4056 where
4057 T: std::convert::Into<wkt::FieldMask>,
4058 {
4059 self.0.request.update_mask = std::option::Option::Some(v.into());
4060 self
4061 }
4062
4063 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4065 where
4066 T: std::convert::Into<wkt::FieldMask>,
4067 {
4068 self.0.request.update_mask = v.map(|x| x.into());
4069 self
4070 }
4071 }
4072
4073 #[doc(hidden)]
4074 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4075 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4076 &mut self.0.options
4077 }
4078 }
4079
4080 #[derive(Clone, Debug)]
4097 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4098
4099 impl GetIamPolicy {
4100 pub(crate) fn new(
4101 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4102 ) -> Self {
4103 Self(RequestBuilder::new(stub))
4104 }
4105
4106 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4108 self.0.request = v.into();
4109 self
4110 }
4111
4112 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4114 self.0.options = v.into();
4115 self
4116 }
4117
4118 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4120 (*self.0.stub)
4121 .get_iam_policy(self.0.request, self.0.options)
4122 .await
4123 .map(gax::response::Response::into_body)
4124 }
4125
4126 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4130 self.0.request.resource = v.into();
4131 self
4132 }
4133
4134 pub fn set_options<T>(mut self, v: T) -> Self
4136 where
4137 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4138 {
4139 self.0.request.options = std::option::Option::Some(v.into());
4140 self
4141 }
4142
4143 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4145 where
4146 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4147 {
4148 self.0.request.options = v.map(|x| x.into());
4149 self
4150 }
4151 }
4152
4153 #[doc(hidden)]
4154 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4155 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4156 &mut self.0.options
4157 }
4158 }
4159
4160 #[derive(Clone, Debug)]
4177 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4178
4179 impl TestIamPermissions {
4180 pub(crate) fn new(
4181 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4182 ) -> Self {
4183 Self(RequestBuilder::new(stub))
4184 }
4185
4186 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4188 mut self,
4189 v: V,
4190 ) -> Self {
4191 self.0.request = v.into();
4192 self
4193 }
4194
4195 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4197 self.0.options = v.into();
4198 self
4199 }
4200
4201 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4203 (*self.0.stub)
4204 .test_iam_permissions(self.0.request, self.0.options)
4205 .await
4206 .map(gax::response::Response::into_body)
4207 }
4208
4209 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4213 self.0.request.resource = v.into();
4214 self
4215 }
4216
4217 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4221 where
4222 T: std::iter::IntoIterator<Item = V>,
4223 V: std::convert::Into<std::string::String>,
4224 {
4225 use std::iter::Iterator;
4226 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4227 self
4228 }
4229 }
4230
4231 #[doc(hidden)]
4232 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4234 &mut self.0.options
4235 }
4236 }
4237
4238 #[derive(Clone, Debug)]
4255 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4256
4257 impl GetOperation {
4258 pub(crate) fn new(
4259 stub: std::sync::Arc<dyn super::super::stub::dynamic::HsmManagement>,
4260 ) -> Self {
4261 Self(RequestBuilder::new(stub))
4262 }
4263
4264 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4266 mut self,
4267 v: V,
4268 ) -> Self {
4269 self.0.request = v.into();
4270 self
4271 }
4272
4273 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4275 self.0.options = v.into();
4276 self
4277 }
4278
4279 pub async fn send(self) -> Result<longrunning::model::Operation> {
4281 (*self.0.stub)
4282 .get_operation(self.0.request, self.0.options)
4283 .await
4284 .map(gax::response::Response::into_body)
4285 }
4286
4287 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4289 self.0.request.name = v.into();
4290 self
4291 }
4292 }
4293
4294 #[doc(hidden)]
4295 impl gax::options::internal::RequestBuilder for GetOperation {
4296 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4297 &mut self.0.options
4298 }
4299 }
4300}
4301
4302pub mod key_management_service {
4303 use crate::Result;
4304
4305 pub type ClientBuilder =
4319 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4320
4321 pub(crate) mod client {
4322 use super::super::super::client::KeyManagementService;
4323 pub struct Factory;
4324 impl gax::client_builder::internal::ClientFactory for Factory {
4325 type Client = KeyManagementService;
4326 type Credentials = gaxi::options::Credentials;
4327 async fn build(
4328 self,
4329 config: gaxi::options::ClientConfig,
4330 ) -> gax::client_builder::Result<Self::Client> {
4331 Self::Client::new(config).await
4332 }
4333 }
4334 }
4335
4336 #[derive(Clone, Debug)]
4338 pub(crate) struct RequestBuilder<R: std::default::Default> {
4339 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4340 request: R,
4341 options: gax::options::RequestOptions,
4342 }
4343
4344 impl<R> RequestBuilder<R>
4345 where
4346 R: std::default::Default,
4347 {
4348 pub(crate) fn new(
4349 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4350 ) -> Self {
4351 Self {
4352 stub,
4353 request: R::default(),
4354 options: gax::options::RequestOptions::default(),
4355 }
4356 }
4357 }
4358
4359 #[derive(Clone, Debug)]
4380 pub struct ListKeyRings(RequestBuilder<crate::model::ListKeyRingsRequest>);
4381
4382 impl ListKeyRings {
4383 pub(crate) fn new(
4384 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4385 ) -> Self {
4386 Self(RequestBuilder::new(stub))
4387 }
4388
4389 pub fn with_request<V: Into<crate::model::ListKeyRingsRequest>>(mut self, v: V) -> Self {
4391 self.0.request = v.into();
4392 self
4393 }
4394
4395 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4397 self.0.options = v.into();
4398 self
4399 }
4400
4401 pub async fn send(self) -> Result<crate::model::ListKeyRingsResponse> {
4403 (*self.0.stub)
4404 .list_key_rings(self.0.request, self.0.options)
4405 .await
4406 .map(gax::response::Response::into_body)
4407 }
4408
4409 pub fn by_page(
4411 self,
4412 ) -> impl gax::paginator::Paginator<crate::model::ListKeyRingsResponse, gax::error::Error>
4413 {
4414 use std::clone::Clone;
4415 let token = self.0.request.page_token.clone();
4416 let execute = move |token: String| {
4417 let mut builder = self.clone();
4418 builder.0.request = builder.0.request.set_page_token(token);
4419 builder.send()
4420 };
4421 gax::paginator::internal::new_paginator(token, execute)
4422 }
4423
4424 pub fn by_item(
4426 self,
4427 ) -> impl gax::paginator::ItemPaginator<crate::model::ListKeyRingsResponse, gax::error::Error>
4428 {
4429 use gax::paginator::Paginator;
4430 self.by_page().items()
4431 }
4432
4433 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4437 self.0.request.parent = v.into();
4438 self
4439 }
4440
4441 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4443 self.0.request.page_size = v.into();
4444 self
4445 }
4446
4447 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4449 self.0.request.page_token = v.into();
4450 self
4451 }
4452
4453 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4455 self.0.request.filter = v.into();
4456 self
4457 }
4458
4459 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4461 self.0.request.order_by = v.into();
4462 self
4463 }
4464 }
4465
4466 #[doc(hidden)]
4467 impl gax::options::internal::RequestBuilder for ListKeyRings {
4468 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4469 &mut self.0.options
4470 }
4471 }
4472
4473 #[derive(Clone, Debug)]
4494 pub struct ListCryptoKeys(RequestBuilder<crate::model::ListCryptoKeysRequest>);
4495
4496 impl ListCryptoKeys {
4497 pub(crate) fn new(
4498 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4499 ) -> Self {
4500 Self(RequestBuilder::new(stub))
4501 }
4502
4503 pub fn with_request<V: Into<crate::model::ListCryptoKeysRequest>>(mut self, v: V) -> Self {
4505 self.0.request = v.into();
4506 self
4507 }
4508
4509 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4511 self.0.options = v.into();
4512 self
4513 }
4514
4515 pub async fn send(self) -> Result<crate::model::ListCryptoKeysResponse> {
4517 (*self.0.stub)
4518 .list_crypto_keys(self.0.request, self.0.options)
4519 .await
4520 .map(gax::response::Response::into_body)
4521 }
4522
4523 pub fn by_page(
4525 self,
4526 ) -> impl gax::paginator::Paginator<crate::model::ListCryptoKeysResponse, gax::error::Error>
4527 {
4528 use std::clone::Clone;
4529 let token = self.0.request.page_token.clone();
4530 let execute = move |token: String| {
4531 let mut builder = self.clone();
4532 builder.0.request = builder.0.request.set_page_token(token);
4533 builder.send()
4534 };
4535 gax::paginator::internal::new_paginator(token, execute)
4536 }
4537
4538 pub fn by_item(
4540 self,
4541 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCryptoKeysResponse, gax::error::Error>
4542 {
4543 use gax::paginator::Paginator;
4544 self.by_page().items()
4545 }
4546
4547 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4551 self.0.request.parent = v.into();
4552 self
4553 }
4554
4555 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4557 self.0.request.page_size = v.into();
4558 self
4559 }
4560
4561 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4563 self.0.request.page_token = v.into();
4564 self
4565 }
4566
4567 pub fn set_version_view<T: Into<crate::model::crypto_key_version::CryptoKeyVersionView>>(
4569 mut self,
4570 v: T,
4571 ) -> Self {
4572 self.0.request.version_view = v.into();
4573 self
4574 }
4575
4576 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4578 self.0.request.filter = v.into();
4579 self
4580 }
4581
4582 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4584 self.0.request.order_by = v.into();
4585 self
4586 }
4587 }
4588
4589 #[doc(hidden)]
4590 impl gax::options::internal::RequestBuilder for ListCryptoKeys {
4591 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4592 &mut self.0.options
4593 }
4594 }
4595
4596 #[derive(Clone, Debug)]
4617 pub struct ListCryptoKeyVersions(RequestBuilder<crate::model::ListCryptoKeyVersionsRequest>);
4618
4619 impl ListCryptoKeyVersions {
4620 pub(crate) fn new(
4621 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4622 ) -> Self {
4623 Self(RequestBuilder::new(stub))
4624 }
4625
4626 pub fn with_request<V: Into<crate::model::ListCryptoKeyVersionsRequest>>(
4628 mut self,
4629 v: V,
4630 ) -> Self {
4631 self.0.request = v.into();
4632 self
4633 }
4634
4635 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4637 self.0.options = v.into();
4638 self
4639 }
4640
4641 pub async fn send(self) -> Result<crate::model::ListCryptoKeyVersionsResponse> {
4643 (*self.0.stub)
4644 .list_crypto_key_versions(self.0.request, self.0.options)
4645 .await
4646 .map(gax::response::Response::into_body)
4647 }
4648
4649 pub fn by_page(
4651 self,
4652 ) -> impl gax::paginator::Paginator<crate::model::ListCryptoKeyVersionsResponse, gax::error::Error>
4653 {
4654 use std::clone::Clone;
4655 let token = self.0.request.page_token.clone();
4656 let execute = move |token: String| {
4657 let mut builder = self.clone();
4658 builder.0.request = builder.0.request.set_page_token(token);
4659 builder.send()
4660 };
4661 gax::paginator::internal::new_paginator(token, execute)
4662 }
4663
4664 pub fn by_item(
4666 self,
4667 ) -> impl gax::paginator::ItemPaginator<
4668 crate::model::ListCryptoKeyVersionsResponse,
4669 gax::error::Error,
4670 > {
4671 use gax::paginator::Paginator;
4672 self.by_page().items()
4673 }
4674
4675 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4679 self.0.request.parent = v.into();
4680 self
4681 }
4682
4683 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4685 self.0.request.page_size = v.into();
4686 self
4687 }
4688
4689 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4691 self.0.request.page_token = v.into();
4692 self
4693 }
4694
4695 pub fn set_view<T: Into<crate::model::crypto_key_version::CryptoKeyVersionView>>(
4697 mut self,
4698 v: T,
4699 ) -> Self {
4700 self.0.request.view = v.into();
4701 self
4702 }
4703
4704 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4706 self.0.request.filter = v.into();
4707 self
4708 }
4709
4710 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4712 self.0.request.order_by = v.into();
4713 self
4714 }
4715 }
4716
4717 #[doc(hidden)]
4718 impl gax::options::internal::RequestBuilder for ListCryptoKeyVersions {
4719 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4720 &mut self.0.options
4721 }
4722 }
4723
4724 #[derive(Clone, Debug)]
4745 pub struct ListImportJobs(RequestBuilder<crate::model::ListImportJobsRequest>);
4746
4747 impl ListImportJobs {
4748 pub(crate) fn new(
4749 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4750 ) -> Self {
4751 Self(RequestBuilder::new(stub))
4752 }
4753
4754 pub fn with_request<V: Into<crate::model::ListImportJobsRequest>>(mut self, v: V) -> Self {
4756 self.0.request = v.into();
4757 self
4758 }
4759
4760 pub fn with_options<V: Into<gax::options::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::ListImportJobsResponse> {
4768 (*self.0.stub)
4769 .list_import_jobs(self.0.request, self.0.options)
4770 .await
4771 .map(gax::response::Response::into_body)
4772 }
4773
4774 pub fn by_page(
4776 self,
4777 ) -> impl gax::paginator::Paginator<crate::model::ListImportJobsResponse, gax::error::Error>
4778 {
4779 use std::clone::Clone;
4780 let token = self.0.request.page_token.clone();
4781 let execute = move |token: String| {
4782 let mut builder = self.clone();
4783 builder.0.request = builder.0.request.set_page_token(token);
4784 builder.send()
4785 };
4786 gax::paginator::internal::new_paginator(token, execute)
4787 }
4788
4789 pub fn by_item(
4791 self,
4792 ) -> impl gax::paginator::ItemPaginator<crate::model::ListImportJobsResponse, gax::error::Error>
4793 {
4794 use gax::paginator::Paginator;
4795 self.by_page().items()
4796 }
4797
4798 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4802 self.0.request.parent = v.into();
4803 self
4804 }
4805
4806 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4808 self.0.request.page_size = v.into();
4809 self
4810 }
4811
4812 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4814 self.0.request.page_token = v.into();
4815 self
4816 }
4817
4818 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4820 self.0.request.filter = v.into();
4821 self
4822 }
4823
4824 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4826 self.0.request.order_by = v.into();
4827 self
4828 }
4829 }
4830
4831 #[doc(hidden)]
4832 impl gax::options::internal::RequestBuilder for ListImportJobs {
4833 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4834 &mut self.0.options
4835 }
4836 }
4837
4838 #[derive(Clone, Debug)]
4855 pub struct GetKeyRing(RequestBuilder<crate::model::GetKeyRingRequest>);
4856
4857 impl GetKeyRing {
4858 pub(crate) fn new(
4859 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4860 ) -> Self {
4861 Self(RequestBuilder::new(stub))
4862 }
4863
4864 pub fn with_request<V: Into<crate::model::GetKeyRingRequest>>(mut self, v: V) -> Self {
4866 self.0.request = v.into();
4867 self
4868 }
4869
4870 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4872 self.0.options = v.into();
4873 self
4874 }
4875
4876 pub async fn send(self) -> Result<crate::model::KeyRing> {
4878 (*self.0.stub)
4879 .get_key_ring(self.0.request, self.0.options)
4880 .await
4881 .map(gax::response::Response::into_body)
4882 }
4883
4884 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4888 self.0.request.name = v.into();
4889 self
4890 }
4891 }
4892
4893 #[doc(hidden)]
4894 impl gax::options::internal::RequestBuilder for GetKeyRing {
4895 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4896 &mut self.0.options
4897 }
4898 }
4899
4900 #[derive(Clone, Debug)]
4917 pub struct GetCryptoKey(RequestBuilder<crate::model::GetCryptoKeyRequest>);
4918
4919 impl GetCryptoKey {
4920 pub(crate) fn new(
4921 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4922 ) -> Self {
4923 Self(RequestBuilder::new(stub))
4924 }
4925
4926 pub fn with_request<V: Into<crate::model::GetCryptoKeyRequest>>(mut self, v: V) -> Self {
4928 self.0.request = v.into();
4929 self
4930 }
4931
4932 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4934 self.0.options = v.into();
4935 self
4936 }
4937
4938 pub async fn send(self) -> Result<crate::model::CryptoKey> {
4940 (*self.0.stub)
4941 .get_crypto_key(self.0.request, self.0.options)
4942 .await
4943 .map(gax::response::Response::into_body)
4944 }
4945
4946 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4950 self.0.request.name = v.into();
4951 self
4952 }
4953 }
4954
4955 #[doc(hidden)]
4956 impl gax::options::internal::RequestBuilder for GetCryptoKey {
4957 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4958 &mut self.0.options
4959 }
4960 }
4961
4962 #[derive(Clone, Debug)]
4979 pub struct GetCryptoKeyVersion(RequestBuilder<crate::model::GetCryptoKeyVersionRequest>);
4980
4981 impl GetCryptoKeyVersion {
4982 pub(crate) fn new(
4983 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4984 ) -> Self {
4985 Self(RequestBuilder::new(stub))
4986 }
4987
4988 pub fn with_request<V: Into<crate::model::GetCryptoKeyVersionRequest>>(
4990 mut self,
4991 v: V,
4992 ) -> Self {
4993 self.0.request = v.into();
4994 self
4995 }
4996
4997 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4999 self.0.options = v.into();
5000 self
5001 }
5002
5003 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
5005 (*self.0.stub)
5006 .get_crypto_key_version(self.0.request, self.0.options)
5007 .await
5008 .map(gax::response::Response::into_body)
5009 }
5010
5011 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5015 self.0.request.name = v.into();
5016 self
5017 }
5018 }
5019
5020 #[doc(hidden)]
5021 impl gax::options::internal::RequestBuilder for GetCryptoKeyVersion {
5022 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5023 &mut self.0.options
5024 }
5025 }
5026
5027 #[derive(Clone, Debug)]
5044 pub struct GetPublicKey(RequestBuilder<crate::model::GetPublicKeyRequest>);
5045
5046 impl GetPublicKey {
5047 pub(crate) fn new(
5048 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5049 ) -> Self {
5050 Self(RequestBuilder::new(stub))
5051 }
5052
5053 pub fn with_request<V: Into<crate::model::GetPublicKeyRequest>>(mut self, v: V) -> Self {
5055 self.0.request = v.into();
5056 self
5057 }
5058
5059 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5061 self.0.options = v.into();
5062 self
5063 }
5064
5065 pub async fn send(self) -> Result<crate::model::PublicKey> {
5067 (*self.0.stub)
5068 .get_public_key(self.0.request, self.0.options)
5069 .await
5070 .map(gax::response::Response::into_body)
5071 }
5072
5073 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5077 self.0.request.name = v.into();
5078 self
5079 }
5080
5081 pub fn set_public_key_format<T: Into<crate::model::public_key::PublicKeyFormat>>(
5083 mut self,
5084 v: T,
5085 ) -> Self {
5086 self.0.request.public_key_format = v.into();
5087 self
5088 }
5089 }
5090
5091 #[doc(hidden)]
5092 impl gax::options::internal::RequestBuilder for GetPublicKey {
5093 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5094 &mut self.0.options
5095 }
5096 }
5097
5098 #[derive(Clone, Debug)]
5115 pub struct GetImportJob(RequestBuilder<crate::model::GetImportJobRequest>);
5116
5117 impl GetImportJob {
5118 pub(crate) fn new(
5119 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5120 ) -> Self {
5121 Self(RequestBuilder::new(stub))
5122 }
5123
5124 pub fn with_request<V: Into<crate::model::GetImportJobRequest>>(mut self, v: V) -> Self {
5126 self.0.request = v.into();
5127 self
5128 }
5129
5130 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5132 self.0.options = v.into();
5133 self
5134 }
5135
5136 pub async fn send(self) -> Result<crate::model::ImportJob> {
5138 (*self.0.stub)
5139 .get_import_job(self.0.request, self.0.options)
5140 .await
5141 .map(gax::response::Response::into_body)
5142 }
5143
5144 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5148 self.0.request.name = v.into();
5149 self
5150 }
5151 }
5152
5153 #[doc(hidden)]
5154 impl gax::options::internal::RequestBuilder for GetImportJob {
5155 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5156 &mut self.0.options
5157 }
5158 }
5159
5160 #[derive(Clone, Debug)]
5177 pub struct CreateKeyRing(RequestBuilder<crate::model::CreateKeyRingRequest>);
5178
5179 impl CreateKeyRing {
5180 pub(crate) fn new(
5181 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5182 ) -> Self {
5183 Self(RequestBuilder::new(stub))
5184 }
5185
5186 pub fn with_request<V: Into<crate::model::CreateKeyRingRequest>>(mut self, v: V) -> Self {
5188 self.0.request = v.into();
5189 self
5190 }
5191
5192 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5194 self.0.options = v.into();
5195 self
5196 }
5197
5198 pub async fn send(self) -> Result<crate::model::KeyRing> {
5200 (*self.0.stub)
5201 .create_key_ring(self.0.request, self.0.options)
5202 .await
5203 .map(gax::response::Response::into_body)
5204 }
5205
5206 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5210 self.0.request.parent = v.into();
5211 self
5212 }
5213
5214 pub fn set_key_ring_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5218 self.0.request.key_ring_id = v.into();
5219 self
5220 }
5221
5222 pub fn set_key_ring<T>(mut self, v: T) -> Self
5226 where
5227 T: std::convert::Into<crate::model::KeyRing>,
5228 {
5229 self.0.request.key_ring = std::option::Option::Some(v.into());
5230 self
5231 }
5232
5233 pub fn set_or_clear_key_ring<T>(mut self, v: std::option::Option<T>) -> Self
5237 where
5238 T: std::convert::Into<crate::model::KeyRing>,
5239 {
5240 self.0.request.key_ring = v.map(|x| x.into());
5241 self
5242 }
5243 }
5244
5245 #[doc(hidden)]
5246 impl gax::options::internal::RequestBuilder for CreateKeyRing {
5247 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5248 &mut self.0.options
5249 }
5250 }
5251
5252 #[derive(Clone, Debug)]
5269 pub struct CreateCryptoKey(RequestBuilder<crate::model::CreateCryptoKeyRequest>);
5270
5271 impl CreateCryptoKey {
5272 pub(crate) fn new(
5273 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5274 ) -> Self {
5275 Self(RequestBuilder::new(stub))
5276 }
5277
5278 pub fn with_request<V: Into<crate::model::CreateCryptoKeyRequest>>(mut self, v: V) -> Self {
5280 self.0.request = v.into();
5281 self
5282 }
5283
5284 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5286 self.0.options = v.into();
5287 self
5288 }
5289
5290 pub async fn send(self) -> Result<crate::model::CryptoKey> {
5292 (*self.0.stub)
5293 .create_crypto_key(self.0.request, self.0.options)
5294 .await
5295 .map(gax::response::Response::into_body)
5296 }
5297
5298 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5302 self.0.request.parent = v.into();
5303 self
5304 }
5305
5306 pub fn set_crypto_key_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5310 self.0.request.crypto_key_id = v.into();
5311 self
5312 }
5313
5314 pub fn set_crypto_key<T>(mut self, v: T) -> Self
5318 where
5319 T: std::convert::Into<crate::model::CryptoKey>,
5320 {
5321 self.0.request.crypto_key = std::option::Option::Some(v.into());
5322 self
5323 }
5324
5325 pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
5329 where
5330 T: std::convert::Into<crate::model::CryptoKey>,
5331 {
5332 self.0.request.crypto_key = v.map(|x| x.into());
5333 self
5334 }
5335
5336 pub fn set_skip_initial_version_creation<T: Into<bool>>(mut self, v: T) -> Self {
5338 self.0.request.skip_initial_version_creation = v.into();
5339 self
5340 }
5341 }
5342
5343 #[doc(hidden)]
5344 impl gax::options::internal::RequestBuilder for CreateCryptoKey {
5345 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5346 &mut self.0.options
5347 }
5348 }
5349
5350 #[derive(Clone, Debug)]
5367 pub struct CreateCryptoKeyVersion(RequestBuilder<crate::model::CreateCryptoKeyVersionRequest>);
5368
5369 impl CreateCryptoKeyVersion {
5370 pub(crate) fn new(
5371 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5372 ) -> Self {
5373 Self(RequestBuilder::new(stub))
5374 }
5375
5376 pub fn with_request<V: Into<crate::model::CreateCryptoKeyVersionRequest>>(
5378 mut self,
5379 v: V,
5380 ) -> Self {
5381 self.0.request = v.into();
5382 self
5383 }
5384
5385 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5387 self.0.options = v.into();
5388 self
5389 }
5390
5391 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
5393 (*self.0.stub)
5394 .create_crypto_key_version(self.0.request, self.0.options)
5395 .await
5396 .map(gax::response::Response::into_body)
5397 }
5398
5399 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5403 self.0.request.parent = v.into();
5404 self
5405 }
5406
5407 pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
5411 where
5412 T: std::convert::Into<crate::model::CryptoKeyVersion>,
5413 {
5414 self.0.request.crypto_key_version = std::option::Option::Some(v.into());
5415 self
5416 }
5417
5418 pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
5422 where
5423 T: std::convert::Into<crate::model::CryptoKeyVersion>,
5424 {
5425 self.0.request.crypto_key_version = v.map(|x| x.into());
5426 self
5427 }
5428 }
5429
5430 #[doc(hidden)]
5431 impl gax::options::internal::RequestBuilder for CreateCryptoKeyVersion {
5432 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5433 &mut self.0.options
5434 }
5435 }
5436
5437 #[derive(Clone, Debug)]
5454 pub struct ImportCryptoKeyVersion(RequestBuilder<crate::model::ImportCryptoKeyVersionRequest>);
5455
5456 impl ImportCryptoKeyVersion {
5457 pub(crate) fn new(
5458 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5459 ) -> Self {
5460 Self(RequestBuilder::new(stub))
5461 }
5462
5463 pub fn with_request<V: Into<crate::model::ImportCryptoKeyVersionRequest>>(
5465 mut self,
5466 v: V,
5467 ) -> Self {
5468 self.0.request = v.into();
5469 self
5470 }
5471
5472 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5474 self.0.options = v.into();
5475 self
5476 }
5477
5478 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
5480 (*self.0.stub)
5481 .import_crypto_key_version(self.0.request, self.0.options)
5482 .await
5483 .map(gax::response::Response::into_body)
5484 }
5485
5486 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5490 self.0.request.parent = v.into();
5491 self
5492 }
5493
5494 pub fn set_crypto_key_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
5496 self.0.request.crypto_key_version = v.into();
5497 self
5498 }
5499
5500 pub fn set_algorithm<
5504 T: Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
5505 >(
5506 mut self,
5507 v: T,
5508 ) -> Self {
5509 self.0.request.algorithm = v.into();
5510 self
5511 }
5512
5513 pub fn set_import_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
5517 self.0.request.import_job = v.into();
5518 self
5519 }
5520
5521 pub fn set_wrapped_key<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5523 self.0.request.wrapped_key = v.into();
5524 self
5525 }
5526
5527 pub fn set_wrapped_key_material<
5532 T: Into<Option<crate::model::import_crypto_key_version_request::WrappedKeyMaterial>>,
5533 >(
5534 mut self,
5535 v: T,
5536 ) -> Self {
5537 self.0.request.wrapped_key_material = v.into();
5538 self
5539 }
5540
5541 pub fn set_rsa_aes_wrapped_key<T: std::convert::Into<::bytes::Bytes>>(
5547 mut self,
5548 v: T,
5549 ) -> Self {
5550 self.0.request = self.0.request.set_rsa_aes_wrapped_key(v);
5551 self
5552 }
5553 }
5554
5555 #[doc(hidden)]
5556 impl gax::options::internal::RequestBuilder for ImportCryptoKeyVersion {
5557 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5558 &mut self.0.options
5559 }
5560 }
5561
5562 #[derive(Clone, Debug)]
5579 pub struct CreateImportJob(RequestBuilder<crate::model::CreateImportJobRequest>);
5580
5581 impl CreateImportJob {
5582 pub(crate) fn new(
5583 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5584 ) -> Self {
5585 Self(RequestBuilder::new(stub))
5586 }
5587
5588 pub fn with_request<V: Into<crate::model::CreateImportJobRequest>>(mut self, v: V) -> Self {
5590 self.0.request = v.into();
5591 self
5592 }
5593
5594 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5596 self.0.options = v.into();
5597 self
5598 }
5599
5600 pub async fn send(self) -> Result<crate::model::ImportJob> {
5602 (*self.0.stub)
5603 .create_import_job(self.0.request, self.0.options)
5604 .await
5605 .map(gax::response::Response::into_body)
5606 }
5607
5608 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5612 self.0.request.parent = v.into();
5613 self
5614 }
5615
5616 pub fn set_import_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5620 self.0.request.import_job_id = v.into();
5621 self
5622 }
5623
5624 pub fn set_import_job<T>(mut self, v: T) -> Self
5628 where
5629 T: std::convert::Into<crate::model::ImportJob>,
5630 {
5631 self.0.request.import_job = std::option::Option::Some(v.into());
5632 self
5633 }
5634
5635 pub fn set_or_clear_import_job<T>(mut self, v: std::option::Option<T>) -> Self
5639 where
5640 T: std::convert::Into<crate::model::ImportJob>,
5641 {
5642 self.0.request.import_job = v.map(|x| x.into());
5643 self
5644 }
5645 }
5646
5647 #[doc(hidden)]
5648 impl gax::options::internal::RequestBuilder for CreateImportJob {
5649 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5650 &mut self.0.options
5651 }
5652 }
5653
5654 #[derive(Clone, Debug)]
5671 pub struct UpdateCryptoKey(RequestBuilder<crate::model::UpdateCryptoKeyRequest>);
5672
5673 impl UpdateCryptoKey {
5674 pub(crate) fn new(
5675 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5676 ) -> Self {
5677 Self(RequestBuilder::new(stub))
5678 }
5679
5680 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyRequest>>(mut self, v: V) -> Self {
5682 self.0.request = v.into();
5683 self
5684 }
5685
5686 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5688 self.0.options = v.into();
5689 self
5690 }
5691
5692 pub async fn send(self) -> Result<crate::model::CryptoKey> {
5694 (*self.0.stub)
5695 .update_crypto_key(self.0.request, self.0.options)
5696 .await
5697 .map(gax::response::Response::into_body)
5698 }
5699
5700 pub fn set_crypto_key<T>(mut self, v: T) -> Self
5704 where
5705 T: std::convert::Into<crate::model::CryptoKey>,
5706 {
5707 self.0.request.crypto_key = std::option::Option::Some(v.into());
5708 self
5709 }
5710
5711 pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
5715 where
5716 T: std::convert::Into<crate::model::CryptoKey>,
5717 {
5718 self.0.request.crypto_key = v.map(|x| x.into());
5719 self
5720 }
5721
5722 pub fn set_update_mask<T>(mut self, v: T) -> Self
5726 where
5727 T: std::convert::Into<wkt::FieldMask>,
5728 {
5729 self.0.request.update_mask = std::option::Option::Some(v.into());
5730 self
5731 }
5732
5733 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5737 where
5738 T: std::convert::Into<wkt::FieldMask>,
5739 {
5740 self.0.request.update_mask = v.map(|x| x.into());
5741 self
5742 }
5743 }
5744
5745 #[doc(hidden)]
5746 impl gax::options::internal::RequestBuilder for UpdateCryptoKey {
5747 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5748 &mut self.0.options
5749 }
5750 }
5751
5752 #[derive(Clone, Debug)]
5769 pub struct UpdateCryptoKeyVersion(RequestBuilder<crate::model::UpdateCryptoKeyVersionRequest>);
5770
5771 impl UpdateCryptoKeyVersion {
5772 pub(crate) fn new(
5773 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5774 ) -> Self {
5775 Self(RequestBuilder::new(stub))
5776 }
5777
5778 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyVersionRequest>>(
5780 mut self,
5781 v: V,
5782 ) -> Self {
5783 self.0.request = v.into();
5784 self
5785 }
5786
5787 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5789 self.0.options = v.into();
5790 self
5791 }
5792
5793 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
5795 (*self.0.stub)
5796 .update_crypto_key_version(self.0.request, self.0.options)
5797 .await
5798 .map(gax::response::Response::into_body)
5799 }
5800
5801 pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
5805 where
5806 T: std::convert::Into<crate::model::CryptoKeyVersion>,
5807 {
5808 self.0.request.crypto_key_version = std::option::Option::Some(v.into());
5809 self
5810 }
5811
5812 pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
5816 where
5817 T: std::convert::Into<crate::model::CryptoKeyVersion>,
5818 {
5819 self.0.request.crypto_key_version = v.map(|x| x.into());
5820 self
5821 }
5822
5823 pub fn set_update_mask<T>(mut self, v: T) -> Self
5827 where
5828 T: std::convert::Into<wkt::FieldMask>,
5829 {
5830 self.0.request.update_mask = std::option::Option::Some(v.into());
5831 self
5832 }
5833
5834 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5838 where
5839 T: std::convert::Into<wkt::FieldMask>,
5840 {
5841 self.0.request.update_mask = v.map(|x| x.into());
5842 self
5843 }
5844 }
5845
5846 #[doc(hidden)]
5847 impl gax::options::internal::RequestBuilder for UpdateCryptoKeyVersion {
5848 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5849 &mut self.0.options
5850 }
5851 }
5852
5853 #[derive(Clone, Debug)]
5870 pub struct UpdateCryptoKeyPrimaryVersion(
5871 RequestBuilder<crate::model::UpdateCryptoKeyPrimaryVersionRequest>,
5872 );
5873
5874 impl UpdateCryptoKeyPrimaryVersion {
5875 pub(crate) fn new(
5876 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5877 ) -> Self {
5878 Self(RequestBuilder::new(stub))
5879 }
5880
5881 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyPrimaryVersionRequest>>(
5883 mut self,
5884 v: V,
5885 ) -> Self {
5886 self.0.request = v.into();
5887 self
5888 }
5889
5890 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5892 self.0.options = v.into();
5893 self
5894 }
5895
5896 pub async fn send(self) -> Result<crate::model::CryptoKey> {
5898 (*self.0.stub)
5899 .update_crypto_key_primary_version(self.0.request, self.0.options)
5900 .await
5901 .map(gax::response::Response::into_body)
5902 }
5903
5904 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5908 self.0.request.name = v.into();
5909 self
5910 }
5911
5912 pub fn set_crypto_key_version_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5916 self.0.request.crypto_key_version_id = v.into();
5917 self
5918 }
5919 }
5920
5921 #[doc(hidden)]
5922 impl gax::options::internal::RequestBuilder for UpdateCryptoKeyPrimaryVersion {
5923 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5924 &mut self.0.options
5925 }
5926 }
5927
5928 #[derive(Clone, Debug)]
5945 pub struct DestroyCryptoKeyVersion(
5946 RequestBuilder<crate::model::DestroyCryptoKeyVersionRequest>,
5947 );
5948
5949 impl DestroyCryptoKeyVersion {
5950 pub(crate) fn new(
5951 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5952 ) -> Self {
5953 Self(RequestBuilder::new(stub))
5954 }
5955
5956 pub fn with_request<V: Into<crate::model::DestroyCryptoKeyVersionRequest>>(
5958 mut self,
5959 v: V,
5960 ) -> Self {
5961 self.0.request = v.into();
5962 self
5963 }
5964
5965 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5967 self.0.options = v.into();
5968 self
5969 }
5970
5971 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
5973 (*self.0.stub)
5974 .destroy_crypto_key_version(self.0.request, self.0.options)
5975 .await
5976 .map(gax::response::Response::into_body)
5977 }
5978
5979 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5983 self.0.request.name = v.into();
5984 self
5985 }
5986 }
5987
5988 #[doc(hidden)]
5989 impl gax::options::internal::RequestBuilder for DestroyCryptoKeyVersion {
5990 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5991 &mut self.0.options
5992 }
5993 }
5994
5995 #[derive(Clone, Debug)]
6012 pub struct RestoreCryptoKeyVersion(
6013 RequestBuilder<crate::model::RestoreCryptoKeyVersionRequest>,
6014 );
6015
6016 impl RestoreCryptoKeyVersion {
6017 pub(crate) fn new(
6018 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6019 ) -> Self {
6020 Self(RequestBuilder::new(stub))
6021 }
6022
6023 pub fn with_request<V: Into<crate::model::RestoreCryptoKeyVersionRequest>>(
6025 mut self,
6026 v: V,
6027 ) -> Self {
6028 self.0.request = v.into();
6029 self
6030 }
6031
6032 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6034 self.0.options = v.into();
6035 self
6036 }
6037
6038 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
6040 (*self.0.stub)
6041 .restore_crypto_key_version(self.0.request, self.0.options)
6042 .await
6043 .map(gax::response::Response::into_body)
6044 }
6045
6046 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6050 self.0.request.name = v.into();
6051 self
6052 }
6053 }
6054
6055 #[doc(hidden)]
6056 impl gax::options::internal::RequestBuilder for RestoreCryptoKeyVersion {
6057 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6058 &mut self.0.options
6059 }
6060 }
6061
6062 #[derive(Clone, Debug)]
6079 pub struct Encrypt(RequestBuilder<crate::model::EncryptRequest>);
6080
6081 impl Encrypt {
6082 pub(crate) fn new(
6083 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6084 ) -> Self {
6085 Self(RequestBuilder::new(stub))
6086 }
6087
6088 pub fn with_request<V: Into<crate::model::EncryptRequest>>(mut self, v: V) -> Self {
6090 self.0.request = v.into();
6091 self
6092 }
6093
6094 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6096 self.0.options = v.into();
6097 self
6098 }
6099
6100 pub async fn send(self) -> Result<crate::model::EncryptResponse> {
6102 (*self.0.stub)
6103 .encrypt(self.0.request, self.0.options)
6104 .await
6105 .map(gax::response::Response::into_body)
6106 }
6107
6108 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6112 self.0.request.name = v.into();
6113 self
6114 }
6115
6116 pub fn set_plaintext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6120 self.0.request.plaintext = v.into();
6121 self
6122 }
6123
6124 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6126 self.0.request.additional_authenticated_data = v.into();
6127 self
6128 }
6129
6130 pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
6132 where
6133 T: std::convert::Into<wkt::Int64Value>,
6134 {
6135 self.0.request.plaintext_crc32c = std::option::Option::Some(v.into());
6136 self
6137 }
6138
6139 pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6141 where
6142 T: std::convert::Into<wkt::Int64Value>,
6143 {
6144 self.0.request.plaintext_crc32c = v.map(|x| x.into());
6145 self
6146 }
6147
6148 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
6150 where
6151 T: std::convert::Into<wkt::Int64Value>,
6152 {
6153 self.0.request.additional_authenticated_data_crc32c =
6154 std::option::Option::Some(v.into());
6155 self
6156 }
6157
6158 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
6160 mut self,
6161 v: std::option::Option<T>,
6162 ) -> Self
6163 where
6164 T: std::convert::Into<wkt::Int64Value>,
6165 {
6166 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
6167 self
6168 }
6169 }
6170
6171 #[doc(hidden)]
6172 impl gax::options::internal::RequestBuilder for Encrypt {
6173 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6174 &mut self.0.options
6175 }
6176 }
6177
6178 #[derive(Clone, Debug)]
6195 pub struct Decrypt(RequestBuilder<crate::model::DecryptRequest>);
6196
6197 impl Decrypt {
6198 pub(crate) fn new(
6199 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6200 ) -> Self {
6201 Self(RequestBuilder::new(stub))
6202 }
6203
6204 pub fn with_request<V: Into<crate::model::DecryptRequest>>(mut self, v: V) -> Self {
6206 self.0.request = v.into();
6207 self
6208 }
6209
6210 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6212 self.0.options = v.into();
6213 self
6214 }
6215
6216 pub async fn send(self) -> Result<crate::model::DecryptResponse> {
6218 (*self.0.stub)
6219 .decrypt(self.0.request, self.0.options)
6220 .await
6221 .map(gax::response::Response::into_body)
6222 }
6223
6224 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6228 self.0.request.name = v.into();
6229 self
6230 }
6231
6232 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6236 self.0.request.ciphertext = v.into();
6237 self
6238 }
6239
6240 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6242 self.0.request.additional_authenticated_data = v.into();
6243 self
6244 }
6245
6246 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
6248 where
6249 T: std::convert::Into<wkt::Int64Value>,
6250 {
6251 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
6252 self
6253 }
6254
6255 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6257 where
6258 T: std::convert::Into<wkt::Int64Value>,
6259 {
6260 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
6261 self
6262 }
6263
6264 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
6266 where
6267 T: std::convert::Into<wkt::Int64Value>,
6268 {
6269 self.0.request.additional_authenticated_data_crc32c =
6270 std::option::Option::Some(v.into());
6271 self
6272 }
6273
6274 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
6276 mut self,
6277 v: std::option::Option<T>,
6278 ) -> Self
6279 where
6280 T: std::convert::Into<wkt::Int64Value>,
6281 {
6282 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
6283 self
6284 }
6285 }
6286
6287 #[doc(hidden)]
6288 impl gax::options::internal::RequestBuilder for Decrypt {
6289 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6290 &mut self.0.options
6291 }
6292 }
6293
6294 #[derive(Clone, Debug)]
6311 pub struct RawEncrypt(RequestBuilder<crate::model::RawEncryptRequest>);
6312
6313 impl RawEncrypt {
6314 pub(crate) fn new(
6315 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6316 ) -> Self {
6317 Self(RequestBuilder::new(stub))
6318 }
6319
6320 pub fn with_request<V: Into<crate::model::RawEncryptRequest>>(mut self, v: V) -> Self {
6322 self.0.request = v.into();
6323 self
6324 }
6325
6326 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6328 self.0.options = v.into();
6329 self
6330 }
6331
6332 pub async fn send(self) -> Result<crate::model::RawEncryptResponse> {
6334 (*self.0.stub)
6335 .raw_encrypt(self.0.request, self.0.options)
6336 .await
6337 .map(gax::response::Response::into_body)
6338 }
6339
6340 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6344 self.0.request.name = v.into();
6345 self
6346 }
6347
6348 pub fn set_plaintext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6352 self.0.request.plaintext = v.into();
6353 self
6354 }
6355
6356 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6358 self.0.request.additional_authenticated_data = v.into();
6359 self
6360 }
6361
6362 pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
6364 where
6365 T: std::convert::Into<wkt::Int64Value>,
6366 {
6367 self.0.request.plaintext_crc32c = std::option::Option::Some(v.into());
6368 self
6369 }
6370
6371 pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6373 where
6374 T: std::convert::Into<wkt::Int64Value>,
6375 {
6376 self.0.request.plaintext_crc32c = v.map(|x| x.into());
6377 self
6378 }
6379
6380 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
6382 where
6383 T: std::convert::Into<wkt::Int64Value>,
6384 {
6385 self.0.request.additional_authenticated_data_crc32c =
6386 std::option::Option::Some(v.into());
6387 self
6388 }
6389
6390 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
6392 mut self,
6393 v: std::option::Option<T>,
6394 ) -> Self
6395 where
6396 T: std::convert::Into<wkt::Int64Value>,
6397 {
6398 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
6399 self
6400 }
6401
6402 pub fn set_initialization_vector<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6404 self.0.request.initialization_vector = v.into();
6405 self
6406 }
6407
6408 pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
6410 where
6411 T: std::convert::Into<wkt::Int64Value>,
6412 {
6413 self.0.request.initialization_vector_crc32c = std::option::Option::Some(v.into());
6414 self
6415 }
6416
6417 pub fn set_or_clear_initialization_vector_crc32c<T>(
6419 mut self,
6420 v: std::option::Option<T>,
6421 ) -> Self
6422 where
6423 T: std::convert::Into<wkt::Int64Value>,
6424 {
6425 self.0.request.initialization_vector_crc32c = v.map(|x| x.into());
6426 self
6427 }
6428 }
6429
6430 #[doc(hidden)]
6431 impl gax::options::internal::RequestBuilder for RawEncrypt {
6432 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6433 &mut self.0.options
6434 }
6435 }
6436
6437 #[derive(Clone, Debug)]
6454 pub struct RawDecrypt(RequestBuilder<crate::model::RawDecryptRequest>);
6455
6456 impl RawDecrypt {
6457 pub(crate) fn new(
6458 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6459 ) -> Self {
6460 Self(RequestBuilder::new(stub))
6461 }
6462
6463 pub fn with_request<V: Into<crate::model::RawDecryptRequest>>(mut self, v: V) -> Self {
6465 self.0.request = v.into();
6466 self
6467 }
6468
6469 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6471 self.0.options = v.into();
6472 self
6473 }
6474
6475 pub async fn send(self) -> Result<crate::model::RawDecryptResponse> {
6477 (*self.0.stub)
6478 .raw_decrypt(self.0.request, self.0.options)
6479 .await
6480 .map(gax::response::Response::into_body)
6481 }
6482
6483 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6487 self.0.request.name = v.into();
6488 self
6489 }
6490
6491 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6495 self.0.request.ciphertext = v.into();
6496 self
6497 }
6498
6499 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6501 self.0.request.additional_authenticated_data = v.into();
6502 self
6503 }
6504
6505 pub fn set_initialization_vector<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6509 self.0.request.initialization_vector = v.into();
6510 self
6511 }
6512
6513 pub fn set_tag_length<T: Into<i32>>(mut self, v: T) -> Self {
6515 self.0.request.tag_length = v.into();
6516 self
6517 }
6518
6519 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
6521 where
6522 T: std::convert::Into<wkt::Int64Value>,
6523 {
6524 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
6525 self
6526 }
6527
6528 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6530 where
6531 T: std::convert::Into<wkt::Int64Value>,
6532 {
6533 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
6534 self
6535 }
6536
6537 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
6539 where
6540 T: std::convert::Into<wkt::Int64Value>,
6541 {
6542 self.0.request.additional_authenticated_data_crc32c =
6543 std::option::Option::Some(v.into());
6544 self
6545 }
6546
6547 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
6549 mut self,
6550 v: std::option::Option<T>,
6551 ) -> Self
6552 where
6553 T: std::convert::Into<wkt::Int64Value>,
6554 {
6555 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
6556 self
6557 }
6558
6559 pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
6561 where
6562 T: std::convert::Into<wkt::Int64Value>,
6563 {
6564 self.0.request.initialization_vector_crc32c = std::option::Option::Some(v.into());
6565 self
6566 }
6567
6568 pub fn set_or_clear_initialization_vector_crc32c<T>(
6570 mut self,
6571 v: std::option::Option<T>,
6572 ) -> Self
6573 where
6574 T: std::convert::Into<wkt::Int64Value>,
6575 {
6576 self.0.request.initialization_vector_crc32c = v.map(|x| x.into());
6577 self
6578 }
6579 }
6580
6581 #[doc(hidden)]
6582 impl gax::options::internal::RequestBuilder for RawDecrypt {
6583 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6584 &mut self.0.options
6585 }
6586 }
6587
6588 #[derive(Clone, Debug)]
6605 pub struct AsymmetricSign(RequestBuilder<crate::model::AsymmetricSignRequest>);
6606
6607 impl AsymmetricSign {
6608 pub(crate) fn new(
6609 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6610 ) -> Self {
6611 Self(RequestBuilder::new(stub))
6612 }
6613
6614 pub fn with_request<V: Into<crate::model::AsymmetricSignRequest>>(mut self, v: V) -> Self {
6616 self.0.request = v.into();
6617 self
6618 }
6619
6620 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6622 self.0.options = v.into();
6623 self
6624 }
6625
6626 pub async fn send(self) -> Result<crate::model::AsymmetricSignResponse> {
6628 (*self.0.stub)
6629 .asymmetric_sign(self.0.request, self.0.options)
6630 .await
6631 .map(gax::response::Response::into_body)
6632 }
6633
6634 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6638 self.0.request.name = v.into();
6639 self
6640 }
6641
6642 pub fn set_digest<T>(mut self, v: T) -> Self
6644 where
6645 T: std::convert::Into<crate::model::Digest>,
6646 {
6647 self.0.request.digest = std::option::Option::Some(v.into());
6648 self
6649 }
6650
6651 pub fn set_or_clear_digest<T>(mut self, v: std::option::Option<T>) -> Self
6653 where
6654 T: std::convert::Into<crate::model::Digest>,
6655 {
6656 self.0.request.digest = v.map(|x| x.into());
6657 self
6658 }
6659
6660 pub fn set_digest_crc32c<T>(mut self, v: T) -> Self
6662 where
6663 T: std::convert::Into<wkt::Int64Value>,
6664 {
6665 self.0.request.digest_crc32c = std::option::Option::Some(v.into());
6666 self
6667 }
6668
6669 pub fn set_or_clear_digest_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6671 where
6672 T: std::convert::Into<wkt::Int64Value>,
6673 {
6674 self.0.request.digest_crc32c = v.map(|x| x.into());
6675 self
6676 }
6677
6678 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6680 self.0.request.data = v.into();
6681 self
6682 }
6683
6684 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
6686 where
6687 T: std::convert::Into<wkt::Int64Value>,
6688 {
6689 self.0.request.data_crc32c = std::option::Option::Some(v.into());
6690 self
6691 }
6692
6693 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6695 where
6696 T: std::convert::Into<wkt::Int64Value>,
6697 {
6698 self.0.request.data_crc32c = v.map(|x| x.into());
6699 self
6700 }
6701 }
6702
6703 #[doc(hidden)]
6704 impl gax::options::internal::RequestBuilder for AsymmetricSign {
6705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6706 &mut self.0.options
6707 }
6708 }
6709
6710 #[derive(Clone, Debug)]
6727 pub struct AsymmetricDecrypt(RequestBuilder<crate::model::AsymmetricDecryptRequest>);
6728
6729 impl AsymmetricDecrypt {
6730 pub(crate) fn new(
6731 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6732 ) -> Self {
6733 Self(RequestBuilder::new(stub))
6734 }
6735
6736 pub fn with_request<V: Into<crate::model::AsymmetricDecryptRequest>>(
6738 mut self,
6739 v: V,
6740 ) -> Self {
6741 self.0.request = v.into();
6742 self
6743 }
6744
6745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6747 self.0.options = v.into();
6748 self
6749 }
6750
6751 pub async fn send(self) -> Result<crate::model::AsymmetricDecryptResponse> {
6753 (*self.0.stub)
6754 .asymmetric_decrypt(self.0.request, self.0.options)
6755 .await
6756 .map(gax::response::Response::into_body)
6757 }
6758
6759 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6763 self.0.request.name = v.into();
6764 self
6765 }
6766
6767 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6771 self.0.request.ciphertext = v.into();
6772 self
6773 }
6774
6775 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
6777 where
6778 T: std::convert::Into<wkt::Int64Value>,
6779 {
6780 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
6781 self
6782 }
6783
6784 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6786 where
6787 T: std::convert::Into<wkt::Int64Value>,
6788 {
6789 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
6790 self
6791 }
6792 }
6793
6794 #[doc(hidden)]
6795 impl gax::options::internal::RequestBuilder for AsymmetricDecrypt {
6796 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6797 &mut self.0.options
6798 }
6799 }
6800
6801 #[derive(Clone, Debug)]
6818 pub struct MacSign(RequestBuilder<crate::model::MacSignRequest>);
6819
6820 impl MacSign {
6821 pub(crate) fn new(
6822 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6823 ) -> Self {
6824 Self(RequestBuilder::new(stub))
6825 }
6826
6827 pub fn with_request<V: Into<crate::model::MacSignRequest>>(mut self, v: V) -> Self {
6829 self.0.request = v.into();
6830 self
6831 }
6832
6833 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6835 self.0.options = v.into();
6836 self
6837 }
6838
6839 pub async fn send(self) -> Result<crate::model::MacSignResponse> {
6841 (*self.0.stub)
6842 .mac_sign(self.0.request, self.0.options)
6843 .await
6844 .map(gax::response::Response::into_body)
6845 }
6846
6847 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6851 self.0.request.name = v.into();
6852 self
6853 }
6854
6855 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6859 self.0.request.data = v.into();
6860 self
6861 }
6862
6863 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
6865 where
6866 T: std::convert::Into<wkt::Int64Value>,
6867 {
6868 self.0.request.data_crc32c = std::option::Option::Some(v.into());
6869 self
6870 }
6871
6872 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6874 where
6875 T: std::convert::Into<wkt::Int64Value>,
6876 {
6877 self.0.request.data_crc32c = v.map(|x| x.into());
6878 self
6879 }
6880 }
6881
6882 #[doc(hidden)]
6883 impl gax::options::internal::RequestBuilder for MacSign {
6884 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6885 &mut self.0.options
6886 }
6887 }
6888
6889 #[derive(Clone, Debug)]
6906 pub struct MacVerify(RequestBuilder<crate::model::MacVerifyRequest>);
6907
6908 impl MacVerify {
6909 pub(crate) fn new(
6910 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6911 ) -> Self {
6912 Self(RequestBuilder::new(stub))
6913 }
6914
6915 pub fn with_request<V: Into<crate::model::MacVerifyRequest>>(mut self, v: V) -> Self {
6917 self.0.request = v.into();
6918 self
6919 }
6920
6921 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6923 self.0.options = v.into();
6924 self
6925 }
6926
6927 pub async fn send(self) -> Result<crate::model::MacVerifyResponse> {
6929 (*self.0.stub)
6930 .mac_verify(self.0.request, self.0.options)
6931 .await
6932 .map(gax::response::Response::into_body)
6933 }
6934
6935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6939 self.0.request.name = v.into();
6940 self
6941 }
6942
6943 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6947 self.0.request.data = v.into();
6948 self
6949 }
6950
6951 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
6953 where
6954 T: std::convert::Into<wkt::Int64Value>,
6955 {
6956 self.0.request.data_crc32c = std::option::Option::Some(v.into());
6957 self
6958 }
6959
6960 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6962 where
6963 T: std::convert::Into<wkt::Int64Value>,
6964 {
6965 self.0.request.data_crc32c = v.map(|x| x.into());
6966 self
6967 }
6968
6969 pub fn set_mac<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6973 self.0.request.mac = v.into();
6974 self
6975 }
6976
6977 pub fn set_mac_crc32c<T>(mut self, v: T) -> Self
6979 where
6980 T: std::convert::Into<wkt::Int64Value>,
6981 {
6982 self.0.request.mac_crc32c = std::option::Option::Some(v.into());
6983 self
6984 }
6985
6986 pub fn set_or_clear_mac_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
6988 where
6989 T: std::convert::Into<wkt::Int64Value>,
6990 {
6991 self.0.request.mac_crc32c = v.map(|x| x.into());
6992 self
6993 }
6994 }
6995
6996 #[doc(hidden)]
6997 impl gax::options::internal::RequestBuilder for MacVerify {
6998 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6999 &mut self.0.options
7000 }
7001 }
7002
7003 #[derive(Clone, Debug)]
7020 pub struct Decapsulate(RequestBuilder<crate::model::DecapsulateRequest>);
7021
7022 impl Decapsulate {
7023 pub(crate) fn new(
7024 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7025 ) -> Self {
7026 Self(RequestBuilder::new(stub))
7027 }
7028
7029 pub fn with_request<V: Into<crate::model::DecapsulateRequest>>(mut self, v: V) -> Self {
7031 self.0.request = v.into();
7032 self
7033 }
7034
7035 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7037 self.0.options = v.into();
7038 self
7039 }
7040
7041 pub async fn send(self) -> Result<crate::model::DecapsulateResponse> {
7043 (*self.0.stub)
7044 .decapsulate(self.0.request, self.0.options)
7045 .await
7046 .map(gax::response::Response::into_body)
7047 }
7048
7049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7053 self.0.request.name = v.into();
7054 self
7055 }
7056
7057 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7061 self.0.request.ciphertext = v.into();
7062 self
7063 }
7064
7065 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
7067 where
7068 T: std::convert::Into<wkt::Int64Value>,
7069 {
7070 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
7071 self
7072 }
7073
7074 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
7076 where
7077 T: std::convert::Into<wkt::Int64Value>,
7078 {
7079 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
7080 self
7081 }
7082 }
7083
7084 #[doc(hidden)]
7085 impl gax::options::internal::RequestBuilder for Decapsulate {
7086 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7087 &mut self.0.options
7088 }
7089 }
7090
7091 #[derive(Clone, Debug)]
7108 pub struct GenerateRandomBytes(RequestBuilder<crate::model::GenerateRandomBytesRequest>);
7109
7110 impl GenerateRandomBytes {
7111 pub(crate) fn new(
7112 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7113 ) -> Self {
7114 Self(RequestBuilder::new(stub))
7115 }
7116
7117 pub fn with_request<V: Into<crate::model::GenerateRandomBytesRequest>>(
7119 mut self,
7120 v: V,
7121 ) -> Self {
7122 self.0.request = v.into();
7123 self
7124 }
7125
7126 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7128 self.0.options = v.into();
7129 self
7130 }
7131
7132 pub async fn send(self) -> Result<crate::model::GenerateRandomBytesResponse> {
7134 (*self.0.stub)
7135 .generate_random_bytes(self.0.request, self.0.options)
7136 .await
7137 .map(gax::response::Response::into_body)
7138 }
7139
7140 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7142 self.0.request.location = v.into();
7143 self
7144 }
7145
7146 pub fn set_length_bytes<T: Into<i32>>(mut self, v: T) -> Self {
7148 self.0.request.length_bytes = v.into();
7149 self
7150 }
7151
7152 pub fn set_protection_level<T: Into<crate::model::ProtectionLevel>>(
7154 mut self,
7155 v: T,
7156 ) -> Self {
7157 self.0.request.protection_level = v.into();
7158 self
7159 }
7160 }
7161
7162 #[doc(hidden)]
7163 impl gax::options::internal::RequestBuilder for GenerateRandomBytes {
7164 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7165 &mut self.0.options
7166 }
7167 }
7168
7169 #[derive(Clone, Debug)]
7190 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7191
7192 impl ListLocations {
7193 pub(crate) fn new(
7194 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7195 ) -> Self {
7196 Self(RequestBuilder::new(stub))
7197 }
7198
7199 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7201 mut self,
7202 v: V,
7203 ) -> Self {
7204 self.0.request = v.into();
7205 self
7206 }
7207
7208 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7210 self.0.options = v.into();
7211 self
7212 }
7213
7214 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7216 (*self.0.stub)
7217 .list_locations(self.0.request, self.0.options)
7218 .await
7219 .map(gax::response::Response::into_body)
7220 }
7221
7222 pub fn by_page(
7224 self,
7225 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7226 {
7227 use std::clone::Clone;
7228 let token = self.0.request.page_token.clone();
7229 let execute = move |token: String| {
7230 let mut builder = self.clone();
7231 builder.0.request = builder.0.request.set_page_token(token);
7232 builder.send()
7233 };
7234 gax::paginator::internal::new_paginator(token, execute)
7235 }
7236
7237 pub fn by_item(
7239 self,
7240 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7241 {
7242 use gax::paginator::Paginator;
7243 self.by_page().items()
7244 }
7245
7246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7248 self.0.request.name = v.into();
7249 self
7250 }
7251
7252 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7254 self.0.request.filter = v.into();
7255 self
7256 }
7257
7258 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7260 self.0.request.page_size = v.into();
7261 self
7262 }
7263
7264 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7266 self.0.request.page_token = v.into();
7267 self
7268 }
7269 }
7270
7271 #[doc(hidden)]
7272 impl gax::options::internal::RequestBuilder for ListLocations {
7273 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7274 &mut self.0.options
7275 }
7276 }
7277
7278 #[derive(Clone, Debug)]
7295 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7296
7297 impl GetLocation {
7298 pub(crate) fn new(
7299 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7300 ) -> Self {
7301 Self(RequestBuilder::new(stub))
7302 }
7303
7304 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7306 self.0.request = v.into();
7307 self
7308 }
7309
7310 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7312 self.0.options = v.into();
7313 self
7314 }
7315
7316 pub async fn send(self) -> Result<location::model::Location> {
7318 (*self.0.stub)
7319 .get_location(self.0.request, self.0.options)
7320 .await
7321 .map(gax::response::Response::into_body)
7322 }
7323
7324 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7326 self.0.request.name = v.into();
7327 self
7328 }
7329 }
7330
7331 #[doc(hidden)]
7332 impl gax::options::internal::RequestBuilder for GetLocation {
7333 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7334 &mut self.0.options
7335 }
7336 }
7337
7338 #[derive(Clone, Debug)]
7355 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
7356
7357 impl SetIamPolicy {
7358 pub(crate) fn new(
7359 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7360 ) -> Self {
7361 Self(RequestBuilder::new(stub))
7362 }
7363
7364 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
7366 self.0.request = v.into();
7367 self
7368 }
7369
7370 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7372 self.0.options = v.into();
7373 self
7374 }
7375
7376 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7378 (*self.0.stub)
7379 .set_iam_policy(self.0.request, self.0.options)
7380 .await
7381 .map(gax::response::Response::into_body)
7382 }
7383
7384 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7388 self.0.request.resource = v.into();
7389 self
7390 }
7391
7392 pub fn set_policy<T>(mut self, v: T) -> Self
7396 where
7397 T: std::convert::Into<iam_v1::model::Policy>,
7398 {
7399 self.0.request.policy = std::option::Option::Some(v.into());
7400 self
7401 }
7402
7403 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7407 where
7408 T: std::convert::Into<iam_v1::model::Policy>,
7409 {
7410 self.0.request.policy = v.map(|x| x.into());
7411 self
7412 }
7413
7414 pub fn set_update_mask<T>(mut self, v: T) -> Self
7416 where
7417 T: std::convert::Into<wkt::FieldMask>,
7418 {
7419 self.0.request.update_mask = std::option::Option::Some(v.into());
7420 self
7421 }
7422
7423 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7425 where
7426 T: std::convert::Into<wkt::FieldMask>,
7427 {
7428 self.0.request.update_mask = v.map(|x| x.into());
7429 self
7430 }
7431 }
7432
7433 #[doc(hidden)]
7434 impl gax::options::internal::RequestBuilder for SetIamPolicy {
7435 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7436 &mut self.0.options
7437 }
7438 }
7439
7440 #[derive(Clone, Debug)]
7457 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
7458
7459 impl GetIamPolicy {
7460 pub(crate) fn new(
7461 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7462 ) -> Self {
7463 Self(RequestBuilder::new(stub))
7464 }
7465
7466 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
7468 self.0.request = v.into();
7469 self
7470 }
7471
7472 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7474 self.0.options = v.into();
7475 self
7476 }
7477
7478 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7480 (*self.0.stub)
7481 .get_iam_policy(self.0.request, self.0.options)
7482 .await
7483 .map(gax::response::Response::into_body)
7484 }
7485
7486 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7490 self.0.request.resource = v.into();
7491 self
7492 }
7493
7494 pub fn set_options<T>(mut self, v: T) -> Self
7496 where
7497 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7498 {
7499 self.0.request.options = std::option::Option::Some(v.into());
7500 self
7501 }
7502
7503 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7505 where
7506 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7507 {
7508 self.0.request.options = v.map(|x| x.into());
7509 self
7510 }
7511 }
7512
7513 #[doc(hidden)]
7514 impl gax::options::internal::RequestBuilder for GetIamPolicy {
7515 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7516 &mut self.0.options
7517 }
7518 }
7519
7520 #[derive(Clone, Debug)]
7537 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
7538
7539 impl TestIamPermissions {
7540 pub(crate) fn new(
7541 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7542 ) -> Self {
7543 Self(RequestBuilder::new(stub))
7544 }
7545
7546 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
7548 mut self,
7549 v: V,
7550 ) -> Self {
7551 self.0.request = v.into();
7552 self
7553 }
7554
7555 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7557 self.0.options = v.into();
7558 self
7559 }
7560
7561 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
7563 (*self.0.stub)
7564 .test_iam_permissions(self.0.request, self.0.options)
7565 .await
7566 .map(gax::response::Response::into_body)
7567 }
7568
7569 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7573 self.0.request.resource = v.into();
7574 self
7575 }
7576
7577 pub fn set_permissions<T, V>(mut self, v: T) -> Self
7581 where
7582 T: std::iter::IntoIterator<Item = V>,
7583 V: std::convert::Into<std::string::String>,
7584 {
7585 use std::iter::Iterator;
7586 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7587 self
7588 }
7589 }
7590
7591 #[doc(hidden)]
7592 impl gax::options::internal::RequestBuilder for TestIamPermissions {
7593 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7594 &mut self.0.options
7595 }
7596 }
7597
7598 #[derive(Clone, Debug)]
7615 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7616
7617 impl GetOperation {
7618 pub(crate) fn new(
7619 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
7620 ) -> Self {
7621 Self(RequestBuilder::new(stub))
7622 }
7623
7624 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7626 mut self,
7627 v: V,
7628 ) -> Self {
7629 self.0.request = v.into();
7630 self
7631 }
7632
7633 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7635 self.0.options = v.into();
7636 self
7637 }
7638
7639 pub async fn send(self) -> Result<longrunning::model::Operation> {
7641 (*self.0.stub)
7642 .get_operation(self.0.request, self.0.options)
7643 .await
7644 .map(gax::response::Response::into_body)
7645 }
7646
7647 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7649 self.0.request.name = v.into();
7650 self
7651 }
7652 }
7653
7654 #[doc(hidden)]
7655 impl gax::options::internal::RequestBuilder for GetOperation {
7656 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7657 &mut self.0.options
7658 }
7659 }
7660}