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.util.Arrays;
17 import java.util.Collections;
18 import java.util.List;
19 import java.util.Objects;
20 import java.util.Optional;
21 import java.util.function.BiConsumer;
22 import java.util.function.Function;
23 import software.amazon.awssdk.annotations.Generated;
24 import software.amazon.awssdk.core.SdkField;
25 import software.amazon.awssdk.core.SdkPojo;
26 import software.amazon.awssdk.core.protocol.MarshallLocation;
27 import software.amazon.awssdk.core.protocol.MarshallingType;
28 import software.amazon.awssdk.core.traits.LocationTrait;
29 import software.amazon.awssdk.utils.ToString;
30 import software.amazon.awssdk.utils.builder.CopyableBuilder;
31 import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
32
33 /**
34  */

35 @Generated("software.amazon.awssdk:codegen")
36 public final class PutObjectResponse extends S3Response implements
37         ToCopyableBuilder<PutObjectResponse.Builder, PutObjectResponse> {
38     private static final SdkField<String> EXPIRATION_FIELD = SdkField
39             .<String> builder(MarshallingType.STRING)
40             .getter(getter(PutObjectResponse::expiration))
41             .setter(setter(Builder::expiration))
42             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-expiration")
43                     .unmarshallLocationName("x-amz-expiration").build()).build();
44
45     private static final SdkField<String> E_TAG_FIELD = SdkField
46             .<String> builder(MarshallingType.STRING)
47             .getter(getter(PutObjectResponse::eTag))
48             .setter(setter(Builder::eTag))
49             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("ETag").unmarshallLocationName("ETag")
50                     .build()).build();
51
52     private static final SdkField<String> SERVER_SIDE_ENCRYPTION_FIELD = SdkField
53             .<String> builder(MarshallingType.STRING)
54             .getter(getter(PutObjectResponse::serverSideEncryptionAsString))
55             .setter(setter(Builder::serverSideEncryption))
56             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-server-side-encryption")
57                     .unmarshallLocationName("x-amz-server-side-encryption").build()).build();
58
59     private static final SdkField<String> VERSION_ID_FIELD = SdkField
60             .<String> builder(MarshallingType.STRING)
61             .getter(getter(PutObjectResponse::versionId))
62             .setter(setter(Builder::versionId))
63             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-version-id")
64                     .unmarshallLocationName("x-amz-version-id").build()).build();
65
66     private static final SdkField<String> SSE_CUSTOMER_ALGORITHM_FIELD = SdkField
67             .<String> builder(MarshallingType.STRING)
68             .getter(getter(PutObjectResponse::sseCustomerAlgorithm))
69             .setter(setter(Builder::sseCustomerAlgorithm))
70             .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
71                     .locationName("x-amz-server-side-encryption-customer-algorithm")
72                     .unmarshallLocationName("x-amz-server-side-encryption-customer-algorithm").build()).build();
73
74     private static final SdkField<String> SSE_CUSTOMER_KEY_MD5_FIELD = SdkField
75             .<String> builder(MarshallingType.STRING)
76             .getter(getter(PutObjectResponse::sseCustomerKeyMD5))
77             .setter(setter(Builder::sseCustomerKeyMD5))
78             .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
79                     .locationName("x-amz-server-side-encryption-customer-key-MD5")
80                     .unmarshallLocationName("x-amz-server-side-encryption-customer-key-MD5").build()).build();
81
82     private static final SdkField<String> SSEKMS_KEY_ID_FIELD = SdkField
83             .<String> builder(MarshallingType.STRING)
84             .getter(getter(PutObjectResponse::ssekmsKeyId))
85             .setter(setter(Builder::ssekmsKeyId))
86             .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
87                     .locationName("x-amz-server-side-encryption-aws-kms-key-id")
88                     .unmarshallLocationName("x-amz-server-side-encryption-aws-kms-key-id").build()).build();
89
90     private static final SdkField<String> SSEKMS_ENCRYPTION_CONTEXT_FIELD = SdkField
91             .<String> builder(MarshallingType.STRING)
92             .getter(getter(PutObjectResponse::ssekmsEncryptionContext))
93             .setter(setter(Builder::ssekmsEncryptionContext))
94             .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
95                     .locationName("x-amz-server-side-encryption-context")
96                     .unmarshallLocationName("x-amz-server-side-encryption-context").build()).build();
97
98     private static final SdkField<String> REQUEST_CHARGED_FIELD = SdkField
99             .<String> builder(MarshallingType.STRING)
100             .getter(getter(PutObjectResponse::requestChargedAsString))
101             .setter(setter(Builder::requestCharged))
102             .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-request-charged")
103                     .unmarshallLocationName("x-amz-request-charged").build()).build();
104
105     private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EXPIRATION_FIELD, E_TAG_FIELD,
106             SERVER_SIDE_ENCRYPTION_FIELD, VERSION_ID_FIELD, SSE_CUSTOMER_ALGORITHM_FIELD, SSE_CUSTOMER_KEY_MD5_FIELD,
107             SSEKMS_KEY_ID_FIELD, SSEKMS_ENCRYPTION_CONTEXT_FIELD, REQUEST_CHARGED_FIELD));
108
109     private final String expiration;
110
111     private final String eTag;
112
113     private final String serverSideEncryption;
114
115     private final String versionId;
116
117     private final String sseCustomerAlgorithm;
118
119     private final String sseCustomerKeyMD5;
120
121     private final String ssekmsKeyId;
122
123     private final String ssekmsEncryptionContext;
124
125     private final String requestCharged;
126
127     private PutObjectResponse(BuilderImpl builder) {
128         super(builder);
129         this.expiration = builder.expiration;
130         this.eTag = builder.eTag;
131         this.serverSideEncryption = builder.serverSideEncryption;
132         this.versionId = builder.versionId;
133         this.sseCustomerAlgorithm = builder.sseCustomerAlgorithm;
134         this.sseCustomerKeyMD5 = builder.sseCustomerKeyMD5;
135         this.ssekmsKeyId = builder.ssekmsKeyId;
136         this.ssekmsEncryptionContext = builder.ssekmsEncryptionContext;
137         this.requestCharged = builder.requestCharged;
138     }
139
140     /**
141      * <p>
142      * If the expiration is configured for the object (see <a>PutBucketLifecycleConfiguration</a>), the response
143      * includes this header. It includes the expiry-date and rule-id key-value pairs that provide information about
144      * object expiration. The value of the rule-id is URL encoded.
145      * </p>
146      * 
147      * @return If the expiration is configured for the object (see <a>PutBucketLifecycleConfiguration</a>), the response
148      *         includes this header. It includes the expiry-date and rule-id key-value pairs that provide information
149      *         about object expiration. The value of the rule-id is URL encoded.
150      */

