aws_sdk_paymentcryptographydata/operation/decrypt_data/
_decrypt_data_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct DecryptDataInput {
6    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for ciphertext decryption.</p>
7    /// <p>When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.</p>
8    pub key_identifier: ::std::option::Option<::std::string::String>,
9    /// <p>The ciphertext to decrypt.</p>
10    pub cipher_text: ::std::option::Option<::std::string::String>,
11    /// <p>The encryption key type and attributes for ciphertext decryption.</p>
12    pub decryption_attributes: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>,
13    /// <p>The WrappedKeyBlock containing the encryption key for ciphertext decryption.</p>
14    pub wrapped_key: ::std::option::Option<crate::types::WrappedKey>,
15}
16impl DecryptDataInput {
17    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for ciphertext decryption.</p>
18    /// <p>When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.</p>
19    pub fn key_identifier(&self) -> ::std::option::Option<&str> {
20        self.key_identifier.as_deref()
21    }
22    /// <p>The ciphertext to decrypt.</p>
23    pub fn cipher_text(&self) -> ::std::option::Option<&str> {
24        self.cipher_text.as_deref()
25    }
26    /// <p>The encryption key type and attributes for ciphertext decryption.</p>
27    pub fn decryption_attributes(&self) -> ::std::option::Option<&crate::types::EncryptionDecryptionAttributes> {
28        self.decryption_attributes.as_ref()
29    }
30    /// <p>The WrappedKeyBlock containing the encryption key for ciphertext decryption.</p>
31    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    /// Creates a new builder-style object to manufacture [`DecryptDataInput`](crate::operation::decrypt_data::DecryptDataInput).
47    pub fn builder() -> crate::operation::decrypt_data::builders::DecryptDataInputBuilder {
48        crate::operation::decrypt_data::builders::DecryptDataInputBuilder::default()
49    }
50}
51
52/// A builder for [`DecryptDataInput`](crate::operation::decrypt_data::DecryptDataInput).
53#[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    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for ciphertext decryption.</p>
63    /// <p>When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.</p>
64    /// This field is required.
65    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    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for ciphertext decryption.</p>
70    /// <p>When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.</p>
71    pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.key_identifier = input;
73        self
74    }
75    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for ciphertext decryption.</p>
76    /// <p>When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.</p>
77    pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
78        &self.key_identifier
79    }
80    /// <p>The ciphertext to decrypt.</p>
81    /// This field is required.
82    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    /// <p>The ciphertext to decrypt.</p>
87    pub fn set_cipher_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.cipher_text = input;
89        self
90    }
91    /// <p>The ciphertext to decrypt.</p>
92    pub fn get_cipher_text(&self) -> &::std::option::Option<::std::string::String> {
93        &self.cipher_text
94    }
95    /// <p>The encryption key type and attributes for ciphertext decryption.</p>
96    /// This field is required.
97    pub fn decryption_attributes(mut self, input: crate::types::EncryptionDecryptionAttributes) -> Self {
98        self.decryption_attributes = ::std::option::Option::Some(input);
99        self
100    }
101    /// <p>The encryption key type and attributes for ciphertext decryption.</p>
102    pub fn set_decryption_attributes(mut self, input: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>) -> Self {
103        self.decryption_attributes = input;
104        self
105    }
106    /// <p>The encryption key type and attributes for ciphertext decryption.</p>
107    pub fn get_decryption_attributes(&self) -> &::std::option::Option<crate::types::EncryptionDecryptionAttributes> {
108        &self.decryption_attributes
109    }
110    /// <p>The WrappedKeyBlock containing the encryption key for ciphertext decryption.</p>
111    pub fn wrapped_key(mut self, input: crate::types::WrappedKey) -> Self {
112        self.wrapped_key = ::std::option::Option::Some(input);
113        self
114    }
115    /// <p>The WrappedKeyBlock containing the encryption key for ciphertext decryption.</p>
116    pub fn set_wrapped_key(mut self, input: ::std::option::Option<crate::types::WrappedKey>) -> Self {
117        self.wrapped_key = input;
118        self
119    }
120    /// <p>The WrappedKeyBlock containing the encryption key for ciphertext decryption.</p>
121    pub fn get_wrapped_key(&self) -> &::std::option::Option<crate::types::WrappedKey> {
122        &self.wrapped_key
123    }
124    /// Consumes the builder and constructs a [`DecryptDataInput`](crate::operation::decrypt_data::DecryptDataInput).
125    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}