aws_sdk_kms/operation/generate_mac/
_generate_mac_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GenerateMacOutput {
6 pub mac: ::std::option::Option<::aws_smithy_types::Blob>,
9 pub mac_algorithm: ::std::option::Option<crate::types::MacAlgorithmSpec>,
11 pub key_id: ::std::option::Option<::std::string::String>,
13 _request_id: Option<String>,
14}
15impl GenerateMacOutput {
16 pub fn mac(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
19 self.mac.as_ref()
20 }
21 pub fn mac_algorithm(&self) -> ::std::option::Option<&crate::types::MacAlgorithmSpec> {
23 self.mac_algorithm.as_ref()
24 }
25 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 pub fn builder() -> crate::operation::generate_mac::builders::GenerateMacOutputBuilder {
38 crate::operation::generate_mac::builders::GenerateMacOutputBuilder::default()
39 }
40}
41
42#[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 pub fn mac(mut self, input: ::aws_smithy_types::Blob) -> Self {
55 self.mac = ::std::option::Option::Some(input);
56 self
57 }
58 pub fn set_mac(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
61 self.mac = input;
62 self
63 }
64 pub fn get_mac(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
67 &self.mac
68 }
69 pub fn mac_algorithm(mut self, input: crate::types::MacAlgorithmSpec) -> Self {
71 self.mac_algorithm = ::std::option::Option::Some(input);
72 self
73 }
74 pub fn set_mac_algorithm(mut self, input: ::std::option::Option<crate::types::MacAlgorithmSpec>) -> Self {
76 self.mac_algorithm = input;
77 self
78 }
79 pub fn get_mac_algorithm(&self) -> &::std::option::Option<crate::types::MacAlgorithmSpec> {
81 &self.mac_algorithm
82 }
83 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 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.key_id = input;
91 self
92 }
93 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 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}