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 HeadObjectResponse extends S3Response implements
43         ToCopyableBuilder<HeadObjectResponse.Builder, HeadObjectResponse> {
44     private static final SdkField<Boolean> DELETE_MARKER_FIELD = SdkField
45             .<Boolean> builder(MarshallingType.BOOLEAN)
46             .getter(getter(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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(HeadObjectResponse::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_TYPE_FIELD = SdkField
136             .<String> builder(MarshallingType.STRING)
137             .getter(getter(HeadObjectResponse::contentType))
138             .setter(setter(Builder::contentType))
139             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Type")
140                     .unmarshallLocationName("Content-Type").build()).build();
141
142     private static final SdkField<Instant> EXPIRES_FIELD = SdkField
143             .<Instant> builder(MarshallingType.INSTANT)
144             .getter(getter(HeadObjectResponse::expires))
145             .setter(setter(Builder::expires))
146             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Expires")
147                     .unmarshallLocationName("Expires").build()).build();
148
149     private static final SdkField<String> WEBSITE_REDIRECT_LOCATION_FIELD = SdkField
150             .<String> builder(MarshallingType.STRING)
151             .getter(getter(HeadObjectResponse::websiteRedirectLocation))
152             .setter(setter(Builder::websiteRedirectLocation))
153             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-website-redirect-location")
154                     .unmarshallLocationName("x-amz-website-redirect-location").build()).build();
155
156     private static final SdkField<String> SERVER_SIDE_ENCRYPTION_FIELD = SdkField
157             .<String> builder(MarshallingType.STRING)
158             .getter(getter(HeadObjectResponse::serverSideEncryptionAsString))
159             .setter(setter(Builder::serverSideEncryption))
160             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-server-side-encryption")
161                     .unmarshallLocationName("x-amz-server-side-encryption").build()).build();
162
163     private static final SdkField<Map<String, String>> METADATA_FIELD = SdkField
164             .<Map<String, String>> builder(MarshallingType.MAP)
165             .getter(getter(HeadObjectResponse::metadata))
166             .setter(setter(Builder::metadata))
167             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-meta-")
168                     .unmarshallLocationName("x-amz-meta-").build(),
169                     MapTrait.builder()
170                             .keyLocationName("key")
171                             .valueLocationName("value")
172                             .valueFieldInfo(
173                                     SdkField.<String> builder(MarshallingType.STRING)
174                                             .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
175                                                     .locationName("value").unmarshallLocationName("value").build()).build())
176                             .build()).build();
177
178     private static final SdkField<String> SSE_CUSTOMER_ALGORITHM_FIELD = SdkField
179             .<String> builder(MarshallingType.STRING)
180             .getter(getter(HeadObjectResponse::sseCustomerAlgorithm))
181             .setter(setter(Builder::sseCustomerAlgorithm))
182             .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
183                     .locationName("x-amz-server-side-encryption-customer-algorithm")
184                     .unmarshallLocationName("x-amz-server-side-encryption-customer-algorithm").build()).build();
185
186     private static final SdkField<String> SSE_CUSTOMER_KEY_MD5_FIELD = SdkField
187             .<String> builder(MarshallingType.STRING)
188             .getter(getter(HeadObjectResponse::sseCustomerKeyMD5))
189             .setter(setter(Builder::sseCustomerKeyMD5))
190             .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
191                     .locationName("x-amz-server-side-encryption-customer-key-MD5")
192                     .unmarshallLocationName("x-amz-server-side-encryption-customer-key-MD5").build()).build();
193
194     private static final SdkField<String> SSEKMS_KEY_ID_FIELD = SdkField
195             .<String> builder(MarshallingType.STRING)
196             .getter(getter(HeadObjectResponse::ssekmsKeyId))
197             .setter(setter(Builder::ssekmsKeyId))
198             .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
199                     .locationName("x-amz-server-side-encryption-aws-kms-key-id")
200                     .unmarshallLocationName("x-amz-server-side-encryption-aws-kms-key-id").build()).build();
201
202     private static final SdkField<String> STORAGE_CLASS_FIELD = SdkField
203             .<String> builder(MarshallingType.STRING)
204             .getter(getter(HeadObjectResponse::storageClassAsString))
205             .setter(setter(Builder::storageClass))
206             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-storage-class")
207                     .unmarshallLocationName("x-amz-storage-class").build()).build();
208
209     private static final SdkField<String> REQUEST_CHARGED_FIELD = SdkField
210             .<String> builder(MarshallingType.STRING)
211             .getter(getter(HeadObjectResponse::requestChargedAsString))
212             .setter(setter(Builder::requestCharged))
213             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-request-charged")
214                     .unmarshallLocationName("x-amz-request-charged").build()).build();
215
216     private static final SdkField<String> REPLICATION_STATUS_FIELD = SdkField
217             .<String> builder(MarshallingType.STRING)
218             .getter(getter(HeadObjectResponse::replicationStatusAsString))
219             .setter(setter(Builder::replicationStatus))
220             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-replication-status")
221                     .unmarshallLocationName("x-amz-replication-status").build()).build();
222
223     private static final SdkField<Integer> PARTS_COUNT_FIELD = SdkField
224             .<Integer> builder(MarshallingType.INTEGER)
225             .getter(getter(HeadObjectResponse::partsCount))
226             .setter(setter(Builder::partsCount))
227             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-mp-parts-count")
228                     .unmarshallLocationName("x-amz-mp-parts-count").build()).build();
229
230     private static final SdkField<String> OBJECT_LOCK_MODE_FIELD = SdkField
231             .<String> builder(MarshallingType.STRING)
232             .getter(getter(HeadObjectResponse::objectLockModeAsString))
233             .setter(setter(Builder::objectLockMode))
234             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-mode")
235                     .unmarshallLocationName("x-amz-object-lock-mode").build()).build();
236
237     private static final SdkField<Instant> OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD = SdkField
238             .<Instant> builder(MarshallingType.INSTANT)
239             .getter(getter(HeadObjectResponse::objectLockRetainUntilDate))
240             .setter(setter(Builder::objectLockRetainUntilDate))
241             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-retain-until-date")
242                     .unmarshallLocationName("x-amz-object-lock-retain-until-date").build(),
243                     TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
244
245     private static final SdkField<String> OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD = SdkField
246             .<String> builder(MarshallingType.STRING)
247             .getter(getter(HeadObjectResponse::objectLockLegalHoldStatusAsString))
248             .setter(setter(Builder::objectLockLegalHoldStatus))
249             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-legal-hold")
250                     .unmarshallLocationName("x-amz-object-lock-legal-hold").build()).build();
251
252     private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DELETE_MARKER_FIELD,
253             ACCEPT_RANGES_FIELD, EXPIRATION_FIELD, RESTORE_FIELD, LAST_MODIFIED_FIELD, CONTENT_LENGTH_FIELD, E_TAG_FIELD,
254             MISSING_META_FIELD, VERSION_ID_FIELD, CACHE_CONTROL_FIELD, CONTENT_DISPOSITION_FIELD, CONTENT_ENCODING_FIELD,
255             CONTENT_LANGUAGE_FIELD, CONTENT_TYPE_FIELD, EXPIRES_FIELD, WEBSITE_REDIRECT_LOCATION_FIELD,
256             SERVER_SIDE_ENCRYPTION_FIELD, METADATA_FIELD, SSE_CUSTOMER_ALGORITHM_FIELD, SSE_CUSTOMER_KEY_MD5_FIELD,
257             SSEKMS_KEY_ID_FIELD, STORAGE_CLASS_FIELD, REQUEST_CHARGED_FIELD, REPLICATION_STATUS_FIELD, PARTS_COUNT_FIELD,
258             OBJECT_LOCK_MODE_FIELD, OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD, OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD));
259
260     private final Boolean deleteMarker;
261
262     private final String acceptRanges;
263
264     private final String expiration;
265
266     private final String restore;
267
268     private final Instant lastModified;
269
270     private final Long contentLength;
271
272     private final String eTag;
273
274     private final Integer missingMeta;
275
276     private final String versionId;
277
278     private final String cacheControl;
279
280     private final String contentDisposition;
281
282     private final String contentEncoding;
283
284     private final String contentLanguage;
285
286     private final String contentType;
287
288     private final Instant expires;
289
290     private final String websiteRedirectLocation;
291
292     private final String serverSideEncryption;
293
294     private final Map<String, String> metadata;
295
296     private final String sseCustomerAlgorithm;
297
298     private final String sseCustomerKeyMD5;
299
300     private final String ssekmsKeyId;
301
302     private final String storageClass;
303
304     private final String requestCharged;
305
306     private final String replicationStatus;
307
308     private final Integer partsCount;
309
310     private final String objectLockMode;
311
312     private final Instant objectLockRetainUntilDate;
313
314     private final String objectLockLegalHoldStatus;
315
316     private HeadObjectResponse(BuilderImpl builder) {
317         super(builder);
318         this.deleteMarker = builder.deleteMarker;
319         this.acceptRanges = builder.acceptRanges;
320         this.expiration = builder.expiration;
321         this.restore = builder.restore;
322         this.lastModified = builder.lastModified;
323         this.contentLength = builder.contentLength;
324         this.eTag = builder.eTag;
325         this.missingMeta = builder.missingMeta;
326         this.versionId = builder.versionId;
327         this.cacheControl = builder.cacheControl;
328         this.contentDisposition = builder.contentDisposition;
329         this.contentEncoding = builder.contentEncoding;
330         this.contentLanguage = builder.contentLanguage;
331         this.contentType = builder.contentType;
332         this.expires = builder.expires;
333         this.websiteRedirectLocation = builder.websiteRedirectLocation;
334         this.serverSideEncryption = builder.serverSideEncryption;
335         this.metadata = builder.metadata;
336         this.sseCustomerAlgorithm = builder.sseCustomerAlgorithm;
337         this.sseCustomerKeyMD5 = builder.sseCustomerKeyMD5;
338         this.ssekmsKeyId = builder.ssekmsKeyId;
339         this.storageClass = builder.storageClass;
340         this.requestCharged = builder.requestCharged;
341         this.replicationStatus = builder.replicationStatus;
342         this.partsCount = builder.partsCount;
343         this.objectLockMode = builder.objectLockMode;
344         this.objectLockRetainUntilDate = builder.objectLockRetainUntilDate;
345         this.objectLockLegalHoldStatus = builder.objectLockLegalHoldStatus;
346     }
347
348     /**
349      * <p>
350      * Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If falsethis response
351      * header does not appear in the response.
352      * </p>
353      * 
354      * @return Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If falsethis
355      *         response header does not appear in the response.
356      */

