aws_sdk_s3/operation/copy_object/
_copy_object_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 CopyObjectOutput {
6    /// <p>Container for all response elements.</p>
7    pub copy_object_result: ::std::option::Option<crate::types::CopyObjectResult>,
8    /// <p>If the object expiration is configured, the response includes this header.</p><note>
9    /// <p>Object expiration information is not returned in directory buckets and this header returns the value "<code>NotImplemented</code>" in all responses for directory buckets.</p>
10    /// </note>
11    pub expiration: ::std::option::Option<::std::string::String>,
12    /// <p>Version ID of the source object that was copied.</p><note>
13    /// <p>This functionality is not supported when the source object is in a directory bucket.</p>
14    /// </note>
15    pub copy_source_version_id: ::std::option::Option<::std::string::String>,
16    /// <p>Version ID of the newly created copy.</p><note>
17    /// <p>This functionality is not supported for directory buckets.</p>
18    /// </note>
19    pub version_id: ::std::option::Option<::std::string::String>,
20    /// <p>The server-side encryption algorithm used when you store this object in Amazon S3 (for example, <code>AES256</code>, <code>aws:kms</code>, <code>aws:kms:dsse</code>).</p>
21    pub server_side_encryption: ::std::option::Option<crate::types::ServerSideEncryption>,
22    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.</p><note>
23    /// <p>This functionality is not supported for directory buckets.</p>
24    /// </note>
25    pub sse_customer_algorithm: ::std::option::Option<::std::string::String>,
26    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.</p><note>
27    /// <p>This functionality is not supported for directory buckets.</p>
28    /// </note>
29    pub sse_customer_key_md5: ::std::option::Option<::std::string::String>,
30    /// <p>If present, indicates the ID of the KMS key that was used for object encryption.</p>
31    pub ssekms_key_id: ::std::option::Option<::std::string::String>,
32    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs.</p>
33    pub ssekms_encryption_context: ::std::option::Option<::std::string::String>,
34    /// <p>Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).</p>
35    pub bucket_key_enabled: ::std::option::Option<bool>,
36    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
37    /// <p>This functionality is not supported for directory buckets.</p>
38    /// </note>
39    pub request_charged: ::std::option::Option<crate::types::RequestCharged>,
40    _extended_request_id: Option<String>,
41    _request_id: Option<String>,
42}
43impl CopyObjectOutput {
44    /// <p>Container for all response elements.</p>
45    pub fn copy_object_result(&self) -> ::std::option::Option<&crate::types::CopyObjectResult> {
46        self.copy_object_result.as_ref()
47    }
48    /// <p>If the object expiration is configured, the response includes this header.</p><note>
49    /// <p>Object expiration information is not returned in directory buckets and this header returns the value "<code>NotImplemented</code>" in all responses for directory buckets.</p>
50    /// </note>
51    pub fn expiration(&self) -> ::std::option::Option<&str> {
52        self.expiration.as_deref()
53    }
54    /// <p>Version ID of the source object that was copied.</p><note>
55    /// <p>This functionality is not supported when the source object is in a directory bucket.</p>
56    /// </note>
57    pub fn copy_source_version_id(&self) -> ::std::option::Option<&str> {
58        self.copy_source_version_id.as_deref()
59    }
60    /// <p>Version ID of the newly created copy.</p><note>
61    /// <p>This functionality is not supported for directory buckets.</p>
62    /// </note>
63    pub fn version_id(&self) -> ::std::option::Option<&str> {
64        self.version_id.as_deref()
65    }
66    /// <p>The server-side encryption algorithm used when you store this object in Amazon S3 (for example, <code>AES256</code>, <code>aws:kms</code>, <code>aws:kms:dsse</code>).</p>
67    pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> {
68        self.server_side_encryption.as_ref()
69    }
70    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.</p><note>
71    /// <p>This functionality is not supported for directory buckets.</p>
72    /// </note>
73    pub fn sse_customer_algorithm(&self) -> ::std::option::Option<&str> {
74        self.sse_customer_algorithm.as_deref()
75    }
76    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.</p><note>
77    /// <p>This functionality is not supported for directory buckets.</p>
78    /// </note>
79    pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> {
80        self.sse_customer_key_md5.as_deref()
81    }
82    /// <p>If present, indicates the ID of the KMS key that was used for object encryption.</p>
83    pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> {
84        self.ssekms_key_id.as_deref()
85    }
86    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs.</p>
87    pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> {
88        self.ssekms_encryption_context.as_deref()
89    }
90    /// <p>Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).</p>
91    pub fn bucket_key_enabled(&self) -> ::std::option::Option<bool> {
92        self.bucket_key_enabled
93    }
94    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
95    /// <p>This functionality is not supported for directory buckets.</p>
96    /// </note>
97    pub fn request_charged(&self) -> ::std::option::Option<&crate::types::RequestCharged> {
98        self.request_charged.as_ref()
99    }
100}
101impl ::std::fmt::Debug for CopyObjectOutput {
102    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
103        let mut formatter = f.debug_struct("CopyObjectOutput");
104        formatter.field("copy_object_result", &self.copy_object_result);
105        formatter.field("expiration", &self.expiration);
106        formatter.field("copy_source_version_id", &self.copy_source_version_id);
107        formatter.field("version_id", &self.version_id);
108        formatter.field("server_side_encryption", &self.server_side_encryption);
109        formatter.field("sse_customer_algorithm", &self.sse_customer_algorithm);
110        formatter.field("sse_customer_key_md5", &self.sse_customer_key_md5);
111        formatter.field("ssekms_key_id", &"*** Sensitive Data Redacted ***");
112        formatter.field("ssekms_encryption_context", &"*** Sensitive Data Redacted ***");
113        formatter.field("bucket_key_enabled", &self.bucket_key_enabled);
114        formatter.field("request_charged", &self.request_charged);
115        formatter.field("_extended_request_id", &self._extended_request_id);
116        formatter.field("_request_id", &self._request_id);
117        formatter.finish()
118    }
119}
120impl crate::s3_request_id::RequestIdExt for CopyObjectOutput {
121    fn extended_request_id(&self) -> Option<&str> {
122        self._extended_request_id.as_deref()
123    }
124}
125impl ::aws_types::request_id::RequestId for CopyObjectOutput {
126    fn request_id(&self) -> Option<&str> {
127        self._request_id.as_deref()
128    }
129}
130impl CopyObjectOutput {
131    /// Creates a new builder-style object to manufacture [`CopyObjectOutput`](crate::operation::copy_object::CopyObjectOutput).
132    pub fn builder() -> crate::operation::copy_object::builders::CopyObjectOutputBuilder {
133        crate::operation::copy_object::builders::CopyObjectOutputBuilder::default()
134    }
135}
136
137/// A builder for [`CopyObjectOutput`](crate::operation::copy_object::CopyObjectOutput).
138#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
139#[non_exhaustive]
140pub struct CopyObjectOutputBuilder {
141    pub(crate) copy_object_result: ::std::option::Option<crate::types::CopyObjectResult>,
142    pub(crate) expiration: ::std::option::Option<::std::string::String>,
143    pub(crate) copy_source_version_id: ::std::option::Option<::std::string::String>,
144    pub(crate) version_id: ::std::option::Option<::std::string::String>,
145    pub(crate) server_side_encryption: ::std::option::Option<crate::types::ServerSideEncryption>,
146    pub(crate) sse_customer_algorithm: ::std::option::Option<::std::string::String>,
147    pub(crate) sse_customer_key_md5: ::std::option::Option<::std::string::String>,
148    pub(crate) ssekms_key_id: ::std::option::Option<::std::string::String>,
149    pub(crate) ssekms_encryption_context: ::std::option::Option<::std::string::String>,
150    pub(crate) bucket_key_enabled: ::std::option::Option<bool>,
151    pub(crate) request_charged: ::std::option::Option<crate::types::RequestCharged>,
152    _extended_request_id: Option<String>,
153    _request_id: Option<String>,
154}
155impl CopyObjectOutputBuilder {
156    /// <p>Container for all response elements.</p>
157    pub fn copy_object_result(mut self, input: crate::types::CopyObjectResult) -> Self {
158        self.copy_object_result = ::std::option::Option::Some(input);
159        self
160    }
161    /// <p>Container for all response elements.</p>
162    pub fn set_copy_object_result(mut self, input: ::std::option::Option<crate::types::CopyObjectResult>) -> Self {
163        self.copy_object_result = input;
164        self
165    }
166    /// <p>Container for all response elements.</p>
167    pub fn get_copy_object_result(&self) -> &::std::option::Option<crate::types::CopyObjectResult> {
168        &self.copy_object_result
169    }
170    /// <p>If the object expiration is configured, the response includes this header.</p><note>
171    /// <p>Object expiration information is not returned in directory buckets and this header returns the value "<code>NotImplemented</code>" in all responses for directory buckets.</p>
172    /// </note>
173    pub fn expiration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.expiration = ::std::option::Option::Some(input.into());
175        self
176    }
177    /// <p>If the object expiration is configured, the response includes this header.</p><note>
178    /// <p>Object expiration information is not returned in directory buckets and this header returns the value "<code>NotImplemented</code>" in all responses for directory buckets.</p>
179    /// </note>
180    pub fn set_expiration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.expiration = input;
182        self
183    }
184    /// <p>If the object expiration is configured, the response includes this header.</p><note>
185    /// <p>Object expiration information is not returned in directory buckets and this header returns the value "<code>NotImplemented</code>" in all responses for directory buckets.</p>
186    /// </note>
187    pub fn get_expiration(&self) -> &::std::option::Option<::std::string::String> {
188        &self.expiration
189    }
190    /// <p>Version ID of the source object that was copied.</p><note>
191    /// <p>This functionality is not supported when the source object is in a directory bucket.</p>
192    /// </note>
193    pub fn copy_source_version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.copy_source_version_id = ::std::option::Option::Some(input.into());
195        self
196    }
197    /// <p>Version ID of the source object that was copied.</p><note>
198    /// <p>This functionality is not supported when the source object is in a directory bucket.</p>
199    /// </note>
200    pub fn set_copy_source_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.copy_source_version_id = input;
202        self
203    }
204    /// <p>Version ID of the source object that was copied.</p><note>
205    /// <p>This functionality is not supported when the source object is in a directory bucket.</p>
206    /// </note>
207    pub fn get_copy_source_version_id(&self) -> &::std::option::Option<::std::string::String> {
208        &self.copy_source_version_id
209    }
210    /// <p>Version ID of the newly created copy.</p><note>
211    /// <p>This functionality is not supported for directory buckets.</p>
212    /// </note>
213    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.version_id = ::std::option::Option::Some(input.into());
215        self
216    }
217    /// <p>Version ID of the newly created copy.</p><note>
218    /// <p>This functionality is not supported for directory buckets.</p>
219    /// </note>
220    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.version_id = input;
222        self
223    }
224    /// <p>Version ID of the newly created copy.</p><note>
225    /// <p>This functionality is not supported for directory buckets.</p>
226    /// </note>
227    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
228        &self.version_id
229    }
230    /// <p>The server-side encryption algorithm used when you store this object in Amazon S3 (for example, <code>AES256</code>, <code>aws:kms</code>, <code>aws:kms:dsse</code>).</p>
231    pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self {
232        self.server_side_encryption = ::std::option::Option::Some(input);
233        self
234    }
235    /// <p>The server-side encryption algorithm used when you store this object in Amazon S3 (for example, <code>AES256</code>, <code>aws:kms</code>, <code>aws:kms:dsse</code>).</p>
236    pub fn set_server_side_encryption(mut self, input: ::std::option::Option<crate::types::ServerSideEncryption>) -> Self {
237        self.server_side_encryption = input;
238        self
239    }
240    /// <p>The server-side encryption algorithm used when you store this object in Amazon S3 (for example, <code>AES256</code>, <code>aws:kms</code>, <code>aws:kms:dsse</code>).</p>
241    pub fn get_server_side_encryption(&self) -> &::std::option::Option<crate::types::ServerSideEncryption> {
242        &self.server_side_encryption
243    }
244    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.</p><note>
245    /// <p>This functionality is not supported for directory buckets.</p>
246    /// </note>
247    pub fn sse_customer_algorithm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
248        self.sse_customer_algorithm = ::std::option::Option::Some(input.into());
249        self
250    }
251    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.</p><note>
252    /// <p>This functionality is not supported for directory buckets.</p>
253    /// </note>
254    pub fn set_sse_customer_algorithm(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255        self.sse_customer_algorithm = input;
256        self
257    }
258    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.</p><note>
259    /// <p>This functionality is not supported for directory buckets.</p>
260    /// </note>
261    pub fn get_sse_customer_algorithm(&self) -> &::std::option::Option<::std::string::String> {
262        &self.sse_customer_algorithm
263    }
264    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.</p><note>
265    /// <p>This functionality is not supported for directory buckets.</p>
266    /// </note>
267    pub fn sse_customer_key_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        self.sse_customer_key_md5 = ::std::option::Option::Some(input.into());
269        self
270    }
271    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.</p><note>
272    /// <p>This functionality is not supported for directory buckets.</p>
273    /// </note>
274    pub fn set_sse_customer_key_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275        self.sse_customer_key_md5 = input;
276        self
277    }
278    /// <p>If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.</p><note>
279    /// <p>This functionality is not supported for directory buckets.</p>
280    /// </note>
281    pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> {
282        &self.sse_customer_key_md5
283    }
284    /// <p>If present, indicates the ID of the KMS key that was used for object encryption.</p>
285    pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
286        self.ssekms_key_id = ::std::option::Option::Some(input.into());
287        self
288    }
289    /// <p>If present, indicates the ID of the KMS key that was used for object encryption.</p>
290    pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291        self.ssekms_key_id = input;
292        self
293    }
294    /// <p>If present, indicates the ID of the KMS key that was used for object encryption.</p>
295    pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> {
296        &self.ssekms_key_id
297    }
298    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs.</p>
299    pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
300        self.ssekms_encryption_context = ::std::option::Option::Some(input.into());
301        self
302    }
303    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs.</p>
304    pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305        self.ssekms_encryption_context = input;
306        self
307    }
308    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs.</p>
309    pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> {
310        &self.ssekms_encryption_context
311    }
312    /// <p>Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).</p>
313    pub fn bucket_key_enabled(mut self, input: bool) -> Self {
314        self.bucket_key_enabled = ::std::option::Option::Some(input);
315        self
316    }
317    /// <p>Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).</p>
318    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
319        self.bucket_key_enabled = input;
320        self
321    }
322    /// <p>Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).</p>
323    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option<bool> {
324        &self.bucket_key_enabled
325    }
326    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
327    /// <p>This functionality is not supported for directory buckets.</p>
328    /// </note>
329    pub fn request_charged(mut self, input: crate::types::RequestCharged) -> Self {
330        self.request_charged = ::std::option::Option::Some(input);
331        self
332    }
333    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
334    /// <p>This functionality is not supported for directory buckets.</p>
335    /// </note>
336    pub fn set_request_charged(mut self, input: ::std::option::Option<crate::types::RequestCharged>) -> Self {
337        self.request_charged = input;
338        self
339    }
340    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
341    /// <p>This functionality is not supported for directory buckets.</p>
342    /// </note>
343    pub fn get_request_charged(&self) -> &::std::option::Option<crate::types::RequestCharged> {
344        &self.request_charged
345    }
346    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
347        self._extended_request_id = Some(extended_request_id.into());
348        self
349    }
350
351    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
352        self._extended_request_id = extended_request_id;
353        self
354    }
355    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
356        self._request_id = Some(request_id.into());
357        self
358    }
359
360    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
361        self._request_id = request_id;
362        self
363    }
364    /// Consumes the builder and constructs a [`CopyObjectOutput`](crate::operation::copy_object::CopyObjectOutput).
365    pub fn build(self) -> crate::operation::copy_object::CopyObjectOutput {
366        crate::operation::copy_object::CopyObjectOutput {
367            copy_object_result: self.copy_object_result,
368            expiration: self.expiration,
369            copy_source_version_id: self.copy_source_version_id,
370            version_id: self.version_id,
371            server_side_encryption: self.server_side_encryption,
372            sse_customer_algorithm: self.sse_customer_algorithm,
373            sse_customer_key_md5: self.sse_customer_key_md5,
374            ssekms_key_id: self.ssekms_key_id,
375            ssekms_encryption_context: self.ssekms_encryption_context,
376            bucket_key_enabled: self.bucket_key_enabled,
377            request_charged: self.request_charged,
378            _extended_request_id: self._extended_request_id,
379            _request_id: self._request_id,
380        }
381    }
382}
383impl ::std::fmt::Debug for CopyObjectOutputBuilder {
384    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
385        let mut formatter = f.debug_struct("CopyObjectOutputBuilder");
386        formatter.field("copy_object_result", &self.copy_object_result);
387        formatter.field("expiration", &self.expiration);
388        formatter.field("copy_source_version_id", &self.copy_source_version_id);
389        formatter.field("version_id", &self.version_id);
390        formatter.field("server_side_encryption", &self.server_side_encryption);
391        formatter.field("sse_customer_algorithm", &self.sse_customer_algorithm);
392        formatter.field("sse_customer_key_md5", &self.sse_customer_key_md5);
393        formatter.field("ssekms_key_id", &"*** Sensitive Data Redacted ***");
394        formatter.field("ssekms_encryption_context", &"*** Sensitive Data Redacted ***");
395        formatter.field("bucket_key_enabled", &self.bucket_key_enabled);
396        formatter.field("request_charged", &self.request_charged);
397        formatter.field("_extended_request_id", &self._extended_request_id);
398        formatter.field("_request_id", &self._request_id);
399        formatter.finish()
400    }
401}