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