357     public Boolean deleteMarker() {
358         return deleteMarker;
359     }
360
361     /**
362      * <p>
363      * Indicates that a range of bytes was specified.
364      * </p>
365      * 
366      * @return Indicates that a range of bytes was specified.
367      */

368     public String acceptRanges() {
369         return acceptRanges;
370     }
371
372     /**
373      * <p>
374      * If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes
375      * the expiry-date and rule-id key-value pairs providing object expiration information. The value of the rule-id is
376      * URL encoded.
377      * </p>
378      * 
379      * @return If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It
380      *         includes the expiry-date and rule-id key-value pairs providing object expiration information. The value
381      *         of the rule-id is URL encoded.
382      */

383     public String expiration() {
384         return expiration;
385     }
386
387     /**
388      * <p>
389      * If the object is an archived object (an object whose storage class is GLACIER), the response includes this header
390      * if either the archive restoration is in progress (see <a>RestoreObject</a> or an archive copy is already
391      * restored.
392      * </p>
393      * <p>
394      * If an archive copy is already restored, the header value indicates when Amazon S3 is scheduled to delete the
395      * object copy. For example:
396      * </p>
397      * <p>
398      * <code>x-amz-restore: ongoing-request="false", expiry-date="Fri, 23 Dec 2012 00:00:00 GMT"</code>
399      * </p>
400      * <p>
401      * If the object restoration is in progress, the header returns the value <code>ongoing-request="true"</code>.
402      * </p>
403      * <p>
404      * For more information about archiving objects, see <a href=
405      * "https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations"
406      * >Transitioning Objects: General Considerations</a>.
407      * </p>
408      * 
409      * @return If the object is an archived object (an object whose storage class is GLACIER), the response includes
410      *         this header if either the archive restoration is in progress (see <a>RestoreObject</a> or an archive copy
411      *         is already restored.</p>
412      *         <p>
413      *         If an archive copy is already restored, the header value indicates when Amazon S3 is scheduled to delete
414      *         the object copy. For example:
415      *         </p>
416      *         <p>
417      *         <code>x-amz-restore: ongoing-request="false", expiry-date="Fri, 23 Dec 2012 00:00:00 GMT"</code>
418      *         </p>
419      *         <p>
420      *         If the object restoration is in progress, the header returns the value
421      *         <code>ongoing-request="true"</code>.
422      *         </p>
423      *         <p>
424      *         For more information about archiving objects, see <a href=
425      *         "https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations"
426      *         >Transitioning Objects: General Considerations</a>.
427      */

428     public String restore() {
429         return restore;
430     }
431
432     /**
433      * <p>
434      * Last modified date of the object
435      * </p>
436      * 
437      * @return Last modified date of the object
438      */

439     public Instant lastModified() {
440         return lastModified;
441     }
442
443     /**
444      * <p>
445      * Size of the body in bytes.
446      * </p>
447      * 
448      * @return Size of the body in bytes.
449      */

450     public Long contentLength() {
451         return contentLength;
452     }
453
454     /**
455      * <p>
456      * An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.
457      * </p>
458      * 
459      * @return An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a
460      *         URL.
461      */

462     public String eTag() {
463         return eTag;
464     }
465
466     /**
467      * <p>
468      * This is set to the number of metadata entries not returned in <code>x-amz-meta</code> headers. This can happen if
469      * you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example,
470      * using SOAP, you can create metadata whose values are not legal HTTP headers.
471      * </p>
472      * 
473      * @return This is set to the number of metadata entries not returned in <code>x-amz-meta</code> headers. This can
474      *         happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST
475      *         API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
476      */

477     public Integer missingMeta() {
478         return missingMeta;
479     }
480
481     /**
482      * <p>
483      * Version of the object.
484      * </p>
485      * 
486      * @return Version of the object.
487      */

488     public String versionId() {
489         return versionId;
490     }
491
492     /**
493      * <p>
494      * Specifies caching behavior along the request/reply chain.
495      * </p>
496      * 
497      * @return Specifies caching behavior along the request/reply chain.
498      */

499     public String cacheControl() {
500         return cacheControl;
501     }
502
503     /**
504      * <p>
505      * Specifies presentational information for the object.
506      * </p>
507      * 
508      * @return Specifies presentational information for the object.
509      */

510     public String contentDisposition() {
511         return contentDisposition;
512     }
513
514     /**
515      * <p>
516      * Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be
517      * applied to obtain the media-type referenced by the Content-Type header field.
518      * </p>
519      * 
520      * @return Specifies what content encodings have been applied to the object and thus what decoding mechanisms must
521      *         be applied to obtain the media-type referenced by the Content-Type header field.
522      */

523     public String contentEncoding() {
524         return contentEncoding;
525     }
526
527     /**
528      * <p>
529      * The language the content is in.
530      * </p>
531      * 
532      * @return The language the content is in.
533      */

534     public String contentLanguage() {
535         return contentLanguage;
536     }
537
538     /**
539      * <p>
540      * A standard MIME type describing the format of the object data.
541      * </p>
542      * 
543      * @return A standard MIME type describing the format of the object data.
544      */

545     public String contentType() {
546         return contentType;
547     }
548
549     /**
550      * <p>
551      * The date and time at which the object is no longer cacheable.
552      * </p>
553      * 
554      * @return The date and time at which the object is no longer cacheable.
555      */

556     public Instant expires() {
557         return expires;
558     }
559
560     /**
561      * <p>
562      * If the bucket is configured as a website, redirects requests for this object to another object in the same bucket
563      * or to an external URL. Amazon S3 stores the value of this header in the object metadata.
564      * </p>
565      * 
566      * @return If the bucket is configured as a website, redirects requests for this object to another object in the
567      *         same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
568      */

569     public String websiteRedirectLocation() {
570         return websiteRedirectLocation;
571     }
572
573     /**
574      * <p>
575      * If the object is stored using server-side encryption either with an AWS KMS customer master key (CMK) or an
576      * Amazon S3-managed encryption key, the response includes this header with the value of the server-side encryption
577      * algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
578      * </p>
579      * <p>
580      * If the service returns an enum value that is not available in the current SDK version,
581      * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value
582      * returned by the service is available from {@link #serverSideEncryptionAsString}.
583      * </p>
584      * 
585      * @return If the object is stored using server-side encryption either with an AWS KMS customer master key (CMK) or
586      *         an Amazon S3-managed encryption key, the response includes this header with the value of the server-side
587      *         encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
588      * @see ServerSideEncryption
589      */

590     public ServerSideEncryption serverSideEncryption() {
591         return ServerSideEncryption.fromValue(serverSideEncryption);
592     }
593
594     /**
595      * <p>
596      * If the object is stored using server-side encryption either with an AWS KMS customer master key (CMK) or an
597      * Amazon S3-managed encryption key, the response includes this header with the value of the server-side encryption
598      * algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
599      * </p>
600      * <p>
601      * If the service returns an enum value that is not available in the current SDK version,
602      * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value
603      * returned by the service is available from {@link #serverSideEncryptionAsString}.
604      * </p>
605      * 
606      * @return If the object is stored using server-side encryption either with an AWS KMS customer master key (CMK) or
607      *         an Amazon S3-managed encryption key, the response includes this header with the value of the server-side
608      *         encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
609      * @see ServerSideEncryption
610      */

611     public String serverSideEncryptionAsString() {
612         return serverSideEncryption;
613     }
614
615     /**
616      * Returns true if the Metadata property was specified by the sender (it may be empty), or false if the sender did
617      * not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
618      */

619     public boolean hasMetadata() {
620         return metadata != null && !(metadata instanceof SdkAutoConstructMap);
621     }
622
623     /**
624      * <p>
625      * A map of metadata to store with the object in S3.
626      * </p>
627      * <p>
628      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
629      * </p>
630      * <p>
631      * You can use {@link #hasMetadata()} to see if a value was sent in this field.
632      * </p>
633      * 
634      * @return A map of metadata to store with the object in S3.
635      */

636     public Map<String, String> metadata() {
637         return metadata;
638     }
639
640     /**
641      * <p>
642      * If server-side encryption with a customer-provided encryption key was requested, the response will include this
643      * header confirming the encryption algorithm used.
644      * </p>
645      * 
646      * @return If server-side encryption with a customer-provided encryption key was requested, the response will
647      *         include this header confirming the encryption algorithm used.
648      */

649     public String sseCustomerAlgorithm() {
650         return sseCustomerAlgorithm;
651     }
652
653     /**
654      * <p>
655      * If server-side encryption with a customer-provided encryption key was requested, the response will include this
656      * header to provide round-trip message integrity verification of the customer-provided encryption key.
657      * </p>
658      * 
659      * @return If server-side encryption with a customer-provided encryption key was requested, the response will
660      *         include this header to provide round-trip message integrity verification of the customer-provided
661      *         encryption key.
662      */

663     public String sseCustomerKeyMD5() {
664         return sseCustomerKeyMD5;
665     }
666
667     /**
668      * <p>
669      * If present, specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed customer
670      * master key (CMK) that was used for the object.
671      * </p>
672      * 
673      * @return If present, specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed
674      *         customer master key (CMK) that was used for the object.
675      */

676     public String ssekmsKeyId() {
677         return ssekmsKeyId;
678     }
679
680     /**
681      * <p>
682      * Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3
683      * Standard storage class objects.
684      * </p>
685      * <p>
686      * For more information, see <a
687      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a>.
688      * </p>
689      * <p>
690      * If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will
691      * return {@link StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
692      * {@link #storageClassAsString}.
693      * </p>
694      * 
695      * @return Provides storage class information of the object. Amazon S3 returns this header for all objects except
696      *         for S3 Standard storage class objects.</p>
697      *         <p>
698      *         For more information, see <a
699      *         href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a>.
700      * @see StorageClass
701      */

702     public StorageClass storageClass() {
703         return StorageClass.fromValue(storageClass);
704     }
705
706     /**
707      * <p>
708      * Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3
709      * Standard storage class objects.
710      * </p>
711      * <p>
712      * For more information, see <a
713      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a>.
714      * </p>
715      * <p>
716      * If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will
717      * return {@link StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
718      * {@link #storageClassAsString}.
719      * </p>
720      * 
721      * @return Provides storage class information of the object. Amazon S3 returns this header for all objects except
722      *         for S3 Standard storage class objects.</p>
723      *         <p>
724      *         For more information, see <a
725      *         href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a>.
726      * @see StorageClass
727      */

