aws_sdk_kms/operation/encrypt/
_encrypt_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 EncryptOutput {
6    /// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
7    pub ciphertext_blob: ::std::option::Option<::aws_smithy_types::Blob>,
8    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
9    pub key_id: ::std::option::Option<::std::string::String>,
10    /// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
11    pub encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
12    _request_id: Option<String>,
13}
14impl EncryptOutput {
15    /// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
16    pub fn ciphertext_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
17        self.ciphertext_blob.as_ref()
18    }
19    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
20    pub fn key_id(&self) -> ::std::option::Option<&str> {
21        self.key_id.as_deref()
22    }
23    /// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
24    pub fn encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithmSpec> {
25        self.encryption_algorithm.as_ref()
26    }
27}
28impl ::aws_types::request_id::RequestId for EncryptOutput {
29    fn request_id(&self) -> Option<&str> {
30        self._request_id.as_deref()
31    }
32}
33impl EncryptOutput {
34    /// Creates a new builder-style object to manufacture [`EncryptOutput`](crate::operation::encrypt::EncryptOutput).
35    pub fn builder() -> crate::operation::encrypt::builders::EncryptOutputBuilder {
36        crate::operation::encrypt::builders::EncryptOutputBuilder::default()
37    }
38}
39
40/// A builder for [`EncryptOutput`](crate::operation::encrypt::EncryptOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct EncryptOutputBuilder {
44    pub(crate) ciphertext_blob: ::std::option::Option<::aws_smithy_types::Blob>,
45    pub(crate) key_id: ::std::option::Option<::std::string::String>,
46    pub(crate) encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
47    _request_id: Option<String>,
48}
49impl EncryptOutputBuilder {
50    /// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
51    pub fn ciphertext_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
52        self.ciphertext_blob = ::std::option::Option::Some(input);
53        self
54    }
55    /// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
56    pub fn set_ciphertext_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
57        self.ciphertext_blob = input;
58        self
59    }
60    /// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
61    pub fn get_ciphertext_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
62        &self.ciphertext_blob
63    }
64    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
65    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.key_id = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
70    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.key_id = input;
72        self
73    }
74    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
75    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
76        &self.key_id
77    }
78    /// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
79    pub fn encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
80        self.encryption_algorithm = ::std::option::Option::Some(input);
81        self
82    }
83    /// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
84    pub fn set_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
85        self.encryption_algorithm = input;
86        self
87    }
88    /// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
89    pub fn get_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
90        &self.encryption_algorithm
91    }
92    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93        self._request_id = Some(request_id.into());
94        self
95    }
96
97    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98        self._request_id = request_id;
99        self
100    }
101    /// Consumes the builder and constructs a [`EncryptOutput`](crate::operation::encrypt::EncryptOutput).
102    pub fn build(self) -> crate::operation::encrypt::EncryptOutput {
103        crate::operation::encrypt::EncryptOutput {
104            ciphertext_blob: self.ciphertext_blob,
105            key_id: self.key_id,
106            encryption_algorithm: self.encryption_algorithm,
107            _request_id: self._request_id,
108        }
109    }
110}