151     public String expiration() {
152         return expiration;
153     }
154
155     /**
156      * <p>
157      * Entity tag for the uploaded object.
158      * </p>
159      * 
160      * @return Entity tag for the uploaded object.
161      */

162     public String eTag() {
163         return eTag;
164     }
165
166     /**
167      * <p>
168      * If you specified server-side encryption either with an AWS KMS customer master key (CMK) or Amazon S3-managed
169      * encryption key in your PUT request, the response includes this header. It confirms the encryption algorithm that
170      * Amazon S3 used to encrypt the object.
171      * </p>
172      * <p>
173      * If the service returns an enum value that is not available in the current SDK version,
174      * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value
175      * returned by the service is available from {@link #serverSideEncryptionAsString}.
176      * </p>
177      * 
178      * @return If you specified server-side encryption either with an AWS KMS customer master key (CMK) or Amazon
179      *         S3-managed encryption key in your PUT request, the response includes this header. It confirms the
180      *         encryption algorithm that Amazon S3 used to encrypt the object.
181      * @see ServerSideEncryption
182      */

183     public ServerSideEncryption serverSideEncryption() {
184         return ServerSideEncryption.fromValue(serverSideEncryption);
185     }
186
187     /**
188      * <p>
189      * If you specified server-side encryption either with an AWS KMS customer master key (CMK) or Amazon S3-managed
190      * encryption key in your PUT request, the response includes this header. It confirms the encryption algorithm that
191      * Amazon S3 used to encrypt the object.
192      * </p>
193      * <p>
194      * If the service returns an enum value that is not available in the current SDK version,
195      * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value
196      * returned by the service is available from {@link #serverSideEncryptionAsString}.
197      * </p>
198      * 
199      * @return If you specified server-side encryption either with an AWS KMS customer master key (CMK) or Amazon
200      *         S3-managed encryption key in your PUT request, the response includes this header. It confirms the
201      *         encryption algorithm that Amazon S3 used to encrypt the object.
202      * @see ServerSideEncryption
203      */