728     public String storageClassAsString() {
729         return storageClass;
730     }
731
732     /**
733      * Returns the value of the RequestCharged property for this object.
734      * <p>
735      * If the service returns an enum value that is not available in the current SDK version, {@link #requestCharged}
736      * will return {@link RequestCharged#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
737      * from {@link #requestChargedAsString}.
738      * </p>
739      * 
740      * @return The value of the RequestCharged property for this object.
741      * @see RequestCharged
742      */

743     public RequestCharged requestCharged() {
744         return RequestCharged.fromValue(requestCharged);
745     }
746
747     /**
748      * Returns the value of the RequestCharged property for this object.
749      * <p>
750      * If the service returns an enum value that is not available in the current SDK version, {@link #requestCharged}
751      * will return {@link RequestCharged#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
752      * from {@link #requestChargedAsString}.
753      * </p>
754      * 
755      * @return The value of the RequestCharged property for this object.
756      * @see RequestCharged
757      */

758     public String requestChargedAsString() {
759         return requestCharged;
760     }
761
762     /**
763      * <p>
764      * Amazon S3 can return this header if your request involves a bucket that is either a source or destination in a
765      * replication rule.
766      * </p>
767      * <p>
768      * In replication, you have a source bucket on which you configure replication and destination bucket where Amazon
769      * S3 stores object replicas. When you request an object (<code>GetObject</code>) or object metadata (
770      * <code>HeadObject</code>) from these buckets, Amazon S3 will return the <code>x-amz-replication-status</code>
771      * header in the response as follows:
772      * </p>
773      * <ul>
774      * <li>
775      * <p>
776      * If requesting an object from the source bucket â€” Amazon S3 will return the <code>x-amz-replication-status</code>
777      * header if the object in your request is eligible for replication.
778      * </p>
779      * <p>
780      * For example, suppose that in your replication configuration, you specify object prefix <code>TaxDocs</code>
781      * requesting Amazon S3 to replicate objects with key prefix <code>TaxDocs</code>. Any objects you upload with this
782      * key name prefix, for example <code>TaxDocs/document1.pdf</code>, are eligible for replication. For any object
783      * request with this key name prefix, Amazon S3 will return the <code>x-amz-replication-status</code> header with
784      * value PENDING, COMPLETED or FAILED indicating object replication status.
785      * </p>
786      * </li>
787      * <li>
788      * <p>
789      * If requesting an object from the destination bucket â€” Amazon S3 will return the
790      * <code>x-amz-replication-status</code> header with value REPLICA if the object in your request is a replica that
791      * Amazon S3 created.
792      * </p>
793      * </li>
794      * </ul>
795      * <p>
796      * For more information, see <a
797      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Replication</a>.
798      * </p>
799      * <p>
800      * If the service returns an enum value that is not available in the current SDK version, {@link #replicationStatus}
801      * will return {@link ReplicationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
802      * from {@link #replicationStatusAsString}.
803      * </p>
804      * 
805      * @return Amazon S3 can return this header if your request involves a bucket that is either a source or destination
806      *         in a replication rule.</p>
807      *         <p>
808      *         In replication, you have a source bucket on which you configure replication and destination bucket where
809      *         Amazon S3 stores object replicas. When you request an object (<code>GetObject</code>) or object metadata
810      *         (<code>HeadObject</code>) from these buckets, Amazon S3 will return the
811      *         <code>x-amz-replication-status</code> header in the response as follows:
812      *         </p>
813      *         <ul>
814      *         <li>
815      *         <p>
816      *         If requesting an object from the source bucket â€” Amazon S3 will return the
817      *         <code>x-amz-replication-status</code> header if the object in your request is eligible for replication.
818      *         </p>
819      *         <p>
820      *         For example, suppose that in your replication configuration, you specify object prefix
821      *         <code>TaxDocs</code> requesting Amazon S3 to replicate objects with key prefix <code>TaxDocs</code>. Any
822      *         objects you upload with this key name prefix, for example <code>TaxDocs/document1.pdf</code>, are
823      *         eligible for replication. For any object request with this key name prefix, Amazon S3 will return the
824      *         <code>x-amz-replication-status</code> header with value PENDING, COMPLETED or FAILED indicating object
825      *         replication status.
826      *         </p>
827      *         </li>
828      *         <li>
829      *         <p>
830      *         If requesting an object from the destination bucket â€” Amazon S3 will return the
831      *         <code>x-amz-replication-status</code> header with value REPLICA if the object in your request is a
832      *         replica that Amazon S3 created.
833      *         </p>
834      *         </li>
835      *         </ul>
836      *         <p>
837      *         For more information, see <a
838      *         href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Replication</a>.
839      * @see ReplicationStatus
840      */

841     public ReplicationStatus replicationStatus() {
842         return ReplicationStatus.fromValue(replicationStatus);
843     }
844
845     /**
846      * <p>
847      * Amazon S3 can return this header if your request involves a bucket that is either a source or destination in a
848      * replication rule.
849      * </p>
850      * <p>
851      * In replication, you have a source bucket on which you configure replication and destination bucket where Amazon
852      * S3 stores object replicas. When you request an object (<code>GetObject</code>) or object metadata (
853      * <code>HeadObject</code>) from these buckets, Amazon S3 will return the <code>x-amz-replication-status</code>
854      * header in the response as follows:
855      * </p>
856      * <ul>
857      * <li>
858      * <p>
859      * If requesting an object from the source bucket â€” Amazon S3 will return the <code>x-amz-replication-status</code>
860      * header if the object in your request is eligible for replication.
861      * </p>
862      * <p>
863      * For example, suppose that in your replication configuration, you specify object prefix <code>TaxDocs</code>
864      * requesting Amazon S3 to replicate objects with key prefix <code>TaxDocs</code>. Any objects you upload with this
865      * key name prefix, for example <code>TaxDocs/document1.pdf</code>, are eligible for replication. For any object
866      * request with this key name prefix, Amazon S3 will return the <code>x-amz-replication-status</code> header with
867      * value PENDING, COMPLETED or FAILED indicating object replication status.
868      * </p>
869      * </li>
870      * <li>
871      * <p>
872      * If requesting an object from the destination bucket â€” Amazon S3 will return the
873      * <code>x-amz-replication-status</code> header with value REPLICA if the object in your request is a replica that
874      * Amazon S3 created.
875      * </p>
876      * </li>
877      * </ul>
878      * <p>
879      * For more information, see <a
880      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Replication</a>.
881      * </p>
882      * <p>
883      * If the service returns an enum value that is not available in the current SDK version, {@link #replicationStatus}
884      * will return {@link ReplicationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
885      * from {@link #replicationStatusAsString}.
886      * </p>
887      * 
888      * @return Amazon S3 can return this header if your request involves a bucket that is either a source or destination
889      *         in a replication rule.</p>
890      *         <p>
891      *         In replication, you have a source bucket on which you configure replication and destination bucket where
892      *         Amazon S3 stores object replicas. When you request an object (<code>GetObject</code>) or object metadata
893      *         (<code>HeadObject</code>) from these buckets, Amazon S3 will return the
894      *         <code>x-amz-replication-status</code> header in the response as follows:
895      *         </p>
896      *         <ul>
897      *         <li>
898      *         <p>
899      *         If requesting an object from the source bucket â€” Amazon S3 will return the
900      *         <code>x-amz-replication-status</code> header if the object in your request is eligible for replication.
901      *         </p>
902      *         <p>
903      *         For example, suppose that in your replication configuration, you specify object prefix
904      *         <code>TaxDocs</code> requesting Amazon S3 to replicate objects with key prefix <code>TaxDocs</code>. Any
905      *         objects you upload with this key name prefix, for example <code>TaxDocs/document1.pdf</code>, are
906      *         eligible for replication. For any object request with this key name prefix, Amazon S3 will return the
907      *         <code>x-amz-replication-status</code> header with value PENDING, COMPLETED or FAILED indicating object
908      *         replication status.
909      *         </p>
910      *         </li>
911      *         <li>
912      *         <p>
913      *         If requesting an object from the destination bucket â€” Amazon S3 will return the
914      *         <code>x-amz-replication-status</code> header with value REPLICA if the object in your request is a
915      *         replica that Amazon S3 created.
916      *         </p>
917      *         </li>
918      *         </ul>
919      *         <p>
920      *         For more information, see <a
921      *         href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Replication</a>.
922      * @see ReplicationStatus
923      */

924     public String replicationStatusAsString() {
925         return replicationStatus;
926     }
927
928     /**
929      * <p>
930      * The count of parts this object has.
931      * </p>
932      * 
933      * @return The count of parts this object has.
934      */

935     public Integer partsCount() {
936         return partsCount;
937     }
938
939     /**
940      * <p>
941      * The Object Lock mode, if any, that's in effect for this object. This header is only returned if the requester has
942      * the <code>s3:GetObjectRetention</code> permission. For more information about S3 Object Lock, see <a
943      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
944      * </p>
945      * <p>
946      * If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode}
947      * will return {@link ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
948      * from {@link #objectLockModeAsString}.
949      * </p>
950      * 
951      * @return The Object Lock mode, if any, that's in effect for this object. This header is only returned if the
952      *         requester has the <code>s3:GetObjectRetention</code> permission. For more information about S3 Object
953      *         Lock, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
954      * @see ObjectLockMode
955      */

956     public ObjectLockMode objectLockMode() {
957         return ObjectLockMode.fromValue(objectLockMode);
958     }
959
960     /**
961      * <p>
962      * The Object Lock mode, if any, that's in effect for this object. This header is only returned if the requester has
963      * the <code>s3:GetObjectRetention</code> permission. For more information about S3 Object Lock, see <a
964      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
965      * </p>
966      * <p>
967      * If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode}
968      * will return {@link ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
969      * from {@link #objectLockModeAsString}.
970      * </p>
971      * 
972      * @return The Object Lock mode, if any, that's in effect for this object. This header is only returned if the
973      *         requester has the <code>s3:GetObjectRetention</code> permission. For more information about S3 Object
974      *         Lock, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
975      * @see ObjectLockMode
976      */

977     public String objectLockModeAsString() {
978         return objectLockMode;
979     }
980
981     /**
982      * <p>
983      * The date and time when the Object Lock retention period expires. This header is only returned if the requester
984      * has the <code>s3:GetObjectRetention</code> permission.
985      * </p>
986      * 
987      * @return The date and time when the Object Lock retention period expires. This header is only returned if the
988      *         requester has the <code>s3:GetObjectRetention</code> permission.
989      */

