aws_sdk_paymentcryptographydata/operation/verify_mac/
_verify_mac_output.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, ::std::fmt::Debug)]
5pub struct VerifyMacOutput {
6    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for MAC verification.</p>
7    pub key_arn: ::std::string::String,
8    /// <p>The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
9    /// <p>Amazon Web Services Payment Cryptography computes the KCV according to the CMAC specification.</p>
10    pub key_check_value: ::std::string::String,
11    _request_id: Option<String>,
12}
13impl VerifyMacOutput {
14    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for MAC verification.</p>
15    pub fn key_arn(&self) -> &str {
16        use std::ops::Deref;
17        self.key_arn.deref()
18    }
19    /// <p>The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
20    /// <p>Amazon Web Services Payment Cryptography computes the KCV according to the CMAC specification.</p>
21    pub fn key_check_value(&self) -> &str {
22        use std::ops::Deref;
23        self.key_check_value.deref()
24    }
25}
26impl ::aws_types::request_id::RequestId for VerifyMacOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl VerifyMacOutput {
32    /// Creates a new builder-style object to manufacture [`VerifyMacOutput`](crate::operation::verify_mac::VerifyMacOutput).
33    pub fn builder() -> crate::operation::verify_mac::builders::VerifyMacOutputBuilder {
34        crate::operation::verify_mac::builders::VerifyMacOutputBuilder::default()
35    }
36}
37
38/// A builder for [`VerifyMacOutput`](crate::operation::verify_mac::VerifyMacOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct VerifyMacOutputBuilder {
42    pub(crate) key_arn: ::std::option::Option<::std::string::String>,
43    pub(crate) key_check_value: ::std::option::Option<::std::string::String>,
44    _request_id: Option<String>,
45}
46impl VerifyMacOutputBuilder {
47    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for MAC verification.</p>
48    /// This field is required.
49    pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.key_arn = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for MAC verification.</p>
54    pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.key_arn = input;
56        self
57    }
58    /// <p>The <code>keyARN</code> of the encryption key that Amazon Web Services Payment Cryptography uses for MAC verification.</p>
59    pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
60        &self.key_arn
61    }
62    /// <p>The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
63    /// <p>Amazon Web Services Payment Cryptography computes the KCV according to the CMAC specification.</p>
64    /// This field is required.
65    pub fn key_check_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.key_check_value = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
70    /// <p>Amazon Web Services Payment Cryptography computes the KCV according to the CMAC specification.</p>
71    pub fn set_key_check_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.key_check_value = input;
73        self
74    }
75    /// <p>The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
76    /// <p>Amazon Web Services Payment Cryptography computes the KCV according to the CMAC specification.</p>
77    pub fn get_key_check_value(&self) -> &::std::option::Option<::std::string::String> {
78        &self.key_check_value
79    }
80    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81        self._request_id = Some(request_id.into());
82        self
83    }
84
85    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86        self._request_id = request_id;
87        self
88    }
89    /// Consumes the builder and constructs a [`VerifyMacOutput`](crate::operation::verify_mac::VerifyMacOutput).
90    /// This method will fail if any of the following fields are not set:
91    /// - [`key_arn`](crate::operation::verify_mac::builders::VerifyMacOutputBuilder::key_arn)
92    /// - [`key_check_value`](crate::operation::verify_mac::builders::VerifyMacOutputBuilder::key_check_value)
93    pub fn build(self) -> ::std::result::Result<crate::operation::verify_mac::VerifyMacOutput, ::aws_smithy_types::error::operation::BuildError> {
94        ::std::result::Result::Ok(crate::operation::verify_mac::VerifyMacOutput {
95            key_arn: self.key_arn.ok_or_else(|| {
96                ::aws_smithy_types::error::operation::BuildError::missing_field(
97                    "key_arn",
98                    "key_arn was not specified but it is required when building VerifyMacOutput",
99                )
100            })?,
101            key_check_value: self.key_check_value.ok_or_else(|| {
102                ::aws_smithy_types::error::operation::BuildError::missing_field(
103                    "key_check_value",
104                    "key_check_value was not specified but it is required when building VerifyMacOutput",
105                )
106            })?,
107            _request_id: self._request_id,
108        })
109    }
110}