aws_sdk_paymentcryptographydata/operation/decrypt_data/
_decrypt_data_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct DecryptDataInput {
6 pub key_identifier: ::std::option::Option<::std::string::String>,
9 pub cipher_text: ::std::option::Option<::std::string::String>,
11 pub decryption_attributes: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>,
13 pub wrapped_key: ::std::option::Option<crate::types::WrappedKey>,
15}
16impl DecryptDataInput {
17 pub fn key_identifier(&self) -> ::std::option::Option<&str> {
20 self.key_identifier.as_deref()
21 }
22 pub fn cipher_text(&self) -> ::std::option::Option<&str> {
24 self.cipher_text.as_deref()
25 }
26 pub fn decryption_attributes(&self) -> ::std::option::Option<&crate::types::EncryptionDecryptionAttributes> {
28 self.decryption_attributes.as_ref()
29 }
30 pub fn wrapped_key(&self) -> ::std::option::Option<&crate::types::WrappedKey> {
32 self.wrapped_key.as_ref()
33 }
34}
35impl ::std::fmt::Debug for DecryptDataInput {
36 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
37 let mut formatter = f.debug_struct("DecryptDataInput");
38 formatter.field("key_identifier", &self.key_identifier);
39 formatter.field("cipher_text", &"*** Sensitive Data Redacted ***");
40 formatter.field("decryption_attributes", &self.decryption_attributes);
41 formatter.field("wrapped_key", &self.wrapped_key);
42 formatter.finish()
43 }
44}
45impl DecryptDataInput {
46 pub fn builder() -> crate::operation::decrypt_data::builders::DecryptDataInputBuilder {
48 crate::operation::decrypt_data::builders::DecryptDataInputBuilder::default()
49 }
50}
51
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
54#[non_exhaustive]
55pub struct DecryptDataInputBuilder {
56 pub(crate) key_identifier: ::std::option::Option<::std::string::String>,
57 pub(crate) cipher_text: ::std::option::Option<::std::string::String>,
58 pub(crate) decryption_attributes: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>,
59 pub(crate) wrapped_key: ::std::option::Option<crate::types::WrappedKey>,
60}
61impl DecryptDataInputBuilder {
62 pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.key_identifier = ::std::option::Option::Some(input.into());
67 self
68 }
69 pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.key_identifier = input;
73 self
74 }
75 pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
78 &self.key_identifier
79 }
80 pub fn cipher_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.cipher_text = ::std::option::Option::Some(input.into());
84 self
85 }
86 pub fn set_cipher_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.cipher_text = input;
89 self
90 }
91 pub fn get_cipher_text(&self) -> &::std::option::Option<::std::string::String> {
93 &self.cipher_text
94 }
95 pub fn decryption_attributes(mut self, input: crate::types::EncryptionDecryptionAttributes) -> Self {
98 self.decryption_attributes = ::std::option::Option::Some(input);
99 self
100 }
101 pub fn set_decryption_attributes(mut self, input: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>) -> Self {
103 self.decryption_attributes = input;
104 self
105 }
106 pub fn get_decryption_attributes(&self) -> &::std::option::Option<crate::types::EncryptionDecryptionAttributes> {
108 &self.decryption_attributes
109 }
110 pub fn wrapped_key(mut self, input: crate::types::WrappedKey) -> Self {
112 self.wrapped_key = ::std::option::Option::Some(input);
113 self
114 }
115 pub fn set_wrapped_key(mut self, input: ::std::option::Option<crate::types::WrappedKey>) -> Self {
117 self.wrapped_key = input;
118 self
119 }
120 pub fn get_wrapped_key(&self) -> &::std::option::Option<crate::types::WrappedKey> {
122 &self.wrapped_key
123 }
124 pub fn build(self) -> ::std::result::Result<crate::operation::decrypt_data::DecryptDataInput, ::aws_smithy_types::error::operation::BuildError> {
126 ::std::result::Result::Ok(crate::operation::decrypt_data::DecryptDataInput {
127 key_identifier: self.key_identifier,
128 cipher_text: self.cipher_text,
129 decryption_attributes: self.decryption_attributes,
130 wrapped_key: self.wrapped_key,
131 })
132 }
133}
134impl ::std::fmt::Debug for DecryptDataInputBuilder {
135 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
136 let mut formatter = f.debug_struct("DecryptDataInputBuilder");
137 formatter.field("key_identifier", &self.key_identifier);
138 formatter.field("cipher_text", &"*** Sensitive Data Redacted ***");
139 formatter.field("decryption_attributes", &self.decryption_attributes);
140 formatter.field("wrapped_key", &self.wrapped_key);
141 formatter.finish()
142 }
143}