990     public Instant objectLockRetainUntilDate() {
991         return objectLockRetainUntilDate;
992     }
993
994     /**
995      * <p>
996      * Specifies whether a legal hold is in effect for this object. This header is only returned if the requester has
997      * the <code>s3:GetObjectLegalHold</code> permission. This header is not returned if the specified version of this
998      * object has never had a legal hold applied. For more information about S3 Object Lock, see <a
999      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1000      * </p>
1001      * <p>
1002      * If the service returns an enum value that is not available in the current SDK version,
1003      * {@link #objectLockLegalHoldStatus} will return {@link ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The raw
1004      * value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}.
1005      * </p>
1006      * 
1007      * @return Specifies whether a legal hold is in effect for this object. This header is only returned if the
1008      *         requester has the <code>s3:GetObjectLegalHold</code> permission. This header is not returned if the
1009      *         specified version of this object has never had a legal hold applied. For more information about S3 Object
1010      *         Lock, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1011      * @see ObjectLockLegalHoldStatus
1012      */

1013     public ObjectLockLegalHoldStatus objectLockLegalHoldStatus() {
1014         return ObjectLockLegalHoldStatus.fromValue(objectLockLegalHoldStatus);
1015     }
1016
1017     /**
1018      * <p>
1019      * Specifies whether a legal hold is in effect for this object. This header is only returned if the requester has
1020      * the <code>s3:GetObjectLegalHold</code> permission. This header is not returned if the specified version of this
1021      * object has never had a legal hold applied. For more information about S3 Object Lock, see <a
1022      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1023      * </p>
1024      * <p>
1025      * If the service returns an enum value that is not available in the current SDK version,
1026      * {@link #objectLockLegalHoldStatus} will return {@link ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The raw
1027      * value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}.
1028      * </p>
1029      * 
1030      * @return Specifies whether a legal hold is in effect for this object. This header is only returned if the
1031      *         requester has the <code>s3:GetObjectLegalHold</code> permission. This header is not returned if the
1032      *         specified version of this object has never had a legal hold applied. For more information about S3 Object
1033      *         Lock, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1034      * @see ObjectLockLegalHoldStatus
1035      */

1036     public String objectLockLegalHoldStatusAsString() {
1037         return objectLockLegalHoldStatus;
1038     }
1039
1040     @Override
1041     public Builder toBuilder() {
1042         return new BuilderImpl(this);
1043     }
1044
1045     public static Builder builder() {
1046         return new BuilderImpl();
1047     }
1048
1049     public static Class<? extends Builder> serializableBuilderClass() {
1050         return BuilderImpl.class;
1051     }
1052
1053     @Override
1054     public int hashCode() {
1055         int hashCode = 1;
1056         hashCode = 31 * hashCode + super.hashCode();
1057         hashCode = 31 * hashCode + Objects.hashCode(deleteMarker());
1058         hashCode = 31 * hashCode + Objects.hashCode(acceptRanges());
1059         hashCode = 31 * hashCode + Objects.hashCode(expiration());
1060         hashCode = 31 * hashCode + Objects.hashCode(restore());
1061         hashCode = 31 * hashCode + Objects.hashCode(lastModified());
1062         hashCode = 31 * hashCode + Objects.hashCode(contentLength());
1063         hashCode = 31 * hashCode + Objects.hashCode(eTag());
1064         hashCode = 31 * hashCode + Objects.hashCode(missingMeta());
1065         hashCode = 31 * hashCode + Objects.hashCode(versionId());
1066         hashCode = 31 * hashCode + Objects.hashCode(cacheControl());
1067         hashCode = 31 * hashCode + Objects.hashCode(contentDisposition());
1068         hashCode = 31 * hashCode + Objects.hashCode(contentEncoding());
1069         hashCode = 31 * hashCode + Objects.hashCode(contentLanguage());
1070         hashCode = 31 * hashCode + Objects.hashCode(contentType());
1071         hashCode = 31 * hashCode + Objects.hashCode(expires());
1072         hashCode = 31 * hashCode + Objects.hashCode(websiteRedirectLocation());
1073         hashCode = 31 * hashCode + Objects.hashCode(serverSideEncryptionAsString());
1074         hashCode = 31 * hashCode + Objects.hashCode(metadata());
1075         hashCode = 31 * hashCode + Objects.hashCode(sseCustomerAlgorithm());
1076         hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKeyMD5());
1077         hashCode = 31 * hashCode + Objects.hashCode(ssekmsKeyId());
1078         hashCode = 31 * hashCode + Objects.hashCode(storageClassAsString());
1079         hashCode = 31 * hashCode + Objects.hashCode(requestChargedAsString());
1080         hashCode = 31 * hashCode + Objects.hashCode(replicationStatusAsString());
1081         hashCode = 31 * hashCode + Objects.hashCode(partsCount());
1082         hashCode = 31 * hashCode + Objects.hashCode(objectLockModeAsString());
1083         hashCode = 31 * hashCode + Objects.hashCode(objectLockRetainUntilDate());
1084         hashCode = 31 * hashCode + Objects.hashCode(objectLockLegalHoldStatusAsString());
1085         return hashCode;
1086     }
1087
1088     @Override
1089     public boolean equals(Object obj) {
1090         return super.equals(obj) && equalsBySdkFields(obj);
1091     }
1092
1093     @Override
1094     public boolean equalsBySdkFields(Object obj) {
1095         if (this == obj) {
1096             return true;
1097         }
1098         if (obj == null) {
1099             return false;
1100         }
1101         if (!(obj instanceof HeadObjectResponse)) {
1102             return false;
1103         }
1104         HeadObjectResponse other = (HeadObjectResponse) obj;
1105         return Objects.equals(deleteMarker(), other.deleteMarker()) && Objects.equals(acceptRanges(), other.acceptRanges())
1106                 && Objects.equals(expiration(), other.expiration()) && Objects.equals(restore(), other.restore())
1107                 && Objects.equals(lastModified(), other.lastModified()) && Objects.equals(contentLength(), other.contentLength())
1108                 && Objects.equals(eTag(), other.eTag()) && Objects.equals(missingMeta(), other.missingMeta())
1109                 && Objects.equals(versionId(), other.versionId()) && Objects.equals(cacheControl(), other.cacheControl())
1110                 && Objects.equals(contentDisposition(), other.contentDisposition())
1111                 && Objects.equals(contentEncoding(), other.contentEncoding())
1112                 && Objects.equals(contentLanguage(), other.contentLanguage())
1113                 && Objects.equals(contentType(), other.contentType()) && Objects.equals(expires(), other.expires())
1114                 && Objects.equals(websiteRedirectLocation(), other.websiteRedirectLocation())
1115                 && Objects.equals(serverSideEncryptionAsString(), other.serverSideEncryptionAsString())
1116                 && Objects.equals(metadata(), other.metadata())
1117                 && Objects.equals(sseCustomerAlgorithm(), other.sseCustomerAlgorithm())
1118                 && Objects.equals(sseCustomerKeyMD5(), other.sseCustomerKeyMD5())
1119                 && Objects.equals(ssekmsKeyId(), other.ssekmsKeyId())
1120                 && Objects.equals(storageClassAsString(), other.storageClassAsString())
1121                 && Objects.equals(requestChargedAsString(), other.requestChargedAsString())
1122                 && Objects.equals(replicationStatusAsString(), other.replicationStatusAsString())
1123                 && Objects.equals(partsCount(), other.partsCount())
1124                 && Objects.equals(objectLockModeAsString(), other.objectLockModeAsString())
1125                 && Objects.equals(objectLockRetainUntilDate(), other.objectLockRetainUntilDate())
1126                 && Objects.equals(objectLockLegalHoldStatusAsString(), other.objectLockLegalHoldStatusAsString());
1127     }
1128
1129     /**
1130      * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
1131      * redacted from this string using a placeholder value.
1132      */

