aws_sdk_paymentcryptographydata/operation/encrypt_data/_encrypt_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 EncryptDataInput {
6 /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</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 plaintext to be encrypted.</p><note>
10 /// <p>For encryption using asymmetric keys, plaintext data length is constrained by encryption key strength that you define in <code>KeyAlgorithm</code> and padding type that you define in <code>AsymmetricEncryptionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html">Encrypt data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
11 /// </note>
12 pub plain_text: ::std::option::Option<::std::string::String>,
13 /// <p>The encryption key type and attributes for plaintext encryption.</p>
14 pub encryption_attributes: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>,
15 /// <p>The WrappedKeyBlock containing the encryption key for plaintext encryption.</p>
16 pub wrapped_key: ::std::option::Option<crate::types::WrappedKey>,
17}
18impl EncryptDataInput {
19 /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
20 /// <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>
21 pub fn key_identifier(&self) -> ::std::option::Option<&str> {
22 self.key_identifier.as_deref()
23 }
24 /// <p>The plaintext to be encrypted.</p><note>
25 /// <p>For encryption using asymmetric keys, plaintext data length is constrained by encryption key strength that you define in <code>KeyAlgorithm</code> and padding type that you define in <code>AsymmetricEncryptionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html">Encrypt data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
26 /// </note>
27 pub fn plain_text(&self) -> ::std::option::Option<&str> {
28 self.plain_text.as_deref()
29 }
30 /// <p>The encryption key type and attributes for plaintext encryption.</p>
31 pub fn encryption_attributes(&self) -> ::std::option::Option<&crate::types::EncryptionDecryptionAttributes> {
32 self.encryption_attributes.as_ref()
33 }
34 /// <p>The WrappedKeyBlock containing the encryption key for plaintext encryption.</p>
35 pub fn wrapped_key(&self) -> ::std::option::Option<&crate::types::WrappedKey> {
36 self.wrapped_key.as_ref()
37 }
38}
39impl ::std::fmt::Debug for EncryptDataInput {
40 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
41 let mut formatter = f.debug_struct("EncryptDataInput");
42 formatter.field("key_identifier", &self.key_identifier);
43 formatter.field("plain_text", &"*** Sensitive Data Redacted ***");
44 formatter.field("encryption_attributes", &self.encryption_attributes);
45 formatter.field("wrapped_key", &self.wrapped_key);
46 formatter.finish()
47 }
48}
49impl EncryptDataInput {
50 /// Creates a new builder-style object to manufacture [`EncryptDataInput`](crate::operation::encrypt_data::EncryptDataInput).
51 pub fn builder() -> crate::operation::encrypt_data::builders::EncryptDataInputBuilder {
52 crate::operation::encrypt_data::builders::EncryptDataInputBuilder::default()
53 }
54}
55
56/// A builder for [`EncryptDataInput`](crate::operation::encrypt_data::EncryptDataInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
58#[non_exhaustive]
59pub struct EncryptDataInputBuilder {
60 pub(crate) key_identifier: ::std::option::Option<::std::string::String>,
61 pub(crate) plain_text: ::std::option::Option<::std::string::String>,
62 pub(crate) encryption_attributes: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>,
63 pub(crate) wrapped_key: ::std::option::Option<crate::types::WrappedKey>,
64}
65impl EncryptDataInputBuilder {
66 /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
67 /// <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>
68 /// This field is required.
69 pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.key_identifier = ::std::option::Option::Some(input.into());
71 self
72 }
73 /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
74 /// <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>
75 pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.key_identifier = input;
77 self
78 }
79 /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
80 /// <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>
81 pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
82 &self.key_identifier
83 }
84 /// <p>The plaintext to be encrypted.</p><note>
85 /// <p>For encryption using asymmetric keys, plaintext data length is constrained by encryption key strength that you define in <code>KeyAlgorithm</code> and padding type that you define in <code>AsymmetricEncryptionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html">Encrypt data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
86 /// </note>
87 /// This field is required.
88 pub fn plain_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.plain_text = ::std::option::Option::Some(input.into());
90 self
91 }
92 /// <p>The plaintext to be encrypted.</p><note>
93 /// <p>For encryption using asymmetric keys, plaintext data length is constrained by encryption key strength that you define in <code>KeyAlgorithm</code> and padding type that you define in <code>AsymmetricEncryptionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html">Encrypt data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
94 /// </note>
95 pub fn set_plain_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.plain_text = input;
97 self
98 }
99 /// <p>The plaintext to be encrypted.</p><note>
100 /// <p>For encryption using asymmetric keys, plaintext data length is constrained by encryption key strength that you define in <code>KeyAlgorithm</code> and padding type that you define in <code>AsymmetricEncryptionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html">Encrypt data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
101 /// </note>
102 pub fn get_plain_text(&self) -> &::std::option::Option<::std::string::String> {
103 &self.plain_text
104 }
105 /// <p>The encryption key type and attributes for plaintext encryption.</p>
106 /// This field is required.
107 pub fn encryption_attributes(mut self, input: crate::types::EncryptionDecryptionAttributes) -> Self {
108 self.encryption_attributes = ::std::option::Option::Some(input);
109 self
110 }
111 /// <p>The encryption key type and attributes for plaintext encryption.</p>
112 pub fn set_encryption_attributes(mut self, input: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>) -> Self {
113 self.encryption_attributes = input;
114 self
115 }
116 /// <p>The encryption key type and attributes for plaintext encryption.</p>
117 pub fn get_encryption_attributes(&self) -> &::std::option::Option<crate::types::EncryptionDecryptionAttributes> {
118 &self.encryption_attributes
119 }
120 /// <p>The WrappedKeyBlock containing the encryption key for plaintext encryption.</p>
121 pub fn wrapped_key(mut self, input: crate::types::WrappedKey) -> Self {
122 self.wrapped_key = ::std::option::Option::Some(input);
123 self
124 }
125 /// <p>The WrappedKeyBlock containing the encryption key for plaintext encryption.</p>
126 pub fn set_wrapped_key(mut self, input: ::std::option::Option<crate::types::WrappedKey>) -> Self {
127 self.wrapped_key = input;
128 self
129 }
130 /// <p>The WrappedKeyBlock containing the encryption key for plaintext encryption.</p>
131 pub fn get_wrapped_key(&self) -> &::std::option::Option<crate::types::WrappedKey> {
132 &self.wrapped_key
133 }
134 /// Consumes the builder and constructs a [`EncryptDataInput`](crate::operation::encrypt_data::EncryptDataInput).
135 pub fn build(self) -> ::std::result::Result<crate::operation::encrypt_data::EncryptDataInput, ::aws_smithy_types::error::operation::BuildError> {
136 ::std::result::Result::Ok(crate::operation::encrypt_data::EncryptDataInput {
137 key_identifier: self.key_identifier,
138 plain_text: self.plain_text,
139 encryption_attributes: self.encryption_attributes,
140 wrapped_key: self.wrapped_key,
141 })
142 }
143}
144impl ::std::fmt::Debug for EncryptDataInputBuilder {
145 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
146 let mut formatter = f.debug_struct("EncryptDataInputBuilder");
147 formatter.field("key_identifier", &self.key_identifier);
148 formatter.field("plain_text", &"*** Sensitive Data Redacted ***");
149 formatter.field("encryption_attributes", &self.encryption_attributes);
150 formatter.field("wrapped_key", &self.wrapped_key);
151 formatter.finish()
152 }
153}