204     public String serverSideEncryptionAsString() {
205         return serverSideEncryption;
206     }
207
208     /**
209      * <p>
210      * Version of the object.
211      * </p>
212      * 
213      * @return Version of the object.
214      */

215     public String versionId() {
216         return versionId;
217     }
218
219     /**
220      * <p>
221      * If server-side encryption with a customer-provided encryption key was requested, the response will include this
222      * header confirming the encryption algorithm used.
223      * </p>
224      * 
225      * @return If server-side encryption with a customer-provided encryption key was requested, the response will
226      *         include this header confirming the encryption algorithm used.
227      */

228     public String sseCustomerAlgorithm() {
229         return sseCustomerAlgorithm;
230     }
231
232     /**
233      * <p>
234      * If server-side encryption with a customer-provided encryption key was requested, the response will include this
235      * header to provide round-trip message integrity verification of the customer-provided encryption key.
236      * </p>
237      * 
238      * @return If server-side encryption with a customer-provided encryption key was requested, the response will
239      *         include this header to provide round-trip message integrity verification of the customer-provided
240      *         encryption key.
241      */

242     public String sseCustomerKeyMD5() {
243         return sseCustomerKeyMD5;
244     }
245
246     /**
247      * <p>
248      * If <code>x-amz-server-side-encryption</code> is present and has the value of <code>aws:kms</code>, this header
249      * specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed customer master key (CMK)
250      * that was used for the object.
251      * </p>
252      * 
253      * @return If <code>x-amz-server-side-encryption</code> is present and has the value of <code>aws:kms</code>, this
254      *         header specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed customer
255      *         master key (CMK) that was used for the object.
256      */

257     public String ssekmsKeyId() {
258         return ssekmsKeyId;
259     }
260
261     /**
262      * <p>
263      * If present, specifies the AWS KMS Encryption Context to use for object encryption. The value of this header is a
264      * base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
265      * </p>
266      * 
267      * @return If present, specifies the AWS KMS Encryption Context to use for object encryption. The value of this
268      *         header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
269      */

270     public String ssekmsEncryptionContext() {
271         return ssekmsEncryptionContext;
272     }
273
274     /**
275      * Returns the value of the RequestCharged property for this object.
276      * <p>
277      * If the service returns an enum value that is not available in the current SDK version, {@link #requestCharged}
278      * will return {@link RequestCharged#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
279      * from {@link #requestChargedAsString}.
280      * </p>
281      * 
282      * @return The value of the RequestCharged property for this object.
283      * @see RequestCharged
284      */

285     public RequestCharged requestCharged() {
286         return RequestCharged.fromValue(requestCharged);
287     }
288
289     /**
290      * Returns the value of the RequestCharged property for this object.
291      * <p>
292      * If the service returns an enum value that is not available in the current SDK version, {@link #requestCharged}
293      * will return {@link RequestCharged#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
294      * from {@link #requestChargedAsString}.
295      * </p>
296      * 
297      * @return The value of the RequestCharged property for this object.
298      * @see RequestCharged
299      */

