aws_sdk_paymentcryptographydata/operation/decrypt_data/
_decrypt_data_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct DecryptDataOutput {
6 pub key_arn: ::std::string::String,
8 pub key_check_value: ::std::string::String,
11 pub plain_text: ::std::string::String,
13 _request_id: Option<String>,
14}
15impl DecryptDataOutput {
16 pub fn key_arn(&self) -> &str {
18 use std::ops::Deref;
19 self.key_arn.deref()
20 }
21 pub fn key_check_value(&self) -> &str {
24 use std::ops::Deref;
25 self.key_check_value.deref()
26 }
27 pub fn plain_text(&self) -> &str {
29 use std::ops::Deref;
30 self.plain_text.deref()
31 }
32}
33impl ::std::fmt::Debug for DecryptDataOutput {
34 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35 let mut formatter = f.debug_struct("DecryptDataOutput");
36 formatter.field("key_arn", &self.key_arn);
37 formatter.field("key_check_value", &self.key_check_value);
38 formatter.field("plain_text", &"*** Sensitive Data Redacted ***");
39 formatter.field("_request_id", &self._request_id);
40 formatter.finish()
41 }
42}
43impl ::aws_types::request_id::RequestId for DecryptDataOutput {
44 fn request_id(&self) -> Option<&str> {
45 self._request_id.as_deref()
46 }
47}
48impl DecryptDataOutput {
49 pub fn builder() -> crate::operation::decrypt_data::builders::DecryptDataOutputBuilder {
51 crate::operation::decrypt_data::builders::DecryptDataOutputBuilder::default()
52 }
53}
54
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
57#[non_exhaustive]
58pub struct DecryptDataOutputBuilder {
59 pub(crate) key_arn: ::std::option::Option<::std::string::String>,
60 pub(crate) key_check_value: ::std::option::Option<::std::string::String>,
61 pub(crate) plain_text: ::std::option::Option<::std::string::String>,
62 _request_id: Option<String>,
63}
64impl DecryptDataOutputBuilder {
65 pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68 self.key_arn = ::std::option::Option::Some(input.into());
69 self
70 }
71 pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.key_arn = input;
74 self
75 }
76 pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
78 &self.key_arn
79 }
80 pub fn key_check_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.key_check_value = ::std::option::Option::Some(input.into());
85 self
86 }
87 pub fn set_key_check_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.key_check_value = input;
91 self
92 }
93 pub fn get_key_check_value(&self) -> &::std::option::Option<::std::string::String> {
96 &self.key_check_value
97 }
98 pub fn plain_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.plain_text = ::std::option::Option::Some(input.into());
102 self
103 }
104 pub fn set_plain_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.plain_text = input;
107 self
108 }
109 pub fn get_plain_text(&self) -> &::std::option::Option<::std::string::String> {
111 &self.plain_text
112 }
113 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
114 self._request_id = Some(request_id.into());
115 self
116 }
117
118 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
119 self._request_id = request_id;
120 self
121 }
122 pub fn build(self) -> ::std::result::Result<crate::operation::decrypt_data::DecryptDataOutput, ::aws_smithy_types::error::operation::BuildError> {
128 ::std::result::Result::Ok(crate::operation::decrypt_data::DecryptDataOutput {
129 key_arn: self.key_arn.ok_or_else(|| {
130 ::aws_smithy_types::error::operation::BuildError::missing_field(
131 "key_arn",
132 "key_arn was not specified but it is required when building DecryptDataOutput",
133 )
134 })?,
135 key_check_value: self.key_check_value.ok_or_else(|| {
136 ::aws_smithy_types::error::operation::BuildError::missing_field(
137 "key_check_value",
138 "key_check_value was not specified but it is required when building DecryptDataOutput",
139 )
140 })?,
141 plain_text: self.plain_text.ok_or_else(|| {
142 ::aws_smithy_types::error::operation::BuildError::missing_field(
143 "plain_text",
144 "plain_text was not specified but it is required when building DecryptDataOutput",
145 )
146 })?,
147 _request_id: self._request_id,
148 })
149 }
150}
151impl ::std::fmt::Debug for DecryptDataOutputBuilder {
152 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
153 let mut formatter = f.debug_struct("DecryptDataOutputBuilder");
154 formatter.field("key_arn", &self.key_arn);
155 formatter.field("key_check_value", &self.key_check_value);
156 formatter.field("plain_text", &"*** Sensitive Data Redacted ***");
157 formatter.field("_request_id", &self._request_id);
158 formatter.finish()
159 }
160}