software.amazon.awssdk.services.protocolrestxml.model.ExplicitPayloadAndHeadersException Maven / Gradle / Ivy
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.protocolrestxml.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.PayloadTrait;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExplicitPayloadAndHeadersException extends ProtocolRestXmlException implements
ToCopyableBuilder {
private static final SdkField STRING_HEADER_FIELD = SdkField
. builder(MarshallingType.STRING)
.getter(getter(ExplicitPayloadAndHeadersException::stringHeader))
.setter(setter(Builder::stringHeader))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-string")
.unmarshallLocationName("x-amz-string").build()).build();
private static final SdkField INTEGER_HEADER_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.getter(getter(ExplicitPayloadAndHeadersException::integerHeader))
.setter(setter(Builder::integerHeader))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-integer")
.unmarshallLocationName("x-amz-integer").build()).build();
private static final SdkField LONG_HEADER_FIELD = SdkField
. builder(MarshallingType.LONG)
.getter(getter(ExplicitPayloadAndHeadersException::longHeader))
.setter(setter(Builder::longHeader))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-long")
.unmarshallLocationName("x-amz-long").build()).build();
private static final SdkField DOUBLE_HEADER_FIELD = SdkField
. builder(MarshallingType.DOUBLE)
.getter(getter(ExplicitPayloadAndHeadersException::doubleHeader))
.setter(setter(Builder::doubleHeader))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-double")
.unmarshallLocationName("x-amz-double").build()).build();
private static final SdkField FLOAT_HEADER_FIELD = SdkField
. builder(MarshallingType.FLOAT)
.getter(getter(ExplicitPayloadAndHeadersException::floatHeader))
.setter(setter(Builder::floatHeader))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-float")
.unmarshallLocationName("x-amz-float").build()).build();
private static final SdkField TIMESTAMP_HEADER_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.getter(getter(ExplicitPayloadAndHeadersException::timestampHeader))
.setter(setter(Builder::timestampHeader))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-timestamp")
.unmarshallLocationName("x-amz-timestamp").build()).build();
private static final SdkField BOOLEAN_HEADER_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.getter(getter(ExplicitPayloadAndHeadersException::booleanHeader))
.setter(setter(Builder::booleanHeader))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-boolean")
.unmarshallLocationName("x-amz-boolean").build()).build();
private static final SdkField PAYLOAD_MEMBER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(ExplicitPayloadAndHeadersException::payloadMember))
.setter(setter(Builder::payloadMember))
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PayloadMember")
.unmarshallLocationName("PayloadMember").build(), PayloadTrait.create()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_HEADER_FIELD,
INTEGER_HEADER_FIELD, LONG_HEADER_FIELD, DOUBLE_HEADER_FIELD, FLOAT_HEADER_FIELD, TIMESTAMP_HEADER_FIELD,
BOOLEAN_HEADER_FIELD, PAYLOAD_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final String stringHeader;
private final Integer integerHeader;
private final Long longHeader;
private final Double doubleHeader;
private final Float floatHeader;
private final Instant timestampHeader;
private final Boolean booleanHeader;
private final SimpleStruct payloadMember;
private ExplicitPayloadAndHeadersException(BuilderImpl builder) {
super(builder);
this.stringHeader = builder.stringHeader;
this.integerHeader = builder.integerHeader;
this.longHeader = builder.longHeader;
this.doubleHeader = builder.doubleHeader;
this.floatHeader = builder.floatHeader;
this.timestampHeader = builder.timestampHeader;
this.booleanHeader = builder.booleanHeader;
this.payloadMember = builder.payloadMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
/**
* Returns the value of the StringHeader property for this object.
*
* @return The value of the StringHeader property for this object.
*/
public String stringHeader() {
return stringHeader;
}
/**
* Returns the value of the IntegerHeader property for this object.
*
* @return The value of the IntegerHeader property for this object.
*/
public Integer integerHeader() {
return integerHeader;
}
/**
* Returns the value of the LongHeader property for this object.
*
* @return The value of the LongHeader property for this object.
*/
public Long longHeader() {
return longHeader;
}
/**
* Returns the value of the DoubleHeader property for this object.
*
* @return The value of the DoubleHeader property for this object.
*/
public Double doubleHeader() {
return doubleHeader;
}
/**
* Returns the value of the FloatHeader property for this object.
*
* @return The value of the FloatHeader property for this object.
*/
public Float floatHeader() {
return floatHeader;
}
/**
* Returns the value of the TimestampHeader property for this object.
*
* @return The value of the TimestampHeader property for this object.
*/
public Instant timestampHeader() {
return timestampHeader;
}
/**
* Returns the value of the BooleanHeader property for this object.
*
* @return The value of the BooleanHeader property for this object.
*/
public Boolean booleanHeader() {
return booleanHeader;
}
/**
* Returns the value of the PayloadMember property for this object.
*
* @return The value of the PayloadMember property for this object.
*/
public SimpleStruct payloadMember() {
return payloadMember;
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function