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 key_management_service {
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::KeyManagementService;
2808 pub struct Factory;
2809 impl gax::client_builder::internal::ClientFactory for Factory {
2810 type Client = KeyManagementService;
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::KeyManagementService>,
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::KeyManagementService>,
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 ListKeyRings(RequestBuilder<crate::model::ListKeyRingsRequest>);
2866
2867 impl ListKeyRings {
2868 pub(crate) fn new(
2869 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
2870 ) -> Self {
2871 Self(RequestBuilder::new(stub))
2872 }
2873
2874 pub fn with_request<V: Into<crate::model::ListKeyRingsRequest>>(mut self, v: V) -> Self {
2876 self.0.request = v.into();
2877 self
2878 }
2879
2880 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2882 self.0.options = v.into();
2883 self
2884 }
2885
2886 pub async fn send(self) -> Result<crate::model::ListKeyRingsResponse> {
2888 (*self.0.stub)
2889 .list_key_rings(self.0.request, self.0.options)
2890 .await
2891 .map(gax::response::Response::into_body)
2892 }
2893
2894 pub fn by_page(
2896 self,
2897 ) -> impl gax::paginator::Paginator<crate::model::ListKeyRingsResponse, gax::error::Error>
2898 {
2899 use std::clone::Clone;
2900 let token = self.0.request.page_token.clone();
2901 let execute = move |token: String| {
2902 let mut builder = self.clone();
2903 builder.0.request = builder.0.request.set_page_token(token);
2904 builder.send()
2905 };
2906 gax::paginator::internal::new_paginator(token, execute)
2907 }
2908
2909 pub fn by_item(
2911 self,
2912 ) -> impl gax::paginator::ItemPaginator<crate::model::ListKeyRingsResponse, gax::error::Error>
2913 {
2914 use gax::paginator::Paginator;
2915 self.by_page().items()
2916 }
2917
2918 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2922 self.0.request.parent = v.into();
2923 self
2924 }
2925
2926 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2928 self.0.request.page_size = v.into();
2929 self
2930 }
2931
2932 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2934 self.0.request.page_token = v.into();
2935 self
2936 }
2937
2938 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2940 self.0.request.filter = v.into();
2941 self
2942 }
2943
2944 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2946 self.0.request.order_by = v.into();
2947 self
2948 }
2949 }
2950
2951 #[doc(hidden)]
2952 impl gax::options::internal::RequestBuilder for ListKeyRings {
2953 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2954 &mut self.0.options
2955 }
2956 }
2957
2958 #[derive(Clone, Debug)]
2979 pub struct ListCryptoKeys(RequestBuilder<crate::model::ListCryptoKeysRequest>);
2980
2981 impl ListCryptoKeys {
2982 pub(crate) fn new(
2983 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
2984 ) -> Self {
2985 Self(RequestBuilder::new(stub))
2986 }
2987
2988 pub fn with_request<V: Into<crate::model::ListCryptoKeysRequest>>(mut self, v: V) -> Self {
2990 self.0.request = v.into();
2991 self
2992 }
2993
2994 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2996 self.0.options = v.into();
2997 self
2998 }
2999
3000 pub async fn send(self) -> Result<crate::model::ListCryptoKeysResponse> {
3002 (*self.0.stub)
3003 .list_crypto_keys(self.0.request, self.0.options)
3004 .await
3005 .map(gax::response::Response::into_body)
3006 }
3007
3008 pub fn by_page(
3010 self,
3011 ) -> impl gax::paginator::Paginator<crate::model::ListCryptoKeysResponse, gax::error::Error>
3012 {
3013 use std::clone::Clone;
3014 let token = self.0.request.page_token.clone();
3015 let execute = move |token: String| {
3016 let mut builder = self.clone();
3017 builder.0.request = builder.0.request.set_page_token(token);
3018 builder.send()
3019 };
3020 gax::paginator::internal::new_paginator(token, execute)
3021 }
3022
3023 pub fn by_item(
3025 self,
3026 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCryptoKeysResponse, gax::error::Error>
3027 {
3028 use gax::paginator::Paginator;
3029 self.by_page().items()
3030 }
3031
3032 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3036 self.0.request.parent = v.into();
3037 self
3038 }
3039
3040 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3042 self.0.request.page_size = v.into();
3043 self
3044 }
3045
3046 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3048 self.0.request.page_token = v.into();
3049 self
3050 }
3051
3052 pub fn set_version_view<T: Into<crate::model::crypto_key_version::CryptoKeyVersionView>>(
3054 mut self,
3055 v: T,
3056 ) -> Self {
3057 self.0.request.version_view = v.into();
3058 self
3059 }
3060
3061 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3063 self.0.request.filter = v.into();
3064 self
3065 }
3066
3067 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3069 self.0.request.order_by = v.into();
3070 self
3071 }
3072 }
3073
3074 #[doc(hidden)]
3075 impl gax::options::internal::RequestBuilder for ListCryptoKeys {
3076 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3077 &mut self.0.options
3078 }
3079 }
3080
3081 #[derive(Clone, Debug)]
3102 pub struct ListCryptoKeyVersions(RequestBuilder<crate::model::ListCryptoKeyVersionsRequest>);
3103
3104 impl ListCryptoKeyVersions {
3105 pub(crate) fn new(
3106 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3107 ) -> Self {
3108 Self(RequestBuilder::new(stub))
3109 }
3110
3111 pub fn with_request<V: Into<crate::model::ListCryptoKeyVersionsRequest>>(
3113 mut self,
3114 v: V,
3115 ) -> Self {
3116 self.0.request = v.into();
3117 self
3118 }
3119
3120 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3122 self.0.options = v.into();
3123 self
3124 }
3125
3126 pub async fn send(self) -> Result<crate::model::ListCryptoKeyVersionsResponse> {
3128 (*self.0.stub)
3129 .list_crypto_key_versions(self.0.request, self.0.options)
3130 .await
3131 .map(gax::response::Response::into_body)
3132 }
3133
3134 pub fn by_page(
3136 self,
3137 ) -> impl gax::paginator::Paginator<crate::model::ListCryptoKeyVersionsResponse, gax::error::Error>
3138 {
3139 use std::clone::Clone;
3140 let token = self.0.request.page_token.clone();
3141 let execute = move |token: String| {
3142 let mut builder = self.clone();
3143 builder.0.request = builder.0.request.set_page_token(token);
3144 builder.send()
3145 };
3146 gax::paginator::internal::new_paginator(token, execute)
3147 }
3148
3149 pub fn by_item(
3151 self,
3152 ) -> impl gax::paginator::ItemPaginator<
3153 crate::model::ListCryptoKeyVersionsResponse,
3154 gax::error::Error,
3155 > {
3156 use gax::paginator::Paginator;
3157 self.by_page().items()
3158 }
3159
3160 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3164 self.0.request.parent = v.into();
3165 self
3166 }
3167
3168 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3170 self.0.request.page_size = v.into();
3171 self
3172 }
3173
3174 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3176 self.0.request.page_token = v.into();
3177 self
3178 }
3179
3180 pub fn set_view<T: Into<crate::model::crypto_key_version::CryptoKeyVersionView>>(
3182 mut self,
3183 v: T,
3184 ) -> Self {
3185 self.0.request.view = v.into();
3186 self
3187 }
3188
3189 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3191 self.0.request.filter = v.into();
3192 self
3193 }
3194
3195 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3197 self.0.request.order_by = v.into();
3198 self
3199 }
3200 }
3201
3202 #[doc(hidden)]
3203 impl gax::options::internal::RequestBuilder for ListCryptoKeyVersions {
3204 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3205 &mut self.0.options
3206 }
3207 }
3208
3209 #[derive(Clone, Debug)]
3230 pub struct ListImportJobs(RequestBuilder<crate::model::ListImportJobsRequest>);
3231
3232 impl ListImportJobs {
3233 pub(crate) fn new(
3234 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3235 ) -> Self {
3236 Self(RequestBuilder::new(stub))
3237 }
3238
3239 pub fn with_request<V: Into<crate::model::ListImportJobsRequest>>(mut self, v: V) -> Self {
3241 self.0.request = v.into();
3242 self
3243 }
3244
3245 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3247 self.0.options = v.into();
3248 self
3249 }
3250
3251 pub async fn send(self) -> Result<crate::model::ListImportJobsResponse> {
3253 (*self.0.stub)
3254 .list_import_jobs(self.0.request, self.0.options)
3255 .await
3256 .map(gax::response::Response::into_body)
3257 }
3258
3259 pub fn by_page(
3261 self,
3262 ) -> impl gax::paginator::Paginator<crate::model::ListImportJobsResponse, gax::error::Error>
3263 {
3264 use std::clone::Clone;
3265 let token = self.0.request.page_token.clone();
3266 let execute = move |token: String| {
3267 let mut builder = self.clone();
3268 builder.0.request = builder.0.request.set_page_token(token);
3269 builder.send()
3270 };
3271 gax::paginator::internal::new_paginator(token, execute)
3272 }
3273
3274 pub fn by_item(
3276 self,
3277 ) -> impl gax::paginator::ItemPaginator<crate::model::ListImportJobsResponse, gax::error::Error>
3278 {
3279 use gax::paginator::Paginator;
3280 self.by_page().items()
3281 }
3282
3283 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3287 self.0.request.parent = v.into();
3288 self
3289 }
3290
3291 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3293 self.0.request.page_size = v.into();
3294 self
3295 }
3296
3297 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3299 self.0.request.page_token = v.into();
3300 self
3301 }
3302
3303 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3305 self.0.request.filter = v.into();
3306 self
3307 }
3308
3309 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3311 self.0.request.order_by = v.into();
3312 self
3313 }
3314 }
3315
3316 #[doc(hidden)]
3317 impl gax::options::internal::RequestBuilder for ListImportJobs {
3318 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3319 &mut self.0.options
3320 }
3321 }
3322
3323 #[derive(Clone, Debug)]
3340 pub struct GetKeyRing(RequestBuilder<crate::model::GetKeyRingRequest>);
3341
3342 impl GetKeyRing {
3343 pub(crate) fn new(
3344 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3345 ) -> Self {
3346 Self(RequestBuilder::new(stub))
3347 }
3348
3349 pub fn with_request<V: Into<crate::model::GetKeyRingRequest>>(mut self, v: V) -> Self {
3351 self.0.request = v.into();
3352 self
3353 }
3354
3355 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3357 self.0.options = v.into();
3358 self
3359 }
3360
3361 pub async fn send(self) -> Result<crate::model::KeyRing> {
3363 (*self.0.stub)
3364 .get_key_ring(self.0.request, self.0.options)
3365 .await
3366 .map(gax::response::Response::into_body)
3367 }
3368
3369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3373 self.0.request.name = v.into();
3374 self
3375 }
3376 }
3377
3378 #[doc(hidden)]
3379 impl gax::options::internal::RequestBuilder for GetKeyRing {
3380 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3381 &mut self.0.options
3382 }
3383 }
3384
3385 #[derive(Clone, Debug)]
3402 pub struct GetCryptoKey(RequestBuilder<crate::model::GetCryptoKeyRequest>);
3403
3404 impl GetCryptoKey {
3405 pub(crate) fn new(
3406 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3407 ) -> Self {
3408 Self(RequestBuilder::new(stub))
3409 }
3410
3411 pub fn with_request<V: Into<crate::model::GetCryptoKeyRequest>>(mut self, v: V) -> Self {
3413 self.0.request = v.into();
3414 self
3415 }
3416
3417 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3419 self.0.options = v.into();
3420 self
3421 }
3422
3423 pub async fn send(self) -> Result<crate::model::CryptoKey> {
3425 (*self.0.stub)
3426 .get_crypto_key(self.0.request, self.0.options)
3427 .await
3428 .map(gax::response::Response::into_body)
3429 }
3430
3431 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3435 self.0.request.name = v.into();
3436 self
3437 }
3438 }
3439
3440 #[doc(hidden)]
3441 impl gax::options::internal::RequestBuilder for GetCryptoKey {
3442 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3443 &mut self.0.options
3444 }
3445 }
3446
3447 #[derive(Clone, Debug)]
3464 pub struct GetCryptoKeyVersion(RequestBuilder<crate::model::GetCryptoKeyVersionRequest>);
3465
3466 impl GetCryptoKeyVersion {
3467 pub(crate) fn new(
3468 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3469 ) -> Self {
3470 Self(RequestBuilder::new(stub))
3471 }
3472
3473 pub fn with_request<V: Into<crate::model::GetCryptoKeyVersionRequest>>(
3475 mut self,
3476 v: V,
3477 ) -> Self {
3478 self.0.request = v.into();
3479 self
3480 }
3481
3482 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3484 self.0.options = v.into();
3485 self
3486 }
3487
3488 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
3490 (*self.0.stub)
3491 .get_crypto_key_version(self.0.request, self.0.options)
3492 .await
3493 .map(gax::response::Response::into_body)
3494 }
3495
3496 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3500 self.0.request.name = v.into();
3501 self
3502 }
3503 }
3504
3505 #[doc(hidden)]
3506 impl gax::options::internal::RequestBuilder for GetCryptoKeyVersion {
3507 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3508 &mut self.0.options
3509 }
3510 }
3511
3512 #[derive(Clone, Debug)]
3529 pub struct GetPublicKey(RequestBuilder<crate::model::GetPublicKeyRequest>);
3530
3531 impl GetPublicKey {
3532 pub(crate) fn new(
3533 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3534 ) -> Self {
3535 Self(RequestBuilder::new(stub))
3536 }
3537
3538 pub fn with_request<V: Into<crate::model::GetPublicKeyRequest>>(mut self, v: V) -> Self {
3540 self.0.request = v.into();
3541 self
3542 }
3543
3544 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3546 self.0.options = v.into();
3547 self
3548 }
3549
3550 pub async fn send(self) -> Result<crate::model::PublicKey> {
3552 (*self.0.stub)
3553 .get_public_key(self.0.request, self.0.options)
3554 .await
3555 .map(gax::response::Response::into_body)
3556 }
3557
3558 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3562 self.0.request.name = v.into();
3563 self
3564 }
3565
3566 pub fn set_public_key_format<T: Into<crate::model::public_key::PublicKeyFormat>>(
3568 mut self,
3569 v: T,
3570 ) -> Self {
3571 self.0.request.public_key_format = v.into();
3572 self
3573 }
3574 }
3575
3576 #[doc(hidden)]
3577 impl gax::options::internal::RequestBuilder for GetPublicKey {
3578 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3579 &mut self.0.options
3580 }
3581 }
3582
3583 #[derive(Clone, Debug)]
3600 pub struct GetImportJob(RequestBuilder<crate::model::GetImportJobRequest>);
3601
3602 impl GetImportJob {
3603 pub(crate) fn new(
3604 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3605 ) -> Self {
3606 Self(RequestBuilder::new(stub))
3607 }
3608
3609 pub fn with_request<V: Into<crate::model::GetImportJobRequest>>(mut self, v: V) -> Self {
3611 self.0.request = v.into();
3612 self
3613 }
3614
3615 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3617 self.0.options = v.into();
3618 self
3619 }
3620
3621 pub async fn send(self) -> Result<crate::model::ImportJob> {
3623 (*self.0.stub)
3624 .get_import_job(self.0.request, self.0.options)
3625 .await
3626 .map(gax::response::Response::into_body)
3627 }
3628
3629 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3633 self.0.request.name = v.into();
3634 self
3635 }
3636 }
3637
3638 #[doc(hidden)]
3639 impl gax::options::internal::RequestBuilder for GetImportJob {
3640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3641 &mut self.0.options
3642 }
3643 }
3644
3645 #[derive(Clone, Debug)]
3662 pub struct CreateKeyRing(RequestBuilder<crate::model::CreateKeyRingRequest>);
3663
3664 impl CreateKeyRing {
3665 pub(crate) fn new(
3666 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3667 ) -> Self {
3668 Self(RequestBuilder::new(stub))
3669 }
3670
3671 pub fn with_request<V: Into<crate::model::CreateKeyRingRequest>>(mut self, v: V) -> Self {
3673 self.0.request = v.into();
3674 self
3675 }
3676
3677 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3679 self.0.options = v.into();
3680 self
3681 }
3682
3683 pub async fn send(self) -> Result<crate::model::KeyRing> {
3685 (*self.0.stub)
3686 .create_key_ring(self.0.request, self.0.options)
3687 .await
3688 .map(gax::response::Response::into_body)
3689 }
3690
3691 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3695 self.0.request.parent = v.into();
3696 self
3697 }
3698
3699 pub fn set_key_ring_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3703 self.0.request.key_ring_id = v.into();
3704 self
3705 }
3706
3707 pub fn set_key_ring<T>(mut self, v: T) -> Self
3711 where
3712 T: std::convert::Into<crate::model::KeyRing>,
3713 {
3714 self.0.request.key_ring = std::option::Option::Some(v.into());
3715 self
3716 }
3717
3718 pub fn set_or_clear_key_ring<T>(mut self, v: std::option::Option<T>) -> Self
3722 where
3723 T: std::convert::Into<crate::model::KeyRing>,
3724 {
3725 self.0.request.key_ring = v.map(|x| x.into());
3726 self
3727 }
3728 }
3729
3730 #[doc(hidden)]
3731 impl gax::options::internal::RequestBuilder for CreateKeyRing {
3732 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3733 &mut self.0.options
3734 }
3735 }
3736
3737 #[derive(Clone, Debug)]
3754 pub struct CreateCryptoKey(RequestBuilder<crate::model::CreateCryptoKeyRequest>);
3755
3756 impl CreateCryptoKey {
3757 pub(crate) fn new(
3758 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3759 ) -> Self {
3760 Self(RequestBuilder::new(stub))
3761 }
3762
3763 pub fn with_request<V: Into<crate::model::CreateCryptoKeyRequest>>(mut self, v: V) -> Self {
3765 self.0.request = v.into();
3766 self
3767 }
3768
3769 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3771 self.0.options = v.into();
3772 self
3773 }
3774
3775 pub async fn send(self) -> Result<crate::model::CryptoKey> {
3777 (*self.0.stub)
3778 .create_crypto_key(self.0.request, self.0.options)
3779 .await
3780 .map(gax::response::Response::into_body)
3781 }
3782
3783 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3787 self.0.request.parent = v.into();
3788 self
3789 }
3790
3791 pub fn set_crypto_key_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3795 self.0.request.crypto_key_id = v.into();
3796 self
3797 }
3798
3799 pub fn set_crypto_key<T>(mut self, v: T) -> Self
3803 where
3804 T: std::convert::Into<crate::model::CryptoKey>,
3805 {
3806 self.0.request.crypto_key = std::option::Option::Some(v.into());
3807 self
3808 }
3809
3810 pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
3814 where
3815 T: std::convert::Into<crate::model::CryptoKey>,
3816 {
3817 self.0.request.crypto_key = v.map(|x| x.into());
3818 self
3819 }
3820
3821 pub fn set_skip_initial_version_creation<T: Into<bool>>(mut self, v: T) -> Self {
3823 self.0.request.skip_initial_version_creation = v.into();
3824 self
3825 }
3826 }
3827
3828 #[doc(hidden)]
3829 impl gax::options::internal::RequestBuilder for CreateCryptoKey {
3830 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3831 &mut self.0.options
3832 }
3833 }
3834
3835 #[derive(Clone, Debug)]
3852 pub struct CreateCryptoKeyVersion(RequestBuilder<crate::model::CreateCryptoKeyVersionRequest>);
3853
3854 impl CreateCryptoKeyVersion {
3855 pub(crate) fn new(
3856 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3857 ) -> Self {
3858 Self(RequestBuilder::new(stub))
3859 }
3860
3861 pub fn with_request<V: Into<crate::model::CreateCryptoKeyVersionRequest>>(
3863 mut self,
3864 v: V,
3865 ) -> Self {
3866 self.0.request = v.into();
3867 self
3868 }
3869
3870 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3872 self.0.options = v.into();
3873 self
3874 }
3875
3876 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
3878 (*self.0.stub)
3879 .create_crypto_key_version(self.0.request, self.0.options)
3880 .await
3881 .map(gax::response::Response::into_body)
3882 }
3883
3884 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3888 self.0.request.parent = v.into();
3889 self
3890 }
3891
3892 pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
3896 where
3897 T: std::convert::Into<crate::model::CryptoKeyVersion>,
3898 {
3899 self.0.request.crypto_key_version = std::option::Option::Some(v.into());
3900 self
3901 }
3902
3903 pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
3907 where
3908 T: std::convert::Into<crate::model::CryptoKeyVersion>,
3909 {
3910 self.0.request.crypto_key_version = v.map(|x| x.into());
3911 self
3912 }
3913 }
3914
3915 #[doc(hidden)]
3916 impl gax::options::internal::RequestBuilder for CreateCryptoKeyVersion {
3917 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3918 &mut self.0.options
3919 }
3920 }
3921
3922 #[derive(Clone, Debug)]
3939 pub struct ImportCryptoKeyVersion(RequestBuilder<crate::model::ImportCryptoKeyVersionRequest>);
3940
3941 impl ImportCryptoKeyVersion {
3942 pub(crate) fn new(
3943 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
3944 ) -> Self {
3945 Self(RequestBuilder::new(stub))
3946 }
3947
3948 pub fn with_request<V: Into<crate::model::ImportCryptoKeyVersionRequest>>(
3950 mut self,
3951 v: V,
3952 ) -> Self {
3953 self.0.request = v.into();
3954 self
3955 }
3956
3957 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3959 self.0.options = v.into();
3960 self
3961 }
3962
3963 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
3965 (*self.0.stub)
3966 .import_crypto_key_version(self.0.request, self.0.options)
3967 .await
3968 .map(gax::response::Response::into_body)
3969 }
3970
3971 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3975 self.0.request.parent = v.into();
3976 self
3977 }
3978
3979 pub fn set_crypto_key_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
3981 self.0.request.crypto_key_version = v.into();
3982 self
3983 }
3984
3985 pub fn set_algorithm<
3989 T: Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
3990 >(
3991 mut self,
3992 v: T,
3993 ) -> Self {
3994 self.0.request.algorithm = v.into();
3995 self
3996 }
3997
3998 pub fn set_import_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
4002 self.0.request.import_job = v.into();
4003 self
4004 }
4005
4006 pub fn set_wrapped_key<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4008 self.0.request.wrapped_key = v.into();
4009 self
4010 }
4011
4012 pub fn set_wrapped_key_material<
4017 T: Into<Option<crate::model::import_crypto_key_version_request::WrappedKeyMaterial>>,
4018 >(
4019 mut self,
4020 v: T,
4021 ) -> Self {
4022 self.0.request.wrapped_key_material = v.into();
4023 self
4024 }
4025
4026 pub fn set_rsa_aes_wrapped_key<T: std::convert::Into<::bytes::Bytes>>(
4032 mut self,
4033 v: T,
4034 ) -> Self {
4035 self.0.request = self.0.request.set_rsa_aes_wrapped_key(v);
4036 self
4037 }
4038 }
4039
4040 #[doc(hidden)]
4041 impl gax::options::internal::RequestBuilder for ImportCryptoKeyVersion {
4042 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4043 &mut self.0.options
4044 }
4045 }
4046
4047 #[derive(Clone, Debug)]
4064 pub struct CreateImportJob(RequestBuilder<crate::model::CreateImportJobRequest>);
4065
4066 impl CreateImportJob {
4067 pub(crate) fn new(
4068 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4069 ) -> Self {
4070 Self(RequestBuilder::new(stub))
4071 }
4072
4073 pub fn with_request<V: Into<crate::model::CreateImportJobRequest>>(mut self, v: V) -> Self {
4075 self.0.request = v.into();
4076 self
4077 }
4078
4079 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4081 self.0.options = v.into();
4082 self
4083 }
4084
4085 pub async fn send(self) -> Result<crate::model::ImportJob> {
4087 (*self.0.stub)
4088 .create_import_job(self.0.request, self.0.options)
4089 .await
4090 .map(gax::response::Response::into_body)
4091 }
4092
4093 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4097 self.0.request.parent = v.into();
4098 self
4099 }
4100
4101 pub fn set_import_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4105 self.0.request.import_job_id = v.into();
4106 self
4107 }
4108
4109 pub fn set_import_job<T>(mut self, v: T) -> Self
4113 where
4114 T: std::convert::Into<crate::model::ImportJob>,
4115 {
4116 self.0.request.import_job = std::option::Option::Some(v.into());
4117 self
4118 }
4119
4120 pub fn set_or_clear_import_job<T>(mut self, v: std::option::Option<T>) -> Self
4124 where
4125 T: std::convert::Into<crate::model::ImportJob>,
4126 {
4127 self.0.request.import_job = v.map(|x| x.into());
4128 self
4129 }
4130 }
4131
4132 #[doc(hidden)]
4133 impl gax::options::internal::RequestBuilder for CreateImportJob {
4134 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4135 &mut self.0.options
4136 }
4137 }
4138
4139 #[derive(Clone, Debug)]
4156 pub struct UpdateCryptoKey(RequestBuilder<crate::model::UpdateCryptoKeyRequest>);
4157
4158 impl UpdateCryptoKey {
4159 pub(crate) fn new(
4160 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4161 ) -> Self {
4162 Self(RequestBuilder::new(stub))
4163 }
4164
4165 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyRequest>>(mut self, v: V) -> Self {
4167 self.0.request = v.into();
4168 self
4169 }
4170
4171 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4173 self.0.options = v.into();
4174 self
4175 }
4176
4177 pub async fn send(self) -> Result<crate::model::CryptoKey> {
4179 (*self.0.stub)
4180 .update_crypto_key(self.0.request, self.0.options)
4181 .await
4182 .map(gax::response::Response::into_body)
4183 }
4184
4185 pub fn set_crypto_key<T>(mut self, v: T) -> Self
4189 where
4190 T: std::convert::Into<crate::model::CryptoKey>,
4191 {
4192 self.0.request.crypto_key = std::option::Option::Some(v.into());
4193 self
4194 }
4195
4196 pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
4200 where
4201 T: std::convert::Into<crate::model::CryptoKey>,
4202 {
4203 self.0.request.crypto_key = v.map(|x| x.into());
4204 self
4205 }
4206
4207 pub fn set_update_mask<T>(mut self, v: T) -> Self
4211 where
4212 T: std::convert::Into<wkt::FieldMask>,
4213 {
4214 self.0.request.update_mask = std::option::Option::Some(v.into());
4215 self
4216 }
4217
4218 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4222 where
4223 T: std::convert::Into<wkt::FieldMask>,
4224 {
4225 self.0.request.update_mask = v.map(|x| x.into());
4226 self
4227 }
4228 }
4229
4230 #[doc(hidden)]
4231 impl gax::options::internal::RequestBuilder for UpdateCryptoKey {
4232 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4233 &mut self.0.options
4234 }
4235 }
4236
4237 #[derive(Clone, Debug)]
4254 pub struct UpdateCryptoKeyVersion(RequestBuilder<crate::model::UpdateCryptoKeyVersionRequest>);
4255
4256 impl UpdateCryptoKeyVersion {
4257 pub(crate) fn new(
4258 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4259 ) -> Self {
4260 Self(RequestBuilder::new(stub))
4261 }
4262
4263 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyVersionRequest>>(
4265 mut self,
4266 v: V,
4267 ) -> Self {
4268 self.0.request = v.into();
4269 self
4270 }
4271
4272 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4274 self.0.options = v.into();
4275 self
4276 }
4277
4278 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
4280 (*self.0.stub)
4281 .update_crypto_key_version(self.0.request, self.0.options)
4282 .await
4283 .map(gax::response::Response::into_body)
4284 }
4285
4286 pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
4290 where
4291 T: std::convert::Into<crate::model::CryptoKeyVersion>,
4292 {
4293 self.0.request.crypto_key_version = std::option::Option::Some(v.into());
4294 self
4295 }
4296
4297 pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
4301 where
4302 T: std::convert::Into<crate::model::CryptoKeyVersion>,
4303 {
4304 self.0.request.crypto_key_version = v.map(|x| x.into());
4305 self
4306 }
4307
4308 pub fn set_update_mask<T>(mut self, v: T) -> Self
4312 where
4313 T: std::convert::Into<wkt::FieldMask>,
4314 {
4315 self.0.request.update_mask = std::option::Option::Some(v.into());
4316 self
4317 }
4318
4319 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4323 where
4324 T: std::convert::Into<wkt::FieldMask>,
4325 {
4326 self.0.request.update_mask = v.map(|x| x.into());
4327 self
4328 }
4329 }
4330
4331 #[doc(hidden)]
4332 impl gax::options::internal::RequestBuilder for UpdateCryptoKeyVersion {
4333 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4334 &mut self.0.options
4335 }
4336 }
4337
4338 #[derive(Clone, Debug)]
4355 pub struct UpdateCryptoKeyPrimaryVersion(
4356 RequestBuilder<crate::model::UpdateCryptoKeyPrimaryVersionRequest>,
4357 );
4358
4359 impl UpdateCryptoKeyPrimaryVersion {
4360 pub(crate) fn new(
4361 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4362 ) -> Self {
4363 Self(RequestBuilder::new(stub))
4364 }
4365
4366 pub fn with_request<V: Into<crate::model::UpdateCryptoKeyPrimaryVersionRequest>>(
4368 mut self,
4369 v: V,
4370 ) -> Self {
4371 self.0.request = v.into();
4372 self
4373 }
4374
4375 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4377 self.0.options = v.into();
4378 self
4379 }
4380
4381 pub async fn send(self) -> Result<crate::model::CryptoKey> {
4383 (*self.0.stub)
4384 .update_crypto_key_primary_version(self.0.request, self.0.options)
4385 .await
4386 .map(gax::response::Response::into_body)
4387 }
4388
4389 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4393 self.0.request.name = v.into();
4394 self
4395 }
4396
4397 pub fn set_crypto_key_version_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4401 self.0.request.crypto_key_version_id = v.into();
4402 self
4403 }
4404 }
4405
4406 #[doc(hidden)]
4407 impl gax::options::internal::RequestBuilder for UpdateCryptoKeyPrimaryVersion {
4408 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4409 &mut self.0.options
4410 }
4411 }
4412
4413 #[derive(Clone, Debug)]
4430 pub struct DestroyCryptoKeyVersion(
4431 RequestBuilder<crate::model::DestroyCryptoKeyVersionRequest>,
4432 );
4433
4434 impl DestroyCryptoKeyVersion {
4435 pub(crate) fn new(
4436 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4437 ) -> Self {
4438 Self(RequestBuilder::new(stub))
4439 }
4440
4441 pub fn with_request<V: Into<crate::model::DestroyCryptoKeyVersionRequest>>(
4443 mut self,
4444 v: V,
4445 ) -> Self {
4446 self.0.request = v.into();
4447 self
4448 }
4449
4450 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4452 self.0.options = v.into();
4453 self
4454 }
4455
4456 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
4458 (*self.0.stub)
4459 .destroy_crypto_key_version(self.0.request, self.0.options)
4460 .await
4461 .map(gax::response::Response::into_body)
4462 }
4463
4464 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4468 self.0.request.name = v.into();
4469 self
4470 }
4471 }
4472
4473 #[doc(hidden)]
4474 impl gax::options::internal::RequestBuilder for DestroyCryptoKeyVersion {
4475 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4476 &mut self.0.options
4477 }
4478 }
4479
4480 #[derive(Clone, Debug)]
4497 pub struct RestoreCryptoKeyVersion(
4498 RequestBuilder<crate::model::RestoreCryptoKeyVersionRequest>,
4499 );
4500
4501 impl RestoreCryptoKeyVersion {
4502 pub(crate) fn new(
4503 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4504 ) -> Self {
4505 Self(RequestBuilder::new(stub))
4506 }
4507
4508 pub fn with_request<V: Into<crate::model::RestoreCryptoKeyVersionRequest>>(
4510 mut self,
4511 v: V,
4512 ) -> Self {
4513 self.0.request = v.into();
4514 self
4515 }
4516
4517 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4519 self.0.options = v.into();
4520 self
4521 }
4522
4523 pub async fn send(self) -> Result<crate::model::CryptoKeyVersion> {
4525 (*self.0.stub)
4526 .restore_crypto_key_version(self.0.request, self.0.options)
4527 .await
4528 .map(gax::response::Response::into_body)
4529 }
4530
4531 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4535 self.0.request.name = v.into();
4536 self
4537 }
4538 }
4539
4540 #[doc(hidden)]
4541 impl gax::options::internal::RequestBuilder for RestoreCryptoKeyVersion {
4542 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4543 &mut self.0.options
4544 }
4545 }
4546
4547 #[derive(Clone, Debug)]
4564 pub struct Encrypt(RequestBuilder<crate::model::EncryptRequest>);
4565
4566 impl Encrypt {
4567 pub(crate) fn new(
4568 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4569 ) -> Self {
4570 Self(RequestBuilder::new(stub))
4571 }
4572
4573 pub fn with_request<V: Into<crate::model::EncryptRequest>>(mut self, v: V) -> Self {
4575 self.0.request = v.into();
4576 self
4577 }
4578
4579 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4581 self.0.options = v.into();
4582 self
4583 }
4584
4585 pub async fn send(self) -> Result<crate::model::EncryptResponse> {
4587 (*self.0.stub)
4588 .encrypt(self.0.request, self.0.options)
4589 .await
4590 .map(gax::response::Response::into_body)
4591 }
4592
4593 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4597 self.0.request.name = v.into();
4598 self
4599 }
4600
4601 pub fn set_plaintext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4605 self.0.request.plaintext = v.into();
4606 self
4607 }
4608
4609 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4611 self.0.request.additional_authenticated_data = v.into();
4612 self
4613 }
4614
4615 pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
4617 where
4618 T: std::convert::Into<wkt::Int64Value>,
4619 {
4620 self.0.request.plaintext_crc32c = std::option::Option::Some(v.into());
4621 self
4622 }
4623
4624 pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
4626 where
4627 T: std::convert::Into<wkt::Int64Value>,
4628 {
4629 self.0.request.plaintext_crc32c = v.map(|x| x.into());
4630 self
4631 }
4632
4633 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
4635 where
4636 T: std::convert::Into<wkt::Int64Value>,
4637 {
4638 self.0.request.additional_authenticated_data_crc32c =
4639 std::option::Option::Some(v.into());
4640 self
4641 }
4642
4643 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
4645 mut self,
4646 v: std::option::Option<T>,
4647 ) -> Self
4648 where
4649 T: std::convert::Into<wkt::Int64Value>,
4650 {
4651 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
4652 self
4653 }
4654 }
4655
4656 #[doc(hidden)]
4657 impl gax::options::internal::RequestBuilder for Encrypt {
4658 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4659 &mut self.0.options
4660 }
4661 }
4662
4663 #[derive(Clone, Debug)]
4680 pub struct Decrypt(RequestBuilder<crate::model::DecryptRequest>);
4681
4682 impl Decrypt {
4683 pub(crate) fn new(
4684 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4685 ) -> Self {
4686 Self(RequestBuilder::new(stub))
4687 }
4688
4689 pub fn with_request<V: Into<crate::model::DecryptRequest>>(mut self, v: V) -> Self {
4691 self.0.request = v.into();
4692 self
4693 }
4694
4695 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4697 self.0.options = v.into();
4698 self
4699 }
4700
4701 pub async fn send(self) -> Result<crate::model::DecryptResponse> {
4703 (*self.0.stub)
4704 .decrypt(self.0.request, self.0.options)
4705 .await
4706 .map(gax::response::Response::into_body)
4707 }
4708
4709 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4713 self.0.request.name = v.into();
4714 self
4715 }
4716
4717 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4721 self.0.request.ciphertext = v.into();
4722 self
4723 }
4724
4725 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4727 self.0.request.additional_authenticated_data = v.into();
4728 self
4729 }
4730
4731 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
4733 where
4734 T: std::convert::Into<wkt::Int64Value>,
4735 {
4736 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
4737 self
4738 }
4739
4740 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
4742 where
4743 T: std::convert::Into<wkt::Int64Value>,
4744 {
4745 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
4746 self
4747 }
4748
4749 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
4751 where
4752 T: std::convert::Into<wkt::Int64Value>,
4753 {
4754 self.0.request.additional_authenticated_data_crc32c =
4755 std::option::Option::Some(v.into());
4756 self
4757 }
4758
4759 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
4761 mut self,
4762 v: std::option::Option<T>,
4763 ) -> Self
4764 where
4765 T: std::convert::Into<wkt::Int64Value>,
4766 {
4767 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
4768 self
4769 }
4770 }
4771
4772 #[doc(hidden)]
4773 impl gax::options::internal::RequestBuilder for Decrypt {
4774 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4775 &mut self.0.options
4776 }
4777 }
4778
4779 #[derive(Clone, Debug)]
4796 pub struct RawEncrypt(RequestBuilder<crate::model::RawEncryptRequest>);
4797
4798 impl RawEncrypt {
4799 pub(crate) fn new(
4800 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4801 ) -> Self {
4802 Self(RequestBuilder::new(stub))
4803 }
4804
4805 pub fn with_request<V: Into<crate::model::RawEncryptRequest>>(mut self, v: V) -> Self {
4807 self.0.request = v.into();
4808 self
4809 }
4810
4811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4813 self.0.options = v.into();
4814 self
4815 }
4816
4817 pub async fn send(self) -> Result<crate::model::RawEncryptResponse> {
4819 (*self.0.stub)
4820 .raw_encrypt(self.0.request, self.0.options)
4821 .await
4822 .map(gax::response::Response::into_body)
4823 }
4824
4825 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4829 self.0.request.name = v.into();
4830 self
4831 }
4832
4833 pub fn set_plaintext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4837 self.0.request.plaintext = v.into();
4838 self
4839 }
4840
4841 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4843 self.0.request.additional_authenticated_data = v.into();
4844 self
4845 }
4846
4847 pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
4849 where
4850 T: std::convert::Into<wkt::Int64Value>,
4851 {
4852 self.0.request.plaintext_crc32c = std::option::Option::Some(v.into());
4853 self
4854 }
4855
4856 pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
4858 where
4859 T: std::convert::Into<wkt::Int64Value>,
4860 {
4861 self.0.request.plaintext_crc32c = v.map(|x| x.into());
4862 self
4863 }
4864
4865 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
4867 where
4868 T: std::convert::Into<wkt::Int64Value>,
4869 {
4870 self.0.request.additional_authenticated_data_crc32c =
4871 std::option::Option::Some(v.into());
4872 self
4873 }
4874
4875 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
4877 mut self,
4878 v: std::option::Option<T>,
4879 ) -> Self
4880 where
4881 T: std::convert::Into<wkt::Int64Value>,
4882 {
4883 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
4884 self
4885 }
4886
4887 pub fn set_initialization_vector<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4889 self.0.request.initialization_vector = v.into();
4890 self
4891 }
4892
4893 pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
4895 where
4896 T: std::convert::Into<wkt::Int64Value>,
4897 {
4898 self.0.request.initialization_vector_crc32c = std::option::Option::Some(v.into());
4899 self
4900 }
4901
4902 pub fn set_or_clear_initialization_vector_crc32c<T>(
4904 mut self,
4905 v: std::option::Option<T>,
4906 ) -> Self
4907 where
4908 T: std::convert::Into<wkt::Int64Value>,
4909 {
4910 self.0.request.initialization_vector_crc32c = v.map(|x| x.into());
4911 self
4912 }
4913 }
4914
4915 #[doc(hidden)]
4916 impl gax::options::internal::RequestBuilder for RawEncrypt {
4917 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4918 &mut self.0.options
4919 }
4920 }
4921
4922 #[derive(Clone, Debug)]
4939 pub struct RawDecrypt(RequestBuilder<crate::model::RawDecryptRequest>);
4940
4941 impl RawDecrypt {
4942 pub(crate) fn new(
4943 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
4944 ) -> Self {
4945 Self(RequestBuilder::new(stub))
4946 }
4947
4948 pub fn with_request<V: Into<crate::model::RawDecryptRequest>>(mut self, v: V) -> Self {
4950 self.0.request = v.into();
4951 self
4952 }
4953
4954 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4956 self.0.options = v.into();
4957 self
4958 }
4959
4960 pub async fn send(self) -> Result<crate::model::RawDecryptResponse> {
4962 (*self.0.stub)
4963 .raw_decrypt(self.0.request, self.0.options)
4964 .await
4965 .map(gax::response::Response::into_body)
4966 }
4967
4968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4972 self.0.request.name = v.into();
4973 self
4974 }
4975
4976 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4980 self.0.request.ciphertext = v.into();
4981 self
4982 }
4983
4984 pub fn set_additional_authenticated_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4986 self.0.request.additional_authenticated_data = v.into();
4987 self
4988 }
4989
4990 pub fn set_initialization_vector<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4994 self.0.request.initialization_vector = v.into();
4995 self
4996 }
4997
4998 pub fn set_tag_length<T: Into<i32>>(mut self, v: T) -> Self {
5000 self.0.request.tag_length = v.into();
5001 self
5002 }
5003
5004 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
5006 where
5007 T: std::convert::Into<wkt::Int64Value>,
5008 {
5009 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
5010 self
5011 }
5012
5013 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5015 where
5016 T: std::convert::Into<wkt::Int64Value>,
5017 {
5018 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
5019 self
5020 }
5021
5022 pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
5024 where
5025 T: std::convert::Into<wkt::Int64Value>,
5026 {
5027 self.0.request.additional_authenticated_data_crc32c =
5028 std::option::Option::Some(v.into());
5029 self
5030 }
5031
5032 pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
5034 mut self,
5035 v: std::option::Option<T>,
5036 ) -> Self
5037 where
5038 T: std::convert::Into<wkt::Int64Value>,
5039 {
5040 self.0.request.additional_authenticated_data_crc32c = v.map(|x| x.into());
5041 self
5042 }
5043
5044 pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
5046 where
5047 T: std::convert::Into<wkt::Int64Value>,
5048 {
5049 self.0.request.initialization_vector_crc32c = std::option::Option::Some(v.into());
5050 self
5051 }
5052
5053 pub fn set_or_clear_initialization_vector_crc32c<T>(
5055 mut self,
5056 v: std::option::Option<T>,
5057 ) -> Self
5058 where
5059 T: std::convert::Into<wkt::Int64Value>,
5060 {
5061 self.0.request.initialization_vector_crc32c = v.map(|x| x.into());
5062 self
5063 }
5064 }
5065
5066 #[doc(hidden)]
5067 impl gax::options::internal::RequestBuilder for RawDecrypt {
5068 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5069 &mut self.0.options
5070 }
5071 }
5072
5073 #[derive(Clone, Debug)]
5090 pub struct AsymmetricSign(RequestBuilder<crate::model::AsymmetricSignRequest>);
5091
5092 impl AsymmetricSign {
5093 pub(crate) fn new(
5094 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5095 ) -> Self {
5096 Self(RequestBuilder::new(stub))
5097 }
5098
5099 pub fn with_request<V: Into<crate::model::AsymmetricSignRequest>>(mut self, v: V) -> Self {
5101 self.0.request = v.into();
5102 self
5103 }
5104
5105 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5107 self.0.options = v.into();
5108 self
5109 }
5110
5111 pub async fn send(self) -> Result<crate::model::AsymmetricSignResponse> {
5113 (*self.0.stub)
5114 .asymmetric_sign(self.0.request, self.0.options)
5115 .await
5116 .map(gax::response::Response::into_body)
5117 }
5118
5119 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5123 self.0.request.name = v.into();
5124 self
5125 }
5126
5127 pub fn set_digest<T>(mut self, v: T) -> Self
5129 where
5130 T: std::convert::Into<crate::model::Digest>,
5131 {
5132 self.0.request.digest = std::option::Option::Some(v.into());
5133 self
5134 }
5135
5136 pub fn set_or_clear_digest<T>(mut self, v: std::option::Option<T>) -> Self
5138 where
5139 T: std::convert::Into<crate::model::Digest>,
5140 {
5141 self.0.request.digest = v.map(|x| x.into());
5142 self
5143 }
5144
5145 pub fn set_digest_crc32c<T>(mut self, v: T) -> Self
5147 where
5148 T: std::convert::Into<wkt::Int64Value>,
5149 {
5150 self.0.request.digest_crc32c = std::option::Option::Some(v.into());
5151 self
5152 }
5153
5154 pub fn set_or_clear_digest_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5156 where
5157 T: std::convert::Into<wkt::Int64Value>,
5158 {
5159 self.0.request.digest_crc32c = v.map(|x| x.into());
5160 self
5161 }
5162
5163 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5165 self.0.request.data = v.into();
5166 self
5167 }
5168
5169 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
5171 where
5172 T: std::convert::Into<wkt::Int64Value>,
5173 {
5174 self.0.request.data_crc32c = std::option::Option::Some(v.into());
5175 self
5176 }
5177
5178 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5180 where
5181 T: std::convert::Into<wkt::Int64Value>,
5182 {
5183 self.0.request.data_crc32c = v.map(|x| x.into());
5184 self
5185 }
5186 }
5187
5188 #[doc(hidden)]
5189 impl gax::options::internal::RequestBuilder for AsymmetricSign {
5190 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5191 &mut self.0.options
5192 }
5193 }
5194
5195 #[derive(Clone, Debug)]
5212 pub struct AsymmetricDecrypt(RequestBuilder<crate::model::AsymmetricDecryptRequest>);
5213
5214 impl AsymmetricDecrypt {
5215 pub(crate) fn new(
5216 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5217 ) -> Self {
5218 Self(RequestBuilder::new(stub))
5219 }
5220
5221 pub fn with_request<V: Into<crate::model::AsymmetricDecryptRequest>>(
5223 mut self,
5224 v: V,
5225 ) -> Self {
5226 self.0.request = v.into();
5227 self
5228 }
5229
5230 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5232 self.0.options = v.into();
5233 self
5234 }
5235
5236 pub async fn send(self) -> Result<crate::model::AsymmetricDecryptResponse> {
5238 (*self.0.stub)
5239 .asymmetric_decrypt(self.0.request, self.0.options)
5240 .await
5241 .map(gax::response::Response::into_body)
5242 }
5243
5244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5248 self.0.request.name = v.into();
5249 self
5250 }
5251
5252 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5256 self.0.request.ciphertext = v.into();
5257 self
5258 }
5259
5260 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
5262 where
5263 T: std::convert::Into<wkt::Int64Value>,
5264 {
5265 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
5266 self
5267 }
5268
5269 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5271 where
5272 T: std::convert::Into<wkt::Int64Value>,
5273 {
5274 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
5275 self
5276 }
5277 }
5278
5279 #[doc(hidden)]
5280 impl gax::options::internal::RequestBuilder for AsymmetricDecrypt {
5281 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5282 &mut self.0.options
5283 }
5284 }
5285
5286 #[derive(Clone, Debug)]
5303 pub struct MacSign(RequestBuilder<crate::model::MacSignRequest>);
5304
5305 impl MacSign {
5306 pub(crate) fn new(
5307 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5308 ) -> Self {
5309 Self(RequestBuilder::new(stub))
5310 }
5311
5312 pub fn with_request<V: Into<crate::model::MacSignRequest>>(mut self, v: V) -> Self {
5314 self.0.request = v.into();
5315 self
5316 }
5317
5318 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5320 self.0.options = v.into();
5321 self
5322 }
5323
5324 pub async fn send(self) -> Result<crate::model::MacSignResponse> {
5326 (*self.0.stub)
5327 .mac_sign(self.0.request, self.0.options)
5328 .await
5329 .map(gax::response::Response::into_body)
5330 }
5331
5332 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5336 self.0.request.name = v.into();
5337 self
5338 }
5339
5340 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5344 self.0.request.data = v.into();
5345 self
5346 }
5347
5348 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
5350 where
5351 T: std::convert::Into<wkt::Int64Value>,
5352 {
5353 self.0.request.data_crc32c = std::option::Option::Some(v.into());
5354 self
5355 }
5356
5357 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5359 where
5360 T: std::convert::Into<wkt::Int64Value>,
5361 {
5362 self.0.request.data_crc32c = v.map(|x| x.into());
5363 self
5364 }
5365 }
5366
5367 #[doc(hidden)]
5368 impl gax::options::internal::RequestBuilder for MacSign {
5369 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5370 &mut self.0.options
5371 }
5372 }
5373
5374 #[derive(Clone, Debug)]
5391 pub struct MacVerify(RequestBuilder<crate::model::MacVerifyRequest>);
5392
5393 impl MacVerify {
5394 pub(crate) fn new(
5395 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5396 ) -> Self {
5397 Self(RequestBuilder::new(stub))
5398 }
5399
5400 pub fn with_request<V: Into<crate::model::MacVerifyRequest>>(mut self, v: V) -> Self {
5402 self.0.request = v.into();
5403 self
5404 }
5405
5406 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5408 self.0.options = v.into();
5409 self
5410 }
5411
5412 pub async fn send(self) -> Result<crate::model::MacVerifyResponse> {
5414 (*self.0.stub)
5415 .mac_verify(self.0.request, self.0.options)
5416 .await
5417 .map(gax::response::Response::into_body)
5418 }
5419
5420 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5424 self.0.request.name = v.into();
5425 self
5426 }
5427
5428 pub fn set_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5432 self.0.request.data = v.into();
5433 self
5434 }
5435
5436 pub fn set_data_crc32c<T>(mut self, v: T) -> Self
5438 where
5439 T: std::convert::Into<wkt::Int64Value>,
5440 {
5441 self.0.request.data_crc32c = std::option::Option::Some(v.into());
5442 self
5443 }
5444
5445 pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5447 where
5448 T: std::convert::Into<wkt::Int64Value>,
5449 {
5450 self.0.request.data_crc32c = v.map(|x| x.into());
5451 self
5452 }
5453
5454 pub fn set_mac<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5458 self.0.request.mac = v.into();
5459 self
5460 }
5461
5462 pub fn set_mac_crc32c<T>(mut self, v: T) -> Self
5464 where
5465 T: std::convert::Into<wkt::Int64Value>,
5466 {
5467 self.0.request.mac_crc32c = std::option::Option::Some(v.into());
5468 self
5469 }
5470
5471 pub fn set_or_clear_mac_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5473 where
5474 T: std::convert::Into<wkt::Int64Value>,
5475 {
5476 self.0.request.mac_crc32c = v.map(|x| x.into());
5477 self
5478 }
5479 }
5480
5481 #[doc(hidden)]
5482 impl gax::options::internal::RequestBuilder for MacVerify {
5483 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5484 &mut self.0.options
5485 }
5486 }
5487
5488 #[derive(Clone, Debug)]
5505 pub struct Decapsulate(RequestBuilder<crate::model::DecapsulateRequest>);
5506
5507 impl Decapsulate {
5508 pub(crate) fn new(
5509 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5510 ) -> Self {
5511 Self(RequestBuilder::new(stub))
5512 }
5513
5514 pub fn with_request<V: Into<crate::model::DecapsulateRequest>>(mut self, v: V) -> Self {
5516 self.0.request = v.into();
5517 self
5518 }
5519
5520 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5522 self.0.options = v.into();
5523 self
5524 }
5525
5526 pub async fn send(self) -> Result<crate::model::DecapsulateResponse> {
5528 (*self.0.stub)
5529 .decapsulate(self.0.request, self.0.options)
5530 .await
5531 .map(gax::response::Response::into_body)
5532 }
5533
5534 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5538 self.0.request.name = v.into();
5539 self
5540 }
5541
5542 pub fn set_ciphertext<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5546 self.0.request.ciphertext = v.into();
5547 self
5548 }
5549
5550 pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
5552 where
5553 T: std::convert::Into<wkt::Int64Value>,
5554 {
5555 self.0.request.ciphertext_crc32c = std::option::Option::Some(v.into());
5556 self
5557 }
5558
5559 pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5561 where
5562 T: std::convert::Into<wkt::Int64Value>,
5563 {
5564 self.0.request.ciphertext_crc32c = v.map(|x| x.into());
5565 self
5566 }
5567 }
5568
5569 #[doc(hidden)]
5570 impl gax::options::internal::RequestBuilder for Decapsulate {
5571 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5572 &mut self.0.options
5573 }
5574 }
5575
5576 #[derive(Clone, Debug)]
5593 pub struct GenerateRandomBytes(RequestBuilder<crate::model::GenerateRandomBytesRequest>);
5594
5595 impl GenerateRandomBytes {
5596 pub(crate) fn new(
5597 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5598 ) -> Self {
5599 Self(RequestBuilder::new(stub))
5600 }
5601
5602 pub fn with_request<V: Into<crate::model::GenerateRandomBytesRequest>>(
5604 mut self,
5605 v: V,
5606 ) -> Self {
5607 self.0.request = v.into();
5608 self
5609 }
5610
5611 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5613 self.0.options = v.into();
5614 self
5615 }
5616
5617 pub async fn send(self) -> Result<crate::model::GenerateRandomBytesResponse> {
5619 (*self.0.stub)
5620 .generate_random_bytes(self.0.request, self.0.options)
5621 .await
5622 .map(gax::response::Response::into_body)
5623 }
5624
5625 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5627 self.0.request.location = v.into();
5628 self
5629 }
5630
5631 pub fn set_length_bytes<T: Into<i32>>(mut self, v: T) -> Self {
5633 self.0.request.length_bytes = v.into();
5634 self
5635 }
5636
5637 pub fn set_protection_level<T: Into<crate::model::ProtectionLevel>>(
5639 mut self,
5640 v: T,
5641 ) -> Self {
5642 self.0.request.protection_level = v.into();
5643 self
5644 }
5645 }
5646
5647 #[doc(hidden)]
5648 impl gax::options::internal::RequestBuilder for GenerateRandomBytes {
5649 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5650 &mut self.0.options
5651 }
5652 }
5653
5654 #[derive(Clone, Debug)]
5675 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5676
5677 impl ListLocations {
5678 pub(crate) fn new(
5679 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5680 ) -> Self {
5681 Self(RequestBuilder::new(stub))
5682 }
5683
5684 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5686 mut self,
5687 v: V,
5688 ) -> Self {
5689 self.0.request = v.into();
5690 self
5691 }
5692
5693 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5695 self.0.options = v.into();
5696 self
5697 }
5698
5699 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5701 (*self.0.stub)
5702 .list_locations(self.0.request, self.0.options)
5703 .await
5704 .map(gax::response::Response::into_body)
5705 }
5706
5707 pub fn by_page(
5709 self,
5710 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5711 {
5712 use std::clone::Clone;
5713 let token = self.0.request.page_token.clone();
5714 let execute = move |token: String| {
5715 let mut builder = self.clone();
5716 builder.0.request = builder.0.request.set_page_token(token);
5717 builder.send()
5718 };
5719 gax::paginator::internal::new_paginator(token, execute)
5720 }
5721
5722 pub fn by_item(
5724 self,
5725 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5726 {
5727 use gax::paginator::Paginator;
5728 self.by_page().items()
5729 }
5730
5731 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5733 self.0.request.name = v.into();
5734 self
5735 }
5736
5737 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5739 self.0.request.filter = v.into();
5740 self
5741 }
5742
5743 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5745 self.0.request.page_size = v.into();
5746 self
5747 }
5748
5749 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5751 self.0.request.page_token = v.into();
5752 self
5753 }
5754 }
5755
5756 #[doc(hidden)]
5757 impl gax::options::internal::RequestBuilder for ListLocations {
5758 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5759 &mut self.0.options
5760 }
5761 }
5762
5763 #[derive(Clone, Debug)]
5780 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5781
5782 impl GetLocation {
5783 pub(crate) fn new(
5784 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5785 ) -> Self {
5786 Self(RequestBuilder::new(stub))
5787 }
5788
5789 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5791 self.0.request = v.into();
5792 self
5793 }
5794
5795 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5797 self.0.options = v.into();
5798 self
5799 }
5800
5801 pub async fn send(self) -> Result<location::model::Location> {
5803 (*self.0.stub)
5804 .get_location(self.0.request, self.0.options)
5805 .await
5806 .map(gax::response::Response::into_body)
5807 }
5808
5809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5811 self.0.request.name = v.into();
5812 self
5813 }
5814 }
5815
5816 #[doc(hidden)]
5817 impl gax::options::internal::RequestBuilder for GetLocation {
5818 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5819 &mut self.0.options
5820 }
5821 }
5822
5823 #[derive(Clone, Debug)]
5840 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5841
5842 impl SetIamPolicy {
5843 pub(crate) fn new(
5844 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5845 ) -> Self {
5846 Self(RequestBuilder::new(stub))
5847 }
5848
5849 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5851 self.0.request = v.into();
5852 self
5853 }
5854
5855 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5857 self.0.options = v.into();
5858 self
5859 }
5860
5861 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5863 (*self.0.stub)
5864 .set_iam_policy(self.0.request, self.0.options)
5865 .await
5866 .map(gax::response::Response::into_body)
5867 }
5868
5869 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5873 self.0.request.resource = v.into();
5874 self
5875 }
5876
5877 pub fn set_policy<T>(mut self, v: T) -> Self
5881 where
5882 T: std::convert::Into<iam_v1::model::Policy>,
5883 {
5884 self.0.request.policy = std::option::Option::Some(v.into());
5885 self
5886 }
5887
5888 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5892 where
5893 T: std::convert::Into<iam_v1::model::Policy>,
5894 {
5895 self.0.request.policy = v.map(|x| x.into());
5896 self
5897 }
5898
5899 pub fn set_update_mask<T>(mut self, v: T) -> Self
5901 where
5902 T: std::convert::Into<wkt::FieldMask>,
5903 {
5904 self.0.request.update_mask = std::option::Option::Some(v.into());
5905 self
5906 }
5907
5908 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5910 where
5911 T: std::convert::Into<wkt::FieldMask>,
5912 {
5913 self.0.request.update_mask = v.map(|x| x.into());
5914 self
5915 }
5916 }
5917
5918 #[doc(hidden)]
5919 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5920 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5921 &mut self.0.options
5922 }
5923 }
5924
5925 #[derive(Clone, Debug)]
5942 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5943
5944 impl GetIamPolicy {
5945 pub(crate) fn new(
5946 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
5947 ) -> Self {
5948 Self(RequestBuilder::new(stub))
5949 }
5950
5951 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5953 self.0.request = v.into();
5954 self
5955 }
5956
5957 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5959 self.0.options = v.into();
5960 self
5961 }
5962
5963 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5965 (*self.0.stub)
5966 .get_iam_policy(self.0.request, self.0.options)
5967 .await
5968 .map(gax::response::Response::into_body)
5969 }
5970
5971 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5975 self.0.request.resource = v.into();
5976 self
5977 }
5978
5979 pub fn set_options<T>(mut self, v: T) -> Self
5981 where
5982 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5983 {
5984 self.0.request.options = std::option::Option::Some(v.into());
5985 self
5986 }
5987
5988 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5990 where
5991 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5992 {
5993 self.0.request.options = v.map(|x| x.into());
5994 self
5995 }
5996 }
5997
5998 #[doc(hidden)]
5999 impl gax::options::internal::RequestBuilder for GetIamPolicy {
6000 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6001 &mut self.0.options
6002 }
6003 }
6004
6005 #[derive(Clone, Debug)]
6022 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
6023
6024 impl TestIamPermissions {
6025 pub(crate) fn new(
6026 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6027 ) -> Self {
6028 Self(RequestBuilder::new(stub))
6029 }
6030
6031 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
6033 mut self,
6034 v: V,
6035 ) -> Self {
6036 self.0.request = v.into();
6037 self
6038 }
6039
6040 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6042 self.0.options = v.into();
6043 self
6044 }
6045
6046 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
6048 (*self.0.stub)
6049 .test_iam_permissions(self.0.request, self.0.options)
6050 .await
6051 .map(gax::response::Response::into_body)
6052 }
6053
6054 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6058 self.0.request.resource = v.into();
6059 self
6060 }
6061
6062 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6066 where
6067 T: std::iter::IntoIterator<Item = V>,
6068 V: std::convert::Into<std::string::String>,
6069 {
6070 use std::iter::Iterator;
6071 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6072 self
6073 }
6074 }
6075
6076 #[doc(hidden)]
6077 impl gax::options::internal::RequestBuilder for TestIamPermissions {
6078 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6079 &mut self.0.options
6080 }
6081 }
6082
6083 #[derive(Clone, Debug)]
6100 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6101
6102 impl GetOperation {
6103 pub(crate) fn new(
6104 stub: std::sync::Arc<dyn super::super::stub::dynamic::KeyManagementService>,
6105 ) -> Self {
6106 Self(RequestBuilder::new(stub))
6107 }
6108
6109 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6111 mut self,
6112 v: V,
6113 ) -> Self {
6114 self.0.request = v.into();
6115 self
6116 }
6117
6118 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6120 self.0.options = v.into();
6121 self
6122 }
6123
6124 pub async fn send(self) -> Result<longrunning::model::Operation> {
6126 (*self.0.stub)
6127 .get_operation(self.0.request, self.0.options)
6128 .await
6129 .map(gax::response::Response::into_body)
6130 }
6131
6132 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6134 self.0.request.name = v.into();
6135 self
6136 }
6137 }
6138
6139 #[doc(hidden)]
6140 impl gax::options::internal::RequestBuilder for GetOperation {
6141 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6142 &mut self.0.options
6143 }
6144 }
6145}