aws_sdk_paymentcryptographydata/operation/generate_mac/
_generate_mac_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 GenerateMacInput {
6    /// <p>The <code>keyARN</code> of the MAC generation encryption key.</p>
7    pub key_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The data for which a MAC is under generation. This value must be hexBinary.</p>
9    pub message_data: ::std::option::Option<::std::string::String>,
10    /// <p>The attributes and data values to use for MAC generation within Amazon Web Services Payment Cryptography.</p>
11    pub generation_attributes: ::std::option::Option<crate::types::MacAttributes>,
12    /// <p>The length of a MAC under generation.</p>
13    pub mac_length: ::std::option::Option<i32>,
14}
15impl GenerateMacInput {
16    /// <p>The <code>keyARN</code> of the MAC generation encryption key.</p>
17    pub fn key_identifier(&self) -> ::std::option::Option<&str> {
18        self.key_identifier.as_deref()
19    }
20    /// <p>The data for which a MAC is under generation. This value must be hexBinary.</p>
21    pub fn message_data(&self) -> ::std::option::Option<&str> {
22        self.message_data.as_deref()
23    }
24    /// <p>The attributes and data values to use for MAC generation within Amazon Web Services Payment Cryptography.</p>
25    pub fn generation_attributes(&self) -> ::std::option::Option<&crate::types::MacAttributes> {
26        self.generation_attributes.as_ref()
27    }
28    /// <p>The length of a MAC under generation.</p>
29    pub fn mac_length(&self) -> ::std::option::Option<i32> {
30        self.mac_length
31    }
32}
33impl ::std::fmt::Debug for GenerateMacInput {
34    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35        let mut formatter = f.debug_struct("GenerateMacInput");
36        formatter.field("key_identifier", &self.key_identifier);
37        formatter.field("message_data", &"*** Sensitive Data Redacted ***");
38        formatter.field("generation_attributes", &self.generation_attributes);
39        formatter.field("mac_length", &self.mac_length);
40        formatter.finish()
41    }
42}
43impl GenerateMacInput {
44    /// Creates a new builder-style object to manufacture [`GenerateMacInput`](crate::operation::generate_mac::GenerateMacInput).
45    pub fn builder() -> crate::operation::generate_mac::builders::GenerateMacInputBuilder {
46        crate::operation::generate_mac::builders::GenerateMacInputBuilder::default()
47    }
48}
49
50/// A builder for [`GenerateMacInput`](crate::operation::generate_mac::GenerateMacInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct GenerateMacInputBuilder {
54    pub(crate) key_identifier: ::std::option::Option<::std::string::String>,
55    pub(crate) message_data: ::std::option::Option<::std::string::String>,
56    pub(crate) generation_attributes: ::std::option::Option<crate::types::MacAttributes>,
57    pub(crate) mac_length: ::std::option::Option<i32>,
58}
59impl GenerateMacInputBuilder {
60    /// <p>The <code>keyARN</code> of the MAC generation encryption key.</p>
61    /// This field is required.
62    pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.key_identifier = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The <code>keyARN</code> of the MAC generation encryption key.</p>
67    pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.key_identifier = input;
69        self
70    }
71    /// <p>The <code>keyARN</code> of the MAC generation encryption key.</p>
72    pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
73        &self.key_identifier
74    }
75    /// <p>The data for which a MAC is under generation. This value must be hexBinary.</p>
76    /// This field is required.
77    pub fn message_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.message_data = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The data for which a MAC is under generation. This value must be hexBinary.</p>
82    pub fn set_message_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.message_data = input;
84        self
85    }
86    /// <p>The data for which a MAC is under generation. This value must be hexBinary.</p>
87    pub fn get_message_data(&self) -> &::std::option::Option<::std::string::String> {
88        &self.message_data
89    }
90    /// <p>The attributes and data values to use for MAC generation within Amazon Web Services Payment Cryptography.</p>
91    /// This field is required.
92    pub fn generation_attributes(mut self, input: crate::types::MacAttributes) -> Self {
93        self.generation_attributes = ::std::option::Option::Some(input);
94        self
95    }
96    /// <p>The attributes and data values to use for MAC generation within Amazon Web Services Payment Cryptography.</p>
97    pub fn set_generation_attributes(mut self, input: ::std::option::Option<crate::types::MacAttributes>) -> Self {
98        self.generation_attributes = input;
99        self
100    }
101    /// <p>The attributes and data values to use for MAC generation within Amazon Web Services Payment Cryptography.</p>
102    pub fn get_generation_attributes(&self) -> &::std::option::Option<crate::types::MacAttributes> {
103        &self.generation_attributes
104    }
105    /// <p>The length of a MAC under generation.</p>
106    pub fn mac_length(mut self, input: i32) -> Self {
107        self.mac_length = ::std::option::Option::Some(input);
108        self
109    }
110    /// <p>The length of a MAC under generation.</p>
111    pub fn set_mac_length(mut self, input: ::std::option::Option<i32>) -> Self {
112        self.mac_length = input;
113        self
114    }
115    /// <p>The length of a MAC under generation.</p>
116    pub fn get_mac_length(&self) -> &::std::option::Option<i32> {
117        &self.mac_length
118    }
119    /// Consumes the builder and constructs a [`GenerateMacInput`](crate::operation::generate_mac::GenerateMacInput).
120    pub fn build(self) -> ::std::result::Result<crate::operation::generate_mac::GenerateMacInput, ::aws_smithy_types::error::operation::BuildError> {
121        ::std::result::Result::Ok(crate::operation::generate_mac::GenerateMacInput {
122            key_identifier: self.key_identifier,
123            message_data: self.message_data,
124            generation_attributes: self.generation_attributes,
125            mac_length: self.mac_length,
126        })
127    }
128}
129impl ::std::fmt::Debug for GenerateMacInputBuilder {
130    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
131        let mut formatter = f.debug_struct("GenerateMacInputBuilder");
132        formatter.field("key_identifier", &self.key_identifier);
133        formatter.field("message_data", &"*** Sensitive Data Redacted ***");
134        formatter.field("generation_attributes", &self.generation_attributes);
135        formatter.field("mac_length", &self.mac_length);
136        formatter.finish()
137    }
138}