aws_sdk_kms/operation/generate_mac/
_generate_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 GenerateMacOutput {
6    /// <p>The hash-based message authentication code (HMAC) that was generated for the specified message, HMAC KMS key, and MAC algorithm.</p>
7    /// <p>This is the standard, raw HMAC defined in <a href="https://datatracker.ietf.org/doc/html/rfc2104">RFC 2104</a>.</p>
8    pub mac: ::std::option::Option<::aws_smithy_types::Blob>,
9    /// <p>The MAC algorithm that was used to generate the HMAC.</p>
10    pub mac_algorithm: ::std::option::Option<crate::types::MacAlgorithmSpec>,
11    /// <p>The HMAC KMS key used in the operation.</p>
12    pub key_id: ::std::option::Option<::std::string::String>,
13    _request_id: Option<String>,
14}
15impl GenerateMacOutput {
16    /// <p>The hash-based message authentication code (HMAC) that was generated for the specified message, HMAC KMS key, and MAC algorithm.</p>
17    /// <p>This is the standard, raw HMAC defined in <a href="https://datatracker.ietf.org/doc/html/rfc2104">RFC 2104</a>.</p>
18    pub fn mac(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
19        self.mac.as_ref()
20    }
21    /// <p>The MAC algorithm that was used to generate the HMAC.</p>
22    pub fn mac_algorithm(&self) -> ::std::option::Option<&crate::types::MacAlgorithmSpec> {
23        self.mac_algorithm.as_ref()
24    }
25    /// <p>The HMAC KMS key used in the operation.</p>
26    pub fn key_id(&self) -> ::std::option::Option<&str> {
27        self.key_id.as_deref()
28    }
29}
30impl ::aws_types::request_id::RequestId for GenerateMacOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl GenerateMacOutput {
36    /// Creates a new builder-style object to manufacture [`GenerateMacOutput`](crate::operation::generate_mac::GenerateMacOutput).
37    pub fn builder() -> crate::operation::generate_mac::builders::GenerateMacOutputBuilder {
38        crate::operation::generate_mac::builders::GenerateMacOutputBuilder::default()
39    }
40}
41
42/// A builder for [`GenerateMacOutput`](crate::operation::generate_mac::GenerateMacOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct GenerateMacOutputBuilder {
46    pub(crate) mac: ::std::option::Option<::aws_smithy_types::Blob>,
47    pub(crate) mac_algorithm: ::std::option::Option<crate::types::MacAlgorithmSpec>,
48    pub(crate) key_id: ::std::option::Option<::std::string::String>,
49    _request_id: Option<String>,
50}
51impl GenerateMacOutputBuilder {
52    /// <p>The hash-based message authentication code (HMAC) that was generated for the specified message, HMAC KMS key, and MAC algorithm.</p>
53    /// <p>This is the standard, raw HMAC defined in <a href="https://datatracker.ietf.org/doc/html/rfc2104">RFC 2104</a>.</p>
54    pub fn mac(mut self, input: ::aws_smithy_types::Blob) -> Self {
55        self.mac = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>The hash-based message authentication code (HMAC) that was generated for the specified message, HMAC KMS key, and MAC algorithm.</p>
59    /// <p>This is the standard, raw HMAC defined in <a href="https://datatracker.ietf.org/doc/html/rfc2104">RFC 2104</a>.</p>
60    pub fn set_mac(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
61        self.mac = input;
62        self
63    }
64    /// <p>The hash-based message authentication code (HMAC) that was generated for the specified message, HMAC KMS key, and MAC algorithm.</p>
65    /// <p>This is the standard, raw HMAC defined in <a href="https://datatracker.ietf.org/doc/html/rfc2104">RFC 2104</a>.</p>
66    pub fn get_mac(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
67        &self.mac
68    }
69    /// <p>The MAC algorithm that was used to generate the HMAC.</p>
70    pub fn mac_algorithm(mut self, input: crate::types::MacAlgorithmSpec) -> Self {
71        self.mac_algorithm = ::std::option::Option::Some(input);
72        self
73    }
74    /// <p>The MAC algorithm that was used to generate the HMAC.</p>
75    pub fn set_mac_algorithm(mut self, input: ::std::option::Option<crate::types::MacAlgorithmSpec>) -> Self {
76        self.mac_algorithm = input;
77        self
78    }
79    /// <p>The MAC algorithm that was used to generate the HMAC.</p>
80    pub fn get_mac_algorithm(&self) -> &::std::option::Option<crate::types::MacAlgorithmSpec> {
81        &self.mac_algorithm
82    }
83    /// <p>The HMAC KMS key used in the operation.</p>
84    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.key_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The HMAC KMS key used in the operation.</p>
89    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.key_id = input;
91        self
92    }
93    /// <p>The HMAC KMS key used in the operation.</p>
94    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.key_id
96    }
97    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
98        self._request_id = Some(request_id.into());
99        self
100    }
101
102    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
103        self._request_id = request_id;
104        self
105    }
106    /// Consumes the builder and constructs a [`GenerateMacOutput`](crate::operation::generate_mac::GenerateMacOutput).
107    pub fn build(self) -> crate::operation::generate_mac::GenerateMacOutput {
108        crate::operation::generate_mac::GenerateMacOutput {
109            mac: self.mac,
110            mac_algorithm: self.mac_algorithm,
111            key_id: self.key_id,
112            _request_id: self._request_id,
113        }
114    }
115}