300     public String requestChargedAsString() {
301         return requestCharged;
302     }
303
304     @Override
305     public Builder toBuilder() {
306         return new BuilderImpl(this);
307     }
308
309     public static Builder builder() {
310         return new BuilderImpl();
311     }
312
313     public static Class<? extends Builder> serializableBuilderClass() {
314         return BuilderImpl.class;
315     }
316
317     @Override
318     public int hashCode() {
319         int hashCode = 1;
320         hashCode = 31 * hashCode + super.hashCode();
321         hashCode = 31 * hashCode + Objects.hashCode(expiration());
322         hashCode = 31 * hashCode + Objects.hashCode(eTag());
323         hashCode = 31 * hashCode + Objects.hashCode(serverSideEncryptionAsString());
324         hashCode = 31 * hashCode + Objects.hashCode(versionId());
325         hashCode = 31 * hashCode + Objects.hashCode(sseCustomerAlgorithm());
326         hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKeyMD5());
327         hashCode = 31 * hashCode + Objects.hashCode(ssekmsKeyId());
328         hashCode = 31 * hashCode + Objects.hashCode(ssekmsEncryptionContext());
329         hashCode = 31 * hashCode + Objects.hashCode(requestChargedAsString());
330         return hashCode;
331     }
332
333     @Override
334     public boolean equals(Object obj) {
335         return super.equals(obj) && equalsBySdkFields(obj);
336     }
337
338     @Override
339     public boolean equalsBySdkFields(Object obj) {
340         if (this == obj) {
341             return true;
342         }
343         if (obj == null) {
344             return false;
345         }
346         if (!(obj instanceof PutObjectResponse)) {
347             return false;
348         }
349         PutObjectResponse other = (PutObjectResponse) obj;
350         return Objects.equals(expiration(), other.expiration()) && Objects.equals(eTag(), other.eTag())
351                 && Objects.equals(serverSideEncryptionAsString(), other.serverSideEncryptionAsString())
352                 && Objects.equals(versionId(), other.versionId())
353                 && Objects.equals(sseCustomerAlgorithm(), other.sseCustomerAlgorithm())
354                 && Objects.equals(sseCustomerKeyMD5(), other.sseCustomerKeyMD5())
355                 && Objects.equals(ssekmsKeyId(), other.ssekmsKeyId())
356                 && Objects.equals(ssekmsEncryptionContext(), other.ssekmsEncryptionContext())
357                 && Objects.equals(requestChargedAsString(), other.requestChargedAsString());
358     }
359
360     /**
361      * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
362      * redacted from this string using a placeholder value.
363      */

