aws_sdk_kms/operation/re_encrypt/
_re_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 ReEncryptOutput {
6    /// <p>The reencrypted data. 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>Unique identifier of the KMS key used to originally encrypt the data.</p>
9    pub source_key_id: ::std::option::Option<::std::string::String>,
10    /// <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 reencrypt the data.</p>
11    pub key_id: ::std::option::Option<::std::string::String>,
12    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
13    pub source_encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
14    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
15    pub destination_encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
16    _request_id: Option<String>,
17}
18impl ReEncryptOutput {
19    /// <p>The reencrypted data. 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 ciphertext_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
21        self.ciphertext_blob.as_ref()
22    }
23    /// <p>Unique identifier of the KMS key used to originally encrypt the data.</p>
24    pub fn source_key_id(&self) -> ::std::option::Option<&str> {
25        self.source_key_id.as_deref()
26    }
27    /// <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 reencrypt the data.</p>
28    pub fn key_id(&self) -> ::std::option::Option<&str> {
29        self.key_id.as_deref()
30    }
31    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
32    pub fn source_encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithmSpec> {
33        self.source_encryption_algorithm.as_ref()
34    }
35    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
36    pub fn destination_encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithmSpec> {
37        self.destination_encryption_algorithm.as_ref()
38    }
39}
40impl ::aws_types::request_id::RequestId for ReEncryptOutput {
41    fn request_id(&self) -> Option<&str> {
42        self._request_id.as_deref()
43    }
44}
45impl ReEncryptOutput {
46    /// Creates a new builder-style object to manufacture [`ReEncryptOutput`](crate::operation::re_encrypt::ReEncryptOutput).
47    pub fn builder() -> crate::operation::re_encrypt::builders::ReEncryptOutputBuilder {
48        crate::operation::re_encrypt::builders::ReEncryptOutputBuilder::default()
49    }
50}
51
52/// A builder for [`ReEncryptOutput`](crate::operation::re_encrypt::ReEncryptOutput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct ReEncryptOutputBuilder {
56    pub(crate) ciphertext_blob: ::std::option::Option<::aws_smithy_types::Blob>,
57    pub(crate) source_key_id: ::std::option::Option<::std::string::String>,
58    pub(crate) key_id: ::std::option::Option<::std::string::String>,
59    pub(crate) source_encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
60    pub(crate) destination_encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
61    _request_id: Option<String>,
62}
63impl ReEncryptOutputBuilder {
64    /// <p>The reencrypted data. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
65    pub fn ciphertext_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
66        self.ciphertext_blob = ::std::option::Option::Some(input);
67        self
68    }
69    /// <p>The reencrypted data. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
70    pub fn set_ciphertext_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
71        self.ciphertext_blob = input;
72        self
73    }
74    /// <p>The reencrypted data. 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 get_ciphertext_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
76        &self.ciphertext_blob
77    }
78    /// <p>Unique identifier of the KMS key used to originally encrypt the data.</p>
79    pub fn source_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.source_key_id = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// <p>Unique identifier of the KMS key used to originally encrypt the data.</p>
84    pub fn set_source_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.source_key_id = input;
86        self
87    }
88    /// <p>Unique identifier of the KMS key used to originally encrypt the data.</p>
89    pub fn get_source_key_id(&self) -> &::std::option::Option<::std::string::String> {
90        &self.source_key_id
91    }
92    /// <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 reencrypt the data.</p>
93    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.key_id = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <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 reencrypt the data.</p>
98    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.key_id = input;
100        self
101    }
102    /// <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 reencrypt the data.</p>
103    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
104        &self.key_id
105    }
106    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
107    pub fn source_encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
108        self.source_encryption_algorithm = ::std::option::Option::Some(input);
109        self
110    }
111    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
112    pub fn set_source_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
113        self.source_encryption_algorithm = input;
114        self
115    }
116    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
117    pub fn get_source_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
118        &self.source_encryption_algorithm
119    }
120    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
121    pub fn destination_encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
122        self.destination_encryption_algorithm = ::std::option::Option::Some(input);
123        self
124    }
125    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
126    pub fn set_destination_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
127        self.destination_encryption_algorithm = input;
128        self
129    }
130    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
131    pub fn get_destination_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
132        &self.destination_encryption_algorithm
133    }
134    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
135        self._request_id = Some(request_id.into());
136        self
137    }
138
139    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
140        self._request_id = request_id;
141        self
142    }
143    /// Consumes the builder and constructs a [`ReEncryptOutput`](crate::operation::re_encrypt::ReEncryptOutput).
144    pub fn build(self) -> crate::operation::re_encrypt::ReEncryptOutput {
145        crate::operation::re_encrypt::ReEncryptOutput {
146            ciphertext_blob: self.ciphertext_blob,
147            source_key_id: self.source_key_id,
148            key_id: self.key_id,
149            source_encryption_algorithm: self.source_encryption_algorithm,
150            destination_encryption_algorithm: self.destination_encryption_algorithm,
151            _request_id: self._request_id,
152        }
153    }
154}