1133     @Override
1134     public String toString() {
1135         return ToString.builder("HeadObjectResponse").add("DeleteMarker", deleteMarker()).add("AcceptRanges", acceptRanges())
1136                 .add("Expiration", expiration()).add("Restore", restore()).add("LastModified", lastModified())
1137                 .add("ContentLength", contentLength()).add("ETag", eTag()).add("MissingMeta", missingMeta())
1138                 .add("VersionId", versionId()).add("CacheControl", cacheControl())
1139                 .add("ContentDisposition", contentDisposition()).add("ContentEncoding", contentEncoding())
1140                 .add("ContentLanguage", contentLanguage()).add("ContentType", contentType()).add("Expires", expires())
1141                 .add("WebsiteRedirectLocation", websiteRedirectLocation())
1142                 .add("ServerSideEncryption", serverSideEncryptionAsString()).add("Metadata", metadata())
1143                 .add("SSECustomerAlgorithm", sseCustomerAlgorithm()).add("SSECustomerKeyMD5", sseCustomerKeyMD5())
1144                 .add("SSEKMSKeyId", ssekmsKeyId() == null ? null : "*** Sensitive Data Redacted ***")
1145                 .add("StorageClass", storageClassAsString()).add("RequestCharged", requestChargedAsString())
1146                 .add("ReplicationStatus", replicationStatusAsString()).add("PartsCount", partsCount())
1147                 .add("ObjectLockMode", objectLockModeAsString()).add("ObjectLockRetainUntilDate", objectLockRetainUntilDate())
1148                 .add("ObjectLockLegalHoldStatus", objectLockLegalHoldStatusAsString()).build();
1149     }
1150
1151     public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
1152         switch (fieldName) {
1153         case "DeleteMarker":
1154             return Optional.ofNullable(clazz.cast(deleteMarker()));
1155         case "AcceptRanges":
1156             return Optional.ofNullable(clazz.cast(acceptRanges()));
1157         case "Expiration":
1158             return Optional.ofNullable(clazz.cast(expiration()));
1159         case "Restore":
1160             return Optional.ofNullable(clazz.cast(restore()));
1161         case "LastModified":
1162             return Optional.ofNullable(clazz.cast(lastModified()));
1163         case "ContentLength":
1164             return Optional.ofNullable(clazz.cast(contentLength()));
1165         case "ETag":
1166             return Optional.ofNullable(clazz.cast(eTag()));
1167         case "MissingMeta":
1168             return Optional.ofNullable(clazz.cast(missingMeta()));
1169         case "VersionId":
1170             return Optional.ofNullable(clazz.cast(versionId()));
1171         case "CacheControl":
1172             return Optional.ofNullable(clazz.cast(cacheControl()));
1173         case "ContentDisposition":
1174             return Optional.ofNullable(clazz.cast(contentDisposition()));
1175         case "ContentEncoding":
1176             return Optional.ofNullable(clazz.cast(contentEncoding()));
1177         case "ContentLanguage":
1178             return Optional.ofNullable(clazz.cast(contentLanguage()));
1179         case "ContentType":
1180             return Optional.ofNullable(clazz.cast(contentType()));
1181         case "Expires":
1182             return Optional.ofNullable(clazz.cast(expires()));
1183         case "WebsiteRedirectLocation":
1184             return Optional.ofNullable(clazz.cast(websiteRedirectLocation()));
1185         case "ServerSideEncryption":
1186             return Optional.ofNullable(clazz.cast(serverSideEncryptionAsString()));
1187         case "Metadata":
1188             return Optional.ofNullable(clazz.cast(metadata()));
1189         case "SSECustomerAlgorithm":
1190             return Optional.ofNullable(clazz.cast(sseCustomerAlgorithm()));
1191         case "SSECustomerKeyMD5":
1192             return Optional.ofNullable(clazz.cast(sseCustomerKeyMD5()));
1193         case "SSEKMSKeyId":
1194             return Optional.ofNullable(clazz.cast(ssekmsKeyId()));
1195         case "StorageClass":
1196             return Optional.ofNullable(clazz.cast(storageClassAsString()));
1197         case "RequestCharged":
1198             return Optional.ofNullable(clazz.cast(requestChargedAsString()));
1199         case "ReplicationStatus":
1200             return Optional.ofNullable(clazz.cast(replicationStatusAsString()));
1201         case "PartsCount":
1202             return Optional.ofNullable(clazz.cast(partsCount()));
1203         case "ObjectLockMode":
1204             return Optional.ofNullable(clazz.cast(objectLockModeAsString()));
1205         case "ObjectLockRetainUntilDate":
1206             return Optional.ofNullable(clazz.cast(objectLockRetainUntilDate()));
1207         case "ObjectLockLegalHoldStatus":
1208             return Optional.ofNullable(clazz.cast(objectLockLegalHoldStatusAsString()));
1209         default:
1210             return Optional.empty();
1211         }
1212     }
1213
1214     @Override
1215     public List<SdkField<?>> sdkFields() {
1216         return SDK_FIELDS;
1217     }
1218
1219     private static <T> Function<Object, T> getter(Function<HeadObjectResponse, T> g) {
1220         return obj -> g.apply((HeadObjectResponse) obj);
1221     }
1222
1223     private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
1224         return (obj, val) -> s.accept((Builder) obj, val);
1225     }
1226
1227     public interface Builder extends S3Response.Builder, SdkPojo, CopyableBuilder<Builder, HeadObjectResponse> {
1228         /**
1229          * <p>
1230          * Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If falsethis response
1231          * header does not appear in the response.
1232          * </p>
1233          * 
1234          * @param deleteMarker
1235          *        Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If falsethis
1236          *        response header does not appear in the response.
1237          * @return Returns a reference to this object so that method calls can be chained together.
1238          */

1239         Builder deleteMarker(Boolean deleteMarker);
1240
1241         /**
1242          * <p>
1243          * Indicates that a range of bytes was specified.
1244          * </p>
1245          * 
1246          * @param acceptRanges
1247          *        Indicates that a range of bytes was specified.
1248          * @return Returns a reference to this object so that method calls can be chained together.
1249          */

1250         Builder acceptRanges(String acceptRanges);
1251
1252         /**
1253          * <p>
1254          * If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It
1255          * includes the expiry-date and rule-id key-value pairs providing object expiration information. The value of
1256          * the rule-id is URL encoded.
1257          * </p>
1258          * 
1259          * @param expiration
1260          *        If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header.
1261          *        It includes the expiry-date and rule-id key-value pairs providing object expiration information. The
1262          *        value of the rule-id is URL encoded.
1263          * @return Returns a reference to this object so that method calls can be chained together.
1264          */

1265         Builder expiration(String expiration);
1266
1267         /**
1268          * <p>
1269          * If the object is an archived object (an object whose storage class is GLACIER), the response includes this
1270          * header if either the archive restoration is in progress (see <a>RestoreObject</a> or an archive copy is
1271          * already restored.
1272          * </p>
1273          * <p>
1274          * If an archive copy is already restored, the header value indicates when Amazon S3 is scheduled to delete the
1275          * object copy. For example:
1276          * </p>
1277          * <p>
1278          * <code>x-amz-restore: ongoing-request="false", expiry-date="Fri, 23 Dec 2012 00:00:00 GMT"</code>
1279          * </p>
1280          * <p>
1281          * If the object restoration is in progress, the header returns the value <code>ongoing-request="true"</code>.
1282          * </p>
1283          * <p>
1284          * For more information about archiving objects, see <a href=
1285          * "https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations"
1286          * >Transitioning Objects: General Considerations</a>.
1287          * </p>
1288          * 
1289          * @param restore
1290          *        If the object is an archived object (an object whose storage class is GLACIER), the response includes
1291          *        this header if either the archive restoration is in progress (see <a>RestoreObject</a> or an archive
1292          *        copy is already restored.</p>
1293          *        <p>
1294          *        If an archive copy is already restored, the header value indicates when Amazon S3 is scheduled to
1295          *        delete the object copy. For example:
1296          *        </p>
1297          *        <p>
1298          *        <code>x-amz-restore: ongoing-request="false", expiry-date="Fri, 23 Dec 2012 00:00:00 GMT"</code>
1299          *        </p>
1300          *        <p>
1301          *        If the object restoration is in progress, the header returns the value
1302          *        <code>ongoing-request="true"</code>.
1303          *        </p>
1304          *        <p>
1305          *        For more information about archiving objects, see <a href=
1306          *        "https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations"
1307          *        >Transitioning Objects: General Considerations</a>.
1308          * @return Returns a reference to this object so that method calls can be chained together.
1309          */

1310         Builder restore(String restore);
1311
1312         /**
1313          * <p>
1314          * Last modified date of the object
1315          * </p>
1316          * 
1317          * @param lastModified
1318          *        Last modified date of the object
1319          * @return Returns a reference to this object so that method calls can be chained together.
1320          */

1321         Builder lastModified(Instant lastModified);
1322
1323         /**
1324          * <p>
1325          * Size of the body in bytes.
1326          * </p>
1327          * 
1328          * @param contentLength
1329          *        Size of the body in bytes.
1330          * @return Returns a reference to this object so that method calls can be chained together.
1331          */

1332         Builder contentLength(Long contentLength);
1333
1334         /**
1335          * <p>
1336          * An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.
1337          * </p>
1338          * 
1339          * @param eTag
1340          *        An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at
1341          *        a URL.
1342          * @return Returns a reference to this object so that method calls can be chained together.
1343          */

1344         Builder eTag(String eTag);
1345
1346         /**
1347          * <p>
1348          * This is set to the number of metadata entries not returned in <code>x-amz-meta</code> headers. This can
1349          * happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API.
1350          * For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
1351          * </p>
1352          * 
1353          * @param missingMeta
1354          *        This is set to the number of metadata entries not returned in <code>x-amz-meta</code> headers. This
1355          *        can happen if you create metadata using an API like SOAP that supports more flexible metadata than the
1356          *        REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
1357          * @return Returns a reference to this object so that method calls can be chained together.
1358          */

1359         Builder missingMeta(Integer missingMeta);
1360
1361         /**
1362          * <p>
1363          * Version of the object.
1364          * </p>
1365          * 
1366          * @param versionId
1367          *        Version of the object.
1368          * @return Returns a reference to this object so that method calls can be chained together.
1369          */

1370         Builder versionId(String versionId);
1371
1372         /**
1373          * <p>
1374          * Specifies caching behavior along the request/reply chain.
1375          * </p>
1376          * 
1377          * @param cacheControl
1378          *        Specifies caching behavior along the request/reply chain.
1379          * @return Returns a reference to this object so that method calls can be chained together.
1380          */

1381         Builder cacheControl(String cacheControl);
1382
1383         /**
1384          * <p>
1385          * Specifies presentational information for the object.
1386          * </p>
1387          * 
1388          * @param contentDisposition
1389          *        Specifies presentational information for the object.
1390          * @return Returns a reference to this object so that method calls can be chained together.
1391          */

1392         Builder contentDisposition(String contentDisposition);
1393
1394         /**
1395          * <p>
1396          * Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be
1397          * applied to obtain the media-type referenced by the Content-Type header field.
1398          * </p>
1399          * 
1400          * @param contentEncoding
1401          *        Specifies what content encodings have been applied to the object and thus what decoding mechanisms
1402          *        must be applied to obtain the media-type referenced by the Content-Type header field.
1403          * @return Returns a reference to this object so that method calls can be chained together.
1404          */

1405         Builder contentEncoding(String contentEncoding);
1406
1407         /**
1408          * <p>
1409          * The language the content is in.
1410          * </p>
1411          * 
1412          * @param contentLanguage
1413          *        The language the content is in.
1414          * @return Returns a reference to this object so that method calls can be chained together.
1415          */

1416         Builder contentLanguage(String contentLanguage);
1417
1418         /**
1419          * <p>
1420          * A standard MIME type describing the format of the object data.
1421          * </p>
1422          * 
1423          * @param contentType
1424          *        A standard MIME type describing the format of the object data.
1425          * @return Returns a reference to this object so that method calls can be chained together.
1426          */

1427         Builder contentType(String contentType);
1428
1429         /**
1430          * <p>
1431          * The date and time at which the object is no longer cacheable.
1432          * </p>
1433          * 
1434          * @param expires
1435          *        The date and time at which the object is no longer cacheable.
1436          * @return Returns a reference to this object so that method calls can be chained together.
1437          */

1438         Builder expires(Instant expires);
1439
1440         /**
1441          * <p>
1442          * If the bucket is configured as a website, redirects requests for this object to another object in the same
1443          * bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
1444          * </p>
1445          * 
1446          * @param websiteRedirectLocation
1447          *        If the bucket is configured as a website, redirects requests for this object to another object in the
1448          *        same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
1449          * @return Returns a reference to this object so that method calls can be chained together.
1450          */

1451         Builder websiteRedirectLocation(String websiteRedirectLocation);
1452
1453         /**
1454          * <p>
1455          * If the object is stored using server-side encryption either with an AWS KMS customer master key (CMK) or an
1456          * Amazon S3-managed encryption key, the response includes this header with the value of the server-side
1457          * encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
1458          * </p>
1459          * 
1460          * @param serverSideEncryption
1461          *        If the object is stored using server-side encryption either with an AWS KMS customer master key (CMK)
1462          *        or an Amazon S3-managed encryption key, the response includes this header with the value of the
1463          *        server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256,
1464          *        aws:kms).
1465          * @see ServerSideEncryption
1466          * @return Returns a reference to this object so that method calls can be chained together.
1467          * @see ServerSideEncryption
1468          */

1469         Builder serverSideEncryption(String serverSideEncryption);
1470
1471         /**
1472          * <p>
1473          * If the object is stored using server-side encryption either with an AWS KMS customer master key (CMK) or an
1474          * Amazon S3-managed encryption key, the response includes this header with the value of the server-side
1475          * encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
1476          * </p>
1477          * 
1478          * @param serverSideEncryption
1479          *        If the object is stored using server-side encryption either with an AWS KMS customer master key (CMK)
1480          *        or an Amazon S3-managed encryption key, the response includes this header with the value of the
1481          *        server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256,
1482          *        aws:kms).
1483          * @see ServerSideEncryption
1484          * @return Returns a reference to this object so that method calls can be chained together.
1485          * @see ServerSideEncryption
1486          */

1487         Builder serverSideEncryption(ServerSideEncryption serverSideEncryption);
1488
1489         /**
1490          * <p>
1491          * A map of metadata to store with the object in S3.
1492          * </p>
1493          * 
1494          * @param metadata
1495          *        A map of metadata to store with the object in S3.
1496          * @return Returns a reference to this object so that method calls can be chained together.
1497          */

1498         Builder metadata(Map<String, String> metadata);
1499
1500         /**
1501          * <p>
1502          * If server-side encryption with a customer-provided encryption key was requested, the response will include
1503          * this header confirming the encryption algorithm used.
1504          * </p>
1505          * 
1506          * @param sseCustomerAlgorithm
1507          *        If server-side encryption with a customer-provided encryption key was requested, the response will
1508          *        include this header confirming the encryption algorithm used.
1509          * @return Returns a reference to this object so that method calls can be chained together.
1510          */

1511         Builder sseCustomerAlgorithm(String sseCustomerAlgorithm);
1512
1513         /**
1514          * <p>
1515          * If server-side encryption with a customer-provided encryption key was requested, the response will include
1516          * this header to provide round-trip message integrity verification of the customer-provided encryption key.
1517          * </p>
1518          * 
1519          * @param sseCustomerKeyMD5
1520          *        If server-side encryption with a customer-provided encryption key was requested, the response will
1521          *        include this header to provide round-trip message integrity verification of the customer-provided
1522          *        encryption key.
1523          * @return Returns a reference to this object so that method calls can be chained together.
1524          */

1525         Builder sseCustomerKeyMD5(String sseCustomerKeyMD5);
1526
1527         /**
1528          * <p>
1529          * If present, specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed customer
1530          * master key (CMK) that was used for the object.
1531          * </p>
1532          * 
1533          * @param ssekmsKeyId
1534          *        If present, specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed
1535          *        customer master key (CMK) that was used for the object.
1536          * @return Returns a reference to this object so that method calls can be chained together.
1537          */

1538         Builder ssekmsKeyId(String ssekmsKeyId);
1539
1540         /**
1541          * <p>
1542          * Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3
1543          * Standard storage class objects.
1544          * </p>
1545          * <p>
1546          * For more information, see <a
1547          * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a>.
1548          * </p>
1549          * 
1550          * @param storageClass
1551          *        Provides storage class information of the object. Amazon S3 returns this header for all objects except
1552          *        for S3 Standard storage class objects.</p>
1553          *        <p>
1554          *        For more information, see <a
1555          *        href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a>.
1556          * @see StorageClass
1557          * @return Returns a reference to this object so that method calls can be chained together.
1558          * @see StorageClass
1559          */

1560         Builder storageClass(String storageClass);
1561
1562         /**
1563          * <p>
1564          * Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3
1565          * Standard storage class objects.
1566          * </p>
1567          * <p>
1568          * For more information, see <a
1569          * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a>.
1570          * </p>
1571          * 
1572          * @param storageClass
1573          *        Provides storage class information of the object. Amazon S3 returns this header for all objects except
1574          *        for S3 Standard storage class objects.</p>
1575          *        <p>
1576          *        For more information, see <a
1577          *        href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a>.
1578          * @see StorageClass
1579          * @return Returns a reference to this object so that method calls can be chained together.
1580          * @see StorageClass
1581          */

1582         Builder storageClass(StorageClass storageClass);
1583
1584         /**
1585          * Sets the value of the RequestCharged property for this object.
1586          *
1587          * @param requestCharged
1588          *        The new value for the RequestCharged property for this object.
1589          * @see RequestCharged
1590          * @return Returns a reference to this object so that method calls can be chained together.
1591          * @see RequestCharged
1592          */

1593         Builder requestCharged(String requestCharged);
1594
1595         /**
1596          * Sets the value of the RequestCharged property for this object.
1597          *
1598          * @param requestCharged
1599          *        The new value for the RequestCharged property for this object.
1600          * @see RequestCharged
1601          * @return Returns a reference to this object so that method calls can be chained together.
1602          * @see RequestCharged
1603          */

1604         Builder requestCharged(RequestCharged requestCharged);
1605
1606         /**
1607          * <p>
1608          * Amazon S3 can return this header if your request involves a bucket that is either a source or destination in
1609          * a replication rule.
1610          * </p>
1611          * <p>
1612          * In replication, you have a source bucket on which you configure replication and destination bucket where
1613          * Amazon S3 stores object replicas. When you request an object (<code>GetObject</code>) or object metadata (
1614          * <code>HeadObject</code>) from these buckets, Amazon S3 will return the <code>x-amz-replication-status</code>
1615          * header in the response as follows:
1616          * </p>
1617          * <ul>
1618          * <li>
1619          * <p>
1620          * If requesting an object from the source bucket â€” Amazon S3 will return the
1621          * <code>x-amz-replication-status</code> header if the object in your request is eligible for replication.
1622          * </p>
1623          * <p>
1624          * For example, suppose that in your replication configuration, you specify object prefix <code>TaxDocs</code>
1625          * requesting Amazon S3 to replicate objects with key prefix <code>TaxDocs</code>. Any objects you upload with
1626          * this key name prefix, for example <code>TaxDocs/document1.pdf</code>, are eligible for replication. For any
1627          * object request with this key name prefix, Amazon S3 will return the <code>x-amz-replication-status</code>
1628          * header with value PENDING, COMPLETED or FAILED indicating object replication status.
1629          * </p>
1630          * </li>
1631          * <li>
1632          * <p>
1633          * If requesting an object from the destination bucket â€” Amazon S3 will return the
1634          * <code>x-amz-replication-status</code> header with value REPLICA if the object in your request is a replica
1635          * that Amazon S3 created.
1636          * </p>
1637          * </li>
1638          * </ul>
1639          * <p>
1640          * For more information, see <a
1641          * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Replication</a>.
1642          * </p>
1643          * 
1644          * @param replicationStatus
1645          *        Amazon S3 can return this header if your request involves a bucket that is either a source or
1646          *        destination in a replication rule.</p>
1647          *        <p>
1648          *        In replication, you have a source bucket on which you configure replication and destination bucket
1649          *        where Amazon S3 stores object replicas. When you request an object (<code>GetObject</code>) or object
1650          *        metadata (<code>HeadObject</code>) from these buckets, Amazon S3 will return the
1651          *        <code>x-amz-replication-status</code> header in the response as follows:
1652          *        </p>
1653          *        <ul>
1654          *        <li>
1655          *        <p>
1656          *        If requesting an object from the source bucket â€” Amazon S3 will return the
1657          *        <code>x-amz-replication-status</code> header if the object in your request is eligible for
1658          *        replication.
1659          *        </p>
1660          *        <p>
1661          *        For example, suppose that in your replication configuration, you specify object prefix
1662          *        <code>TaxDocs</code> requesting Amazon S3 to replicate objects with key prefix <code>TaxDocs</code>.
1663          *        Any objects you upload with this key name prefix, for example <code>TaxDocs/document1.pdf</code>, are
1664          *        eligible for replication. For any object request with this key name prefix, Amazon S3 will return the
1665          *        <code>x-amz-replication-status</code> header with value PENDING, COMPLETED or FAILED indicating object
1666          *        replication status.
1667          *        </p>
1668          *        </li>
1669          *        <li>
1670          *        <p>
1671          *        If requesting an object from the destination bucket â€” Amazon S3 will return the
1672          *        <code>x-amz-replication-status</code> header with value REPLICA if the object in your request is a
1673          *        replica that Amazon S3 created.
1674          *        </p>
1675          *        </li>
1676          *        </ul>
1677          *        <p>
1678          *        For more information, see <a
1679          *        href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Replication</a>.
1680          * @see ReplicationStatus
1681          * @return Returns a reference to this object so that method calls can be chained together.
1682          * @see ReplicationStatus
1683          */

1684         Builder replicationStatus(String replicationStatus);
1685
1686         /**
1687          * <p>
1688          * Amazon S3 can return this header if your request involves a bucket that is either a source or destination in
1689          * a replication rule.
1690          * </p>
1691          * <p>
1692          * In replication, you have a source bucket on which you configure replication and destination bucket where
1693          * Amazon S3 stores object replicas. When you request an object (<code>GetObject</code>) or object metadata (
1694          * <code>HeadObject</code>) from these buckets, Amazon S3 will return the <code>x-amz-replication-status</code>
1695          * header in the response as follows:
1696          * </p>
1697          * <ul>
1698          * <li>
1699          * <p>
1700          * If requesting an object from the source bucket â€” Amazon S3 will return the
1701          * <code>x-amz-replication-status</code> header if the object in your request is eligible for replication.
1702          * </p>
1703          * <p>
1704          * For example, suppose that in your replication configuration, you specify object prefix <code>TaxDocs</code>
1705          * requesting Amazon S3 to replicate objects with key prefix <code>TaxDocs</code>. Any objects you upload with
1706          * this key name prefix, for example <code>TaxDocs/document1.pdf</code>, are eligible for replication. For any
1707          * object request with this key name prefix, Amazon S3 will return the <code>x-amz-replication-status</code>
1708          * header with value PENDING, COMPLETED or FAILED indicating object replication status.
1709          * </p>
1710          * </li>
1711          * <li>
1712          * <p>
1713          * If requesting an object from the destination bucket â€” Amazon S3 will return the
1714          * <code>x-amz-replication-status</code> header with value REPLICA if the object in your request is a replica
1715          * that Amazon S3 created.
1716          * </p>
1717          * </li>
1718          * </ul>
1719          * <p>
1720          * For more information, see <a
1721          * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Replication</a>.
1722          * </p>
1723          * 
1724          * @param replicationStatus
1725          *        Amazon S3 can return this header if your request involves a bucket that is either a source or
1726          *        destination in a replication rule.</p>
1727          *        <p>
1728          *        In replication, you have a source bucket on which you configure replication and destination bucket
1729          *        where Amazon S3 stores object replicas. When you request an object (<code>GetObject</code>) or object
1730          *        metadata (<code>HeadObject</code>) from these buckets, Amazon S3 will return the
1731          *        <code>x-amz-replication-status</code> header in the response as follows:
1732          *        </p>
1733          *        <ul>
1734          *        <li>
1735          *        <p>
1736          *        If requesting an object from the source bucket â€” Amazon S3 will return the
1737          *        <code>x-amz-replication-status</code> header if the object in your request is eligible for
1738          *        replication.
1739          *        </p>
1740          *        <p>
1741          *        For example, suppose that in your replication configuration, you specify object prefix
1742          *        <code>TaxDocs</code> requesting Amazon S3 to replicate objects with key prefix <code>TaxDocs</code>.
1743          *        Any objects you upload with this key name prefix, for example <code>TaxDocs/document1.pdf</code>, are
1744          *        eligible for replication. For any object request with this key name prefix, Amazon S3 will return the
1745          *        <code>x-amz-replication-status</code> header with value PENDING, COMPLETED or FAILED indicating object
1746          *        replication status.
1747          *        </p>
1748          *        </li>
1749          *        <li>
1750          *        <p>
1751          *        If requesting an object from the destination bucket â€” Amazon S3 will return the
1752          *        <code>x-amz-replication-status</code> header with value REPLICA if the object in your request is a
1753          *        replica that Amazon S3 created.
1754          *        </p>
1755          *        </li>
1756          *        </ul>
1757          *        <p>
1758          *        For more information, see <a
1759          *        href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Replication</a>.
1760          * @see ReplicationStatus
1761          * @return Returns a reference to this object so that method calls can be chained together.
1762          * @see ReplicationStatus
1763          */

1764         Builder replicationStatus(ReplicationStatus replicationStatus);
1765
1766         /**
1767          * <p>
1768          * The count of parts this object has.
1769          * </p>
1770          * 
1771          * @param partsCount
1772          *        The count of parts this object has.
1773          * @return Returns a reference to this object so that method calls can be chained together.
1774          */

1775         Builder partsCount(Integer partsCount);
1776
1777         /**
1778          * <p>
1779          * The Object Lock mode, if any, that's in effect for this object. This header is only returned if the requester
1780          * has the <code>s3:GetObjectRetention</code> permission. For more information about S3 Object Lock, see <a
1781          * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1782          * </p>
1783          * 
1784          * @param objectLockMode
1785          *        The Object Lock mode, if any, that's in effect for this object. This header is only returned if the
1786          *        requester has the <code>s3:GetObjectRetention</code> permission. For more information about S3 Object
1787          *        Lock, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1788          * @see ObjectLockMode
1789          * @return Returns a reference to this object so that method calls can be chained together.
1790          * @see ObjectLockMode
1791          */

1792         Builder objectLockMode(String objectLockMode);
1793
1794         /**
1795          * <p>
1796          * The Object Lock mode, if any, that's in effect for this object. This header is only returned if the requester
1797          * has the <code>s3:GetObjectRetention</code> permission. For more information about S3 Object Lock, see <a
1798          * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1799          * </p>
1800          * 
1801          * @param objectLockMode
1802          *        The Object Lock mode, if any, that's in effect for this object. This header is only returned if the
1803          *        requester has the <code>s3:GetObjectRetention</code> permission. For more information about S3 Object
1804          *        Lock, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1805          * @see ObjectLockMode
1806          * @return Returns a reference to this object so that method calls can be chained together.
1807          * @see ObjectLockMode
1808          */

1809         Builder objectLockMode(ObjectLockMode objectLockMode);
1810
1811         /**
1812          * <p>
1813          * The date and time when the Object Lock retention period expires. This header is only returned if the
1814          * requester has the <code>s3:GetObjectRetention</code> permission.
1815          * </p>
1816          * 
1817          * @param objectLockRetainUntilDate
1818          *        The date and time when the Object Lock retention period expires. This header is only returned if the
1819          *        requester has the <code>s3:GetObjectRetention</code> permission.
1820          * @return Returns a reference to this object so that method calls can be chained together.
1821          */

1822         Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate);
1823
1824         /**
1825          * <p>
1826          * Specifies whether a legal hold is in effect for this object. This header is only returned if the requester
1827          * has the <code>s3:GetObjectLegalHold</code> permission. This header is not returned if the specified version
1828          * of this object has never had a legal hold applied. For more information about S3 Object Lock, see <a
1829          * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1830          * </p>
1831          * 
1832          * @param objectLockLegalHoldStatus
1833          *        Specifies whether a legal hold is in effect for this object. This header is only returned if the
1834          *        requester has the <code>s3:GetObjectLegalHold</code> permission. This header is not returned if the
1835          *        specified version of this object has never had a legal hold applied. For more information about S3
1836          *        Object Lock, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object
1837          *        Lock</a>.
1838          * @see ObjectLockLegalHoldStatus
1839          * @return Returns a reference to this object so that method calls can be chained together.
1840          * @see ObjectLockLegalHoldStatus
1841          */

