aws-sdk-kms 1.129.0

AWS SDK for AWS Key Management Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DecapsulateOutput {
    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
    pub key_id: ::std::option::Option<::std::string::String>,
    /// <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>
    pub shared_secret: ::std::option::Option<::aws_smithy_types::Blob>,
    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
    pub encapsulation_algorithm: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>,
    _request_id: Option<String>,
}
impl DecapsulateOutput {
    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
    pub fn key_id(&self) -> ::std::option::Option<&str> {
        self.key_id.as_deref()
    }
    /// <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>
    pub fn shared_secret(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
        self.shared_secret.as_ref()
    }
    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
    pub fn encapsulation_algorithm(&self) -> ::std::option::Option<&crate::types::EncapsulationAlgorithmSpec> {
        self.encapsulation_algorithm.as_ref()
    }
}
impl ::std::fmt::Debug for DecapsulateOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("DecapsulateOutput");
        formatter.field("key_id", &self.key_id);
        formatter.field("shared_secret", &"*** Sensitive Data Redacted ***");
        formatter.field("encapsulation_algorithm", &self.encapsulation_algorithm);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for DecapsulateOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DecapsulateOutput {
    /// Creates a new builder-style object to manufacture [`DecapsulateOutput`](crate::operation::decapsulate::DecapsulateOutput).
    pub fn builder() -> crate::operation::decapsulate::builders::DecapsulateOutputBuilder {
        crate::operation::decapsulate::builders::DecapsulateOutputBuilder::default()
    }
}

/// A builder for [`DecapsulateOutput`](crate::operation::decapsulate::DecapsulateOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct DecapsulateOutputBuilder {
    pub(crate) key_id: ::std::option::Option<::std::string::String>,
    pub(crate) shared_secret: ::std::option::Option<::aws_smithy_types::Blob>,
    pub(crate) encapsulation_algorithm: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>,
    _request_id: Option<String>,
}
impl DecapsulateOutputBuilder {
    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.key_id = input;
        self
    }
    /// <p>The identifier of the ML-KEM KMS key used to decapsulate the shared secret.</p>
    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.key_id
    }
    /// <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>
    pub fn shared_secret(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.shared_secret = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    pub fn set_shared_secret(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.shared_secret = input;
        self
    }
    /// <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>
    pub fn get_shared_secret(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.shared_secret
    }
    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
    pub fn encapsulation_algorithm(mut self, input: crate::types::EncapsulationAlgorithmSpec) -> Self {
        self.encapsulation_algorithm = ::std::option::Option::Some(input);
        self
    }
    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
    pub fn set_encapsulation_algorithm(mut self, input: ::std::option::Option<crate::types::EncapsulationAlgorithmSpec>) -> Self {
        self.encapsulation_algorithm = input;
        self
    }
    /// <p>The key encapsulation algorithm used to recover the shared secret.</p>
    pub fn get_encapsulation_algorithm(&self) -> &::std::option::Option<crate::types::EncapsulationAlgorithmSpec> {
        &self.encapsulation_algorithm
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DecapsulateOutput`](crate::operation::decapsulate::DecapsulateOutput).
    pub fn build(self) -> crate::operation::decapsulate::DecapsulateOutput {
        crate::operation::decapsulate::DecapsulateOutput {
            key_id: self.key_id,
            shared_secret: self.shared_secret,
            encapsulation_algorithm: self.encapsulation_algorithm,
            _request_id: self._request_id,
        }
    }
}
impl ::std::fmt::Debug for DecapsulateOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("DecapsulateOutputBuilder");
        formatter.field("key_id", &self.key_id);
        formatter.field("shared_secret", &"*** Sensitive Data Redacted ***");
        formatter.field("encapsulation_algorithm", &self.encapsulation_algorithm);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}