aws_sdk_paymentcryptographydata/operation/encrypt_data/
_encrypt_data_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct EncryptDataOutput {
6 pub key_arn: ::std::string::String,
8 pub key_check_value: ::std::option::Option<::std::string::String>,
11 pub cipher_text: ::std::string::String,
13 _request_id: Option<String>,
14}
15impl EncryptDataOutput {
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) -> ::std::option::Option<&str> {
24 self.key_check_value.as_deref()
25 }
26 pub fn cipher_text(&self) -> &str {
28 use std::ops::Deref;
29 self.cipher_text.deref()
30 }
31}
32impl ::std::fmt::Debug for EncryptDataOutput {
33 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
34 let mut formatter = f.debug_struct("EncryptDataOutput");
35 formatter.field("key_arn", &self.key_arn);
36 formatter.field("key_check_value", &self.key_check_value);
37 formatter.field("cipher_text", &"*** Sensitive Data Redacted ***");
38 formatter.field("_request_id", &self._request_id);
39 formatter.finish()
40 }
41}
42impl ::aws_types::request_id::RequestId for EncryptDataOutput {
43 fn request_id(&self) -> Option<&str> {
44 self._request_id.as_deref()
45 }
46}
47impl EncryptDataOutput {
48 pub fn builder() -> crate::operation::encrypt_data::builders::EncryptDataOutputBuilder {
50 crate::operation::encrypt_data::builders::EncryptDataOutputBuilder::default()
51 }
52}
53
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
56#[non_exhaustive]
57pub struct EncryptDataOutputBuilder {
58 pub(crate) key_arn: ::std::option::Option<::std::string::String>,
59 pub(crate) key_check_value: ::std::option::Option<::std::string::String>,
60 pub(crate) cipher_text: ::std::option::Option<::std::string::String>,
61 _request_id: Option<String>,
62}
63impl EncryptDataOutputBuilder {
64 pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.key_arn = ::std::option::Option::Some(input.into());
68 self
69 }
70 pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.key_arn = input;
73 self
74 }
75 pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
77 &self.key_arn
78 }
79 pub fn key_check_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.key_check_value = ::std::option::Option::Some(input.into());
83 self
84 }
85 pub fn set_key_check_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.key_check_value = input;
89 self
90 }
91 pub fn get_key_check_value(&self) -> &::std::option::Option<::std::string::String> {
94 &self.key_check_value
95 }
96 pub fn cipher_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99 self.cipher_text = ::std::option::Option::Some(input.into());
100 self
101 }
102 pub fn set_cipher_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104 self.cipher_text = input;
105 self
106 }
107 pub fn get_cipher_text(&self) -> &::std::option::Option<::std::string::String> {
109 &self.cipher_text
110 }
111 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
112 self._request_id = Some(request_id.into());
113 self
114 }
115
116 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
117 self._request_id = request_id;
118 self
119 }
120 pub fn build(self) -> ::std::result::Result<crate::operation::encrypt_data::EncryptDataOutput, ::aws_smithy_types::error::operation::BuildError> {
125 ::std::result::Result::Ok(crate::operation::encrypt_data::EncryptDataOutput {
126 key_arn: self.key_arn.ok_or_else(|| {
127 ::aws_smithy_types::error::operation::BuildError::missing_field(
128 "key_arn",
129 "key_arn was not specified but it is required when building EncryptDataOutput",
130 )
131 })?,
132 key_check_value: self.key_check_value,
133 cipher_text: self.cipher_text.ok_or_else(|| {
134 ::aws_smithy_types::error::operation::BuildError::missing_field(
135 "cipher_text",
136 "cipher_text was not specified but it is required when building EncryptDataOutput",
137 )
138 })?,
139 _request_id: self._request_id,
140 })
141 }
142}
143impl ::std::fmt::Debug for EncryptDataOutputBuilder {
144 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
145 let mut formatter = f.debug_struct("EncryptDataOutputBuilder");
146 formatter.field("key_arn", &self.key_arn);
147 formatter.field("key_check_value", &self.key_check_value);
148 formatter.field("cipher_text", &"*** Sensitive Data Redacted ***");
149 formatter.field("_request_id", &self._request_id);
150 formatter.finish()
151 }
152}