1842         Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus);
1843
1844         /**
1845          * <p>
1846          * Specifies whether a legal hold is in effect for this object. This header is only returned if the requester
1847          * has the <code>s3:GetObjectLegalHold</code> permission. This header is not returned if the specified version
1848          * of this object has never had a legal hold applied. For more information about S3 Object Lock, see <a
1849          * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object Lock</a>.
1850          * </p>
1851          * 
1852          * @param objectLockLegalHoldStatus
1853          *        Specifies whether a legal hold is in effect for this object. This header is only returned if the
1854          *        requester has the <code>s3:GetObjectLegalHold</code> permission. This header is not returned if the
1855          *        specified version of this object has never had a legal hold applied. For more information about S3
1856          *        Object Lock, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Object
1857          *        Lock</a>.
1858          * @see ObjectLockLegalHoldStatus
1859          * @return Returns a reference to this object so that method calls can be chained together.
1860          * @see ObjectLockLegalHoldStatus
1861          */

1862         Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus);
1863     }
1864
1865     static final class BuilderImpl extends S3Response.BuilderImpl implements Builder {
1866         private Boolean deleteMarker;
1867
1868         private String acceptRanges;
1869
1870         private String expiration;
1871
1872         private String restore;
1873
1874         private Instant lastModified;
1875
1876         private Long contentLength;
1877
1878         private String eTag;
1879
1880         private Integer missingMeta;
1881
1882         private String versionId;
1883
1884         private String cacheControl;
1885
1886         private String contentDisposition;
1887
1888         private String contentEncoding;
1889
1890         private String contentLanguage;
1891
1892         private String contentType;
1893
1894         private Instant expires;
1895
1896         private String websiteRedirectLocation;
1897
1898         private String serverSideEncryption;
1899
1900         private Map<String, String> metadata = DefaultSdkAutoConstructMap.getInstance();
1901
1902         private String sseCustomerAlgorithm;
1903
1904         private String sseCustomerKeyMD5;
1905
1906         private String ssekmsKeyId;
1907
1908         private String storageClass;
1909
1910         private String requestCharged;
1911
1912         private String replicationStatus;
1913
1914         private Integer partsCount;
1915
1916         private String objectLockMode;
1917
1918         private Instant objectLockRetainUntilDate;
1919
1920         private String objectLockLegalHoldStatus;
1921
1922         private BuilderImpl() {
1923         }
1924
1925         private BuilderImpl(HeadObjectResponse model) {
1926             super(model);
1927             deleteMarker(model.deleteMarker);
1928             acceptRanges(model.acceptRanges);
1929             expiration(model.expiration);
1930             restore(model.restore);
1931             lastModified(model.lastModified);
1932             contentLength(model.contentLength);
1933             eTag(model.eTag);
1934             missingMeta(model.missingMeta);
1935             versionId(model.versionId);
1936             cacheControl(model.cacheControl);
1937             contentDisposition(model.contentDisposition);
1938             contentEncoding(model.contentEncoding);
1939             contentLanguage(model.contentLanguage);
1940             contentType(model.contentType);
1941             expires(model.expires);
1942             websiteRedirectLocation(model.websiteRedirectLocation);
1943             serverSideEncryption(model.serverSideEncryption);
1944             metadata(model.metadata);
1945             sseCustomerAlgorithm(model.sseCustomerAlgorithm);
1946             sseCustomerKeyMD5(model.sseCustomerKeyMD5);
1947             ssekmsKeyId(model.ssekmsKeyId);
1948             storageClass(model.storageClass);
1949             requestCharged(model.requestCharged);
1950             replicationStatus(model.replicationStatus);
1951             partsCount(model.partsCount);
1952             objectLockMode(model.objectLockMode);
1953             objectLockRetainUntilDate(model.objectLockRetainUntilDate);
1954             objectLockLegalHoldStatus(model.objectLockLegalHoldStatus);
1955         }
1956
1957         public final Boolean getDeleteMarker() {
1958             return deleteMarker;
1959         }
1960
1961         @Override
1962         public final Builder deleteMarker(Boolean deleteMarker) {
1963             this.deleteMarker = deleteMarker;
1964             return this;
1965         }
1966
1967         public final void setDeleteMarker(Boolean deleteMarker) {
1968             this.deleteMarker = deleteMarker;
1969         }
1970
1971         public final String getAcceptRanges() {
1972             return acceptRanges;
1973         }
1974
1975         @Override
1976         public final Builder acceptRanges(String acceptRanges) {
1977             this.acceptRanges = acceptRanges;
1978             return this;
1979         }
1980
1981         public final void setAcceptRanges(String acceptRanges) {
1982             this.acceptRanges = acceptRanges;
1983         }
1984
1985         public final String getExpiration() {
1986             return expiration;
1987         }
1988
1989         @Override
1990         public final Builder expiration(String expiration) {
1991             this.expiration = expiration;
1992             return this;
1993         }
1994
1995         public final void setExpiration(String expiration) {
1996             this.expiration = expiration;
1997         }
1998
1999         public final String getRestore() {
2000             return restore;
2001         }
2002
2003         @Override
2004         public final Builder restore(String restore) {
2005             this.restore = restore;
2006             return this;
2007         }
2008
2009         public final void setRestore(String restore) {
2010             this.restore = restore;
2011         }
2012
2013         public final Instant getLastModified() {
2014             return lastModified;
2015         }
2016
2017         @Override
2018         public final Builder lastModified(Instant lastModified) {
2019             this.lastModified = lastModified;
2020             return this;
2021         }
2022
2023         public final void setLastModified(Instant lastModified) {
2024             this.lastModified = lastModified;
2025         }
2026
2027         public final Long getContentLength() {
2028             return contentLength;
2029         }
2030
2031         @Override
2032         public final Builder contentLength(Long contentLength) {
2033             this.contentLength = contentLength;
2034             return this;
2035         }
2036
2037         public final void setContentLength(Long contentLength) {
2038             this.contentLength = contentLength;
2039         }
2040
2041         public final String getETag() {
2042             return eTag;
2043         }
2044
2045         @Override
2046         public final Builder eTag(String eTag) {
2047             this.eTag = eTag;
2048             return this;
2049         }
2050
2051         public final void setETag(String eTag) {
2052             this.eTag = eTag;
2053         }
2054
2055         public final Integer getMissingMeta() {
2056             return missingMeta;
2057         }
2058
2059         @Override
2060         public final Builder missingMeta(Integer missingMeta) {
2061             this.missingMeta = missingMeta;
2062             return this;
2063         }
2064
2065         public final void setMissingMeta(Integer missingMeta) {
2066             this.missingMeta = missingMeta;
2067         }
2068
2069         public final String getVersionId() {
2070             return versionId;
2071         }
2072
2073         @Override
2074         public final Builder versionId(String versionId) {
2075             this.versionId = versionId;
2076             return this;
2077         }
2078
2079         public final void setVersionId(String versionId) {
2080             this.versionId = versionId;
2081         }
2082
2083         public final String getCacheControl() {
2084             return cacheControl;
2085         }
2086
2087         @Override
2088         public final Builder cacheControl(String cacheControl) {
2089             this.cacheControl = cacheControl;
2090             return this;
2091         }
2092
2093         public final void setCacheControl(String cacheControl) {
2094             this.cacheControl = cacheControl;
2095         }
2096
2097         public final String getContentDisposition() {
2098             return contentDisposition;
2099         }
2100
2101         @Override
2102         public final Builder contentDisposition(String contentDisposition) {
2103             this.contentDisposition = contentDisposition;
2104             return this;
2105         }
2106
2107         public final void setContentDisposition(String contentDisposition) {
2108             this.contentDisposition = contentDisposition;
2109         }
2110
2111         public final String getContentEncoding() {
2112             return contentEncoding;
2113         }
2114
2115         @Override
2116         public final Builder contentEncoding(String contentEncoding) {
2117             this.contentEncoding = contentEncoding;
2118             return this;
2119         }
2120
2121         public final void setContentEncoding(String contentEncoding) {
2122             this.contentEncoding = contentEncoding;
2123         }
2124
2125         public final String getContentLanguage() {
2126             return contentLanguage;
2127         }
2128
2129         @Override
2130         public final Builder contentLanguage(String contentLanguage) {
2131             this.contentLanguage = contentLanguage;
2132             return this;
2133         }
2134
2135         public final void setContentLanguage(String contentLanguage) {
2136             this.contentLanguage = contentLanguage;
2137         }
2138
2139         public final String getContentType() {
2140             return contentType;
2141         }
2142
2143         @Override
2144         public final Builder contentType(String contentType) {
2145             this.contentType = contentType;
2146             return this;
2147         }
2148
2149         public final void setContentType(String contentType) {
2150             this.contentType = contentType;
2151         }
2152
2153         public final Instant getExpires() {
2154             return expires;
2155         }
2156
2157         @Override
2158         public final Builder expires(Instant expires) {
2159             this.expires = expires;
2160             return this;
2161         }
2162
2163         public final void setExpires(Instant expires) {
2164             this.expires = expires;
2165         }
2166
2167         public final String getWebsiteRedirectLocation() {
2168             return websiteRedirectLocation;
2169         }
2170
2171         @Override
2172         public final Builder websiteRedirectLocation(String websiteRedirectLocation) {
2173             this.websiteRedirectLocation = websiteRedirectLocation;
2174             return this;
2175         }
2176
2177         public final void setWebsiteRedirectLocation(String websiteRedirectLocation) {
2178             this.websiteRedirectLocation = websiteRedirectLocation;
2179         }
2180
2181         public final String getServerSideEncryption() {
2182             return serverSideEncryption;
2183         }
2184
2185         @Override
2186         public final Builder serverSideEncryption(String serverSideEncryption) {
2187             this.serverSideEncryption = serverSideEncryption;
2188             return this;
2189         }
2190
2191         @Override
2192         public final Builder serverSideEncryption(ServerSideEncryption serverSideEncryption) {
2193             this.serverSideEncryption(serverSideEncryption == null ? null : serverSideEncryption.toString());
2194             return this;
2195         }
2196
2197         public final void setServerSideEncryption(String serverSideEncryption) {
2198             this.serverSideEncryption = serverSideEncryption;
2199         }
2200
2201         public final Map<String, String> getMetadata() {
2202             return metadata;
2203         }
2204
2205         @Override
2206         public final Builder metadata(Map<String, String> metadata) {
2207             this.metadata = MetadataCopier.copy(metadata);
2208             return this;
2209         }
2210
2211         public final void setMetadata(Map<String, String> metadata) {
2212             this.metadata = MetadataCopier.copy(metadata);
2213         }
2214
2215         public final String getSseCustomerAlgorithm() {
2216             return sseCustomerAlgorithm;
2217         }
2218
2219         @Override
2220         public final Builder sseCustomerAlgorithm(String sseCustomerAlgorithm) {
2221             this.sseCustomerAlgorithm = sseCustomerAlgorithm;
2222             return this;
2223         }
2224
2225         public final void setSseCustomerAlgorithm(String sseCustomerAlgorithm) {
2226             this.sseCustomerAlgorithm = sseCustomerAlgorithm;
2227         }
2228
2229         public final String getSseCustomerKeyMD5() {
2230             return sseCustomerKeyMD5;
2231         }
2232
2233         @Override
2234         public final Builder sseCustomerKeyMD5(String sseCustomerKeyMD5) {
2235             this.sseCustomerKeyMD5 = sseCustomerKeyMD5;
2236             return this;
2237         }
2238
2239         public final void setSseCustomerKeyMD5(String sseCustomerKeyMD5) {
2240             this.sseCustomerKeyMD5 = sseCustomerKeyMD5;
2241         }
2242
2243         public final String getSsekmsKeyId() {
2244             return ssekmsKeyId;
2245         }
2246
2247         @Override
2248         public final Builder ssekmsKeyId(String ssekmsKeyId) {
2249             this.ssekmsKeyId = ssekmsKeyId;
2250             return this;
2251         }
2252
2253         public final void setSsekmsKeyId(String ssekmsKeyId) {
2254             this.ssekmsKeyId = ssekmsKeyId;
2255         }
2256
2257         public final String getStorageClass() {
2258             return storageClass;
2259         }
2260
2261         @Override
2262         public final Builder storageClass(String storageClass) {
2263             this.storageClass = storageClass;
2264             return this;
2265         }
2266
2267         @Override
2268         public final Builder storageClass(StorageClass storageClass) {
2269             this.storageClass(storageClass == null ? null : storageClass.toString());
2270             return this;
2271         }
2272
2273         public final void setStorageClass(String storageClass) {
2274             this.storageClass = storageClass;
2275         }
2276
2277         public final String getRequestCharged() {
2278             return requestCharged;
2279         }
2280
2281         @Override
2282         public final Builder requestCharged(String requestCharged) {
2283             this.requestCharged = requestCharged;
2284             return this;
2285         }
2286
2287         @Override
2288         public final Builder requestCharged(RequestCharged requestCharged) {
2289             this.requestCharged(requestCharged == null ? null : requestCharged.toString());
2290             return this;
2291         }
2292
2293         public final void setRequestCharged(String requestCharged) {
2294             this.requestCharged = requestCharged;
2295         }
2296
2297         public final String getReplicationStatus() {
2298             return replicationStatus;
2299         }
2300
2301         @Override
2302         public final Builder replicationStatus(String replicationStatus) {
2303             this.replicationStatus = replicationStatus;
2304             return this;
2305         }
2306
2307         @Override
2308         public final Builder replicationStatus(ReplicationStatus replicationStatus) {
2309             this.replicationStatus(replicationStatus == null ? null : replicationStatus.toString());
2310             return this;
2311         }
2312
2313         public final void setReplicationStatus(String replicationStatus) {
2314             this.replicationStatus = replicationStatus;
2315         }
2316
2317         public final Integer getPartsCount() {
2318             return partsCount;
2319         }
2320
2321         @Override
2322         public final Builder partsCount(Integer partsCount) {
2323             this.partsCount = partsCount;
2324             return this;
2325         }
2326
2327         public final void setPartsCount(Integer partsCount) {
2328             this.partsCount = partsCount;
2329         }
2330
2331         public final String getObjectLockMode() {
2332             return objectLockMode;
2333         }
2334
2335         @Override
2336         public final Builder objectLockMode(String objectLockMode) {
2337             this.objectLockMode = objectLockMode;
2338             return this;
2339         }
2340
2341         @Override
2342         public final Builder objectLockMode(ObjectLockMode objectLockMode) {
2343             this.objectLockMode(objectLockMode == null ? null : objectLockMode.toString());
2344             return this;
2345         }
2346
2347         public final void setObjectLockMode(String objectLockMode) {
2348             this.objectLockMode = objectLockMode;
2349         }
2350
2351         public final Instant getObjectLockRetainUntilDate() {
2352             return objectLockRetainUntilDate;
2353         }
2354
2355         @Override
2356         public final Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate) {
2357             this.objectLockRetainUntilDate = objectLockRetainUntilDate;
2358             return this;
2359         }
2360
2361         public final void setObjectLockRetainUntilDate(Instant objectLockRetainUntilDate) {
2362             this.objectLockRetainUntilDate = objectLockRetainUntilDate;
2363         }
2364
2365         public final String getObjectLockLegalHoldStatus() {
2366             return objectLockLegalHoldStatus;
2367         }
2368
2369         @Override
2370         public final Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus) {
2371             this.objectLockLegalHoldStatus = objectLockLegalHoldStatus;
2372             return this;
2373         }
2374
2375         @Override
2376         public final Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus) {
2377             this.objectLockLegalHoldStatus(objectLockLegalHoldStatus == null ? null : objectLockLegalHoldStatus.toString());
2378             return this;
2379         }
2380
2381         public final void setObjectLockLegalHoldStatus(String objectLockLegalHoldStatus) {
2382             this.objectLockLegalHoldStatus = objectLockLegalHoldStatus;
2383         }
2384
2385         @Override
2386         public HeadObjectResponse build() {
2387             return new HeadObjectResponse(this);
2388         }
2389
2390         @Override
2391         public List<SdkField<?>> sdkFields() {
2392             return SDK_FIELDS;
2393         }
2394     }
2395 }
2396