Skip to main content

aws_sdk_kms/operation/decapsulate/
_decapsulate_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)]
5pub struct DecapsulateOutput {
6    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
7    pub key_id: ::std::option::Option<::std::string::String>,
8    /// <p>The plaintext shared secret recovered from the encapsulated form. It is a 32-byte value that matches the shared secret held by the encapsulating party. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
9    pub shared_secret: ::std::option::Option<::aws_smithy_types::Blob>,
10    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
11    pub encapsulation_algorithm: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>,
12    _request_id: Option<String>,
13}
14impl DecapsulateOutput {
15    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
16    pub fn key_id(&self) -> ::std::option::Option<&str> {
17        self.key_id.as_deref()
18    }
19    /// <p>The plaintext shared secret recovered from the encapsulated form. It is a 32-byte value that matches the shared secret held by the encapsulating party. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
20    pub fn shared_secret(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
21        self.shared_secret.as_ref()
22    }
23    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
24    pub fn encapsulation_algorithm(&self) -> ::std::option::Option<&crate::types::EncapsulationAlgorithmSpec> {
25        self.encapsulation_algorithm.as_ref()
26    }
27}
28impl ::std::fmt::Debug for DecapsulateOutput {
29    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30        let mut formatter = f.debug_struct("DecapsulateOutput");
31        formatter.field("key_id", &self.key_id);
32        formatter.field("shared_secret", &"*** Sensitive Data Redacted ***");
33        formatter.field("encapsulation_algorithm", &self.encapsulation_algorithm);
34        formatter.field("_request_id", &self._request_id);
35        formatter.finish()
36    }
37}
38impl ::aws_types::request_id::RequestId for DecapsulateOutput {
39    fn request_id(&self) -> Option<&str> {
40        self._request_id.as_deref()
41    }
42}
43impl DecapsulateOutput {
44    /// Creates a new builder-style object to manufacture [`DecapsulateOutput`](crate::operation::decapsulate::DecapsulateOutput).
45    pub fn builder() -> crate::operation::decapsulate::builders::DecapsulateOutputBuilder {
46        crate::operation::decapsulate::builders::DecapsulateOutputBuilder::default()
47    }
48}
49
50/// A builder for [`DecapsulateOutput`](crate::operation::decapsulate::DecapsulateOutput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct DecapsulateOutputBuilder {
54    pub(crate) key_id: ::std::option::Option<::std::string::String>,
55    pub(crate) shared_secret: ::std::option::Option<::aws_smithy_types::Blob>,
56    pub(crate) encapsulation_algorithm: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>,
57    _request_id: Option<String>,
58}
59impl DecapsulateOutputBuilder {
60    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
61    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.key_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
66    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.key_id = input;
68        self
69    }
70    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
71    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.key_id
73    }
74    /// <p>The plaintext shared secret recovered from the encapsulated form. It is a 32-byte value that matches the shared secret held by the encapsulating party. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
75    pub fn shared_secret(mut self, input: ::aws_smithy_types::Blob) -> Self {
76        self.shared_secret = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>The plaintext shared secret recovered from the encapsulated form. It is a 32-byte value that matches the shared secret held by the encapsulating party. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
80    pub fn set_shared_secret(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
81        self.shared_secret = input;
82        self
83    }
84    /// <p>The plaintext shared secret recovered from the encapsulated form. It is a 32-byte value that matches the shared secret held by the encapsulating party. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
85    pub fn get_shared_secret(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
86        &self.shared_secret
87    }
88    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
89    pub fn encapsulation_algorithm(mut self, input: crate::types::EncapsulationAlgorithmSpec) -> Self {
90        self.encapsulation_algorithm = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
94    pub fn set_encapsulation_algorithm(mut self, input: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>) -> Self {
95        self.encapsulation_algorithm = input;
96        self
97    }
98    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
99    pub fn get_encapsulation_algorithm(&self) -> &::std::option::Option<crate::types::EncapsulationAlgorithmSpec> {
100        &self.encapsulation_algorithm
101    }
102    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
103        self._request_id = Some(request_id.into());
104        self
105    }
106
107    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
108        self._request_id = request_id;
109        self
110    }
111    /// Consumes the builder and constructs a [`DecapsulateOutput`](crate::operation::decapsulate::DecapsulateOutput).
112    pub fn build(self) -> crate::operation::decapsulate::DecapsulateOutput {
113        crate::operation::decapsulate::DecapsulateOutput {
114            key_id: self.key_id,
115            shared_secret: self.shared_secret,
116            encapsulation_algorithm: self.encapsulation_algorithm,
117            _request_id: self._request_id,
118        }
119    }
120}
121impl ::std::fmt::Debug for DecapsulateOutputBuilder {
122    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
123        let mut formatter = f.debug_struct("DecapsulateOutputBuilder");
124        formatter.field("key_id", &self.key_id);
125        formatter.field("shared_secret", &"*** Sensitive Data Redacted ***");
126        formatter.field("encapsulation_algorithm", &self.encapsulation_algorithm);
127        formatter.field("_request_id", &self._request_id);
128        formatter.finish()
129    }
130}