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    /// <p>The identifier of the key material used to originally encrypt the data. This field is present only when the original encryption used a symmetric encryption KMS key.</p>
17    pub source_key_material_id: ::std::option::Option<::std::string::String>,
18    /// <p>The identifier of the key material used to reencrypt the data. This field is present only when data is reencrypted using a symmetric encryption KMS key.</p>
19    pub destination_key_material_id: ::std::option::Option<::std::string::String>,
20    _request_id: Option<String>,
21}
22impl ReEncryptOutput {
23    /// <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>
24    pub fn ciphertext_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
25        self.ciphertext_blob.as_ref()
26    }
27    /// <p>Unique identifier of the KMS key used to originally encrypt the data.</p>
28    pub fn source_key_id(&self) -> ::std::option::Option<&str> {
29        self.source_key_id.as_deref()
30    }
31    /// <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>
32    pub fn key_id(&self) -> ::std::option::Option<&str> {
33        self.key_id.as_deref()
34    }
35    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
36    pub fn source_encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithmSpec> {
37        self.source_encryption_algorithm.as_ref()
38    }
39    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
40    pub fn destination_encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithmSpec> {
41        self.destination_encryption_algorithm.as_ref()
42    }
43    /// <p>The identifier of the key material used to originally encrypt the data. This field is present only when the original encryption used a symmetric encryption KMS key.</p>
44    pub fn source_key_material_id(&self) -> ::std::option::Option<&str> {
45        self.source_key_material_id.as_deref()
46    }
47    /// <p>The identifier of the key material used to reencrypt the data. This field is present only when data is reencrypted using a symmetric encryption KMS key.</p>
48    pub fn destination_key_material_id(&self) -> ::std::option::Option<&str> {
49        self.destination_key_material_id.as_deref()
50    }
51}
52impl ::aws_types::request_id::RequestId for ReEncryptOutput {
53    fn request_id(&self) -> Option<&str> {
54        self._request_id.as_deref()
55    }
56}
57impl ReEncryptOutput {
58    /// Creates a new builder-style object to manufacture [`ReEncryptOutput`](crate::operation::re_encrypt::ReEncryptOutput).
59    pub fn builder() -> crate::operation::re_encrypt::builders::ReEncryptOutputBuilder {
60        crate::operation::re_encrypt::builders::ReEncryptOutputBuilder::default()
61    }
62}
63
64/// A builder for [`ReEncryptOutput`](crate::operation::re_encrypt::ReEncryptOutput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct ReEncryptOutputBuilder {
68    pub(crate) ciphertext_blob: ::std::option::Option<::aws_smithy_types::Blob>,
69    pub(crate) source_key_id: ::std::option::Option<::std::string::String>,
70    pub(crate) key_id: ::std::option::Option<::std::string::String>,
71    pub(crate) source_encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
72    pub(crate) destination_encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
73    pub(crate) source_key_material_id: ::std::option::Option<::std::string::String>,
74    pub(crate) destination_key_material_id: ::std::option::Option<::std::string::String>,
75    _request_id: Option<String>,
76}
77impl ReEncryptOutputBuilder {
78    /// <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>
79    pub fn ciphertext_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
80        self.ciphertext_blob = ::std::option::Option::Some(input);
81        self
82    }
83    /// <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>
84    pub fn set_ciphertext_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
85        self.ciphertext_blob = input;
86        self
87    }
88    /// <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>
89    pub fn get_ciphertext_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
90        &self.ciphertext_blob
91    }
92    /// <p>Unique identifier of the KMS key used to originally encrypt the data.</p>
93    pub fn source_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.source_key_id = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>Unique identifier of the KMS key used to originally encrypt the data.</p>
98    pub fn set_source_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.source_key_id = input;
100        self
101    }
102    /// <p>Unique identifier of the KMS key used to originally encrypt the data.</p>
103    pub fn get_source_key_id(&self) -> &::std::option::Option<::std::string::String> {
104        &self.source_key_id
105    }
106    /// <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>
107    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.key_id = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <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>
112    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.key_id = input;
114        self
115    }
116    /// <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>
117    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
118        &self.key_id
119    }
120    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
121    pub fn source_encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
122        self.source_encryption_algorithm = ::std::option::Option::Some(input);
123        self
124    }
125    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
126    pub fn set_source_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
127        self.source_encryption_algorithm = input;
128        self
129    }
130    /// <p>The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.</p>
131    pub fn get_source_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
132        &self.source_encryption_algorithm
133    }
134    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
135    pub fn destination_encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
136        self.destination_encryption_algorithm = ::std::option::Option::Some(input);
137        self
138    }
139    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
140    pub fn set_destination_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
141        self.destination_encryption_algorithm = input;
142        self
143    }
144    /// <p>The encryption algorithm that was used to reencrypt the data.</p>
145    pub fn get_destination_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
146        &self.destination_encryption_algorithm
147    }
148    /// <p>The identifier of the key material used to originally encrypt the data. This field is present only when the original encryption used a symmetric encryption KMS key.</p>
149    pub fn source_key_material_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.source_key_material_id = ::std::option::Option::Some(input.into());
151        self
152    }
153    /// <p>The identifier of the key material used to originally encrypt the data. This field is present only when the original encryption used a symmetric encryption KMS key.</p>
154    pub fn set_source_key_material_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.source_key_material_id = input;
156        self
157    }
158    /// <p>The identifier of the key material used to originally encrypt the data. This field is present only when the original encryption used a symmetric encryption KMS key.</p>
159    pub fn get_source_key_material_id(&self) -> &::std::option::Option<::std::string::String> {
160        &self.source_key_material_id
161    }
162    /// <p>The identifier of the key material used to reencrypt the data. This field is present only when data is reencrypted using a symmetric encryption KMS key.</p>
163    pub fn destination_key_material_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.destination_key_material_id = ::std::option::Option::Some(input.into());
165        self
166    }
167    /// <p>The identifier of the key material used to reencrypt the data. This field is present only when data is reencrypted using a symmetric encryption KMS key.</p>
168    pub fn set_destination_key_material_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.destination_key_material_id = input;
170        self
171    }
172    /// <p>The identifier of the key material used to reencrypt the data. This field is present only when data is reencrypted using a symmetric encryption KMS key.</p>
173    pub fn get_destination_key_material_id(&self) -> &::std::option::Option<::std::string::String> {
174        &self.destination_key_material_id
175    }
176    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
177        self._request_id = Some(request_id.into());
178        self
179    }
180
181    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
182        self._request_id = request_id;
183        self
184    }
185    /// Consumes the builder and constructs a [`ReEncryptOutput`](crate::operation::re_encrypt::ReEncryptOutput).
186    pub fn build(self) -> crate::operation::re_encrypt::ReEncryptOutput {
187        crate::operation::re_encrypt::ReEncryptOutput {
188            ciphertext_blob: self.ciphertext_blob,
189            source_key_id: self.source_key_id,
190            key_id: self.key_id,
191            source_encryption_algorithm: self.source_encryption_algorithm,
192            destination_encryption_algorithm: self.destination_encryption_algorithm,
193            source_key_material_id: self.source_key_material_id,
194            destination_key_material_id: self.destination_key_material_id,
195            _request_id: self._request_id,
196        }
197    }
198}