1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct EncryptDataInput {
/// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
pub key_identifier: ::std::option::Option<::std::string::String>,
/// <p>The plaintext to be encrypted.</p><note>
/// <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>
/// </note>
pub plain_text: ::std::option::Option<::std::string::String>,
/// <p>The encryption key type and attributes for plaintext encryption.</p>
pub encryption_attributes: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>,
}
impl EncryptDataInput {
/// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
pub fn key_identifier(&self) -> ::std::option::Option<&str> {
self.key_identifier.as_deref()
}
/// <p>The plaintext to be encrypted.</p><note>
/// <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>
/// </note>
pub fn plain_text(&self) -> ::std::option::Option<&str> {
self.plain_text.as_deref()
}
/// <p>The encryption key type and attributes for plaintext encryption.</p>
pub fn encryption_attributes(&self) -> ::std::option::Option<&crate::types::EncryptionDecryptionAttributes> {
self.encryption_attributes.as_ref()
}
}
impl ::std::fmt::Debug for EncryptDataInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("EncryptDataInput");
formatter.field("key_identifier", &self.key_identifier);
formatter.field("plain_text", &"*** Sensitive Data Redacted ***");
formatter.field("encryption_attributes", &self.encryption_attributes);
formatter.finish()
}
}
impl EncryptDataInput {
/// Creates a new builder-style object to manufacture [`EncryptDataInput`](crate::operation::encrypt_data::EncryptDataInput).
pub fn builder() -> crate::operation::encrypt_data::builders::EncryptDataInputBuilder {
crate::operation::encrypt_data::builders::EncryptDataInputBuilder::default()
}
}
/// A builder for [`EncryptDataInput`](crate::operation::encrypt_data::EncryptDataInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct EncryptDataInputBuilder {
pub(crate) key_identifier: ::std::option::Option<::std::string::String>,
pub(crate) plain_text: ::std::option::Option<::std::string::String>,
pub(crate) encryption_attributes: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>,
}
impl EncryptDataInputBuilder {
/// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
/// This field is required.
pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.key_identifier = ::std::option::Option::Some(input.into());
self
}
/// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.key_identifier = input;
self
}
/// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.</p>
pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.key_identifier
}
/// <p>The plaintext to be encrypted.</p><note>
/// <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>
/// </note>
/// This field is required.
pub fn plain_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.plain_text = ::std::option::Option::Some(input.into());
self
}
/// <p>The plaintext to be encrypted.</p><note>
/// <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>
/// </note>
pub fn set_plain_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.plain_text = input;
self
}
/// <p>The plaintext to be encrypted.</p><note>
/// <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>
/// </note>
pub fn get_plain_text(&self) -> &::std::option::Option<::std::string::String> {
&self.plain_text
}
/// <p>The encryption key type and attributes for plaintext encryption.</p>
/// This field is required.
pub fn encryption_attributes(mut self, input: crate::types::EncryptionDecryptionAttributes) -> Self {
self.encryption_attributes = ::std::option::Option::Some(input);
self
}
/// <p>The encryption key type and attributes for plaintext encryption.</p>
pub fn set_encryption_attributes(mut self, input: ::std::option::Option<crate::types::EncryptionDecryptionAttributes>) -> Self {
self.encryption_attributes = input;
self
}
/// <p>The encryption key type and attributes for plaintext encryption.</p>
pub fn get_encryption_attributes(&self) -> &::std::option::Option<crate::types::EncryptionDecryptionAttributes> {
&self.encryption_attributes
}
/// Consumes the builder and constructs a [`EncryptDataInput`](crate::operation::encrypt_data::EncryptDataInput).
pub fn build(self) -> ::std::result::Result<crate::operation::encrypt_data::EncryptDataInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::encrypt_data::EncryptDataInput {
key_identifier: self.key_identifier,
plain_text: self.plain_text,
encryption_attributes: self.encryption_attributes,
})
}
}
impl ::std::fmt::Debug for EncryptDataInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("EncryptDataInputBuilder");
formatter.field("key_identifier", &self.key_identifier);
formatter.field("plain_text", &"*** Sensitive Data Redacted ***");
formatter.field("encryption_attributes", &self.encryption_attributes);
formatter.finish()
}
}