aws_sdk_kms/operation/decapsulate/
_decapsulate_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct DecapsulateOutput {
6 pub key_id: ::std::option::Option<::std::string::String>,
8 pub shared_secret: ::std::option::Option<::aws_smithy_types::Blob>,
10 pub encapsulation_algorithm: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>,
12 _request_id: Option<String>,
13}
14impl DecapsulateOutput {
15 pub fn key_id(&self) -> ::std::option::Option<&str> {
17 self.key_id.as_deref()
18 }
19 pub fn shared_secret(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
21 self.shared_secret.as_ref()
22 }
23 pub fn encapsulation_algorithm(&self) -> ::std::option::Option<&crate::types::EncapsulationAlgorithmSpec> {
25 self.encapsulation_algorithm.as_ref()
26 }
27}
28impl ::std::fmt::Debug for DecapsulateOutput {
29 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30 let mut formatter = f.debug_struct("DecapsulateOutput");
31 formatter.field("key_id", &self.key_id);
32 formatter.field("shared_secret", &"*** Sensitive Data Redacted ***");
33 formatter.field("encapsulation_algorithm", &self.encapsulation_algorithm);
34 formatter.field("_request_id", &self._request_id);
35 formatter.finish()
36 }
37}
38impl ::aws_types::request_id::RequestId for DecapsulateOutput {
39 fn request_id(&self) -> Option<&str> {
40 self._request_id.as_deref()
41 }
42}
43impl DecapsulateOutput {
44 pub fn builder() -> crate::operation::decapsulate::builders::DecapsulateOutputBuilder {
46 crate::operation::decapsulate::builders::DecapsulateOutputBuilder::default()
47 }
48}
49
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct DecapsulateOutputBuilder {
54 pub(crate) key_id: ::std::option::Option<::std::string::String>,
55 pub(crate) shared_secret: ::std::option::Option<::aws_smithy_types::Blob>,
56 pub(crate) encapsulation_algorithm: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>,
57 _request_id: Option<String>,
58}
59impl DecapsulateOutputBuilder {
60 pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.key_id = ::std::option::Option::Some(input.into());
63 self
64 }
65 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.key_id = input;
68 self
69 }
70 pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
72 &self.key_id
73 }
74 pub fn shared_secret(mut self, input: ::aws_smithy_types::Blob) -> Self {
76 self.shared_secret = ::std::option::Option::Some(input);
77 self
78 }
79 pub fn set_shared_secret(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
81 self.shared_secret = input;
82 self
83 }
84 pub fn get_shared_secret(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
86 &self.shared_secret
87 }
88 pub fn encapsulation_algorithm(mut self, input: crate::types::EncapsulationAlgorithmSpec) -> Self {
90 self.encapsulation_algorithm = ::std::option::Option::Some(input);
91 self
92 }
93 pub fn set_encapsulation_algorithm(mut self, input: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>) -> Self {
95 self.encapsulation_algorithm = input;
96 self
97 }
98 pub fn get_encapsulation_algorithm(&self) -> &::std::option::Option<crate::types::EncapsulationAlgorithmSpec> {
100 &self.encapsulation_algorithm
101 }
102 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
103 self._request_id = Some(request_id.into());
104 self
105 }
106
107 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
108 self._request_id = request_id;
109 self
110 }
111 pub fn build(self) -> crate::operation::decapsulate::DecapsulateOutput {
113 crate::operation::decapsulate::DecapsulateOutput {
114 key_id: self.key_id,
115 shared_secret: self.shared_secret,
116 encapsulation_algorithm: self.encapsulation_algorithm,
117 _request_id: self._request_id,
118 }
119 }
120}
121impl ::std::fmt::Debug for DecapsulateOutputBuilder {
122 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
123 let mut formatter = f.debug_struct("DecapsulateOutputBuilder");
124 formatter.field("key_id", &self.key_id);
125 formatter.field("shared_secret", &"*** Sensitive Data Redacted ***");
126 formatter.field("encapsulation_algorithm", &self.encapsulation_algorithm);
127 formatter.field("_request_id", &self._request_id);
128 formatter.finish()
129 }
130}