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>
7pub 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>
11pub 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>
15pub 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>
19pub 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>
21pub 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>
25pub 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>
29pub 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>
31pub 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>
33pub 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>
35pub 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>
39pub 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>
45pub fn copy_object_result(&self) -> ::std::option::Option<&crate::types::CopyObjectResult> {
46self.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>
51pub fn expiration(&self) -> ::std::option::Option<&str> {
52self.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>
57pub fn copy_source_version_id(&self) -> ::std::option::Option<&str> {
58self.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>
63pub fn version_id(&self) -> ::std::option::Option<&str> {
64self.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>
67pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> {
68self.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>
73pub fn sse_customer_algorithm(&self) -> ::std::option::Option<&str> {
74self.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>
79pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> {
80self.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>
83pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> {
84self.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>
87pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> {
88self.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>
91pub fn bucket_key_enabled(&self) -> ::std::option::Option<bool> {
92self.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>
97pub fn request_charged(&self) -> ::std::option::Option<&crate::types::RequestCharged> {
98self.request_charged.as_ref()
99 }
100}
101impl ::std::fmt::Debug for CopyObjectOutput {
102fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
103let 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 {
121fn extended_request_id(&self) -> Option<&str> {
122self._extended_request_id.as_deref()
123 }
124}
125impl ::aws_types::request_id::RequestId for CopyObjectOutput {
126fn request_id(&self) -> Option<&str> {
127self._request_id.as_deref()
128 }
129}
130impl CopyObjectOutput {
131/// Creates a new builder-style object to manufacture [`CopyObjectOutput`](crate::operation::copy_object::CopyObjectOutput).
132pub fn builder() -> crate::operation::copy_object::builders::CopyObjectOutputBuilder {
133crate::operation::copy_object::builders::CopyObjectOutputBuilder::default()
134 }
135}
136137/// 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 {
141pub(crate) copy_object_result: ::std::option::Option<crate::types::CopyObjectResult>,
142pub(crate) expiration: ::std::option::Option<::std::string::String>,
143pub(crate) copy_source_version_id: ::std::option::Option<::std::string::String>,
144pub(crate) version_id: ::std::option::Option<::std::string::String>,
145pub(crate) server_side_encryption: ::std::option::Option<crate::types::ServerSideEncryption>,
146pub(crate) sse_customer_algorithm: ::std::option::Option<::std::string::String>,
147pub(crate) sse_customer_key_md5: ::std::option::Option<::std::string::String>,
148pub(crate) ssekms_key_id: ::std::option::Option<::std::string::String>,
149pub(crate) ssekms_encryption_context: ::std::option::Option<::std::string::String>,
150pub(crate) bucket_key_enabled: ::std::option::Option<bool>,
151pub(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>
157pub fn copy_object_result(mut self, input: crate::types::CopyObjectResult) -> Self {
158self.copy_object_result = ::std::option::Option::Some(input);
159self
160}
161/// <p>Container for all response elements.</p>
162pub fn set_copy_object_result(mut self, input: ::std::option::Option<crate::types::CopyObjectResult>) -> Self {
163self.copy_object_result = input;
164self
165}
166/// <p>Container for all response elements.</p>
167pub 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>
173pub fn expiration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174self.expiration = ::std::option::Option::Some(input.into());
175self
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>
180pub fn set_expiration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181self.expiration = input;
182self
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>
187pub 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>
193pub fn copy_source_version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194self.copy_source_version_id = ::std::option::Option::Some(input.into());
195self
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>
200pub fn set_copy_source_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201self.copy_source_version_id = input;
202self
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>
207pub 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>
213pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214self.version_id = ::std::option::Option::Some(input.into());
215self
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>
220pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221self.version_id = input;
222self
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>
227pub 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>
231pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self {
232self.server_side_encryption = ::std::option::Option::Some(input);
233self
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>
236pub fn set_server_side_encryption(mut self, input: ::std::option::Option<crate::types::ServerSideEncryption>) -> Self {
237self.server_side_encryption = input;
238self
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>
241pub 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>
247pub fn sse_customer_algorithm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
248self.sse_customer_algorithm = ::std::option::Option::Some(input.into());
249self
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>
254pub fn set_sse_customer_algorithm(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255self.sse_customer_algorithm = input;
256self
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>
261pub 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>
267pub fn sse_customer_key_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268self.sse_customer_key_md5 = ::std::option::Option::Some(input.into());
269self
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>
274pub fn set_sse_customer_key_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275self.sse_customer_key_md5 = input;
276self
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>
281pub 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>
285pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
286self.ssekms_key_id = ::std::option::Option::Some(input.into());
287self
288}
289/// <p>If present, indicates the ID of the KMS key that was used for object encryption.</p>
290pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291self.ssekms_key_id = input;
292self
293}
294/// <p>If present, indicates the ID of the KMS key that was used for object encryption.</p>
295pub 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>
299pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
300self.ssekms_encryption_context = ::std::option::Option::Some(input.into());
301self
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>
304pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305self.ssekms_encryption_context = input;
306self
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>
309pub 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>
313pub fn bucket_key_enabled(mut self, input: bool) -> Self {
314self.bucket_key_enabled = ::std::option::Option::Some(input);
315self
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>
318pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
319self.bucket_key_enabled = input;
320self
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>
323pub 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>
329pub fn request_charged(mut self, input: crate::types::RequestCharged) -> Self {
330self.request_charged = ::std::option::Option::Some(input);
331self
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>
336pub fn set_request_charged(mut self, input: ::std::option::Option<crate::types::RequestCharged>) -> Self {
337self.request_charged = input;
338self
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>
343pub fn get_request_charged(&self) -> &::std::option::Option<crate::types::RequestCharged> {
344&self.request_charged
345 }
346pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
347self._extended_request_id = Some(extended_request_id.into());
348self
349}
350351pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
352self._extended_request_id = extended_request_id;
353self
354}
355pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
356self._request_id = Some(request_id.into());
357self
358}
359360pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
361self._request_id = request_id;
362self
363}
364/// Consumes the builder and constructs a [`CopyObjectOutput`](crate::operation::copy_object::CopyObjectOutput).
365pub fn build(self) -> crate::operation::copy_object::CopyObjectOutput {
366crate::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 {
384fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
385let 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}