364     @Override
365     public String toString() {
366         return ToString.builder("PutObjectResponse").add("Expiration", expiration()).add("ETag", eTag())
367                 .add("ServerSideEncryption", serverSideEncryptionAsString()).add("VersionId", versionId())
368                 .add("SSECustomerAlgorithm", sseCustomerAlgorithm()).add("SSECustomerKeyMD5", sseCustomerKeyMD5())
369                 .add("SSEKMSKeyId", ssekmsKeyId() == null ? null : "*** Sensitive Data Redacted ***")
370                 .add("SSEKMSEncryptionContext", ssekmsEncryptionContext() == null ? null : "*** Sensitive Data Redacted ***")
371                 .add("RequestCharged", requestChargedAsString()).build();
372     }
373
374     public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
375         switch (fieldName) {
376         case "Expiration":
377             return Optional.ofNullable(clazz.cast(expiration()));
378         case "ETag":
379             return Optional.ofNullable(clazz.cast(eTag()));
380         case "ServerSideEncryption":
381             return Optional.ofNullable(clazz.cast(serverSideEncryptionAsString()));
382         case "VersionId":
383             return Optional.ofNullable(clazz.cast(versionId()));
384         case "SSECustomerAlgorithm":
385             return Optional.ofNullable(clazz.cast(sseCustomerAlgorithm()));
386         case "SSECustomerKeyMD5":
387             return Optional.ofNullable(clazz.cast(sseCustomerKeyMD5()));
388         case "SSEKMSKeyId":
389             return Optional.ofNullable(clazz.cast(ssekmsKeyId()));
390         case "SSEKMSEncryptionContext":
391             return Optional.ofNullable(clazz.cast(ssekmsEncryptionContext()));
392         case "RequestCharged":
393             return Optional.ofNullable(clazz.cast(requestChargedAsString()));
394         default:
395             return Optional.empty();
396         }
397     }
398
399     @Override
400     public List<SdkField<?>> sdkFields() {
401         return SDK_FIELDS;
402     }
403
404     private static <T> Function<Object, T> getter(Function<PutObjectResponse, T> g) {
405         return obj -> g.apply((PutObjectResponse) obj);
406     }
407
408     private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
409         return (obj, val) -> s.accept((Builder) obj, val);
410     }
411
412     public interface Builder extends S3Response.Builder, SdkPojo, CopyableBuilder<Builder, PutObjectResponse> {
413         /**
414          * <p>
415          * If the expiration is configured for the object (see <a>PutBucketLifecycleConfiguration</a>), the response
416          * includes this header. It includes the expiry-date and rule-id key-value pairs that provide information about
417          * object expiration. The value of the rule-id is URL encoded.
418          * </p>
419          * 
420          * @param expiration
421          *        If the expiration is configured for the object (see <a>PutBucketLifecycleConfiguration</a>), the
422          *        response includes this header. It includes the expiry-date and rule-id key-value pairs that provide
423          *        information about object expiration. The value of the rule-id is URL encoded.
424          * @return Returns a reference to this object so that method calls can be chained together.
425          */

426         Builder expiration(String expiration);
427
428         /**
429          * <p>
430          * Entity tag for the uploaded object.
431          * </p>
432          * 
433          * @param eTag
434          *        Entity tag for the uploaded object.
435          * @return Returns a reference to this object so that method calls can be chained together.
436          */

437         Builder eTag(String eTag);
438
439         /**
440          * <p>
441          * If you specified server-side encryption either with an AWS KMS customer master key (CMK) or Amazon S3-managed
442          * encryption key in your PUT request, the response includes this header. It confirms the encryption algorithm
443          * that Amazon S3 used to encrypt the object.
444          * </p>
445          * 
446          * @param serverSideEncryption
447          *        If you specified server-side encryption either with an AWS KMS customer master key (CMK) or Amazon
448          *        S3-managed encryption key in your PUT request, the response includes this header. It confirms the
449          *        encryption algorithm that Amazon S3 used to encrypt the object.
450          * @see ServerSideEncryption
451          * @return Returns a reference to this object so that method calls can be chained together.
452          * @see ServerSideEncryption
453          */

454         Builder serverSideEncryption(String serverSideEncryption);
455
456         /**
457          * <p>
458          * If you specified server-side encryption either with an AWS KMS customer master key (CMK) or Amazon S3-managed
459          * encryption key in your PUT request, the response includes this header. It confirms the encryption algorithm
460          * that Amazon S3 used to encrypt the object.
461          * </p>
462          * 
463          * @param serverSideEncryption
464          *        If you specified server-side encryption either with an AWS KMS customer master key (CMK) or Amazon
465          *        S3-managed encryption key in your PUT request, the response includes this header. It confirms the
466          *        encryption algorithm that Amazon S3 used to encrypt the object.
467          * @see ServerSideEncryption
468          * @return Returns a reference to this object so that method calls can be chained together.
469          * @see ServerSideEncryption
470          */

471         Builder serverSideEncryption(ServerSideEncryption serverSideEncryption);
472
473         /**
474          * <p>
475          * Version of the object.
476          * </p>
477          * 
478          * @param versionId
479          *        Version of the object.
480          * @return Returns a reference to this object so that method calls can be chained together.
481          */

482         Builder versionId(String versionId);
483
484         /**
485          * <p>
486          * If server-side encryption with a customer-provided encryption key was requested, the response will include
487          * this header confirming the encryption algorithm used.
488          * </p>
489          * 
490          * @param sseCustomerAlgorithm
491          *        If server-side encryption with a customer-provided encryption key was requested, the response will
492          *        include this header confirming the encryption algorithm used.
493          * @return Returns a reference to this object so that method calls can be chained together.
494          */

495         Builder sseCustomerAlgorithm(String sseCustomerAlgorithm);
496
497         /**
498          * <p>
499          * If server-side encryption with a customer-provided encryption key was requested, the response will include
500          * this header to provide round-trip message integrity verification of the customer-provided encryption key.
501          * </p>
502          * 
503          * @param sseCustomerKeyMD5
504          *        If server-side encryption with a customer-provided encryption key was requested, the response will
505          *        include this header to provide round-trip message integrity verification of the customer-provided
506          *        encryption key.
507          * @return Returns a reference to this object so that method calls can be chained together.
508          */

509         Builder sseCustomerKeyMD5(String sseCustomerKeyMD5);
510
511         /**
512          * <p>
513          * If <code>x-amz-server-side-encryption</code> is present and has the value of <code>aws:kms</code>, this
514          * header specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed customer
515          * master key (CMK) that was used for the object.
516          * </p>
517          * 
518          * @param ssekmsKeyId
519          *        If <code>x-amz-server-side-encryption</code> is present and has the value of <code>aws:kms</code>,
520          *        this header specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer managed
521          *        customer master key (CMK) that was used for the object.
522          * @return Returns a reference to this object so that method calls can be chained together.
523          */

524         Builder ssekmsKeyId(String ssekmsKeyId);
525
526         /**
527          * <p>
528          * If present, specifies the AWS KMS Encryption Context to use for object encryption. The value of this header
529          * is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
530          * </p>
531          * 
532          * @param ssekmsEncryptionContext
533          *        If present, specifies the AWS KMS Encryption Context to use for object encryption. The value of this
534          *        header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
535          * @return Returns a reference to this object so that method calls can be chained together.
536          */

537         Builder ssekmsEncryptionContext(String ssekmsEncryptionContext);
538
539         /**
540          * Sets the value of the RequestCharged property for this object.
541          *
542          * @param requestCharged
543          *        The new value for the RequestCharged property for this object.
544          * @see RequestCharged
545          * @return Returns a reference to this object so that method calls can be chained together.
546          * @see RequestCharged
547          */

548         Builder requestCharged(String requestCharged);
549
550         /**
551          * Sets the value of the RequestCharged property for this object.
552          *
553          * @param requestCharged
554          *        The new value for the RequestCharged property for this object.
555          * @see RequestCharged
556          * @return Returns a reference to this object so that method calls can be chained together.
557          * @see RequestCharged
558          */

559         Builder requestCharged(RequestCharged requestCharged);
560     }
561
562     static final class BuilderImpl extends S3Response.BuilderImpl implements Builder {
563         private String expiration;
564
565         private String eTag;
566
567         private String serverSideEncryption;
568
569         private String versionId;
570
571         private String sseCustomerAlgorithm;
572
573         private String sseCustomerKeyMD5;
574
575         private String ssekmsKeyId;
576
577         private String ssekmsEncryptionContext;
578
579         private String requestCharged;
580
581         private BuilderImpl() {
582         }
583
584         private BuilderImpl(PutObjectResponse model) {
585             super(model);
586             expiration(model.expiration);
587             eTag(model.eTag);
588             serverSideEncryption(model.serverSideEncryption);
589             versionId(model.versionId);
590             sseCustomerAlgorithm(model.sseCustomerAlgorithm);
591             sseCustomerKeyMD5(model.sseCustomerKeyMD5);
592             ssekmsKeyId(model.ssekmsKeyId);
593             ssekmsEncryptionContext(model.ssekmsEncryptionContext);
594             requestCharged(model.requestCharged);
595         }
596
597         public final String getExpiration() {
598             return expiration;
599         }
600
601         @Override
602         public final Builder expiration(String expiration) {
603             this.expiration = expiration;
604             return this;
605         }
606
607         public final void setExpiration(String expiration) {
608             this.expiration = expiration;
609         }
610
611         public final String getETag() {
612             return eTag;
613         }
614
615         @Override
616         public final Builder eTag(String eTag) {
617             this.eTag = eTag;
618             return this;
619         }
620
621         public final void setETag(String eTag) {
622             this.eTag = eTag;
623         }
624
625         public final String getServerSideEncryption() {
626             return serverSideEncryption;
627         }
628
629         @Override
630         public final Builder serverSideEncryption(String serverSideEncryption) {
631             this.serverSideEncryption = serverSideEncryption;
632             return this;
633         }
634
635         @Override
636         public final Builder serverSideEncryption(ServerSideEncryption serverSideEncryption) {
637             this.serverSideEncryption(serverSideEncryption == null ? null : serverSideEncryption.toString());
638             return this;
639         }
640
641         public final void setServerSideEncryption(String serverSideEncryption) {
642             this.serverSideEncryption = serverSideEncryption;
643         }
644
645         public final String getVersionId() {
646             return versionId;
647         }
648
649         @Override
650         public final Builder versionId(String versionId) {
651             this.versionId = versionId;
652             return this;
653         }
654
655         public final void setVersionId(String versionId) {
656             this.versionId = versionId;
657         }
658
659         public final String getSseCustomerAlgorithm() {
660             return sseCustomerAlgorithm;
661         }
662
663         @Override
664         public final Builder sseCustomerAlgorithm(String sseCustomerAlgorithm) {
665             this.sseCustomerAlgorithm = sseCustomerAlgorithm;
666             return this;
667         }
668
669         public final void setSseCustomerAlgorithm(String sseCustomerAlgorithm) {
670             this.sseCustomerAlgorithm = sseCustomerAlgorithm;
671         }
672
673         public final String getSseCustomerKeyMD5() {
674             return sseCustomerKeyMD5;
675         }
676
677         @Override
678         public final Builder sseCustomerKeyMD5(String sseCustomerKeyMD5) {
679             this.sseCustomerKeyMD5 = sseCustomerKeyMD5;
680             return this;
681         }
682
683         public final void setSseCustomerKeyMD5(String sseCustomerKeyMD5) {
684             this.sseCustomerKeyMD5 = sseCustomerKeyMD5;
685         }
686
687         public final String getSsekmsKeyId() {
688             return ssekmsKeyId;
689         }
690
691         @Override
692         public final Builder ssekmsKeyId(String ssekmsKeyId) {
693             this.ssekmsKeyId = ssekmsKeyId;
694             return this;
695         }
696
697         public final void setSsekmsKeyId(String ssekmsKeyId) {
698             this.ssekmsKeyId = ssekmsKeyId;
699         }
700
701         public final String getSsekmsEncryptionContext() {
702             return ssekmsEncryptionContext;
703         }
704
705         @Override
706         public final Builder ssekmsEncryptionContext(String ssekmsEncryptionContext) {
707             this.ssekmsEncryptionContext = ssekmsEncryptionContext;
708             return this;
709         }
710
711         public final void setSsekmsEncryptionContext(String ssekmsEncryptionContext) {
712             this.ssekmsEncryptionContext = ssekmsEncryptionContext;
713         }
714
715         public final String getRequestCharged() {
716             return requestCharged;
717         }
718
719         @Override
720         public final Builder requestCharged(String requestCharged) {
721             this.requestCharged = requestCharged;
722             return this;
723         }
724
725         @Override
726         public final Builder requestCharged(RequestCharged requestCharged) {
727             this.requestCharged(requestCharged == null ? null : requestCharged.toString());
728             return this;
729         }
730
731         public final void setRequestCharged(String requestCharged) {
732             this.requestCharged = requestCharged;
733         }
734
735         @Override
736         public PutObjectResponse build() {
737             return new PutObjectResponse(this);
738         }
739
740         @Override
741         public List<SdkField<?>> sdkFields() {
742             return SDK_FIELDS;
743         }
744     }
745 }
746