1 /*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5 * the License. A copy of the License is located at
6 *
7 * http://aws.amazon.com/apache2.0
8 *
9 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11 * and limitations under the License.
12 */
13
14 package software.amazon.awssdk.services.s3.model;
15
16 import java.time.Instant;
17 import java.util.Arrays;
18 import java.util.Collections;
19 import java.util.List;
20 import java.util.Map;
21 import java.util.Objects;
22 import java.util.Optional;
23 import java.util.function.BiConsumer;
24 import java.util.function.Function;
25 import software.amazon.awssdk.annotations.Generated;
26 import software.amazon.awssdk.core.SdkField;
27 import software.amazon.awssdk.core.SdkPojo;
28 import software.amazon.awssdk.core.protocol.MarshallLocation;
29 import software.amazon.awssdk.core.protocol.MarshallingType;
30 import software.amazon.awssdk.core.traits.LocationTrait;
31 import software.amazon.awssdk.core.traits.MapTrait;
32 import software.amazon.awssdk.core.traits.TimestampFormatTrait;
33 import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
34 import software.amazon.awssdk.core.util.SdkAutoConstructMap;
35 import software.amazon.awssdk.utils.ToString;
36 import software.amazon.awssdk.utils.builder.CopyableBuilder;
37 import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
38
39 /**
40 */
41 @Generated("software.amazon.awssdk:codegen")
42 public final class GetObjectResponse extends S3Response implements
43 ToCopyableBuilder<GetObjectResponse.Builder, GetObjectResponse> {
44 private static final SdkField<Boolean> DELETE_MARKER_FIELD = SdkField
45 .<Boolean> builder(MarshallingType.BOOLEAN)
46 .getter(getter(GetObjectResponse::deleteMarker))
47 .setter(setter(Builder::deleteMarker))
48 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-delete-marker")
49 .unmarshallLocationName("x-amz-delete-marker").build()).build();
50
51 private static final SdkField<String> ACCEPT_RANGES_FIELD = SdkField
52 .<String> builder(MarshallingType.STRING)
53 .getter(getter(GetObjectResponse::acceptRanges))
54 .setter(setter(Builder::acceptRanges))
55 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("accept-ranges")
56 .unmarshallLocationName("accept-ranges").build()).build();
57
58 private static final SdkField<String> EXPIRATION_FIELD = SdkField
59 .<String> builder(MarshallingType.STRING)
60 .getter(getter(GetObjectResponse::expiration))
61 .setter(setter(Builder::expiration))
62 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-expiration")
63 .unmarshallLocationName("x-amz-expiration").build()).build();
64
65 private static final SdkField<String> RESTORE_FIELD = SdkField
66 .<String> builder(MarshallingType.STRING)
67 .getter(getter(GetObjectResponse::restore))
68 .setter(setter(Builder::restore))
69 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-restore")
70 .unmarshallLocationName("x-amz-restore").build()).build();
71
72 private static final SdkField<Instant> LAST_MODIFIED_FIELD = SdkField
73 .<Instant> builder(MarshallingType.INSTANT)
74 .getter(getter(GetObjectResponse::lastModified))
75 .setter(setter(Builder::lastModified))
76 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Last-Modified")
77 .unmarshallLocationName("Last-Modified").build()).build();
78
79 private static final SdkField<Long> CONTENT_LENGTH_FIELD = SdkField
80 .<Long> builder(MarshallingType.LONG)
81 .getter(getter(GetObjectResponse::contentLength))
82 .setter(setter(Builder::contentLength))
83 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Length")
84 .unmarshallLocationName("Content-Length").build()).build();
85
86 private static final SdkField<String> E_TAG_FIELD = SdkField
87 .<String> builder(MarshallingType.STRING)
88 .getter(getter(GetObjectResponse::eTag))
89 .setter(setter(Builder::eTag))
90 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("ETag").unmarshallLocationName("ETag")
91 .build()).build();
92
93 private static final SdkField<Integer> MISSING_META_FIELD = SdkField
94 .<Integer> builder(MarshallingType.INTEGER)
95 .getter(getter(GetObjectResponse::missingMeta))
96 .setter(setter(Builder::missingMeta))
97 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-missing-meta")
98 .unmarshallLocationName("x-amz-missing-meta").build()).build();
99
100 private static final SdkField<String> VERSION_ID_FIELD = SdkField
101 .<String> builder(MarshallingType.STRING)
102 .getter(getter(GetObjectResponse::versionId))
103 .setter(setter(Builder::versionId))
104 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-version-id")
105 .unmarshallLocationName("x-amz-version-id").build()).build();
106
107 private static final SdkField<String> CACHE_CONTROL_FIELD = SdkField
108 .<String> builder(MarshallingType.STRING)
109 .getter(getter(GetObjectResponse::cacheControl))
110 .setter(setter(Builder::cacheControl))
111 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Cache-Control")
112 .unmarshallLocationName("Cache-Control").build()).build();
113
114 private static final SdkField<String> CONTENT_DISPOSITION_FIELD = SdkField
115 .<String> builder(MarshallingType.STRING)
116 .getter(getter(GetObjectResponse::contentDisposition))
117 .setter(setter(Builder::contentDisposition))
118 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Disposition")
119 .unmarshallLocationName("Content-Disposition").build()).build();
120
121 private static final SdkField<String> CONTENT_ENCODING_FIELD = SdkField
122 .<String> builder(MarshallingType.STRING)
123 .getter(getter(GetObjectResponse::contentEncoding))
124 .setter(setter(Builder::contentEncoding))
125 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Encoding")
126 .unmarshallLocationName("Content-Encoding").build()).build();
127
128 private static final SdkField<String> CONTENT_LANGUAGE_FIELD = SdkField
129 .<String> builder(MarshallingType.STRING)
130 .getter(getter(GetObjectResponse::contentLanguage))
131 .setter(setter(Builder::contentLanguage))
132 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Language")
133 .unmarshallLocationName("Content-Language").build()).build();
134
135 private static final SdkField<String> CONTENT_RANGE_FIELD = SdkField
136 .<String> builder(MarshallingType.STRING)
137 .getter(getter(GetObjectResponse::contentRange))
138 .setter(setter(Builder::contentRange))
139 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Range")
140 .unmarshallLocationName("Content-Range").build()).build();
141
142 private static final SdkField<String> CONTENT_TYPE_FIELD = SdkField
143 .<String> builder(MarshallingType.STRING)
144 .getter(getter(GetObjectResponse::contentType))
145 .setter(setter(Builder::contentType))
146 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Type")
147 .unmarshallLocationName("Content-Type").build()).build();
148
149 private static final SdkField<Instant> EXPIRES_FIELD = SdkField
150 .<Instant> builder(MarshallingType.INSTANT)
151 .getter(getter(GetObjectResponse::expires))
152 .setter(setter(Builder::expires))
153 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Expires")
154 .unmarshallLocationName("Expires").build()).build();
155
156 private static final SdkField<String> WEBSITE_REDIRECT_LOCATION_FIELD = SdkField
157 .<String> builder(MarshallingType.STRING)
158 .getter(getter(GetObjectResponse::websiteRedirectLocation))
159 .setter(setter(Builder::websiteRedirectLocation))
160 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-website-redirect-location")
161 .unmarshallLocationName("x-amz-website-redirect-location").build()).build();
162
163 private static final SdkField<String> SERVER_SIDE_ENCRYPTION_FIELD = SdkField
164 .<String> builder(MarshallingType.STRING)
165 .getter(getter(GetObjectResponse::serverSideEncryptionAsString))
166 .setter(setter(Builder::serverSideEncryption))
167 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-server-side-encryption")
168 .unmarshallLocationName("x-amz-server-side-encryption").build()).build();
169
170 private static final SdkField<Map<String, String>> METADATA_FIELD = SdkField
171 .<Map<String, String>> builder(MarshallingType.MAP)
172 .getter(getter(GetObjectResponse::metadata))
173 .setter(setter(Builder::metadata))
174 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-meta-")
175 .unmarshallLocationName("x-amz-meta-").build(),
176 MapTrait.builder()
177 .keyLocationName("key")
178 .valueLocationName("value")
179 .valueFieldInfo(
180 SdkField.<String> builder(MarshallingType.STRING)
181 .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
182 .locationName("value").unmarshallLocationName("value").build()).build())
183 .build()).build();
184
185 private static final SdkField<String> SSE_CUSTOMER_ALGORITHM_FIELD = SdkField
186 .<String> builder(MarshallingType.STRING)
187 .getter(getter(GetObjectResponse::sseCustomerAlgorithm))
188 .setter(setter(Builder::sseCustomerAlgorithm))
189 .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
190 .locationName("x-amz-server-side-encryption-customer-algorithm")
191 .unmarshallLocationName("x-amz-server-side-encryption-customer-algorithm").build()).build();
192
193 private static final SdkField<String> SSE_CUSTOMER_KEY_MD5_FIELD = SdkField
194 .<String> builder(MarshallingType.STRING)
195 .getter(getter(GetObjectResponse::sseCustomerKeyMD5))
196 .setter(setter(Builder::sseCustomerKeyMD5))
197 .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
198 .locationName("x-amz-server-side-encryption-customer-key-MD5")
199 .unmarshallLocationName("x-amz-server-side-encryption-customer-key-MD5").build()).build();
200
201 private static final SdkField<String> SSEKMS_KEY_ID_FIELD = SdkField
202 .<String> builder(MarshallingType.STRING)
203 .getter(getter(GetObjectResponse::ssekmsKeyId))
204 .setter(setter(Builder::ssekmsKeyId))
205 .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
206 .locationName("x-amz-server-side-encryption-aws-kms-key-id")
207 .unmarshallLocationName("x-amz-server-side-encryption-aws-kms-key-id").build()).build();
208
209 private static final SdkField<String> STORAGE_CLASS_FIELD = SdkField
210 .<String> builder(MarshallingType.STRING)
211 .getter(getter(GetObjectResponse::storageClassAsString))
212 .setter(setter(Builder::storageClass))
213 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-storage-class")
214 .unmarshallLocationName("x-amz-storage-class").build()).build();
215
216 private static final SdkField<String> REQUEST_CHARGED_FIELD = SdkField
217 .<String> builder(MarshallingType.STRING)
218 .getter(getter(GetObjectResponse::requestChargedAsString))
219 .setter(setter(Builder::requestCharged))
220 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-request-charged")
221 .unmarshallLocationName("x-amz-request-charged").build()).build();
222
223 private static final SdkField<String> REPLICATION_STATUS_FIELD = SdkField
224 .<String> builder(MarshallingType.STRING)
225 .getter(getter(GetObjectResponse::replicationStatusAsString))
226 .setter(setter(Builder::replicationStatus))
227 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-replication-status")
228 .unmarshallLocationName("x-amz-replication-status").build()).build();
229
230 private static final SdkField<Integer> PARTS_COUNT_FIELD = SdkField
231 .<Integer> builder(MarshallingType.INTEGER)
232 .getter(getter(GetObjectResponse::partsCount))
233 .setter(setter(Builder::partsCount))
234 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-mp-parts-count")
235 .unmarshallLocationName("x-amz-mp-parts-count").build()).build();
236
237 private static final SdkField<Integer> TAG_COUNT_FIELD = SdkField
238 .<Integer> builder(MarshallingType.INTEGER)
239 .getter(getter(GetObjectResponse::tagCount))
240 .setter(setter(Builder::tagCount))
241 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-tagging-count")
242 .unmarshallLocationName("x-amz-tagging-count").build()).build();
243
244 private static final SdkField<String> OBJECT_LOCK_MODE_FIELD = SdkField
245 .<String> builder(MarshallingType.STRING)
246 .getter(getter(GetObjectResponse::objectLockModeAsString))
247 .setter(setter(Builder::objectLockMode))
248 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-mode")
249 .unmarshallLocationName("x-amz-object-lock-mode").build()).build();
250
251 private static final SdkField<Instant> OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD = SdkField
252 .<Instant> builder(MarshallingType.INSTANT)
253 .getter(getter(GetObjectResponse::objectLockRetainUntilDate))
254 .setter(setter(Builder::objectLockRetainUntilDate))
255 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-retain-until-date")
256 .unmarshallLocationName("x-amz-object-lock-retain-until-date").build(),
257 TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
258
259 private static final SdkField<String> OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD = SdkField
260 .<String> builder(MarshallingType.STRING)
261 .getter(getter(GetObjectResponse::objectLockLegalHoldStatusAsString))
262 .setter(setter(Builder::objectLockLegalHoldStatus))
263 .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-legal-hold")
264 .unmarshallLocationName("x-amz-object-lock-legal-hold").build()).build();
265
266 private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DELETE_MARKER_FIELD,
267 ACCEPT_RANGES_FIELD, EXPIRATION_FIELD, RESTORE_FIELD, LAST_MODIFIED_FIELD, CONTENT_LENGTH_FIELD, E_TAG_FIELD,
268 MISSING_META_FIELD, VERSION_ID_FIELD, CACHE_CONTROL_FIELD, CONTENT_DISPOSITION_FIELD, CONTENT_ENCODING_FIELD,
269 CONTENT_LANGUAGE_FIELD, CONTENT_RANGE_FIELD, CONTENT_TYPE_FIELD, EXPIRES_FIELD, WEBSITE_REDIRECT_LOCATION_FIELD,
270 SERVER_SIDE_ENCRYPTION_FIELD, METADATA_FIELD, SSE_CUSTOMER_ALGORITHM_FIELD, SSE_CUSTOMER_KEY_MD5_FIELD,
271 SSEKMS_KEY_ID_FIELD, STORAGE_CLASS_FIELD, REQUEST_CHARGED_FIELD, REPLICATION_STATUS_FIELD, PARTS_COUNT_FIELD,
272 TAG_COUNT_FIELD, OBJECT_LOCK_MODE_FIELD, OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD, OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD));
273
274 private final Boolean deleteMarker;
275
276 private final String acceptRanges;
277
278 private final String expiration;
279
280 private final String restore;
281
282 private final Instant lastModified;
283
284 private final Long contentLength;
285
286 private final String eTag;
287
288 private final Integer missingMeta;
289
290 private final String versionId;
291
292 private final String cacheControl;
293
294 private final String contentDisposition;
295
296 private final String contentEncoding;
297
298 private final String contentLanguage;
299
300 private final String contentRange;
301
302 private final String contentType;
303
304 private final Instant expires;
305
306 private final String websiteRedirectLocation;
307
308 private final String serverSideEncryption;
309
310 private final Map<String, String> metadata;
311
312 private final String sseCustomerAlgorithm;
313
314 private final String sseCustomerKeyMD5;
315
316 private final String ssekmsKeyId;
317
318 private final String storageClass;
319
320 private final String requestCharged;
321
322 private final String replicationStatus;
323
324 private final Integer partsCount;
325
326 private final Integer tagCount;
327
328 private final String objectLockMode;
329
330 private final Instant objectLockRetainUntilDate;
331
332 private final String objectLockLegalHoldStatus;
333
334 private GetObjectResponse(BuilderImpl builder) {
335 super(builder);
336 this.deleteMarker = builder.deleteMarker;
337 this.acceptRanges = builder.acceptRanges;
338 this.expiration = builder.expiration;
339 this.restore = builder.restore;
340 this.lastModified = builder.lastModified;
341 this.contentLength = builder.contentLength;
342 this.eTag = builder.eTag;
343 this.missingMeta = builder.missingMeta;
344 this.versionId = builder.versionId;
345 this.cacheControl = builder.cacheControl;
346 this.contentDisposition = builder.contentDisposition;
347 this.contentEncoding = builder.contentEncoding;
348 this.contentLanguage = builder.contentLanguage;
349 this.contentRange = builder.contentRange;
350 this.contentType = builder.contentType;
351 this.expires = builder.expires;
352 this.websiteRedirectLocation = builder.websiteRedirectLocation;
353 this.serverSideEncryption = builder.serverSideEncryption;
354 this.metadata = builder.metadata;
355 this.sseCustomerAlgorithm = builder.sseCustomerAlgorithm;
356 this.sseCustomerKeyMD5 = builder.sseCustomerKeyMD5;
357 this.ssekmsKeyId = builder.ssekmsKeyId;
358 this.storageClass = builder.storageClass;
359 this.requestCharged = builder.requestCharged;
360 this.replicationStatus = builder.replicationStatus;
361 this.partsCount = builder.partsCount;
362 this.tagCount = builder.tagCount;
363 this.objectLockMode = builder.objectLockMode;
364 this.objectLockRetainUntilDate = builder.objectLockRetainUntilDate;
365 this.objectLockLegalHoldStatus = builder.objectLockLegalHoldStatus;
366 }
367
368 /**
369 * <p>
370 * Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response
371 * header does not appear in the response.
372 * </p>
373 *
374 * @return Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this
375 * response header does not appear in the response.
376 */
377 public Boolean deleteMarker() {
378 return deleteMarker;
379 }
380
381 /**
382 * <p>
383 * Indicates that a range of bytes was specified.
384 * </p>
385 *
386 * @return Indicates that a range of bytes was specified.
387 */
388 public String acceptRanges() {
389 return acceptRanges;
390 }
391
392 /**
393 * <p>
394 * If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes
395 * the expiry-date and rule-id key-value pairs providing object expiration information. The value of the rule-id is
396 * URL encoded.
397 * </p>
398 *
399 * @return If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It
400 * includes the expiry-date and rule-id key-value pairs providing object expiration information. The value
401 * of the rule-id is URL encoded.
402 */
403 public String expiration() {
404 return expiration;
405 }
406
407 /**
408 * <p>
409 * Provides information about object restoration operation and expiration time of the restored object copy.
410 * </p>
411 *
412 * @return Provides information about object restoration operation and expiration time of the restored object copy.
413 */
414 public String restore() {
415 return restore;
416 }
417
418 /**
419 * <p>
420 * Last modified date of the object
421 * </p>
422 *
423 * @return Last modified date of the object
424 */
425 public Instant lastModified() {
426 return lastModified;
427 }
428
429 /**
430 * <p>
431 * Size of the body in bytes.
432 * </p>
433 *
434 * @return Size of the body in bytes.
435 */
436 public Long contentLength() {
437 return contentLength;
438 }
439
440 /**
441 * <p>
442 * An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.
443 * </p>
444 *
445 * @return An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a
446 * URL.
447 */
448 public String eTag() {
449 return eTag;
450 }
451
452 /**
453 * <p>
454 * This is set to the number of metadata entries not returned in <code>x-amz-meta</code> headers. This can happen if
455 * you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example,
456 * using SOAP, you can create metadata whose values are not legal HTTP headers.
457 * </p>
458 *
459 * @return This is set to the number of metadata entries not returned in <code>x-amz-meta</code> headers. This can
460 * happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST
461 * API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
462 */
463 public Integer missingMeta() {
464 return missingMeta;
465 }
466
467 /**
468 * <p>
469 * Version of the object.
470 * </p>
471 *
472 * @return Version of the object.
473 */
474 public String versionId() {
475 return versionId;
476 }
477
478 /**
479 * <p>
480 * Specifies caching behavior along the request/reply chain.
481 * </p>
482 *
483 * @return Specifies caching behavior along the request/reply chain.
484 */
485 public String cacheControl() {
486 return cacheControl;
487 }
488
489 /**
490 * <p>
491 * Specifies presentational information for the object.
492 * </p>
493 *
494 * @return Specifies presentational information for the object.
495 */
496 public String contentDisposition() {
497 return contentDisposition;
498 }
499
500 /**
501 * <p>
502 * Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be
503 * applied to obtain the media-type referenced by the Content-Type header field.
504 * </p>
505 *
506 * @return Specifies what content encodings have been applied to the object and thus what decoding mechanisms must
507 * be applied to obtain the media-type referenced by the Content-Type header field.
508 */
509 public String contentEncoding() {
510 return contentEncoding;
511 }
512
513 /**
514 * <p>
515 * The language the content is in.
516 * </p>
517 *
518 * @return The language the content is in.
519 */
520 public String contentLanguage() {
521 return contentLanguage;
522 }
523
524 /**
525 * <p>
526 * The portion of the object returned in the response.
527 * </p>
528 *
529 * @return The portion of the object returned in the response.
530 */
531 public String contentRange() {
532 return contentRange;
533 }
534
535 /**
536 * <p>
537 * A standard MIME type describing the format of the object data.
538 * </p>
539 *
540 * @return A standard MIME type describing the format of the object data.
541 */
542 public String contentType() {
543 return contentType;
544 }
545
546 /**
547 * <p>
548 * The date and time at which the object is no longer cacheable.
549 * </p>
550 *
551 * @return The date and time at which the object is no longer cacheable.
552 */
553 public Instant expires() {
554 return expires;
555 }
556
557 /**
558 * <p>
559 * If the bucket is configured as a website, redirects requests for this object to another object in the same bucket
560 * or to an external URL. Amazon S3 stores the value of this header in the object metadata.
561 * </p>
562 *
563 * @return If the bucket is configured as a website, redirects requests for this object to another object in the
564 * same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
565 */
566 public String websiteRedirectLocation() {
567 return websiteRedirectLocation;
568 }
569
570 /**
571 * <p>
572 * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
573 * </p>
574 * <p>
575 * If the service returns an enum value that is not available in the current SDK version,
576 * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value
577 * returned by the service is available from {@link #serverSideEncryptionAsString}.
578 * </p>
579 *
580 * @return The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256,
581 * aws:kms).
582 * @see ServerSideEncryption
583 */
584 public ServerSideEncryption serverSideEncryption() {
585 return ServerSideEncryption.fromValue(serverSideEncryption);
586 }
587
588 /**
589 * <p>
590 * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
591 * </p>
592 * <p>
593 * If the service returns an enum value that is not available in the current SDK version,
594 * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value
595 * returned by the service is available from {@link #serverSideEncryptionAsString}.
596 * </p>
597 *
598 * @return The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256,
599 * aws:kms).
600 * @see ServerSideEncryption
601 */
602 public String serverSideEncryptionAsString() {
603 return serverSideEncryption;
604 }
605
606 /**
607 * Returns true if the Metadata property was specified by the sender (it may be empty), or false if the sender did
608 * not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
609 */
610 public boolean hasMetadata() {
611 return metadata != null && !(metadata instanceof SdkAutoConstructMap);
612 }
613
614 /**
615 * <p>
616 * A map of metadata to store with the object in S3.
617 * </p>
618 * <p>
619 * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
620 * </p>
621 * <p>
622 * You can use {@link #hasMetadata()} to see if a value was sent in this field.
623 * </p>
624 *
625 * @return A map of metadata to store with the object in S3.
626 */
627 public Map<String, String> metadata() {
628 return metadata;
629 }
630
631 /**
632 * <p>
633 * If server-side encryption with a customer-provided encryption key was requested, the response will include this
634 * header confirming the encryption algorithm used.
635 * </p>
636 *
637 * @return If server-side encryption with a customer-provided encryption key was requested, the response will
638 * include this header confirming the encryption algorithm used.
639 */
640 public String sseCustomerAlgorithm() {
641 return sseCustomerAlgorithm;
642 }
643
644 /**
645 * <p>
646 * If server-side encryption with a customer-provided encryption key was requested, the response will include this
647 * header to provide round-trip message integrity verification of the customer-provided encryption key.
648 * </p>
649 *
650 * @return If server-side encryption with a customer-provided encryption key was requested, the response will
651 * include this header to provide round-trip message integrity verification of the customer-provided
652 * encryption key.
653 */
654 public String sseCustomerKeyMD5() {
655 return sseCustomerKeyMD5;
656 }
657
658 /**
659 * <p>
660 * If present, specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed customer
661 * master key (CMK) that was used for the object.
662 * </p>
663 *
664 * @return If present, specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed
665 * customer master key (CMK) that was used for the object.
666 */
667 public String ssekmsKeyId() {
668 return ssekmsKeyId;
669 }
670
671 /**
672 * <p>
673 * Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3
674 * Standard storage class objects.
675 * </p>
676 * <p>
677 * If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will
678 * return {@link StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
679 * {@link #storageClassAsString}.
680 * </p>
681 *
682 * @return Provides storage class information of the object. Amazon S3 returns this header for all objects except
683 * for S3 Standard storage class objects.
684 * @see StorageClass
685 */
686 public StorageClass storageClass() {
687 return StorageClass.fromValue(storageClass);
688 }
689
690 /**
691 * <p>
692 * Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3
693 * Standard storage class objects.
694 * </p>
695 * <p>
696 * If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will
697 * return {@link StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
698 * {@link #storageClassAsString}.
699 * </p>
700 *
701 * @return Provides storage class information of the object. Amazon S3 returns this header for all objects except
702 * for S3 Standard storage class objects.
703 * @see StorageClass
704 */
705 public String storageClassAsString() {
706 return storageClass;
707 }
708
709 /**
710 * Returns the value of the RequestCharged property for this object.
711 * <p>
712 * If the service returns an enum value that is not available in the current SDK version, {@link #requestCharged}
713 * will return {@link RequestCharged#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
714 * from {@link #requestChargedAsString}.
715 * </p>
716 *
717 * @return The value of the RequestCharged property for this object.
718 * @see RequestCharged
719 */
720 public RequestCharged requestCharged() {
721 return RequestCharged.fromValue(requestCharged);
722 }
723
724 /**
725 * Returns the value of the RequestCharged property for this object.
726 * <p>
727 * If the service returns an enum value that is not available in the current SDK version, {@link #requestCharged}
728 * will return {@link RequestCharged#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
729 * from {@link #requestChargedAsString}.
730 * </p>
731 *
732 * @return The value of the RequestCharged property for this object.
733 * @see RequestCharged
734 */
735 public String requestChargedAsString() {
736 return requestCharged;
737 }
738
739 /**
740 * <p>
741 * Amazon S3 can return this if your request involves a bucket that is either a source or destination in a
742 * replication rule.
743 * </p>
744 * <p>
745 * If the service returns an enum value that is not available in the current SDK version, {@link #replicationStatus}
746 * will return {@link ReplicationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
747 * from {@link #replicationStatusAsString}.
748 * </p>
749 *
750 * @return Amazon S3 can return this if your request involves a bucket that is either a source or destination in a
751 * replication rule.
752 * @see ReplicationStatus
753 */
754 public ReplicationStatus replicationStatus() {
755 return ReplicationStatus.fromValue(replicationStatus);
756 }
757
758 /**
759 * <p>
760 * Amazon S3 can return this if your request involves a bucket that is either a source or destination in a
761 * replication rule.
762 * </p>
763 * <p>
764 * If the service returns an enum value that is not available in the current SDK version, {@link #replicationStatus}
765 * will return {@link ReplicationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
766 * from {@link #replicationStatusAsString}.
767 * </p>
768 *
769 * @return Amazon S3 can return this if your request involves a bucket that is either a source or destination in a
770 * replication rule.
771 * @see ReplicationStatus
772 */
773 public String replicationStatusAsString() {
774 return replicationStatus;
775 }
776
777 /**
778 * <p>
779 * The count of parts this object has.
780 * </p>
781 *
782 * @return The count of parts this object has.
783 */
784 public Integer partsCount() {
785 return partsCount;
786 }
787
788 /**
789 * <p>
790 * The number of tags, if any, on the object.
791 * </p>
792 *
793 * @return The number of tags, if any, on the object.
794 */
795 public Integer tagCount() {
796 return tagCount;
797 }
798
799 /**
800 * <p>
801 * The Object Lock mode currently in place for this object.
802 * </p>
803 * <p>
804 * If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode}
805 * will return {@link ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
806 * from {@link #objectLockModeAsString}.
807 * </p>
808 *
809 * @return The Object Lock mode currently in place for this object.
810 * @see ObjectLockMode
811 */
812 public ObjectLockMode objectLockMode() {
813 return ObjectLockMode.fromValue(objectLockMode);
814 }
815
816 /**
817 * <p>
818 * The Object Lock mode currently in place for this object.
819 * </p>
820 * <p>
821 * If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode}
822 * will return {@link ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
823 * from {@link #objectLockModeAsString}.
824 * </p>
825 *
826 * @return The Object Lock mode currently in place for this object.
827 * @see ObjectLockMode
828 */
829 public String objectLockModeAsString() {
830 return objectLockMode;
831 }
832
833 /**
834 * <p>
835 * The date and time when this object's Object Lock will expire.
836 * </p>
837 *
838 * @return The date and time when this object's Object Lock will expire.
839 */
840 public Instant objectLockRetainUntilDate() {
841 return objectLockRetainUntilDate;
842 }
843
844 /**
845 * <p>
846 * Indicates whether this object has an active legal hold. This field is only returned if you have permission to
847 * view an object's legal hold status.
848 * </p>
849 * <p>
850 * If the service returns an enum value that is not available in the current SDK version,
851 * {@link #objectLockLegalHoldStatus} will return {@link ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The raw
852 * value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}.
853 * </p>
854 *
855 * @return Indicates whether this object has an active legal hold. This field is only returned if you have
856 * permission to view an object's legal hold status.
857 * @see ObjectLockLegalHoldStatus
858 */
859 public ObjectLockLegalHoldStatus objectLockLegalHoldStatus() {
860 return ObjectLockLegalHoldStatus.fromValue(objectLockLegalHoldStatus);
861 }
862
863 /**
864 * <p>
865 * Indicates whether this object has an active legal hold. This field is only returned if you have permission to
866 * view an object's legal hold status.
867 * </p>
868 * <p>
869 * If the service returns an enum value that is not available in the current SDK version,
870 * {@link #objectLockLegalHoldStatus} will return {@link ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The raw
871 * value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}.
872 * </p>
873 *
874 * @return Indicates whether this object has an active legal hold. This field is only returned if you have
875 * permission to view an object's legal hold status.
876 * @see ObjectLockLegalHoldStatus
877 */
878 public String objectLockLegalHoldStatusAsString() {
879 return objectLockLegalHoldStatus;
880 }
881
882 @Override
883 public Builder toBuilder() {
884 return new BuilderImpl(this);
885 }
886
887 public static Builder builder() {
888 return new BuilderImpl();
889 }
890
891 public static Class<? extends Builder> serializableBuilderClass() {
892 return BuilderImpl.class;
893 }
894
895 @Override
896 public int hashCode() {
897 int hashCode = 1;
898 hashCode = 31 * hashCode + super.hashCode();
899 hashCode = 31 * hashCode + Objects.hashCode(deleteMarker());
900 hashCode = 31 * hashCode + Objects.hashCode(acceptRanges());
901 hashCode = 31 * hashCode + Objects.hashCode(expiration());
902 hashCode = 31 * hashCode + Objects.hashCode(restore());
903 hashCode = 31 * hashCode + Objects.hashCode(lastModified());
904 hashCode = 31 * hashCode + Objects.hashCode(contentLength());
905 hashCode = 31 * hashCode + Objects.hashCode(eTag());
906 hashCode = 31 * hashCode + Objects.hashCode(missingMeta());
907 hashCode = 31 * hashCode + Objects.hashCode(versionId());
908 hashCode = 31 * hashCode + Objects.hashCode(cacheControl());
909 hashCode = 31 * hashCode + Objects.hashCode(contentDisposition());
910 hashCode = 31 * hashCode + Objects.hashCode(contentEncoding());
911 hashCode = 31 * hashCode + Objects.hashCode(contentLanguage());
912 hashCode = 31 * hashCode + Objects.hashCode(contentRange());
913 hashCode = 31 * hashCode + Objects.hashCode(contentType());
914 hashCode = 31 * hashCode + Objects.hashCode(expires());
915 hashCode = 31 * hashCode + Objects.hashCode(websiteRedirectLocation());
916 hashCode = 31 * hashCode + Objects.hashCode(serverSideEncryptionAsString());
917 hashCode = 31 * hashCode + Objects.hashCode(metadata());
918 hashCode = 31 * hashCode + Objects.hashCode(sseCustomerAlgorithm());
919 hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKeyMD5());
920 hashCode = 31 * hashCode + Objects.hashCode(ssekmsKeyId());
921 hashCode = 31 * hashCode + Objects.hashCode(storageClassAsString());
922 hashCode = 31 * hashCode + Objects.hashCode(requestChargedAsString());
923 hashCode = 31 * hashCode + Objects.hashCode(replicationStatusAsString());
924 hashCode = 31 * hashCode + Objects.hashCode(partsCount());
925 hashCode = 31 * hashCode + Objects.hashCode(tagCount());
926 hashCode = 31 * hashCode + Objects.hashCode(objectLockModeAsString());
927 hashCode = 31 * hashCode + Objects.hashCode(objectLockRetainUntilDate());
928 hashCode = 31 * hashCode + Objects.hashCode(objectLockLegalHoldStatusAsString());
929 return hashCode;
930 }
931
932 @Override
933 public boolean equals(Object obj) {
934 return super.equals(obj) && equalsBySdkFields(obj);
935 }
936
937 @Override
938 public boolean equalsBySdkFields(Object obj) {
939 if (this == obj) {
940 return true;
941 }
942 if (obj == null) {
943 return false;
944 }
945 if (!(obj instanceof GetObjectResponse)) {
946 return false;
947 }
948 GetObjectResponse other = (GetObjectResponse) obj;
949 return Objects.equals(deleteMarker(), other.deleteMarker()) && Objects.equals(acceptRanges(), other.acceptRanges())
950 && Objects.equals(expiration(), other.expiration()) && Objects.equals(restore(), other.restore())
951 && Objects.equals(lastModified(), other.lastModified()) && Objects.equals(contentLength(), other.contentLength())
952 && Objects.equals(eTag(), other.eTag()) && Objects.equals(missingMeta(), other.missingMeta())
953 && Objects.equals(versionId(), other.versionId()) && Objects.equals(cacheControl(), other.cacheControl())
954 && Objects.equals(contentDisposition(), other.contentDisposition())
955 && Objects.equals(contentEncoding(), other.contentEncoding())
956 && Objects.equals(contentLanguage(), other.contentLanguage())
957 && Objects.equals(contentRange(), other.contentRange()) && Objects.equals(contentType(), other.contentType())
958 && Objects.equals(expires(), other.expires())
959 && Objects.equals(websiteRedirectLocation(), other.websiteRedirectLocation())
960 && Objects.equals(serverSideEncryptionAsString(), other.serverSideEncryptionAsString())
961 && Objects.equals(metadata(), other.metadata())
962 && Objects.equals(sseCustomerAlgorithm(), other.sseCustomerAlgorithm())
963 && Objects.equals(sseCustomerKeyMD5(), other.sseCustomerKeyMD5())
964 && Objects.equals(ssekmsKeyId(), other.ssekmsKeyId())
965 && Objects.equals(storageClassAsString(), other.storageClassAsString())
966 && Objects.equals(requestChargedAsString(), other.requestChargedAsString())
967 && Objects.equals(replicationStatusAsString(), other.replicationStatusAsString())
968 && Objects.equals(partsCount(), other.partsCount()) && Objects.equals(tagCount(), other.tagCount())
969 && Objects.equals(objectLockModeAsString(), other.objectLockModeAsString())
970 && Objects.equals(objectLockRetainUntilDate(), other.objectLockRetainUntilDate())
971 && Objects.equals(objectLockLegalHoldStatusAsString(), other.objectLockLegalHoldStatusAsString());
972 }
973
974 /**
975 * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
976 * redacted from this string using a placeholder value.
977 */
978 @Override
979 public String toString() {
980 return ToString.builder("GetObjectResponse").add("DeleteMarker", deleteMarker()).add("AcceptRanges", acceptRanges())
981 .add("Expiration", expiration()).add("Restore", restore()).add("LastModified", lastModified())
982 .add("ContentLength", contentLength()).add("ETag", eTag()).add("MissingMeta", missingMeta())
983 .add("VersionId", versionId()).add("CacheControl", cacheControl())
984 .add("ContentDisposition", contentDisposition()).add("ContentEncoding", contentEncoding())
985 .add("ContentLanguage", contentLanguage()).add("ContentRange", contentRange()).add("ContentType", contentType())
986 .add("Expires", expires()).add("WebsiteRedirectLocation", websiteRedirectLocation())
987 .add("ServerSideEncryption", serverSideEncryptionAsString()).add("Metadata", metadata())
988 .add("SSECustomerAlgorithm", sseCustomerAlgorithm()).add("SSECustomerKeyMD5", sseCustomerKeyMD5())
989 .add("SSEKMSKeyId", ssekmsKeyId() == null ? null : "*** Sensitive Data Redacted ***")
990 .add("StorageClass", storageClassAsString()).add("RequestCharged", requestChargedAsString())
991 .add("ReplicationStatus", replicationStatusAsString()).add("PartsCount", partsCount())
992 .add("TagCount", tagCount()).add("ObjectLockMode", objectLockModeAsString())
993 .add("ObjectLockRetainUntilDate", objectLockRetainUntilDate())
994 .add("ObjectLockLegalHoldStatus", objectLockLegalHoldStatusAsString()).build();
995 }
996
997 public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
998 switch (fieldName) {
999 case "DeleteMarker":
1000 return Optional.ofNullable(clazz.cast(deleteMarker()));
1001 case "AcceptRanges":
1002 return Optional.ofNullable(clazz.cast(acceptRanges()));
1003 case "Expiration":
1004 return Optional.ofNullable(clazz.cast(expiration()));
1005 case "Restore":
1006 return Optional.ofNullable(clazz.cast(restore()));
1007 case "LastModified":
1008 return Optional.ofNullable(clazz.cast(lastModified()));
1009 case "ContentLength":
1010 return Optional.ofNullable(clazz.cast(contentLength()));
1011 case "ETag":
1012 return Optional.ofNullable(clazz.cast(eTag()));
1013 case "MissingMeta":
1014 return Optional.ofNullable(clazz.cast(missingMeta()));
1015 case "VersionId":
1016 return Optional.ofNullable(clazz.cast(versionId()));
1017 case "CacheControl":
1018 return Optional.ofNullable(clazz.cast(cacheControl()));
1019 case "ContentDisposition":
1020 return Optional.ofNullable(clazz.cast(contentDisposition()));
1021 case "ContentEncoding":
1022 return Optional.ofNullable(clazz.cast(contentEncoding()));
1023 case "ContentLanguage":
1024 return Optional.ofNullable(clazz.cast(contentLanguage()));
1025 case "ContentRange":
1026 return Optional.ofNullable(clazz.cast(contentRange()));
1027 case "ContentType":
1028 return Optional.ofNullable(clazz.cast(contentType()));
1029 case "Expires":
1030 return Optional.ofNullable(clazz.cast(expires()));
1031 case "WebsiteRedirectLocation":
1032 return Optional.ofNullable(clazz.cast(websiteRedirectLocation()));
1033 case "ServerSideEncryption":
1034 return Optional.ofNullable(clazz.cast(serverSideEncryptionAsString()));
1035 case "Metadata":
1036 return Optional.ofNullable(clazz.cast(metadata()));
1037 case "SSECustomerAlgorithm":
1038 return Optional.ofNullable(clazz.cast(sseCustomerAlgorithm()));
1039 case "SSECustomerKeyMD5":
1040 return Optional.ofNullable(clazz.cast(sseCustomerKeyMD5()));
1041 case "SSEKMSKeyId":
1042 return Optional.ofNullable(clazz.cast(ssekmsKeyId()));
1043 case "StorageClass":
1044 return Optional.ofNullable(clazz.cast(storageClassAsString()));
1045 case "RequestCharged":
1046 return Optional.ofNullable(clazz.cast(requestChargedAsString()));
1047 case "ReplicationStatus":
1048 return Optional.ofNullable(clazz.cast(replicationStatusAsString()));
1049 case "PartsCount":
1050 return Optional.ofNullable(clazz.cast(partsCount()));
1051 case "TagCount":
1052 return Optional.ofNullable(clazz.cast(tagCount()));
1053 case "ObjectLockMode":
1054 return Optional.ofNullable(clazz.cast(objectLockModeAsString()));
1055 case "ObjectLockRetainUntilDate":
1056 return Optional.ofNullable(clazz.cast(objectLockRetainUntilDate()));
1057 case "ObjectLockLegalHoldStatus":
1058 return Optional.ofNullable(clazz.cast(objectLockLegalHoldStatusAsString()));
1059 default:
1060 return Optional.empty();
1061 }
1062 }
1063
1064 @Override
1065 public List<SdkField<?>> sdkFields() {
1066 return SDK_FIELDS;
1067 }
1068
1069 private static <T> Function<Object, T> getter(Function<GetObjectResponse, T> g) {
1070 return obj -> g.apply((GetObjectResponse) obj);
1071 }
1072
1073 private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
1074 return (obj, val) -> s.accept((Builder) obj, val);
1075 }
1076
1077 public interface Builder extends S3Response.Builder, SdkPojo, CopyableBuilder<Builder, GetObjectResponse> {
1078 /**
1079 * <p>
1080 * Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response
1081 * header does not appear in the response.
1082 * </p>
1083 *
1084 * @param deleteMarker
1085 * Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this
1086 * response header does not appear in the response.
1087 * @return Returns a reference to this object so that method calls can be chained together.
1088 */
1089 Builder deleteMarker(Boolean deleteMarker);
1090
1091 /**
1092 * <p>
1093 * Indicates that a range of bytes was specified.
1094 * </p>
1095 *
1096 * @param acceptRanges
1097 * Indicates that a range of bytes was specified.
1098 * @return Returns a reference to this object so that method calls can be chained together.
1099 */
1100 Builder acceptRanges(String acceptRanges);
1101
1102 /**
1103 * <p>
1104 * If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It
1105 * includes the expiry-date and rule-id key-value pairs providing object expiration information. The value of
1106 * the rule-id is URL encoded.
1107 * </p>
1108 *
1109 * @param expiration
1110 * If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header.
1111 * It includes the expiry-date and rule-id key-value pairs providing object expiration information. The
1112 * value of the rule-id is URL encoded.
1113 * @return Returns a reference to this object so that method calls can be chained together.
1114 */
1115 Builder expiration(String expiration);
1116
1117 /**
1118 * <p>
1119 * Provides information about object restoration operation and expiration time of the restored object copy.
1120 * </p>
1121 *
1122 * @param restore
1123 * Provides information about object restoration operation and expiration time of the restored object
1124 * copy.
1125 * @return Returns a reference to this object so that method calls can be chained together.
1126 */
1127 Builder restore(String restore);
1128
1129 /**
1130 * <p>
1131 * Last modified date of the object
1132 * </p>
1133 *
1134 * @param lastModified
1135 * Last modified date of the object
1136 * @return Returns a reference to this object so that method calls can be chained together.
1137 */
1138 Builder lastModified(Instant lastModified);
1139
1140 /**
1141 * <p>
1142 * Size of the body in bytes.
1143 * </p>
1144 *
1145 * @param contentLength
1146 * Size of the body in bytes.
1147 * @return Returns a reference to this object so that method calls can be chained together.
1148 */
1149 Builder contentLength(Long contentLength);
1150
1151 /**
1152 * <p>
1153 * An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.
1154 * </p>
1155 *
1156 * @param eTag
1157 * An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at
1158 * a URL.
1159 * @return Returns a reference to this object so that method calls can be chained together.
1160 */
1161 Builder eTag(String eTag);
1162
1163 /**
1164 * <p>
1165 * This is set to the number of metadata entries not returned in <code>x-amz-meta</code> headers. This can
1166 * happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API.
1167 * For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
1168 * </p>
1169 *
1170 * @param missingMeta
1171 * This is set to the number of metadata entries not returned in <code>x-amz-meta</code> headers. This
1172 * can happen if you create metadata using an API like SOAP that supports more flexible metadata than the
1173 * REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
1174 * @return Returns a reference to this object so that method calls can be chained together.
1175 */
1176 Builder missingMeta(Integer missingMeta);
1177
1178 /**
1179 * <p>
1180 * Version of the object.
1181 * </p>
1182 *
1183 * @param versionId
1184 * Version of the object.
1185 * @return Returns a reference to this object so that method calls can be chained together.
1186 */
1187 Builder versionId(String versionId);
1188
1189 /**
1190 * <p>
1191 * Specifies caching behavior along the request/reply chain.
1192 * </p>
1193 *
1194 * @param cacheControl
1195 * Specifies caching behavior along the request/reply chain.
1196 * @return Returns a reference to this object so that method calls can be chained together.
1197 */
1198 Builder cacheControl(String cacheControl);
1199
1200 /**
1201 * <p>
1202 * Specifies presentational information for the object.
1203 * </p>
1204 *
1205 * @param contentDisposition
1206 * Specifies presentational information for the object.
1207 * @return Returns a reference to this object so that method calls can be chained together.
1208 */
1209 Builder contentDisposition(String contentDisposition);
1210
1211 /**
1212 * <p>
1213 * Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be
1214 * applied to obtain the media-type referenced by the Content-Type header field.
1215 * </p>
1216 *
1217 * @param contentEncoding
1218 * Specifies what content encodings have been applied to the object and thus what decoding mechanisms
1219 * must be applied to obtain the media-type referenced by the Content-Type header field.
1220 * @return Returns a reference to this object so that method calls can be chained together.
1221 */
1222 Builder contentEncoding(String contentEncoding);
1223
1224 /**
1225 * <p>
1226 * The language the content is in.
1227 * </p>
1228 *
1229 * @param contentLanguage
1230 * The language the content is in.
1231 * @return Returns a reference to this object so that method calls can be chained together.
1232 */
1233 Builder contentLanguage(String contentLanguage);
1234
1235 /**
1236 * <p>
1237 * The portion of the object returned in the response.
1238 * </p>
1239 *
1240 * @param contentRange
1241 * The portion of the object returned in the response.
1242 * @return Returns a reference to this object so that method calls can be chained together.
1243 */
1244 Builder contentRange(String contentRange);
1245
1246 /**
1247 * <p>
1248 * A standard MIME type describing the format of the object data.
1249 * </p>
1250 *
1251 * @param contentType
1252 * A standard MIME type describing the format of the object data.
1253 * @return Returns a reference to this object so that method calls can be chained together.
1254 */
1255 Builder contentType(String contentType);
1256
1257 /**
1258 * <p>
1259 * The date and time at which the object is no longer cacheable.
1260 * </p>
1261 *
1262 * @param expires
1263 * The date and time at which the object is no longer cacheable.
1264 * @return Returns a reference to this object so that method calls can be chained together.
1265 */
1266 Builder expires(Instant expires);
1267
1268 /**
1269 * <p>
1270 * If the bucket is configured as a website, redirects requests for this object to another object in the same
1271 * bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
1272 * </p>
1273 *
1274 * @param websiteRedirectLocation
1275 * If the bucket is configured as a website, redirects requests for this object to another object in the
1276 * same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
1277 * @return Returns a reference to this object so that method calls can be chained together.
1278 */
1279 Builder websiteRedirectLocation(String websiteRedirectLocation);
1280
1281 /**
1282 * <p>
1283 * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256,
1284 * aws:kms).
1285 * </p>
1286 *
1287 * @param serverSideEncryption
1288 * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256,
1289 * aws:kms).
1290 * @see ServerSideEncryption
1291 * @return Returns a reference to this object so that method calls can be chained together.
1292 * @see ServerSideEncryption
1293 */
1294 Builder serverSideEncryption(String serverSideEncryption);
1295
1296 /**
1297 * <p>
1298 * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256,
1299 * aws:kms).
1300 * </p>
1301 *
1302 * @param serverSideEncryption
1303 * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256,
1304 * aws:kms).
1305 * @see ServerSideEncryption
1306 * @return Returns a reference to this object so that method calls can be chained together.
1307 * @see ServerSideEncryption
1308 */
1309 Builder serverSideEncryption(ServerSideEncryption serverSideEncryption);
1310
1311 /**
1312 * <p>
1313 * A map of metadata to store with the object in S3.
1314 * </p>
1315 *
1316 * @param metadata
1317 * A map of metadata to store with the object in S3.
1318 * @return Returns a reference to this object so that method calls can be chained together.
1319 */
1320 Builder metadata(Map<String, String> metadata);
1321
1322 /**
1323 * <p>
1324 * If server-side encryption with a customer-provided encryption key was requested, the response will include
1325 * this header confirming the encryption algorithm used.
1326 * </p>
1327 *
1328 * @param sseCustomerAlgorithm
1329 * If server-side encryption with a customer-provided encryption key was requested, the response will
1330 * include this header confirming the encryption algorithm used.
1331 * @return Returns a reference to this object so that method calls can be chained together.
1332 */
1333 Builder sseCustomerAlgorithm(String sseCustomerAlgorithm);
1334
1335 /**
1336 * <p>
1337 * If server-side encryption with a customer-provided encryption key was requested, the response will include
1338 * this header to provide round-trip message integrity verification of the customer-provided encryption key.
1339 * </p>
1340 *
1341 * @param sseCustomerKeyMD5
1342 * If server-side encryption with a customer-provided encryption key was requested, the response will
1343 * include this header to provide round-trip message integrity verification of the customer-provided
1344 * encryption key.
1345 * @return Returns a reference to this object so that method calls can be chained together.
1346 */
1347 Builder sseCustomerKeyMD5(String sseCustomerKeyMD5);
1348
1349 /**
1350 * <p>
1351 * If present, specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed customer
1352 * master key (CMK) that was used for the object.
1353 * </p>
1354 *
1355 * @param ssekmsKeyId
1356 * If present, specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed
1357 * customer master key (CMK) that was used for the object.
1358 * @return Returns a reference to this object so that method calls can be chained together.
1359 */
1360 Builder ssekmsKeyId(String ssekmsKeyId);
1361
1362 /**
1363 * <p>
1364 * Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3
1365 * Standard storage class objects.
1366 * </p>
1367 *
1368 * @param storageClass
1369 * Provides storage class information of the object. Amazon S3 returns this header for all objects except
1370 * for S3 Standard storage class objects.
1371 * @see StorageClass
1372 * @return Returns a reference to this object so that method calls can be chained together.
1373 * @see StorageClass
1374 */
1375 Builder storageClass(String storageClass);
1376
1377 /**
1378 * <p>
1379 * Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3
1380 * Standard storage class objects.
1381 * </p>
1382 *
1383 * @param storageClass
1384 * Provides storage class information of the object. Amazon S3 returns this header for all objects except
1385 * for S3 Standard storage class objects.
1386 * @see StorageClass
1387 * @return Returns a reference to this object so that method calls can be chained together.
1388 * @see StorageClass
1389 */
1390 Builder storageClass(StorageClass storageClass);
1391
1392 /**
1393 * Sets the value of the RequestCharged property for this object.
1394 *
1395 * @param requestCharged
1396 * The new value for the RequestCharged property for this object.
1397 * @see RequestCharged
1398 * @return Returns a reference to this object so that method calls can be chained together.
1399 * @see RequestCharged
1400 */
1401 Builder requestCharged(String requestCharged);
1402
1403 /**
1404 * Sets the value of the RequestCharged property for this object.
1405 *
1406 * @param requestCharged
1407 * The new value for the RequestCharged property for this object.
1408 * @see RequestCharged
1409 * @return Returns a reference to this object so that method calls can be chained together.
1410 * @see RequestCharged
1411 */
1412 Builder requestCharged(RequestCharged requestCharged);
1413
1414 /**
1415 * <p>
1416 * Amazon S3 can return this if your request involves a bucket that is either a source or destination in a
1417 * replication rule.
1418 * </p>
1419 *
1420 * @param replicationStatus
1421 * Amazon S3 can return this if your request involves a bucket that is either a source or destination in
1422 * a replication rule.
1423 * @see ReplicationStatus
1424 * @return Returns a reference to this object so that method calls can be chained together.
1425 * @see ReplicationStatus
1426 */
1427 Builder replicationStatus(String replicationStatus);
1428
1429 /**
1430 * <p>
1431 * Amazon S3 can return this if your request involves a bucket that is either a source or destination in a
1432 * replication rule.
1433 * </p>
1434 *
1435 * @param replicationStatus
1436 * Amazon S3 can return this if your request involves a bucket that is either a source or destination in
1437 * a replication rule.
1438 * @see ReplicationStatus
1439 * @return Returns a reference to this object so that method calls can be chained together.
1440 * @see ReplicationStatus
1441 */
1442 Builder replicationStatus(ReplicationStatus replicationStatus);
1443
1444 /**
1445 * <p>
1446 * The count of parts this object has.
1447 * </p>
1448 *
1449 * @param partsCount
1450 * The count of parts this object has.
1451 * @return Returns a reference to this object so that method calls can be chained together.
1452 */
1453 Builder partsCount(Integer partsCount);
1454
1455 /**
1456 * <p>
1457 * The number of tags, if any, on the object.
1458 * </p>
1459 *
1460 * @param tagCount
1461 * The number of tags, if any, on the object.
1462 * @return Returns a reference to this object so that method calls can be chained together.
1463 */
1464 Builder tagCount(Integer tagCount);
1465
1466 /**
1467 * <p>
1468 * The Object Lock mode currently in place for this object.
1469 * </p>
1470 *
1471 * @param objectLockMode
1472 * The Object Lock mode currently in place for this object.
1473 * @see ObjectLockMode
1474 * @return Returns a reference to this object so that method calls can be chained together.
1475 * @see ObjectLockMode
1476 */
1477 Builder objectLockMode(String objectLockMode);
1478
1479 /**
1480 * <p>
1481 * The Object Lock mode currently in place for this object.
1482 * </p>
1483 *
1484 * @param objectLockMode
1485 * The Object Lock mode currently in place for this object.
1486 * @see ObjectLockMode
1487 * @return Returns a reference to this object so that method calls can be chained together.
1488 * @see ObjectLockMode
1489 */
1490 Builder objectLockMode(ObjectLockMode objectLockMode);
1491
1492 /**
1493 * <p>
1494 * The date and time when this object's Object Lock will expire.
1495 * </p>
1496 *
1497 * @param objectLockRetainUntilDate
1498 * The date and time when this object's Object Lock will expire.
1499 * @return Returns a reference to this object so that method calls can be chained together.
1500 */
1501 Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate);
1502
1503 /**
1504 * <p>
1505 * Indicates whether this object has an active legal hold. This field is only returned if you have permission to
1506 * view an object's legal hold status.
1507 * </p>
1508 *
1509 * @param objectLockLegalHoldStatus
1510 * Indicates whether this object has an active legal hold. This field is only returned if you have
1511 * permission to view an object's legal hold status.
1512 * @see ObjectLockLegalHoldStatus
1513 * @return Returns a reference to this object so that method calls can be chained together.
1514 * @see ObjectLockLegalHoldStatus
1515 */
1516 Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus);
1517
1518 /**
1519 * <p>
1520 * Indicates whether this object has an active legal hold. This field is only returned if you have permission to
1521 * view an object's legal hold status.
1522 * </p>
1523 *
1524 * @param objectLockLegalHoldStatus
1525 * Indicates whether this object has an active legal hold. This field is only returned if you have
1526 * permission to view an object's legal hold status.
1527 * @see ObjectLockLegalHoldStatus
1528 * @return Returns a reference to this object so that method calls can be chained together.
1529 * @see ObjectLockLegalHoldStatus
1530 */
1531 Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus);
1532 }
1533
1534 static final class BuilderImpl extends S3Response.BuilderImpl implements Builder {
1535 private Boolean deleteMarker;
1536
1537 private String acceptRanges;
1538
1539 private String expiration;
1540
1541 private String restore;
1542
1543 private Instant lastModified;
1544
1545 private Long contentLength;
1546
1547 private String eTag;
1548
1549 private Integer missingMeta;
1550
1551 private String versionId;
1552
1553 private String cacheControl;
1554
1555 private String contentDisposition;
1556
1557 private String contentEncoding;
1558
1559 private String contentLanguage;
1560
1561 private String contentRange;
1562
1563 private String contentType;
1564
1565 private Instant expires;
1566
1567 private String websiteRedirectLocation;
1568
1569 private String serverSideEncryption;
1570
1571 private Map<String, String> metadata = DefaultSdkAutoConstructMap.getInstance();
1572
1573 private String sseCustomerAlgorithm;
1574
1575 private String sseCustomerKeyMD5;
1576
1577 private String ssekmsKeyId;
1578
1579 private String storageClass;
1580
1581 private String requestCharged;
1582
1583 private String replicationStatus;
1584
1585 private Integer partsCount;
1586
1587 private Integer tagCount;
1588
1589 private String objectLockMode;
1590
1591 private Instant objectLockRetainUntilDate;
1592
1593 private String objectLockLegalHoldStatus;
1594
1595 private BuilderImpl() {
1596 }
1597
1598 private BuilderImpl(GetObjectResponse model) {
1599 super(model);
1600 deleteMarker(model.deleteMarker);
1601 acceptRanges(model.acceptRanges);
1602 expiration(model.expiration);
1603 restore(model.restore);
1604 lastModified(model.lastModified);
1605 contentLength(model.contentLength);
1606 eTag(model.eTag);
1607 missingMeta(model.missingMeta);
1608 versionId(model.versionId);
1609 cacheControl(model.cacheControl);
1610 contentDisposition(model.contentDisposition);
1611 contentEncoding(model.contentEncoding);
1612 contentLanguage(model.contentLanguage);
1613 contentRange(model.contentRange);
1614 contentType(model.contentType);
1615 expires(model.expires);
1616 websiteRedirectLocation(model.websiteRedirectLocation);
1617 serverSideEncryption(model.serverSideEncryption);
1618 metadata(model.metadata);
1619 sseCustomerAlgorithm(model.sseCustomerAlgorithm);
1620 sseCustomerKeyMD5(model.sseCustomerKeyMD5);
1621 ssekmsKeyId(model.ssekmsKeyId);
1622 storageClass(model.storageClass);
1623 requestCharged(model.requestCharged);
1624 replicationStatus(model.replicationStatus);
1625 partsCount(model.partsCount);
1626 tagCount(model.tagCount);
1627 objectLockMode(model.objectLockMode);
1628 objectLockRetainUntilDate(model.objectLockRetainUntilDate);
1629 objectLockLegalHoldStatus(model.objectLockLegalHoldStatus);
1630 }
1631
1632 public final Boolean getDeleteMarker() {
1633 return deleteMarker;
1634 }
1635
1636 @Override
1637 public final Builder deleteMarker(Boolean deleteMarker) {
1638 this.deleteMarker = deleteMarker;
1639 return this;
1640 }
1641
1642 public final void setDeleteMarker(Boolean deleteMarker) {
1643 this.deleteMarker = deleteMarker;
1644 }
1645
1646 public final String getAcceptRanges() {
1647 return acceptRanges;
1648 }
1649
1650 @Override
1651 public final Builder acceptRanges(String acceptRanges) {
1652 this.acceptRanges = acceptRanges;
1653 return this;
1654 }
1655
1656 public final void setAcceptRanges(String acceptRanges) {
1657 this.acceptRanges = acceptRanges;
1658 }
1659
1660 public final String getExpiration() {
1661 return expiration;
1662 }
1663
1664 @Override
1665 public final Builder expiration(String expiration) {
1666 this.expiration = expiration;
1667 return this;
1668 }
1669
1670 public final void setExpiration(String expiration) {
1671 this.expiration = expiration;
1672 }
1673
1674 public final String getRestore() {
1675 return restore;
1676 }
1677
1678 @Override
1679 public final Builder restore(String restore) {
1680 this.restore = restore;
1681 return this;
1682 }
1683
1684 public final void setRestore(String restore) {
1685 this.restore = restore;
1686 }
1687
1688 public final Instant getLastModified() {
1689 return lastModified;
1690 }
1691
1692 @Override
1693 public final Builder lastModified(Instant lastModified) {
1694 this.lastModified = lastModified;
1695 return this;
1696 }
1697
1698 public final void setLastModified(Instant lastModified) {
1699 this.lastModified = lastModified;
1700 }
1701
1702 public final Long getContentLength() {
1703 return contentLength;
1704 }
1705
1706 @Override
1707 public final Builder contentLength(Long contentLength) {
1708 this.contentLength = contentLength;
1709 return this;
1710 }
1711
1712 public final void setContentLength(Long contentLength) {
1713 this.contentLength = contentLength;
1714 }
1715
1716 public final String getETag() {
1717 return eTag;
1718 }
1719
1720 @Override
1721 public final Builder eTag(String eTag) {
1722 this.eTag = eTag;
1723 return this;
1724 }
1725
1726 public final void setETag(String eTag) {
1727 this.eTag = eTag;
1728 }
1729
1730 public final Integer getMissingMeta() {
1731 return missingMeta;
1732 }
1733
1734 @Override
1735 public final Builder missingMeta(Integer missingMeta) {
1736 this.missingMeta = missingMeta;
1737 return this;
1738 }
1739
1740 public final void setMissingMeta(Integer missingMeta) {
1741 this.missingMeta = missingMeta;
1742 }
1743
1744 public final String getVersionId() {
1745 return versionId;
1746 }
1747
1748 @Override
1749 public final Builder versionId(String versionId) {
1750 this.versionId = versionId;
1751 return this;
1752 }
1753
1754 public final void setVersionId(String versionId) {
1755 this.versionId = versionId;
1756 }
1757
1758 public final String getCacheControl() {
1759 return cacheControl;
1760 }
1761
1762 @Override
1763 public final Builder cacheControl(String cacheControl) {
1764 this.cacheControl = cacheControl;
1765 return this;
1766 }
1767
1768 public final void setCacheControl(String cacheControl) {
1769 this.cacheControl = cacheControl;
1770 }
1771
1772 public final String getContentDisposition() {
1773 return contentDisposition;
1774 }
1775
1776 @Override
1777 public final Builder contentDisposition(String contentDisposition) {
1778 this.contentDisposition = contentDisposition;
1779 return this;
1780 }
1781
1782 public final void setContentDisposition(String contentDisposition) {
1783 this.contentDisposition = contentDisposition;
1784 }
1785
1786 public final String getContentEncoding() {
1787 return contentEncoding;
1788 }
1789
1790 @Override
1791 public final Builder contentEncoding(String contentEncoding) {
1792 this.contentEncoding = contentEncoding;
1793 return this;
1794 }
1795
1796 public final void setContentEncoding(String contentEncoding) {
1797 this.contentEncoding = contentEncoding;
1798 }
1799
1800 public final String getContentLanguage() {
1801 return contentLanguage;
1802 }
1803
1804 @Override
1805 public final Builder contentLanguage(String contentLanguage) {
1806 this.contentLanguage = contentLanguage;
1807 return this;
1808 }
1809
1810 public final void setContentLanguage(String contentLanguage) {
1811 this.contentLanguage = contentLanguage;
1812 }
1813
1814 public final String getContentRange() {
1815 return contentRange;
1816 }
1817
1818 @Override
1819 public final Builder contentRange(String contentRange) {
1820 this.contentRange = contentRange;
1821 return this;
1822 }
1823
1824 public final void setContentRange(String contentRange) {
1825 this.contentRange = contentRange;
1826 }
1827
1828 public final String getContentType() {
1829 return contentType;
1830 }
1831
1832 @Override
1833 public final Builder contentType(String contentType) {
1834 this.contentType = contentType;
1835 return this;
1836 }
1837
1838 public final void setContentType(String contentType) {
1839 this.contentType = contentType;
1840 }
1841
1842 public final Instant getExpires() {
1843 return expires;
1844 }
1845
1846 @Override
1847 public final Builder expires(Instant expires) {
1848 this.expires = expires;
1849 return this;
1850 }
1851
1852 public final void setExpires(Instant expires) {
1853 this.expires = expires;
1854 }
1855
1856 public final String getWebsiteRedirectLocation() {
1857 return websiteRedirectLocation;
1858 }
1859
1860 @Override
1861 public final Builder websiteRedirectLocation(String websiteRedirectLocation) {
1862 this.websiteRedirectLocation = websiteRedirectLocation;
1863 return this;
1864 }
1865
1866 public final void setWebsiteRedirectLocation(String websiteRedirectLocation) {
1867 this.websiteRedirectLocation = websiteRedirectLocation;
1868 }
1869
1870 public final String getServerSideEncryption() {
1871 return serverSideEncryption;
1872 }
1873
1874 @Override
1875 public final Builder serverSideEncryption(String serverSideEncryption) {
1876 this.serverSideEncryption = serverSideEncryption;
1877 return this;
1878 }
1879
1880 @Override
1881 public final Builder serverSideEncryption(ServerSideEncryption serverSideEncryption) {
1882 this.serverSideEncryption(serverSideEncryption == null ? null : serverSideEncryption.toString());
1883 return this;
1884 }
1885
1886 public final void setServerSideEncryption(String serverSideEncryption) {
1887 this.serverSideEncryption = serverSideEncryption;
1888 }
1889
1890 public final Map<String, String> getMetadata() {
1891 return metadata;
1892 }
1893
1894 @Override
1895 public final Builder metadata(Map<String, String> metadata) {
1896 this.metadata = MetadataCopier.copy(metadata);
1897 return this;
1898 }
1899
1900 public final void setMetadata(Map<String, String> metadata) {
1901 this.metadata = MetadataCopier.copy(metadata);
1902 }
1903
1904 public final String getSseCustomerAlgorithm() {
1905 return sseCustomerAlgorithm;
1906 }
1907
1908 @Override
1909 public final Builder sseCustomerAlgorithm(String sseCustomerAlgorithm) {
1910 this.sseCustomerAlgorithm = sseCustomerAlgorithm;
1911 return this;
1912 }
1913
1914 public final void setSseCustomerAlgorithm(String sseCustomerAlgorithm) {
1915 this.sseCustomerAlgorithm = sseCustomerAlgorithm;
1916 }
1917
1918 public final String getSseCustomerKeyMD5() {
1919 return sseCustomerKeyMD5;
1920 }
1921
1922 @Override
1923 public final Builder sseCustomerKeyMD5(String sseCustomerKeyMD5) {
1924 this.sseCustomerKeyMD5 = sseCustomerKeyMD5;
1925 return this;
1926 }
1927
1928 public final void setSseCustomerKeyMD5(String sseCustomerKeyMD5) {
1929 this.sseCustomerKeyMD5 = sseCustomerKeyMD5;
1930 }
1931
1932 public final String getSsekmsKeyId() {
1933 return ssekmsKeyId;
1934 }
1935
1936 @Override
1937 public final Builder ssekmsKeyId(String ssekmsKeyId) {
1938 this.ssekmsKeyId = ssekmsKeyId;
1939 return this;
1940 }
1941
1942 public final void setSsekmsKeyId(String ssekmsKeyId) {
1943 this.ssekmsKeyId = ssekmsKeyId;
1944 }
1945
1946 public final String getStorageClass() {
1947 return storageClass;
1948 }
1949
1950 @Override
1951 public final Builder storageClass(String storageClass) {
1952 this.storageClass = storageClass;
1953 return this;
1954 }
1955
1956 @Override
1957 public final Builder storageClass(StorageClass storageClass) {
1958 this.storageClass(storageClass == null ? null : storageClass.toString());
1959 return this;
1960 }
1961
1962 public final void setStorageClass(String storageClass) {
1963 this.storageClass = storageClass;
1964 }
1965
1966 public final String getRequestCharged() {
1967 return requestCharged;
1968 }
1969
1970 @Override
1971 public final Builder requestCharged(String requestCharged) {
1972 this.requestCharged = requestCharged;
1973 return this;
1974 }
1975
1976 @Override
1977 public final Builder requestCharged(RequestCharged requestCharged) {
1978 this.requestCharged(requestCharged == null ? null : requestCharged.toString());
1979 return this;
1980 }
1981
1982 public final void setRequestCharged(String requestCharged) {
1983 this.requestCharged = requestCharged;
1984 }
1985
1986 public final String getReplicationStatus() {
1987 return replicationStatus;
1988 }
1989
1990 @Override
1991 public final Builder replicationStatus(String replicationStatus) {
1992 this.replicationStatus = replicationStatus;
1993 return this;
1994 }
1995
1996 @Override
1997 public final Builder replicationStatus(ReplicationStatus replicationStatus) {
1998 this.replicationStatus(replicationStatus == null ? null : replicationStatus.toString());
1999 return this;
2000 }
2001
2002 public final void setReplicationStatus(String replicationStatus) {
2003 this.replicationStatus = replicationStatus;
2004 }
2005
2006 public final Integer getPartsCount() {
2007 return partsCount;
2008 }
2009
2010 @Override
2011 public final Builder partsCount(Integer partsCount) {
2012 this.partsCount = partsCount;
2013 return this;
2014 }
2015
2016 public final void setPartsCount(Integer partsCount) {
2017 this.partsCount = partsCount;
2018 }
2019
2020 public final Integer getTagCount() {
2021 return tagCount;
2022 }
2023
2024 @Override
2025 public final Builder tagCount(Integer tagCount) {
2026 this.tagCount = tagCount;
2027 return this;
2028 }
2029
2030 public final void setTagCount(Integer tagCount) {
2031 this.tagCount = tagCount;
2032 }
2033
2034 public final String getObjectLockMode() {
2035 return objectLockMode;
2036 }
2037
2038 @Override
2039 public final Builder objectLockMode(String objectLockMode) {
2040 this.objectLockMode = objectLockMode;
2041 return this;
2042 }
2043
2044 @Override
2045 public final Builder objectLockMode(ObjectLockMode objectLockMode) {
2046 this.objectLockMode(objectLockMode == null ? null : objectLockMode.toString());
2047 return this;
2048 }
2049
2050 public final void setObjectLockMode(String objectLockMode) {
2051 this.objectLockMode = objectLockMode;
2052 }
2053
2054 public final Instant getObjectLockRetainUntilDate() {
2055 return objectLockRetainUntilDate;
2056 }
2057
2058 @Override
2059 public final Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate) {
2060 this.objectLockRetainUntilDate = objectLockRetainUntilDate;
2061 return this;
2062 }
2063
2064 public final void setObjectLockRetainUntilDate(Instant objectLockRetainUntilDate) {
2065 this.objectLockRetainUntilDate = objectLockRetainUntilDate;
2066 }
2067
2068 public final String getObjectLockLegalHoldStatus() {
2069 return objectLockLegalHoldStatus;
2070 }
2071
2072 @Override
2073 public final Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus) {
2074 this.objectLockLegalHoldStatus = objectLockLegalHoldStatus;
2075 return this;
2076 }
2077
2078 @Override
2079 public final Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus) {
2080 this.objectLockLegalHoldStatus(objectLockLegalHoldStatus == null ? null : objectLockLegalHoldStatus.toString());
2081 return this;
2082 }
2083
2084 public final void setObjectLockLegalHoldStatus(String objectLockLegalHoldStatus) {
2085 this.objectLockLegalHoldStatus = objectLockLegalHoldStatus;
2086 }
2087
2088 @Override
2089 public GetObjectResponse build() {
2090 return new GetObjectResponse(this);
2091 }
2092
2093 @Override
2094 public List<SdkField<?>> sdkFields() {
2095 return SDK_FIELDS;
2096 }
2097 }
2098 }
2099